code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class _FullPaths(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> if isinstance(values, (list, tuple)): <NEW_LINE> <INDENT> vals = [os.path.abspath(os.path.expanduser(val)) for val in values] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> vals =... | Parent class for various file type and file path handling classes.
Expands out given paths to their full absolute paths. This class should not be
called directly. It is the base class for the various different file handling
methods. | 62599066cb5e8a47e493cd31 |
class BlockComponent(components.TokenComponent): <NEW_LINE> <INDENT> RE = re.compile('(?P<inline>.*)') <NEW_LINE> def __call__(self, info, parent): <NEW_LINE> <INDENT> return tokens.Token(parent) | Class for testing MarkdownReader | 625990663d592f4c4edbc637 |
class UserInfo(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User) <NEW_LINE> class Meta(object): <NEW_LINE> <INDENT> verbose_name = u"User Information" <NEW_LINE> verbose_name_plural = u"Users Informations" <NEW_LINE> <DEDENT> hashes = models.TextField( blank=True, verbose_name=u"Hashes") <NEW_LINE> u... | To keep extra user data | 62599066627d3e7fe0e085e4 |
class StaticWebsite(Model): <NEW_LINE> <INDENT> _validation = { 'enabled': {'required': True}, } <NEW_LINE> _attribute_map = { 'enabled': {'key': 'Enabled', 'type': 'bool', 'xml': {'name': 'Enabled'}}, 'index_document': {'key': 'IndexDocument', 'type': 'str', 'xml': {'name': 'IndexDocument'}}, 'error_document404_path':... | The properties that enable an account to host a static website.
All required parameters must be populated in order to send to Azure.
:param enabled: Required. Indicates whether this account is hosting a
static website
:type enabled: bool
:param index_document: The default name of the index page under each
directory... | 62599066f548e778e596cce4 |
class ApiCreateHuntHandler(api_call_handler_base.ApiCallHandler): <NEW_LINE> <INDENT> args_type = ApiCreateHuntArgs <NEW_LINE> result_type = ApiHunt <NEW_LINE> def Handle(self, args, token=None): <NEW_LINE> <INDENT> generic_hunt_args = standard.GenericHuntArgs() <NEW_LINE> generic_hunt_args.flow_runner_args.flow_name =... | Handles hunt creation request. | 625990664428ac0f6e659c8c |
class InstanceServletRenderServletDelegate(RenderServlet.Delegate): <NEW_LINE> <INDENT> def __init__(self, delegate): <NEW_LINE> <INDENT> self._delegate = delegate <NEW_LINE> <DEDENT> @memoize <NEW_LINE> def CreateServerInstance(self): <NEW_LINE> <INDENT> object_store_creator = ObjectStoreCreator(start_empty=False) <NE... | AppEngine instances should never need to call out to SVN. That should only
ever be done by the cronjobs, which then write the result into DataStore,
which is as far as instances look. To enable this, crons can pass a custom
(presumably online) ServerInstance into Get().
Why? SVN is slow and a bit flaky. Cronjobs faili... | 625990667cff6e4e811b71a2 |
class Test(BT.BiskitTest): <NEW_LINE> <INDENT> def test_lognormal(self): <NEW_LINE> <INDENT> import random <NEW_LINE> import Biskit.gnuplot as gnuplot <NEW_LINE> import Biskit.hist as H <NEW_LINE> cr = [] <NEW_LINE> for i in range( 10000 ): <NEW_LINE> <INDENT> alpha = 1.5 <NEW_LINE> beta = .7 <NEW_LINE> x = 10. <NEW_LI... | Test class | 62599066cc0a2c111447c67d |
class AdminPage(AuthenticatedRequest): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> member = self.get_admin_member() <NEW_LINE> if not member: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.render_template( 'AdminPage', { 'members': model.Member.all(), 'admin': member } ) | For /admin
Displays the application's users (minus the admin)
Allows the admin to add/drop users from the application | 625990668e7ae83300eea7e9 |
class PersonalRequests(RequestListing): <NEW_LINE> <INDENT> template = 'requests_personal.html' <NEW_LINE> decorators = [login_required] <NEW_LINE> def requests(self, filters): <NEW_LINE> <INDENT> requests = super(PersonalRequests, self).requests(filters) <NEW_LINE> requests = requests .join(User) ... | Shows a list of all personally submitted requests and divisions the user
has permissions in.
It will show all requests the current user has submitted. | 6259906632920d7e50bc77a1 |
class ImageReference(Model): <NEW_LINE> <INDENT> _attribute_map = { 'publisher': {'key': 'publisher', 'type': 'str'}, 'offer': {'key': 'offer', 'type': 'str'}, 'sku': {'key': 'sku', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, } <NEW_LINE> def __init__(self, *, publisher: str=None, offer: str=None, sku... | Specifies information about the image to use. You can specify information
about platform images, marketplace images, or virtual machine images. This
element is required when you want to use a platform image, marketplace
image, or virtual machine image, but is not used in other creation
operations.
:param publisher: Th... | 6259906699fddb7c1ca6397c |
class Stats: <NEW_LINE> <INDENT> exposed = True <NEW_LINE> _cp_config = dict(LowDataAdapter._cp_config, **{"tools.salt_auth.on": True}) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> if cherrypy.config["apiopts"].get("stats_disable_auth"): <NEW_LINE> <INDENT> self._cp_config["tools.salt_auth.on"] = False <NEW_LINE>... | Expose statistics on the running CherryPy server | 62599066097d151d1a2c27c7 |
class SweepPriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.qlist = [] <NEW_LINE> self.queue_entryD = {} <NEW_LINE> self.nth_addition = 0 <NEW_LINE> <DEDENT> def add_sa_pair(self, sa_pair, neg_priority=0): <NEW_LINE> <INDENT> if sa_pair in self.queue_entryD: <NEW_LINE> <INDENT> old_neg_pr... | A priority queue used for prioritized sweeping algorithm
from page 169 of Sutton & Barto
State-Action pairs are added along with the NEGATIVE of abs( delta )
where delta is the expected change in Q(s,a) | 625990661f037a2d8b9e5418 |
class RouteDao(BaseDao): <NEW_LINE> <INDENT> def __init__(self, route, alerts, show_geo=False): <NEW_LINE> <INDENT> super(RouteDao, self).__init__() <NEW_LINE> self.copy(route, show_geo) <NEW_LINE> self.set_alerts(alerts) <NEW_LINE> <DEDENT> def copy(self, r, show_geo): <NEW_LINE> <INDENT> self.name = r.route_name <NEW... | RouteDao data object ready for marshaling into JSON
| 625990664428ac0f6e659c8d |
class TranscriptQuerySet(models.QuerySet): <NEW_LINE> <INDENT> pass | QuerySet for Transcript models. Assumed to have a one-to-many
relationship with an AbstractTag model. | 625990664f6381625f19a052 |
class window_manager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def open_duplicate_view(self, view_name): <NEW_LINE> <INDENT> return _get_rpcclient().PlotWindowManager("openDuplicateView", None, view_name) <NEW_LINE> <DEDENT> def open_view(self, view_name=None): <NEW_L... | Wrapper for IPlotWindowManager in SDA. Allows opening, duplicating and
obtaining list of existing views | 62599066baa26c4b54d50a00 |
class DutyPaidProofOCRRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageBase64 = None <NEW_LINE> self.ImageUrl = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageBase64 = params.get("ImageBase64") <NEW_LINE> self.ImageUrl = params.get("Im... | DutyPaidProofOCR请求参数结构体
| 62599066498bea3a75a591ae |
class Uptime(IntervalModule): <NEW_LINE> <INDENT> settings = ( ("format", "Format string"), ("color", "String color"), ("alert", "If you want the string to change color"), ("seconds_alert", "How many seconds necessary to start the alert"), ("color_alert", "Alert color"), ) <NEW_LINE> file = "/proc/uptime" <NEW_LINE> fo... | Outputs Uptime
.. rubric:: Available formatters
* `{days}` - uptime in days
* `{hours}` - rest of uptime in hours
* `{mins}` - rest of uptime in minutes
* `{secs}` - rest of uptime in seconds
* `{uptime}` - deprecated: equals '`{hours}:{mins}`' | 62599066be8e80087fbc07e4 |
class UserForManagerSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = UserModel <NEW_LINE> fields = ( "id", "username", "email", "is_superuser", "users_permission_level", "library_permission_level", "playlist_permission_level", "validated_by_manager", "validated_by_ema... | Users edition for managers. | 62599066cb5e8a47e493cd32 |
class ROSWidget(flx.Widget): <NEW_LINE> <INDENT> def init(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @flx.action <NEW_LINE> def announce_action_client(self, topic, topic_type): <NEW_LINE> <INDENT> self.root.announce_action_client(topic, topic_type) <NEW_LINE> <DEDENT> @flx.action <NEW_LINE> def call_service(se... | flx.Widget subclass that a widget can inherit from for easy access to ros functionality | 625990663617ad0b5ee078ac |
class Node: <NEW_LINE> <INDENT> def __init__(self, x, y, parent, g=0, h=0): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.h = h <NEW_LINE> self.g = g <NEW_LINE> self.f = g + h <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def get_G(self, start): <NEW_LINE> <INDENT> x_dis = self.x - start[0]... | 定义相邻横竖的单元格距离是10,斜的的14 | 625990667047854f46340b0f |
class DescribeEdgeUnitApplicationPodContainersResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ContainerSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("ContainerSet") is not None: <NEW_LINE> <INDE... | DescribeEdgeUnitApplicationPodContainers返回参数结构体
| 62599066a17c0f6771d5d754 |
class DescriptorBase(object): <NEW_LINE> <INDENT> __metaclass__ = DescriptorMetaclass <NEW_LINE> if _USE_C_DESCRIPTORS: <NEW_LINE> <INDENT> _C_DESCRIPTOR_CLASS = () <NEW_LINE> <DEDENT> def __init__(self, options, options_class_name): <NEW_LINE> <INDENT> self._options = options <NEW_LINE> self._options_class_name = opti... | Descriptors base class.
This class is the base of all descriptor classes. It provides common options
related functionality.
Attributes:
has_options: True if the descriptor has non-default options. Usually it
is not necessary to read this -- just call GetOptions() which will
happily return the default ... | 6259906692d797404e38970b |
class Sprint(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100, blank=True, default='') <NEW_LINE> description = models.TextField(blank=True, default='') <NEW_LINE> end = models.DateField(unique=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name or _('Sprint ending %s') % s... | Developers iteration period | 625990667d43ff2487427fbe |
class Datetime(PropertyDescriptor): <NEW_LINE> <INDENT> def __init__(self, default=datetime.date.today(), help=None): <NEW_LINE> <INDENT> super(Datetime, self).__init__(default=default, help=help) <NEW_LINE> <DEDENT> def validate(self, value): <NEW_LINE> <INDENT> super(Datetime, self).validate(value) <NEW_LINE> datetim... | Datetime type property.
| 625990667d847024c075db33 |
class gdgl(find_html_ele): <NEW_LINE> <INDENT> def test_0002(self): <NEW_LINE> <INDENT> super().enter() <NEW_LINE> super().jcgngl() <NEW_LINE> time.sleep(2) <NEW_LINE> super().wdgl() <NEW_LINE> super().change_iframe('网点管理') <NEW_LINE> for i in bank_list[::-1]: <NEW_LINE> <INDENT> super().data_add() <NEW_LINE> t = 1 <NE... | 网点管理 | 625990664428ac0f6e659c8e |
class ParenString(six.text_type): <NEW_LINE> <INDENT> pass | Class representing a parenthesis string. | 6259906632920d7e50bc77a2 |
class Picker(MultiPicker): <NEW_LINE> <INDENT> async def run(self): <NEW_LINE> <INDENT> fetcher = SlowFetcher() <NEW_LINE> response = await fetcher.fetch(self.url()) <NEW_LINE> offset = scrape.pagination(response) <NEW_LINE> first = [jj for jj in scrape.collection(response)] <NEW_LINE> if not offset is None: <NEW_LINE>... | docstring for Picker. | 62599066fff4ab517ebcef78 |
class HTMLResponse(requests.Response): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super(HTMLResponse, self).__init__(*args, **kwargs) <NEW_LINE> self._html = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def html(self) -> HTML: <NEW_LINE> <INDENT> if self._html: <NEW_LINE> <IND... | An HTML-enabled :class:`Response <Response>` object.
Same as Requests class:`Response <Response>` object, but with an
intelligent ``.html`` property added. | 6259906663d6d428bbee3e37 |
class currentStatus_result(object): <NEW_LINE> <INDENT> __slots__ = [ 'success', ] <NEW_LINE> thrift_spec = ( (0, TType.STRUCT, 'success', (Status, Status.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LIN... | Attributes:
- success | 6259906616aa5153ce401c37 |
class DFA: <NEW_LINE> <INDENT> current_state = None <NEW_LINE> def __init__(self, states, alphabet, start_state, accept_states): <NEW_LINE> <INDENT> self.states = states <NEW_LINE> self.alphabet = alphabet <NEW_LINE> self.start_state = start_state <NEW_LINE> self.accept_states = accept_states <NEW_LINE> self.current_st... | This class is a small implementation of a Deterministic Finite Automata. | 625990664e4d562566373b64 |
class NasNetANormalCell(NasNetABaseCell): <NEW_LINE> <INDENT> def __init__(self, num_conv_filters, drop_path_keep_prob, total_num_cells, total_training_steps): <NEW_LINE> <INDENT> operations = ['separable_5x5_2', 'separable_3x3_2', 'separable_5x5_2', 'separable_3x3_2', 'avg_pool_3x3', 'none', 'avg_pool_3x3', 'avg_pool_... | NASNetA Normal Cell. | 6259906697e22403b383c66a |
class Sequence(Iterable): <NEW_LINE> <INDENT> def __init__(self, cells, name=None): <NEW_LINE> <INDENT> Iterable.__init__(self, cells, name) <NEW_LINE> <DEDENT> def __call__(self, x): <NEW_LINE> <INDENT> super().__call__(x) <NEW_LINE> for cell in self: <NEW_LINE> <INDENT> x = cell(x) <NEW_LINE> <DEDENT> return x <NEW_L... | This implementation of the Iterable class describes a sequential (vertical) ordering of cells. | 625990664428ac0f6e659c8f |
class KeyPressInteractorStyle(vtk.vtkInteractorStyleTrackballCamera): <NEW_LINE> <INDENT> def __init__(self, renWin, parent=None): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.AddObserver("KeyPressEvent", self.keyPressEvent) <NEW_LINE> self.OUTPUT_FILE_NAME = "map_output.png" <NEW_LINE> self.renWin = renWin... | An interactor style class extending vtkInteractorStyleTrackballCamera
that saves a screenshot of the window when the 's' or Return key are
pressed. | 62599066498bea3a75a591af |
class TestStatus4(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 testStatus4(self): <NEW_LINE> <INDENT> pass | Status4 unit test stubs | 62599066796e427e5384fed4 |
class ScrapingRuleFormatError(scraper_utils.NewsScrapperError): <NEW_LINE> <INDENT> pass | Indicates that a rule has invalid format.
| 6259906666673b3332c31b5a |
class TestCollectionApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = ibmwex.apis.collection_api.CollectionApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_del... | CollectionApi unit test stubs | 62599066ac7a0e7691f73c42 |
class Location(collections.namedtuple('Location', ('row', 'column'))): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def zero(cls): <NEW_LINE> <INDENT> return cls(0, 0) <NEW_LINE> <DEDENT> def __add__(self, other): <NEW_LINE> <INDENT> return Location(self[0] + other[0], self[1] + other[1]) <NEW_LINE> <DEDENT> def __sub__... | Location reperesents a location in a 2D row-column space. It is primarily
a helper class over regular tuples of (row, column). It assumes that +row
is down and +column is right.
Note that Location does *not* perform any type checking on its arguments;
all the type checking is performed by the validators of the Grid cl... | 6259906699cbb53fe6832641 |
class CompositeMetric(MetricBase): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> super(CompositeMetric, self).__init__(name) <NEW_LINE> self._metrics = [] <NEW_LINE> <DEDENT> def add_metric(self, metric): <NEW_LINE> <INDENT> if not isinstance(metric, MetricBase): <NEW_LINE> <INDENT> raise Value... | This op creates a container that contains the union of all the added metrics.
After the metrics added in, calling eval() method will compute all the contained metrics automatically.
CAUTION: only metrics with the SAME argument list can be added in a CompositeMetric instance.
Inherit from: `MetricBase <https://www.pad... | 62599066cb5e8a47e493cd33 |
@public <NEW_LINE> class SubscribeOptions(object): <NEW_LINE> <INDENT> __slots__ = ( 'match', 'details', 'details_arg', 'get_retained', 'forward_for', 'correlation_id', 'correlation_uri', 'correlation_is_anchor', 'correlation_is_last', ) <NEW_LINE> def __init__(self, match=None, details=None, details_arg=None, forward_... | Used to provide options for subscribing in
:func:`autobahn.wamp.interfaces.ISubscriber.subscribe`. | 625990665166f23b2e244b2e |
class NoteModelSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user = serializers.SlugRelatedField(slug_field="username", required=False, allow_null=True, queryset=User.objects.all()) <NEW_LINE> def create(self, validated_data): <NEW_LINE> <INDENT> request = self.context["request"] <NEW_LINE> user = reques... | Note Model Serializer | 62599066aad79263cf42ff17 |
class PassCollegeViewset(APIView): <NEW_LINE> <INDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> idcard = request.data.get("idcard", 0) <NEW_LINE> examcode = request.data.get("examcode", 0) <NEW_LINE> student = CollegeStudent.objects.filter(idcard=idcard, examcode=examcode).first() <NEW_LINE> if stu... | 用户查看是否通过考试 | 625990664428ac0f6e659c90 |
class TimezoneNotSpecifiedError(TimestampError): <NEW_LINE> <INDENT> pass | This error is raised when timezone is not specified. | 6259906632920d7e50bc77a5 |
class nn_se_lr003(p40): <NEW_LINE> <INDENT> learning_rate = 0.003 | cnn2blstm | 6259906663d6d428bbee3e38 |
class CertificateRequestTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> from acme.messages import CertificateRequest <NEW_LINE> self.req = CertificateRequest(csr=CSR, authorizations=('foo',)) <NEW_LINE> <DEDENT> def test_json_de_serializable(self): <NEW_LINE> <INDENT> self.assertTrue(i... | Tests for acme.messages.CertificateRequest. | 625990668e71fb1e983bd224 |
@navigator.register(FilterEntity, 'All') <NEW_LINE> class ShowAllFilters(NavigateStep): <NEW_LINE> <INDENT> VIEW = FiltersView <NEW_LINE> def am_i_here(self, *args, **kwargs): <NEW_LINE> <INDENT> role_name = kwargs.get('role_name') <NEW_LINE> return self.view.is_displayed and self.view.breadcrumb.locations[1] in ( role... | Navigate to All Role Filters page by pressing 'Filters' button on Roles
List view.
Args:
role_name: name of role | 62599066a219f33f346c7f65 |
class Extractor(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _make_social_stats( cls, threads=0, comments=0, replies=0, upvotes=0, followers=0, comments_generated=0, threads_read=0 ): <NEW_LINE> <INDENT> return { DiscussionExportFields.THREADS: threads, DiscussionExportFields.COMMENTS: comments, DiscussionE... | Extracts discussion participation data from db and cs_comments_service | 625990661f037a2d8b9e541a |
class SQLCache(object): <NEW_LINE> <INDENT> def __init__(self, filepath, worker_keepalive=2.0, commit_spacing=2.0): <NEW_LINE> <INDENT> self._path = os.path.abspath(filepath) <NEW_LINE> self._worker_keepalive = worker_keepalive <NEW_LINE> self._commit_spacing = commit_spacing <NEW_LINE> self._work_queue = Queue(maxsize... | Maintains a worker thread with an active cursor in a sqlite database that commits periodically.
Functions as a bare-bones key-value store on the front end (text to bytes). Rather more performant
than committing every interaction, and does not require anything to be installed or set up. | 6259906601c39578d7f142e4 |
class SelectSpecies(SelectionWindow): <NEW_LINE> <INDENT> def __init__(self, locations, title="Species Selection", description="Select the species:", width=600, slot=0): <NEW_LINE> <INDENT> self.locations = locations <NEW_LINE> super(SelectSpecies, self).__init__(title, description, width, slot) <NEW_LINE> self.back_si... | Display a selection dialog that allows the user to make a
selection from the SETL species in the local database.
Design Part: 1.88 | 625990663539df3088ecd9fd |
class Subject(models.Model): <NEW_LINE> <INDENT> code = models.CharField(_('code'), max_length=16, blank=True, unique=True) <NEW_LINE> name = models.CharField(_('name'), max_length=256) <NEW_LINE> short_name = models.CharField(_('short name'), max_length=32, blank=True, default="") <NEW_LINE> def __str__(self): <NEW_LI... | e. g. Math 101 | 62599066796e427e5384fed5 |
@keras_export('keras.layers.ReLU') <NEW_LINE> class ReLU(Layer): <NEW_LINE> <INDENT> def __init__(self, max_value=None, negative_slope=0, threshold=0, **kwargs): <NEW_LINE> <INDENT> super(ReLU, self).__init__(**kwargs) <NEW_LINE> if max_value is not None and max_value < 0.: <NEW_LINE> <INDENT> raise ValueError('max_val... | Rectified Linear Unit activation function.
With default values, it returns element-wise `max(x, 0)`.
Otherwise, it follows:
```
f(x) = max_value if x >= max_value
f(x) = x if threshold <= x < max_value
f(x) = negative_slope * (x - threshold) otherwise
```
Usage:
>>> layer = tf.keras.layers.ReLU()
>>> output ... | 62599066435de62698e9d568 |
class TileFeatured(BaseTile): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> implements(ITileFeatured) <NEW_LINE> portal_type = 'TileFeatured' <NEW_LINE> _at_rename_after_creation = True <NEW_LINE> schema = TileFeatured_schema <NEW_LINE> columns = 6 | Reserve Content for TileFeatured | 62599066627d3e7fe0e085ea |
class Sander(Sandable): <NEW_LINE> <INDENT> def __init__(self, width, length, ballSize, units): <NEW_LINE> <INDENT> self.editor = [ DialogFloat("h", "Coefficient 'H'", default=0.01, min=.001, max=.05), DialogFloat("a", "Coefficient 'A'", default=10.0, min=.5, max=45.0), Dia... | ### Draw a Lorenz Attractor (a type of fractal)
#### Hints
Read the Wikipedia article on [Lorenz Systems](http://en.wikipedia.org/wiki/Lorenz_system)
#### Parameters
* **h, a, b, c** - coefficients that describe parameters for the chaotic differential equations.
* **Number of points** - number of points to draw in ... | 62599066d486a94d0ba2d721 |
class WiredDiscoveryV1(CDPDataItem): <NEW_LINE> <INDENT> type = 0x800F <NEW_LINE> definition = [DIUInt8Attr('hardware_version'), DIUInt32Attr('server_instance'), DIUInt64Attr('capabilities'), DIVariableLengthBytesAttr('payload')] <NEW_LINE> def get_hardware_version(self): <NEW_LINE> <INDENT> return self.hardware_versio... | CDP Data Item: Ciholas Data Protocol Wired Descovery Data Item Definition | 625990665166f23b2e244b30 |
@register_snippet <NEW_LINE> class ActionButtons(ClusterableModel, models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> small = models.BooleanField(verbose_name="Small Buttons", default=False) <NEW_LINE> fit = models.BooleanField(verbose_name="Fit Buttons", default=False) <NEW_LINE> sta... | Action Buttons | 6259906656b00c62f0fb402d |
class AniList: <NEW_LINE> <INDENT> api_url = API_URL <NEW_LINE> query = QUERY <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def json(self): <NEW_LINE> <INDENT> data = { 'query': self.query, 'variables': { 'name': self.name } } <NEW_LINE> response = requests.post(self.api_... | Main class to communicate with AniList API.
Attributes
----------
api_url : str
AniList API url
query : str
Query that you want to sent to. It must be GraphQL query and
exists in AniList API.
Parameters
----------
name : str
Name of the manga that you want to get. | 6259906644b2445a339b7510 |
class SparkChartView(proto.Message): <NEW_LINE> <INDENT> spark_chart_type = proto.Field( proto.ENUM, number=1, enum=metrics.SparkChartType, ) <NEW_LINE> min_alignment_period = proto.Field( proto.MESSAGE, number=2, message=duration_pb2.Duration, ) | A sparkChart is a small chart suitable for inclusion in a
table-cell or inline in text. This message contains the
configuration for a sparkChart to show up on a Scorecard,
showing recent trends of the scorecard's timeseries.
Attributes:
spark_chart_type (google.cloud.monitoring_dashboard_v1.types.SparkChartType):
... | 62599066379a373c97d9a77e |
class Float32Array(Array): <NEW_LINE> <INDENT> pass | 32-bit floating point number | 6259906676e4537e8c3f0ce3 |
class XMLTreeFile(ElementTree.ElementTree, XMLBackup): <NEW_LINE> <INDENT> sourcebackupfile = None <NEW_LINE> def __init__(self, xml): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.sourcebackupfile = file(xml, "rb") <NEW_LINE> self.sourcebackupfile.close() <NEW_LINE> <DEDENT> except (IOError, OSError): <NEW_LINE> <... | Combination of ElementTree root and auto-cleaned XML backup file. | 62599066009cb60464d02c99 |
class Equal (Constraint): <NEW_LINE> <INDENT> def __init__ (self, other_id, message = None): <NEW_LINE> <INDENT> self.other_id = other_id <NEW_LINE> self.message = message <NEW_LINE> <DEDENT> def get_error (self, data, result, entry): <NEW_LINE> <INDENT> if result[self.other_id]==result[entry.id_]: <NEW_LINE> <INDENT> ... | Equal constraint: This data entry must have the same value as another data entry. | 625990664f6381625f19a055 |
class Deck: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cards = [] <NEW_LINE> for suit in range(4): <NEW_LINE> <INDENT> for rank in range(1, 14): <NEW_LINE> <INDENT> self.cards.append(Card(suit, rank)) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> s = "" <NEW_LINE> fo... | Defines a deck of cards. | 62599066e76e3b2f99fda161 |
class InvalidRuleSource(RuleSourceException): <NEW_LINE> <INDENT> pass | The rule's @source decorator has invalid arguments | 62599066baa26c4b54d50a06 |
class LoggingSetLevelCommand(sublime_plugin.WindowCommand): <NEW_LINE> <INDENT> def run(self, level=20): <NEW_LINE> <INDENT> logging.root.setLevel(ensure_loglevel_int(level)) <NEW_LINE> sublime.status_message("Logging level set to %s" % level) <NEW_LINE> print("Logging level set to %s" % level) <NEW_LINE> logger.info("... | command key: logging_set_level | 62599066498bea3a75a591b1 |
class EffectsListView(QListView): <NEW_LINE> <INDENT> drag_item_size = 48 <NEW_LINE> def contextMenuEvent(self, event): <NEW_LINE> <INDENT> app = get_app() <NEW_LINE> app.context_menu_object = "effects" <NEW_LINE> menu = QMenu(self) <NEW_LINE> menu.addAction(self.win.actionDetailsView) <NEW_LINE> menu.exec_(QCursor.pos... | A TreeView QWidget used on the main window | 62599066d7e4931a7ef3d736 |
class SourceGroup(Source): <NEW_LINE> <INDENT> def __init__(self, group_id=None, **kwargs): <NEW_LINE> <INDENT> super(SourceGroup, self).__init__(**kwargs) <NEW_LINE> self.type = 'group' <NEW_LINE> self.group_id = group_id <NEW_LINE> <DEDENT> @property <NEW_LINE> def sender_id(self): <NEW_LINE> <INDENT> return self.gro... | SourceGroup.
https://devdocs.line.me/en/#source-group
JSON object which contains the source group of the event. | 62599066dd821e528d6da532 |
class PostListView(ListView): <NEW_LINE> <INDENT> queryset = Post.published.all() <NEW_LINE> context_object_name = 'posts' <NEW_LINE> paginate_by = 3 <NEW_LINE> template_name = 'myblog/post/list.html' | 对象列表返回类 分页 包装 | 62599066a8ecb0332587297a |
class RMSprop(Optimizer): <NEW_LINE> <INDENT> def __init__(self, lr=0.001, rho=0.9, epsilon=None, decay=0., **kwargs): <NEW_LINE> <INDENT> super(RMSprop, self).__init__(**kwargs) <NEW_LINE> with K.name_scope(self.__class__.__name__): <NEW_LINE> <INDENT> self.lr = K.variable(lr, name='lr') <NEW_LINE> self.rho = K.variab... | RMSProp optimizer.
It is recommended to leave the parameters of this optimizer
at their default values
(except the learning rate, which can be freely tuned).
This optimizer is usually a good choice for recurrent
neural networks.
# Arguments
lr: float >= 0. Learning rate.
rho: float >= 0.
epsilon: float >... | 62599066aad79263cf42ff1a |
class Newchannel(_Message): <NEW_LINE> <INDENT> def process(self): <NEW_LINE> <INDENT> (headers, data) = _Message.process(self) <NEW_LINE> try: <NEW_LINE> <INDENT> headers['ChannelState'] = int(headers['ChannelState']) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> headers['ChannelState'] = None <NEW_LINE> <... | Indicates that a new channel has been created.
- 'AccountCode': The billing account associated with the channel; may be empty
- 'CallerIDNum': The (often) numeric identifier of the caller
- 'CallerIDName': The caller's name, on supporting channels
- 'Channel': The channel identifier used by Asterisk
- 'ChannelState': ... | 62599066627d3e7fe0e085ec |
class Solution(object): <NEW_LINE> <INDENT> def methodX(self): <NEW_LINE> <INDENT> pass | >>> solution = Solution() | 625990665166f23b2e244b32 |
class SentimentPlugin(Analyser, Evaluable, models.SentimentPlugin): <NEW_LINE> <INDENT> minPolarityValue = 0 <NEW_LINE> maxPolarityValue = 1 <NEW_LINE> _terse_keys = Analyser._terse_keys + ['minPolarityValue', 'maxPolarityValue'] <NEW_LINE> def test_case(self, case): <NEW_LINE> <INDENT> if 'polarity' in case: <NEW_LINE... | Sentiment plugins provide sentiment annotation (using Marl) | 6259906692d797404e38970e |
class FakeDriver(base.DriverBase): <NEW_LINE> <INDENT> def __init__(self, config, logger, systems, chassis): <NEW_LINE> <INDENT> super().__init__(config, logger) <NEW_LINE> self._systems = systems <NEW_LINE> self._chassis = chassis <NEW_LINE> <DEDENT> def get_manager(self, identity): <NEW_LINE> <INDENT> try: <NEW_LINE>... | Redfish manager that copied systems. | 6259906656b00c62f0fb402f |
class TestImageCacheXattr(test_utils.BaseTestCase, ImageCacheTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestImageCacheXattr, self).setUp() <NEW_LINE> if getattr(self, 'disable', False): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.cache_dir = self.useFixture(fixtures.TempDir()).pat... | Tests image caching when xattr is used in cache | 625990664e4d562566373b69 |
class FactoryRegistration(object): <NEW_LINE> <INDENT> descriptor = None <NEW_LINE> class_factory = None <NEW_LINE> def __init__(self, descriptor, class_factory): <NEW_LINE> <INDENT> self.descriptor = descriptor <NEW_LINE> self.class_factory = class_factory | Holds registration of specific component in component factory. | 625990662ae34c7f260ac849 |
class HeadingItem(BaseItem): <NEW_LINE> <INDENT> __metaclass__ = generate_docstring <NEW_LINE> fixed = {'menu_type': 'heading'} <NEW_LINE> defaults = {'name': None, 'description': None, 'heading_level': DEFAULT_HEADING_LEVEL, 'extra_data': None, 'klass': None, } | Wrapper/interface for heading objects in a LayerTree/menu. | 62599066fff4ab517ebcef7d |
class Visual7W_Pointing(Visual7W): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs) -> None: <NEW_LINE> <INDENT> super(Visual7W_Pointing, self).__init__(*args, data_type="pointing", **kwargs) | One type of VQA Dataset
http://web.stanford.edu/%7Eyukez/visual7w/
Download Pointing Dataset | 625990668e7ae83300eea7f0 |
class Amenity(BaseModel): <NEW_LINE> <INDENT> name = "" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) | amenity class | 62599066cc0a2c111447c681 |
class Jogo: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cena = Cena(TABULEIRO, direita=Tabuleiro()) <NEW_LINE> self.start = Elemento(BOTAO, x=50, y=50, cena=self.cena) <NEW_LINE> <DEDENT> def vai(self): <NEW_LINE> <INDENT> self.cena.vai() <NEW_LINE> <DEDENT> def bt_click(self): <NEW_LINE> <INDENT> ... | Representa uma cena de tabuleiro com o botão | 6259906655399d3f05627c83 |
class SearchError(DiaspyError): <NEW_LINE> <INDENT> pass | Exception raised when something related to searching goes wrong.
| 62599066009cb60464d02c9b |
class TestGeolookupResult(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 testGeolookupResult(self): <NEW_LINE> <INDENT> pass | GeolookupResult unit test stubs | 625990668da39b475be0494c |
class RgbColor(core.RgbColor): <NEW_LINE> <INDENT> def writeSdl(self, f): <NEW_LINE> <INDENT> f.write("rgb <") <NEW_LINE> f.write(str.join(",", (list(map(str,self))))) <NEW_LINE> f.write(">") | Extends L{core.RgbColor} by implementing the L{writeSdl} method. | 62599066d268445f2663a70e |
class ExtWindow(BaseExtWindow): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ExtWindow, self).__init__(*args, **kwargs) <NEW_LINE> self._ext_name = 'Ext.m3.Window' <NEW_LINE> self.init_component(*args, **kwargs) <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> assert getat... | Окно
:raises: AssertionError, UnicodeDecodeError | 62599066498bea3a75a591b2 |
class ITribunaContentLayer(IRedominoAdvancedKeywordLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a Zope 3 browser layer. | 62599066a8370b77170f1b32 |
class UpdateDestroyReview(RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Review.objects.all() <NEW_LINE> serializer_class = ReviewSerializer <NEW_LINE> lookup_url_kwarg = 'review_id' <NEW_LINE> permission_classes = [IsOwnerOrReadOnly, IsAuthenticated] | get, update and delete specific review by owner | 62599066e5267d203ee6cf70 |
class Glossary(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'glossary_url': {'required': True}, 'format': {'required': True}, } <NEW_LINE> _attribute_map = { 'glossary_url': {'key': 'glossaryUrl', 'type': 'str'}, 'format': {'key': 'format', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'... | Glossary / translation memory for the request.
All required parameters must be populated in order to send to Azure.
:param glossary_url: Required. Location of the glossary.
We will use the file extension to extract the formatting if the format parameter is not
supplied.
If the translation language pair is not pre... | 6259906676e4537e8c3f0ce6 |
class ListDocumentsResponse(proto.Message): <NEW_LINE> <INDENT> @property <NEW_LINE> def raw_page(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> documents = proto.RepeatedField( proto.MESSAGE, number=1, message=gf_document.Document, ) <NEW_LINE> next_page_token = proto.Field(proto.STRING, number=2) | The response for
[Firestore.ListDocuments][google.firestore.v1.Firestore.ListDocuments].
Attributes:
documents (Sequence[~.gf_document.Document]):
The Documents found.
next_page_token (str):
The next page token. | 62599066435de62698e9d56d |
class PlayerDifficulty(Enum): <NEW_LINE> <INDENT> EASY = 1, <NEW_LINE> MEDIUM = 2, <NEW_LINE> HARD = 3, <NEW_LINE> HUMAN = 4 | Easy sAI | 62599066cb5e8a47e493cd36 |
class ListTaskCallMixin(Call): <NEW_LINE> <INDENT> def list_tasks(self): <NEW_LINE> <INDENT> from highton.models.task import Task <NEW_LINE> return fields.ListField( name=self.ENDPOINT, init_class=Task ).decode( self.element_from_string( self._get_request( endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Task.ENDPOI... | A mixin to get all tasks of inherited class
These could be: people || companies || kases || deals | 625990667047854f46340b18 |
class IonObjectDeserializer(IonObjectSerializationBase): <NEW_LINE> <INDENT> deserialize = IonObjectSerializationBase.operate <NEW_LINE> def __init__(self, transform_method=None, obj_registry=None, **kwargs): <NEW_LINE> <INDENT> assert obj_registry <NEW_LINE> self._obj_registry = obj_registry <NEW_LINE> IonObjectSerial... | Deserializer for IonObjects.
Defines a _transform method to transform dictionaries produced by IonObjectSerializer back
into IonObjects. You *MUST* pass an object registry | 6259906699fddb7c1ca63981 |
class DebugColrPrinterTests(DebugPrinterTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dp_class = DebugColrPrinter <NEW_LINE> self.class_name = self.dp_class.__name__ | Tests for the DebugColrPrinter class. | 6259906632920d7e50bc77ab |
class Segment(api_extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_name(cls): <NEW_LINE> <INDENT> return "Segment" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_alias(cls): <NEW_LINE> <INDENT> return "segment" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_description(cls)... | Extension class supporting Segments. | 625990667c178a314d78e79e |
class LRUCache(object): <NEW_LINE> <INDENT> def __init__(self, max_entries, default_entry): <NEW_LINE> <INDENT> self._max_entries = max_entries <NEW_LINE> self._default_entry = default_entry <NEW_LINE> self._cache = collections.OrderedDict() <NEW_LINE> self._on_evict = None <NEW_LINE> <DEDENT> def get(self, key): <NEW_... | A simple LRUCache implementation used to manage the internal runtime state.
An internal runtime state is used to handle the data under a specific key of a "public" state.
So the number of the internal runtime states may keep growing during the streaming task
execution. To prevent the OOM caused by the unlimited growth,... | 625990663cc13d1c6d466ea8 |
class ExpressRouteConnectionList(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ExpressRouteConnection]'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["ExpressRouteConnection"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(ExpressRouteConnectionList... | ExpressRouteConnection list.
:param value: The list of ExpressRoute connections.
:type value: list[~azure.mgmt.network.v2019_08_01.models.ExpressRouteConnection] | 62599066fff4ab517ebcef80 |
class WeightedPositiveWords(MRJob): <NEW_LINE> <INDENT> INPUT_PROTOCOL = JSONValueProtocol <NEW_LINE> OUTPUT_PROTOCOL = JSONValueProtocol <NEW_LINE> weight_list = [] <NEW_LINE> def mapper(self, _, data): <NEW_LINE> <INDENT> if "review_id" in data: <NEW_LINE> <INDENT> yield data['business_id'], ('review', (data['text'],... | Find the most positive words in the dataset. | 62599066462c4b4f79dbd16b |
class GetBookmarkInputSet(InputSet): <NEW_LINE> <INDENT> def set_ChangeSignature(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'ChangeSignature', value) <NEW_LINE> <DEDENT> def set_Date(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Date', value) <NEW_LINE> <DEDENT> def set_Meta(self, value)... | An InputSet with methods appropriate for specifying the inputs to the GetBookmark
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62599066460517430c432c07 |
class TestJSONEnforcer: <NEW_LINE> <INDENT> enforcer = mid.JSONEnforcer() <NEW_LINE> @pytest.mark.parametrize('accepts', [True, False]) <NEW_LINE> def test_client_accept(self, accepts): <NEW_LINE> <INDENT> req = mock.Mock() <NEW_LINE> req.client_accepts_json = accepts <NEW_LINE> req.method = 'GET' <NEW_LINE> if not acc... | Test enforcement of JSON requests | 62599066e76e3b2f99fda165 |
class RPCMethodError(Exception): <NEW_LINE> <INDENT> pass | Error might be raised during rpc methods processing | 625990664a966d76dd5f065b |
class RawProduct(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> shelf_life = models.PositiveSmallIntegerField(default=0) | Example: Coffee Beans | 6259906601c39578d7f142e7 |
class GanGenerator(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def generate_data_dict(self, noise: torch.Tensor, *args, **kwargs) -> tuple: <NEW_LINE> <INDENT> raise NotImplementedError | Abstract class for standard GAN generators, which aim to convert input noise into synthetic data. | 62599066d7e4931a7ef3d738 |
class SimpleCursorShapeConfig(CursorShapeConfig): <NEW_LINE> <INDENT> def __init__(self, cursor_shape: CursorShape = CursorShape._NEVER_CHANGE) -> None: <NEW_LINE> <INDENT> self.cursor_shape = cursor_shape <NEW_LINE> <DEDENT> def get_cursor_shape(self, application: "Application[Any]") -> CursorShape: <NEW_LINE> <INDENT... | Always show the given cursor shape. | 6259906667a9b606de547654 |
class ModelType(Enum): <NEW_LINE> <INDENT> CONV1 = 1, <NEW_LINE> VGG16 = 2 | An enum type for specifying a model architexture. | 62599066be8e80087fbc07ee |
class GatewayRejectionReason(object): <NEW_LINE> <INDENT> Avs = "avs" <NEW_LINE> AvsAndCvv = "avs_and_cvv" <NEW_LINE> Cvv = "cvv" <NEW_LINE> Duplicate = "duplicate" <NEW_LINE> Fraud = "fraud" <NEW_LINE> ThreeDSecure = "three_d_secure" <NEW_LINE> Unrecognized = "unrecognized" | Constants representing gateway rejection reasons. Available types are:
* braintree.Transaction.GatewayRejectionReason.Avs
* braintree.Transaction.GatewayRejectionReason.AvsAndCvv
* braintree.Transaction.GatewayRejectionReason.Cvv
* braintree.Transaction.GatewayRejectionReason.Duplicate
* braintree.Transaction.GatewayR... | 625990667b25080760ed8894 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.