code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class LatticeApply(latticeBaseFeature.LatticeFeature): <NEW_LINE> <INDENT> def derivedInit(self,obj): <NEW_LINE> <INDENT> self.Type = "LatticeApply" <NEW_LINE> obj.addProperty("App::PropertyLink","Base","Lattice Apply","Base object. Can be any generic shape, as well as another lattice object.") <NEW_LINE> obj.addProper...
The Lattice Apply object
62598ef157b8e32f525074fd
class Gap(Signal): <NEW_LINE> <INDENT> def __init__(self, length): <NEW_LINE> <INDENT> super().__init__(length)
Represents a gap between IR pulses.
62598ef1adb09d7d5dc08dbb
class Instance(ClassBasedTraitType): <NEW_LINE> <INDENT> klass = None <NEW_LINE> def __init__(self, klass=None, args=None, kw=None, **metadata): <NEW_LINE> <INDENT> if klass is None: <NEW_LINE> <INDENT> klass = self.klass <NEW_LINE> <DEDENT> if (klass is not None) and (inspect.isclass(klass) or isinstance(klass, py3com...
A trait whose value must be an instance of a specified class. The value can also be an instance of a subclass of the specified class. Subclasses can declare default classes by overriding the klass attribute
62598ef13d592f4c4edb96df
class CustomObtainJSONWebToken(views.ObtainJSONWebToken): <NEW_LINE> <INDENT> serializer_class = LoginSerializer <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> error = self.wechat_auth(request.data) <NEW_LINE> if error: <NEW_LINE> <INDENT> return Response(status=status.HTTP_400_BAD_REQUEST, da...
用户登陆
62598ef1f548e778e5969d7f
class Product(models.Model): <NEW_LINE> <INDENT> sku = models.IntegerField(unique=True) <NEW_LINE> price = models.IntegerField() <NEW_LINE> quantity = models.IntegerField() <NEW_LINE> shipping = models.IntegerField() <NEW_LINE> name = models.CharField(max_length=140) <NEW_LINE> description = models.TextField() <NEW_LIN...
Defines each product to be sold in the store. Tracks its own inventory and shipping. Product images are saved in the static folder due to how heroku does not allow file uploads. Rather than introduce additional dependencies I decided to just put the images in the static files folder and serve them from there. The def...
62598ef116aa5153ce3fecf3
class NetModChild(NetModule): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> NetModule.__init__(self, updatetime=5, protocol='dns', *args, **kwargs) <NEW_LINE> self.l_dns_name = list() <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> to_return = dict() <NEW_LINE> to_return['list_d...
Retrieve domain name inside DNS packet Only works with the sniffer system
62598ef1460517430c430c7c
class QueenAnt(ScubaThrower): <NEW_LINE> <INDENT> name = 'Queen' <NEW_LINE> food_cost = 6 <NEW_LINE> implemented = True <NEW_LINE> queens = 0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> QueenAnt.queens += 1 <NEW_LINE> self.queens=QueenAnt.queens <NEW_LINE> Ant.__init__(self) <NEW_LINE> self.doubled_damage_ants =...
The Queen of the colony. The game is over if a bee enters her place.
62598ef1091ae3566870340c
class admin(): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> auth = current.auth <NEW_LINE> s3_has_role = auth.s3_has_role <NEW_LINE> system_roles = auth.get_system_roles() <NEW_LINE> ADMIN = system_roles.ADMIN <NEW_LINE> ORG_ADMIN = system_roles.ORG_ADMIN <NEW_LINE> if s3_has_role(ADMIN) | s3_has_role(OR...
Custom Admin Index Page
62598ef1236d856c2adc8810
class SpacelessNode(Node): <NEW_LINE> <INDENT> tag_name = "spaceless" <NEW_LINE> def render(self, environment, context, template, text_escape): <NEW_LINE> <INDENT> text = self.render_contents(environment, context, template, text_escape) <NEW_LINE> return spaceless(text)
Remove whitespace between tags.
62598ef12c8b7c6e89bd1fb6
class FFDBSeason(FFDBEntry): <NEW_LINE> <INDENT> year = ndb.StringProperty(required=True) <NEW_LINE> start = ndb.DateProperty(indexed=False, required=True) <NEW_LINE> end = ndb.DateProperty(indexed=False, required=True) <NEW_LINE> enableUpdates = ndb.IntegerProperty(indexed=False) <NEW_LINE> ...
Models a football season
62598ef13346ee7daa336a61
class DesigntimeLicenseContextSerializer(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Serialize(o, cryptoKey, context): <NEW_LINE> <INDENT> pass
Provides support for design-time license context serialization.
62598ef13539df3088ecaaa5
class TestRobotParser(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.rp = robotparser2.RobotFileParser(session=requests.Session()) <NEW_LINE> <DEDENT> def check(self, a, b): <NEW_LINE> <INDENT> if not b: <NEW_LINE> <INDENT> ac = "access denied" <NEW_LINE> <DEDENT> else: <NEW_LINE> <IN...
Test robots.txt parser (needs internet access).
62598ef1a8370b77170eebd7
class Xenon1tMuvetoVoltageMapApi(object): <NEW_LINE> <INDENT> def __init__(self, api_client=None): <NEW_LINE> <INDENT> if api_client is None: <NEW_LINE> <INDENT> api_client = ApiClient() <NEW_LINE> <DEDENT> self.api_client = api_client <NEW_LINE> <DEDENT> def get_xenon1t_muveto_voltage_maps(self, **kwargs): <NEW_LINE> ...
NOTE: This class is auto generated by OpenAPI Generator Ref: https://openapi-generator.tech Do not edit the class manually.
62598ef1d486a94d0ba2a7bc
class GsStatusShowStashCommand(TextCommand, GitCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> interface = ui.get_interface(self.view.id()) <NEW_LINE> lines = util.view.get_lines_from_regions( self.view, self.view.sel(), valid_ranges=interface.get_view_regions("stashes") ) <NEW_LINE> ids = tuple(...
For each selected stash, open a new window to display the diff for that stash.
62598ef1cc40096d616195d2
class GameStates(object): <NEW_LINE> <INDENT> def __init__(self, ai_settings): <NEW_LINE> <INDENT> self.ai_settings = ai_settings <NEW_LINE> self.reset_states() <NEW_LINE> self.game_active = False <NEW_LINE> self.high_score = 0 <NEW_LINE> <DEDENT> def reset_states(self): <NEW_LINE> <INDENT> self.ships_left = self.ai_se...
跟踪游戏的统计信息
62598ef1cc0a2c11144797fa
class ReturnData(object): <NEW_LINE> <INDENT> __slots__ = [ 'result', 'comm_ok', 'host' ] <NEW_LINE> def __init__(self, conn=None, host=None, result=None, comm_ok=True): <NEW_LINE> <INDENT> if conn is not None: <NEW_LINE> <INDENT> self.host = conn.host <NEW_LINE> delegate = getattr(conn, 'delegate', None) <NEW_LINE> if...
internal return class for runner execute methods, not part of public API signature
62598ef1d7e4931a7ef3a88e
class DotAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, ctx_dim, hid_dim, att_bottleneck='ctx', transform_ctx=True, att_activ='tanh', temp=1., ctx2hid=True, mlp_bias=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.ctx_dim = ctx_dim <NEW_LINE> self.hid_dim = hid_dim <NEW_LINE> self._ctx2hid =...
Attention layer with dot product.
62598ef14a966d76dd5ed6cf
class TypeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> FACE_DETECTION = 1 <NEW_LINE> LANDMARK_DETECTION = 2 <NEW_LINE> LOGO_DETECTION = 3 <NEW_LINE> LABEL_DETECTION = 4 <NEW_LINE> TEXT_DETECTION = 5 <NEW_LINE> DOCUMENT_TEXT_DETECTION = 6 <NEW_LINE> SAFE_SEARCH_DETECTION = 7 <NEW_...
The feature type. Values: TYPE_UNSPECIFIED: Unspecified feature type. FACE_DETECTION: Run face detection. LANDMARK_DETECTION: Run landmark detection. LOGO_DETECTION: Run logo detection. LABEL_DETECTION: Run label detection. TEXT_DETECTION: Run OCR. DOCUMENT_TEXT_DETECTION: Run dense text document OCR. Ta...
62598ef1a8370b77170eebd8
class LinkedList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> <DEDENT> def traverse(self): <NEW_LINE> <INDENT> head = self.head <NEW_LINE> print("[", end="") <NEW_LINE> while head is not None: <NEW_LINE> <INDENT> print(head.data, end=" -> ") <NEW_LINE> head = head.next <NEW_L...
implements the singly linked list
62598ef163b5f9789fe83952
class Blog(db.Model): <NEW_LINE> <INDENT> __tablename__ = "blogs" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> user_id = db.Column(db.Integer, db.ForeignKey("users.id")) <NEW_LINE> title = db.Column(db.String) <NEW_LINE> category = db.Column(db.String) <NEW_LINE> blog = db.Column(db.String) <NEW_L...
Pitch class to define pitch objects
62598ef19c8ee8231303f554
class Permission(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('name'), max_length=255) <NEW_LINE> content_type = models.ForeignKey( ContentType, models.CASCADE, related_name='+', verbose_name=_('content type'), ) <NEW_LINE> codename = models.CharField(_('codename'), max_length=100) <NEW_LINE> objects = ...
The permissions system provides a way to assign permissions to specific users and groups of users. The permission system is used by the Django admin site, but may also be useful in your own code. The Django admin site uses permissions as follows: - The "add" permission limits the user's ability to view the "add" ...
62598ef17b25080760ed5c90
class SKLModel(object): <NEW_LINE> <INDENT> def __init__(self, estimator, param_grid, train_data, **kwargs): <NEW_LINE> <INDENT> override = kwargs.get('override', False) <NEW_LINE> weighted = kwargs.get('weighted', False) <NEW_LINE> cv = kwargs.get('cv', 10) <NEW_LINE> pkl_path = kwargs.get('pkl_path', None) <NEW_LINE>...
A learnig model for errors correction. Attributes: _gs: an object that implements the 'sklearn.model_selection.GridSearchCV' interface. features: a list of features used in training and testing. settings: the settings of the model.
62598ef123849d37ff84f8af
class TestReceiver(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def echo(context, value): <NEW_LINE> <INDENT> LOG.debug(_("Received %s"), value) <NEW_LINE> return value <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def context(context, value): <NEW_LINE> <INDENT> LOG.debug(_("Received %s"), context) <NEW_LINE> ...
Simple Proxy class so the consumer has methods to call. Uses static methods because we aren't actually storing any state.
62598ef1a79ad16197768816
class AutoRestParameterizedHostTestClient(object): <NEW_LINE> <INDENT> def __init__( self, host, filepath=None): <NEW_LINE> <INDENT> self.config = AutoRestParameterizedHostTestClientConfiguration(host, filepath) <NEW_LINE> self._client = ServiceClient(None, self.config) <NEW_LINE> client_models = {k: v for k, v in mode...
Test Infrastructure for AutoRest :ivar config: Configuration for client. :vartype config: AutoRestParameterizedHostTestClientConfiguration :ivar paths: Paths operations :vartype paths: .operations.PathsOperations :param host: A string value that is used as a global part of the parameterized host :type host: str :pa...
62598ef176e4537e8c3eddab
class Point2DSchema(Schema): <NEW_LINE> <INDENT> x_coord = fields.Float(required=True, description="The x coordinate") <NEW_LINE> y_coord = fields.Float(required=True, description="The y coordinate") <NEW_LINE> @post_load <NEW_LINE> def _create_point(self, data): <NEW_LINE> <INDENT> return Point2D(**data)
Schema class for Point2D class used for validation.
62598ef15166f23b2e241bd0
class Page1(KeySilkCasesPage): <NEW_LINE> <INDENT> def __init__(self, page_set): <NEW_LINE> <INDENT> super(Page1, self).__init__( url='http://groupcloned.com/test/plain/list-recycle-transform.html', page_set=page_set) <NEW_LINE> <DEDENT> def RunSmoothness(self, action_runner): <NEW_LINE> <INDENT> interaction = action_r...
Why: Infinite scroll. Brings out all of our perf issues.
62598ef1627d3e7fe0e05680
class AtomType(object): <NEW_LINE> <INDENT> def __init__(self, name, params={}): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self._params = params <NEW_LINE> try: <NEW_LINE> <INDENT> self.symbol = element.name2symbol(name) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> self.symbol = None <NEW_LINE> <DED...
A type of atom
62598ef1097d151d1a2bf815
class UserProfile(models.Model, AuxiliaryMixin): <NEW_LINE> <INDENT> user = models.OneToOneField(User, verbose_name='用户') <NEW_LINE> nick_name = models.CharField('昵称', max_length=64, blank=True, default='') <NEW_LINE> phone_no = models.CharField('电话', max_length=16, db_index=True) <NEW_LINE> id_no = models.CharField('身...
用户资料
62598ef17b180e01f3e48440
class BaseAdmin(object): <NEW_LINE> <INDENT> choice_fields = [] <NEW_LINE> fk_fields = [] <NEW_LINE> dynamic_fk = None <NEW_LINE> dynamic_list_display = [] <NEW_LINE> dynamic_choice_fields = [] <NEW_LINE> m2m_fields = []
自定义admin类
62598ef1e5267d203ee6a0fe
class SarsaLearner(MarkovLearner): <NEW_LINE> <INDENT> def init(self): <NEW_LINE> <INDENT> self.init_Q() <NEW_LINE> <DEDENT> def learn(self): <NEW_LINE> <INDENT> self.sarsa_learn() <NEW_LINE> self.generate_Pi() <NEW_LINE> <DEDENT> def sarsa_learn(self): <NEW_LINE> <INDENT> s_p = None; a_p = None; r_p = None; sp_p = Non...
Sarsa Learner. Uses model-free Sarsa learning to determine Q, then determine policy Pi from Q.
62598ef199cbb53fe682f6a3
class ConvGRU_gn(nn.Module): <NEW_LINE> <INDENT> def __init__(self, args, input_size, hidden_size, n_classes): <NEW_LINE> <INDENT> super(ConvGRU_gn, self).__init__() <NEW_LINE> self.device = args.device <NEW_LINE> self.initial = args.initial <NEW_LINE> self.input_size = input_size <NEW_LINE> self.hidden_size = hidden_s...
Generate a convolutional GRU cell
62598ef14c34283577618adb
class TipoItemEditFiller(EditFormFiller): <NEW_LINE> <INDENT> __model__ = TipoItem
Se utiliza para llenar el formulario de modificación de un tipo de ítem con los valores recuperados de la base de datos.
62598ef1167d2b6e312b578f
class Settings(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.screen_width = 1200 <NEW_LINE> self.screen_height = 800 <NEW_LINE> self.bg_color = (230,230,230) <NEW_LINE> self.ship_limit = 3 <NEW_LINE> self.bullet_width = 3 <NEW_LINE> self.bullet_height = 15 <NEW_LINE> self.bullet_color = 60,60,60 <...
A class to store all settings for Alien Invasion
62598ef1be383301e0251fd0
@redis_deco_wrapper_class_decorator <NEW_LINE> class RedisDecoWrapper(redis.Redis): <NEW_LINE> <INDENT> pass
Redis wrapper Args: as in original redis.Redis class Note: main purpose of this class is decorate all Redis methods with retry connection wrapper
62598ef1a17c0f6771d5aa4a
class ResourceMetricDefinition(ProxyOnlyResource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'unit': {'readonly': True}, 'primary_aggregation_type': {'readonly': True}, 'metric_availabilities': {'readonly': True}, 'resource_uri': {'readonly': T...
Metadata for the metrics. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Resource Id. :vartype id: str :ivar name: Resource Name. :vartype name: str :ivar kind: Kind of resource. :vartype kind: str :ivar type: Resource type. :vartype type: str :ivar unit: Unit of the...
62598ef1d7e4931a7ef3a890
class AnnotationRecord: <NEW_LINE> <INDENT> def __init__(self, start_time, end_time, class_): <NEW_LINE> <INDENT> self.start_time = start_time <NEW_LINE> self.end_time = end_time <NEW_LINE> self.class_ = class_
The data structure of an annotation. It contains the start time and end time of the proposal, and its' class label.
62598ef163d6d428bbee0fc4
class FactorsServicer(object): <NEW_LINE> <INDENT> def PrimeFactors(self, request_iterator, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!')
Prime factors service definition. We have a method called `PrimeFactors` which takes parameter called `Request` and returns the message `Response`
62598ef11b99ca400228e909
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = {'password': {'write_only': True, 'min_length': 5}} <NEW_LINE> <DEDENT> def create(self, validated_data): <NEW_LINE>...
Serializer for user object
62598ef1a8370b77170eebda
class State(object): <NEW_LINE> <INDENT> def __init__(self, centroid): <NEW_LINE> <INDENT> self.centroid = centroid <NEW_LINE> <DEDENT> def SetBasin( self, periodicity, anglerange ): <NEW_LINE> <INDENT> domainlength = anglerange[1]-anglerange[0] <NEW_LINE> minangle = self.centroid - domainlength/(2.0*periodicity) <NEW_...
This class implements one of the dihedral minima
62598ef1f9cc0f698b1c46ca
class SpecifyMain: <NEW_LINE> <INDENT> def it_is_callable(self): <NEW_LINE> <INDENT> import da.cli <NEW_LINE> assert callable(da.cli.main)
Specify the da.cli.main() function.
62598ef17b25080760ed5c92
class SysRaidArray(SysRaidArraySchema): <NEW_LINE> <INDENT> cli_command = "/mgmt/tm/sys/raid/array" <NEW_LINE> def rest(self): <NEW_LINE> <INDENT> response = self.device.get(self.cli_command) <NEW_LINE> response_json = response.json() <NEW_LINE> if not response_json: <NEW_LINE> <INDENT> return {} <NEW_LINE> <DEDENT> re...
To F5 resource for /mgmt/tm/sys/raid/array
62598ef1adb09d7d5dc08dbf
@skip("is not required since DRF 3.7.7") <NEW_LINE> class DateTimeFieldWithTZTestCase(TestCase): <NEW_LINE> <INDENT> @patch('rest_framework.serializers.DateTimeField.enforce_timezone') <NEW_LINE> def test_enforce_timezone(self, enforce_timezone): <NEW_LINE> <INDENT> date_field = DateTimeFieldWithTZ() <NEW_LINE> current...
Test case for ``DateTimeFieldWithTZ``
62598ef17c178a314d78bc8d
class AbbrExtension(Extension): <NEW_LINE> <INDENT> def extendMarkdown(self, md, md_globals): <NEW_LINE> <INDENT> md.preprocessors.add('abbr', AbbrPreprocessor(md), '<reference')
Abbreviation Extension for Python-Markdown.
62598ef144b2445a339b5d67
class Grassmannian(LevelSet): <NEW_LINE> <INDENT> def __init__(self, n, k): <NEW_LINE> <INDENT> geomstats.errors.check_integer(k, "k") <NEW_LINE> geomstats.errors.check_integer(n, "n") <NEW_LINE> if k > n: <NEW_LINE> <INDENT> raise ValueError( "k <= n is required: k-dimensional subspaces in n dimensions." ) <NEW_LINE> ...
Class for Grassmann manifolds Gr(n, k). Parameters ---------- n : int Dimension of the Euclidean space. k : int Dimension of the subspaces.
62598ef15fc7496912d4766d
class NullCompositeNode(CompositeNode): <NEW_LINE> <INDENT> def render(self, context): <NEW_LINE> <INDENT> return None
Null Transform Node Dummy transform node that compose any inputs into ```None```.
62598ef1498bea3a75a5632a
class TwoLayerNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=3*32*32, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.params['W1'] = np.random.normal(0, weight_scale,(input_dim, hidden_dim)) <NEW_LINE> self.params...
A two-layer fully-connected neural network with ReLU nonlinearity and softmax loss that uses a modular layer design. We assume an input dimension of D, a hidden dimension of H, and perform classification over C classes. The architecure should be affine - relu - affine - softmax. Note that this class does not implemen...
62598ef12ae34c7f260a98de
class AtomicUninstall(Command): <NEW_LINE> <INDENT> log = logging.getLogger(__name__) <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(AtomicUninstall, self).get_parser(prog_name) <NEW_LINE> parser.add_argument('--name', '-n') <NEW_LINE> parser.add_argument('--keep', '-k', action='store_tr...
Uninstall an atomic container.
62598ef155399d3f05624d1d
class Job: <NEW_LINE> <INDENT> Read = 0 <NEW_LINE> Write = 1 <NEW_LINE> def __init__(self, pos, kind, value=None): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.kind = kind <NEW_LINE> self.value = value <NEW_LINE> self.result = 0 <NEW_LINE> self.doneEvent = Event()
Clasa ce modeleaza un Job ce este transmis uni thread de comunicare. Jobul poate avea 2 tipuri(citire si scriere), pozitia coloanei, si eventual valoarea de scris. Semnalizarea terminarii jobului se va face prin intermediul eventului doneEvent de catre threadul ce a preluat jobul
62598ef1236d856c2adc8812
class Car: <NEW_LINE> <INDENT> def __init__(self, manufacturer, model, make, transmission, color): <NEW_LINE> <INDENT> self.manufacturer = manufacturer <NEW_LINE> self.model = model <NEW_LINE> self.make = make <NEW_LINE> self.transmission = transmission <NEW_LINE> self.color = color <NEW_LINE> <DEDENT> def accelerate(s...
This class represents a car
62598ef171ff763f4b5e5f56
class Resistor(Device): <NEW_LINE> <INDENT> def __init__(self, pos_node, neg_node, resistance): <NEW_LINE> <INDENT> self._current = Variable() <NEW_LINE> self.resistance = resistance <NEW_LINE> super(Resistor, self).__init__(pos_node, neg_node) <NEW_LINE> <DEDENT> def voltage(self): <NEW_LINE> <INDENT> return -self.res...
A resistor with V = R*I.
62598ef1627d3e7fe0e05682
class ClassBasedView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> return HttpResponse('class_based_view GET') <NEW_LINE> <DEDENT> def post(self, request): <NEW_LINE> <INDENT> return HttpResponse('class_based_view POST')
クラスベースビュー
62598ef1956e5f7376df4a74
class DeepLabV3(_SimpleSegmentationModel): <NEW_LINE> <INDENT> pass
Implements DeepLabV3 model from `"Rethinking Atrous Convolution for Semantic Image Segmentation" <https://arxiv.org/abs/1706.05587>`_. Args: backbone (nn.Module): the network used to compute the features for the model. The backbone should return an OrderedDict[Tensor], with the key being "out" for ...
62598ef14428ac0f6e656d45
class Users(metaelement.MetaElement): <NEW_LINE> <INDENT> xml_tag_name = "users" <NEW_LINE> update_handler = UpdateUsers <NEW_LINE> url = "users" <NEW_LINE> def __init__(self, date, fullUpdate = None): <NEW_LINE> <INDENT> attributes = { 'date': date, } <NEW_LINE> if fullUpdate: <NEW_LINE> <INDENT> attributes['fullUpdat...
List of users tied to a system.
62598ef1cc0a2c11144797fd
class Detail(LoginRequiredMixin, TemplateView): <NEW_LINE> <INDENT> template_name = "shopping/detail.html" <NEW_LINE> def get(self, request, id, *args, **kwargs): <NEW_LINE> <INDENT> vetement = get_object_or_404(Vetement, id=id) <NEW_LINE> Item.objects.create(user=request.user, vetement=vetement) <NEW_LINE> return rend...
Display one vetement
62598ef197e22403b38396e7
class BoardsFile(PlainParamsFile): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(BoardsFile, self).__init__(path) <NEW_LINE> <DEDENT> def get_menu_info(self): <NEW_LINE> <INDENT> menu_info = {'sub_menus': {}} <NEW_LINE> menu_info['sub_menus']['names'] = [] <NEW_LINE> lines = get_lines_with_hea...
.
62598ef1be383301e0251fd2
class AppError(Exception): <NEW_LINE> <INDENT> title = 'Internal Server Error' <NEW_LINE> status = falcon.HTTP_500 <NEW_LINE> def __init__(self, title=None, description=None, error_list=None, info_list=None, status=None, retry=False,): <NEW_LINE> <INDENT> if title is None: <NEW_LINE> <INDENT> self.title = self.__class_...
Base error containing enough information to make a shipyard formatted error
62598ef1167d2b6e312b5791
class AuthenticationTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = { 'username': 'admin', 'password': 'easybing' } <NEW_LINE> User.objects.create_user(**self.user) <NEW_LINE> <DEDENT> def test_user_logged_in(self): <NEW_LINE> <INDENT> response = self.client.post(reverse('login'), {...
Test cases for authentication system.
62598ef156ac1b37e63009e4
class PhypLparMemory(object): <NEW_LINE> <INDENT> def __init__(self, mem): <NEW_LINE> <INDENT> self.logical_mem = mem.get('logicalMem') <NEW_LINE> self.backed_physical_mem = mem.get('backedPhysicalMem')
A sample of a Client Virtual Machines's memory presented by PHYP. Part of the PhypLparSample.
62598ef1a219f33f346c502b
class TestGtfsStopTime(object): <NEW_LINE> <INDENT> def test_construction(self): <NEW_LINE> <INDENT> provider = GtfsProviderSingleRowMock() <NEW_LINE> stop_times = provider.load_stop_times() <NEW_LINE> assert len(stop_times) == 1 <NEW_LINE> first_element = stop_times[0] <NEW_LINE> stop_time = models.StopTime(first_elem...
Tests basic functionality of models.StopTime objects
62598ef138b623060ffa7897
class LayoutSelector(Select): <NEW_LINE> <INDENT> def render(self, name, value, attrs=None, *args, **kwargs): <NEW_LINE> <INDENT> if attrs: <NEW_LINE> <INDENT> attrs['data-original-value'] = value <NEW_LINE> <DEDENT> return super(LayoutSelector, self).render(name, value, attrs, *args, **kwargs)
Modified `Select` class to select the original value. This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets .py` in the `django-fluent-pages` app.
62598ef18e7ae83300ee7888
class MyBuildExt(build_ext): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> build_ext.run(self) <NEW_LINE> global names <NEW_LINE> build_path = join(dirname(__file__), self.build_lib) <NEW_LINE> build_sources = tuple(join(build_path, *list(p.split('.') + ['*.py'])) for p in packages) <NEW_LINE> for s...
Our own build extension class
62598ef1ff9c53063f518e58
class TestDeprecationWarnings: <NEW_LINE> <INDENT> def test_deprecation_warning_namedzip(self): <NEW_LINE> <INDENT> with pytest.warns(DeprecationWarning): <NEW_LINE> <INDENT> namedzip(typename="Pair", field_names=("letter", "number")) <NEW_LINE> <DEDENT> <DEDENT> def test_deprecation_warning_namedzip_longest(self): <NE...
Verify that warnings are issued for deprecated parameters.
62598ef185dfad0860cbee63
class Point(object): <NEW_LINE> <INDENT> swagger_types = { 'coordinates': 'Position' } <NEW_LINE> attribute_map = { 'coordinates': 'coordinates' } <NEW_LINE> def __init__(self, coordinates=None): <NEW_LINE> <INDENT> self._coordinates = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.coordinates = coordinates ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ef13d592f4c4edb96e5
class ToolPackaging(Enum): <NEW_LINE> <INDENT> CONDA = "--use-conda" <NEW_LINE> SINGULARITY = "--use-singularity"
Supported tool packaging options. Args: CONDA: Use binaries from Conda. SINGULARITY: Use Singularity containers. Attributes: CONDA: Use binaries from Conda. SINGULARITY: Use Singularity containers.
62598ef1377c676e912f615e
@unittest.skipIf(not HAVE_NUMPY, 'Skipping due to missing numpy dependency.') <NEW_LINE> class Test_health_monthly_probability_to_annual_rate(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> self.prob = np.arange(0, 0.05, 1) <NEW_LINE> self.rate = -np.log(1 - self.prob) * 12 <NEW_LIN...
Tests the health.monthly_probability_to_annual_rate function with the following cases: convert a vector from annual to monthly convert a scalar convert a number less than zero (raise error) convert a number greater than one (raise error) convert a vector from annual to monthly and then back chec...
62598ef116aa5153ce3fecf9
class HelloWorld: <NEW_LINE> <INDENT> _cp_config = { 'tools.persona.on': True, 'tools.persona.audience': 'localhost:8080', 'tools.sessions.on': True, } <NEW_LINE> @cherrypy.expose <NEW_LINE> def index(self): <NEW_LINE> <INDENT> return "Hello %(username)s" % cherrypy.session <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> d...
A fully-contained example CherryPy app utilizing persona
62598ef17047854f4633dbcb
class TCON(TextFrame): <NEW_LINE> <INDENT> from mutagen._constants import GENRES <NEW_LINE> GENRES = GENRES <NEW_LINE> def __get_genres(self): <NEW_LINE> <INDENT> genres = [] <NEW_LINE> import re <NEW_LINE> genre_re = re.compile(r"((?:\((?P<id>[0-9]+|RX|CR)\))*)(?P<str>.+)?") <NEW_LINE> for value in self.text: <NEW_LIN...
Content type (Genre) ID3 has several ways genres can be represented; for convenience, use the 'genres' property rather than the 'text' attribute.
62598ef1bd1bec0571e144c7
class Re: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.last_match = None <NEW_LINE> <DEDENT> def match(self, pattern, text): <NEW_LINE> <INDENT> self.last_match = re.match(pattern, text) <NEW_LINE> return self.last_match <NEW_LINE> <DEDENT> def search(self, pattern, text): <NEW_LINE> <INDENT> self.l...
Custom regex helper class (source https://stackoverflow.com/a/4980181) Use to conveniently build switch-case like constructs using if/elif
62598ef1d58c6744b42db6b2
class Tile(object): <NEW_LINE> <INDENT> SVG_TEMPLATE = ( ) <NEW_LINE> def __init__(self, page, fill): <NEW_LINE> <INDENT> self.page = page <NEW_LINE> self.fill = fill <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return (self.page, self.fill) == (other.page, other.fill) <NEW_LINE> <DEDENT> def execut...
Class represnting "tile" command.
62598ef12ae34c7f260a98e0
class Promise(PaxosMessage): <NEW_LINE> <INDENT> def __init__( self, from_uid: str, proposer_uid: str, proposal_id: ProposalID, last_accepted_id: ProposalID, last_accepted_value: Any, ): <NEW_LINE> <INDENT> self.from_uid = from_uid <NEW_LINE> self.proposer_uid = proposer_uid <NEW_LINE> self.proposal_id = proposal_id <N...
Promise messages should be sent to at least the Proposer specified in the proposer_uid field
62598ef15fdd1c0f98e5c79b
class Tag(MP_Node): <NEW_LINE> <INDENT> name = models.CharField(max_length=20, null=False, unique=True) <NEW_LINE> node_order_by = ['name'] <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = 'tag' <NEW_LINE> app_label = 'emotion_recorder' <NEW_LINE> db_table = 'tags' <NEW_LINE> managed = True <NEW_LINE> <...
Model for table tag. Which stores tags for emotion post. Fields includes: Id: auto increase name: tag's name, Must unique.
62598ef1091ae35668703412
class CollegeDetailView(BaseView): <NEW_LINE> <INDENT> serializer_class = CollegeSerializer <NEW_LINE> def get(self, request, college_uid, format=None): <NEW_LINE> <INDENT> college = College.objects.filter(uid=college_uid).first() <NEW_LINE> if not college: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> base_url...
A BaseView derivative class that shows details of College.
62598ef1aad79263cf42d007
class LimitedPriorityLevelConfiguration(_kuber_definitions.Definition): <NEW_LINE> <INDENT> def __init__( self, assured_concurrency_shares: int = None, limit_response: "LimitResponse" = None, ): <NEW_LINE> <INDENT> super(LimitedPriorityLevelConfiguration, self).__init__( api_version="flowcontrol/v1alpha1", kind="Limite...
LimitedPriorityLevelConfiguration specifies how to handle requests that are subject to limits. It addresses two issues: * How are requests for this priority level limited? * What should be done with requests that exceed the limit?
62598ef12c8b7c6e89bd1fbc
class MinMaxScaler(basePreprocessors): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.name = 'Min-max Scaler' <NEW_LINE> self.model = preprocessing.MinMaxScaler() <NEW_LINE> self.takes_label = False <NEW_LINE> <DEDENT> def get_hyperparameter_space(self)...
Min-max scaler model.
62598ef1be7bc26dc925125f
class Model(object): <NEW_LINE> <INDENT> def __init__(self, model): <NEW_LINE> <INDENT> self.model = model() <NEW_LINE> <DEDENT> def fit(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def predict(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_coefs(self): <NEW_LINE> <INDENT> pass
This is a skeleton class to hold objects. All ML classes will be built of this to handle parameter tuning, fitting, and predicting in the same manner for our backtesting and forecasting functions.
62598ef126068e7796d4b156
class RawHtmlPattern(HtmlPattern): <NEW_LINE> <INDENT> def __init__(self, endtag, *args, **kwargs): <NEW_LINE> <INDENT> self._hz_tag = endtag <NEW_LINE> HtmlPattern.__init__(self, *args, **kwargs) <NEW_LINE> <DEDENT> def handleMatch(self, m): <NEW_LINE> <INDENT> pre = m.group(2) <NEW_LINE> body = self.unescape(m.group(...
A subclass of `catsoop.tools.markdown.inlinepattern.HtmlPattern` used to store raw inline html and return a placeholder.
62598ef14527f215b58e86f8
class UniqueFactorizationDomainPolynomial (GcdProvider, DomainPolynomial): <NEW_LINE> <INDENT> def __init__(self, coefficients, **kwds): <NEW_LINE> <INDENT> DomainPolynomial.__init__(self, coefficients, **kwds) <NEW_LINE> if not self._coefficient_ring.isufd(): <NEW_LINE> <INDENT> raise TypeError("coefficient ring has t...
Polynomial with unique factorization domain coefficients.
62598ef14e4d562566370c0e
class TestResultHistogram(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 testResultHistogram(self): <NEW_LINE> <INDENT> pass
ResultHistogram unit test stubs
62598ef1a219f33f346c502c
class GitTagProvider(GenericGitProvider): <NEW_LINE> <INDENT> TAG_PATTERN = re.compile(r'^refs/tags/(.*)$') <NEW_LINE> def __init__( self, software_package: SoftwarePackage, url: str, version_name_derivator: Union[Callable[[str], str], None] = None, version_pattern: Union[Pattern, None] = None, exclude_pattern: Union[P...
A Git provider using tags for versions.
62598ef1a17c0f6771d5aa4e
class ParseJournal(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._dsdict = {} <NEW_LINE> self._activity_name = [] <NEW_LINE> self._activity_count = [] <NEW_LINE> homepath = os.environ['HOME'] <NEW_LINE> for name in os.listdir(os.path.join(homepath, ".sugar")): <NEW_LINE> <INDENT> path = os.path.jo...
Simple parser of datastore
62598ef1442bda511e95ac5c
class PacManLoader(Loader): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Loader.__init__(self) <NEW_LINE> <DEDENT> def load(self): <NEW_LINE> <INDENT> provargs = reqargs = upargs = cnargs = [] <NEW_LINE> for info in self.getInfoList(): <NEW_LINE> <INDENT> name = info['name'] <NEW_LINE> version = info['ve...
Module in charge of downloading information about packages from a given URL
62598ef101c39578d7f1159d
class PythonPathTestCase(TestCase): <NEW_LINE> <INDENT> def test_unhandledImporter(self): <NEW_LINE> <INDENT> class SecretImporter(object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def hook(name): <NEW_LINE> <INDENT> return SecretImporter() <NEW_LINE> <DEDENT> syspath = ['example/path'] <NEW_LINE> sysmodules = {} <...
Tests for the class which provides the implementation for all of the public API of L{twisted.python.modules}, L{PythonPath}.
62598ef138b623060ffa7899
class TestUserSchedulersListSchedulers(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 testUserSchedulersListSchedulers(self): <NEW_LINE> <INDENT> pass
UserSchedulersListSchedulers unit test stubs
62598ef130bbd7224646842f
class Review(core_models.TimeStampedModel): <NEW_LINE> <INDENT> review = models.TextField() <NEW_LINE> Accuracy = models.IntegerField() <NEW_LINE> communication = models.IntegerField() <NEW_LINE> cleanliness = models.IntegerField() <NEW_LINE> location = models.IntegerField() <NEW_LINE> check_in = models.IntegerField() ...
Review Model Definition
62598ef1fff4ab517ebcbfd2
class BaseAction(): <NEW_LINE> <INDENT> def __init__(self,driver): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> <DEDENT> def find_element(self,loc,time=10,poll=1): <NEW_LINE> <INDENT> by = loc[0] <NEW_LINE> value = loc[1] <NEW_LINE> return WebDriverWait(self.driver,time,poll).until(lambda x:x.find_element(by,val...
1.脚本(scripts)注重的是操作的执行的先后顺序 2.特征是页面提供的 3.base action 是根据page的特征去做操作(比如:click,send_keys,input_text等)
62598ef1f9cc0f698b1c46cc
class MySqlExample: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def build_driver(): <NEW_LINE> <INDENT> d = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) <NEW_LINE> inifile = os.path.join(d, 'mysql_connections.ini') <NEW_LINE> if not os.path.exists(inifile): <NEW_LINE> <INDENT> inifile = in...
An example wrapper that takes files in this directory and applies them to a mysql database. Parses command-line arguments to determine which actions to take (call "python this_file.py -h" for details): You can create a new db, upgrade it, etc. Configuration: See mysql_connections.ini.template (in this directory). A...
62598ef1f548e778e5969d86
class Translate(Node): <NEW_LINE> <INDENT> __slots__ = [ "identifier", "language", "block", ] <NEW_LINE> def __init__(self, loc, identifier, language, block): <NEW_LINE> <INDENT> super(Translate, self).__init__(loc) <NEW_LINE> self.identifier = identifier <NEW_LINE> self.language = language <NEW_LINE> self.block = bloc...
A translation block, produced either by explicit translation statements or implicit translation blocs. If language is None, when executed this transfers control to the translate statement in the current language, if any, and otherwise runs the block. If language is not None, causes an error to occur if control reaches...
62598ef166656f66f7d58bdd
class CompleteMe(object): <NEW_LINE> <INDENT> spam = 1
Trivial class used in testing rlcompleter.Completer.
62598ef123849d37ff84f8b5
class Voigt(AveragingScheme): <NEW_LINE> <INDENT> def average_bulk_moduli(self, volumes, bulk_moduli, shear_moduli): <NEW_LINE> <INDENT> return voigt_average_function(volumes, bulk_moduli) <NEW_LINE> <DEDENT> def average_shear_moduli(self, volumes, bulk_moduli, shear_moduli): <NEW_LINE> <INDENT> return voigt_average_fu...
Class for computing the Voigt (iso-strain) bound for elastic properties. This derives from :class:`burnman.averaging_schemes.averaging_scheme`, and implements the :func:`burnman.averaging_schemes.averaging_scheme.average_bulk_moduli` and :func:`burnman.averaging_schemes.averaging_scheme.average_shear_moduli` functions...
62598ef13d592f4c4edb96e7
class Model: <NEW_LINE> <INDENT> def __init__(self, X, label, epsilon=0.8): <NEW_LINE> <INDENT> self._label = label <NEW_LINE> self.X = np.array(X) <NEW_LINE> correlations = np.corrcoef(self.X, y=None, rowvar=False) <NEW_LINE> self.mask = (np.absolute(correlations) > epsilon) <NEW_LINE> pool = Pool(processes=cpu_count(...
The model constructed for a given class
62598ef176e4537e8c3eddb1
class DescribeTargetHealthRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.LoadBalancerIds = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.LoadBalancerIds = params.get("LoadBalancerIds") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> fo...
DescribeTargetHealth请求参数结构体
62598ef160cbc95b06362b3b
class ContractorDeliverableTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> Model = ContentType.objects.get_for_model(ContractorDeliverable) <NEW_LINE> self.entity = EntityFactory() <NEW_LINE> self.category = CategoryFactory( category_template__metadata_model=Model, third_parties=[self.entit...
Base test case class with useful document helpers.
62598ef17047854f4633dbcd
class Bucketlist(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'bucketlist' <NEW_LINE> bucketlist_id = db.Column(db.Integer,primary_key=True,autoincrement=True) <NEW_LINE> title = db.Column(db.String(80)) <NEW_LINE> description = db.Column(db.String(254)) <NEW_LINE> date_created = db.Column(db.DateTime, default=dateti...
this class models the bucketlist table
62598ef1236d856c2adc8814
class AppWatchdog(QtCore.QObject): <NEW_LINE> <INDENT> sigDoQuit = QtCore.Signal(object) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.alreadyQuit = False <NEW_LINE> self.hasGui = False <NEW_LINE> self.exitcode = 0 <NEW_LINE> self.timer = QtCore.QTimer() <NEW_LINE> self.timer.tim...
This class periodically runs a function for debugging and handles application exit.
62598ef1e5267d203ee6a103
class FileFieldAsUrlField(LimitedExtensionMixin, serializers.FileField): <NEW_LINE> <INDENT> def __init__(self, file_field_name='executed_file', *args, **kwargs): <NEW_LINE> <INDENT> self.file_field_name = file_field_name <NEW_LINE> return super(FileFieldAsUrlField, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> d...
Acts like a normal FileField but to_native will download the file
62598ef121bff66bcd721451
class Ports_quark(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_name(cls): <NEW_LINE> <INDENT> return "Quark Ports API Extension" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_alias(cls): <NEW_LINE> <INDENT> return "ports_quark" <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_description(cls): ...
Extends ports for quark API purposes. * Allows for DELETE (disassociation of port) with IP address * Allows for POST with fixed_ip in body to associate additional IPs
62598ef1956e5f7376df4a76
class StatsCommandR: <NEW_LINE> <INDENT> allow_origin, rest_url = get_allowed.get_allowed() <NEW_LINE> def GET(self, machine, category, format): <NEW_LINE> <INDENT> web.header('Access-Control-Allow-Origin', self.allow_origin) <NEW_LINE> out = None <NEW_LINE> try: <NEW_LINE> <INDENT> if category == "all": <NEW_LINE> <IN...
This endpoint is for getting stats about a Vent machine.
62598ef13539df3088ecaaad
class ONOSFloatingIP(object): <NEW_LINE> <INDENT> def send_floatingip_msg(self, msg_type, entity_path, entity): <NEW_LINE> <INDENT> onos_utils.send_msg(self.onos_path, self.onos_auth, msg_type, entity_path, entity) <NEW_LINE> <DEDENT> def handle_create_floatingip(self, fip_dict): <NEW_LINE> <INDENT> self.send_floatingi...
Implementation of ONOS L3 Floating IP Service. This class sends Neutron's L3 Floating IP messages to ONOS.
62598ef192d797404e387f79
class get_ocr_args(object): <NEW_LINE> <INDENT> def __init__(self, image=None,): <NEW_LINE> <INDENT> self.image = image <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE>...
Attributes: - image
62598ef1a219f33f346c502e
class LaunchTechnoResearchForm(forms.Form): <NEW_LINE> <INDENT> technology = forms.ModelChoiceField( queryset = Technology.objects.all(), )
Provide a form to launch a technology research
62598ef13539df3088ecaaae