code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TestCommunicatorDelegate(ProcessControllerDelegate): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def launch_mode(self): <NEW_LINE> <INDENT> return self.LAUNCH_MODE_CHILD <NEW_LINE> <DEDENT> def process_filedescriptors(self): <NEW_LINE> <INDENT> return (None, subprocess.PIPE, subprocess.PIPE) <NEW_LINE> <DEDENT>...
Communicate with a process and see how that works
62598feafbf16365ca79485b
class SherpaRomeo(utopia.document.Annotator, utopia.document.Visualiser): <NEW_LINE> <INDENT> apiKey = 'TGb5fUBjk9Q' <NEW_LINE> def on_ready_event(self, document): <NEW_LINE> <INDENT> issn = utopia.tools.utils.metadata(document, 'publication-issn') <NEW_LINE> doi = utopia.tools.utils.metadata(document, 'identifiers[doi...
Generate Sherpa Romeo information
62598feaad47b63b2c5a7fe8
class MariaDBMigratorBase(MigratorBase): <NEW_LINE> <INDENT> def execute_if_authorized(default: Any = None): <NEW_LINE> <INDENT> def inner_metdhod(func): <NEW_LINE> <INDENT> @functools.wraps(func) <NEW_LINE> def wrapper(self, *args, **kwargs): <NEW_LINE> <INDENT> if self.authorized: <NEW_LINE> <INDENT> return func(self...
Provides the base of all our mariadb migration.
62598fea4c3428357761aa43
class ModelExclude(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'test.modelsql.exclude' <NEW_LINE> value = fields.Integer("Value") <NEW_LINE> condition = fields.Boolean("Condition") <NEW_LINE> @classmethod <NEW_LINE> def default_condition(cls): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> de...
ModelSQL with exclude constraint
62598fea627d3e7fe0e07641
@dataclass <NEW_LINE> class GradientClipping(LearnerCallback): <NEW_LINE> <INDENT> clip:float <NEW_LINE> def on_backward_end(self, **kwargs): <NEW_LINE> <INDENT> if self.clip: nn.utils.clip_grad_norm_(self.learn.model.parameters(), self.clip)
To do gradient clipping during training.
62598feaad47b63b2c5a7fea
class _Message(object): <NEW_LINE> <INDENT> def __init__(self, msg_id, msg_str, long_msg, default): <NEW_LINE> <INDENT> self.msg_id = msg_id <NEW_LINE> self.msg_str = msg_str <NEW_LINE> if long_msg: <NEW_LINE> <INDENT> self.long_msg = textwrap.dedent(long_msg) <NEW_LINE> self.long_msg = self.long_msg.strip() <NEW_LINE>...
An individual pkgcheck message. This should be accessed via the MESSAGES dict keyed by msg_id, e.g. from pkgcheck.messages import MESSAGES print(MESSAGES['E123'].msg) :param msg_id: The unique message id (E...) :param msg_str: The short message string, as displayed in program output :param long_...
62598fea091ae356687053b7
class PublicTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(TAGS_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicly available tags API.
62598fea187af65679d29fc4
class RadicalizationTest(LabyrinthTestCase): <NEW_LINE> <INDENT> def test_cell_placement_removes_cadre(self): <NEW_LINE> <INDENT> mock_randomizer = mock(Randomizer()) <NEW_LINE> app = Labyrinth(1, 1, self.set_up_test_scenario, randomizer=mock_randomizer) <NEW_LINE> country_name = "Iraq" <NEW_LINE> when(mock_randomizer)...
Test Radicalization
62598fea26238365f5fad2fd
class BaseScaffoldFilterRule(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def filter(self, child, parents): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def name(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE>...
Abstract base class for defining rules for scaffold prioritization. Scaffold filter rules should subclass this base class. All base rules should implement the ``name`` property and the ``filter`` function.
62598feac4546d3d9def7654
class StatusTrigger(Trigger): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(StatusTrigger, self).__init__() <NEW_LINE> self.cmd_attrs = {} <NEW_LINE> <DEDENT> def get_title(self): <NEW_LINE> <INDENT> return "StatusTrigger" <NEW_LINE> <DEDENT> def check(self, sobject): <NEW_LINE> <INDENT> if not isin...
A trigger for changing the compositing task status to Pending when the rendering task status is set to Review
62598fea4c3428357761aa49
class PiersonMoskowitz(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def significant_wave_height(cls, wind_speed): <NEW_LINE> <INDENT> return (wind_speed ** 2.0) * 0.22 / g <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def peak_wave_period(cls, wind_speed): <NEW_LINE> <INDENT> return wind_speed * 3.0 / 4.0
Pierson-Moskowitz spectrum for fully developed, wind induced, surface waves. This relates significant wave height to U_10 (m/s), which is the wind speed at 10m elevation.
62598fea627d3e7fe0e07649
class ProxyMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request, spider): <NEW_LINE> <INDENT> request.meta["proxy"] = PROXYSERVER <NEW_LINE> request.headers["Proxy-Authorization"] = PROXYAUTH <NEW_LINE> request.headers["Cache-Control"] = "no-cache"
阿布云代理中间件
62598feaab23a570cc2d513e
class LiteralStructType(BaseStructType): <NEW_LINE> <INDENT> null = 'zeroinitializer' <NEW_LINE> def __init__(self, elems, packed=False): <NEW_LINE> <INDENT> self.elements = tuple(elems) <NEW_LINE> self.packed = packed <NEW_LINE> <DEDENT> def _to_string(self): <NEW_LINE> <INDENT> return self.structure_repr() <NEW_LINE>...
The type of "literal" structs, i.e. structs with a literally-defined type (by contrast with IdentifiedStructType).
62598fea627d3e7fe0e0764f
@pytest.mark.draft <NEW_LINE> @pytest.mark.components <NEW_LINE> @pytest.allure.story('Broadcasts') <NEW_LINE> @pytest.allure.feature('GET') <NEW_LINE> class Test_PFE_Components(object): <NEW_LINE> <INDENT> @pytest.allure.link('https://jira.qumu.com/browse/TC-42299') <NEW_LINE> @pytest.mark.Broadcasts <NEW_LINE> @pytes...
PFE Broadcasts test cases.
62598fea187af65679d29fcb
class OrbiterRocketGroupRemove(Operator): <NEW_LINE> <INDENT> bl_idname = "orbiter.rocket_group_remove" <NEW_LINE> bl_label = "Remove Rocket Group" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> orbiter = context.scene.orbiter <NEW_LINE> orbiter.rocket_groups.remove(orbiter.rocket_groups_active_index) <NEW_...
Remove a rocket group
62598fea187af65679d29fcc
class WPL(ActorCritic): <NEW_LINE> <INDENT> def _loss(self, is_terminal, state, next_state, action, next_action, reward, cum_return, final_reward): <NEW_LINE> <INDENT> grad_est = cum_return - state[:, :, 1].gather(index=action.unsqueeze(1), dim=1).view(-1) <NEW_LINE> grad_projected = torch.where(grad_est < 0, 1. + grad...
Weighted Policy Learner (WPL) Multi-Agent Reinforcement Learning based decision making.
62598fea4c3428357761aa5a
class ScopedSymbol(object): <NEW_LINE> <INDENT> def __init__(self, name, enclosing_scope): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.scope = None <NEW_LINE> self.enclosing_scope = enclosing_scope <NEW_LINE> <DEDENT> def define(self, symbol): <NEW_LINE> <INDENT> self.get_members()[symbol.name] = symbol <NEW_L...
Base class for symbols
62598feaad47b63b2c5a8000
class Vertex: <NEW_LINE> <INDENT> def __init__(self, point_2): <NEW_LINE> <INDENT> self.x = point_2.x() <NEW_LINE> self.y = point_2.y() <NEW_LINE> self.hedgelist = [] <NEW_LINE> <DEDENT> def sortincident(self): <NEW_LINE> <INDENT> self.hedgelist.sort(hsort, reverse=True)
Minimal implementation of a vertex of a 2D dcel
62598feaab23a570cc2d5145
class MetricDescription(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.metric_name = None <NEW_LINE> self.description = None <NEW_LINE> self.extra_fields = None <NEW_LINE> self.unit = None <NEW_LINE> self.cumulative = False <NEW_LINE> self.category = None
Simple object to hold fields describing a monitor's metric.
62598feb187af65679d29fd0
class KeystoneToken(Authenticator): <NEW_LINE> <INDENT> def __init__(self, app, url=None): <NEW_LINE> <INDENT> super(KeystoneToken, self).__init__(app) <NEW_LINE> self.url = url <NEW_LINE> <DEDENT> def authenticate(self, environ, start_response): <NEW_LINE> <INDENT> token = environ.get('HTTP_X_AUTH_TOKEN') <NEW_LINE> i...
Auth implementation using token method against OpenStack Keystone
62598febab23a570cc2d5146
class Invalid(Exception): <NEW_LINE> <INDENT> max_err = 1 <NEW_LINE> err_count = 0 <NEW_LINE> def __init__(self, err_code, *args): <NEW_LINE> <INDENT> super(Invalid, self).__init__(err_code) <NEW_LINE> err_msg = err_dict[err_code].format(*args) <NEW_LINE> err_msg = err_msg.replace("{", "{{").replace("}", "}}") <NEW_LIN...
Exception that triggers upon invalid data.
62598feb26238365f5fad316
class TestUserCreationForm: <NEW_LINE> <INDENT> def test_clean_username(self) -> None: <NEW_LINE> <INDENT> proto_user = UserFactory.build() <NEW_LINE> form = UserCreationForm( { "username": proto_user.username, "password1": proto_user._password, "password2": proto_user._password, } ) <NEW_LINE> assert form.is_valid() <...
Test the user creation form.
62598febab23a570cc2d5147
class ListContainerPost(ContainerPost): <NEW_LINE> <INDENT> def __init__( self, name: str, tags: Optional[str] = None, description: Optional[str] = None, extra_fields: Optional[Sequence] = [], can_store_containers: bool = True, can_store_samples: bool = True, location: TargetLocation = TopLevelTargetLocation(), ): <NEW...
Define a new ListContainer to create
62598feb4c3428357761aa62
class Config(CacheConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = False <NEW_LINE> SECRET_KEY = "i_don't_want_my_cookies_expiring_while_developing" <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'sqlite:////tmp/blacklist.db' <NEW_LINE> REDIS_URL = 'redis://127.0.0.1/0' <NEW_LINE> CELERY_BROKER_URL = 'redis://127.0...
Default Flask configuration inherited by all environments. Use this for development environments.
62598feb187af65679d29fd2
class ConstrainedGameObject(GameObject): <NEW_LINE> <INDENT> def __init__(self, command_queue): <NEW_LINE> <INDENT> self.is_configured = False <NEW_LINE> self.is_started = False <NEW_LINE> self.is_solved = False <NEW_LINE> self.is_static = False <NEW_LINE> self.command_queue = command_queue <NEW_LINE> GameObject.__init...
A ConstrainedGameObject has a set of constraints that it tries to solve by examining neighbouring objects. States: (Non-Existent) Initialised, Accept subscribe requests but do not call neighbours. Can be "configured" (especially with neighbours) in this period Started, All neighbou...
62598febc4546d3d9def7661
class SensorComponent: <NEW_LINE> <INDENT> def __init__(self, name, sensor,range,length=1000): <NEW_LINE> <INDENT> self.plot_widget = pg.PlotWidget( axisItems={'bottom': TimeAxisItem(orientation='bottom')}) <NEW_LINE> self.pw = self.plot_widget <NEW_LINE> self.pw.addLegend() <NEW_LINE> self.x = ComponentAxis('x', self....
Refers to an individual graph: ie the representation of the accelerometer, gyroscope, magnetometer or other component of a sensor.
62598feb4c3428357761aa63
class LoanInterestRate(InterestRateFee): <NEW_LINE> <INDENT> swagger_types = { 'applications': 'list[ApplicationRate]', 'minimum_rate': 'str', 'maximum_rate': 'str' } <NEW_LINE> if hasattr(InterestRateFee, "swagger_types"): <NEW_LINE> <INDENT> swagger_types.update(InterestRateFee.swagger_types) <NEW_LINE> <DEDENT> attr...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598febad47b63b2c5a800c
class IndexColumnSchema(schema.InformationSchema): <NEW_LINE> <INDENT> __table__ = 'information_schema.index_columns' <NEW_LINE> table_catalog = typing.cast(str, field.Field(field.String, primary_key=True)) <NEW_LINE> table_schema = typing.cast(str, field.Field(field.String, primary_key=True)) <NEW_LINE> table_name = t...
Model for interacting with Spanner index column schema table.
62598feb4c3428357761aa67
class frame_type(enum.IntEnum): <NEW_LINE> <INDENT> DATA = 0 <NEW_LINE> HEADERS = 0x01 <NEW_LINE> PRIORITY = 0x02 <NEW_LINE> RST_STREAM = 0x03 <NEW_LINE> SETTINGS = 0x04 <NEW_LINE> PUSH_PROMISE = 0x05 <NEW_LINE> PING = 0x06 <NEW_LINE> GOAWAY = 0x07 <NEW_LINE> WINDOW_UPDATE = 0x08 <NEW_LINE> CONTINUATION = 0x09 <NEW_LIN...
The frame types in HTTP/2 specification.
62598febc4546d3d9def7665
class MFT_INDEX_ENTRY_HEADER(INDEX_ENTRY_HEADER): <NEW_LINE> <INDENT> def __init__(self, buf, offset, parent): <NEW_LINE> <INDENT> super(MFT_INDEX_ENTRY_HEADER, self).__init__(buf, offset, parent) <NEW_LINE> self.declare_field("qword", "mft_reference", 0x0)
Index used by the MFT for INDX attributes.
62598febc4546d3d9def7669
class ReferenceDelegate(object): <NEW_LINE> <INDENT> def __init__(self, name, dataType, plural): <NEW_LINE> <INDENT> self.name = name + "_BackReference" <NEW_LINE> self.dataType = dataType <NEW_LINE> self.plural = plural <NEW_LINE> self.values = None <NEW_LINE> self.maxOccurs = 9999 <NEW_LINE> self.minOccurs = 0 <NEW_L...
A "virtual" property delegate to be used with "reference" OMEModelProperty instances. This delegate conforms loosely to the same interface as a delegate coming from generateDS (ie. an "attribute" or an "element").
62598feb4c3428357761aa71
class ConditionsTest(cros_test_lib.MockTestCase): <NEW_LINE> <INDENT> def testConditionsMet(self): <NEW_LINE> <INDENT> stat = stats.Stats( username='chrome-bot@chromium.org', host='build42-m2.golo.chromium.org') <NEW_LINE> self.assertTrue(stats.StatsUploader._UploadConditionsMet(stat)) <NEW_LINE> <DEDENT> def testCondi...
Test UploadConditionsMet.
62598feb4c3428357761aa75
class TestUserInputs(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> logging.basicConfig(level=logging.FATAL) <NEW_LINE> self.tmp_dir = tempfile.mkdtemp() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> shutil.rmtree(self.tmp_dir) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def...
Unit test suite for invalid user inputs
62598feb3cc13d1c6d465f1f
class SysPathAwareMixin(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(SysPathAwareMixin, self).setUp() <NEW_LINE> setup_with_context_manager(self, saved_sys_path())
A test case mixin that isolates changes to sys.path.
62598feb26238365f5fad32b
class SquaredGroupHonesty(GroupHonesty): <NEW_LINE> <INDENT> def measure_one(self, signaller): <NEW_LINE> <INDENT> r = signaller.do_signal(self.signal) <NEW_LINE> signaller.signal_log.pop() <NEW_LINE> signaller.rounds -= 1 <NEW_LINE> signaller.signal_matches[r] -= 1 <NEW_LINE> try: <NEW_LINE> <INDENT> signaller.signal_...
Return the average squared distance of everybody's choice of signal if they were to signal right now, from their own type.
62598feb091ae356687053e8
class casting_operator_t(member_calldef_t, operator_t): <NEW_LINE> <INDENT> def __init__(self, *args, **keywords): <NEW_LINE> <INDENT> member_calldef_t.__init__(self, *args, **keywords) <NEW_LINE> operator_t.__init__(self, *args, **keywords)
describes casting operator declaration
62598feb627d3e7fe0e07672
class GoProblem19(base_go_problem.GoProblem): <NEW_LINE> <INDENT> @property <NEW_LINE> def board_size(self): <NEW_LINE> <INDENT> return 19 <NEW_LINE> <DEDENT> def dataset_filename(self): <NEW_LINE> <INDENT> fn = "go_problem_19" <NEW_LINE> if self.use_kgs_data and self.use_gogod_data: <NEW_LINE> <INDENT> fn += "_multi" ...
Go Problem for 19x19 go games.
62598feb3cc13d1c6d465f25
class OpNZTsetcolletionorigin(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.nzt_setcollectionorigin" <NEW_LINE> bl_label = "set collection origin" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> if bpy.context.selected_objects==[]: <NEW_LINE> <INDENT> bpy.context.object.users_collection[0].ins...
set active object's collection offset to location of object pivot
62598febad47b63b2c5a8022
class GHSLUrban(GlobalImageDatasource): <NEW_LINE> <INDENT> def build_img_coll(self, year=None, separate=False, use_closest_image=False): <NEW_LINE> <INDENT> if year is not None: <NEW_LINE> <INDENT> if not isinstance(year, int): <NEW_LINE> <INDENT> raise ValueError('Expected year to be integral. Got: {}'.format(type(y...
Image Properties SMOD Degree of urbanization (See table below). Value Color Description 0 000000 Inhabited areas 1 448564 RUR (rural grid cells) 2 70daa4 LDC (low density clusters) 3 ffffff HDC (high density clusters) If separate is set to True, the resu...
62598feb4c3428357761aa7e
class Game(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> args = parser.parse_args() <NEW_LINE> if 'board_id' not in args or 'bitboard' not in args: <NEW_LINE> <INDENT> return {'message': 'Required POST fields missing'} <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> board_id = int(args['board_id']) <N...
You can also post a new boards state after a move has been completed. :return: JSON representing the boards state for each players
62598feb627d3e7fe0e07678
class AudioList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> model_obj = models.MediaFileUpload.objects.filter(is_label=False) <NEW_LINE> serializer = serializers.MediaFileUploadSerializer(model_obj, many=True) <NEW_LINE> data_dict={} <NEW_LINE> for i in serializer.data[0]: <NE...
List all snippets, or create a new snippet.
62598fec3cc13d1c6d465f27
class ProjectCommand(ObjectCommand): <NEW_LINE> <INDENT> def get_object(self, blank: bool = False): <NEW_LINE> <INDENT> obj = super().get_object(blank=blank) <NEW_LINE> if not isinstance(obj, wlc.Project): <NEW_LINE> <INDENT> raise CommandError("Not supported") <NEW_LINE> <DEDENT> return obj <NEW_LINE> <DEDENT> def run...
Wrapper to allow only project objects.
62598fecad47b63b2c5a8024
class LecturerAdmin(utils.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( 'id', 'human', ) <NEW_LINE> search_fields = ( 'id', 'human__first_name', 'human__last_name', 'human__old_last_name', ) <NEW_LINE> inlines = ( LecturerParticipationInlineAdmin, )
Administration for lecturer.
62598fec4c3428357761aa82
class MicroscanConfiguration: <NEW_LINE> <INDENT> _K_CODE_PATTERN = re.compile(b'<(K\d+)(.*)>') <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.load_defaults() <NEW_LINE> <DEDENT> def load_defaults(self): <NEW_LINE> <INDENT> for k_code, serializer in REGISTRY.items(): <NEW_LINE> <INDENT> prop_name = self._clsna...
Container for configuration settings for a barcode reader device Calling the constructor will initialize a configuration object with all available configuration settings, each set to the default value as specified by the device documentation. Use MicroscanConfiguration.from_config_strings() to create a configuration ...
62598fec627d3e7fe0e0767c
class C_spectrum_CAM_RGB(C_spectrum_CAM): <NEW_LINE> <INDENT> mdict_updateRule = { 'R' : {'direction' : [ 'G', 'R' ], 'amount' : 9}, 'G' : {'direction' : [ 'B', 'G' ], 'amount' : 9}, 'B' : {'direction' : [ 'R', 'B' ], 'amount' : 9} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.mstr_obj ...
The Cellular Automata Machine (CAM) RGB class, subclassed from a C_spectrum(_CAM) object.
62598fec26238365f5fad338
class ArLog: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, ArLog, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, ArLog, name) <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> StdOut = _Aria...
Proxy of C++ ArLog class
62598fecad47b63b2c5a8027
@bacpypes_debugging <NEW_LINE> class String(_Struct): <NEW_LINE> <INDENT> def __init__(self, registerLength=6): <NEW_LINE> <INDENT> if _debug: String._debug("__init__ %r", registerLength) <NEW_LINE> self.registerLength = registerLength <NEW_LINE> <DEDENT> def pack(self, value): <NEW_LINE> <INDENT> if _debug: String._de...
This class packs and unpacks a list of registers as a null terminated string.
62598fec091ae356687053f4
class PythonParser(BaseParser): <NEW_LINE> <INDENT> def __init__(self, socket_read_size): <NEW_LINE> <INDENT> self.socket_read_size = socket_read_size <NEW_LINE> self.encoder = None <NEW_LINE> self._sock = None <NEW_LINE> self._buffer = None <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <IN...
Plain Python parsing class
62598fecc4546d3d9def7672
class Negation: <NEW_LINE> <INDENT> __metaclass__ = SlotExpressionFunctor <NEW_LINE> def __init__(self, *lPredicats): <NEW_LINE> <INDENT> self.__lPredicats = lPredicats <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> return negation(*self.__lPredicats)
![] bnf primitive as a functor
62598fec4c3428357761aa84
@override_settings(MODULESTORE=TEST_DATA_MIXED_MODULESTORE) <NEW_LINE> class SplitTestBase(ModuleStoreTestCase): <NEW_LINE> <INDENT> __test__ = False <NEW_LINE> COURSE_NUMBER = 'split-test-base' <NEW_LINE> ICON_CLASSES = None <NEW_LINE> TOOLTIPS = None <NEW_LINE> HIDDEN_CONTENT = None <NEW_LINE> VISIBLE_CONTENT = None ...
Sets up a basic course and user for split test testing. Also provides tests of rendered HTML for two user_tag conditions, 0 and 1.
62598fec627d3e7fe0e0767e
class About(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> template_values = make_template_values(self.request) <NEW_LINE> template_values['page_title'] = '{} - {}'.format( DEFAULT_PAGE_TITLE, 'About') <NEW_LINE> template = JINJA_ENVIRONMENT.get_template('about.html') <NEW_LINE> self.re...
About page handler.
62598fec3cc13d1c6d465f2c
class EnzymeComparison(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 test_basic_isochizomers(self): <NEW_LINE> <INDENT> assert Acc65I.isoschizomers() == [Asp718I, KpnI] <NEW_LINE> assert Acc65I.e...
Tests for comparing various enzymes.
62598fecad47b63b2c5a8029
class Slot: <NEW_LINE> <INDENT> def __init__(self, concurrency, delay, randomize_delay): <NEW_LINE> <INDENT> self.concurrency = concurrency <NEW_LINE> self.delay = delay <NEW_LINE> self.randomize_delay = randomize_delay <NEW_LINE> self.active = set() <NEW_LINE> self.queue = deque() <NEW_LINE> self.transferring = set() ...
Downloader slot
62598fecab23a570cc2d5159
class RegionSummaryOverviewItem(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RegionId = None <NEW_LINE> self.RegionName = None <NEW_LINE> self.RealTotalCost = None <NEW_LINE> self.RealTotalCostRatio = None <NEW_LINE> self.CashPayAmount = None <NEW_LINE> self.IncentivePayAmount = None...
按地域汇总消费详情
62598fec3cc13d1c6d465f2e
class AlphaEqResult: <NEW_LINE> <INDENT> def __init__(self, res, sub=None): <NEW_LINE> <INDENT> self.res = res <NEW_LINE> self.sub = sub <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> if index < 0 or index > 1: <NEW_LINE> <INDENT> raise IndexError('index {} is out of bounds'.format(index)) <NEW_L...
Much like a ``namedtuple``, but with better booleanness.
62598fec26238365f5fad33e
class ProjectDeleteViewTestCase(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> UserModel.objects.create_user(username='Tester', password='test_password') <NEW_LINE> for _ in range(3): <NEW_LINE> <INDENT> ProjectFactory() <NEW_LINE> <DEDENT> <DEDENT> def setUp(self): <...
Testing the project delete view.
62598fec627d3e7fe0e07684
class HasVarianceCol(Params): <NEW_LINE> <INDENT> varianceCol = Param(Params._dummy(), "varianceCol", "column name for the biased sample variance of prediction.", typeConverter=TypeConverters.toString) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(HasVarianceCol, self).__init__() <NEW_LINE> <DEDENT> def setV...
Mixin for param varianceCol: column name for the biased sample variance of prediction.
62598fec3cc13d1c6d465f32
class PyscesSMTP: <NEW_LINE> <INDENT> __smtp_active = 0 <NEW_LINE> def __init__(self, fromadd, server): <NEW_LINE> <INDENT> self.server = server <NEW_LINE> try: <NEW_LINE> <INDENT> self.userstr = getuser() <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.userstr = 'PySCeS ' <NEW_LINE> <DEDENT> self.msgintro = '' <N...
A purely experimental class that extends PySCeS with SMTP mailer capabilities. Initialise with sender address and local mail server name.
62598fec26238365f5fad340
class AlphaSenderList(ListResource): <NEW_LINE> <INDENT> def __init__(self, version, service_sid): <NEW_LINE> <INDENT> super(AlphaSenderList, self).__init__(version) <NEW_LINE> self._solution = { 'service_sid': service_sid, } <NEW_LINE> self._uri = '/Services/{service_sid}/AlphaSenders'.format(**self._solution) <NEW_LI...
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
62598fecad47b63b2c5a802f
class NestedDict(dict): <NEW_LINE> <INDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if key in self: <NEW_LINE> <INDENT> return self.get(key) <NEW_LINE> <DEDENT> return self.setdefault(key, NestedDict()) <NEW_LINE> <DEDENT> def to_dict(self): <NEW_LINE> <INDENT> new_dict = {} <NEW_LINE> for key, val in self.item...
This helps with accessing a heavily nested dictionary. Access to keys which don't exist will result in a new, empty dictionary
62598fecab23a570cc2d515c
class PyTautulliApiResponse(PyTautulliApiBaseModel): <NEW_LINE> <INDENT> data: dict[str, Any] | list[ dict[str, Any] ] | PyTautulliApiActivity | PyTautulliApiSession | list[ PyTautulliApiUser ] | None = None <NEW_LINE> message: str | None = None <NEW_LINE> result: APIResult | None = None <NEW_LINE> def _generate_data(s...
API response model for PyTautulli Api.
62598fec4c3428357761aa8e
class Meta: <NEW_LINE> <INDENT> ordering = ("platform", "name") <NEW_LINE> unique_together = ("name", "platform")
Meta information for ConfigRemove model.
62598fec26238365f5fad343
class TFServingServer(object): <NEW_LINE> <INDENT> def __init__(self, port, model_name, model_path, per_process_gpu_memory_fraction=0.0): <NEW_LINE> <INDENT> self.port = port <NEW_LINE> self.server = None <NEW_LINE> self.running = False <NEW_LINE> self.model_path = model_path <NEW_LINE> self.model_name = model_name <NE...
Manage TF Serving Server for inference. This object will manage turning on/off server
62598fec187af65679d29fe9
class ModelCreateObject(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ModelCreateObject, self).__init__(**kwargs) <NEW_LINE> self.name = kwargs.get('name', None)
Object model for creating a new entity extractor. :param name: Name of the new entity extractor. :type name: str
62598fec4c3428357761aa90
class OpenkimModels(CMakePackage): <NEW_LINE> <INDENT> homepage = "https://openkim.org/" <NEW_LINE> url = "https://s3.openkim.org/archives/collection/openkim-models-2021-01-28.txz" <NEW_LINE> maintainers = ['ellio167'] <NEW_LINE> extends('kim-api') <NEW_LINE> depends_on('kim-api@2.2.1:', when='@2021-01-28:') <NEW_...
OpenKIM is an online framework for making molecular simulations reliable, reproducible, and portable. Computer implementations of inter-atomic models are archived in OpenKIM, verified for coding integrity, and tested by computing their predictions for a variety of material properties. Models conforming to the KIM appl...
62598fecab23a570cc2d515f
class GetElementByStyle(FilterBase): <NEW_LINE> <INDENT> __kind__ = 'element-by-style' <NEW_LINE> __supported_subfilters__ = { 'style': 'HTML style attribute value to filter for (required)', } <NEW_LINE> __default_subfilter__ = 'style' <NEW_LINE> def filter(self, data, subfilter): <NEW_LINE> <INDENT> if 'style' not in ...
Get all HTML elements by style
62598fec3cc13d1c6d465f3a
class Convert(object): <NEW_LINE> <INDENT> PATTERN = re.compile(r'inputfile([0-9]+)\.png') <NEW_LINE> def __init__(self, pdf_path): <NEW_LINE> <INDENT> filename = os.path.basename(pdf_path) <NEW_LINE> LOGGER.info('PDF filename=%s' % filename) <NEW_LINE> cache_directory = 'cache/%s' % (filename[:-4]) <NEW_LINE> if not o...
Converts PDF to PNGs, one PNG per page. Cached in a directory called 'cache'.
62598fec26238365f5fad347
class DigitalCartes(Digital): <NEW_LINE> <INDENT> def __init__(self, left, right): <NEW_LINE> <INDENT> self.left = left <NEW_LINE> self.right = right <NEW_LINE> <DEDENT> def base(self): <NEW_LINE> <INDENT> return self.left.base() * self.right.base() <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> ri...
A digital place with dynamic cartesian multiplication of digits. >>> dsq = DigitalCartes(Digital('01234'), Digital('abcdef')) >>> dsq.base() 30 >>> dsq[0] ['0', 'a'] >>> dsq[29] ['4', 'f'] >>> dsq[31] ... #doctest: +IGNORE_EXCEPTION_DETAIL Traceback (most recent call last): ... IndexError:
62598fecab23a570cc2d5160
class ExperienceViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = ExperienceSerializer <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Experience.objects.filter(person__id=self.request.user.id).all() <NEW_LINE> <DEDENT> def create(sel...
Experience CRUD operations.
62598fec26238365f5fad349
class delete_follow_result(object): <NEW_LINE> <INDENT> def __init__(self, e1=None, e2=None,): <NEW_LINE> <INDENT> self.e1 = e1 <NEW_LINE> self.e2 = e2 <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thr...
Attributes: - e1 - e2
62598fec627d3e7fe0e07692
class Masking(MaskedLayer): <NEW_LINE> <INDENT> def __init__(self, mask_value=0., **kwargs): <NEW_LINE> <INDENT> super(Masking, self).__init__(**kwargs) <NEW_LINE> self.mask_value = mask_value <NEW_LINE> self.input = T.tensor3() <NEW_LINE> <DEDENT> def get_output_mask(self, train=False): <NEW_LINE> <INDENT> X = self.ge...
Mask an input sequence by using a mask value to identify padding. This layer copies the input to the output layer with identified padding replaced with 0s and creates an output mask in the process. At each timestep, if the values all equal `mask_value`, then the corresponding mask value for the timestep is 0 (skipped...
62598fecad47b63b2c5a803d
class ProfileTestCase(ModoTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> super(ProfileTestCase, cls).setUpTestData() <NEW_LINE> cls.account = factories.UserFactory( username="user@test.com", groups=('SimpleUsers',) ) <NEW_LINE> <DEDENT> def test_update_password(self):...
Profile related tests.
62598fec3cc13d1c6d465f40
class SELoginEntry(SuccessEntry): <NEW_LINE> <INDENT> selinuxuser = models.CharField(max_length=128) <NEW_LINE> current_selinuxuser = models.CharField(max_length=128, null=True) <NEW_LINE> ENTRY_TYPE = r"SELogin"
SELinux login
62598fec26238365f5fad34f
class VMImageHtmlParser(HTMLParser): <NEW_LINE> <INDENT> def __init__(self, pattern): <NEW_LINE> <INDENT> HTMLParser.__init__(self) <NEW_LINE> self.items = [] <NEW_LINE> self.pattern = pattern <NEW_LINE> <DEDENT> def handle_starttag(self, tag, attrs): <NEW_LINE> <INDENT> if tag != 'a': <NEW_LINE> <INDENT> return <NEW_L...
Custom HTML parser to extract the href items that match a given pattern
62598fecc4546d3d9def767e
class W_PromotableClosure(W_Procedure): <NEW_LINE> <INDENT> _attrs_ = _immutable_fields_ = ["closure", "arity"] <NEW_LINE> def __init__(self, caselam, toplevel_env): <NEW_LINE> <INDENT> envs = [toplevel_env] * len(caselam.lams) <NEW_LINE> self.closure = W_Closure._make(envs, caselam, toplevel_env) <NEW_LINE> self.arity...
A W_Closure that is promotable, ie that is cached in some place and unlikely to change.
62598fecab23a570cc2d5164
class Account: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = 0 <NEW_LINE> self.type = AccountType.INVALID <NEW_LINE> self.state = AccountState.INVALID <NEW_LINE> self.subtype = "" <NEW_LINE> <DEDENT> def print_object(self, format_data=""): <NEW_LINE> <INDENT> from huobi.utils.print_mix_object im...
The account information for spot account, margin account etc. :member id: The unique account id. account_type: The type of this account, possible value: spot, margin, otc, point. account_state: The account state, possible value: working, lock. balances: The balance list of the specified currency. The c...
62598fecad47b63b2c5a8041
class ArrayBackend(_BackendBase): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def process(self, query): <NEW_LINE> <INDENT> response = super(ArrayBackend, self).process(query) <NEW_LINE> data = list(self.data) <NEW_LINE> response['iTotalRecords'] = len(data) <N...
Array backend to data tables Stores all data in a plain python list. All filtering is handled in the running process. It is suitable for very small data sets only but has the advantage of being unrelated to any databases.
62598fecab23a570cc2d5165
class EnvironmentGroupsListView(TemplateView): <NEW_LINE> <INDENT> template_name = "environment/groups.html" <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> if "name" in self.request.GET: <NEW_LINE> <INDENT> env_groups = TCMSEnvGroup.objects.f...
The environment groups index page
62598fec627d3e7fe0e07698
class FreePCBfile (object): <NEW_LINE> <INDENT> def __init__ (self, f): <NEW_LINE> <INDENT> self.File = [i.rstrip () for i in f.readlines ()] <NEW_LINE> self.File.reverse () <NEW_LINE> self.Lineno = 1 <NEW_LINE> <DEDENT> def get_string (self, allow_blank): <NEW_LINE> <INDENT> while self.File and not self.File[-1].strip...
This just wraps a FreePCB text file, reading it out in pieces.
62598fed627d3e7fe0e0769c
class SampleInput(unittest.TestCase): <NEW_LINE> <INDENT> def test_sample_input(self): <NEW_LINE> <INDENT> inputs = [] <NEW_LINE> inputs.append('dog ogday') <NEW_LINE> inputs.append('cat atcay') <NEW_LINE> inputs.append('pig igpay') <NEW_LINE> inputs.append('froot ootfray') <NEW_LINE> inputs.append('loops oopslay') <NE...
Problem statement sample inputs and outputs
62598fed627d3e7fe0e0769e
class Tag(View): <NEW_LINE> <INDENT> def init(self, conf, env, template='main.html', items_per_page=10, pagination='/tag/:name/:num/'): <NEW_LINE> <INDENT> self.template = template <NEW_LINE> self.items_per_page = items_per_page <NEW_LINE> self.pagination = pagination <NEW_LINE> self.filters.append('relative') <NEW_LIN...
Same behaviour like Index except ``route`` that defaults to */tag/:name/* and ``pagination`` that defaults to */tag/:name/:num/* where :name is the current tag identifier. To create a tag cloud head over to :doc:`conf.py`.
62598fed091ae35668705415
class NeighbourScheduler(NearestTransferCPUSelector, NoAdvanceTransmissionScheduler, BaseScheduler): <NEW_LINE> <INDENT> pass
Schedules DAG by neighbour appointment (no advance transmits)
62598fed091ae35668705417
class JEvent(object): <NEW_LINE> <INDENT> def __init__(self, evt_type, number, value): <NEW_LINE> <INDENT> self.type = evt_type <NEW_LINE> self.number = number <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "JEvent(type={}, number={}, value={})".format( self.type, self....
Joystick event class. Encapsulate single joystick event.
62598fed4c3428357761aaa8
class Bug35CModel(models.Model): <NEW_LINE> <INDENT> age = models.PositiveIntegerField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True
Ensure that multiple Postive Integer columns across tables don't create duplicate constraint names when using inheritence. The test for Bug35 is just the creation of the tables; there are no other explicit tests.
62598fed26238365f5fad35d
class LayerNorm(nn.Module): <NEW_LINE> <INDENT> def __init__( self, input_size=None, input_shape=None, eps=1e-05, elementwise_affine=True, ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.eps = eps <NEW_LINE> self.elementwise_affine = elementwise_affine <NEW_LINE> if input_shape is not None: <NEW_LINE> <INDENT...
Applies layer normalization to the input tensor. Arguments --------- input_shape : tuple The expected shape of the input. eps : float This value is added to std deviation estimation to improve the numerical stability. elementwise_affine : bool If True, this module has learnable per-element affine parame...
62598fedc4546d3d9def7685
class Actor: <NEW_LINE> <INDENT> x: int <NEW_LINE> y: int <NEW_LINE> _is_stop: bool <NEW_LINE> _is_push: bool <NEW_LINE> image: pygame.Surface <NEW_LINE> def __init__(self, x: int, y: int) -> None: <NEW_LINE> <INDENT> self.x, self.y = x, y <NEW_LINE> self._is_stop = False <NEW_LINE> self._is_push = False <NEW_LINE> sel...
A class that represents all the actors in the game. This class includes any attributes/methods that are common between the actors === Public Attributes === x: x coordinate of this actor's location on the stage y: y coordinate of this actor's location on the stage image: the image of the actor === Private ...
62598fedc4546d3d9def7686
class PIR(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, pirpin, nomovementforseconds): <NEW_LINE> <INDENT> self.__pin = pirpin <NEW_LINE> self.__delay = nomovementforseconds <NEW_LINE> GPIO.setup(self.__pin, GPIO.IN) <NEW_LINE> self.__hasbeenmovement = True <NEW_LINE> super(PIR, self).__init__() <NEW_LINE> ...
Detects whether there has been movement around the clock, and turns the matrix off if there has not been any
62598fed091ae3566870541d
class Tags(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=64)
Text tags used only with KModel instances
62598fed187af65679d29ff9
class GoogleVisionAPISafeSearchExtractor(GoogleVisionAPIExtractor): <NEW_LINE> <INDENT> request_type = 'SAFE_SEARCH_DETECTION' <NEW_LINE> response_object = 'safeSearchAnnotation' <NEW_LINE> def _parse_annotations(self, annotation): <NEW_LINE> <INDENT> return annotation.keys(), annotation.values()
Extracts safe search detection using the Google Cloud Vision API.
62598fed3cc13d1c6d465f56
class CustomStorageBase(ICustomStorage): <NEW_LINE> <INDENT> def registerCallbacks(self, properties): <NEW_LINE> <INDENT> callbacks = CustomStorageCallbacks( ctypes.c_void_p(), self.create, self.destroy, self.flush, self.loadByteArray, self.storeByteArray, self.deleteByteArray) <NEW_LINE> properties.custom_storage_call...
Derive from this class to create your own storage manager with access to the raw C buffers.
62598fedc4546d3d9def7688
class TwoByteChunk( object ): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.otherParameters = [ 0, 0] <NEW_LINE> <DEDENT> def serialize(self, outputStream): <NEW_LINE> <INDENT> for idx in range(0, 2): <NEW_LINE> <INDENT> outputStream.write_byte( self.otherParameters[ idx ] ); <NEW_LINE> <DEDENT> <DE...
16 bit piece of data
62598fed3cc13d1c6d465f58
class HealthcareProjectsLocationsDatasetsOperationsListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> name = _messages.StringField(2, required=True) <NEW_LINE> pageSize = _messages.IntegerField(3, variant=_messages.Variant.INT32) <NEW_LINE> pageToken = _messages.StringField...
A HealthcareProjectsLocationsDatasetsOperationsListRequest object. Fields: filter: The standard list filter. name: The name of the operation's parent resource. pageSize: The standard list page size. pageToken: The standard list page token.
62598fed3cc13d1c6d465f5a
class add_measure_group_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'str_addr', None, None, ), (2, TType.I32, 'interval', None, None, ), ) <NEW_LINE> def __init__(self, str_addr=None, interval=None,): <NEW_LINE> <INDENT> self.str_addr = str_addr <NEW_LINE> self.interval = interval <NEW_LINE> <DEDE...
Attributes: - str_addr - interval
62598fed4c3428357761aab4
class PCFG(CFG): <NEW_LINE> <INDENT> EPSILON = 0.01 <NEW_LINE> def __init__(self, start, productions, calculate_leftcorners=True): <NEW_LINE> <INDENT> CFG.__init__(self, start, productions, calculate_leftcorners) <NEW_LINE> probs = {} <NEW_LINE> for production in productions: <NEW_LINE> <INDENT> probs[production.lhs()]...
A probabilistic context-free grammar. A PCFG consists of a start state and a set of productions with probabilities. The set of terminals and nonterminals is implicitly specified by the productions. PCFG productions use the ``ProbabilisticProduction`` class. ``PCFGs`` impose the constraint that the set of productions ...
62598fed187af65679d29ffd
class JsAPIOrderPay(UnifiedOrderPay): <NEW_LINE> <INDENT> def __init__(self, wechat_config): <NEW_LINE> <INDENT> super(JsAPIOrderPay, self).__init__(wechat_config) <NEW_LINE> self.trade_type = 'JSAPI' <NEW_LINE> <DEDENT> def post(self, body, out_trade_no, total_fee, spbill_create_ip, notify_url, open_id, url): <NEW_LIN...
H5页面的js调用类
62598fedad47b63b2c5a805d
class Describe_SortRowsByDerivedColumnHelper: <NEW_LINE> <INDENT> def it_derives_the_sort_column_idx_from_the_order_spec_to_help( self, _columns_dimension_prop_, dimension_, _order_spec_prop_, order_spec_ ): <NEW_LINE> <INDENT> _columns_dimension_prop_.return_value = dimension_ <NEW_LINE> dimension_.element_ids = (1, 2...
Unit test suite for `cr.cube.matrix.assembler._SortRowsByDerivedColumnHelper`.
62598fedc4546d3d9def768d
class ProfileSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> owner = serializers.ReadOnlyField(source='owner.username') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Profile <NEW_LINE> fields = ('owner', 'first_name', 'last_name', 'email', 'date_created', 'date_modified' ) <NEW_LINE> read_only_field...
Serializer to map the Model instance into JSON format.
62598fed4c3428357761aaba
class TestFilename(unittest.TestCase): <NEW_LINE> <INDENT> def test_ordinary(self): <NEW_LINE> <INDENT> date = datetime(2016, 11, 12) <NEW_LINE> seq = 36 <NEW_LINE> name = star_barcode.barcode_filename(date, seq) <NEW_LINE> self.assertEqual( name, 'Barcode_2016-W45-6_36.pdf' ) <NEW_LINE> <DEDENT> def test_wrong_sequenc...
Test barcode_filename function for naming barcode barcode_filename should take a datetime object and an int, representing the sequence number of the edition, and produce a string as so: Barcode_%G-W%V-%u_SS.pdf Where %G is the ISO year number, %V the ISO week number, and %u the ISO weekday number. SS is the sequen...
62598fed187af65679d2a000
class Review(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name='review author', related_name='review_author') <NEW_LINE> thesis = models.ForeignKey(Thesis, on_delete=models.CASCADE, verbose_name='reviewed thesis', related_name='reviewed_thesis') <NEW_LINE> @prope...
Review class represents the Review table in the database. It contains following attributes: author, thesis, finished, finished_date which can be used to access database regardless of the language it uses Methods: deadline(), get_file_path(filename), __str__(), get_review_name()
62598fed627d3e7fe0e076b6
class Insert(StandardInsert): <NEW_LINE> <INDENT> stringify_dialect = "mysql" <NEW_LINE> inherit_cache = False <NEW_LINE> @property <NEW_LINE> def inserted(self): <NEW_LINE> <INDENT> return self.inserted_alias.columns <NEW_LINE> <DEDENT> @util.memoized_property <NEW_LINE> def inserted_alias(self): <NEW_LINE> <INDENT> r...
MySQL-specific implementation of INSERT. Adds methods for MySQL-specific syntaxes such as ON DUPLICATE KEY UPDATE. The :class:`~.mysql.Insert` object is created using the :func:`sqlalchemy.dialects.mysql.insert` function. .. versionadded:: 1.2
62598fedc4546d3d9def768f