code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class FloorsAboveGrade(BSElement): <NEW_LINE> <INDENT> element_type = "xs:integer"
Number of floors which are fully above ground.
62598f93507cdc57c63a4a22
class PwApp(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> tk.Frame.__init__(self, master) <NEW_LINE> master.resizable(False, False) <NEW_LINE> self.pw_fail_cnt = 0 <NEW_LINE> top = self.top = master <NEW_LINE> lable_pw = tk.Label(top, text="Password") <NEW_LINE> self.raw_pw = tk.Entry(t...
Password UI
62598f936e29344779b002e8
class UpdateJobDetails(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'contact_details': {'key': 'contactDetails', 'type': 'ContactDetails'}, 'shipping_address': {'key': 'shippingAddress', 'type': 'ShippingAddress'}, 'key_encryption_key': {'key': 'keyEncryptionKey', 'type': 'KeyEncryptionKey'}, } <...
Job details for update. :param contact_details: Contact details for notification and shipping. :type contact_details: ~azure.mgmt.databox.models.ContactDetails :param shipping_address: Shipping address of the customer. :type shipping_address: ~azure.mgmt.databox.models.ShippingAddress :param key_encryption_key: Key en...
62598f9307f4c71912baf0d9
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, password=None, **extra_fields): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('Users must have an email address') <NEW_LINE> <DEDENT> email = self.normalize_email(email) <NEW_LINE> user = self.model(email=email...
Manager for user profiles
62598f9307d97122c421693e
@register_op <NEW_LINE> class PadMultiScaleTest(BaseOperator): <NEW_LINE> <INDENT> def __init__(self, pad_to_stride=0): <NEW_LINE> <INDENT> super(PadMultiScaleTest, self).__init__() <NEW_LINE> self.pad_to_stride = pad_to_stride <NEW_LINE> <DEDENT> def __call__(self, samples, context=None): <NEW_LINE> <INDENT> coarsest_...
Pad the image so they can be divisible by a stride for multi-scale testing. Args: pad_to_stride (int): If `pad_to_stride > 0`, pad zeros to ensure height and width is divisible by `pad_to_stride`.
62598f93be8e80087fbbeced
class PressureTransducer(): <NEW_LINE> <INDENT> def __init__(self, name, channel, purpose, pressureRange, scale, displayed): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.channel = channel <NEW_LINE> self.purpose = purpose <NEW_LINE> self.pressureRange = pressureRange <NEW_LINE> self.scale = scale <NEW_LINE> sel...
Constructor @param name: string identifier of this interface @param channel: channel of this interface on the ADC @param purpose: string descriptor @param pressureRange: maximum pressure value, in PSI @param scale: voltage to PSI scaling factor @param displayed: boolean true/false for UI
62598f9391af0d3eaad39a95
class ListSageNBHandler(IPythonHandler): <NEW_LINE> <INDENT> def notebook_iter(self): <NEW_LINE> <INDENT> dot_sage = os.path.expanduser(DOT_SAGE) <NEW_LINE> notebooks = dict( (notebook.sort_key, notebook) for notebook in NotebookSageNB.all_iter(dot_sage) ) <NEW_LINE> for key in sorted(notebooks.keys()): <NEW_LINE> <IND...
Return a web page that lists the current SageNB worksheets
62598f93a79ad16197769cf0
class NotAbsolute(exception.DNSException): <NEW_LINE> <INDENT> pass
An absolute domain name is required but a relative name was provided.
62598f93d99f1b3c44d0533e
class TableauNoir: <NEW_LINE> <INDENT> print("Classe TableauNoir") <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.surface = "" <NEW_LINE> <DEDENT> def ecrire(self, message_a_ecrire): <NEW_LINE> <INDENT> if self.surface != "": <NEW_LINE> <INDENT> self.surface += "\n" <NEW_LINE> <DEDENT> self.surface += message_...
Classe definissant une surface sur laquelle on peut ecrire, que l'on peut lire et effacer, par jeu de methodes. L'attribut modifie est 'surface'
62598f93baa26c4b54d4ef3e
class LDAPGroup(Group): <NEW_LINE> <INDENT> supports_member_list = True <NEW_LINE> def __init__(self, provider, name, dn): <NEW_LINE> <INDENT> super(LDAPGroup, self).__init__(provider, name) <NEW_LINE> self.dn = dn <NEW_LINE> <DEDENT> @property <NEW_LINE> def ldap_settings(self): <NEW_LINE> <INDENT> return self.provide...
A group from the LDAP identity provider
62598f938da39b475be02e72
class Path(str): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(Path, self).__init__(path) <NEW_LINE> <DEDENT> @property <NEW_LINE> def isdir(self): <NEW_LINE> <INDENT> return os.path.isdir(self) <NEW_LINE> <DEDENT> @property <NEW_LINE> def exists(self): <NEW_LINE> <INDENT> return os.path.exist...
Path object for manipulating directory and file paths.
62598f93fbf16365ca793d44
class GroupRounds(BaseSchema): <NEW_LINE> <INDENT> __tablename__ = "group_rounds" <NEW_LINE> id = Column(Integer, Sequence('grpround_id_seq', start=10), primary_key=True) <NEW_LINE> name = Column(Unicode(40)) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "<GroupRound(name={0})>".format(self.name)
Group Rounds data model.
62598f93d53ae8145f91811d
class User(ndb.Model): <NEW_LINE> <INDENT> roles = ndb.KeyProperty(repeated=True) <NEW_LINE> superadmin = ndb.BooleanProperty(default=False) <NEW_LINE> @property <NEW_LINE> def role_names(self): <NEW_LINE> <INDENT> return [name.string_id() for name in self.roles] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_user...
Datastore model representing a user. Attributes: roles: list, a list of roles the user belongs to. superadmin: bool, whether the user is a superadmin which grants all permissions by default.
62598f934a966d76dd5eeb70
class GeometricTransformation: <NEW_LINE> <INDENT> def __init__( self, input_x_axis: Tuple[float, float], input_y_axis: Tuple[float, float], output_x_axis: Tuple[float, float], output_y_axis: Tuple[float, float], ): <NEW_LINE> <INDENT> self.input_x_axis = input_x_axis <NEW_LINE> self.input_y_axis = input_y_axis <NEW_LI...
Geometric transformations from one coordinate system to another
62598f934e696a045264dc51
class LoneAPI(): <NEW_LINE> <INDENT> def __init__(self, cfg=None): <NEW_LINE> <INDENT> self._name = self.__class__.format_name() <NEW_LINE> self._request = None <NEW_LINE> self._cfg = cfg <NEW_LINE> if self.mode == 'server': <NEW_LINE> <INDENT> self.services = importlib.import_module( 'laf.server.app.services' ) <NEW_L...
Lone API class
62598f9363d6d428bbee244d
class TestReadSpdsFromCsvFile(unittest.TestCase): <NEW_LINE> <INDENT> def test_read_spds_from_csv_file(self): <NEW_LINE> <INDENT> colour_checker_n_ohta = os.path.join(RESOURCES_DIRECTORY, 'colorchecker_n_ohta.csv') <NEW_LINE> spds = read_spds_from_csv_file(colour_checker_n_ohta) <NEW_LINE> for spd in spds.values(): <NE...
Defines :func:`colour.io.tabular.read_spds_from_csv_file` definition units tests methods.
62598f9385dfad0860cbf8bb
class EddyCurrentCorrection(object): <NEW_LINE> <INDENT> NONE = 0 <NEW_LINE> SIMPLE = 1 <NEW_LINE> MIN_NOISE_FILTER = 0.1 <NEW_LINE> MAX_NOISE_FILTER = 100.0 <NEW_LINE> choices = ordered_dict( ( (NONE , "Off"), (SIMPLE , "Simple"), ) )
Eddy current correction constants
62598f938a43f66fc4bf1e0b
class FIMFASSETCLASS(List): <NEW_LINE> <INDENT> memberTags = ['FIPORTION', ]
OFX section 13.8.5.3
62598f93a4f1c619b294e27c
class DebugControlString(DebugControl): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> super(DebugControlString, self).__init__(options, StringIO()) <NEW_LINE> <DEDENT> def get_output(self): <NEW_LINE> <INDENT> return self.raw_output.getvalue()
A `DebugControl` that writes to a StringIO, for testing.
62598f93d7e4931a7ef3bd33
@tf_export( "initializers.uniform_unit_scaling", v1=[ "initializers.uniform_unit_scaling", "uniform_unit_scaling_initializer" ]) <NEW_LINE> @deprecation.deprecated_endpoints("uniform_unit_scaling_initializer") <NEW_LINE> class UniformUnitScaling(Initializer): <NEW_LINE> <INDENT> @deprecated(None, "Use tf.initializers.v...
Initializer that generates tensors without scaling variance. When initializing a deep network, it is in principle advantageous to keep the scale of the input variance constant, so it does not explode or diminish by reaching the final layer. If the input is `x` and the operation `x * W`, and we want to initialize `W` u...
62598f9323e79379d538c196
class BaseTitled(Frame, value_title_mixin): <NEW_LINE> <INDENT> @overload <NEW_LINE> def __init__(self, master, cls: Type, RowPadding: int, factor: int, frame: Dict[str, Any], title: str, **value_kwargs: Union[Placement, str, int]): ... <NEW_LINE> @overload <NEW_LINE> def __init__(self, master, cls: Type, RowPadding: i...
When subclassed, pairs the class type with the title label, wrapped in a grid. Example: class TitledEntry(BaseTitled): def __init__(self, master, *, RowPadding: int = 1, factor: int = 3, value: Dict = { }, title: Dict = { }, cls: Type[Entry] = Entry, **kwargs): assert (issubclass(cls, Entry)) ...
62598f9332920d7e50bc5cf0
class Residue(object): <NEW_LINE> <INDENT> def __init__(self, res, nres, chain, atoms): <NEW_LINE> <INDENT> self.res = res <NEW_LINE> self.nres = nres <NEW_LINE> self.chain = chain <NEW_LINE> self.atoms = atoms <NEW_LINE> self._dict = {a.atom: a for a in atoms} <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_atoms...
Container for a residue
62598f938e71fb1e983bb745
class Adapter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.bot = None <NEW_LINE> <DEDENT> def start(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> def send_message(self, nick, msg): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_users(self): <NEW_LINE> <INDENT> ret...
An adapter represents a connection to some sort of user-interface which can send and receive messages.
62598f931f037a2d8b9e3d72
class TwoSum(object): <NEW_LINE> <INDENT> def two_sum(self, numbers, target): <NEW_LINE> <INDENT> if type(numbers) is not list: <NEW_LINE> <INDENT> raise ValueError('wrong input of numbers') <NEW_LINE> <DEDENT> if type(target) is not int: <NEW_LINE> <INDENT> raise ValueError('wrong input of target') <NEW_LINE> <DEDENT>...
Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices(索引) of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are not zero-b...
62598f93a17c0f6771d5becb
class RPC(object): <NEW_LINE> <INDENT> __slots__ = ('readonly', 'instantiate', 'result', 'check_access', 'unique') <NEW_LINE> def __init__(self, readonly=True, instantiate=None, result=None, check_access=True, unique=True): <NEW_LINE> <INDENT> self.readonly = readonly <NEW_LINE> self.instantiate = instantiate <NEW_LINE...
Define RPC behavior readonly: The transaction mode instantiate: The position or the slice of the arguments to be instanciated result: The function to transform the result check_access: If access right must be checked unique: Check instances are unique
62598f9330bbd722464697bf
class LauncherAdapter(object): <NEW_LINE> <INDENT> redis = None <NEW_LINE> def __init__(self, site, message, settings): <NEW_LINE> <INDENT> self.logger = logging.getLogger("RAPDLogger") <NEW_LINE> self.logger.debug("__init__") <NEW_LINE> self.site = site <NEW_LINE> self.message = message <NEW_LINE> self.settings = sett...
RAPD adapter for launcher process Doesn't launch the job, but merely echoes it back
62598f9307d97122c4216940
class EditComment(View): <NEW_LINE> <INDENT> def get(self,request,*args,**kwargs): <NEW_LINE> <INDENT> idea_id = request.GET.get('ideaId') <NEW_LINE> comment_id = request.GET.get('commId') <NEW_LINE> parentNodeId = request.GET.get('parentNodeId') <NEW_LINE> idea = get_object_or_404(Idea,id=idea_id) <NEW_LINE> comment =...
vars in request not in kwargs from front via ajax
62598f93097d151d1a2c0cbd
class ForecastEntry: <NEW_LINE> <INDENT> def __init__(self, date, transaction, balance): <NEW_LINE> <INDENT> self.date = date <NEW_LINE> self.transaction = transaction <NEW_LINE> self.balance = balance <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return (self.date == other.date and self.transaction ...
Transaction at a specific date in a forecast.
62598f9316aa5153ce400192
class PlanetsLayer(SourceLayer): <NEW_LINE> <INDENT> def initialize_astro_sources(self, sources): <NEW_LINE> <INDENT> for key in res.keys(): <NEW_LINE> <INDENT> p = Planet(key, res[key][0], res[key][1], res[key][2]) <NEW_LINE> sources.append(PlanetSource(p, self.model)) <NEW_LINE> <DEDENT> <DEDENT> def get_layer_id(sel...
Manages displaying the other planets, the sun and the moon.
62598f933c8af77a43b67d83
class weewx_sdist(sdist): <NEW_LINE> <INDENT> def copy_file(self, f, install_dir, **kwargs): <NEW_LINE> <INDENT> if f == 'weewx.conf': <NEW_LINE> <INDENT> import configobj <NEW_LINE> config = configobj.ConfigObj(f, interpolation=False, encoding='utf-8') <NEW_LINE> for section in ['StdRESTful', 'StdReport']: <NEW_LINE> ...
Specialized version of sdist which checks for password information in the configuration file before creating the distribution. For other sdist methods, see: http://epydoc.sourceforge.net/stdlib/distutils.command.sdist.sdist-class.html
62598f9323e79379d538c197
class EOF: <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "<EOF>" <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "EOF"
Represents an end-of-file condition when reading.
62598f93e76e3b2f99fd86c9
class Comment(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey("UserProfile") <NEW_LINE> content = models.CharField(max_length=500) <NEW_LINE> comment_date = models.DateTimeField(auto_now=True) <NEW_LINE> article = models.ForeignKey("Article") <NEW_LINE> parent_comment = models.ForeignKey('self',related_name...
文章的评论
62598f9391af0d3eaad39a98
class WithdrawAddAddress(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.currency = "LTC" <NEW_LINE> self.address = "mwewY6WqmYuuQ9xvm9wr5ZP6PsrUPvFdPV" <NEW_LINE> self.email = "bottest@example.com" <NEW_LINE> <DEDENT> def test_withdraw_add_address_success(self): <NEW_LINE> <INDENT> re...
测试添加提现地址
62598f93eab8aa0e5d30ba12
class GradCAMpp(GradCAM): <NEW_LINE> <INDENT> def __init__(self, net: nn.Module, **kwargs): <NEW_LINE> <INDENT> super().__init__(net, **kwargs) <NEW_LINE> <DEDENT> def _get_weights(self, labels: torch.Tensor) -> torch.Tensor: <NEW_LINE> <INDENT> conv_out = self.conv_out[-1] <NEW_LINE> grad = self.grad.pop() <NEW_LINE>...
Grad-CAM++: Improved Visual Explanations for Deep Convolutional Networks (Chattopadhyay et al. 2017)
62598f93e5267d203ee6b5aa
@attr.s(auto_exc=True) <NEW_LINE> class APIError(Exception): <NEW_LINE> <INDENT> code = attr.ib( validator=attr.validators.optional(attr.validators.instance_of(int)), ) <NEW_LINE> reason = attr.ib(validator=attr.validators.instance_of(str)) <NEW_LINE> extra_fields = attr.ib( default=None, validator=attr.validators.opti...
An error to be reported from the API. :ivar reason unicode: The message to be returned as the ``reason`` key of the error response. :ivar code int: The HTTP status code to use for this error.
62598f9316aa5153ce400193
class Address: <NEW_LINE> <INDENT> def __init__(self, street, city, state, zipcode, street2=''): <NEW_LINE> <INDENT> self.street = street <NEW_LINE> self.street2 = street2 <NEW_LINE> self.city = city <NEW_LINE> self.state = state <NEW_LINE> self.zipcode = zipcode <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDEN...
Мы реализовали базовый класс адресов, который содержит обычные компоненты для адреса. Сделали атрибут street2 необязательным, поскольку не все адреса будут иметь этот компонент. Реализовали __str__(), чтобы обеспечить красивое представление Address Когда вы выводите на экран переменную address, вызывается специальный...
62598f9310dbd63aa1c70851
class Greeter(object): <NEW_LINE> <INDENT> async def say_hello(self, msg: HelloRequest) -> HelloReply: <NEW_LINE> <INDENT> raise NotImplementedError
The greeting service definition.
62598f93b830903b9686e2bd
class Recipient(models.Model): <NEW_LINE> <INDENT> TYPE = ( ('friend', 'friend'), ('family', 'family') ) <NEW_LINE> name = models.CharField(max_length=256) <NEW_LINE> relation = models.CharField(max_length=16, choices=TYPE) <NEW_LINE> giver = models.ForeignKey('HolidayUser', related_name='recipients') <NEW_LINE> class ...
An object representing the gift recipient.
62598f93f8510a7c17d7dfc0
class RegisterReminder: <NEW_LINE> <INDENT> start_date = None <NEW_LINE> end_date = None <NEW_LINE> connection = None <NEW_LINE> tree = None <NEW_LINE> def __init__(self, start_date, end_date, stage): <NEW_LINE> <INDENT> logger.info("RegisterReminder({0}. {1}, {2}".format(start_date, end_date, stage)) <NEW_LINE> self.s...
A class to setup and execute a register reminder
62598f93379a373c97d98ca4
class ChainingGeneHashTable(BaseGeneHashTable): <NEW_LINE> <INDENT> def __init__(self, table_size): <NEW_LINE> <INDENT> super().__init__(table_size) <NEW_LINE> self.hash_table = [GeneLinkedList() for _ in range(table_size)] <NEW_LINE> self.n_slots = table_size <NEW_LINE> self.comparisons = 0 <NEW_LINE> self.hashes = 0 ...
A Chaining Gene Hash Table stores Gene objects for efficient matching of genes to diseases, meaning faster diagnosis for patients. This particular variation makes use of linked lists to handle gene hash collisions.
62598f9394891a1f408b9539
class OutputDirExistsException(CookiecutterException): <NEW_LINE> <INDENT> pass
Raised when the output directory of the project exists already.
62598f9301c39578d7f12a1a
class Catagory(models.Model): <NEW_LINE> <INDENT> name = models.CharField('名称',max_length=30) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
博客分类
62598f93dd821e528d6d8bc6
@python_2_unicode_compatible <NEW_LINE> class LSIDBill(AMBaseModel): <NEW_LINE> <INDENT> lsid = models.CharField( max_length=32, help_text='Legiscan ID', unique=True, db_index=True, ) <NEW_LINE> bill = models.ForeignKey( Bill, null=False, blank=False, related_name='ls_ids', ) <NEW_LINE> def __str__(self): <NEW_LINE> <I...
Legiscan Bill-ID Linking class.
62598f9371ff763f4b5e7409
class MyHashSet: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.base = 769 <NEW_LINE> self.data: List[List[int]] = [[] for _ in range(self.base)] <NEW_LINE> <DEDENT> def hash(self, key: int) -> int: <NEW_LINE> <INDENT> return key % self.base <NEW_LINE> <DEDENT> def add(self, key: int) -> None: <NEW_LI...
链地址法
62598f93f7d966606f747c76
class FeatureSequenceSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> sequence = serializers.SerializerMethodField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Feature <NEW_LINE> fields = ("sequence",) <NEW_LINE> <DEDENT> def get_sequence(self, obj): <NEW_LINE> <INDENT> return obj.residues
Feature sequence serializer.
62598f93287bf620b6271850
class TerrainArgumentTests(TestCase): <NEW_LINE> <INDENT> data = ''.join(map(chr, range(2 * 3 * 4))) <NEW_LINE> array = numpy.fromstring(data, 'b').reshape((2, 3, 4)) <NEW_LINE> serialized = { "voxels-dx": "2", "voxels-dy": "3", "voxels-dz": "4", "voxels-type": "int8", "voxels-data": data} <NEW_LINE> del data <NEW_LINE...
Tests for L{Terrain}, an AMP argument serializer for 3d numpy arrays.
62598f935f7d997b871f9225
class TelekomNumberResolver(PhoneNumberResolver): <NEW_LINE> <INDENT> priority = 99 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.priority = float(self.env.config.get("resolver-telekom.priority", default=str(self.priority))) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> pass <NEW_LI...
Configuration keys for section **resolver-telekom** +------------------+------------+-------------------------------------------------------------+ + Key | Format + Description | +==================+============+==========================================...
62598f9324f1403a926856fa
@dataclass <NEW_LINE> class MockUser: <NEW_LINE> <INDENT> email: str <NEW_LINE> first_name: str <NEW_LINE> full_name: str <NEW_LINE> roles: list = field(default_factory=list) <NEW_LINE> approved: bool = False <NEW_LINE> def has_role(self, role_value): <NEW_LINE> <INDENT> return role_value in self.roles
Mock user with attributes required for testing.
62598f93be383301e0253497
class UsersSelectorArg(bb.Union): <NEW_LINE> <INDENT> _catch_all = None <NEW_LINE> @classmethod <NEW_LINE> def team_member_ids(cls, val): <NEW_LINE> <INDENT> return cls('team_member_ids', val) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def external_ids(cls, val): <NEW_LINE> <INDENT> return cls('external_ids', val) <NE...
Argument for selecting a list of users, either by team_member_ids, external_ids or emails. 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 list of [str] team.UsersSelectorArg.team_...
62598f9323e79379d538c198
class ReplayStartupArgsTest(unittest.TestCase): <NEW_LINE> <INDENT> def testReplayOffGivesEmptyArgs(self): <NEW_LINE> <INDENT> network_backend = mock.Mock() <NEW_LINE> network_backend.is_open = False <NEW_LINE> network_backend.forwarder = None <NEW_LINE> self.assertEqual([], chrome_startup_args.GetReplayArgs(network_ba...
Test expected inputs for GetReplayArgs.
62598f93442bda511e95c0f6
class UserDetailTest(BaseAPITestCase): <NEW_LINE> <INDENT> def test_get_unauthenticated(self): <NEW_LINE> <INDENT> response = self.client.get( reverse("users:detail", kwargs={"pk": 0})) <NEW_LINE> self.assertEqual(response.status_code, 401) <NEW_LINE> <DEDENT> def test_get_object_does_not_exist(self): <NEW_LINE> <INDEN...
Tests the 'users:detail' endpoint.
62598f936aa9bd52df0d4b60
@_logged_statechange <NEW_LINE> @implementer(IStateChange) <NEW_LINE> class DestroyVolume(PRecord): <NEW_LINE> <INDENT> volume = _volume() <NEW_LINE> @property <NEW_LINE> def _eliot_action(self): <NEW_LINE> <INDENT> return DESTROY_VOLUME(_logger, volume=self.volume) <NEW_LINE> <DEDENT> def run(self, deployer): <NEW_LIN...
Destroy the storage (and therefore contents) of a volume. :ivar BlockDeviceVolume volume: The volume to destroy.
62598f93a05bb46b3848a511
class sup2: <NEW_LINE> <INDENT> y = ("sup2", 10) <NEW_LINE> z = ("sup2", 10) <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.data
class: sup2
62598f93b57a9660fecd170d
class _SparseColumnHashed(_SparseColumn): <NEW_LINE> <INDENT> def __new__(cls, column_name, hash_bucket_size, combiner="sum"): <NEW_LINE> <INDENT> return super(_SparseColumnHashed, cls).__new__(cls, column_name, bucket_size=hash_bucket_size, combiner=combiner, dtype=dtypes.string) <NEW_LINE> <DEDENT> def insert_transfo...
See `sparse_column_with_hash_bucket`.
62598f933cc13d1c6d4653ff
class ClickableFrame(QFrame): <NEW_LINE> <INDENT> clicked = pyqtSignal() <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__(*args) <NEW_LINE> <DEDENT> def mousePressEvent(self, event): <NEW_LINE> <INDENT> self.clicked.emit()
A Frame that emits a signal when clicked.
62598f9396565a6dacd2cdc3
class ResourceApi(ResourceApiCommon): <NEW_LINE> <INDENT> list_allowed_methods = ['get'] <NEW_LINE> detail_allowed_methods = ['get'] <NEW_LINE> def dispatch_to_view(self, view, request, *args, **kwargs): <NEW_LINE> <INDENT> callback = getattr(self, view) <NEW_LINE> return callback(request, *args, **kwargs) <NEW_LINE> <...
Provides an API that returns a specified resource object.
62598f93d58c6744b42dc118
class MockCommand: <NEW_LINE> <INDENT> def __init__(self, initial, current=None, outputs={}, min=0.0, max=1.0): <NEW_LINE> <INDENT> self.initial = initial <NEW_LINE> self.current = current <NEW_LINE> self.outputs = outputs <NEW_LINE> self.min = min <NEW_LINE> self.max = max
used to inset mock OSCCommand data into `client.commands` without relying on the actual OSCCommand class
62598f9316aa5153ce400194
class Id(Categorical): <NEW_LINE> <INDENT> _dtype_repr = "id" <NEW_LINE> _default_pandas_dtype = int
Represents variables that identify another entity
62598f93be8e80087fbbecf1
@python_2_unicode_compatible <NEW_LINE> class Shape(Base): <NEW_LINE> <INDENT> feed = models.ForeignKey('Feed') <NEW_LINE> shape_id = models.CharField( max_length=255, db_index=True, help_text="Unique identifier for a shape.") <NEW_LINE> geometry = models.LineStringField( null=True, blank=True, help_text='Geometry cach...
The path the vehicle takes along the route. Implements shapes.txt.
62598f93d6c5a102081e1dd6
class Crackle(UGen): <NEW_LINE> <INDENT> __documentation_section__ = 'Noise UGens' <NEW_LINE> __slots__ = () <NEW_LINE> _ordered_input_names = ( 'chaos_parameter', ) <NEW_LINE> _valid_calculation_rates = None <NEW_LINE> def __init__( self, calculation_rate=None, chaos_parameter=1.5, ): <NEW_LINE> <INDENT> UGen.__init__...
A chaotic noise generator. :: >>> crackle = ugentools.Crackle.ar( ... chaos_parameter=1.25, ... ) >>> crackle Crackle.ar()
62598f933617ad0b5ee05ddf
class _CharSizesCache(dict): <NEW_LINE> <INDENT> def __missing__(self, string): <NEW_LINE> <INDENT> if len(string) == 1: <NEW_LINE> <INDENT> result = max(0, wcwidth(string)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> result = sum(max(0, wcwidth(c)) for c in string) <NEW_LINE> <DEDENT> if len(string) < 256: <NEW_LINE...
Cache for wcwidth sizes.
62598f93eab8aa0e5d30ba14
class TestNumberOfIslands(unittest.TestCase): <NEW_LINE> <INDENT> def test_number_of_islands_1(self): <NEW_LINE> <INDENT> matrix = [ ["1", "1", "1", "1", "0"], ["1", "1", "0", "1", "0"], ["1", "1", "0", "0", "0"], ["0", "0", "0", "0", "0"] ] <NEW_LINE> expected = 1 <NEW_LINE> solution = number_of_islands.Solution() <NE...
Tests the number_of_islands solution.
62598f938e7ae83300ee8d3a
@dbus_interface(MANUAL_PARTITIONING.interface_name) <NEW_LINE> class ManualPartitioningInterface(PartitioningInterface): <NEW_LINE> <INDENT> def connect_signals(self): <NEW_LINE> <INDENT> super().connect_signals() <NEW_LINE> self.watch_property("Requests", self.implementation.requests_changed) <NEW_LINE> <DEDENT> @prop...
DBus interface for the manual partitioning module.
62598f937047854f4633f073
class XColorButton(QPushButton): <NEW_LINE> <INDENT> colorChanged = Signal(QColor) <NEW_LINE> def __init__( self, parent ): <NEW_LINE> <INDENT> super(XColorButton, self).__init__(parent) <NEW_LINE> color = QColor('black') <NEW_LINE> self._color = color <NEW_LINE> palette = self.palette() <NEW_LINE> palette.se...
The XColorButton class is a simple extension to the standard QPushButton that will control color settings. When teh user clicks on the button, the QColorDialog will be displayed, prompting the user to select a new color. Colors are stored internally can can be accessed by etter and setter methods, as well as the colo...
62598f9338b623060ffa8d20
class TestDummyRadio(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.radio = DummyRadio() <NEW_LINE> <DEDENT> def test_write(self): <NEW_LINE> <INDENT> start = time.time() <NEW_LINE> self.assertTrue(self.radio.write()) <NEW_LINE> dt = time.time() - start <NEW_LINE> self.assertGreater(d...
Tests for the 'patched' NRF24 class.
62598f932ae34c7f260aad7e
class pdb_sequence(sequence): <NEW_LINE> <INDENT> def __init__(self, sequence, name = "", chain = ""): <NEW_LINE> <INDENT> super( pdb_sequence, self ).__init__( sequence, name ) <NEW_LINE> self.chain = chain <NEW_LINE> <DEDENT> def format(self, width): <NEW_LINE> <INDENT> return ( ( ">PDB:%s_%s" % ( self.name, self.cha...
PDB sequence
62598f93fbf16365ca793d48
@dataclass(frozen=True) <NEW_LINE> class Unit: <NEW_LINE> <INDENT> names: Tuple[str, ...] <NEW_LINE> definition: Optional[Definition] = None <NEW_LINE> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return self.names[0] <NEW_LINE> <DEDENT> def __contains__(self, name: str) -> bool: <NEW_LINE> <INDENT> ...
Defines a unit of measurement.
62598f93dd821e528d6d8bc8
class CredentialError(BaseError): <NEW_LINE> <INDENT> message = u"Credential error for url: '{url}'. Response content: '{content}'"
Error Code: 403 Invalid credentials
62598f9385dfad0860cbf8bd
class Dist: <NEW_LINE> <INDENT> URI = { 'GET_DISTRIBUTION_INFO': 'http://{host}/YamahaExtendedControl/v1/dist/getDistributionInfo', 'SET_SERVER_INFO': 'http://{host}/YamahaExtendedControl/v1/dist/setServerInfo', 'SET_CLIENT_INFO': 'http://{host}/YamahaExtendedControl/v1/dist/setClientInfo', 'START_DISTRIBUTION': 'http:...
APIs in regard to Link distribution related setting and getting information.
62598f9326068e7796d4c5f6
class InsteonBinarySensor(InsteonEntity, BinarySensorDevice): <NEW_LINE> <INDENT> def __init__(self, device, state_key): <NEW_LINE> <INDENT> super().__init__(device, state_key) <NEW_LINE> self._sensor_type = SENSOR_TYPES.get(self._insteon_device_state.name) <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self...
A Class for an Insteon device entity.
62598f9355399d3f056261b3
@register_generator <NEW_LINE> class Thunderbird7RegexTests(CompatRegexTestHelper): <NEW_LINE> <INDENT> VERSION = TB7_DEFINITION <NEW_LINE> def tests(self): <NEW_LINE> <INDENT> yield self.get_test_bug( 621213, r"resource:///modules/dictUtils.js", "`dictUtils.js` was removed in Thunderbird 7", "The `dictUtils.js` file i...
Regex tests for the Thunderbird 7 update.
62598f9323e79379d538c19a
class TestIamPermissionsRequest(_messages.Message): <NEW_LINE> <INDENT> permissions = _messages.StringField(1, repeated=True)
Request message for TestIamPermissions method. Fields: permissions: The set of permissions to check for the resource. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. For more information see IAM Overview (https://cloud.google.com/iam/docs/overview#permissions).
62598f93dd821e528d6d8bc9
class LookinCoordinatorEntity(LookinDeviceMixIn, LookinEntityMixIn, CoordinatorEntity): <NEW_LINE> <INDENT> _attr_should_poll = False <NEW_LINE> _attr_assumed_state = True <NEW_LINE> def __init__( self, coordinator: DataUpdateCoordinator, uuid: str, device: Remote | Climate, lookin_data: LookinData, ) -> None: <NEW_LIN...
A lookin device entity for an external device that uses the coordinator.
62598f938e71fb1e983bb749
class MedicosNew(CreateView): <NEW_LINE> <INDENT> model = Medico <NEW_LINE> form_class = FormularioMedico <NEW_LINE> template_name = 'medicos/novo.html' <NEW_LINE> success_url = reverse_lazy('listar-medicos')
View para a criação de novos médicos.
62598f93c432627299fa2c67
class RuleAlignment(Rule): <NEW_LINE> <INDENT> weight = 0.38 <NEW_LINE> name = "Alignment" <NEW_LINE> def consult(self, boid, neighborhood, window_width, window_height): <NEW_LINE> <INDENT> if neighborhood.avg_velocity.length != 0: <NEW_LINE> <INDENT> return (neighborhood.avg_velocity - boid.velocity) <NEW_LINE> <DEDEN...
Calculates the alignment as per Reynolds.
62598f93a05bb46b3848a513
class SubmitCd(BaseRMPModel): <NEW_LINE> <INDENT> submit = CopyFromCharField( source_column='LookupCode', primary_key=True, max_length=3, help_text='Unique identifier of the submission reason.' ) <NEW_LINE> submit_tr = CopyFromCharField( source_column='Description', max_length=101, help_text='Full description of the su...
Reason for an RMP submission.
62598f93f7d966606f747c79
class AdminRoute(BaseRouter): <NEW_LINE> <INDENT> def __init__(self, view): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> <DEDENT> def add_to_app(self, app, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> admin = kwargs['flask_admin'] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise NotImplement...
The Admin router allows you to define Flask-Admin routes and have those views added to the application automatically. For this to work you must at ``init_app`` time pass a optional keyword argument ``flask_admin`` to ``init_app`` with its value being the Flask-Aadmin extension instance. .. versionadded:: 2014.05.08 N...
62598f93097d151d1a2c0cc1
class Hand(object): <NEW_LINE> <INDENT> def __init__(self, bet, *cards): <NEW_LINE> <INDENT> self.bet = bet <NEW_LINE> self.cards = list(cards) <NEW_LINE> self.stand = False <NEW_LINE> <DEDENT> def IsActive(self): <NEW_LINE> <INDENT> return not (self.IsBusted() or self.IsHypeJack() or self.stand) <NEW_LINE> <DEDENT> de...
Collection of cards with blackjack game state.
62598f9373bcbd0ca4bc9eed
class FunctionBlock(Block): <NEW_LINE> <INDENT> def __init__(self, function_class, options, divider, text: str): <NEW_LINE> <INDENT> assert hasattr(options, '__iter__') <NEW_LINE> self.function_class = function_class <NEW_LINE> self.options, self.divider = options, divider <NEW_LINE> self.content = text <NEW_LINE> if i...
Generate canonical text and HTML for a function block; recursing into function block as neededV Some blocks just wrap others in HTML, e.g. the alignment blocks, and others reformat plain text. Wrappers should be chainable, with '|'. May as well recurse, for simplicity. @todo: In future, Functions should be given an o...
62598f93eab8aa0e5d30ba16
class Drmaa2FloatDescriptor(Drmaa2NumericTypeDescriptor): <NEW_LINE> <INDENT> def __init__(self, name, unset_value=UNSET_NUM): <NEW_LINE> <INDENT> Drmaa2NumericTypeDescriptor.__init__(self, name, unset_value)
A descriptor for float fields.
62598f93be8e80087fbbecf3
class CertificateSetting(WindowsAzureData): <NEW_LINE> <INDENT> def __init__(self, thumbprint=u'', store_name=u'', store_location=u''): <NEW_LINE> <INDENT> self.thumbprint = thumbprint <NEW_LINE> self.store_name = store_name <NEW_LINE> self.store_location = store_location
Initializes a certificate setting. thumbprint: Specifies the thumbprint of the certificate to be provisioned. The thumbprint must specify an existing service certificate. store_name: Specifies the name of the certificate store from which retrieve certificate. store_location: Specifies the target ce...
62598f93e76e3b2f99fd86cd
class IQVIAEntity(CoordinatorEntity): <NEW_LINE> <INDENT> def __init__( self, coordinator: DataUpdateCoordinator, entry: ConfigEntry, description: EntityDescription, ) -> None: <NEW_LINE> <INDENT> super().__init__(coordinator) <NEW_LINE> self._attr_extra_state_attributes = {} <NEW_LINE> self._attr_unique_id = f"{entry....
Define a base IQVIA entity.
62598f9391af0d3eaad39a9c
class Task02TestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_get_market_density(self): <NEW_LINE> <INDENT> fpath = os.path.join(os.path.dirname(boroughs.__file__), 'green_markets.json') <NEW_LINE> results = boroughs.get_market_density(fpath) <NEW_LINE> results = {k.upper(): v for k, v in results.iteritems()} <...
Task 02 tests
62598f936fb2d068a7693c7d
class OfferApplications(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.applications = {} <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self.applications.values().__iter__() <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.applications) <NEW_LINE>...
A collection of offer applications and the discounts that they give. Each offer application is stored as a dict which has fields for: * The offer that led to the successful application * The result instance * The number of times the offer was successfully applied
62598f93656771135c489316
class Actions(ActionsBase): <NEW_LINE> <INDENT> def configure(self,**args): <NEW_LINE> <INDENT> def createENV(): <NEW_LINE> <INDENT> j.system.fs.createDir("/opt/go/workspace") <NEW_LINE> j.system.fs.createDir("/opt/go/workspace/pkg") <NEW_LINE> j.system.fs.createDir("/opt/go/workspace/src") <NEW_LINE> j.system.fs.creat...
process for install ------------------- step1: prepare actions step2: check_requirements action step3: download files & copy on right location (hrd info is used) step4: configure action step5: check_uptime_local to see if process stops (uses timeout $process.stop.timeout) step5b: if check uptime was true will do stop ...
62598f93f8510a7c17d7dfc2
class LibFileToUniformFilenameTestCase(CubaneTestCase): <NEW_LINE> <INDENT> def test_should_replace_invalid_characters(self): <NEW_LINE> <INDENT> self.assertEqual(to_uniform_filename('test/-*?+\\&^%$#@'), 'test') <NEW_LINE> <DEDENT> def test_should_strip_whitespace_and_invalid_characters(self): <NEW_LINE> <INDENT> self...
cubane.lib.file.to_uniform_filename()
62598f9324f1403a926856fc
class Key(object): <NEW_LINE> <INDENT> def __init__(self, key_dir, zone_name, ksk=False, alg="rsasha256", key_len=512): <NEW_LINE> <INDENT> self.dir = key_dir <NEW_LINE> self.zone_name = zone_name <NEW_LINE> self.alg = alg <NEW_LINE> self.len = key_len <NEW_LINE> self.ksk = ksk <NEW_LINE> <DEDENT> def _keymgr(self, *ar...
DNSSEC key generator
62598f934e696a045264dc54
class MyEdgeHDF5Plugin(MyHDF5Plugin): <NEW_LINE> <INDENT> create_directory = Component(EpicsSignal, "CreateDirectory") <NEW_LINE> def make_filename(self): <NEW_LINE> <INDENT> filename = cpr_filename.value <NEW_LINE> write_path = self.file_path.value <NEW_LINE> read_path = "/mnt/WinS/" + write_path.split(":")[-1].replac...
adapt HDF5 plugin for PCO Edge detector
62598f9326068e7796d4c5f8
class LinkParser: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.host = None <NEW_LINE> self.target = None <NEW_LINE> <DEDENT> def is_incomplete(self): <NEW_LINE> <INDENT> return self.host is None or self.target is None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<Link host: '{...
Class representing a connection between two machines
62598f9355399d3f056261b5
class _DomainCheckInterval(object): <NEW_LINE> <INDENT> def __init__(self, a, b): <NEW_LINE> <INDENT> if (a > b): <NEW_LINE> <INDENT> (a, b) = (b, a) <NEW_LINE> <DEDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> <DEDENT> def __call__(self, x): <NEW_LINE> <INDENT> with np.errstate(invalid='ignore'): <NEW_LINE> <INDENT...
Define a valid interval, so that : ``domain_check_interval(a,b)(x) == True`` where ``x < a`` or ``x > b``.
62598f9345492302aabfc16e
class Inn(Business): <NEW_LINE> <INDENT> def __init__(self, owner): <NEW_LINE> <INDENT> super(Inn, self).__init__(owner)
An inn.
62598f938e71fb1e983bb74b
class Visitor(object): <NEW_LINE> <INDENT> def discoverVertex(self, u, g): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def examineEdge(self, e, g): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def treeEdge(self, e, g): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def backEdge(self, e, g): <NEW_LINE> <INDENT> pass <NEW...
Base class for Graph Visitors that does nothing. Sub-classes can override any method to implement specific algorithms.
62598f930c0af96317c5601b
class Rulebook: <NEW_LINE> <INDENT> def __init__(self, rules): <NEW_LINE> <INDENT> self.rules = rules <NEW_LINE> self.cache = {} <NEW_LINE> self._build_cache() <NEW_LINE> <DEDENT> def _build_cache(self): <NEW_LINE> <INDENT> for rule, enhanced in self.rules: <NEW_LINE> <INDENT> for rot in range(4): <NEW_LINE> <INDENT> s...
Holds the rules to enhance blocks of art.
62598f9307f4c71912baf0e2
class SVM(AbstractClassifier): <NEW_LINE> <INDENT> def __init__(self, param=None): <NEW_LINE> <INDENT> AbstractClassifier.__init__(self) <NEW_LINE> self.logger = logging.getLogger("facerec.classifier.SVM") <NEW_LINE> self.param = param <NEW_LINE> self.svm = svm_model() <NEW_LINE> self.param = param <NEW_LINE> if self.p...
This class is just a simple wrapper to use libsvm in the CrossValidation module. If you don't use this framework use the validation methods coming with LibSVM, they are much easier to access (simply pass the correct class labels in svm_predict and you are done...). The grid search method in this class is somewhat simi...
62598f93cb5e8a47e493bfbe
class SpecifyCoro: <NEW_LINE> <INDENT> def it_returns_something(self): <NEW_LINE> <INDENT> import da.compile.gcc <NEW_LINE> assert da.compile.gcc.coro(None) is not None
Specify the da.compile.gcc.coro() function.
62598f9373bcbd0ca4bc9eef
class TimeStamp_db_mixin(object): <NEW_LINE> <INDENT> ISO8601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S' <NEW_LINE> def _change_since_result_filter_hook(self, query, filters): <NEW_LINE> <INDENT> values = filters and filters.get(CHANGED_SINCE, []) <NEW_LINE> if not values: <NEW_LINE> <INDENT> return query <NEW_LINE> <DEDENT> da...
Mixin class to add Time Stamp methods.
62598f9363b5f9789fe84e0d
class StudentAccount(APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.AllowAny,) <NEW_LINE> authentication_classes = [] <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> serializer = StudentSerializer(data=request.data) <NEW_LINE> if serializer.is_valid(): <NEW_LINE> <INDENT> serialize...
Create a new student and return the access/refresh token pair. This is used during the signup process. Errors are not being handled yet. Permissions: any (don't have permissions before user is created)
62598f938e71fb1e983bb74c
class ProxySteerableBase: <NEW_LINE> <INDENT> def __init__(self, in_type, out_type, mon_type=zmq.PUB, ctrl_type=None): <NEW_LINE> <INDENT> super().__init__(in_type=in_type, out_type=out_type, mon_type=mon_type) <NEW_LINE> self.ctrl_type = ctrl_type <NEW_LINE> self._ctrl_binds = [] <NEW_LINE> self._ctrl_connects = [] <N...
Base class for overriding methods.
62598f934e4d5625663720b8
class Interface(object): <NEW_LINE> <INDENT> def __init__(self, type, security_method, access_url): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> if security_method: <NEW_LINE> <INDENT> check_valid_url(security_method) <NEW_LINE> <DEDENT> self.security_method = security_method <NEW_LINE> self.access_url = access_url
Class representing the interface of a capability
62598f93379a373c97d98ca9
class TestDistutilsCopyTree(fake_filesystem_unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.setUpPyfakefs() <NEW_LINE> self.fs.create_dir("./test/subdir/") <NEW_LINE> self.fs.create_dir("./test/subdir2/") <NEW_LINE> self.fs.create_file("./test2/subdir/1.txt") <NEW_LINE> <DEDENT> def te...
Regression test for #501.
62598f93e64d504609df9202