code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Font(object): <NEW_LINE> <INDENT> units_per_em = NotImplementedAttribute() <NEW_LINE> encoding = NotImplementedAttribute() <NEW_LINE> name = NotImplementedAttribute() <NEW_LINE> bounding_box = NotImplementedAttribute() <NEW_LINE> fixed_pitch = NotImplementedAttribute() <NEW_LINE> @property <NEW_LINE> def italic(s...
A collection of glyphs in a particular style This is a base class for classes that parse different font formats. See :mod:`rinoh.font.type1` and :mod:`rinoh.font.opentype`. Args: filename (str): filename of the font file to load weight (FontWeight): weight of the font slant (FontSlant): slant of the font ...
62598f96be8e80087fbbed57
class SymmetricCP(DecompositionMixin): <NEW_LINE> <INDENT> def __init__(self, rank, n_repeat=10, n_iteration=10, verbose=False): <NEW_LINE> <INDENT> self.rank = rank <NEW_LINE> self.n_repeat = n_repeat <NEW_LINE> self.n_iteration = n_iteration <NEW_LINE> self.verbose = verbose <NEW_LINE> <DEDENT> def fit_transform(self...
Symmetric CP Decomposition via Robust Symmetric Tensor Power Iteration Parameters ---------- rank : int rank of the decomposition (number of rank-1 components) n_repeat : int, default is 10 number of initializations to be tried n_iterations : int, default is 10 number of power iterations verbose : bool ...
62598f966aa9bd52df0d4bc6
class IsInGroups(permissions.BasePermission): <NEW_LINE> <INDENT> message = 'User is not belong to this group.' <NEW_LINE> def has_permission(self, request, view): <NEW_LINE> <INDENT> user = get_user(request) <NEW_LINE> if request.META['REQUEST_URI'] == '/jobs/pizdaint/hhnb_daint_cscs/': <NEW_LINE> <INDENT> r = request...
This custom permission allow users to access api based on groups
62598f9630bbd722464697f2
class CurrentTime: <NEW_LINE> <INDENT> def __init__(self, hour, minute, second): <NEW_LINE> <INDENT> self.hour = hour <NEW_LINE> self.minute = minute <NEW_LINE> self.second = second <NEW_LINE> pass <NEW_LINE> <DEDENT> pass <NEW_LINE> @staticmethod <NEW_LINE> def show_time(): <NEW_LINE> <INDENT> return time.strftime("%H...
Current Time Class
62598f9632920d7e50bc5d50
class Brownant(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url_map = Map(strict_slashes=False, host_matching=True, redirect_defaults=False) <NEW_LINE> <DEDENT> def add_url_rule(self, host, rule_string, endpoint, **options): <NEW_LINE> <INDENT> rule = Rule(rule_string, host=host, endpoint=e...
The app which could manage whole crawler system.
62598f9699cbb53fe6830bc9
class ObjectFactory: <NEW_LINE> <INDENT> __type1Value1 = None <NEW_LINE> __type2Value1 = None <NEW_LINE> @staticmethod <NEW_LINE> def initialize(): <NEW_LINE> <INDENT> ObjectFactory.__type1Value1 = Type1(1) <NEW_LINE> ObjectFactory.__type2Value1 = Type2(1) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def getType1Value1...
Manages prototypes. Static factory, that encapsulates prototype initialization and then allows instatiation of the classes from these prototypes.
62598f9610dbd63aa1c708af
class LargeConfig(object): <NEW_LINE> <INDENT> init_scale = 0.04 <NEW_LINE> learning_rate = 1.0 <NEW_LINE> max_grad_norm = 10 <NEW_LINE> num_layers = 2 <NEW_LINE> num_steps = 20 <NEW_LINE> hidden_size = 43 <NEW_LINE> max_epoch = 14 <NEW_LINE> max_max_epoch = 55 <NEW_LINE> keep_prob = 0.35 <NEW_LINE> lr_decay = 1 / 1.15...
Large config.
62598f96656771135c48937a
class YahooQuotesReader(_BaseReader): <NEW_LINE> <INDENT> @property <NEW_LINE> def url(self): <NEW_LINE> <INDENT> return 'https://query1.finance.yahoo.com/v7/finance/quote' <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> if isinstance(self.symbols, compat.string_types): <NEW_LINE> <INDENT> return self._read_one...
Get current yahoo quote
62598f96a8ecb03325870f03
class ClickMixin(ElementMixin): <NEW_LINE> <INDENT> def click(self): <NEW_LINE> <INDENT> element = self.element() <NEW_LINE> if element: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if not element.is_displayed(): <NEW_LINE> <INDENT> self.scroll_to() <NEW_LINE> <DEDENT> element.click() <NEW_LINE> return True <NEW_LINE> ...
The ClickMixin Implementation
62598f96851cf427c66b7fc0
class SubstrateEd25519AddrDecoder(IAddrDecoder): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def DecodeAddr(addr: str, **kwargs: Any) -> bytes: <NEW_LINE> <INDENT> return _SubstrateAddrUtils.DecodeAddr(addr, kwargs["ss58_format"], Ed25519PublicKey)
Substrate address decoder class, based on ed25519 curve. It allows the Substrate address decoding.
62598f96498bea3a75a57819
class Exponential: <NEW_LINE> <INDENT> def __init__(self, data=None, lambtha=1.): <NEW_LINE> <INDENT> if data is not None: <NEW_LINE> <INDENT> if not isinstance(data, list): <NEW_LINE> <INDENT> raise TypeError("data must be a list") <NEW_LINE> <DEDENT> if len(data) <= 2: <NEW_LINE> <INDENT> raise ValueError("data must ...
Exponential class
62598f967047854f4633f0da
class MultiArmedBandit: <NEW_LINE> <INDENT> def __init__(self, epsilon=0.2): <NEW_LINE> <INDENT> self.epsilon = epsilon <NEW_LINE> <DEDENT> def fit(self, env, steps=1000): <NEW_LINE> <INDENT> state_action_values = np.zeros((env.observation_space.n,env.action_space.n)) <NEW_LINE> s = int(np.floor(steps / 100)) <NEW_LINE...
MultiArmedBandit reinforcement learning agent. Arguments: epsilon - (float) The probability of randomly exploring the action space rather than exploiting the best action
62598f9655399d3f05626219
class WAM(Manipulator): <NEW_LINE> <INDENT> def __init__(self, simulator, position=(0, 0, 0), orientation=(0, 0, 0, 1), fixed_base=True, scale=1., urdf=os.path.dirname(__file__) + '/urdfs/wam/wam.urdf'): <NEW_LINE> <INDENT> if position is None: <NEW_LINE> <INDENT> position = (0., 0., 0.) <NEW_LINE> <DEDENT> if len(posi...
Wam robot References: - [1] https://advanced.barrett.com/wam-arm-1 - [2] https://github.com/jhu-lcsr/barrett_model
62598f96596a897236127978
class Bibfmt(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'bibfmt' <NEW_LINE> id_bibrec = db.Column( db.MediumInteger(8, unsigned=True), db.ForeignKey(Bibrec.id), nullable=False, server_default='0', primary_key=True, autoincrement=False) <NEW_LINE> format = db.Column( db.String(10), nullable=False, server_default='',...
Represent a Bibfmt record.
62598f968a43f66fc4bf1e75
class MessageControlType (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'MessageControlType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/avs/avs.xsd', 6195, 3) <NEW_LINE> _Documentation = '...
A Type of Message according to its operational status.
62598f9626068e7796d4c65c
class TestNotFoundExceptionResponseContent(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 testNotFoundExceptionResponseContent(self): <NEW_LINE> <INDENT> pass
NotFoundExceptionResponseContent unit test stubs
62598f9699cbb53fe6830bca
class CacheStorage(BaseStorage): <NEW_LINE> <INDENT> def __init__(self, request, *args, **kwargs): <NEW_LINE> <INDENT> super(CacheStorage, self).__init__(request, *args, **kwargs) <NEW_LINE> self.user = request.user.id <NEW_LINE> self.key = 'storage_messages_%s' % self.user <NEW_LINE> <DEDENT> def _get(self, *args, **k...
Stores messages in a cache.
62598f96435de62698e9baee
class UnTrashMessageInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(UnTrashMessageInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_ClientID(self, value): <NEW_LINE> <INDENT> super(UnTrashMessageInputSet, self)._set_input('ClientID', value) ...
An InputSet with methods appropriate for specifying the inputs to the UnTrashMessage Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598f96a05bb46b3848a579
class PersistedInputDir(PersistedInputPath): <NEW_LINE> <INDENT> _input_ports = [ IPort('path', Directory, optional=True), IPort('metadata', Metadata, optional=True), IPort('hash', PersistentHash, optional=True)] <NEW_LINE> _output_ports = [ OPort('path', File)] <NEW_LINE> _settings = ModuleSettings(configure_widget...
Records or retrieves an external directory in the file store. Because this class has the same interface for querying an existing directory and inserting a new one, it uses Metadata instead of QueryCondition for the query. This means it only allows equality conditions.
62598f96b57a9660fecd1776
class MultiHeadedAttention(nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_head, n_feat, dropout_rate): <NEW_LINE> <INDENT> super(MultiHeadedAttention, self).__init__() <NEW_LINE> assert n_feat % n_head == 0 <NEW_LINE> self.d_k = n_feat // n_head <NEW_LINE> self.h = n_head <NEW_LINE> self.linear_q = nn.Linear(n_fe...
Multi-Head Attention layer :param int n_head: the number of head s :param int n_feat: the number of features :param float dropout_rate: dropout rate
62598f96a17c0f6771d5bf35
class RedditPost: <NEW_LINE> <INDENT> title = '' <NEW_LINE> link = '' <NEW_LINE> logger = logging.getLogger('redditdesktop.redditHTML.RedditPost') <NEW_LINE> def __init__(self, title, link): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.link = link <NEW_LINE> <DEDENT> def isPicture(self): <NEW_LINE> <INDENT> h...
An object containing the different html fields outlined in a single post on Reddit. Very minimal for now
62598f964527f215b58e9bde
class ToTensor(BasicTransform): <NEW_LINE> <INDENT> def __init__(self, num_classes=1, sigmoid=True, normalize=None): <NEW_LINE> <INDENT> super(ToTensor, self).__init__(always_apply=True, p=1.0) <NEW_LINE> self.num_classes = num_classes <NEW_LINE> self.sigmoid = sigmoid <NEW_LINE> self.normalize = normalize <NEW_LINE> w...
Convert image and mask to `torch.Tensor` and divide by 255 if image or mask are `uint8` type. WARNING! Please use this with care and look into sources before usage. Args: num_classes (int): only for segmentation sigmoid (bool, optional): only for segmentation, transform mask to LongTensor or not. normalize...
62598f96e64d504609df9234
class Mower: <NEW_LINE> <INDENT> def __init__(self, X, Y, orientation, upper_right_corner_X, upper_right_corner_Y): <NEW_LINE> <INDENT> self.X = X <NEW_LINE> self.Y = Y <NEW_LINE> self.orientation = orientation <NEW_LINE> self.upper_right_corner_X = upper_right_corner_X <NEW_LINE> self.upper_right_corner_Y = upper_righ...
This class define a mower behavior
62598f96baa26c4b54d4efaa
class Variable(Elementary): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> Elementary.__init__(self, name) <NEW_LINE> self.variableId = None <NEW_LINE> <DEDENT> def getValue(self): <NEW_LINE> <INDENT> error_msg = ( f'Evaluating Variable {self.name} requires a database. Use the ' f'function getValue_c...
Explanatory variable This represents the explanatory variables of the choice model. Typically, they come from the data set.
62598f96090684286d593556
class AdminUser(models.Model): <NEW_LINE> <INDENT> username = models.CharField(max_length = 255) <NEW_LINE> password = models.CharField(max_length = 40) <NEW_LINE> def validate_user(self): <NEW_LINE> <INDENT> if AdminUser.objects.filter(username = self.username).filter(password = hashlib.sha1(self.password).hexdigest()...
Information about the manager user, able to insert new movies and schedule showings
62598f9601c39578d7f12a7f
class EnrichmentMerchant(object): <NEW_LINE> <INDENT> openapi_types = { 'merchant_name': 'str', 'parent_group': 'str' } <NEW_LINE> attribute_map = { 'merchant_name': 'merchantName', 'parent_group': 'parentGroup' } <NEW_LINE> def __init__(self, merchant_name=None, parent_group=None, local_vars_configuration=None): <NEW_...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598f96460517430c431ed6
@DefineSrvCommand(srv,"checksec") <NEW_LINE> class cmd_checksec(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def run(srv, args): <NEW_LINE> <INDENT> if srv.obj: <NEW_LINE> <INDENT> srv.msgs.put(str(srv.obj.task.view.checksec)) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> srv.msgs.put('error: no task loaded') ...
checksec: security parameters related to the current task.
62598f96be383301e02534f6
class HomeView(TemplateView): <NEW_LINE> <INDENT> template_name = 'home.html'
The home view
62598f96a219f33f346c6515
class Probe(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> self.speclst = kw.pop('speclst') <NEW_LINE> self.name = kw.pop('name', None) <NEW_LINE> self.crd = np.array(args, dtype='float64') <NEW_LINE> self.pcl = -1 <NEW_LINE> self.vals = list() <NEW_LINE> <DEDENT> def __str__(self): <...
Represent a point in the mesh.
62598f96fbf16365ca793db1
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> password = models.CharField(max_length=255) <NEW_LINE> is_activate = models.BooleanField(default=True) <NEW_LINE> is_staff = mod...
Database model for user in the system
62598f96f7d966606f747ce0
class Scenario(object): <NEW_LINE> <INDENT> def __init__(self, feature, name, line_number, example_converters=None, tags=None): <NEW_LINE> <INDENT> self.feature = feature <NEW_LINE> self.name = name <NEW_LINE> self._steps = [] <NEW_LINE> self.examples = Examples() <NEW_LINE> self.line_number = line_number <NEW_LINE> se...
Scenario.
62598f9610dbd63aa1c708b1
class loop3(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.loops3" <NEW_LINE> bl_label = "mirror selected on Z axis" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> bpy.ops.object.transform_apply(location=False, rotation=True, scale=True) <NEW_LINE> ...
Mirror over Z axis / global
62598f96656771135c48937c
class GridSearchColorPlot(GridSearchVisualizer): <NEW_LINE> <INDENT> def __init__( self, estimator, x_param, y_param, metric="mean_test_score", colormap="RdBu_r", ax=None, **kwargs ): <NEW_LINE> <INDENT> super(GridSearchColorPlot, self).__init__(estimator, ax=ax, **kwargs) <NEW_LINE> self.x_param = x_param <NEW_LINE> s...
Create a color plot showing the best grid search scores across two parameters. Parameters ---------- estimator : Scikit-Learn grid search object Should be an instance of GridSearchCV. If not, an exception is raised. x_param : string The name of the parameter to be visualized on the horizontal axis. y_param :...
62598f96a8ecb03325870f05
class BasicBuilding(Building): <NEW_LINE> <INDENT> def _generate_calls(self): <NEW_LINE> <INDENT> print_status(self.env.now, f"Building has started generating calls...") <NEW_LINE> while True: <NEW_LINE> <INDENT> yield self.env.timeout(100) <NEW_LINE> call = self._generate_single_call() <NEW_LINE> self.call_queue.put(c...
A building that assigns calls randomly.
62598f967d847024c075c0cf
class Ship(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_game): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = ai_game.screen <NEW_LINE> self.settings = ai_game.settings <NEW_LINE> self.screen_rect = ai_game.screen.get_rect() <NEW_LINE> self.image = pygame.image.load('images/ship.bmp') <NEW_LINE> ...
Класс для управления кораблем.
62598f9655399d3f0562621b
class DescribeAgentVulsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VulType = None <NEW_LINE> self.Uuid = None <NEW_LINE> self.Limit = None <NEW_LINE> self.Offset = None <NEW_LINE> self.Filters = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> sel...
DescribeAgentVuls请求参数结构体
62598f96435de62698e9baef
class NumeroSessaoMemoria(object): <NEW_LINE> <INDENT> def __init__(self, tamanho=100): <NEW_LINE> <INDENT> super(NumeroSessaoMemoria, self).__init__() <NEW_LINE> self._tamanho = tamanho <NEW_LINE> self._memoria = collections.deque(maxlen=tamanho) <NEW_LINE> <DEDENT> def __contains__(self, item): <NEW_LINE> <INDENT> re...
Implementa um numerador de sessão simples, baseado em memória, não persistente, que irá gerar um número de sessão (seis dígitos) diferente entre os ``n`` últimos números de sessão gerados. Conforme a ER SAT, um número de sessão não poderá ser igual aos últimos ``100`` números.
62598f96435de62698e9baf0
class Token: <NEW_LINE> <INDENT> def __init__(self, token_text: str, line_number: int, position: int) -> None: <NEW_LINE> <INDENT> self.token_text = token_text <NEW_LINE> self.type = TokenTypes.classify(token_text) <NEW_LINE> self.line_number = line_number <NEW_LINE> self.position = int(position) <NEW_LINE> if len(toke...
Keeps the token details, the text, where it is in the total text block, and what type it is
62598f9699cbb53fe6830bcc
class ToughEnergyCasesPageSet(page_set_module.PageSet): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ToughEnergyCasesPageSet, self).__init__( archive_data_file='data/tough_energy_cases.json', bucket=page_set_module.PUBLIC_BUCKET, credentials_path='data/credentials.json') <NEW_LINE> self.AddPage(Tou...
Pages for measuring Chrome power draw.
62598f9607d97122c42169ae
class ImageListView(View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> images = Image.objects.all() <NEW_LINE> paginator = Paginator(images, 8) <NEW_LINE> page = int(request.GET.get('page', 1)) <NEW_LINE> try: <NEW_LINE> <INDENT> images = paginator.page(page) <NEW_LINE> <DEDENT> except EmptyPage: <N...
For AJAX requests, we render the list_ajax.html template. This template will only contain the images of the requested page. For standard requests, we render the user_list.html template. This template will extend the base.html template to display the whole page and will include the list_ajax.html template to include th...
62598f96004d5f362081ee7a
class Regions: <NEW_LINE> <INDENT> def __init__(self, lst=None): <NEW_LINE> <INDENT> self._list = lst if lst is not None else [] <NEW_LINE> if self._list: <NEW_LINE> <INDENT> self._sorted_list = self._make_sorted(self._list) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._sorted_list = [] <NEW_LINE> <DEDENT> <DEDEN...
A container class acting as a list of regions (sections or segments). Additionally, it keeps an sorted list of all regions that are mapped into memory to allow fast lookups. We assume none of the regions overlap with others.
62598f962ae34c7f260aaddd
class TLE: <NEW_LINE> <INDENT> def __init__(self, last_update, id_line, line1, line2): <NEW_LINE> <INDENT> self.last_update = last_update <NEW_LINE> self.id_line = id_line <NEW_LINE> self.line1 = line1 <NEW_LINE> self.line2 = line2 <NEW_LINE> self.name = self.id_line <NEW_LINE> self.norad_id = self.line2[2:7] <NEW_LINE...
Initialises TLE from three lines and the last time it was updated.
62598f96a79ad16197769d5e
class execute_pep_process(Component): <NEW_LINE> <INDENT> implements(ProcessInterface) <NEW_LINE> identifier = "execute_assessment" <NEW_LINE> title = "Execute assessment process of the PEP Library" <NEW_LINE> metadata = {"test-metadata":"http://www.metadata.com/test-metadata"} <NEW_LINE> profiles = ["test_profile"] <N...
API for pep processing
62598f96bd1bec0571e14f42
@method_decorator([login_required], name='dispatch') <NEW_LINE> class JobCreateView(CreateView): <NEW_LINE> <INDENT> model = Job <NEW_LINE> fields = ('job_title', 'job_description', 'price', 'tags', 'document') <NEW_LINE> template_name = 'jobs/job_add_form.html' <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT...
创建任务
62598f96498bea3a75a5781c
class CircularDependency(Exception): <NEW_LINE> <INDENT> pass
When a course depends, ultimately, on itself
62598f96a05bb46b3848a57b
class EigenGapType(enum.Enum): <NEW_LINE> <INDENT> Ratio = enum.auto() <NEW_LINE> NormalizedDiff = enum.auto()
Different types of the eigengap computation.
62598f9629b78933be269f5b
class Public(Handler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> user = users.get_current_user() <NEW_LINE> if user: <NEW_LINE> <INDENT> self.render('public.html',link="http://trello.com",actions=constants.ACTIONS,signout=constants.SIGNOUT) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.redirect('/') <...
Handles /publicfeeds
62598f9601c39578d7f12a80
class WallAnt(Ant): <NEW_LINE> <INDENT> implemented = True <NEW_LINE> name = 'Wall' <NEW_LINE> food_cost = 4 <NEW_LINE> def __init__(self, armor=4): <NEW_LINE> <INDENT> Ant.__init__(self, armor)
A defense ant with high armor value
62598f96090684286d593557
class JSONTypeError(shieldException): <NEW_LINE> <INDENT> pass
Unexpected type was passed as parameter
62598f96be383301e02534f8
class Character(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "Dean" <NEW_LINE> self.sex = "Male" <NEW_LINE> self.max_hit_points = 50 <NEW_LINE> self.current_hit_points = 50 <NEW_LINE> self.max_speed = 10 <NEW_LINE> self.armor_amount = 8
This is a class that represents the main character in the game.
62598f96009cb60464d01221
class AlienInvasion: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pygame.init() <NEW_LINE> self.settings=Settings() <NEW_LINE> self.screen=pygame.display.set_mode((self.settings.screen_width,self.settings.screen_height)) <NEW_LINE> pygame.display.set_caption("Alien Invasion") <NEW_LINE> self.ship =Ship(s...
overall class to manage game assets and behaviour
62598f96507cdc57c63a4a91
class _ListenerCollection(object): <NEW_LINE> <INDENT> _exec_once = False <NEW_LINE> def __init__(self, parent, target_cls): <NEW_LINE> <INDENT> if target_cls not in parent._clslevel: <NEW_LINE> <INDENT> parent.update_subclass(target_cls) <NEW_LINE> <DEDENT> self.parent_listeners = parent._clslevel[target_cls] <NEW_LIN...
Instance-level attributes on instances of :class:`._Dispatch`. Represents a collection of listeners. As of 0.7.9, _ListenerCollection is only first created via the _EmptyListener.for_modify() method.
62598f96a219f33f346c6517
class LaunchRequestHandler(AbstractRequestHandler): <NEW_LINE> <INDENT> def can_handle(self, handler_input): <NEW_LINE> <INDENT> return is_request_type("LaunchRequest")(handler_input) <NEW_LINE> <DEDENT> def handle(self, handler_input): <NEW_LINE> <INDENT> logger.info("In LaunchRequestHandler") <NEW_LINE> in_skill_resp...
Handler for Launch Requests. The handler gets the in-skill products for the user, and provides a custom welcome message depending on the ownership of the products to the user. User says: Alexa, open <skill_name>.
62598f961b99ca400228f3ab
class Configurations(namedtuple('Configurations', [ 'cve_data_version', 'nodes' ])): <NEW_LINE> <INDENT> def __new__(cls, cve_data_version: str = None, nodes: typing.List[ConfigurationsEntry] = None, **kwargs): <NEW_LINE> <INDENT> return super(Configurations, cls).__new__( cls, cve_data_version=cve_data_version, nodes=...
Representation of NVD Configurations object.
62598f96442bda511e95c162
class UsernameEmailAuthenticationForm(forms.Form): <NEW_LINE> <INDENT> username_email = forms.CharField(label=_('Username or Email')) <NEW_LINE> password = forms.CharField(label=_('Password'), widget=forms.PasswordInput) <NEW_LINE> error_messages = { 'invalid_login': _('Please enter a correct %(username_email)s and %(p...
Based on django.contrib.auth.forms.AuthenticationForm
62598f9630bbd722464697f4
class DisplayField(models.Model): <NEW_LINE> <INDENT> report = models.ForeignKey(Report) <NEW_LINE> path = models.CharField(max_length=2000, blank=True) <NEW_LINE> path_verbose = models.CharField(max_length=2000, blank=True) <NEW_LINE> field = models.CharField(max_length=2000) <NEW_LINE> field_verbose = models.CharFiel...
A display field to show in a report. Always belongs to a Report
62598f963cc13d1c6d46546a
@register_template <NEW_LINE> class IVarIndexLVarByIVar(ConfigurableStatementTemplate): <NEW_LINE> <INDENT> fills_type = HoleType.STMT <NEW_LINE> required_cost = 1 <NEW_LINE> weight = 5 <NEW_LINE> accesses = [Accesses.IVAR_WRITE, Accesses.LVAR_READ, Accesses.IVAR_READ] <NEW_LINE> def fill(self, hole, rng): <NEW_LINE> <...
Statement, e.g. v1 = L1[v2].
62598f967047854f4633f0de
class ProjectTaskPresecessor(models.Model): <NEW_LINE> <INDENT> _inherit = 'project.task.predecessor' <NEW_LINE> task_id = fields.Many2one(ondelete='cascade') <NEW_LINE> parent_task_id = fields.Many2one(ondelete='cascade')
Called predecessors but represents links between successors and predecessors.
62598f960c0af96317c56081
class ILensAtomPubServiceAdapter(IAtomPubServiceAdapter): <NEW_LINE> <INDENT> pass
Marker interface for objects that want to adapt Lenses as atompub targets.
62598f96eab8aa0e5d30ba80
class DisplayDataSource(object): <NEW_LINE> <INDENT> def __init__(self, display_string = '', separator = None, *a, **k): <NEW_LINE> <INDENT> super(DisplayDataSource, self).__init__(*a, **k) <NEW_LINE> self._display_string = display_string <NEW_LINE> self._separator = separator <NEW_LINE> self._update_callback = None <N...
Data object that is fed with a specific string and notifies a observer via its update_callback.
62598f960fa83653e46f4be8
class WSGIChunkedBodyCopy(object): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def __call__(self, environ, start_response): <NEW_LINE> <INDENT> wsgi_input = environ.get('wsgi.input') <NEW_LINE> if 'chunked' in environ.get('HTTP_TRANSFER_ENCODING', '') and ...
WSGI wrapper that handles chunked encoding of the request body. Copies de-chunked body to a WSGI environment variable called `body_copy` (so best not to use with large requests lest memory issues crop up.
62598f96596a89723612797c
class MuDrawShellCommand(BaseShellCommand): <NEW_LINE> <INDENT> def __init__(self, pdf_file, resolution_dpi, page_file_format="page%03d.png", logger=None): <NEW_LINE> <INDENT> self.pdf_file = pdf_file <NEW_LINE> self.resolution_dpi = resolution_dpi <NEW_LINE> self.page_image_file_format = page_file_format <NEW_LINE> su...
Command to render a PDF to individual image files.
62598f96d99f1b3c44d053ae
class Solution: <NEW_LINE> <INDENT> def find_even_number_of_digits(self, nums): <NEW_LINE> <INDENT> return len(list(filter(lambda x :x % 2 == 0, list(map(lambda num : (int(math.log10(num)) + 1), nums)))))
Finds number of even digit of numbers in an array.
62598f96b5575c28eb712b4b
class IamRulesEngine(bre.BaseRulesEngine): <NEW_LINE> <INDENT> def __init__(self, rules_file_path, snapshot_timestamp=None): <NEW_LINE> <INDENT> super(IamRulesEngine, self).__init__( rules_file_path=rules_file_path, snapshot_timestamp=snapshot_timestamp) <NEW_LINE> self.rule_book = None <NEW_LINE> <DEDENT> def build_ru...
Rules engine for org resources.
62598f9660cbc95b06364046
class ShapeRef (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_EMPTY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'ShapeRef') <NEW_LINE> _XSDLocation = pyxb....
A reference to a shape definition
62598f96498bea3a75a5781e
class RoutingIntent(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'type': 'str'}, 'typ...
The routing intent child resource of a Virtual hub. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :param name: The name of the resource that is unique within a resource group. This name can be used to access the resource. :type name: str...
62598f963eb6a72ae038a33b
class LossHistory(Callback): <NEW_LINE> <INDENT> def on_train_begin(self, logs={}): <NEW_LINE> <INDENT> self.losses = [] <NEW_LINE> <DEDENT> def on_batch_end(self, batch, logs={}): <NEW_LINE> <INDENT> self.losses.append(logs.get('loss'))
loss history
62598f960a50d4780f7050d5
class Core: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.appender = ContentAppender(self) <NEW_LINE> <DEDENT> def process(self, content): <NEW_LINE> <INDENT> log.debug('processing:\n%s', content) <NEW_LINE> self.reset() <NEW_LINE> if content.tag is None: <NEW_LINE> <INDENT> content.tag = content.val...
An I{abstract} marshaller. This class implement the core functionality of the marshaller. @ivar appender: A content appender. @type appender: L{ContentAppender}
62598f96e5267d203ee6b617
@XBlock.needs('i18n') <NEW_LINE> class CompletionBlock( SubmittingXBlockMixin, QuestionMixin, StudioEditableXBlockMixin, XBlockWithTranslationServiceMixin, StudentViewUserStateMixin, XBlock ): <NEW_LINE> <INDENT> CATEGORY = 'pb-completion' <NEW_LINE> STUDIO_LABEL = _(u'Completion') <NEW_LINE> USER_STATE_FIELDS = ['stud...
An XBlock used by students to indicate that they completed a given task. The student's answer is always considered "correct".
62598f96adb09d7d5dc0a286
class GenerateDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_path, word_to_ix, batch_size): <NEW_LINE> <INDENT> data_file = open(data_path, 'r', encoding ='utf-8') <NEW_LINE> self.data = data_file.readlines() <NEW_LINE> self.len = math.floor(len(self.data)/batch_size) <NEW_LINE> self.word_to_ix = word_to...
Alignment dataset.
62598f9601c39578d7f12a81
class Ui: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.business_logic = BusinessLogic() <NEW_LINE> <DEDENT> def get_product_list(self): <NEW_LINE> <INDENT> print('PRODUCT LIST:') <NEW_LINE> for product in self.business_logic.product_list(): <NEW_LINE> <INDENT> print(product) <NEW_LINE> <DEDENT> prin...
UI interaction class
62598f966fb2d068a7693cb2
class PacketCaptureParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'target': {'required': True}, 'storage_location': {'required': True}, } <NEW_LINE> _attribute_map = { 'target': {'key': 'target', 'type': 'str'}, 'bytes_to_capture_per_packet': {'key': 'bytesToCapturePerPacket', 'type': 'int'...
Parameters that define the create packet capture operation. All required parameters must be populated in order to send to Azure. :param target: Required. The ID of the targeted resource, only VM is currently supported. :type target: str :param bytes_to_capture_per_packet: Number of bytes captured per packet, the rema...
62598f964428ac0f6e658229
class DashboardPage(PageObject): <NEW_LINE> <INDENT> url = BASE_URL + "/course/" <NEW_LINE> def is_browser_on_page(self): <NEW_LINE> <INDENT> return self.q(css='body.view-dashboard').present <NEW_LINE> <DEDENT> @property <NEW_LINE> def course_runs(self): <NEW_LINE> <INDENT> return self.q(css='.course-run>.value').text ...
My Courses page in Studio
62598f96d58c6744b42dc14f
class IAnonReport(form.Schema): <NEW_LINE> <INDENT> form.omitted(IEditForm, 'name') <NEW_LINE> name = schema.TextLine(title=_(u'Name'), description=_(u'help_name',default=u'Enter your name.'), default=u'via', required=True) <NEW_LINE> form.omitted(IEditForm, 'country') <NEW_LINE> country = schema.TextLine(title=_(u'Cou...
A report that any site visitor can add.
62598f96460517430c431ed8
class SelfUserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> model = User <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> return self.request.user
This serializer corresponds to the /me route and returns the authenticated user's credentials. Basic CRUD actions are allowed
62598f9671ff763f4b5e7477
class UserSerializerForAuth(serializers.Serializer): <NEW_LINE> <INDENT> email = serializers.EmailField(allow_blank=False) <NEW_LINE> username = serializers.CharField(allow_blank=False, max_length=50) <NEW_LINE> password = serializers.CharField(allow_blank=False, max_length=50) <NEW_LINE> password_check = serializers.C...
Сериализатор для регистрации.
62598f96507cdc57c63a4a93
class RRGTMaskProcessor(DataProcessor): <NEW_LINE> <INDENT> def __init__(self, data_dir): <NEW_LINE> <INDENT> gtdf = self._load_stripped_lines("{}/ground_truth_masked.txt".format(data_dir)) <NEW_LINE> rrdf = self._load_stripped_lines("{}/reddit_random_masked.txt".format(data_dir)) <NEW_LINE> shorter_length = min(len(gt...
Custom processor for the L2Reddit data set
62598f96379a373c97d98d12
class MultiMaskSubsetState(SubsetState): <NEW_LINE> <INDENT> def __init__(self, mask_dict=None): <NEW_LINE> <INDENT> super(MultiMaskSubsetState, self).__init__() <NEW_LINE> mask_dict_uuid = {} <NEW_LINE> for key in mask_dict: <NEW_LINE> <INDENT> if isinstance(key, Data): <NEW_LINE> <INDENT> mask_dict_uuid[key.uuid] = m...
A subset state that can include a different mask for different datasets. This is useful when doing 3D selections with multiple datasets. This used to be a class called MultiElementSubsetState but it is more efficient to store masks than element lists. However, for backward-compatibility, values of the mask_dict dictio...
62598f967b25080760ed71a1
class Pep8Test(SanitySingleVersion): <NEW_LINE> <INDENT> @property <NEW_LINE> def error_code(self): <NEW_LINE> <INDENT> return 'A100' <NEW_LINE> <DEDENT> def filter_targets(self, targets): <NEW_LINE> <INDENT> return [target for target in targets if os.path.splitext(target.path)[1] == '.py' or is_subdir(target.path, 'bi...
Sanity test for PEP 8 style guidelines using pycodestyle.
62598f96a79ad16197769d61
class Message: <NEW_LINE> <INDENT> __status = { 0: "SENT", 1: "DELIVERED", 2: "READ" } <NEW_LINE> def __init__(self, message): <NEW_LINE> <INDENT> self.__dict__['text'] = message <NEW_LINE> self.__dict__['status'] = self.__status[0] <NEW_LINE> self.status = self.__dict__['status'] <NEW_LINE> self.text = self.__dict__['...
Message encapsulation that contains message status
62598f960c0af96317c56083
class Char(models.Model): <NEW_LINE> <INDENT> char = models.CharField(u"Char", max_length=3) <NEW_LINE> def get_authors_list_url(self): <NEW_LINE> <INDENT> return "/book/authors/%s" % self.char <NEW_LINE> <DEDENT> def get_absolute_url(self): <NEW_LINE> <INDENT> return '/opds/authors/%s' % self.id <NEW_LINE> <DEDENT> de...
Char. Search optimisation
62598f96be383301e02534fb
class Project(models.Model): <NEW_LINE> <INDENT> STATE_CHOICES = ( ('active', _('Active')), ('on_hold', _('On Hold')), ('completed', _('Completed')), ('dropped', _('Dropped')), ) <NEW_LINE> name = models.CharField(max_length=128, verbose_name=_('name')) <NEW_LINE> team = models.ForeignKey(Team, null=True, blank = True,...
A project of some kind Acts as a basic container for Slips (tasks)
62598f970a50d4780f7050d7
class SinglePlaceholderToken(PlaceholderToken): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<SinglePlaceholder />'
A placeholder token for a single token rather than a collection.
62598f97e5267d203ee6b619
class DeckOutputSerializer(ModelSerializer): <NEW_LINE> <INDENT> parent_user = SerializerMethodField(source='get_parent_user') <NEW_LINE> parent_course = SerializerMethodField(source='get_parent_course') <NEW_LINE> parent_course_url = SerializerMethodField(source='get_parent_course_url') <NEW_LINE> class Meta: <NEW_LIN...
This serializes the Deck model for Output
62598f97cc0a2c111447ad16
class Page(Route): <NEW_LINE> <INDENT> def __init__(self, url: str=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(url=url, **kwargs) <NEW_LINE> self._index = None <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> if isinstance(args[0], Application): <NEW_LINE> <INDENT> if self._index i...
A Page
62598f9701c39578d7f12a82
class Sender(object): <NEW_LINE> <INDENT> client = None <NEW_LINE> def __init__(self, dispatcher): <NEW_LINE> <INDENT> self.dispatcher = dispatcher <NEW_LINE> self.clientMethodNames = [m[0] for m in clientSocketMethods] <NEW_LINE> <DEDENT> def connect(self, host, port, clientId, handler, clientType=EClientSocket): <NEW...
Encapsulates an EClientSocket instance, and proxies attribute lookup to it.
62598f9707f4c71912baf14b
class TailNode(HeadNode): <NEW_LINE> <INDENT> def __init__(self, bot_link): <NEW_LINE> <INDENT> HeadNode.__init__(self, None, bot_link)
A class which contains methods for a Tail Node object.
62598f974428ac0f6e65822b
class StatisticController: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.aspects = {} <NEW_LINE> <DEDENT> def form_aspect_statistic(self, feature_list_original): <NEW_LINE> <INDENT> self.aspects = {} <NEW_LINE> for feature in feature_list_original: <NEW_LINE> <INDENT> if feature.type not in self.aspe...
Controller that manipulate with statistic
62598f9767a9b606de545cd4
class FakeLoader: <NEW_LINE> <INDENT> dataloaders: Tuple[DataLoader, ...] <NEW_LINE> tags: List[str] <NEW_LINE> gate: Dict[DataLoader, bool] <NEW_LINE> def __init__(self, *dataloaders, tags=None, mimic_idx=0): <NEW_LINE> <INDENT> self.dataloaders = dataloaders <NEW_LINE> self.mimic_idx = mimic_idx <NEW_LINE> self.loade...
A class that mimics a single dataloader but provides data from multiple dataloader I find it quite usefull in semi-supervised learning and multitask learning. Usually, the dataloaders in a fakeloader are expected to be based on the same dataset. A typical case is a fakeloader composed of a labeled dataloader and an un...
62598f97e64d504609df9237
class ProductHandler: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dbconn = DBMethods() <NEW_LINE> <DEDENT> def add_product(self, product_name, quantity, price): <NEW_LINE> <INDENT> new_product = Product(product_name=product_name, quantity=quantity, price=price) <NEW_LINE> self.dbconn.add_new_produc...
This class handles products
62598f9715baa72349461c82
class utIsIterable(ut.UT): <NEW_LINE> <INDENT> def __init__(self, dskey): <NEW_LINE> <INDENT> super().__init__("isiterable()", dskey) <NEW_LINE> <DEDENT> def begin(self, sequencer, datum): <NEW_LINE> <INDENT> self.obj = datum[0] <NEW_LINE> self.tf = datum[1] <NEW_LINE> return (f"isiterable({self.obj})", ut.UTState.P...
Unit test isiterable().
62598f97d53ae8145f91818e
class DeletedCertificate(KeyVaultCertificate): <NEW_LINE> <INDENT> def __init__( self, properties=None, policy=None, cer=None, **kwargs ): <NEW_LINE> <INDENT> super(DeletedCertificate, self).__init__(properties=properties, policy=policy, cer=cer, **kwargs) <NEW_LINE> self._deleted_on = kwargs.get("deleted_on", None) <N...
A Deleted Certificate consisting of its previous id, attributes and its tags, as well as information on when it will be purged. :param policy: The management policy of the deleted certificate. :type policy: ~azure.keyvault.certificates.CertificatePolicy :param bytearray cer: CER contents of the X509 certificate. :para...
62598f971f037a2d8b9e3de4
class Analyzer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.text = "" <NEW_LINE> self.letter_dict = {} <NEW_LINE> self.pair_dict = {} <NEW_LINE> <DEDENT> def letter_count(self, text): <NEW_LINE> <INDENT> self.letter_dict.clear() <NEW_LINE> for letter in text: <NEW_LINE> <INDENT> if letter in self.l...
Analyzer class Currently capable of: Counting letter frequency
62598f977cff6e4e811b571f
class SpecialWordFinder(WordFinder): <NEW_LINE> <INDENT> def __init__(self, filepath): <NEW_LINE> <INDENT> super().__init__(filepath) <NEW_LINE> <DEDENT> def filter_list(self): <NEW_LINE> <INDENT> self.word_list = [ word for word in self.word_list if word != '' and word[0] != '#']
Word finder that eliminates blank lines and comments >>> swf = SpecialWordFinder("words_with_comments.txt") 6 words read >>> swf.random() in ['cat', 'dog', 'sunshine', 'weather', '', '# comment'] True >>> swf.random() in ['cat', 'dog', 'sunshine', 'weather', '', '# comment'] True
62598f9745492302aabfc1da
class ContentSource(DiscussionBoundBase): <NEW_LINE> <INDENT> __tablename__ = "content_source" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(UnicodeText, nullable=False) <NEW_LINE> type = Column(String(60), nullable=False) <NEW_LINE> creation_date = Column(DateTime, nullable=False, default=...
A ContentSource is where any outside content comes from. .
62598f973539df3088ecbfc3
class UI_OT_i18n_updatetranslation_svn_init_settings(Operator): <NEW_LINE> <INDENT> bl_idname = "ui.i18n_updatetranslation_svn_init_settings" <NEW_LINE> bl_label = "Init I18n Update Settings" <NEW_LINE> bl_option = {'REGISTER'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return contex...
Init settings for i18n svn's update operators
62598f974a966d76dd5eebe3
class LinkNet(nn.Module): <NEW_LINE> <INDENT> def __init__(self, n_classes=21): <NEW_LINE> <INDENT> super(LinkNet, self).__init__() <NEW_LINE> base = resnet.resnet18(pretrained=True) <NEW_LINE> self.in_block = nn.Sequential( base.conv1, base.bn1, base.relu, base.maxpool ) <NEW_LINE> self.encoder1 = base.layer1 <NEW_LIN...
Generate Model Architecture
62598f978e71fb1e983bb7b6
class FutureSession(requests.Session): <NEW_LINE> <INDENT> def __init__(self, max_workers=MAX_WORKERS, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.executor = ThreadPoolExecutor(max_workers=max_workers) <NEW_LINE> <DEDENT> def request(self, *args, **kwargs): <NEW_LINE> <INDENT...
Wrap requests session to allow requests to be async
62598f974e4d562566372124
class MenuBar(tk.Menu): <NEW_LINE> <INDENT> def __init__(self, parent, data_base): <NEW_LINE> <INDENT> tk.Menu.__init__(self, parent) <NEW_LINE> self.file_menu = FileMenu(self, parent, data_base) <NEW_LINE> self.add_cascade(label="File", menu=self.file_menu)
menu bar for the root window
62598f97596a897236127981
class jv_printer: <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> <DEDENT> def to_string(self): <NEW_LINE> <INDENT> val_s = jv_to_eval_string(self.val) <NEW_LINE> print_cmd = 'jv_dump_string(jv_copy(%s), JV_PRINT_INVALID)' <NEW_LINE> tostr = gdb.parse_and_eval(print_cmd % val_...
Print a jv object.
62598f97dd821e528d6d8c36