code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class UpdatedException(Exception): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.data = data
Base exception with additional payload
62599052d7e4931a7ef3d556
class InfiniteSliceSource(_MethodOfImagesSourceBase): <NEW_LINE> <INDENT> def __init__(self, y, sigma, h, brain_conductivity, saline_conductivity, glass_conductivity=0, n=20, x=0, z=0, SourceClass=CartesianGaussianSourceKCSD3D, mask_invalid_space=True): <NEW_LINE> <INDENT> super(InfiniteSliceSource, self).__init__(mask...
Torbjorn V. Ness (2015)
62599052d6c5a102081e35f6
class GameConfigMessage(ServerMessage): <NEW_LINE> <INDENT> prefix = "C" <NEW_LINE> message_type = "game config" <NEW_LINE> min_part_count = 5 <NEW_LINE> custom_settings = list() <NEW_LINE> def __init__(self, message, socket_manager): <NEW_LINE> <INDENT> super(GameConfigMessage, self).__init__(self.prefix, self.message...
Messages for custom game settings
62599052004d5f362081fa58
class LocalWorker(multiprocessing.Process, LoggingMixin): <NEW_LINE> <INDENT> def __init__(self, result_queue): <NEW_LINE> <INDENT> super(LocalWorker, self).__init__() <NEW_LINE> self.daemon = True <NEW_LINE> self.result_queue = result_queue <NEW_LINE> self.key = None <NEW_LINE> self.command = None <NEW_LINE> <DEDENT> ...
LocalWorker Process implementation to run airflow commands. Executes the given command and puts the result into a result queue when done, terminating execution.
62599052cad5886f8bdc5aed
class Classifier(object): <NEW_LINE> <INDENT> trained = False <NEW_LINE> def train(self, X_train, Y_train): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def evaluate(self, X_test, Y_test): <NEW_LINE> <INDENT> pass
Common interface for all IDS classifiers
625990528da39b475be046c4
class WaitAgentsStarted(BaseCondition): <NEW_LINE> <INDENT> def __init__(self, timeout=1200): <NEW_LINE> <INDENT> super(WaitAgentsStarted, self).__init__(timeout) <NEW_LINE> <DEDENT> def iter_blocking_state(self, status): <NEW_LINE> <INDENT> states = Status.check_agents_started(status) <NEW_LINE> if states is not None:...
Wait until all agents are idle or started.
6259905207d97122c4218182
class VisualPerceptionType (pyxb.binding.datatypes.string, pyxb.binding.basis.enumeration_mixin): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'VisualPerceptionType') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20100121/ddex.xsd', 1841, 4) <NEW_LINE> _Documen...
A Type of MusicalCreation according to how it is experienced in an AudioVisual Creation.
625990523617ad0b5ee0761f
class ItemDetailSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> category = CategoryListSerializer() <NEW_LINE> stock = StockListSerializer() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Item <NEW_LINE> fields = ['id', 'name', 'price', 'category', 'description', 'image_url', 'comments_total', 'average...
Detail Item Get by id
6259905207f4c71912bb0912
class ProductionConfig(Config): <NEW_LINE> <INDENT> DATABASE_URL = os.getenv('PROD_DATABASE_URL') <NEW_LINE> DEBUG = False <NEW_LINE> TESTING = False
Configurations for Production.
625990527cff6e4e811b6f1a
class Organizer(models.Model): <NEW_LINE> <INDENT> image = models.ImageField(blank=True, null=True, upload_to="media/people/%Y/") <NEW_LINE> order = models.IntegerField(default=0) <NEW_LINE> name = models.CharField(max_length=50) <NEW_LINE> role = models.CharField(max_length=20)
Organizers for the about page.
6259905223e79379d538d9d4
class Response(ReqRep): <NEW_LINE> <INDENT> __slots__ = ('response', 'exception', 'reason', 'return_code') <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.response = kwargs.get('response', None) <NEW_LINE> self.exception = kwargs.get('exception', None) <NEW_LINE> self.rea...
Request response skeleton response: Server response exception: Exception occurred during request processing reason: Reason of the exception return_code: Like HTTP response code :exception AttributeError if attribute not listing in __slots__ :exception NotImplementedError for __delattr__ and __delitem__
625990520fa83653e46f63bd
class FakeInteract: <NEW_LINE> <INDENT> def __init__(self, answers): <NEW_LINE> <INDENT> self.answers = answers <NEW_LINE> <DEDENT> def find_answer(self, message, choices=None, default=None): <NEW_LINE> <INDENT> keys = self.answers.keys() <NEW_LINE> for key in keys: <NEW_LINE> <INDENT> if key in message.lower(): <NEW_L...
A class to control qibuild.interact behavior Answers must be a dict: message -> answer message must be a part of the message answer can be a boolean (for ask_yes_no), and string (for ask_path or ask_string), or a string that must match one of the choices, for (ask_choice) Note that if you do not specify an answer for...
625990524428ac0f6e659a12
class TestPFAOWS(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.start = B2BExport() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_start(self): <NEW_LINE> <INDENT> self.start.b2b_export_logic("PF", "PP_A_OW", "b2b", 2)
测试case,平台采购+成人+单程直飞
625990524e696a045264e88f
class TimestampMixin(object): <NEW_LINE> <INDENT> STATUSPOLICY = [ (StatusPolicy.NEW, _('Record has be created.')), (StatusPolicy.UPT, _('Record has be updated.')), (StatusPolicy.DEL, _('Record has be deleted.')), ] <NEW_LINE> status = db.Column( ChoiceType(STATUSPOLICY, impl=db.String(1)), nullable=False, default=Stat...
Timestamp model mix-in with fractional seconds support. SQLAlchemy-Utils timestamp model does not have support for fractional seconds.
6259905263d6d428bbee3cab
class Fragment(object): <NEW_LINE> <INDENT> i = 0 <NEW_LINE> fragments = {} <NEW_LINE> def lookup(self, *commits): <NEW_LINE> <INDENT> name = self._name_for(*commits) <NEW_LINE> return self.topics.get(name) <NEW_LINE> <DEDENT> def register(self, *commits): <NEW_LINE> <INDENT> new = self._next() <NEW_LINE> self.assign(n...
Tracks fragments of the git explosion, i.e. commits which were exploded off the source branch into smaller topic branches.
625990523539df3088ecd780
class Parameters(): <NEW_LINE> <INDENT> def __init__(self, network, max_length, tot_crit_tracks, stations_list): <NEW_LINE> <INDENT> self.network = network <NEW_LINE> self.max_length = max_length <NEW_LINE> self.tot_crit_tracks = tot_crit_tracks <NEW_LINE> self.stations_list = stations_list
Object saving all parameters for calculation
6259905291af0d3eaad3b303
class _GetActName: <NEW_LINE> <INDENT> _re_actname1 = _re.compile(r'[))][((]') <NEW_LINE> _re_actname2 = _re.compile(r'[((、]') <NEW_LINE> def __call__(self, elems): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> data = elems.find('.//h1').text.strip() <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> raise _...
名前の取得
625990528da39b475be046c6
class LoginSchema(Schema): <NEW_LINE> <INDENT> email = fields.Email(load_only=True, required=True) <NEW_LINE> password = fields.String(load_only=True, required=True)
Serialized login schema.
6259905282261d6c52730937
class UsosWebOAuth(BaseOAuth1): <NEW_LINE> <INDENT> name = 'usosweb' <NEW_LINE> EXTRA_DATA = [('id', 'id')] <NEW_LINE> AUTHORIZATION_URL = 'https://usosapps.uw.edu.pl/services/oauth/authorize' <NEW_LINE> REQUEST_TOKEN_URL = 'https://usosapps.uw.edu.pl/services/oauth/request_token' <NEW_LINE> ACCESS_TOKEN_URL = 'https:/...
UsosWeb OAuth authentication backend
6259905207d97122c4218184
class EmailCreateView(LoginRequiredMixin, NextMixin, FormMessageMixin, generic.CreateView): <NEW_LINE> <INDENT> template_name = 'baseform.html' <NEW_LINE> form_class = EmailAddressForm <NEW_LINE> default_next_url = reverse_lazy('kdo-profile-update') <NEW_LINE> form_valid_message = _("Your new email address has been cre...
Create an EmailAddress for the current user.
625990523617ad0b5ee07621
class Save(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, related_name="Save_user") <NEW_LINE> game = models.ForeignKey(Game, related_name="Save_game") <NEW_LINE> date = models.DateTimeField(auto_now_add=True) <NEW_LINE> score = models.IntegerField(null=False) <NEW_LINE> game_board = models.CharField...
Save table
625990528e71fb1e983bcfa5
class Message(Interface): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def to_python(cls, data): <NEW_LINE> <INDENT> assert data.get('message') <NEW_LINE> kwargs = { 'message': trim(data['message'], 2048) } <NEW_LINE> if data.get('params'): <NEW_LINE> <INDENT> kwargs['params'] = trim(data['params'], 1024) <NEW_LINE> <DE...
A standard message consisting of a ``message`` arg, and an optional ``params`` arg for formatting. If your message cannot be parameterized, then the message interface will serve no benefit. - ``message`` must be no more than 1000 characters in length. >>> { >>> "message": "My raw message with interpreted strings...
6259905230dc7b76659a0cec
class TestLinalgSolve(unittest2.TestCase): <NEW_LINE> <INDENT> def test_array_array(self): <NEW_LINE> <INDENT> test_op = np.eye(2) <NEW_LINE> test_vec = np.arange(2) <NEW_LINE> np_tst.assert_allclose( atmos_flux_inversion.linalg.solve(test_op, test_vec), la.solve(test_op, test_vec)) <NEW_LINE> <DEDENT> def test_method_...
Test the general solve function.
62599052379a373c97d9a500
class LongThrower(ThrowerAnt): <NEW_LINE> <INDENT> name = 'Long' <NEW_LINE> implemented = True <NEW_LINE> food_cost = 2 <NEW_LINE> armor = 1 <NEW_LINE> min_range = 5 <NEW_LINE> def nearest_bee(self, hive): <NEW_LINE> <INDENT> current_place = self.place <NEW_LINE> for i in range (0, self.min_range): <NEW_LINE> <INDENT> ...
A ThrowerAnt that only throws leaves at Bees at least 5 places away.
6259905207d97122c4218185
class TestDataObjectReplicaJSONDecoder(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.data_object, self.data_object_as_json = create_data_object_with_baton_json_representation() <NEW_LINE> self.replica = self.data_object.replicas.get_by_number(1) <NEW_LINE> self.replica_as_json_string...
Tests for `DataObjectReplicaJSONDecoder`.
625990528e7ae83300eea572
class DistributedGoofy(DistributedObject): <NEW_LINE> <INDENT> def __init__(self, cr): <NEW_LINE> <INDENT> DistributedObject.__init__(self, cr)
THIS IS A DUMMY FILE FOR THE DISTRIBUTED CLASS
62599052be383301e0254cfa
class Director(models.Model): <NEW_LINE> <INDENT> class DirectorManager(models.Manager): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> last = models.CharField(max_length=20, blank=False, null=False, verbose_name='Last Name') <NEW_LINE> first = models.CharField(max_length=20, blank=False, null=False, verbose_name='First ...
:param: last - Last name of the director :param: first - First name of the director :param: dob - Director's date of birth :param: dod - Director's date of death. None if still alive
625990524e696a045264e890
class GitProxy(object): <NEW_LINE> <INDENT> def __init__(self, repo): <NEW_LINE> <INDENT> self._repo = repo <NEW_LINE> <DEDENT> def get_config(self, name): <NEW_LINE> <INDENT> return self._repo.git.config('--get', name) <NEW_LINE> <DEDENT> def checkout(self, *args, **kwargs): <NEW_LINE> <INDENT> return self._repo.git.c...
Proxy to underlying git repository This is used for callers to interact with underlying repository from outside of PackageRepo.
6259905263d6d428bbee3cad
class ReqDescription(ReqTagGeneric): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> ReqTagGeneric.__init__( self, config, "Description", set([InputModuleTypes.ctstag, InputModuleTypes.reqtag, InputModuleTypes.testcase])) <NEW_LINE> <DEDENT> def rewrite(self, rid, req): <NEW_LINE> <INDENT> self.chec...
Requirement description attribute
6259905245492302aabfd9b5
class MAVLink_log_entry_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_LOG_ENTRY <NEW_LINE> name = 'LOG_ENTRY' <NEW_LINE> fieldnames = ['id', 'num_logs', 'last_log_num', 'time_utc', 'size'] <NEW_LINE> ordered_fieldnames = ['time_utc', 'size', 'id', 'num_logs', 'last_log_num'] <NEW_LINE> fieldtypes = ...
Reply to LOG_REQUEST_LIST
62599052be8e80087fbc055c
class MappingTree(DSLdapObject): <NEW_LINE> <INDENT> _must_attributes = ['cn'] <NEW_LINE> def __init__(self, instance, dn=None): <NEW_LINE> <INDENT> super(MappingTree, self).__init__(instance, dn) <NEW_LINE> self._rdn_attribute = 'cn' <NEW_LINE> self._must_attributes = ['cn'] <NEW_LINE> self._create_objectclasses = ['t...
Mapping tree DSLdapObject with: - must attributes = ['cn'] - RDN attribute is 'cn' :param instance: An instance :type instance: lib389.DirSrv :param dn: Entry DN :type dn: str
6259905291af0d3eaad3b305
class PrefixLoader(BaseLoader): <NEW_LINE> <INDENT> def __init__(self, mapping, delimiter='/'): <NEW_LINE> <INDENT> self.mapping = mapping <NEW_LINE> self.delimiter = delimiter <NEW_LINE> <DEDENT> def get_loader(self, template): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> prefix, name = template.split(self.delimiter, ...
A loader that is passed a dict of loaders where each loader is bound to a prefix. The prefix is delimited from the template by a slash per default, which can be changed by setting the `delimiter` argument to something else:: loader = PrefixLoader({ 'app1': PackageLoader('mypackage.app1'), 'app...
6259905215baa7234946346e
class RoleTypeSet: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.role_types = {} <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for role_type in self.role_types.values(): <NEW_LINE> <INDENT> yield role_type <NEW_LINE> <DEDENT> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(se...
A non-overlapping set of role type statements. This clas allows the incremental addition of role type statements and maintains a non-overlapping list of statements.
62599052d6c5a102081e35fa
class File(models.Model): <NEW_LINE> <INDENT> short_name = models.CharField(unique=True, max_length=80) <NEW_LINE> file = models.FileField(upload_to="uploads") <NEW_LINE> description = models.CharField(max_length=255) <NEW_LINE> comments = models.CharField(max_length=255, blank=True) <NEW_LINE> def __str__(self): <NEW_...
These are files that are significant enough we want to track and describe. They can be associated with a project.
6259905276d4e153a661dce9
class GeneralAssemblyInvitation(object): <NEW_LINE> <INDENT> def __init__(self, general_assembly, member, sent, token=None): <NEW_LINE> <INDENT> self.general_assembly = general_assembly <NEW_LINE> self.member = member <NEW_LINE> self.sent = sent <NEW_LINE> self.token = token
Invitation of a member to a general assembly The general assembly invitation describes an invitation for a member to a general assembly with sent timestamp and token string.
62599052004d5f362081fa5a
class SAmsNetId(Structure): <NEW_LINE> <INDENT> _pack_ = 1 <NEW_LINE> _fields_ = [("b", c_ubyte * 6)]
Struct with array of 6 bytes used to describe a net id.
62599052287bf620b62730cc
class ButtonCustom(QPushButton): <NEW_LINE> <INDENT> def __init__(self, value='', styles='', param=None, path_icon=None): <NEW_LINE> <INDENT> QPushButton.__init__(self, value) <NEW_LINE> if path_icon: <NEW_LINE> <INDENT> self.setIcon(QIcon(path_icon)) <NEW_LINE> self.setIconSize(QSize(20,20)) <NEW_LINE> <DEDENT> self.s...
Clase de botón o icono personalizado.
625990522ae34c7f260ac5c3
class TensorDataLoader: <NEW_LINE> <INDENT> def __init__(self, *tensors, batch_size, shuffle=False, pin_memory=False): <NEW_LINE> <INDENT> assert all(t.shape[0] == tensors[0].shape[0] for t in tensors) <NEW_LINE> self.dataset_len = tensors[0].shape[0] <NEW_LINE> self.pin_memory = pin_memory and T.cuda.is_available() <N...
Warning: `TensorDataLoader` doesn't support distributed training now.
625990520a50d4780f70682d
class ProjectCursorPagination(CursorPagination): <NEW_LINE> <INDENT> def encode_cursor(self, cursor): <NEW_LINE> <INDENT> tokens = {} <NEW_LINE> if cursor.offset != 0: <NEW_LINE> <INDENT> tokens['o'] = str(cursor.offset) <NEW_LINE> <DEDENT> if cursor.reverse: <NEW_LINE> <INDENT> tokens['r'] = '1' <NEW_LINE> <DEDENT> if...
Customized cursor pagination class.
62599052ac7a0e7691f739be
class FindDuplicatesTests(unittest.TestCase): <NEW_LINE> <INDENT> def test_specification(self): <NEW_LINE> <INDENT> n = 1000000 <NEW_LINE> duplicate = 3578 <NEW_LINE> input_list = list(range(1, n + 1)) <NEW_LINE> input_list.append(duplicate) <NEW_LINE> shuffle(input_list) <NEW_LINE> expected_return = [] <NEW_LINE> expe...
Run tests on find_duplicates(). Useage: $ python find_duplicates_tests.py
6259905255399d3f056279fc
class CityAdminMixin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = () <NEW_LINE> list_filter = () <NEW_LINE> fields = () <NEW_LINE> exclude = () <NEW_LINE> readonly_for_city = () <NEW_LINE> def get_city(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> city = City.objects.get(user=request.user) <NEW_...
City auth admin
625990522ae34c7f260ac5c4
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(verbose_name=u'email address', max_length=255, unique=True, db_index=True) <NEW_LINE> def _make_username(self): <NEW_LINE> <INDENT> return self.email.split('@')[0] <NEW_LINE> <DEDENT> username = property(_make_username) <NEW_L...
A basic user account, containing all common user information. This is a custom-defined User, but inherits from Django's classes to integrate with Django's other provided User tools/functionality AbstractBaseUser provides Django's basic authentication backend. PermissionsMixin provides compatability with Django's built-...
62599052379a373c97d9a503
@base.Hidden <NEW_LINE> @base.ReleaseTracks(base.ReleaseTrack.ALPHA) <NEW_LINE> class SetIamPolicy(base.Command): <NEW_LINE> <INDENT> detailed_help = iam_util.GetDetailedHelpForSetIamPolicy('disk image', 'my-image') <NEW_LINE> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> SetIamPolicy.disk_image_arg = ...
Set the IAM Policy for a Google Compute Engine disk image. *{command}* replaces the existing IAM policy for a disk image, given an image and a file encoded in JSON or YAML that contains the IAM policy. If the given policy file specifies an "etag" value, then the replacement will succeed only if the policy already in p...
62599052dc8b845886d54aa1
class LogitechMediaServer(object): <NEW_LINE> <INDENT> def __init__(self, hass, host, port, username, password): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self._username = username <NEW_LINE> self._password = password <NEW_LINE> <DEDENT> @asyncio.coroutine <...
Representation of a Logitech media server.
6259905230c21e258be99ce7
class FinalOptimizePhase(Visitor.CythonTransform): <NEW_LINE> <INDENT> def visit_SingleAssignmentNode(self, node): <NEW_LINE> <INDENT> self.visitchildren(node) <NEW_LINE> if node.first: <NEW_LINE> <INDENT> lhs = node.lhs <NEW_LINE> lhs.lhs_of_first_assignment = True <NEW_LINE> if isinstance(lhs, ExprNodes.NameNode) and...
This visitor handles several commuting optimizations, and is run just before the C code generation phase. The optimizations currently implemented in this class are: - eliminate None assignment and refcounting for first assignment. - isinstance -> typecheck for cdef types - eliminate checks for None and/...
625990524e696a045264e891
@UASLocalMetadataSet.add_parser <NEW_LINE> class MissionID(StringElementParser): <NEW_LINE> <INDENT> key = b'\x03' <NEW_LINE> TAG = 3 <NEW_LINE> UDSKey = "06 0E 2B 34 01 01 01 01 01 05 05 00 00 00 00 00" <NEW_LINE> LDSName = "Mission ID" <NEW_LINE> ESDName = "Mission Number" <NEW_LINE> UDSName = "Episode Number" <NEW_L...
Mission ID is the descriptive mission identifier. Mission ID value field free text with maximum of 127 characters describing the event.
625990523eb6a72ae038bb3d
class Cylindrical(Projection): <NEW_LINE> <INDENT> _separable = True
Base class for Cylindrical projections. Cylindrical projections are so-named because the surface of projection is a cylinder.
6259905276e4537e8c3f0a69
@python_2_unicode_compatible <NEW_LINE> class User(AbstractUser): <NEW_LINE> <INDENT> nickname = models.CharField(null=True, blank=True, max_length=255, verbose_name='昵称') <NEW_LINE> job_title = models.CharField(max_length=50, null=True, blank=True, verbose_name='职称') <NEW_LINE> introduction = models.TextField(blank=Tr...
Customized User Model
62599052a8ecb033258726f5
class TestInternals(BaseTest): <NEW_LINE> <INDENT> def _check_get_set_state(self, ptr): <NEW_LINE> <INDENT> state = _helperlib.rnd_get_state(ptr) <NEW_LINE> i, ints = state <NEW_LINE> self.assertIsInstance(i, int) <NEW_LINE> self.assertIsInstance(ints, list) <NEW_LINE> self.assertEqual(len(ints), N) <NEW_LINE> j = (i *...
Test low-level internals of the implementation.
6259905291af0d3eaad3b307
class RawDeprecated(object): <NEW_LINE> <INDENT> def __init__(self, first_token, text): <NEW_LINE> <INDENT> self.first_token = first_token <NEW_LINE> self.text = text <NEW_LINE> <DEDENT> def getType(self): <NEW_LINE> <INDENT> return 'deprecated' <NEW_LINE> <DEDENT> def getFormatted(self, formatter): <NEW_LINE> <INDENT>...
A representation of a @deprecated entry. @ivar text The @deprecated clauses's text.
625990527d847024c075d8b9
class Tape: <NEW_LINE> <INDENT> def __init__(self, init, endsym): <NEW_LINE> <INDENT> self._cells = list(init) <NEW_LINE> self._endsym = endsym <NEW_LINE> self._current = 0 <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ''.join(self._cells) <NEW_LINE> <DEDENT> @property <NEW_LINE> def current_cell(se...
Tape is a list of cells that contain symbols of the current machine;
6259905276d4e153a661dcea
class UserByCompanyCity(Base): <NEW_LINE> <INDENT> company = columns.Text(primary_key=True) <NEW_LINE> city = columns.Text(primary_key=True) <NEW_LINE> id = columns.Integer(primary_key=True) <NEW_LINE> first_name = columns.Text() <NEW_LINE> last_name = columns.Text() <NEW_LINE> email = columns.Text() <NEW_LINE> def get...
Model Person object by company & city in the database
625990528da39b475be046c9
class CercaCampoStudio(models.Model): <NEW_LINE> <INDENT> lavoro = models.ForeignKey(Lavoro, on_delete=models.CASCADE) <NEW_LINE> campo_studio = models.ForeignKey(CampoStudi, on_delete=models.CASCADE, null=True)
Rappresenta la tabella che associa una Offerta di Lavoro con zero o piu Campi di Studio
62599052462c4b4f79dbcee3
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = os.environ.get('CONDUIT_SECRET', 'secret-key') <NEW_LINE> APP_DIR = os.path.abspath(os.path.dirname(__file__)) <NEW_LINE> PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) <NEW_LINE> BCRYPT_LOG_ROUNDS = 13 <NEW_LINE> DEBUG_TB_INTERCEPT_REDIRECTS = Fa...
Base configuration.
625990528da39b475be046ca
class Teacher_list(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> users = User.objects.all().filter(is_teacher=True) <NEW_LINE> serializer = CustomUserSerializer(users, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def post(self, request, format=None)...
List all code snippets, or create a new snippet.
62599052cad5886f8bdc5af0
class RequestsHttpClient(HttpClient): <NEW_LINE> <INDENT> def __init__(self, timeout=HttpClient.DEFAULT_TIMEOUT): <NEW_LINE> <INDENT> super(RequestsHttpClient, self).__init__(timeout) <NEW_LINE> <DEDENT> def get(self, url, headers=None, params=None, stream=False, timeout=None): <NEW_LINE> <INDENT> if timeout is None: <...
HttpClient implemented by requests.
625990524a966d76dd5f03cf
class TestOverrideSettings(object): <NEW_LINE> <INDENT> setting = '' <NEW_LINE> method = '' <NEW_LINE> value = None <NEW_LINE> def test_override_value(self): <NEW_LINE> <INDENT> value = self.value or 'new value' <NEW_LINE> with self.settings(**{self.setting: value}): <NEW_LINE> <INDENT> self.assertEquals(first=value, s...
Test cases for setting overrides
6259905245492302aabfd9b8
class ExerciseViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Exercise.objects.all() <NEW_LINE> serializer_class = ExerciseSerializer <NEW_LINE> permission_classes = (IsAuthenticatedOrReadOnly, CreateOnlyPermission) <NEW_LINE> http_method_names = ['get', 'options', 'head'] <NEW_LINE> ordering_fields = '_...
API endpoint for exercise objects
62599052b57a9660fecd2f5a
class BaseModel(db.Model): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> @staticmethod <NEW_LINE> def to_camel_case(snake_str): <NEW_LINE> <INDENT> title_str = snake_str.title().replace("_", "") <NEW_LINE> return title_str[0].lower() + title_str[1:] <NEW_LINE...
Base models. - Contains the serialize method to convert objects to a dictionary - Common field atrributes in the models
62599052379a373c97d9a504
class StreamLabsMonthlyUsage(StreamLabsDailyUsage): <NEW_LINE> <INDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return "{} {}".format(self._location_name, NAME_MONTHLY_USAGE) <NEW_LINE> <DEDENT> @property <NEW_LINE> def state(self): <NEW_LINE> <INDENT> return self._streamlabs_usage_data.get_monthly_usa...
Monitors the monthly water usage.
625990528e7ae83300eea576
class BatchGradientVerificationCallback(VerificationCallbackBase): <NEW_LINE> <INDENT> def __init__( self, input_mapping: Optional[Callable] = None, output_mapping: Optional[Callable] = None, sample_idx: int = 0, **kwargs: Any, ): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._input_mapping = input_map...
The callback version of the :class:`BatchGradientVerification` test. Verification is performed right before training begins.
6259905207f4c71912bb0919
class Config: <NEW_LINE> <INDENT> __instance = None <NEW_LINE> def __new__(cls, config=None): <NEW_LINE> <INDENT> if config != None: <NEW_LINE> <INDENT> cls.__instance = super(Config, cls).__new__(cls) <NEW_LINE> cls.__instance.style_weights = config.get("style-weights", {}) <NEW_LINE> cls.__instance.variants = config....
Singleton Class
6259905223e79379d538d9db
class DagConRunner(object): <NEW_LINE> <INDENT> def __init__(self, script, mode=None): <NEW_LINE> <INDENT> self.script = script <NEW_LINE> self.mode = mode <NEW_LINE> self.validateSettings() <NEW_LINE> <DEDENT> def validateSettings(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> assert self.script in SCRIPT_CHOIC...
A tool for resequencing clusters of rDNA sequences with the Gcon.py script from PB-DagCon
625990522ae34c7f260ac5c6
class RowPacker(Packer): <NEW_LINE> <INDENT> def pack(self, blocks): <NEW_LINE> <INDENT> self.mapping = {} <NEW_LINE> num_rows, _ = factor(len(blocks)) <NEW_LINE> rows = [[] for _ in range(num_rows)] <NEW_LINE> for block in blocks: <NEW_LINE> <INDENT> min_row = min(rows, key=lambda row: sum(b.width for b in row)) <NEW_...
Packs blocks into rows, greedily trying to minimize the maximum width.
62599052dc8b845886d54aa3
class PreprocessedTestWebIDLFile(SandboxDerived): <NEW_LINE> <INDENT> __slots__ = ( 'basename', ) <NEW_LINE> def __init__(self, sandbox, path): <NEW_LINE> <INDENT> SandboxDerived.__init__(self, sandbox) <NEW_LINE> self.basename = path
Describes an individual test-only .webidl source file that requires preprocessing.
625990524e4d5625663738e7
class NATRule: <NEW_LINE> <INDENT> def __init__(self, core_client): <NEW_LINE> <INDENT> self.__cc = core_client <NEW_LINE> <DEDENT> def __post(self, endpoint, package="", uid="", params={}): <NEW_LINE> <INDENT> payload = { 'package': package } <NEW_LINE> if uid: <NEW_LINE> <INDENT> payload['uid'] = uid <NEW_LINE> <DEDE...
Manage NAT rules.
625990523539df3088ecd786
class NjuUiaAuth: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.session = requests.Session() <NEW_LINE> self.session.headers.update({ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:56.0) Gecko/20100101 Firefox/56.0' }) <NEW_LINE> r = self.session.get(URL_NJU_UIA_AUTH) <NEW_LINE> self.lt = re....
DESCRIPTION: Designed for passing Unified Identity Authentication(UIA) of Nanjing University.
6259905291af0d3eaad3b309
class P9_EliasGammaCoding: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def elias_gamma_list_encode(L): <NEW_LINE> <INDENT> answer = "" <NEW_LINE> for x in L: <NEW_LINE> <INDENT> answer += stringextra.elias_gamma_encode(x) <NEW_LINE> <DEDENT> return answer <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def elias_gamma_li...
L is a list of n integers. Write an encode function that returns a string representing the concatenation of the Elias gamma codes for L, and a decode function that takes a string s, generated by the encode function, and returns the array that was passed to the encode function.
62599052498bea3a75a59006
class InvalidContentType(NeutronException): <NEW_LINE> <INDENT> message = _("Invalid content type %(content_type)s.")
An error due to invalid content type. :param content_type: The invalid content type.
62599052d7e4931a7ef3d55e
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'default_row03.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename = test_d...
Test file created by XlsxWriter against a file created by Excel.
62599052462c4b4f79dbcee5
class DebugConf(object): <NEW_LINE> <INDENT> trace = False <NEW_LINE> memory_summary = True <NEW_LINE> top_k = 3 <NEW_LINE> interval_s = 50
Make Debug config, user could re-set it.
6259905207d97122c421818a
class SensorList(ApiList): <NEW_LINE> <INDENT> API_NAME = "sensors" <NEW_LINE> API_NAME_SRC = "sensor_list" <NEW_LINE> API_SIMPLE = {} <NEW_LINE> API_COMPLEX = {"cache_info": "CacheInfo"} <NEW_LINE> API_CONSTANTS = {} <NEW_LINE> API_STR_ADD = [] <NEW_LINE> API_ITEM_ATTR = "sensor" <NEW_LINE> API_ITEM_CLS = "Sensor"
Automagically generated API array object.
6259905299cbb53fe68323cb
class LazyObject(object): <NEW_LINE> <INDENT> _wrapped = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._wrapped = empty <NEW_LINE> <DEDENT> __getattr__ = new_method_proxy(getattr) <NEW_LINE> def __setattr__(self, name, value): <NEW_LINE> <INDENT> if name == "_wrapped": <NEW_LINE> <INDENT> self.__dict__["...
A wrapper for another class that can be used to delay instantiation of the wrapped class. By subclassing, you have the opportunity to intercept and alter the instantiation. If you don't need to do that, use SimpleLazyObject.
625990520fa83653e46f63c5
class StationError(RuntimeError): <NEW_LINE> <INDENT> pass
Mismatching station name on commandline compared to config or wrong station.
6259905216aa5153ce4019c8
class Describe_PhysPkgReader(object): <NEW_LINE> <INDENT> def it_constructs_ZipPkgReader_when_pkg_is_file_like( self, _ZipPkgReader_, zip_pkg_reader_ ): <NEW_LINE> <INDENT> _ZipPkgReader_.return_value = zip_pkg_reader_ <NEW_LINE> file_like_pkg = BytesIO(b"pkg-bytes") <NEW_LINE> phys_reader = _PhysPkgReader.factory(file...
Unit-test suite for `pptx.opc.serialized._PhysPkgReader` objects.
625990524e4d5625663738e9
class TagName(object): <NEW_LINE> <INDENT> def __init__(self, name, options, desc, plural=None, role=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.desc = desc <NEW_LINE> self.plural = plural <NEW_LINE> self.user = "u" in options <NEW_LINE> self.internal = "i" in options <NEW_LINE> self.numeric = "n" in op...
Text: desc -- translated description plural -- translated plural description or None role -- translated role description (for people tags) Types: user -- user editable tag e.g. "foo" hidden -- if user tag should only be shown in the tag editor (e.g. tracknumber is hidden, sinc...
625990524e696a045264e893
class NSGroupInfo(object): <NEW_LINE> <INDENT> swagger_types = { 'nsgroup_policy_path': 'str', 'nsgroup': 'ResourceReference' } <NEW_LINE> attribute_map = { 'nsgroup_policy_path': 'nsgroup_policy_path', 'nsgroup': 'nsgroup' } <NEW_LINE> def __init__(self, nsgroup_policy_path=None, nsgroup=None): <NEW_LINE> <INDENT> sel...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599052a8ecb033258726f9
class APIError(Exception): <NEW_LINE> <INDENT> pass
Raised when something went wrong on the server
625990527d847024c075d8bd
class NewGroupDialog(_BaseGroupDialog): <NEW_LINE> <INDENT> new_aov_group_signal = QtCore.Signal(AOVGroup) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.status_widget.add_info(0, "Enter a group name") <NEW_LINE> self.status_widget.add_info(1, "Choose a file") <...
Dialog for creating a new AOV group.
62599052498bea3a75a59008
class TodoDetail(DetailGenericAPIView): <NEW_LINE> <INDENT> queryset = Todos.objects.all().filter(status=UNDO) <NEW_LINE> serializer_class = Serializer
Retrieve, update or delete a task.
62599052004d5f362081fa5d
class L1_Root_pt(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.l1_root_pt" <NEW_LINE> bl_label = "L1 Root" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> found = 'L1 Root' in bpy.data.objects <NEW_LINE> if found == False: <NEW_L...
Tooltip
62599052435de62698e9d2e5
class Img_Block(QFrame): <NEW_LINE> <INDENT> def __init__(self, Img_list, *args, **kwargs): <NEW_LINE> <INDENT> QFrame.__init__(self, *args, **kwargs) <NEW_LINE> hv = QHBoxLayout(self) <NEW_LINE> self.Imgs = Img_list <NEW_LINE> WB = Img_list[0] <NEW_LINE> BG = Img_list[1] <NEW_LINE> self.WB = LabeledImg(WB, self) <NEW_...
Assign two picture 同步两个图片的设置情况
6259905221a7993f00c67450
class Comment(Model): <NEW_LINE> <INDENT> def __init__(self, form, user_id=-1): <NEW_LINE> <INDENT> super().__init__(form) <NEW_LINE> self.content = form.get('content', '') <NEW_LINE> self.user_id = form.get('user_id', user_id) <NEW_LINE> self.weibo_id = int(form.get('weibo_id', -1)) <NEW_LINE> <DEDENT> def user(self):...
评论类
6259905230dc7b76659a0cf0
class AttentionPool(nn.Module): <NEW_LINE> <INDENT> def __init__(self, hidden_size, drop=0.0): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.fc = nn.Sequential(nn.Linear(hidden_size, 1), nn.ReLU()) <NEW_LINE> self.dropout = nn.Dropout(drop) <NEW_LINE> <DEDENT> def forward(self, input_, mask=None): <NEW_LINE> <...
attention pooling layer
62599052f7d966606f749329
class UserInstruments(object): <NEW_LINE> <INDENT> openapi_types = { } <NEW_LINE> attribute_map = { } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.discriminator = None <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> result = {} <NEW_LINE> for attr, _ in six.iteritems(self.openapi_types): <NEW_LINE...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
6259905271ff763f4b5e8c91
class RoundRobinQueue: <NEW_LINE> <INDENT> def __init__(self, qfactory: Callable[[Hashable], BaseQueue], start_domains: Iterable[Hashable] = ()) -> None: <NEW_LINE> <INDENT> self.queues = {} <NEW_LINE> self.qfactory = qfactory <NEW_LINE> for key in start_domains: <NEW_LINE> <INDENT> self.queues[key] = self.qfactory(key...
A round robin queue implemented using multiple internal queues (typically, FIFO queues). The internal queue must implement the following methods: * push(obj) * pop() * peek() * close() * __len__() The constructor receives a qfactory argument, which is a callable used to instantiate a new (internal) ...
6259905224f1403a92686341
class EmailWhitelistItem(models.Model): <NEW_LINE> <INDENT> email_address = models.EmailField() <NEW_LINE> reason = models.TextField(blank=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.email_address
The email whitelist is a list of author email addresses to blindly accept comments from.
62599052379a373c97d9a509
class InterfaceField: <NEW_LINE> <INDENT> def __init__(self, type_pattern=typing.Any, tests=None): <NEW_LINE> <INDENT> err_msg = f"Expected 'type_pattern' to be a type or a typing pattern but got {type(type_pattern)}" <NEW_LINE> assert issubclass(type(type_pattern), type(type)) or issubclass( type(type_pattern), typing...
Used to define allowed values for a config-attribute
62599052dd821e528d6da3c2
class AdminUserList(Resource): <NEW_LINE> <INDENT> @api.doc(security='apikey') <NEW_LINE> @admin_required <NEW_LINE> def get(self): <NEW_LINE> <INDENT> res = user.get_all_user() <NEW_LINE> return res
Contains GET method for Admin Endpoint
625990520c0af96317c577d3
class BatchPerformanceLoggerBase(Base, Callback): <NEW_LINE> <INDENT> def __init__(self, batch_generator, metrics_name_postfix="unknown", inspect_period = 2000, init_iter = -1, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._batch_generator = batch_generator <NEW_LINE> self._metrics_name_post...
Abstract method to log batch level metrics (e.g. for a validation set) Please implement: _predict_model(batch_data) _calc_performance(batch_data) # Only if you want to inspect results during training _inspect_data( generated_batch_data, predicted_batch_data, batch_metrics_data)
6259905276e4537e8c3f0a6f
class HeadingText(MHeadingText, Widget): <NEW_LINE> <INDENT> implements(IHeadingText) <NEW_LINE> level = Int(1) <NEW_LINE> text = Unicode('Default') <NEW_LINE> def __init__(self, parent, **traits): <NEW_LINE> <INDENT> super(HeadingText, self).__init__(**traits) <NEW_LINE> self._create_control(parent) <NEW_LINE> <DEDENT...
The toolkit specific implementation of a HeadingText. See the IHeadingText interface for the API documentation.
62599052a79ad1619776b52f
class linkParser(sgmllib.SGMLParser): <NEW_LINE> <INDENT> def parse(self, s): <NEW_LINE> <INDENT> self.feed(s) <NEW_LINE> self.close() <NEW_LINE> <DEDENT> def __init__(self, verbose=0): <NEW_LINE> <INDENT> sgmllib.SGMLParser.__init__(self, verbose) <NEW_LINE> self.hyperlinks = [] <NEW_LINE> <DEDENT> def start_a(self, a...
A simple parser class.
625990528e71fb1e983bcfae
class Map(): <NEW_LINE> <INDENT> def __init__(self, url, seed, size, timeout=2): <NEW_LINE> <INDENT> self.request = requests.get(url, timeout=timeout) <NEW_LINE> self.request.raise_for_status() <NEW_LINE> self.cdn_url = 'https://assets-rustserversio.netdna-ssl.com' <NEW_LINE> self.seed = seed <NEW_LINE> self.size = siz...
Map with details Attributes: cdn_url (str): Map image host features (list): List of map monuments img_hi_res (str): High resolution map image img_monuments (str): Map image with monuments request (requests.models.Response): GET <map URL> seed (int): Map seed size (int): Map size
62599052435de62698e9d2e6
class AttentionLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, use_language=True, use_spatial=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._use_language = use_language <NEW_LINE> self._use_spatial = use_spatial <NEW_LINE> self.fc_subject = nn.Sequential(nn.Linear(300, 256), nn.ReLU()) <NEW_LIN...
Drive attention using language and/or spatial features.
6259905245492302aabfd9bc
class TestStreamSlice(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.stream = StringIO.StringIO('0123456789') <NEW_LINE> <DEDENT> def test_read(self): <NEW_LINE> <INDENT> s = _StreamSlice(self.stream, 0, 4) <NEW_LINE> self.assertEqual('', s.read(0)) <NEW_LINE> self.assertEqual('0', s...
Test _StreamSlice.
6259905276d4e153a661dced
class Loader(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__softwares = {} <NEW_LINE> self.__addons = {} <NEW_LINE> <DEDENT> def addSoftwareInfo(self, softwareName, version, options={}): <NEW_LINE> <INDENT> assert isinstance(options, dict), 'options need to be a dictionary' <NEW_...
Abstract loader. Returns a list of software instances based on the addon and software information (@see softwares)
6259905282261d6c5273093c
class ImageViewer(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, master, img_data, passive=False, attached=True, *args, **kwargs): <NEW_LINE> <INDENT> tk.Frame.__init__(self, master, background='black') <NEW_LINE> self.master = master <NEW_LINE> self.attached=attached <NEW_LINE> self.master.config(bg="black") <NEW_...
Main image viewer ; uses range_slider.py to update clim
62599052b57a9660fecd2f60
class PlaceholderType(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { } <NEW_LINE> self.attributeMap = { }
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905271ff763f4b5e8c93
class PairList(list): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> for arg in args: <NEW_LINE> <INDENT> for element in arg: <NEW_LINE> <INDENT> self.append(element) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def append(self, value: Pair): <NEW_LINE> <INDENT> if isinstance(...
Unique pairs inside this list
62599052ac7a0e7691f739c6
class AppController(Borg): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.click_drag_screen = None <NEW_LINE> self.task_list_screen = None <NEW_LINE> self.timer_screen = None <NEW_LINE> self.screen_controller = None <NEW_LINE> self.timer_screen = None <NEW_LINE> self.time...
Contains references to important controller objects. Also contains the registry for object saving and loading.
62599052596a897236129022