code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class AltitudeAlgorithm(FlatAlgorithm): <NEW_LINE> <INDENT> def test_stations_altitude(self): <NEW_LINE> <INDENT> x = (0., 10., 10.) <NEW_LINE> y = (0, 0., 10.) <NEW_LINE> z = (2., 0., -2.) <NEW_LINE> zenith = arctan(4. / 10. / sqrt(2)) <NEW_LINE> t = [0., 0., 0.] <NEW_LINE> azimuth = pi / 4. <NEW_LINE> theta, phi = se...
Use this class to check the altitude support They should give similar results and errors in some cases.
6259905c4428ac0f6e659b68
class TogglePublic(BaseForm): <NEW_LINE> <INDENT> permission = RadioField( 'Permission', choices=[('public', 'Public'), ('private', 'Private')], validators=[DataRequired()])
Form to toggle the public ACL permission.
6259905c2c8b7c6e89bd4e19
class Node: <NEW_LINE> <INDENT> def __init__(self, name, isLeaf, nodeValue = None, counter = None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.children = [] <NEW_LINE> self.isLeaf = isLeaf <NEW_LINE> self.nodeValue = nodeValue <NEW_LINE> self.counter = counter <NEW_LINE> self.value = None <NEW_LINE> if self.n...
Node represents a node in the expression tree for recursively calculating top level Value
6259905cbaa26c4b54d508d1
class GsCoordinateTransformation(GsRefObject): <NEW_LINE> <INDENT> thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> raise AttributeError("No constructor defined") <NEW_LINE> <DEDENT> __repr__ = _swig_rep...
坐标转换基类
6259905c21a7993f00c67598
class PropertiesSearchMode(bb.Union): <NEW_LINE> <INDENT> _catch_all = 'other' <NEW_LINE> other = None <NEW_LINE> @classmethod <NEW_LINE> def field_name(cls, val): <NEW_LINE> <INDENT> return cls('field_name', val) <NEW_LINE> <DEDENT> def is_field_name(self): <NEW_LINE> <INDENT> return self._tag == 'field_name' <NEW_LIN...
This class acts as a tagged union. Only one of the ``is_*`` methods will return true. To get the associated value of a tag (if one exists), use the corresponding ``get_*`` method. :ivar str field_name: Search for a value associated with this field name.
6259905c3539df3088ecd8c7
class Pressable(Element): <NEW_LINE> <INDENT> def __init__(self, text="", elements=None, normal_params=None, press_params=None): <NEW_LINE> <INDENT> self.press_params = init_params(press_params) <NEW_LINE> super(Pressable, self).__init__(text, elements, normal_params) <NEW_LINE> self.set_painter(painterstyle.DEF_PAINTE...
Pressable Element
6259905c8da39b475be04812
class Genre(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=200, help_text='Enter a book genre (e.g. Science Fiction)') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Model representing a book genre.
6259905cf548e778e596cbb6
class PartOfSpeech(Component): <NEW_LINE> <INDENT> def __init__(self, content, link_attributes=None): <NEW_LINE> <INDENT> assert isinstance(content, GenericContent) <NEW_LINE> self.content = content <NEW_LINE> if link_attributes is not None: <NEW_LINE> <INDENT> assert isinstance(link_attributes, LinkAttributes) <NEW_LI...
partOfSpeech |= element xobis:pos { linkAttributes?, genericContent }
6259905cdd821e528d6da496
class LoginManager(gui.Tag): <NEW_LINE> <INDENT> def __init__(self, cookieInterface, session_timeout_seconds = 60, **kwargs): <NEW_LINE> <INDENT> super(LoginManager, self).__init__(**kwargs) <NEW_LINE> self.eventManager = gui._EventManager(self) <NEW_LINE> self.expired = True <NEW_LINE> self.session_uid = str(random.ra...
Login manager class allows to simply manage user access safety by session cookies It requires a cookieInterface instance to query and set user session id When the user login to the system you have to call login_manager.renew_session() #in order to force new session uid setup The session have to be refreshed each u...
6259905c8a43f66fc4bf37b9
class OrderInfo(models.Model): <NEW_LINE> <INDENT> ORDER_STATUS = ( ("TRADE_SUCCESS", "成功"), ("TRADE_CLOSED", "超时关闭"), ("WAIT_BUYER_PAY", "交易创建"), ("TRADE_FINISHED", "交易结束"), ("paying", "待支付"), ) <NEW_LINE> PAY_TYPE = ( ("alipay", "支付宝"), ("wechat", "微信"), ) <NEW_LINE> user = models.ForeignKey(User, on_delete=models.CA...
订单信息
6259905c38b623060ffaa365
class ExpectimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> move = self.maxPlyr(gameState, gameState.getNumAgents(), self.depth) <NEW_LINE> legalMoves = gameState.getLegalActions() <NEW_LINE> moveIndex = [index for index in range(len(legalMoves)) if legalMoves[i...
Your expectimax agent (question 4)
6259905c0c0af96317c57875
class Saltelli(object): <NEW_LINE> <INDENT> def __init__(self, dist, samples, poly=None, rule="R"): <NEW_LINE> <INDENT> self.dist = dist <NEW_LINE> samples_ = dist.sample(2*samples, rule=rule) <NEW_LINE> self.samples1 = samples_.T[:samples].T <NEW_LINE> self.samples2 = samples_.T[samples:].T <NEW_LINE> self.poly = poly...
Buffer class to be able to retrieve Saltelli matrices. The core of the method relies on cross-combining the columns of two random matrices as part of a double expectation. Examples: >>> dist = chaospy.Iid(chaospy.Uniform(), 2) >>> generator = Saltelli(dist, 3, rule="H") >>> print(generator[(False, False)...
6259905c4f6381625f199fb8
class ControllerBase(object): <NEW_LINE> <INDENT> def __init__(self, clock, broker, portfolio, strategies): <NEW_LINE> <INDENT> self._clock = clock <NEW_LINE> self._broker = broker <NEW_LINE> self._strategies = strategies <NEW_LINE> self._portfolio = portfolio <NEW_LINE> <DEDENT> def initialize(self, tick): <NEW_LINE> ...
A controller class takes care to run the actions returned by the strategies for each clock tick. How exactly this is implemented is deferred to the concrete subclass.
6259905c8e71fb1e983bd0f7
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = Column( UUID(as_uuid=True), primary_key=True, default=uuid4 ) <NEW_LINE> name = Column( Text, nullable=False, unique=True ) <NEW_LINE> appointments = orm.relationship( "Appointment", back_populates="user" )
The SQLAlchemy declarative model class for a User object.
6259905c07f4c71912bb0a69
class Eyes(object): <NEW_LINE> <INDENT> def __init__(self, face): <NEW_LINE> <INDENT> self.face = face <NEW_LINE> self.size = self.face.determine_facial_feature(feature_type="eye size") <NEW_LINE> self.shape = self.face.determine_facial_feature(feature_type="eye shape") <NEW_LINE> self.color = self.face.determine_facia...
A person's eyes.
6259905c63b5f9789fe8679f
class AssetItemURL(SingleAssetURL): <NEW_LINE> <INDENT> path: str <NEW_LINE> def get_assets( self, client: DandiAPIClient, order: Optional[str] = None, strict: bool = False ) -> Iterator[BaseRemoteAsset]: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> dandiset = self.get_dandiset(client, lazy=not strict) <NEW_LINE> asser...
Parsed from a URL that refers to a specific asset by path
6259905c0a50d4780f7068d5
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> use_in_migrations = True <NEW_LINE> def _create_user(self, username, email, password,role, **extra_fields): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError("Email is required") <NEW_LINE> <DEDENT> if not username: <NEW_LINE> <INDENT> raise V...
Define a model manager for User model with no username field.
6259905c6e29344779b01c7b
class ThreadTests(KBForumTestCase): <NEW_LINE> <INDENT> def test_watch_forum(self): <NEW_LINE> <INDENT> u = UserFactory() <NEW_LINE> self.client.login(username=u.username, password='testpass') <NEW_LINE> d = DocumentFactory() <NEW_LINE> post(self.client, 'wiki.discuss.watch_forum', {'watch': 'yes'}, args=[d.slug]) <NEW...
Test thread views.
6259905c7cff6e4e811b7072
class NotFound(ParcelBrightAPIException): <NEW_LINE> <INDENT> pass
Raised when server response is 404
6259905c21a7993f00c6759a
class PacanowskiPhilanderModelOptions(TurbulenceModelOptions): <NEW_LINE> <INDENT> name = 'Pacanowski-Philander turbulence closure model' <NEW_LINE> max_viscosity = PositiveFloat(5e-2, help=r"float: Constant maximum viscosity :math:`\nu_{max}`").tag(config=True) <NEW_LINE> alpha = PositiveFloat(10.0, help="float: Richa...
Options for Pacanowski-Philander turbulence model
6259905c7047854f463409ed
class AuditlogModelRegistry(object): <NEW_LINE> <INDENT> def __init__(self, create=True, update=True, delete=True, custom=None): <NEW_LINE> <INDENT> from auditlog.receivers import log_create, log_update, log_delete <NEW_LINE> self._registry = {} <NEW_LINE> self._signals = {} <NEW_LINE> if create: <NEW_LINE> <INDENT> se...
A registry that keeps track of the models that use Auditlog to track changes.
6259905ca8ecb03325872845
@dataclass <NEW_LINE> class Teacher: <NEW_LINE> <INDENT> first_name: str <NEW_LINE> second_name: str <NEW_LINE> full_name: str <NEW_LINE> abbreviation: str <NEW_LINE> email: str <NEW_LINE> phone: str <NEW_LINE> room: str <NEW_LINE> url: str
Class storing information about a teacher.
6259905c8da39b475be04814
class ResponseFactoryPreparator: <NEW_LINE> <INDENT> def __init__(self, response_factory): <NEW_LINE> <INDENT> self._response_factory = response_factory <NEW_LINE> <DEDENT> def prepare_fixed_response(self, fixed_response_class): <NEW_LINE> <INDENT> def _parser(response_type, parameters): <NEW_LINE> <INDENT> try: <NEW_L...
Class to prepare response factory.
6259905cf548e778e596cbb8
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = '29693eaa35867118e267082e9060d194'
Base config class.
6259905c009cb60464d02b63
class PeerObject: <NEW_LINE> <INDENT> def __init__(self, peer_info: PeerInfo): <NEW_LINE> <INDENT> self.__peer_info: PeerInfo = peer_info <NEW_LINE> self.__stub_manager: StubManager = None <NEW_LINE> self.__cert_verifier: PublicVerifier = None <NEW_LINE> self.__no_response_count = 0 <NEW_LINE> self.__create_live_data()...
Peer object has PeerInfo and live data
6259905ca79ad1619776b5d4
class UserDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> profile = serializers.SerializerMethodField('get_profile_data') <NEW_LINE> full_name = serializers.Field(source='get_full_name') <NEW_LINE> organizations = serializers.SerializerMethodField('list_organizations') <NEW_LINE> def get_profile_data...
Detailed serializer presenting user data. Meant to be read-only.
6259905ca219f33f346c7e34
class Component(Resource): <NEW_LINE> <INDENT> def __init__( self, options: Dict[str, str], session: ResilientSession, raw: Dict[str, Any] = None, ): <NEW_LINE> <INDENT> Resource.__init__(self, "component/{0}", options, session) <NEW_LINE> if raw: <NEW_LINE> <INDENT> self._parse_raw(raw) <NEW_LINE> <DEDENT> self.raw: D...
A project component.
6259905c0c0af96317c57876
class SecureValueTypeDriverLicense(TLObject): <NEW_LINE> <INDENT> __slots__ = [] <NEW_LINE> ID = 0x06e425c4 <NEW_LINE> QUALNAME = "types.SecureValueTypeDriverLicense" <NEW_LINE> def __init__(self, ): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *args) -> "SecureValueTypeDri...
Attributes: LAYER: ``112`` Attributes: ID: ``0x06e425c4`` No parameters required.
6259905c4e4d562566373a36
class InlineResponse500(object): <NEW_LINE> <INDENT> openapi_types = { 'http_code': 'int', 'http_status': 'str', 'internal_server_error': 'InlineResponse500InternalServerError' } <NEW_LINE> attribute_map = { 'http_code': 'http_code', 'http_status': 'http_status', 'internal_server_error': 'internal_server_error' } <NEW_...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
6259905c379a373c97d9a653
class IC_4077(Base_14pin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pins = [None, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] <NEW_LINE> self.pins = pinlist_quick(self.pins) <NEW_LINE> self.uses_pincls = True <NEW_LINE> self.set_IC({1: {'desc': 'A1: Input 1 of XNOR gate 1'}, 2: {'desc': 'B1: Input...
Quad 2 input XNOR gate Pin_3 = XNOR(Pin_1, Pin_2) Pin_4 = XNOR(Pin_5, Pin_6) Pin_10 = XNOR(Pin_8, Pin_9) Pin_11 = XNOR(Pin_12, Pin_13)
6259905c1b99ca400229004e
class DesignMatrix(): <NEW_LINE> <INDENT> def __init__(self, matrix, names, frametimes=None): <NEW_LINE> <INDENT> matrix_ = np.atleast_2d(matrix) <NEW_LINE> if matrix_.shape[1] != len(names): <NEW_LINE> <INDENT> raise ValueError( 'The number of names should equate the number of columns') <NEW_LINE> <DEDENT> if frametim...
This is a container for a light-weight class for design matrices This class is only used to make IO and visualization Class members ------------- matrix: array of shape(n_scans, n_regressors), the numerical specification of the matrix names: list of len (n_regressors); the names associated with the colu...
6259905c91f36d47f22319a6
class LogHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, type_name=None): <NEW_LINE> <INDENT> super(LogHandler, self).__init__() <NEW_LINE> self.type_name = type_name <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> <INDENT> if record.name.startswith('blueox'): <NEW_LINE> <INDENT> return <NEW_LIN...
Handler to provide log events as blueox events. Records standard fields such as logger name, level the message and if an exception was provided, the string formatted exception. The type name, if not specified will be something like '<my parent context>.log'
6259905c45492302aabfdb07
class Question(ndb.Model): <NEW_LINE> <INDENT> poll = ndb.IntegerProperty(indexed=True) <NEW_LINE> text = ndb.StringProperty(indexed=False) <NEW_LINE> questionType = ndb.StringProperty(indexed=False, default="MultipleChoice", choices=["MultipleChoice","Numeric"]) <NEW_LINE> def getChoices(self): <NEW_LINE> <INDENT> ret...
A question, which will be featured in a single poll.
6259905c32920d7e50bc7675
class SubmitFeedResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) <NEW_LINE> <DEDENT> def get_SubmissionResult(self): <NEW_LINE> <INDENT> return ...
A ResultSet with methods tailored to the values returned by the SubmitFeed Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
6259905c15baa723494635c1
class _QuadPhaseShifted(QuadPhase): <NEW_LINE> <INDENT> def __init__(self, z, **kwargs): <NEW_LINE> <INDENT> QuadPhase.__init__(self, z, **kwargs) <NEW_LINE> <DEDENT> def get_phasor(self, wave): <NEW_LINE> <INDENT> return accel_math._fftshift(super(_QuadPhaseShifted, self).get_phasor(wave))
Identical to class 'QuadPhase' except for array origin. This class provides a quadratic phase factor for application to FFT shifted wavefronts, with the origin in the corner. For centered "physical" coordinate system optics with an origin at the wavefront center use `QuadPhase`.
6259905c07f4c71912bb0a6b
class SPECTEQ(Effect): <NEW_LINE> <INDENT> instrument = "SPECTEQ" <NEW_LINE> pfields = () <NEW_LINE> def __init__(self, outsk=None, insk=None, dur=None, amp=None, ringdowndur=None, fftsize=None, windowsize=None, windowtype=None, overlap=None, inputchan=None, pan=None, *extra_args, **extra_kwargs): <NEW_LINE> <INDENT> s...
SPECTEQ(outsk, insk, dur, amp, ringdowndur, fftsize, windowsize, windowtype, overlap[, inputchan, pan {default: 0.5}])
6259905c627d3e7fe0e084ba
class CourseHomeMessageFragmentView(EdxFragmentView): <NEW_LINE> <INDENT> def render_to_fragment(self, request, course_id, user_access, **kwargs): <NEW_LINE> <INDENT> course_key = CourseKey.from_string(course_id) <NEW_LINE> course = get_course_with_access(request.user, 'load', course_key) <NEW_LINE> now = datetime.now(...
A fragment that displays a course message with an alert and call to action for three types of users: 1) Not logged in users are given a link to sign in or register. 2) Unenrolled users are given a link to enroll. 3) Enrolled users who get to the page before the course start date are given the option to add the start d...
6259905c8e7ae83300eea6bc
class User(TweettrBase): <NEW_LINE> <INDENT> id: int <NEW_LINE> id_str: str <NEW_LINE> name: str <NEW_LINE> screen_name: str <NEW_LINE> location: Optional[str] <NEW_LINE> url: Optional[str] <NEW_LINE> description: Optional[str] <NEW_LINE> protected: bool <NEW_LINE> verified: bool <NEW_LINE> followers_count: int <NEW_LI...
User see: https://developer.twitter.com/en/docs/tweets/data-dictionary/overview/user-object Attributes ---------- {attributes}
6259905ccb5e8a47e493cc9d
class SetCalibrationSpeed10Action(SetCalibrationSpeedAction): <NEW_LINE> <INDENT> name = 'setCalibrationSpeed10' <NEW_LINE> text = gettext('Speed Factor _10') <NEW_LINE> radioValue = 10
The calibration procedure is sped up by a factor of ten.
6259905c6e29344779b01c7d
class AdminDeleteExpenseTests(ManagerDeleteExpenseTests): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.current_client = self.admin_client <NEW_LINE> self.current_user = self.admin_user <NEW_LINE> <DEDENT> def main_test_for_user(self, user): <NEW_LINE> <INDENT> user_expense_ids = get_expense_ids_from_us...
Admin user can delete any Expense objects.
6259905c435de62698e9d434
class SignInPage(Handler): <NEW_LINE> <INDENT> def render_main(self, username="", error="", users=""): <NEW_LINE> <INDENT> self.render("signin.html", username=username, error=error, users=users) <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDENT> self.render_main() <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <IND...
Sign In Page Handler
6259905c30dc7b76659a0d98
class ViewsTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = Client() <NEW_LINE> self.obj1 = TestModel.objects.create() <NEW_LINE> self.obj2 = TestModel.objects.create() <NEW_LINE> <DEDENT> def test_like(self): <NEW_LINE> <INDENT> response = self.client.get("/like/tests-testmode...
Liking cannot be done programatically since it is tied too closely to a request. Do through-the-web tests.
6259905cf7d966606f7493d0
class Config(xtask.Task): <NEW_LINE> <INDENT> def __init__(self, directory_path, *args): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.directory_path = xtask.parse_path(directory_path) <NEW_LINE> self.args = [xtask.task_variables_to_value(arg) for arg in args] <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <IND...
Invoke configure script inside a directory.
6259905cf548e778e596cbb9
class PocketException(Exception): <NEW_LINE> <INDENT> pass
Base class for all pocket exceptions http://getpocket.com/developer/docs/errors
6259905c4e4d562566373a37
class CDBHandlerCheck(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 testConstructor(self): <NEW_LINE> <INDENT> h = Acspy.Common.CDBAccess.CDBhandler('target') <NEW_LINE> self.assertEqual('target'...
Test of the CDBhandler class.
6259905c3cc13d1c6d466d70
class BreakOutsideLoop(Message): <NEW_LINE> <INDENT> message = '\'break\' outside loop'
Indicates a break statement outside of a while or for loop.
6259905c435de62698e9d435
class Alphabet(object): <NEW_LINE> <INDENT> def __init__(self, alphabet, max_size=300, eos=None, unk='', sos=None): <NEW_LINE> <INDENT> self.unk_char = unk <NEW_LINE> self.eos_char = eos <NEW_LINE> self.sos_char = sos <NEW_LINE> self.max_size = max_size <NEW_LINE> def dict_to_list(char_dict, max_size): <NEW_LINE> <INDE...
Easily encode and decode strings using a set of characters.
6259905c38b623060ffaa367
class Channel: <NEW_LINE> <INDENT> def __init__(self, lines, offset, version, n_chan): <NEW_LINE> <INDENT> self.volt_range = struct.unpack('<H', lines[offset: offset + 2])[0] <NEW_LINE> offset += 2 <NEW_LINE> self.impedance = struct.unpack('<B', lines[offset:offset + 1])[0] <NEW_LINE> offset += 1 <NEW_LINE> if self.imp...
Information about a channel.
6259905c4f6381625f199fba
class TestHtmlView(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 testHtmlView(self): <NEW_LINE> <INDENT> model = flockos.models.html_view.HtmlView()
HtmlView unit test stubs
6259905c4e4d562566373a38
class TweetAnalyzer(): <NEW_LINE> <INDENT> def clean_tweet(self, tweet): <NEW_LINE> <INDENT> return ' '.join(re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)", " ", tweet).split()) <NEW_LINE> <DEDENT> def analyze_sentiment(self, tweet): <NEW_LINE> <INDENT> analysis = TextBlob(self.clean_tweet(tweet)) <NEW_LINE> ...
Functionality for analyzing and categorizing content from tweets.
6259905c1b99ca400229004f
class Main(object): <NEW_LINE> <INDENT> def __init__(self, socket_port, db_file): <NEW_LINE> <INDENT> self.__socket_port = socket_port <NEW_LINE> self.__event = threading.Event() <NEW_LINE> self.__db_file = db_file <NEW_LINE> self.__socket = None <NEW_LINE> self.__prepare_socket() <NEW_LINE> self.__supervisor = None <N...
Main class
6259905c8e71fb1e983bd0fa
class HostTimeStamp: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pid = b'\x1B' <NEW_LINE> self.cnt = b'\x01' <NEW_LINE> self.payload_len = int2bytearray(16, 2) <NEW_LINE> self.device_ts = b'\x00\x00\x00\x00' <NEW_LINE> self.host_ts = None <NEW_LINE> self.fletcher = b'\xFF\xFF\xFF\xFF' <NEW_LINE> <D...
Host timestamp data packet
6259905c15baa723494635c2
@pom.register_pages(pages.pages) <NEW_LINE> class Application(pom.App): <NEW_LINE> <INDENT> def __init__(self, url, *args, **kwgs): <NEW_LINE> <INDENT> super(Application, self).__init__( url, browser='Chrome', executable_path=config.CHROMEDRIVER_PATH, *args, **kwgs) <NEW_LINE> self.webdriver.maximize_window() <NEW_LINE...
Application to launch IMDB in browser.
6259905c23849d37ff8526f6
class ConstructorMix(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwa): <NEW_LINE> <INDENT> cls = self.__class__ <NEW_LINE> for key, val in kwa.items(): <NEW_LINE> <INDENT> if self.__table__.columns.has_key(key): <NEW_LINE> <INDENT> setattr(self, key, val) <NEW_LINE> <DEDENT> elif hasattr(cls, key): <NEW_LI...
This sets column values using constructor keyword args.
6259905c7d43ff2487427f28
class SHA1: <NEW_LINE> <INDENT> def getSHA1(self, token, timestamp, nonce, encrypt): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> sortlist = [token, timestamp, nonce, encrypt] <NEW_LINE> sortlist.sort() <NEW_LINE> sha = hashlib.sha1() <NEW_LINE> sha.update("".join(sortlist).encode("ascii")) <NEW_LINE> return ierror.WX...
计算公众平台的消息签名接口
6259905c627d3e7fe0e084bc
class Marca(TimeStampedModel): <NEW_LINE> <INDENT> name = models.CharField( 'Nombre', max_length=30 ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Marca' <NEW_LINE> verbose_name_plural = 'Marcas' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.name
Marca de un producto
6259905c0a50d4780f7068d7
class Quad(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> if not args: <NEW_LINE> <INDENT> raise InvalidIC('<null>') <NEW_LINE> <DEDENT> if args[0] not in QUADS.keys(): <NEW_LINE> <INDENT> errors.throw_invalid_quad_code(args[0]) <NEW_LINE> <DEDENT> if len(args) - 1 != QUADS[args[0]][0]: <NE...
Implements a Quad code instruction.
6259905c3617ad0b5ee0777c
class GadgetbridgeDatabase: <NEW_LINE> <INDENT> def __init__(self, filename, device): <NEW_LINE> <INDENT> self._db_filename = filename <NEW_LINE> self._db = sqlite3.connect(self._db_filename) <NEW_LINE> self._cursor = self._db.cursor() <NEW_LINE> self.results = ResultIterator(self._cursor) <NEW_LINE> self._query('SELEC...
Provides a simple abstraction layer around the Sqlite DB.
6259905ca8370b77170f19fe
class Config(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = {} <NEW_LINE> <DEDENT> def has(self, key): <NEW_LINE> <INDENT> return True if self._dot(key, False) is not False else False <NEW_LINE> <DEDENT> def get(self, key, default=None): <NEW_LINE> <INDENT> if isinstance(key, list): <...
Manages all the config items. Attributes: items (dict): Loaded config items.
6259905c2c8b7c6e89bd4e1f
class TwoFactorAuthenticationModelResponse(object): <NEW_LINE> <INDENT> _names = { "key" : "key", "uid" : "uid", "to" : "to" } <NEW_LINE> def __init__(self, key=None, uid=None, to=None, additional_properties = {}): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.uid = uid <NEW_LINE> self.to = to <NEW_LINE> self.addi...
Implementation of the 'Two Factor Authentication Model Response' model. TODO: type model description here. Attributes: key (string): TODO: type description here. uid (string): TODO: type description here. to (string): TODO: type description here.
6259905ce64d504609df9ee7
class Linear(object): <NEW_LINE> <INDENT> def __init__(self, start, end): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, Line): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> return not self == oth...
A straight line The base for Line() and Close().
6259905d76e4537e8c3f0bbe
class LogoutHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> cuser=self.get_current_user() <NEW_LINE> ip=self.request.remote_ip <NEW_LINE> self.clear_current_user() <NEW_LINE> goto=self.get_argument("next","/") <NEW_LINE> at=time.strftime("%Y-%m-%d %X",time.localtime()) <NEW_LINE> upsql="upd...
logout website
6259905d8e7ae83300eea6bf
class FilebeatCharm(CharmBase): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> self._elastic_ops_manager = ElasticOpsManager("filebeat") <NEW_LINE> event_handler_bindings = { self.on.install: self._on_install, self.on.start: self._on_start, self.on.upgrade_charm: s...
Filebeat charm.
6259905d10dbd63aa1c72193
class AssertionError(Exception): <NEW_LINE> <INDENT> pass
AssertionError.
6259905c7047854f463409f1
class Comments(Page): <NEW_LINE> <INDENT> id = "edit-comments" <NEW_LINE> title = _(u"Comments") <NEW_LINE> description = _(u"Manage your comments") <NEW_LINE> content_template_name = "editcomments.pt"
Dashboard page
6259905d462c4b4f79dbd037
class _vivante(Structure): <NEW_LINE> <INDENT> _fields_ = [("display", c_void_p), ("window", c_void_p)]
Window information for Vivante.
6259905df7d966606f7493d1
class TestModelTransactionalTestCase(TestModelMixin, TransactionTestCase): <NEW_LINE> <INDENT> pass
A TestCase Similar to `TestModelTestCase` but with transaction support.
6259905d16aa5153ce401b15
class Meta: <NEW_LINE> <INDENT> model = Ride <NEW_LINE> exclude = ('offered_in', 'passengers', 'rating', 'is_active')
Meta class
6259905d435de62698e9d436
class _Action(object): <NEW_LINE> <INDENT> _command = None <NEW_LINE> _arguments = None <NEW_LINE> check_hangup = True <NEW_LINE> def __init__(self, command, *arguments): <NEW_LINE> <INDENT> self._command = command <NEW_LINE> self._arguments = arguments <NEW_LINE> <DEDENT> @property <NEW_LINE> def command(self): <NEW_L...
Provides the basis for assembling and issuing an action via AGI.
6259905d99cbb53fe6832512
class TimedCache(AbstractCache): <NEW_LINE> <INDENT> def __init__(self, name, timeout, update_stamp=TRUE, cleanup_threshold=100): <NEW_LINE> <INDENT> super(TimedCache, self).__init__(name) <NEW_LINE> self.timeout = timeout <NEW_LINE> self.update_stamp = update_stamp <NEW_LINE> self.cleanup_threshold = cleanup_threshold...
<class internal="yes"> </class>
6259905d7d847024c075da03
class CreateRadFolder(QueenbeeTask): <NEW_LINE> <INDENT> _input_params = luigi.DictParameter() <NEW_LINE> @property <NEW_LINE> def view_filter(self): <NEW_LINE> <INDENT> return self._input_params['view_filter'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def input_model(self): <NEW_LINE> <INDENT> value = pathlib.Path(self...
Create a Radiance folder from a HBJSON input file.
6259905d24f1403a926863e7
class Option(object): <NEW_LINE> <INDENT> __slots__ = ["__name", "__value", "__otype"] <NEW_LINE> def __init__(self, value, otype): <NEW_LINE> <INDENT> self.__otype = otype <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self.__value <NEW_LINE> <DEDENT...
stores the an option for a class dervived from Base. contains both its value and type(value) to ensure that an option is not set to some bizzare value. Option objects should not be generated directly but will be made in an Options object that each class dervived from Base should contain :param value: the value of a gi...
6259905dadb09d7d5dc0bb9c
class M: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def do_nothing(): <NEW_LINE> <INDENT> return None
A Method Resolution Order Used To Describe Inheritance Properties From A Parent Class Towards Child-Classes.
6259905d4a966d76dd5f0524
class Strain(models.Model): <NEW_LINE> <INDENT> nomenclature = models.CharField( primary_key=True, max_length=100 ) <NEW_LINE> label = models.CharField( max_length=50, null=True, blank=True ) <NEW_LINE> species = models.ForeignKey( Species ) <NEW_LINE> url = models.URLField( null=True, blank=True, help_text="web page d...
Strain of a subject.
6259905d4e4d562566373a39
class ProbCheck(object): <NEW_LINE> <INDENT> def __init__(self, prob): <NEW_LINE> <INDENT> if isinstance(prob, dict): <NEW_LINE> <INDENT> self._prob = prob.items() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._prob = prob <NEW_LINE> <DEDENT> <DEDENT> def __call__(self, hour_of_day): <NEW_LINE> <INDENT> if isinsta...
Function object to randomly return True or False with probability This function object randomly returns true or false with a chance of success that can optionally vary given the hour of the day.
6259905d498bea3a75a59116
class TimeoutException(AnnotationException): <NEW_LINE> <INDENT> pass
Exception raised when the CoreNLP server timed out.
6259905d9c8ee82313040ca3
class PrefixMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, app, prefix=''): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> self.prefix = prefix <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> if environ['PATH_INFO'].startswith(self.prefix): <NEW_LINE> <INDENT> environ['PA...
Class to enable serving the app from a prefix
6259905d0c0af96317c57878
class GroupLine(dataLine): <NEW_LINE> <INDENT> def __init__(self,_root,_parent,_name): <NEW_LINE> <INDENT> dataLine.__init__(self, _root, _parent, _name) <NEW_LINE> self.expanded = False <NEW_LINE> self.toggle_button = Button(self,text='- '+_name,command=self.toggleCollapse,anchor="w") <NEW_LINE> self.childElements = [...
A group selector has an expand/collapse button to view or hide its children.
6259905d7b25080760ed87f9
class Profiler(object): <NEW_LINE> <INDENT> timer = None <NEW_LINE> stats = None <NEW_LINE> top_frame = None <NEW_LINE> top_code = None <NEW_LINE> _running = False <NEW_LINE> def __init__(self, timer=None, top_frame=None, top_code=None): <NEW_LINE> <INDENT> if timer is None: <NEW_LINE> <INDENT> timer = Timer() <NEW_LIN...
The profiler.
6259905d0a50d4780f7068d8
class PublicIPAddressDnsSettings(Model): <NEW_LINE> <INDENT> _attribute_map = { 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, 'fqdn': {'key': 'fqdn', 'type': 'str'}, 'reverse_fqdn': {'key': 'reverseFqdn', 'type': 'str'}, } <NEW_LINE> def __init__(self, *, domain_name_label: str=None, fqdn: str=None, r...
Contains FQDN of the DNS record associated with the public IP address. :param domain_name_label: Gets or sets the Domain name label.The concatenation of the domain name label and the regionalized DNS zone make up the fully qualified domain name associated with the public IP address. If a domain name label is specif...
6259905d01c39578d7f14250
class RemoteWebServer(): <NEW_LINE> <INDENT> def __init__(self, remote_url, connection_timeout=.25): <NEW_LINE> <INDENT> self.control_url = remote_url <NEW_LINE> self.time = 0. <NEW_LINE> self.angle = 0. <NEW_LINE> self.throttle = 0. <NEW_LINE> self.mode = 'user' <NEW_LINE> self.recording = False <NEW_LINE> self.sessio...
A controller that repeatedly polls a remote webserver and expects the response to be angle, throttle and drive mode.
6259905d4428ac0f6e659b70
class ToTensor(object): <NEW_LINE> <INDENT> def __call__(self, sample): <NEW_LINE> <INDENT> left = np.transpose(sample['left'], (2, 0, 1)) <NEW_LINE> sample['left'] = torch.from_numpy(left) / 255. <NEW_LINE> right = np.transpose(sample['right'], (2, 0, 1)) <NEW_LINE> sample['right'] = torch.from_numpy(right) / 255. <NE...
Convert numpy array to torch tensor
6259905dcc0a2c111447c5e8
class Battery(_Battery): <NEW_LINE> <INDENT> defaults = [ ('low_foreground', 'FF0000', 'font color when battery is low'), ( 'format', '{char} {percent:2.0%} {hour:d}:{min:02d}', 'Display format' ), ('charge_char', '^', 'Character to indicate the battery is charging'), ( 'discharge_char', 'V', 'Character to indicate the...
A simple but flexible text-based battery widget.
6259905d3617ad0b5ee0777f
class IndividualTagsColumn(CommunityTagsColumn): <NEW_LINE> <INDENT> def get_value(self, trans, grid, item): <NEW_LINE> <INDENT> return trans.fill_template( "/tagging_common.mako", tag_type="individual", user=trans.user, tagged_item=item, elt_context=self.grid_name, tag_click_fn="add_tag_to_grid_filter", use_toggle_lin...
Column that supports individual tags.
6259905d7047854f463409f3
class IRootDesigner(IDesigner, IDisposable): <NEW_LINE> <INDENT> def GetView(self, technology): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __enter__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, *args): <NEW_LI...
Provides support for root-level designer view technologies.
6259905d3539df3088ecd8cf
class ATF_Temperature(base.Parser,instruments.ATF,experiments.Temperature): <NEW_LINE> <INDENT> pass
Processes an ATF Temperature experiment.
6259905df7d966606f7493d2
class ConverterDialogTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dialog = ConverterDialog(None) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.dialog = None <NEW_LINE> <DEDENT> def test_dialog_ok(self): <NEW_LINE> <INDENT> button = self.dialog.button_box.butt...
Test dialog works.
6259905dd99f1b3c44d06cd5
class AWS(Source): <NEW_LINE> <INDENT> BUCKET = "bucket" <NEW_LINE> REPORT_PREFIX = "report_prefix" <NEW_LINE> REPORT_NAME = "report_name" <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> self.access_key = os.environ.get("AWS_ACCESS_KEY_ID") <NEW_LINE> self.secret = os.enviro...
Defining the AWS source class.
6259905d99cbb53fe6832514
class ReplaySimulator(object): <NEW_LINE> <INDENT> def __init__(self, n_visits, reward_history, item_col_name, visitor_col_name, reward_col_name, n_iterations=1, random_seed=1): <NEW_LINE> <INDENT> np.random.seed(random_seed) <NEW_LINE> self.reward_history = reward_history <NEW_LINE> self.item_col_name = item_col_name ...
A class to provide base functionality for simulating the replayer method for online algorithms.
6259905d16aa5153ce401b17
class DeleteFromCartView(CartMixin, View): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> product_slug = kwargs.get('slug') <NEW_LINE> product = Product.objects.get(slug=product_slug) <NEW_LINE> cart_product = CartProduct.objects.get( user=self.cart.owner, cart=self.cart, product=produ...
Удаление товаров из корзины
6259905df548e778e596cbbd
class TestPropertyExclusive(BaseRuleTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestPropertyExclusive, self).setUp() <NEW_LINE> self.collection.register(Exclusive()) <NEW_LINE> <DEDENT> def test_file_positive(self): <NEW_LINE> <INDENT> self.helper_file_positive() <NEW_LINE> <DEDENT> def te...
Test Exclusive Property Configuration
6259905d097d151d1a2c26a2
class CreateDomainRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ListenerId = None <NEW_LINE> self.Domain = None <NEW_LINE> self.CertificateId = None <NEW_LINE> self.ClientCertificateId = None <NEW_LINE> self.PolyClientCertificateIds = None <NEW_LINE> <DEDENT> def _deserialize(...
CreateDomain请求参数结构体
6259905d379a373c97d9a658
class packet_header(IntEnum): <NEW_LINE> <INDENT> FILE_TRANSFER_HEADER = 0x00 <NEW_LINE> FILE_TRANSFER_DATA = 55
headers to identify Packets
6259905dadb09d7d5dc0bb9e
class ApplicationDefaults: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def list(): <NEW_LINE> <INDENT> return []
Enumeration of default application settings
6259905d498bea3a75a59117
class HydraulicCoolingCost2015(om.ExplicitComponent): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.add_input("hvac_mass", 0.0, units="kg") <NEW_LINE> self.add_input("hvac_mass_cost_coeff", 124.0, units="USD/kg") <NEW_LINE> self.add_output("hvac_cost", 0.0, units="USD") <NEW_LINE> <DEDENT> def compute(s...
Compute hydraulic cooling cost in the form of :math:`cost = k*mass`. Value of :math:`k` was NOT updated in 2015 and remains the same as original CSM, $124.0 USD/kg. Cost includes materials and manufacturing costs. Parameters ---------- hvac_mass : float, [kg] component mass hvac_mass_cost_coeff : float, [USD/kg] ...
6259905d3cc13d1c6d466d74
class Message: <NEW_LINE> <INDENT> def __init__(self, author, sentence): <NEW_LINE> <INDENT> self.author = author <NEW_LINE> self.sentence = sentence <NEW_LINE> <DEDENT> def compilated_message(self): <NEW_LINE> <INDENT> return [self.author, self.sentence]
This class represents model of massage in talkbox
6259905dbe8e80087fbc06b8
class ToolEditorDrill(ToolEditorImage): <NEW_LINE> <INDENT> def __init__(self, editor): <NEW_LINE> <INDENT> super(self.__class__, self).__init__(editor, 'drill.svg', 'dS', '') <NEW_LINE> <DEDENT> def quantityCuttingEdgeAngle(self, propertyToDisplay): <NEW_LINE> <INDENT> if propertyToDisplay: <NEW_LINE> <INDENT> return ...
Tool parameter editor for drills.
6259905d4f6381625f199fbc
class BinaryOperation: <NEW_LINE> <INDENT> __ops = {'+': lambda x, y: Number(x.value + y.value), '-': lambda x, y: Number(x.value - y.value), '*': lambda x, y: Number(x.value * y.value), '/': lambda x, y: Number(x.value // y.value), '%': lambda x, y: Number(x.value % y.value), '==': lambda x, y: Number(x.value == y.val...
BinaryOperation - представляет бинарную операцию над двумя выражениями. Результатом вычисления бинарной операции является объект Number. Поддерживаемые операции: “+”, “-”, “*”, “/”, “%”, “==”, “!=”, “<”, “>”, “<=”, “>=”, “&&”, “||”.
6259905d009cb60464d02b6a
class ArticleImagePipeline(ImagesPipeline): <NEW_LINE> <INDENT> def item_completed(self, results, item, info): <NEW_LINE> <INDENT> if "front_image_url" in item: <NEW_LINE> <INDENT> for ok, value in results: <NEW_LINE> <INDENT> image_file_path = value['path'] <NEW_LINE> <DEDENT> item['front_image_path'] = image_file_pat...
重写 ImagesPipeline 的 item_completed方法, 获取图片路径
6259905d7b25080760ed87fa
class BaricadrNotImplementedError(Exception): <NEW_LINE> <INDENT> pass
Raised when there are not endpoint associated with this function
6259905d16aa5153ce401b18