code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Messenger: <NEW_LINE> <INDENT> def __init__(self, token='{}'): <NEW_LINE> <INDENT> self._token = token <NEW_LINE> self.post_url = FB_URL.format(self._token) <NEW_LINE> self.user_url = FB_USER_URL.format(self._token) <NEW_LINE> <DEDENT> @property <NEW_LINE> def token(self): <NEW_LINE> <INDENT> return self._token <...
Class that represents a singleton used to send messages to the Facebook API
6259905e3c8af77a43b68a6c
class VerifyUpdateVMName(pending_action.PendingServerAction): <NEW_LINE> <INDENT> def retry(self): <NEW_LINE> <INDENT> if (not self._target['id'] in self._state.get_instances().keys() or self._state.get_instances()[self._target['id']][1] == 'TERMINATING'): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> response, ...
Check that VM has new name
6259905ef7d966606f7493e4
class Node(object): <NEW_LINE> <INDENT> __slots__ = 'row','column','left', 'right', 'up', 'down' <NEW_LINE> def __init__ ( self, row=0, column=0, left = None, right = None, up = None, down = None ): <NEW_LINE> <INDENT> self.row = row <NEW_LINE> self.column = column <NEW_LINE> self.left = left <NEW_LINE> self.right = ri...
This class is used to represent a position of a frozen pond puzzle in a graph representation of that puzzle.
6259905e21a7993f00c675c4
class MonitoringStation: <NEW_LINE> <INDENT> def __init__(self, station_id, measure_id, label, coord, typical_range, river, town): <NEW_LINE> <INDENT> self.station_id = station_id <NEW_LINE> self.measure_id = measure_id <NEW_LINE> self.name = label <NEW_LINE> if isinstance(label, list): <NEW_LINE> <INDENT> self.name = ...
This class represents a river level monitoring station
6259905e0a50d4780f7068ea
class Namespace(object): <NEW_LINE> <INDENT> __slots__ = ("scope", "parent") <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> self.scope = {} <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def _eval_passdown(self, passdown:bool): <NEW_LINE> <INDENT> if self.parent is None: <NEW_LINE> <INDENT> return...
A namespace for the function calls.
6259905eb7558d5895464a58
class PassAvatarIdTerminalRealm(TerminalRealm): <NEW_LINE> <INDENT> noisy = False <NEW_LINE> def _getAvatar(self, avatarId): <NEW_LINE> <INDENT> comp = components.Componentized() <NEW_LINE> user = self.userFactory(comp, avatarId) <NEW_LINE> sess = self.sessionFactory(comp) <NEW_LINE> sess.transportFactory = self.transp...
Returns an avatar that passes the avatarId through to the protocol. This is probably not the best way to do it.
6259905e01c39578d7f14262
class Request(object): <NEW_LINE> <INDENT> def __init__( self, method: str, path: str, params: dict, data: Union[dict, str, bytes], headers: dict, callback: Callable = None, on_failed: Callable = None, on_error: Callable = None, extra: Any = None, ): <NEW_LINE> <INDENT> self.method = method <NEW_LINE> self.path = path ...
Request object for status check.
6259905e460517430c432b7e
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 = (0, 0, 0) <NEW_LINE> self.ship_limit = 3 <NEW_LINE> self.bullet_speed_factor = 5 <NEW_LINE> self.bullet_width = 8 <NEW_LINE> self.bullet_height = 17 <NEW_...
A class to store all settings for Alien Invasion.
6259905e7d847024c075da2a
class RoomDoesNotExists(Exception): <NEW_LINE> <INDENT> pass
Exception for Room
6259905e55399d3f05627b77
class TestConfigurationParameterCondition(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 testConfigurationParameterCondition(self): <NEW_LINE> <INDENT> pass
ConfigurationParameterCondition unit test stubs
6259905ea219f33f346c7e5d
@registry.bind(TestCaseReport) <NEW_LINE> class TestCaseRowBuilder(TestRowRenderer): <NEW_LINE> <INDENT> def get_header_linestyle(self): <NEW_LINE> <INDENT> return 0.5, colors.lightgrey <NEW_LINE> <DEDENT> def should_display(self, source): <NEW_LINE> <INDENT> return self.get_style(source).display_testcase
Row builder for TestCaseReport, this mainly corresponds to a testcase method / function.
6259905e29b78933be26abf0
@override_settings(PASSWORD_HASHERS=('django.contrib.auth.hashers.SHA1PasswordHasher',)) <NEW_LINE> class AdminCustomUrlsTest(TestCase): <NEW_LINE> <INDENT> fixtures = ['users.json', 'actions.json'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.client.login(username='super', password='secret') <NEW_LINE> <DEDENT...
Remember that: * The Action model has a CharField PK. * The ModelAdmin for Action customizes the add_view URL, it's '<app name>/<model name>/!add/'
6259905e32920d7e50bc769e
class TestSAMLProviderRulesApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = SAMLProviderRulesApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_create_saml_provider_rule(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def te...
SAMLProviderRulesApi unit test stubs
6259905e379a373c97d9a67d
class AddDofEmpty(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "add.dof_empty" <NEW_LINE> bl_label = "Add DOF Empty" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None <NEW_LINE> <DEDENT> def execute(self, context): <NEW_LINE> <INDENT> add_DOF...
Create empty and add as DOF Object
6259905e97e22403b383c565
class AttachmentPreprocessor(markdown.preprocessors.Preprocessor): <NEW_LINE> <INDENT> def run(self, lines): <NEW_LINE> <INDENT> new_text = [] <NEW_LINE> for line in lines: <NEW_LINE> <INDENT> m = ATTACHMENT_RE.match(line) <NEW_LINE> if m: <NEW_LINE> <INDENT> attachment_id = m.group('id').strip() <NEW_LINE> before = m....
django-wiki attachment preprocessor - parse text for [attachment:id] references.
6259905ea17c0f6771d5d6cf
class NutritionOrderEnteralFormulaAdministration(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "NutritionOrderEnteralFormulaAdministration" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.quantity = None <NEW_LINE> self.rateQuantity = None <NEW_LINE> self.rateRatio = None ...
Formula feeding instruction as structured data. Formula administration instructions as structured data. This repeating structure allows for changing the administration rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase the rate of continuous feeding...
6259905e99cbb53fe6832539
class Group(models.Model): <NEW_LINE> <INDENT> name = models.SlugField(_("name"), max_length=64, blank=False) <NEW_LINE> display_name = models.CharField(_("display name"), max_length=64) <NEW_LINE> mailing_list = models.EmailField(_("mailing list"), blank=True, help_text=_("The mailing list review requests and discussi...
A group of reviewers identified by a name. This is usually used to separate teams at a company or components of a project. Each group can have an e-mail address associated with it, sending all review requests and replies to that address. If that e-mail address is blank, e-mails are sent individually to each member of ...
6259905e7047854f46340a19
@inside_glslc_testsuite('PragmaShaderStage') <NEW_LINE> class TestConflictingPSSfromIncludingAndIncludedFile(expect.ErrorMessage): <NEW_LINE> <INDENT> environment = Directory('.', [ File('a.vert', '#pragma shader_stage(fragment)\n' 'void main() { gl_Position = vec4(1.); }\n' '#include "b.glsl"\n'), File('b.glsl', '#pra...
Tests that conflicting #pragma shader_stage() from including and included files results in an error with the correct location spec.
6259905e004d5f362081fb1b
class ShippingMethod(models.Model, Criteria): <NEW_LINE> <INDENT> active = models.BooleanField(_(u"Active"), default=False) <NEW_LINE> priority = models.IntegerField(_(u"Priority"), default=0) <NEW_LINE> name = models.CharField(_(u"Name"), max_length=50) <NEW_LINE> description = models.TextField(_(u"Description"), blan...
Decides how bought products are delivered to the customer. name The name of the shipping method. This is displayed to the customer to choose the shipping method. description A longer description of the shipping method. This could be displayed to the customer to describe the shipping method in detail. ...
6259905e435de62698e9d45e
class ContextMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, request): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> self.extrahead = request.PYLUCID.extrahead <NEW_LINE> <DEDENT> def _add_pagetree_headfiles(self): <NEW_LINE> <INDENT> pagetree = self.request.PYLUCID.pagetree <NEW_LINE> design = paget...
replace <!-- ContextMiddleware extrahead --> in the global page template
6259905e76e4537e8c3f0be5
class RuleFilter: <NEW_LINE> <INDENT> def to_query(self) -> Q: <NEW_LINE> <INDENT> raise NotImplementedError('You must override the method in successors') <NEW_LINE> <DEDENT> def __ne__(self, o: object) -> bool: <NEW_LINE> <INDENT> return not self == o
Abstract class shows the idea of rules query filtering invariants.
6259905e8e7ae83300eea6e7
class ExchangeValidator(Validator): <NEW_LINE> <INDENT> def __init__(self, provider: BaseProvider, contract_address: str): <NEW_LINE> <INDENT> super().__init__(provider, contract_address) <NEW_LINE> self.contract_address = contract_address <NEW_LINE> <DEDENT> def assert_valid( self, method_name: str, parameter_name: st...
Validate inputs to Exchange methods.
6259905e097d151d1a2c26c7
class TwitterStreamer(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.twitter_authenticator=TwitterAuthenticator() <NEW_LINE> <DEDENT> def stream_tweets(self,fetched_tweets_filename,hash_tag_list): <NEW_LINE> <INDENT> Listener = TwitterListener() <NEW_LINE> auth = OAuthHandler(twitter_credentials.CO...
class for streaming and processing live tweets
6259905ee64d504609df9efb
class ResetButton(Input): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> type = "reset"
A button that resets the contents of the form to default values. Not recommended.
6259905ed6c5a102081e377c
class ClosingIterator(object): <NEW_LINE> <INDENT> def __init__(self, iterable, callbacks=None): <NEW_LINE> <INDENT> iterator = iter(iterable) <NEW_LINE> self._next = iterator.next <NEW_LINE> if callbacks is None: <NEW_LINE> <INDENT> callbacks = [] <NEW_LINE> <DEDENT> elif callable(callbacks): <NEW_LINE> <INDENT> callb...
The WSGI specification requires that all middlewares and gateways respect the `close` callback of an iterator. Because it is useful to add another close action to a returned iterator and adding a custom iterator is a boring task this class can be used for that:: return ClosingIterator(app(environ, start_response)...
6259905e3539df3088ecd8f5
class DBSaver: <NEW_LINE> <INDENT> conn = None <NEW_LINE> def __init__(self, db_name): <NEW_LINE> <INDENT> self.db_name = db_name <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> self.conn = sqlite3.connect(self.db_name) <NEW_LINE> <DEDENT> def return_cursor(self): <NEW_LINE> <INDENT> if self.conn is not None...
Saves pandas dataframe into sqlite table. Parameters: ---------- db_name string, name of database to interact with
6259905e55399d3f05627b79
class DeblendedParent: <NEW_LINE> <INDENT> def __init__(self, filterName, footprint, maskedImage, psf, psffwhm, avgNoise, maxNumberOfPeaks, debResult): <NEW_LINE> <INDENT> self.filter = filterName <NEW_LINE> self.fp = footprint <NEW_LINE> self.maskedImage = maskedImage <NEW_LINE> self.psf = psf <NEW_LINE> self.psffwhm ...
Deblender result of a single parent footprint, in a single band Convenience class to store useful objects used by the deblender for a single band, such as the maskedImage, psf, etc as well as the results from the deblender. Parameters ---------- filterName: `str` Name of the filter used for `maskedImage` footprin...
6259905ea219f33f346c7e5f
class TestUrlWithStoragesAndOverrides(TankTestBase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestUrlWithStoragesAndOverrides, self).setUp() <NEW_LINE> self.setup_fixtures() <NEW_LINE> self.storage = { "type": "LocalStorage", "id": 1, "code": "storage_1", "windows_path": r"\\storage_win", } <NEW_L...
Tests file:// url resolution with local storages and environment overrides
6259905e29b78933be26abf1
class FeatResults(object): <NEW_LINE> <INDENT> def __init__(self, results, json_file): <NEW_LINE> <INDENT> with open(json_file) as data: <NEW_LINE> <INDENT> feature_data = json.load(data) <NEW_LINE> <DEDENT> self.feat_fractions = {} <NEW_LINE> self.feat_status = {} <NEW_LINE> self.features = set() <NEW_LINE> self.resul...
Container object for results. Has the results, feature profiles and feature computed results.
6259905e45492302aabfdb33
class CanineModelBuilder(GenericModelBuilder): <NEW_LINE> <INDENT> def __init__(self, model_config: canine_modeling.CanineModelConfig): <NEW_LINE> <INDENT> self.model_config = model_config <NEW_LINE> <DEDENT> def create_encoder_model(self, is_training, input_ids, input_mask, segment_ids): <NEW_LINE> <INDENT> return can...
Class for constructing a TyDi QA model based on CANINE.
6259905e4e4d562566373a61
class SCENE_OT_close_report_error(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "{}.close_report_error".format(makeBashSafe(addon_name.lower(), replace_with="_")) <NEW_LINE> bl_label = "Close Report Error" <NEW_LINE> bl_options = {"REGISTER", "UNDO"} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> txt...
Deletes error report from blender's memory (still exists in file system)
6259905ebaa26c4b54d50900
class MarketAPITestCase(APITestCase): <NEW_LINE> <INDENT> client_class = MarketAPIClient <NEW_LINE> def assertFieldEqual(self, response, field, value): <NEW_LINE> <INDENT> self.assertEqual(response.data.get(field), value) <NEW_LINE> <DEDENT> def assert200(self, response): <NEW_LINE> <INDENT> check_response_type(respons...
Custom APITestCase that provides a APIClient with some nice methods and some extra assert methods for common use cases
6259905e0c0af96317c5788c
class RatingStar(models.Model): <NEW_LINE> <INDENT> value = models.SmallIntegerField('Currency', default=0) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return f'{self.value}' <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Rating Star' <NEW_LINE> verbose_name_plural = 'Rating Stars' <NEW_LINE>...
Rating stars
6259905e7d43ff2487427f3d
class APIBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__connect_timeout = 5.0 <NEW_LINE> self.__socket_timeout = 5.0 <NEW_LINE> self.__proxies = {} <NEW_LINE> <DEDENT> def set_connection_timeout(self, second): <NEW_LINE> <INDENT> self.__connect_timeout = second <NEW_LINE> <DEDENT> def ...
自定义web请求类,封装requests
6259905e435de62698e9d460
class DefaultMeta(object): <NEW_LINE> <INDENT> pass
Default Meta for a Djid
6259905e8e7ae83300eea6e8
class Solver: <NEW_LINE> <INDENT> def __init__(self, cube): <NEW_LINE> <INDENT> self.cube = cube <NEW_LINE> self.result = None <NEW_LINE> self.expanded = 0 <NEW_LINE> self.ops = ['F', 'B', 'R', 'L', 'U', 'D', 'rF', 'rB', 'rR', 'rL', 'rU', 'rD'] <NEW_LINE> self.rops = ['rF', 'rB', 'rR', 'rL', 'rU', 'rD', 'F', 'B', 'R', ...
Abstract class solver. Define helper properties and functions for other solvers.
6259905ed99f1b3c44d06cfd
class TemplateState(State): <NEW_LINE> <INDENT> def __init__(self, hass, state): <NEW_LINE> <INDENT> self._hass = hass <NEW_LINE> self._state = state <NEW_LINE> <DEDENT> def _access_state(self): <NEW_LINE> <INDENT> state = object.__getattribute__(self, '_state') <NEW_LINE> hass = object.__getattribute__(self, '_hass') ...
Class to represent a state object in a template.
6259905e01c39578d7f14264
class _UnreadVariable(ResourceVariable): <NEW_LINE> <INDENT> def __init__(self, handle, dtype, shape, in_graph_mode, deleter, parent_op, unique_id): <NEW_LINE> <INDENT> self._trainable = False <NEW_LINE> self._synchronization = None <NEW_LINE> self._aggregation = None <NEW_LINE> self._save_slice_info = None <NEW_LINE> ...
Represents a future for a read of a variable. Pretends to be the tensor if anyone looks.
6259905e097d151d1a2c26ca
class Tokenizer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.token_to_str = {} <NEW_LINE> self.str_to_token = {} <NEW_LINE> self.counter = 0 <NEW_LINE> <DEDENT> def Normalize(self, s): <NEW_LINE> <INDENT> black_words = ['spp'] <NEW_LINE> parts = re.split(r'\W+', s.strip()) <NEW_LINE> parts ...
Assigns a unique token to each string in a corpus. Attributes: token_to_str: A dictionary mapping integer tokens to normalized strings str_to_token: A dictionary mapping normalized strings to token IDs
6259905ed6c5a102081e377e
class IndexTestCase(NodeAPITestCase): <NEW_LINE> <INDENT> def test_status_code(self): <NEW_LINE> <INDENT> rv = self.app.get('/') <NEW_LINE> assert rv.status_code == 200 <NEW_LINE> <DEDENT> def test_service_type(self): <NEW_LINE> <INDENT> rv = self.app.get('/') <NEW_LINE> data = json.loads(rv.data) <NEW_LINE> assert dat...
Test the node API root endpoint for correct infos
6259905e38b623060ffaa37d
class SmoothingFunction: <NEW_LINE> <INDENT> def __init__(self, epsilon=0.1, alpha=5, k=5): <NEW_LINE> <INDENT> self.epsilon = epsilon <NEW_LINE> self.alpha = alpha <NEW_LINE> self.k = k <NEW_LINE> <DEDENT> def method0(self, p_n, *args, **kwargs): <NEW_LINE> <INDENT> return p_n <NEW_LINE> <DEDENT> def method1(self, p_n...
This is an implementation of the smoothing techniques for segment-level BLEU scores that was presented in Boxing Chen and Collin Cherry (2014) A Systematic Comparison of Smoothing Techniques for Sentence-Level BLEU. In WMT14. http://acl2014.org/acl2014/W14-33/pdf/W14-3346.pdf
6259905ea8ecb03325872873
class SimpleRegistrationBackendTests(TestCase): <NEW_LINE> <INDENT> backend = SimpleBackend() <NEW_LINE> def test_registration(self): <NEW_LINE> <INDENT> new_user = self.backend.register(_mock_request(), username='bob', email='bob@example.com', password1='secret') <NEW_LINE> self.assertEqual(new_user.username, 'bob') <...
Test the simple registration backend, which does signup and immediate activation.
6259905efff4ab517ebcee81
class LocationSerializerWithStoryImages(LocationSerializerWithStoryTitle): <NEW_LINE> <INDENT> stories = StoryImageSerializer(many=True)
Serializes a Location and the attached stories using the StoryImageSerializer
6259905ee5267d203ee6ceed
class Cleaner(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__files = [] <NEW_LINE> <DEDENT> def Add(self, filename): <NEW_LINE> <INDENT> self.__files.append(filename) <NEW_LINE> <DEDENT> def HasFiles(self): <NEW_LINE> <INDENT> return self.__files <NEW_LINE> <DEDENT> def GetFiles(self): <NEW...
Class to manage cleanup of a set of files. Instances of this class are callable, when called they delete all of the files.
6259905ea8370b77170f1a2a
class MeanSquaredError(Cost_ABC) : <NEW_LINE> <INDENT> def run(self, targets, outputs, stream) : <NEW_LINE> <INDENT> cost = tt.mean((outputs - targets) ** 2) <NEW_LINE> return cost
The all time classic
6259905e3eb6a72ae038bcbc
class ModelStrategyExecuter(models.Model): <NEW_LINE> <INDENT> code = models.CharField(u'代码', max_length=50) <NEW_LINE> name = models.CharField(u'名称', max_length=100) <NEW_LINE> account = models.ForeignKey('ModelAccount', verbose_name=u'账号', blank=True, null=True) <NEW_LINE> dataGenerator = models.ForeignKey('ModelData...
策略执行器
6259905e7b25080760ed880e
class JistBrainMp2rageSkullStripping(SEMLikeCommandLine): <NEW_LINE> <INDENT> input_spec = JistBrainMp2rageSkullStrippingInputSpec <NEW_LINE> output_spec = JistBrainMp2rageSkullStrippingOutputSpec <NEW_LINE> _cmd = "java edu.jhu.ece.iacl.jist.cli.run de.mpg.cbs.jist.brain.JistBrainMp2rageSkullStripping " <NEW_LINE> _ou...
title: MP2RAGE Skull Stripping category: Developer Tools description: Estimate a brain mask for a MP2RAGE dataset. At least a T1-weighted or a T1 map image is required. version: 3.0.RC
6259905e7cff6e4e811b70a1
class CommandFailedError(BaseError): <NEW_LINE> <INDENT> def __init__(self, cmd, msg, device=None): <NEW_LINE> <INDENT> super(CommandFailedError, self).__init__( (('device %s: ' % device) if device else '') + 'adb command \'%s\' failed with message: \'%s\'' % (' '.join(cmd), msg))
Exception for command failures.
6259905e7d847024c075da2f
class DefaultEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, datetime.datetime): <NEW_LINE> <INDENT> return int(mktime(obj.timetuple())) <NEW_LINE> <DEDENT> return json.JSONEncoder.default(self, obj)
Encode for the json.
6259905e45492302aabfdb36
class TestCreateDateRangeFilter(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.repo_config = { constants.PUBLISH_HTTPS_KEYWORD: True, constants.PUBLISH_HTTP_KEYWORD: False, } <NEW_LINE> self.start_date = '2010-01-01 12:00:00' <NEW_LINE> self.end_date = '2010-01-02 12:00:00' <NEW_LINE>...
Tests for the create_date_range_filter method in export_utils
6259905e56ac1b37e6303815
class TileListagemHorizontal(BaseTile): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> implements(ITileListagemHorizontal) <NEW_LINE> portal_type = 'TileListagemHorizontal' <NEW_LINE> _at_rename_after_creation = True <NEW_LINE> schema = TileListagemHorizontal_schema <NEW_LINE> def voc_list_types(self): <...
Reserve Content for TileListagemHorizontal
6259905ee76e3b2f99fda05c
class FilesAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Files <NEW_LINE> <DEDENT> def save(self, commit=True): <NEW_LINE> <INDENT> user = super(FilesAdmin, self).save(commit=False) <NEW_LINE> if commit: <NEW_LINE> <INDENT> user.save() <NEW_LINE> <DEDENT> return user
A form for creating new users. Includes all the required fields, plus a repeated password.
6259905e3cc13d1c6d466d9e
class TestAuthManager(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_class(cls): <NEW_LINE> <INDENT> ckan.plugins.load('configpermission') <NEW_LINE> <DEDENT> def teardown(self): <NEW_LINE> <INDENT> ckan.model.repo.rebuild_db() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def teardown_class(cl...
Tests for the ckanext.configpermission.logic.action.get module. Specifically tests that overriding parent auth functions will cause child auth functions to use the overridden version.
6259905e4a966d76dd5f0550
class TestDjango: <NEW_LINE> <INDENT> def django_version(self): <NEW_LINE> <INDENT> output = check_output(['python', '-c', 'import django; print(django.get_version())']) <NEW_LINE> return output.decode(getpreferredencoding()).strip() <NEW_LINE> <DEDENT> def test_django_version(self): <NEW_LINE> <INDENT> assert self.dja...
Test if Django and its libraries are properly installed inside venv
6259905ecb5e8a47e493ccb4
class VRFTenantSerializer(object): <NEW_LINE> <INDENT> def __init__(self, id=None, name=None, rd=None, tenant=None): <NEW_LINE> <INDENT> self.swagger_types = { 'id': 'int', 'name': 'str', 'rd': 'str', 'tenant': 'TenantNestedSerializer' } <NEW_LINE> self.attribute_map = { 'id': 'id', 'name': 'name', 'rd': 'rd', 'tenant'...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905e15baa723494635f0
class Customer: <NEW_LINE> <INDENT> def view_menu(self): <NEW_LINE> <INDENT> menu = FoodDetails.objects.select_related('category_id').all() <NEW_LINE> return menu <NEW_LINE> <DEDENT> def customer_signup(self, cust_name, cust_phone, cust_email): <NEW_LINE> <INDENT> signup = CustomerDetails( cust_name=cust_name, cust_pho...
Customer's end operation
6259905e8e71fb1e983bd128
class PandasDelegate(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _make_accessor(cls, data): <NEW_LINE> <INDENT> raise AbstractMethodError("_make_accessor should be implemented" "by subclass and return an instance" "of `cls`.") <NEW_LINE> <DEDENT> def _delegate_property_get(self, name, *args, **kwargs): <NE...
an abstract base class for delegating methods/properties
6259905e56b00c62f0fb3f29
class Event(Base): <NEW_LINE> <INDENT> def __init__(my, event_name): <NEW_LINE> <INDENT> my.event_name = event_name <NEW_LINE> my.event_container = WebContainer.get_event_container() <NEW_LINE> <DEDENT> def add_listener(my, script_text, replace=False): <NEW_LINE> <INDENT> my.event_container.add_listener(my.event_name, ...
This class is a wrapper around a simple event architecture in javascript General usage: To add an event caller: span = SpanWdg() span.add("push me") event_container = WebContainer.get_event_container() caller = event_container.get_event_caller('event_name') span.add_event("onclick", caller) To add a listener: even...
6259905e435de62698e9d463
class ManagementGroup(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'server_count': {'key': 'properties.serverCount', 'type': 'int'}, 'is_gateway': {'key': 'properties.isGateway', 'type': 'bool'}, 'name': {'key': 'properties.name', 'type': 'str'}, 'id': {'key': 'properties.id', 'type': 'str'}, 'cr...
A management group that is connected to a workspace. :ivar server_count: The number of servers connected to the management group. :vartype server_count: int :ivar is_gateway: Gets or sets a value indicating whether the management group is a gateway. :vartype is_gateway: bool :ivar name: The name of the management grou...
6259905e29b78933be26abf3
class pesan(object): <NEW_LINE> <INDENT> def __init__(self, sebuahString): <NEW_LINE> <INDENT> self.teks = sebuahString <NEW_LINE> <DEDENT> def cetakIni(self): <NEW_LINE> <INDENT> print(self.teks) <NEW_LINE> <DEDENT> def cetakHurufkapital(self): <NEW_LINE> <INDENT> print(str.upper(self.teks)) <NEW_LINE> <DEDENT> def ce...
sebuah class bernama pesan. untuk memahami konsep class dan object.
6259905ee5267d203ee6ceee
class UserProfileFeedViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication, ) <NEW_LINE> serializer_class = serializers.ProfileFeedItemSerializer <NEW_LINE> queryset = models.ProfileFeedItem.objects.all() <NEW_LINE> permission_classes = ( permissions.updateOwnStatus, IsAuthen...
Handles creating, reading and updating profile feed items
6259905e379a373c97d9a683
class NSNitroNserrCaconfCnflAbsexpHeurexp(NSNitroCaconfErrors): <NEW_LINE> <INDENT> pass
Nitro error code 483 Conflicting arguments, absExpiry and heurExpiryParam
6259905e3539df3088ecd8fa
class ProtectedResourceView(ProtectedResourceMixin, View): <NEW_LINE> <INDENT> server_class = Server <NEW_LINE> validator_class = oauth2_settings.OAUTH2_VALIDATOR_CLASS <NEW_LINE> oauthlib_backend_class = oauth2_settings.OAUTH2_BACKEND_CLASS
Generic view protecting resources by providing OAuth2 authentication out of the box
6259905e3617ad0b5ee077ab
class CategorySerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> notes = serializers.HyperlinkedRelatedField(view_name='main:note-detail', many=True, read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Category <NEW_LINE> fields = ('id', 'date_modified','date_created', 'category', 'n...
Serializer for Category model
6259905e2ae34c7f260ac746
class Solution: <NEW_LINE> <INDENT> def woodCut(self, L, k): <NEW_LINE> <INDENT> if sum(L) < k: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> start,end = 1,max(L) <NEW_LINE> while start + 1 < end: <NEW_LINE> <INDENT> mid = (start+end) //2 <NEW_LINE> pieces_num = sum(len_i / mid for len_i in L) <NEW_LINE> if pieces+s...
@param: L: Given n pieces of wood with length L[i] @param: k: An integer @return: The maximum length of the small pieces
6259905e3cc13d1c6d466da0
class BetaTransactionApiServicer(object): <NEW_LINE> <INDENT> def CreateTransaction(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLEMENTED) <NEW_LINE> <DEDENT> def GetTransaction(self, request, context): <NEW_LINE> <INDENT> context.code(beta_interfaces.StatusCode.UNIMPLEMENTE...
The Beta API is deprecated for 0.15.0 and later. It is recommended to use the GA API (classes and functions in this file not marked beta) for all further purposes. This class was generated only to ease transition from grpcio<0.15.0 to grpcio>=0.15.0.
6259905e442bda511e95d889
@dataclass(frozen=True) <NEW_LINE> class PlayerCharacter(Character): <NEW_LINE> <INDENT> player: Optional[str] = None
Record for a Player Character.
6259905ecc0a2c111447c5fe
class EtcdInvalidActiveSize(EtcdException): <NEW_LINE> <INDENT> pass
Error ecodeInvalidActiveSize (http code 403)
6259905e7d847024c075da32
@dochelper <NEW_LINE> class XicsrtSourceFocused(XicsrtSourceGeneric): <NEW_LINE> <INDENT> def default_config(self): <NEW_LINE> <INDENT> config = super().default_config() <NEW_LINE> config['target'] = None <NEW_LINE> return config <NEW_LINE> <DEDENT> def generate_direction(self, origin): <NEW_LINE> <INDENT> normal = sel...
An extended rectangular ray source that allows focusing towards a target. This is different to a SourceDirected in that the emission cone is aimed at the target for every location in the source. The SourceDirected instead uses a fixed direction for emission.
6259905e8da39b475be04846
class MyApplication(web.application): <NEW_LINE> <INDENT> def run(self, port=int(SERVER_OPTS['port']), *middleware): <NEW_LINE> <INDENT> func = self.wsgifunc(*middleware) <NEW_LINE> return web.httpserver.runsimple(func, ('0.0.0.0', port))
Can change port or other stuff
6259905e0fa83653e46f6546
class FuturesCommission(BaseCommission): <NEW_LINE> <INDENT> BROKER_COMMISSION_PER_CONTRACT = 0 <NEW_LINE> EXCHANGE_FEE_PER_CONTRACT = 0 <NEW_LINE> CARRYING_FEE_PER_CONTRACT = 0 <NEW_LINE> @classmethod <NEW_LINE> def get_commissions(cls, contract_values, turnover, **kwargs): <NEW_LINE> <INDENT> cost_per_contract = cls....
Base class for futures commissions. Parameters ---------- BROKER_COMMISSION_PER_CONTRACT : float the commission per contract EXCHANGE_FEE_PER_CONTRACT : float the exchange and regulatory fees per contract CARRYING_FEE_PER_CONTRACT : float the overnight carrying fee per contract (depends on equity in exce...
6259905e23e79379d538db5b
class PartieCollectivite(models.Model): <NEW_LINE> <INDENT> id = models.IntegerField(primary_key=True) <NEW_LINE> partie = models.ForeignKey(Partie) <NEW_LINE> collectivite = models.ForeignKey(Collectivite) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = u'partie_collectivite'
PartieCollectivite model * datamodel review by sam * 0 inconsistant/unused fields * MD : OK
6259905e07f4c71912bb0a9c
class MyAccountView(ConfigPagesView): <NEW_LINE> <INDENT> title = _('My Account') <NEW_LINE> css_bundle_names = [ 'account-page', ] <NEW_LINE> js_bundle_names = [ '3rdparty-jsonlint', 'config-forms', 'account-page', ] <NEW_LINE> @method_decorator(login_required) <NEW_LINE> @augment_method_from(ConfigPagesView) <NEW_LIN...
Displays the My Account page containing user preferences. The page will be built based on registered pages and forms. This makes it easy to plug in new bits of UI for the page, which is handy for extensions that want to offer customization for users.
6259905e99cbb53fe6832540
class Env: <NEW_LINE> <INDENT> def __init__(self, modpath_var='MODM_MODULES_PATH', modloaded_var='MODM_LOADED_MODULES'): <NEW_LINE> <INDENT> self.modpath_var = modpath_var <NEW_LINE> self.modloaded_var = modloaded_var <NEW_LINE> self.modpath = self.load_path(modpath_var) <NEW_LINE> self.modloaded = self.load_path(modlo...
Class to handle environment variables in an easy way.
6259905eac7a0e7691f73b43
class getEulaIDL_result(object): <NEW_LINE> <INDENT> thrift_spec = ((0, TType.STRUCT, 'success', (LicenseEulaIDL, LicenseEulaIDL.thrift_spec), None), (1, TType.STRUCT, 'e', (Shared.ttypes.ExceptionIDL, Shared.ttypes.ExceptionIDL.thrift_spec), None)) <NEW_LINE> def __init__(self, success = None, e = None): <NEW_LINE> <I...
Attributes: - success - e
6259905e2ae34c7f260ac747
class Expert(ExperChatBaseModel): <NEW_LINE> <INDENT> userbase = models.OneToOneField( settings.AUTH_USER_MODEL, on_delete=models.PROTECT, primary_key=True, verbose_name=_('user base'), ) <NEW_LINE> expert_uid = models.CharField(max_length=5, unique=True, null=True) <NEW_LINE> account_id = models.IntegerField(default=0...
Store expert's information.
6259905e0c0af96317c5788f
class Douban: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8', 'Accept-Encoding': 'gzip, deflate, sdch, br', 'Accept-Language': 'en,zh-CN;q=0.8,zh;q=0.6,zh-TW;q=0.4' } <NEW_LINE> self.session = requests.s...
使用: 1. 命令行 $ python douban.py 密码: ******* 请到当前目录找到captcha文件, 并输入验证码 captcha $ douban.scrape_doumail() $ douban.do_other_stuff() 2. from douban import Douban douban = Douban() douban.login('<yourusername>', '<yourpassword>') douban.scrape_doumail() douban.do_other_stuff(...
6259905ee76e3b2f99fda060
class UserForm(forms.ModelForm): <NEW_LINE> <INDENT> password = forms.CharField(widget=forms.PasswordInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['username', 'email', 'password']
ModelForm for Users. This is the general form for creating Users. Attributes ---------- username = Username Username for the user to login into the system. email = Email Email required for the user, has format validation. password = Password Password for the user, the widget PasswordInput hides the charac...
6259905e76e4537e8c3f0bed
class ProjectsLocationsClustersWellKnownService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'projects_locations_clusters_well_known' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(ContainerV1.ProjectsLocationsClustersWellKnownService, self).__init__(client) <NEW_LINE> self._upload_configs =...
Service class for the projects_locations_clusters_well_known resource.
6259905e8e7ae83300eea6ef
class ItemOperation(FlaskForm): <NEW_LINE> <INDENT> iid = HiddenField("iid") <NEW_LINE> remove = SubmitField("Smazat") <NEW_LINE> edit = SubmitField("Editovat")
smazání položky
6259905e097d151d1a2c26cf
class IFCurrDualExp(AbstractPopulationVertex): <NEW_LINE> <INDENT> _model_based_max_atoms_per_core = 255 <NEW_LINE> default_parameters = { 'tau_m': 20.0, 'cm': 1.0, 'v_rest': -65.0, 'v_reset': -65.0, 'v_thresh': -50.0, 'tau_syn_E': 5.0, 'tau_syn_E2': 5.0, 'tau_syn_I': 5.0, 'tau_refrac': 0.1, 'i_offset': 0} <NEW_LINE> d...
Leaky integrate and fire neuron with two exponentially decaying excitatory current inputs, and one exponentially decaying inhibitory current input
6259905e627d3e7fe0e084ec
class PrivateTopicNew(CreateView): <NEW_LINE> <INDENT> form_class = PrivateTopicForm <NEW_LINE> template_name = 'mp/topic/new.html' <NEW_LINE> @method_decorator(login_required) <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(PrivateTopicNew, self).dispatch(*args, **kwargs) <NEW_LINE> <D...
Creates a new MP.
6259905e435de62698e9d467
class Menu(QtGui.QMenu): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QtGui.QMenu.__init__(self, parent) <NEW_LINE> self.parent = parent <NEW_LINE> <DEDENT> def newAction(self, label, icon, slot): <NEW_LINE> <INDENT> action = self.addAction(icon, label) <NEW_LINE> self.parent.connect(action, QtCo...
QMenu wrapper for creating popups without pain. Usage: menu = Menu() menu.newAction("Item 1", "green_led", self.slotItem1Clicked)
6259905ea17c0f6771d5d6d4
class MainWindow(QMainWindow): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.item_cnt = 0 <NEW_LINE> self.list_widget = QListWidget(self) <NEW_LINE> self.list_widget.setMinimumWidth(200) <NEW_LINE> self.scene = QGraphicsScene(self) <NEW_LINE> self.scene.setSceneRect(0, 0...
主窗口类
6259905e3617ad0b5ee077af
class Solution: <NEW_LINE> <INDENT> def permute(self, nums): <NEW_LINE> <INDENT> temp = nums[:] <NEW_LINE> n = len(nums) <NEW_LINE> path, result = [], [] <NEW_LINE> if len(nums) == 0: <NEW_LINE> <INDENT> result.append(path) <NEW_LINE> return result <NEW_LINE> <DEDENT> self.helper(temp, path, n, result) <NEW_LINE> retur...
@param: nums: A list of integers. @return: A list of permutations.
6259905e2ae34c7f260ac74a
class BasePrior(object): <NEW_LINE> <INDENT> def __init__(self, adaptive=False, sort=False, nfunc_min=1): <NEW_LINE> <INDENT> self.adaptive = adaptive <NEW_LINE> self.sort = sort <NEW_LINE> self.nfunc_min = nfunc_min <NEW_LINE> <DEDENT> def cube_to_physical(self, cube): <NEW_LINE> <INDENT> return cube <NEW_LINE> <DEDEN...
Base class for Priors.
6259905e3cc13d1c6d466da4
class Webserver: <NEW_LINE> <INDENT> def __init__(self, root=None, port=None, wait=5, handler=None, ssl_opts=None): <NEW_LINE> <INDENT> if port is not None and not isinstance(port, int): <NEW_LINE> <INDENT> raise ValueError("port must be an integer") <NEW_LINE> <DEDENT> if root is None: <NEW_LINE> <INDENT> root = RUNTI...
Starts a tornado webserver on 127.0.0.1 on a random available port USAGE: .. code-block:: python from tests.support.helpers import Webserver webserver = Webserver('/path/to/web/root') webserver.start() webserver.stop()
6259905e0a50d4780f7068f0
class Concrete(Spec, t.NamedTuple): <NEW_LINE> <INDENT> typ: type
str, int, float, null
6259905e56ac1b37e6303818
@util.export <NEW_LINE> class Plugin(plugin.PluginBase): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> super(Plugin, self).__init__(context=context) <NEW_LINE> <DEDENT> @plugin.event( stage=plugin.Stages.STAGE_INIT, ) <NEW_LINE> def _init(self): <NEW_LINE> <INDENT> self.environment.setdefault( os...
Answer file plugin.
6259905e01c39578d7f14268
class Sky2Pix_TAN(Sky2PixProjection, Zenithal): <NEW_LINE> <INDENT> @property <NEW_LINE> def inverse(self): <NEW_LINE> <INDENT> return Pix2Sky_TAN() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def evaluate(cls, phi, theta): <NEW_LINE> <INDENT> phi = np.deg2rad(phi) <NEW_LINE> theta = np.deg2rad(theta) <NEW_LINE> r_thet...
TAN : Gnomonic Projection - sky to pixel. See `Zenithal` for a definition of the full transformation. .. math:: R_\theta = \frac{180^{\circ}}{\pi}\cot \theta
6259905e21bff66bcd7242c8
@StreamFeatures.as_feature_class <NEW_LINE> class StartTLSFeature(StartTLSXSO): <NEW_LINE> <INDENT> TAG = (namespaces.starttls, "starttls") <NEW_LINE> class Required(xso.XSO): <NEW_LINE> <INDENT> TAG = (namespaces.starttls, "required") <NEW_LINE> <DEDENT> required = xso.Child([Required], required=False)
Start TLS capability stream feature
6259905e15baa723494635f6
@base.ReleaseTracks(base.ReleaseTrack.BETA, base.ReleaseTrack.GA) <NEW_LINE> class GetValue(base.Command): <NEW_LINE> <INDENT> detailed_help = {'properties': properties.VALUES.GetHelpString()} <NEW_LINE> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument( 'property', metavar='SECTION/PRO...
Print the value of a Cloud SDK property. {command} prints the property value from your active configuration only. ## AVAILABLE PROPERTIES {properties} ## EXAMPLES To print the project property in the core section, run: $ {command} project To print the zone property in the compute section, run: $ {command} c...
6259905ee64d504609df9f00
class ManageUserFormSchema(interface.Interface): <NEW_LINE> <INDENT> user_id = schema.ASCIILine(title=_(u"Users uuid"))
Form used by user to register.
6259905ea8ecb0332587287b
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = '=!=!=!= PLEASE,CHANGE THIS SECRET KEY, OK?... =!=!=!=' <NEW_LINE> TOKEN_SALT = '=!=!=!= TOKEN-SALT-KEY (do not forget to change it) =!=!=!=' <NEW_LINE> APP_DIR = os.path.abspath(os.path.dirname(__file__)) <NEW_LINE> PROJECT_ROOT = os.path.abspath(os.path.join(APP_...
Base configuration.
6259905e67a9b606de5475d3
class TestOption(TestCase): <NEW_LINE> <INDENT> pass
def _test_option(self, options): self._test("", options=options) def _test_threshold(self, threshold): self._test_option(["--threshold=%(threshold)s" % { "threshold": threshold }]) def test_threshold1(self): self._test_threshold("42") def test_threshold2(self): self._test_threshold("42k") def test_t...
6259905eac7a0e7691f73b47
class Element(Enum): <NEW_LINE> <INDENT> DATE_FROM_XPATH = '//*[@id="ctl00_PlaceHolderMain_generalSearchForm_txtGSStartDate"]' <NEW_LINE> SEARCH_BUTTON_XPATH = '//*[@id="ctl00_PlaceHolderMain_btnNewSearch"]' <NEW_LINE> TABLE_ID = 'ctl00_PlaceHolderMain_dgvPermitList_gdvPermitList' <NEW_LINE> PAGE_NAV_CLASS = 'aca_pagin...
The class contains variables that describe different attributes of web elements to be located
6259905e45492302aabfdb3d
class TestNormalization(ParametricTestCase): <NEW_LINE> <INDENT> def _testCodec(self, normalization, rtol=1e-5): <NEW_LINE> <INDENT> test_data = (numpy.arange(1, 10, dtype=numpy.int32), numpy.linspace(1., 100., 1000, dtype=numpy.float32), numpy.linspace(-1., 1., 100, dtype=numpy.float32), 1., 1) <NEW_LINE> for index in...
Test silx.math.colormap.Normalization sub classes
6259905ea8370b77170f1a32
class SkodaServiceUnavailable(Exception): <NEW_LINE> <INDENT> def __init__(self, status): <NEW_LINE> <INDENT> super(SkodaServiceUnavailable, self).__init__(status) <NEW_LINE> self.status = status
Raised when a API is unavailable
6259905e3539df3088ecd900
class config: <NEW_LINE> <INDENT> interval = float(getenv('THRASH_PROTECT_INTERVAL', '0.5')) <NEW_LINE> max_acceptable_time_delta = interval/16.0 <NEW_LINE> swap_page_threshold = int(getenv('THRASH_PROTECT_SWAP_PAGE_THRESHOLD', '512')) <NEW_LINE> pgmajfault_scan_threshold = int(getenv('THRASH_PROTECT_PGMAJFAULT_SCAN_TH...
Collection of configuration variables. (Those are still really global variables, but looks a bit neater to access config.bits_per_byte than bits_per_byte. Perhaps we'll parse some a config file and initiate some object with the name config in some future version)
6259905ea79ad1619776b5ef
class CreateTokenView(ObtainAuthToken): <NEW_LINE> <INDENT> serializer_class = AuthTokenSerializer <NEW_LINE> renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES
Create a new auth tolen for user
6259905e379a373c97d9a689