code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class LoginView(View): <NEW_LINE> <INDENT> def get(self,request): <NEW_LINE> <INDENT> return render(request,"blog/login.html") <NEW_LINE> <DEDENT> def post(self,request): <NEW_LINE> <INDENT> name = request.POST.get("username") <NEW_LINE> password = request.POST.get("password") <NEW_LINE> check = request.POST.get("check...
用户登录
62598f035fc7496912d47797
class ProxyError(object): <NEW_LINE> <INDENT> LOGGER = logging.getLogger(__name__) <NEW_LINE> def __init__(self, code, message, step=None, context=None): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.message = message <NEW_LINE> self.step = step <NEW_LINE> self.context = context <NEW_LINE> if isinstance(message,...
Carries information for errors :param code: HTTP Code Error :type code: int :param message: Message to display or a dict and its key :type message: str or tuple :ivar code: HTTP Code Error :ivar message: Message to display
62598f037cff6e4e811b442d
class OrdersList(LoginRequiredMixin, XListView): <NEW_LINE> <INDENT> template_name = 'purchase/orders_list.html' <NEW_LINE> model = purchases_models.PurchaseOrder <NEW_LINE> search_fields = ['company__name', 'invoice', 'note', ] <NEW_LINE> queryset = purchases_models.PurchaseOrder.objects.all() <NEW_LINE> ordering = ('...
List of all orders
62598f0323849d37ff84fb09
class RestOAuthMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if not waffle.switch_is_active('drf'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> path_ = request.get_full_path() <NEW_LINE> try: <NEW_LINE> <INDENT> _, lang, platform, api, rest = path_.split('/', 4) <NEW...
This is based on https://github.com/amrox/django-tastypie-two-legged-oauth with permission.
62598f0397e22403b383992d
class MFloatVector(object): <NEW_LINE> <INDENT> def __add__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __delitem__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __div__(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __eq__(*args, **kwargs): <NEW_LINE> <IN...
3D vector with single-precision coordinates.
62598f03adb09d7d5dc08ff9
class AnnounceMessageDialog(MessageDialog): <NEW_LINE> <INDENT> title = _("IRC track announce") <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> MessageDialog.__init__(self) <NEW_LINE> self.delay = gtk.SpinButton(message_delay_adj) <NEW_LINE> self._pack(((_("Delay"), self.delay), )) <NEW_LINE> set_tip(self.delay, _("...
Adds delay functionality to the message dialog.
62598f0360cbc95b06362d7a
class AdditionError(GraphError): <NEW_LINE> <INDENT> pass
This error is raised when trying to add a node already added to the graph or digraph.
62598f03283ffb24f3cf22f4
class SkyShell(SkySpatialModel): <NEW_LINE> <INDENT> def __init__(self, lon_0, lat_0, radius, width): <NEW_LINE> <INDENT> self.parameters = ParameterList([ Parameter('lon_0', Longitude(lon_0)), Parameter('lat_0', Latitude(lat_0)), Parameter('radius', Angle(radius)), Parameter('width', Angle(width)) ]) <NEW_LINE> <DEDEN...
Shell model .. math:: \phi(lon, lat) = \frac{3}{2 \pi (r_{out}^3 - r_{in}^3)} \cdot \begin{cases} \sqrt{r_{out}^2 - \theta^2} - \sqrt{r_{in}^2 - \theta^2} & \text{for } \theta \lt r_{in} \\ \sqrt{r_{out}^2 - \theta^2} & ...
62598f03bf627c535bcafebd
class PropertyPage(WikibasePage, Property): <NEW_LINE> <INDENT> _cache_attrs = WikibasePage._cache_attrs + ( '_type', 'labels', 'descriptions', 'aliases', 'claims') <NEW_LINE> entity_type = 'property' <NEW_LINE> title_pattern = r'P[1-9]\d*' <NEW_LINE> DATA_ATTRIBUTES = { 'labels': LanguageDict, 'descriptions': Language...
A Wikibase entity in the property namespace. Should be created as:: PropertyPage(DataSite, 'P21') or:: PropertyPage(DataSite, datatype='url')
62598f034a966d76dd5ed91d
class StandardPermutations_all(Permutations): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Permutations.__init__(self, category=InfiniteEnumeratedSets()) <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return "Standard permutations" <NEW_LINE> <DEDENT> def __contains__(self, x): <NEW_LINE> <IND...
All standard permutations.
62598f03851cf427c66b6d12
@ns_wikifier.route("/knn/text") <NEW_LINE> class KnnWikifierText(Resource): <NEW_LINE> <INDENT> @ns_wikifier.expect(input_def_text, validate=True) <NEW_LINE> @ns_wikifier.marshal_with(output_def) <NEW_LINE> def post(self): <NEW_LINE> <INDENT> return {'output': knn_wikifier_text(**request.json)} <NEW_LINE> <DEDENT> @ns_...
This is a test
62598f03be7bc26dc9251388
class UvvisAbsAndExtinctionHeadingParser(BaseParser): <NEW_LINE> <INDENT> root = uvvis_and_extinction_abs_heading <NEW_LINE> def interpret(self, result, start, end): <NEW_LINE> <INDENT> print(result) <NEW_LINE> uvvis_units = first(result.xpath('./uvvis_units/text()')) <NEW_LINE> extinction_units = first(result.xpath('....
Parser for headers where the uvvis and extinction coeff are both in same column
62598f034c34283577618d34
class RandomMask(Layer): <NEW_LINE> <INDENT> def __init__(self, my_initializer=RandomUniform(minval=0.0, maxval=1.0, seed=None), **kwargs): <NEW_LINE> <INDENT> self.initializer = my_initializer <NEW_LINE> super(RandomMask, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT> su...
Local thresholding layer: modified from Local Linear Layer code in tensorflow/keras utilities for the neuron project by Adrian V. Dalca, Guha Balakrishnan, John Guttag, Mert R. Sabuncu
62598f0397e22403b383992e
class MultipartDetailsParser(DetailsParser): <NEW_LINE> <INDENT> def __init__(self, state): <NEW_LINE> <INDENT> self._state = state <NEW_LINE> self._details = {} <NEW_LINE> self._parse_state = self._look_for_content <NEW_LINE> <DEDENT> def _look_for_content(self, line): <NEW_LINE> <INDENT> if line == "]\n": <NEW_LINE> ...
Parser for multi-part [] surrounded MIME typed chunked details.
62598f03fbf16365ca792ae5
class UserDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> num_posts = serializers.SerializerMethodField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'first_name', 'last_name', 'email', 'num_posts') <NEW_LINE> extra_kwargs = { 'username': {'validators': []...
Serialized representation of a user
62598f03f9cc0f698b1c47f4
class card(osv.osv): <NEW_LINE> <INDENT> _name = "gift.card" <NEW_LINE> _rec_name = "number" <NEW_LINE> _columns = { 'number': fields.char('Card Number', size=19), 'balance': fields.float('Balance'), 'voucher_ids': fields.one2many('account.voucher', 'giftcard_id', 'Vouchers', readonly=True), 'sale_order_line_id': field...
Represents a gift card in the system.
62598f035fc7496912d47799
class PdfReport: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> <DEDENT> def generate(self, flatmate1, flatmate2, bill): <NEW_LINE> <INDENT> flatmate_pay1 = str(round(flatmate1.pays(bill=bill, flatmate=flatmate2), 2)) <NEW_LINE> flatmate_pay2 = str(round(flatma...
Creates a pdf file that contains data about the flatmates such as names, their due amount and period of the bill
62598f0371ff763f4b5e61af
class SessionFactory(_BaseFactory): <NEW_LINE> <INDENT> valid_response = 'OK' <NEW_LINE> invalid_response = 'ERR' <NEW_LINE> def processLine(self, line): <NEW_LINE> <INDENT> user = self.service.getActiveUserByIp(line) <NEW_LINE> if not user: <NEW_LINE> <INDENT> return self.invalid_response <NEW_LINE> <DEDENT> elif not ...
Optional API for checking if user already seen welcome page
62598f0355399d3f05624f71
class AddonError(Error): <NEW_LINE> <INDENT> def __init__(self, addon, message): <NEW_LINE> <INDENT> self.addon = addon <NEW_LINE> self.message = message <NEW_LINE> self.args = (addon, message) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "{0}: {1}".format(str(self.addon), str(self.message))
Class for exceptions that belong to an add-on.
62598f03fff4ab517ebcc21f
@base.ReleaseTracks(base.ReleaseTrack.BETA) <NEW_LINE> class BigtableV2(base.Group): <NEW_LINE> <INDENT> pass
Manage your Cloud Bigtable storage.
62598f03cc40096d616196ff
class TestCreateUpdateSiteTheme(TestCase): <NEW_LINE> <INDENT> def test_errors_for_invalid_arguments(self): <NEW_LINE> <INDENT> with self.assertRaises(CommandError): <NEW_LINE> <INDENT> call_command("create_or_update_site_theme") <NEW_LINE> <DEDENT> with self.assertRaises(CommandError): <NEW_LINE> <INDENT> call_command...
Test django management command for creating or updating site themes.
62598f03f548e778e5969fd3
class TestController(object): <NEW_LINE> <INDENT> application_under_test = application_name <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.app = load_app(self.application_under_test) <NEW_LINE> setup_app() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> model.DBSession.remove() <NEW_LINE> teardown_db(...
Base functional test case for the controllers. The article-finder application instance (``self.app``) set up in this test case (and descendants) has authentication disabled, so that developers can test the protected areas independently of the :mod:`repoze.who` plugins used initially. This way, authentication can be te...
62598f03091ae35668703667
class NodeState(Enum): <NEW_LINE> <INDENT> TAKEN = auto() <NEW_LINE> ONE_CHILD_TAKEN = auto() <NEW_LINE> NOT_TAKEN = auto()
Node state TAKEN: node taken, all children not taken ONE_CHILD_TAKEN: node not taken, one child taken NOT_TAKEN: node not taken, two chilren taken
62598f03adb09d7d5dc08ffd
class SwitcherControl(SwitchDevice): <NEW_LINE> <INDENT> def __init__(self, device_data: "SwitcherV2Device") -> None: <NEW_LINE> <INDENT> self._self_initiated = False <NEW_LINE> self._device_data = device_data <NEW_LINE> self._state = device_data.state <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NE...
Home Assistant switch entity.
62598f0360cbc95b06362d7e
class PortBatching(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "port-batching" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.tcp_time_wait_interval = "" <NEW_LINE> self.size = "" <NEW_LINE> for keys, value in kwargs.items(): <NEW_LI...
This class does not support CRUD Operations please use parent. :param tcp_time_wait_interval: {"description": "Minutes before TCP NAT ports can be reused (default: 2)", "format": "number", "default": 2, "maximum": 10, "minimum": 0, "type": "number"} :param size: {"default": "1", "enum": ["1", "8", "16", "32", "64", "1...
62598f033d592f4c4edb9935
class ResizeShort(object): <NEW_LINE> <INDENT> def __init__(self, size: Union[int, float]) -> None: <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def __call__(self, image: np.ndarray, label: np.ndarray) -> Tuple[np.ndarray, np.ndarray]: <NEW_LINE> <INDENT> old_image_shape, old_label_shape = image.shape, labe...
Resize the input such that its shorter size meets the prescribed size. Note that 'size' is a float or int.
62598f035fdd1c0f98e5c9ed
class W06(VOTableSpecWarning): <NEW_LINE> <INDENT> message_template = "Invalid UCD '%s': %s" <NEW_LINE> default_args = ('x', 'explanation')
This warning is emitted when a ``ucd`` attribute does not match the syntax of a `unified content descriptor <http://vizier.u-strasbg.fr/doc/UCD.htx>`__. If the VOTable version is 1.2 or later, the UCD will also be checked to ensure it conforms to the controlled vocabulary defined by UCD1+. **References**: `1.1 <http:...
62598f035166f23b2e241e2c
class RequestParser(object): <NEW_LINE> <INDENT> def __init__(self, argument_class=Argument, namespace_class=Namespace): <NEW_LINE> <INDENT> self.args = [] <NEW_LINE> self.argument_class = argument_class <NEW_LINE> self.namespace_class = namespace_class <NEW_LINE> <DEDENT> def add_argument(self, *args, **kwargs): <NEW_...
Enables adding and parsing of multiple arguments in the context of a single request. Ex:: from flask import request parser = RequestParser() parser.add_argument('foo') parser.add_argument('int_bar', type=int) args = parser.parse_args()
62598f03dc8b845886d52014
@CoseAlgorithm.register_attribute() <NEW_LINE> class RsaPkcs1Sha1(_RsaPkcs1): <NEW_LINE> <INDENT> identifier = -65535 <NEW_LINE> fullname = "RS1" <NEW_LINE> @classmethod <NEW_LINE> def get_hash_func(cls): <NEW_LINE> <INDENT> return SHA1
RSASSA-PKCS1-v1_5 using SHA-1 Attributes: identifier -65565 fullname RS1
62598f03283ffb24f3cf22f9
class header_write_hierarch_keywords_dict_test(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.pri = header().default() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> del self.pri <NEW_LINE> <DEDENT> def test_write_hierarch_keywords_dict(self): <NEW_LINE> <INDENT> print(se...
Are HIERARCH cards written to the header dict correctly?
62598f0371ff763f4b5e61b1
class ProgrammeMaintenanceManager(models.Manager): <NEW_LINE> <INDENT> def get_programmes_for_voiture(self, voiture=None, voiture_pk=None, user=None): <NEW_LINE> <INDENT> if voiture is None: <NEW_LINE> <INDENT> if voiture_pk is None or user is None: <NEW_LINE> <INDENT> raise Exception( "Les deux paramètres voiture_pk e...
Manager pour le modèle ProgrammeMaintenance
62598f03cc40096d61619700
class fork(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> self.fm.execute_command("i3-sensible-terminal -e ranger 2> /dev/null&")
:fork A command for forking a new ranger session in the same location as the current.
62598f03a05bb46b384892c5
class ProgressAPIHandler(UMBaseHandler): <NEW_LINE> <INDENT> @gpluslogin <NEW_LINE> def get(self): <NEW_LINE> <INDENT> progress = self.student.get_course_progress() <NEW_LINE> self.write_json(progress)
Handlers for /api/progress
62598f03aad79263cf42d25d
class TextAlignBaseTreeNode(TreeNode): <NEW_LINE> <INDENT> html_render_template = '<p class="text-{text_alignment}">{inner_html}</p>\n' <NEW_LINE> text_alignment = '' <NEW_LINE> def render_html(self, inner_html, **kwargs): <NEW_LINE> <INDENT> return self.html_render_template.format(text_alignment=self.text_alignment, i...
Base class for all text alignment tag class.
62598f034c34283577618d38
class HealthDiscoveryServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.StreamHealthCheck = channel.stream_stream( '/envoy.service.discovery.v2.HealthDiscoveryService/StreamHealthCheck', request_serializer=HealthCheckRequestOrEndpointHealthResponse.SerializeToString, response...
[#proto-status: experimental] HDS is Health Discovery Service. It compliments Envoy’s health checking service by designating this Envoy to be a healthchecker for a subset of hosts in the cluster. The status of these health checks will be reported to the management server, where it can be aggregated etc and redistribute...
62598f03377c676e912f628c
@dataclass <NEW_LINE> class ProfileConfig: <NEW_LINE> <INDENT> profile: str <NEW_LINE> user_id: int <NEW_LINE> api_response_user_get_device: Union[UserGetDeviceResponse, Exception] <NEW_LINE> api_response_measure_get_meas: Union[MeasureGetMeasResponse, Exception] <NEW_LINE> api_response_sleep_get_summary: Union[SleepGe...
Data representing a user profile.
62598f033617ad0b5ee04b7a
class Staff(Person): <NEW_LINE> <INDENT> def __init__(self, fname=None, lname=None): <NEW_LINE> <INDENT> super(Staff, self).__init__(fname=fname, lname=lname, role='STAFF')
Staff class inherits from super class Person. The class inherits all attributes and methods from the parent class. Initiates a staff, and assignes the staff role.
62598f0397e22403b3839930
class Chatlog(models.Model): <NEW_LINE> <INDENT> classroom = models.ForeignKey(Classroom, related_name="chat_entries") <NEW_LINE> user = models.ForeignKey(User) <NEW_LINE> message = models.TextField() <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> retu...
Stores text chat for project classrooms.
62598f03d486a94d0ba2aa16
class InvalidKeysException(Exception): <NEW_LINE> <INDENT> pass
The passed data contains keys that are not allowed
62598f045fdd1c0f98e5c9ef
class GetSpecificUser(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self, user_id): <NEW_LINE> <INDENT> user = User().get_user_by_id(user_id) <NEW_LINE> if user: <NEW_LINE> <INDENT> return{"message": user.serialize_user()}, 200 <NEW_LINE> <DEDENT> return{"message":"user {} not found".format(user_id)},...
Get a specific user by user_id.
62598f047b180e01f3e4856f
class SpeechRecognitionAlternative(object): <NEW_LINE> <INDENT> def __init__(self, transcript, confidence=None, timestamps=None, word_confidence=None): <NEW_LINE> <INDENT> self.transcript = transcript <NEW_LINE> self.confidence = confidence <NEW_LINE> self.timestamps = timestamps <NEW_LINE> self.word_confidence = word_...
SpeechRecognitionAlternative. :attr str transcript: A transcription of the audio. :attr float confidence: (optional) A score that indicates the service's confidence in the transcript in the range of 0.0 to 1.0. A confidence score is returned only for the best alternative and only with results marked as final. :attr li...
62598f04a05bb46b384892c7
class MNodeMessage(MMessage): <NEW_LINE> <INDENT> def addAttributeAddedOrRemovedCallback(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def addAttributeChangedCallback(*args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def addKeyableChangeOverride(*args, **kwargs): <NEW_LINE> <INDENT> pass <...
Class used to register callbacks for dependency node messages of specific dependency nodes. The class also provides the following AttributeMessage constants which describe the type of attribute changed/addedOrRemoved messages that has occurred: kConnectionMade #a connection has been made to an attribut...
62598f04be7bc26dc925138b
@gin.configurable <NEW_LINE> class ValueNetworkNewLeafRater(NewLeafRater): <NEW_LINE> <INDENT> def __call__(self, observation, model): <NEW_LINE> <INDENT> del observation <NEW_LINE> init_state = model.clone_state() <NEW_LINE> def step_and_rewind(action): <NEW_LINE> <INDENT> (observation, reward, done, _) = model.step(a...
Rates new leaves using a value network.
62598f0455399d3f05624f76
class TestIpamsvcReadIpamHostResponse(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 testIpamsvcReadIpamHostResponse(self): <NEW_LINE> <INDENT> pass
IpamsvcReadIpamHostResponse unit test stubs
62598f043d592f4c4edb9939
class RenderCopySettingsOPPreset(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "scene.render_copy_settings_preset" <NEW_LINE> bl_label = "Render: Copy Settings Preset" <NEW_LINE> bl_description = "Apply or clear this preset of render settings" <NEW_LINE> bl_option = {'REGISTER', 'UNDO'} <NEW_LINE> presets: EnumP...
Apply some presets of render settings to copy to other scenes
62598f04956e5f7376df4ba4
class AlreadyTakingCourseError(Exception): <NEW_LINE> <INDENT> pass
Exception used when the student is already taking the course.
62598f047c178a314d78beef
class WhenPerformingPrivateOperations(utils.BaseTestCase): <NEW_LINE> <INDENT> def test_get_plugin_meta(self): <NEW_LINE> <INDENT> class Value(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> <DEDENT> class OrderModel(object): <NEW_LINE> <INDENT> id = mo...
Tests private methods within certificate_resources.py.
62598f047b180e01f3e48570
class SimulatedExecutionHandler(ExecutionHandler): <NEW_LINE> <INDENT> def __init__(self,events): <NEW_LINE> <INDENT> self.events=events <NEW_LINE> <DEDENT> def execute_order(self,event): <NEW_LINE> <INDENT> if event.type=='ORDER': <NEW_LINE> <INDENT> fill_event=FillEvent(datetime.datetime.utcnow(), event.symbol, 'ARCA...
这是一个模拟的执行处理,简单的将所有的订单对象转化为等价的成交对象,不考虑 时延,滑价以及成交比率的影响。
62598f0431939e2706ed0f8a
class UserData(object,IDisposable): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Copy(source,destination): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def MoveUserDataFrom(objectWithUserData): <NEW_LINE> <INDENT> pass <NEW_LIN...
Provides a base class for custom classes of information which may be attached to geometry or attribute classes.
62598f04be7bc26dc925138c
class TestBaseAccountInfo(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 testBaseAccountInfo(self): <NEW_LINE> <INDENT> pass
BaseAccountInfo unit test stubs
62598f048a349b6b43684c95
class AdverbPhrase(Modifier): <NEW_LINE> <INDENT> def __init__(self, text: str = None, possibility: float = 0.5, confidence: float = 0.5, **variants): <NEW_LINE> <INDENT> Modifier.__init__(self, "AdverbPhrase", text, possibility, confidence, **variants) <NEW_LINE> <DEDENT> def to_adverb(self): <NEW_LINE> <INDENT> retur...
An adverb phrase.
62598f04f548e778e5969fd9
class VariationalMeanField(hk.Module): <NEW_LINE> <INDENT> def __init__(self, latent_size: int, hidden_size: int): <NEW_LINE> <INDENT> super().__init__(name="variational") <NEW_LINE> self._latent_size = latent_size <NEW_LINE> self._hidden_size = hidden_size <NEW_LINE> self.inference_network = hk.Sequential( [ hk.Flatte...
Mean field variational distribution q(z | x) parameterized by inference network.
62598f04ad47b63b2c5a626a
class HomeLocators(GeopostLocators): <NEW_LINE> <INDENT> INFO_MODAL = (By.ID, 'info') <NEW_LINE> ENTRY_TITLE = (By.ID, 'title') <NEW_LINE> ENTRY_BODY = (By.ID, 'body') <NEW_LINE> ENTRY_IMG = (By.ID, 'photo') <NEW_LINE> CLOSE_BTN = (By.ID, 'close-btn') <NEW_LINE> EDIT_BTN = (By.ID, 'edit-btn') <NEW_LINE> DELETE_BTN = (B...
Locators for the home page.
62598f0460cbc95b06362d84
class Command(Build): <NEW_LINE> <INDENT> verbosity = 1 <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> options['skip_static'] = True <NEW_LINE> options['skip_media'] = True <NEW_LINE> super(Command, self).handle(*args, **options)
An override of Django's base `build` command that changes some of the options to defaults we'd prefer here on this site.
62598f04bf627c535bcafec7
class GameLinescoreIntermissionInfo(object): <NEW_LINE> <INDENT> openapi_types = { 'intermission_time_remaining': 'float', 'intermission_time_elapsed': 'float', 'in_intermission': 'bool' } <NEW_LINE> attribute_map = { 'intermission_time_remaining': 'intermissionTimeRemaining', 'intermission_time_elapsed': 'intermission...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598f04adb09d7d5dc09003
class StreamingDataFrameSchemaError(Exception): <NEW_LINE> <INDENT> pass
Reveals an issue with inconsistant schemas.
62598f049f28863672817249
class OperationPaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[Operation]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(OperationPaged, self).__init__(*args, **kwargs)
A paging container for iterating over a list of :class:`Operation <azure.mgmt.batchai.models.Operation>` object
62598f0476e4537e8c3ee00f
class Error(Exception): <NEW_LINE> <INDENT> pass
Base exception for this module
62598f045fcc89381b265654
class SetMaxString(DebuggerSubcommand): <NEW_LINE> <INDENT> in_list = True <NEW_LINE> max_args = 1 <NEW_LINE> min_abbrev = len("str") <NEW_LINE> min_args = 1 <NEW_LINE> short_help = "Set maximum characters in showing strings" <NEW_LINE> def run(self, args): <NEW_LINE> <INDENT> Mcmdfns.run_set_int( self, " ".join(args),...
**set maxstring** *number* Set the number of characters allowed in showing string values See also: --------- `show maxstring`
62598f044f88993c371efa14
class Separatable(Protocol): <NEW_LINE> <INDENT> in_channels: Optional[int] <NEW_LINE> def forward_wav(self, wav: torch.Tensor, **kwargs) -> torch.Tensor: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> @property <NEW_LINE> def sample_rate(self) -> float: <NEW_LINE> <INDENT> ...
Things that are separatable.
62598f04a05bb46b384892ca
class TemplateNote(models.Model): <NEW_LINE> <INDENT> template = models.ForeignKey(Template) <NEW_LINE> owner = models.CharField(max_length=255, blank=True, null=True) <NEW_LINE> group = models.CharField(max_length=255, blank=True, null=True) <NEW_LINE> status = models.CharField(max_length=255, blank=True, null=True) <...
Simple text notes attached to a template record.
62598f04851cf427c66b6d1c
class EmailChangeForm(forms.Form): <NEW_LINE> <INDENT> email = forms.EmailField( label='Адрес электронной почты', max_length=254, widget=forms.EmailInput( attrs={'autocomplete': 'email', 'autofocus': True}) )
Форма изменения электронной почты
62598f04fff4ab517ebcc227
class ForemanTaskTestCase(APITestCase): <NEW_LINE> <INDENT> @tier1 <NEW_LINE> @run_only_on('sat') <NEW_LINE> @skip_if_bug_open('bugzilla', 1131702) <NEW_LINE> def test_negative_fetch_non_existent_task(self): <NEW_LINE> <INDENT> with self.assertRaises(HTTPError): <NEW_LINE> <INDENT> entities.ForemanTask(id='abc123').rea...
Tests for the ``foreman_tasks/api/v2/tasks/:id`` path.
62598f04283ffb24f3cf2300
class MemoryAccessUnit(Unit): <NEW_LINE> <INDENT> def __init__(self, ratio=(1, 16, 16), word_size=(8, 1, 1), raw_memory=None, input_address=std_logic.InputRegister): <NEW_LINE> <INDENT> ratio_product = 1 <NEW_LINE> for i in ratio: <NEW_LINE> <INDENT> ratio_product *= i <NEW_LINE> <DEDENT> address_space_size = int(math....
This unit provides basic functionality for accessing memory and preforming some user-defined action. See example of use in the ReadUnit.
62598f0476e4537e8c3ee011
class BinaryCrossEntropy( NNLoss ): <NEW_LINE> <INDENT> def __init__( self, node_name = "Loss_BinaryCrossEntropy_op" ): <NEW_LINE> <INDENT> self._loss_op = None <NEW_LINE> self._node_name = node_name <NEW_LINE> return <NEW_LINE> <DEDENT> def loss( self, t_holder, y_out_op ): <NEW_LINE> <INDENT> self._loss_op = -tf.redu...
2値のクロス・エントロピーの損失関数 NNLoss クラスの子クラスとして定義
62598f045fdd1c0f98e5c9f5
class AsignarPasswordForm(forms.Form): <NEW_LINE> <INDENT> error_messages = { 'password_mismatch': "Las dos contraseñas no coindicen.", } <NEW_LINE> new_password1 = forms.CharField(label="Nueva contraseña", widget=forms.PasswordInput) <NEW_LINE> new_password2 = forms.CharField(label="Confirmar contraseña", widget=forms...
Form que permite al usuario modificar su password sin ingresar el password anterior
62598f044f88993c371efa15
class gameInfo_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'gameId', None, None, ), ) <NEW_LINE> def __init__(self, gameId=None,): <NEW_LINE> <INDENT> self.gameId = gameId <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerate...
Attributes: - gameId
62598f047c178a314d78bef2
class Kickstarter(Platform): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.platformName = "Kickstarter" <NEW_LINE> self.tags = ["e-commerce", "professional"] <NEW_LINE> self.isValidMode = {} <NEW_LINE> self.isValidMode["phonefy"] = False <NEW_LINE> self.isValidMode["usufy"] = True <NEW_LINE> self.isV...
A <Platform> object for Kickstarter.
62598f04be7bc26dc925138e
class HelloApiViewSerializer(serializers.Serializer): <NEW_LINE> <INDENT> name = serializers.CharField(max_length=10)
Serializes a name field for testing our APIView.
62598f04fff4ab517ebcc229
class TestToStream(unittest.TestCase): <NEW_LINE> <INDENT> def testBasic(self): <NEW_LINE> <INDENT> for data in ["foo", "foo %s", "foo %(test)s", "foo %s %s", "", ]: <NEW_LINE> <INDENT> buf = StringIO() <NEW_LINE> cli._ToStream(buf, data) <NEW_LINE> self.failUnlessEqual(buf.getvalue(), data+'\n') <NEW_LINE> <DEDENT> <D...
Test the ToStream functions
62598f04f548e778e5969fdd
class DOMState(object): <NEW_LINE> <INDENT> def __init__(self, cwd, lines=None): <NEW_LINE> <INDENT> self.cwd = cwd <NEW_LINE> self.lines = [] <NEW_LINE> if lines: <NEW_LINE> <INDENT> for line in lines: <NEW_LINE> <INDENT> self.add_data(line) <NEW_LINE> <DEDENT> <DEDENT> self._failed_ = False <NEW_LINE> self._has_warni...
Small class to represent DOM states
62598f04ab23a570cc2d4297
class ActionReenroll(): <NEW_LINE> <INDENT> def __init__(self, *, tls_cert: bool = None, ecert: bool = None) -> None: <NEW_LINE> <INDENT> self.tls_cert = tls_cert <NEW_LINE> self.ecert = ecert <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_dict(cls, _dict: Dict) -> 'ActionReenroll': <NEW_LINE> <INDENT> args = {} ...
ActionReenroll. :attr bool tls_cert: (optional) Set to `true` to generate a new tls cert for this component via re-enrollment. :attr bool ecert: (optional) Set to `true` to generate a new ecert for this component via re-enrollment.
62598f0476e4537e8c3ee013
class StandardTableaux_size(StandardTableaux, DisjointUnionEnumeratedSets): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> StandardTableaux.__init__(self) <NEW_LINE> from sage.combinat.partition import Partitions_n <NEW_LINE> DisjointUnionEnumeratedSets.__init__(self, Family(Partitions_n(n), StandardTab...
Standard tableaux of fixed size `n`. EXAMPLES:: sage: [ t for t in StandardTableaux(1) ] [[[1]]] sage: [ t for t in StandardTableaux(2) ] [[[1, 2]], [[1], [2]]] sage: [ t for t in StandardTableaux(3) ] [[[1, 2, 3]], [[1, 3], [2]], [[1, 2], [3]], [[1], [2], [3]]] sage: StandardTableaux(4)[:...
62598f045fdd1c0f98e5c9f7
class Server(): <NEW_LINE> <INDENT> def __init__(self, port, password, method, host='0.0.0.0', timeout=180, udp=True, fast_open=True, **extra_config): <NEW_LINE> <INDENT> self._traffic = 0 <NEW_LINE> self._is_running = False <NEW_LINE> self.port = port <NEW_LINE> self.host = host <NEW_LINE> self._udp = udp <NEW_LINE> s...
Store configuration about one server instance.
62598f047c178a314d78bef4
class NaiveRayWeighter(RayWeighter): <NEW_LINE> <INDENT> def __init__(self, source_description): <NEW_LINE> <INDENT> self.source_description = source_description <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "NaiveRayWeighter()" <NEW_LINE> <DEDENT> def compute_weights(self, rays): <NEW_LINE> <INDENT...
RayWeighter that computes rays using naïve integration method that doesn't rely on difference of covered angles.
62598f045166f23b2e241e36
class DecodeException(CpuException): <NEW_LINE> <INDENT> def __init__(self, pc, bytes): <NEW_LINE> <INDENT> super(DecodeException, self).__init__("Error decoding instruction @%08x", pc) <NEW_LINE> self.pc=pc <NEW_LINE> self.bytes=bytes
Raised when trying to decode an unknown or invalid instruction
62598f04a05bb46b384892cf
class CountryStats(db.Model): <NEW_LINE> <INDENT> country = db.StringProperty() <NEW_LINE> bids_count = db.IntegerProperty() <NEW_LINE> frequent_words = db.TextProperty() <NEW_LINE> word_count = db.IntegerProperty() <NEW_LINE> unique_word_count = db.IntegerProperty() <NEW_LINE> average_rating = db.FloatProperty() <NEW_...
Class used to store statistics about a particular country, in the Appengine datastore.
62598f047047854f4633de1f
class MessagesNode(GroupingNode): <NEW_LINE> <INDENT> def _IsValidChild(self, child): <NEW_LINE> <INDENT> return isinstance(child, (message.MessageNode, misc.IfNode)) <NEW_LINE> <DEDENT> def ItemFormatter(self, t): <NEW_LINE> <INDENT> if t in ['rc_all', 'rc_translateable', 'rc_nontranslateable']: <NEW_LINE> <INDENT> fr...
The <messages> element.
62598f04a219f33f346c5285
class Dependency(jsl.Document): <NEW_LINE> <INDENT> class Options(object): <NEW_LINE> <INDENT> definition_id = 'dependency_object' <NEW_LINE> description = 'Dependency Object' <NEW_LINE> <DEDENT> ecosystem = jsl.StringField(required=True) <NEW_LINE> name = jsl.StringField(required=True) <NEW_LINE> version = jsl.OneOfFi...
JSL schema for Dependency object.
62598f04956e5f7376df4ba8
class SubscriptionAcknowledgement(FrozenClass): <NEW_LINE> <INDENT> def __init__(self, binary=None): <NEW_LINE> <INDENT> if binary is not None: <NEW_LINE> <INDENT> self._binary_init(binary) <NEW_LINE> self._freeze = True <NEW_LINE> return <NEW_LINE> <DEDENT> self.SubscriptionId = 0 <NEW_LINE> self.SequenceNumber = 0 <N...
:ivar SubscriptionId: :vartype SubscriptionId: UInt32 :ivar SequenceNumber: :vartype SequenceNumber: UInt32
62598f043d592f4c4edb9941
class EdbrowseWrapper: <NEW_LINE> <INDENT> def __init__(self): self.tDir,self.url,self.out = None,"about:blank",b"" <NEW_LINE> def new(self,index,*args): self.tDir,self.edEnv = setup_edbrowse(index) <NEW_LINE> def getTmp(self,*args): return self.tDir <NEW_LINE> def quit(self,*args): <NEW_LINE> <INDENT> if self.tDir: sh...
Experimental wrapper for edbrowse that behaves like WebdriverWrapper
62598f04adb09d7d5dc09009
class Restart(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> self.character.restart_command_list() <NEW_LINE> return self
Command that restarts a character's command list.
62598f04167d2b6e312b59f4
class Qpecgen201(Qpecgen200): <NEW_LINE> <INDENT> def __init__(self, pname, param): <NEW_LINE> <INDENT> super(Qpecgen201, self).__init__(pname, param, qpec_type=201) <NEW_LINE> <DEDENT> def _make_info(self): <NEW_LINE> <INDENT> md = self.param['m'] <NEW_LINE> l = self.param['l'] <NEW_LINE> second_deg = self.param['seco...
This subclass of ``qpecgen.box.Qpecgen200`` generates a more specific type of BOX-QPEC problem known as the FULL-BOX-QPEC. Type 201 is a more specific case of type 200 where x variables are constrained :math:`x_l \leq x \leq x_u` and y variables are constrained :math:`0 \leq y \leq y_u \leq 10` for integers :math:`x_l...
62598f045fc7496912d477a0
class Zwire(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass
Base class for Zwire SPI/other serial interfaces
62598f049f2886367281724f
class Carrier(object): <NEW_LINE> <INDENT> def __init__(self, id=None, name=None, logo_path=None): <NEW_LINE> <INDENT> self.swagger_types = { 'id': 'int', 'name': 'str', 'logo_path': 'str' } <NEW_LINE> self.attribute_map = { 'id': 'id', 'name': 'name', 'logo_path': 'logo_path' } <NEW_LINE> self._id = id <NEW_LINE> self...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f04aad79263cf42d269
class SimpleTokenizer: <NEW_LINE> <INDENT> def __init__(self, min_freq=16): <NEW_LINE> <INDENT> self.char2id = {} <NEW_LINE> self.MASK = 0 <NEW_LINE> self.UNKNOW = 1 <NEW_LINE> self.min_freq = min_freq <NEW_LINE> <DEDENT> def fit(self, X): <NEW_LINE> <INDENT> chars = collections.defaultdict(int) <NEW_LINE> for c in ite...
字转ID
62598f0455399d3f05624f7f
@register_cnfgen_subcommand <NEW_LINE> class GAutoCmdHelper(object): <NEW_LINE> <INDENT> name='gauto' <NEW_LINE> description='graph automorphism formula' <NEW_LINE> @staticmethod <NEW_LINE> def setup_command_line(parser): <NEW_LINE> <INDENT> SimpleGraphHelper.setup_command_line(parser) <NEW_LINE> <DEDENT> @staticmethod...
Command line helper for Graph Automorphism formula
62598f04a8370b77170eee37
class PageFlip(scanning.Group): <NEW_LINE> <INDENT> __gtype_name__ = "PisakPageFlip" <NEW_LINE> __gproperties__ = { "target": (PagerWidget.__gtype__, "", "", GObject.PARAM_READWRITE), } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._target = None <NEW_LINE> super().__init__() <NEW_LINE> <DEDENT> @property <NE...
A one-purpose only mechanism, wrapped into artificial scanning group, instantaneously flips a pager page when started.
62598f04fff4ab517ebcc22f
class pdg(object): <NEW_LINE> <INDENT> import pandas as pd <NEW_LINE> import pdg as pdgtmp <NEW_LINE> _Series=pd.Series <NEW_LINE> _fullnames=_Series(pdgtmp.pdgid_names) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.pdg_new_names=self._Series() <NEW_LINE> self.pdg_id=self._Series(self._fullna...
self.pdg_id[pid] -> returns name self.pdg_name[pname] -> returns pid self.pdg_new_names -> returns updated values self[pname]=pid -> Update Series
62598f04f548e778e5969fe3
class ActionClient(ClientBase): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> if name == '': <NEW_LINE> <INDENT> ClientBase.__init__(self, "actions") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ClientBase.__init__(self, "actions/" + name) <NEW_LINE> <DEDENT> <DEDENT> def close(self): <NEW_LINE> <I...
The ActionClient class provides an abstraction ontologenius action ROS services. This class is based on ClientBase and so ensure a persistent connection with the service based on. The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection f...
62598f04aad79263cf42d26b
class CpuInPower(Base): <NEW_LINE> <INDENT> unique_word = "thermal_power_cpu_get" <NEW_LINE> name = "cpu_in_power" <NEW_LINE> pivot = "cpus" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(CpuInPower, self).__init__( unique_word=self.unique_word, ) <NEW_LINE> <DEDENT> def _get_load_series(self): <NEW_LINE> <IN...
Process the cpufreq cooling power actor data in a ftrace dump
62598f048a349b6b43684c9f
class LoginForm(Form): <NEW_LINE> <INDENT> username = TextField('Username') <NEW_LINE> password = PasswordField('Password') <NEW_LINE> remember_me = BooleanField('Remember Me')
A form for users to login.
62598f040fa83653e46f393f
class FrameNotFinishedError(EmulatorError): <NEW_LINE> <INDENT> pass
Raised when an operation that must occur between frames is attempted while in the middle of a frame.
62598f04283ffb24f3cf2308
class Validator(base.Validator): <NEW_LINE> <INDENT> invalid = re.compile(r"FOO")
Found FOO
62598f043617ad0b5ee04b88
class MultinomialNB(BaseDiscreteNB): <NEW_LINE> <INDENT> def __init__(self, alpha=1.0, fit_prior=True, class_weight=None): <NEW_LINE> <INDENT> self.alpha = alpha <NEW_LINE> self.fit_prior = fit_prior <NEW_LINE> self.class_weight = class_weight <NEW_LINE> <DEDENT> def _count(self, X, Y): <NEW_LINE> <INDENT> if np.any((X...
Naive Bayes classifier for multinomial models The multinomial Naive Bayes classifier is suitable for classification with discrete features (e.g., word counts for text classification). The multinomial distribution normally requires integer feature counts. However, in practice, fractional counts such as tf-idf may also ...
62598f045fdd1c0f98e5c9fd
@handler.subscribe(OpenPortEvent, predicate=lambda p: p.port == 2379) <NEW_LINE> class EtcdRemoteAccess(Discovery): <NEW_LINE> <INDENT> def __init__(self, event): <NEW_LINE> <INDENT> self.event = event <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT> self.publish_event(EtcdAccessEvent())
Etcd service check for the existence of etcd service
62598f044a966d76dd5ed931
class SystemThroughput(CombinedEfficiency): <NEW_LINE> <INDENT> def __init__(self, wave=None, spectrograph=None, telescope=None): <NEW_LINE> <INDENT> values = inspect.getargvalues(inspect.currentframe()) <NEW_LINE> keys = numpy.array(values.args[2:]) <NEW_LINE> objects = numpy.array([values.locals[key] for key in keys]...
Define the full system throughput from the top of the telescope to the detector; i.e., ratio of detected-to-incident photons. Args: wave (array-like, optional): Wavelength vector at which to define the total efficiency. spectrograph (:class:`~enyo.etc.efficiency.Efficiency`, optional): ...
62598f047cff6e4e811b4443
class XQueueTestClient(Client): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def create_user(username, email, password): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> User.objects.get(username=username) <NEW_LINE> <DEDENT> except User.DoesNotExist: <NEW_LINE> <INDENT> User.objects.create_user(username, email, password) ...
Client that simulates input to the XQueue Since this is a subclass of Django's test client, we can use it to login and send HTTP requests.
62598f04851cf427c66b6d26
class RegressionPolicy(Policy): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> <DEDENT> def get_action(self, context): <NEW_LINE> <INDENT> features = context.get_ld_features() <NEW_LINE> L = context.get_L() <NEW_LINE> preds = self.model.predict(features) <NEW_LINE> idx ...
A RegressionPolicy object holds a sklearn model and can be used to get actions. Models should be regression models
62598f04656771135c4880e9
class Deformation(SquareTensor): <NEW_LINE> <INDENT> def __new__(cls, deformation_gradient): <NEW_LINE> <INDENT> obj = super(Deformation, cls).__new__(cls, deformation_gradient) <NEW_LINE> return obj.view(cls) <NEW_LINE> <DEDENT> def check_independent(self): <NEW_LINE> <INDENT> indices = list(zip(*np.asarray(self - np....
Subclass of SquareTensor that describes the deformation gradient tensor
62598f04fff4ab517ebcc231