code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Echo(object): <NEW_LINE> <INDENT> def write(self, value): <NEW_LINE> <INDENT> return value
An object that implements just the write method of the file-like interface.
62598ee42c8b7c6e89bd1e0b
class RoleAssignmentsGet(APISharingGet): <NEW_LINE> <INDENT> implements(IPublishTraverse) <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> super(RoleAssignmentsGet, self).__init__(context, request) <NEW_LINE> self.params = [] <NEW_LINE> <DEDENT> def publishTraverse(self, request, name): <NEW_LINE> <...
API Endpoint which returns a list of all role assignments of the current context for a particular user. Sharing assignments are skipped. GET /@role-assignments/principal_id HTTP/1.1
62598ee43539df3088eca8fe
class Character: <NEW_LINE> <INDENT> bad_guy_names = ["Soundwave", "Megatron", "Starscream", "Buzzsaw", "Ravage", "Barricade", "Blackout", "Fracture", "Skipjack"] <NEW_LINE> def __init__(self, char_name): <NEW_LINE> <INDENT> if char_name is None: <NEW_LINE> <INDENT> selection = randrange(0, len(Character.bad_guy_names)...
The base class for any character used in the game
62598ee4be8e80087fbbd699
class IndexerOverview(object): <NEW_LINE> <INDENT> def __init__(self, indexer_cluster=None, counts=None, indices=None, deflector=None): <NEW_LINE> <INDENT> self.swagger_types = { 'indexer_cluster': 'object', 'counts': 'object', 'indices': 'object', 'deflector': 'object' } <NEW_LINE> self.attribute_map = { 'indexer_clus...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee491f36d47f22301c9
class ExtendedI2C(I2C): <NEW_LINE> <INDENT> def __init__(self, bus_id, frequency=400000): <NEW_LINE> <INDENT> self.init(bus_id, frequency) <NEW_LINE> <DEDENT> def init(self, bus_id, frequency): <NEW_LINE> <INDENT> self.deinit() <NEW_LINE> if not path.exists(f"/dev/i2c-{bus_id}"): <NEW_LINE> <INDENT> raise ValueError(f"...
Extended I2C is a busio extension that allows creating a compatible I2C object using the Bus ID number. The bus ID is the number at the end of /dev/i2c-# and you can find which I2C devices you have by typing ``ls /dev/i2c*``
62598ee45fdd1c0f98e5c5fb
class CustomImagesPipeline(ImagesPipeline): <NEW_LINE> <INDENT> def get_media_requests(self, item, info): <NEW_LINE> <INDENT> for img_url in item["img_urls"]: <NEW_LINE> <INDENT> yield scrapy.Request(img_url, meta={"item": item}) <NEW_LINE> <DEDENT> <DEDENT> def file_path(self, request, response=None, info=None): <NEW_...
重写ImagesPipeline方法,使保存的图片名称和路径自定义
62598ee48a43f66fc4bf07be
class UnescapePostprocessor(Postprocessor): <NEW_LINE> <INDENT> RE = re.compile('%s(\d+)%s' % (util.STX, util.ETX)) <NEW_LINE> def unescape(self, m): <NEW_LINE> <INDENT> return unichr(int(m.group(1))) <NEW_LINE> <DEDENT> def run(self, text): <NEW_LINE> <INDENT> return self.RE.sub(self.unescape, text)
Restore escaped chars
62598ee4ac7a0e7691f70b62
class NormalizeImg: <NEW_LINE> <INDENT> def __init__(self, std_epsilon=.0001): <NEW_LINE> <INDENT> self.std_epsilon = std_epsilon <NEW_LINE> <DEDENT> def __call__(self, img): <NEW_LINE> <INDENT> assert isinstance(img, np.ndarray) <NEW_LINE> mean, std = cv2.meanStdDev(img) <NEW_LINE> mean, std = mean.astype(np.float32),...
Normalize each image or patch by its own mean/std
62598ee485dfad0860cbed8e
class HaveChildren(Rule): <NEW_LINE> <INDENT> name = _('People with children') <NEW_LINE> description = _("Matches people who have children") <NEW_LINE> category = _('Family filters') <NEW_LINE> def apply(self,db,person): <NEW_LINE> <INDENT> for family_handle in person.get_family_handle_list(): <NEW_LINE> <IN...
People with children
62598ee4a17c0f6771d5a8a0
class HealtCheckConsumer(AsyncConsumer): <NEW_LINE> <INDENT> async def health_check(self, message: dict): <NEW_LINE> <INDENT> logger.debug(__("Performing health check with message {}.", message)) <NEW_LINE> path = Path(message["file"]) <NEW_LINE> if await self.check_database(): <NEW_LINE> <INDENT> logger.debug("Health ...
Channels consumer for handling health-check events.
62598ee4e64d504609df86e5
class ManageReplicationResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId")
ManageReplication返回参数结构体
62598ee47047854f4633da22
class UserEditView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> desc_data = request.POST.get('desc') <NEW_LINE> try: <NEW_LINE> <INDENT> user.desc = desc_data <NEW_LINE> user.save() <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> return JsonR...
用户编辑个人简介
62598ee4e76e3b2f99fd7085
@icmpv6.register_icmpv6_type(ND_ROUTER_ADVERT) <NEW_LINE> class nd_router_advert(stringify.StringifyMixin): <NEW_LINE> <INDENT> _PACK_STR = '!BBHII' <NEW_LINE> _MIN_LEN = struct.calcsize(_PACK_STR) <NEW_LINE> _ND_OPTION_TYPES = {} <NEW_LINE> @staticmethod <NEW_LINE> def register_nd_option_type(*args): <NEW_LINE> <INDEN...
ICMPv6 sub encoder/decoder class for Router Advertisement messages. (RFC 4861) This is used with ryu.lib.packet.icmpv6.icmpv6. An instance has the following attributes at least. Most of them are same to the on-wire counterparts but in host byte order. __init__ takes the corresponding args in this order. .. tabularco...
62598ee4a79ad16197768665
class Score: <NEW_LINE> <INDENT> def __init__(self, name: str, score: float): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.score = score <NEW_LINE> self._mean = -1.0 <NEW_LINE> self._ci = -1.0 <NEW_LINE> self._verbose = '' <NEW_LINE> <DEDENT> def format(self, width: int = 2, score_only: bool = False, signature:...
A base score class to derive from. :param name: The name of the underlying metric. :param score: A floating point number for the final metric.
62598ee466673b3332c2e9f4
class GridSquares(Button): <NEW_LINE> <INDENT> dist = 0 <NEW_LINE> grid = None <NEW_LINE> ship_id = None <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(GridSquares, self).__init__(**kwargs) <NEW_LINE> size = 10 <NEW_LINE> self.is_ship = False <NEW_LINE> self.row = GridSquares.dist // size <NEW_LINE>...
Class defining the squares on the board, each square is a button! Grids in pygame were hard to make too.
62598ee4adb09d7d5dc08c13
class ParameterCustom(Parameter): <NEW_LINE> <INDENT> def __init__(self, **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> self.ptype = "custom"
This is a custom parameter whose editor and drawer will need to be set by its sub-class.
62598ee455399d3f05624b7e
class PublicRecipeApiTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_auth_required(self): <NEW_LINE> <INDENT> res = self.client.get(RECIPE_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test unauthenticated recipe API request
62598ee401c39578d7f113f6
class IPortletView(interface.Interface): <NEW_LINE> <INDENT> pass
portlet view
62598ee456ac1b37e6300839
class TestPressure(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 testPressure(self): <NEW_LINE> <INDENT> pass
Pressure unit test stubs
62598ee4627d3e7fe0e054d5
class Block(): <NEW_LINE> <INDENT> def __init__(self, inputs, block_params, is_training, scope=None, summary_flag=False, ): <NEW_LINE> <INDENT> self.inputs = inputs <NEW_LINE> self.block_params = block_params <NEW_LINE> self.is_training = is_training <NEW_LINE> self.summary_flag = summary_flag <NEW_LINE> if scope is No...
A class to generate the ResNet block composed of bottlenecks. inputs ====== input: tf.Tensor a tensor as the input of last layer block_params: list configure params for the block, for instance block_params = [bottle_param1, bottle_params2, bottle_params3] For a bottleneck, [(row,col,kernels),stride...
62598ee466656f66f7d58a2e
class RptkStubProcess(multiprocessing.Process): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> sys.argv = [sys.executable] <NEW_LINE> server = RptkStub(loglevel="warning") <NEW_LINE> server.run()
Multiprocessing runner.
62598ee48e7ae83300ee76dc
class ControlScriptEffectsTests(SynchronousTestCase): <NEW_LINE> <INDENT> def test_starts_http_api_server(self): <NEW_LINE> <INDENT> options = ControlOptions() <NEW_LINE> options.parseOptions( [b"--port", b"tcp:8001", b"--data-path", self.mktemp()]) <NEW_LINE> reactor = MemoryCoreReactor() <NEW_LINE> ControlScript().ma...
Tests for effects ``ControlScript``.
62598ee4379a373c97d97648
class MaplexWeightRankingDialog(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{D9C171EE-4FDF-4935-B4B6-4F2338347842}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{D92377DC-FAB1-4DFB-A4C1-61BD8C40DBEB}', 10, 2)
Esri Maplex Weight Ranking Dialog.
62598ee42eb69b55b15a06b0
class SimpleConfWxDialog(wx.Frame): <NEW_LINE> <INDENT> def __init__(self, section, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('title', section.title) <NEW_LINE> super(SimpleConfWxDialog, self).__init__(*args, **kwargs) <NEW_LINE> self.panel = SimpleConfWxParentFriendlyPanel(section, self) <NEW_LINE> <DEDE...
A frame to show a configuration section.
62598ee47d43ff2487426722
class GetMaximumLevel(TestMixins.GetMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.DIMMER_SETTINGS <NEW_LINE> PID = "MAXIMUM_LEVEL" <NEW_LINE> PROVIDES = ['maximum_level'] <NEW_LINE> EXPECTED_FIELD = 'maximum_level'
Get MAXIMUM_LEVEL.
62598ee467a9b606de54461c
class Time(Trigger, mixin.Single("time")): <NEW_LINE> <INDENT> def __call__(self, env): <NEW_LINE> <INDENT> return datetime.datetime.today() >= self.time
Time trigger.
62598ee491f36d47f22301ca
class ChooseManufacturerForm(forms.Form): <NEW_LINE> <INDENT> manufacturer = forms.ModelChoiceField(queryset=man_models.Manufacturer.objects.all())
A form to choose a pre-existing Manufacturer
62598ee42ae34c7f260a9736
class Document(object): <NEW_LINE> <INDENT> def __init__(self, vocabulary): <NEW_LINE> <INDENT> self.__name = "" <NEW_LINE> self.__document_class = None <NEW_LINE> self._words_and_freq = BagOfWords() <NEW_LINE> Document._vocabulary = vocabulary <NEW_LINE> <DEDENT> def read_document(self,filename, learn=False): <NEW_LIN...
Used both for learning (training) documents and for testing documents. The optional parameter learn has to be set to True, if a classificator should be trained. If it is a test document learn has to be set to False.
62598ee4a8370b77170eea32
class ListAllFeedsInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> super(ListAllFeedsInputSet, self)._set_input('APIKey', value) <NEW_LINE> <DEDENT> def set_Content(self, value): <NEW_LINE> <INDENT> super(ListAllFeedsInputSet, self)._set_input('Content', value) <NEW_LINE> <DEDENT...
An InputSet with methods appropriate for specifying the inputs to the ListAllFeeds Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598ee43c8af77a43b6725a
class FlashFile(BoardInterface): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super().__init__(args) <NEW_LINE> self.filepath = args.flash_file <NEW_LINE> self.max_size = 0x8000000 <NEW_LINE> if self.board and self.board in self.KNOWN_BOARDS: <NEW_LINE> <INDENT> logging.info('Using settings from KN...
Implementation of `BoardInterface` for flash files.
62598ee457b8e32f5250742c
class AboutDialog(gtk.AboutDialog): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(AboutDialog, self).__init__() <NEW_LINE> self.set_icon(gtk.gdk.pixbuf_new_from_file(os.path.join(PIX_PATH,"about.png"))) <NEW_LINE> self.set_name("Monitor Hebras") <NEW_LINE> self.set_comments("Monitoriza las hebras de...
Ventana Acerca de la aplicación.
62598ee41b99ca400228e834
class OctaveInstrctl(OctavePackage, SourceforgePackage): <NEW_LINE> <INDENT> homepage = "https://octave.sourceforge.io/instrument-control/" <NEW_LINE> sourceforge_mirror_path = "octave/instrument-control-0.3.1.tar.gz" <NEW_LINE> version('0.3.1', sha256='d9c3b2e258cc8245ebfdd282e6314af12987daf453f4356555f56ca5ec55873c')...
Instrument-Control is a package for interfacing the outside world of hardware via Serial, i2c or Parallel interfaces.
62598ee40a50d4780f7039f8
class Shadow: <NEW_LINE> <INDENT> def __init__(self, body: AnyContainer) -> None: <NEW_LINE> <INDENT> self.container = FloatContainer( content=body, floats=[ Float( bottom=-1, height=1, left=1, right=-1, transparent=True, content=Window(style="class:shadow") ), Float( bottom=-1, top=1, width=1, right=-1, transparent=Tr...
Draw a shadow underneath/behind this container. (This applies `class:shadow` the the cells under the shadow. The Style should define the colors for the shadow.) :param body: Another container object.
62598ee40c0af96317c549ec
class WordTagSupervised_dotp(Layer): <NEW_LINE> <INDENT> input_ndim = 2 <NEW_LINE> def __init__(self, input_dim, proj_dim=128, neg_samples = 4, init='uniform', activation='sigmoid', weights=None, W_regularizer = None, activity_regularizer = None, **kwargs): <NEW_LINE> <INDENT> super(WordTagContextProduct, self).__init_...
This layer turns a tuple of word and its surrounding words (i.e. context) identified by their index in a vocabulary, into two dense reprensentations (word representation and context representation). Then it returns activation(dot(pivot_embedding, context_embedding)), which can be trained to encode the probability of f...
62598ee44e4d562566370a68
class CmdLineEdit(QLineEdit): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.history = [] <NEW_LINE> self.histidx = 0 <NEW_LINE> <DEDENT> def keyPressEvent(self, e): <NEW_LINE> <INDENT> if e.key() == Qt.Key_Up: <NEW_LINE> <INDENT> self.useHistory(-1) <NEW_LI...
自定义的命令输入框,基于QLineEdit,增加了记录命令功能。 类似于Linux终端,可以通过上下箭头选择历史命令
62598ee43539df3088eca901
class Wrapper(dict): <NEW_LINE> <INDENT> def is_immutable(self, key): <NEW_LINE> <INDENT> item = self.get(key) <NEW_LINE> if item and item["immutable"]: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return False
Simple wrapper for a dict that provides some extra functionaity. This is NOT json serializable but it should be easy to convert to a regular dictionary with dict(wrapper)
62598ee476e4537e8c3edc07
class GenRotatingFileHandler(BaseRotatingHandler): <NEW_LINE> <INDENT> def __init__(self, base_filename, suffix_filename='', when='H', encoding=None, log_name_format=None, log_time_format={}): <NEW_LINE> <INDENT> if log_time_format == {}: <NEW_LINE> <INDENT> self.log_time_format = { "S": "%Y%m%d_%H%M%S", "M": "%Y%m%d_%...
From lib/geneity/lib/LoggingHandlers Handler for logging to a file, rotating the log file at certain timed intervals.
62598ee416aa5153ce3feb4c
class Task(enum.Enum): <NEW_LINE> <INDENT> SQA = 0 <NEW_LINE> WTQ = 1 <NEW_LINE> WIKISQL = 2 <NEW_LINE> WIKISQL_SUPERVISED = 3 <NEW_LINE> TABFACT = 4 <NEW_LINE> NQ_RETRIEVAL = 7 <NEW_LINE> HYBRIDQA_RC = 8 <NEW_LINE> HYBRIDQA_E2E = 9 <NEW_LINE> HYBRIDQA = 6 <NEW_LINE> SEM_TAB_FACT = 10
Fine-tuning tasks supported by Tapas.
62598ee4435de62698e9a425
class readInput(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def getInput(self): <NEW_LINE> <INDENT> lines = [] <NEW_LINE> Done = 0; <NEW_LINE> while not Done: <NEW_LINE> <INDENT> myline = input() <NEW_LINE> lines.append(myline) <NEW_LINE> if myline == "0 0": <NEW_LINE> ...
this class reads a piped input
62598ee4435de62698e9a426
class Random(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.Metadata = Coverage._meta.get_model('modelinstance') <NEW_LINE> self.page = Page.objects.create(type="abc") <NEW_LINE> self.content_type = ContentType.objects.get_for_model(Page) <NEW_LINE> self.model_metadata = self.Metadata.objects....
- Caching - metadata lookups are avoided by caching previous rendering for certain amount of time
62598ee4cc0a2c1114479652
class Tree: <NEW_LINE> <INDENT> def __init__(self, items=[]): <NEW_LINE> <INDENT> self.root = None <NEW_LINE> if len(items) > 0: <NEW_LINE> <INDENT> self.create(items) <NEW_LINE> <DEDENT> <DEDENT> def create(self, items): <NEW_LINE> <INDENT> if len(items) == 0: <NEW_LINE> <INDENT> print("No items found to create Tree")...
Input format should be: Root, Left, right, left.left, left.right, right.left, right.right, etc If a node is None, put "N" instead of adding any number like -1, 0 etc. Example input: 1 2 3 N 5 6 7 N N 1 2 3 N 5 6 7
62598ee44c34283577618932
class SplitNode: <NEW_LINE> <INDENT> def __init__(self, split_dim, split_val,left_child, right_child, parent_node=None, parent_branch=None, subtree_linear_dim=None): <NEW_LINE> <INDENT> self.split_dim = copy.copy(split_dim) <NEW_LINE> self.split_val = copy.copy(split_val) <NEW_LINE> self.parent_node = parent_node <NEW_...
Nodes for the tree interior Args: split_dim (int): The dimension this node split on (starts at 0) split_val (float): The value of the split point parent_node (SplitNode): This node's parent node parent_branch (int): This node's branch (0 for left, 1 for right)
62598ee4379a373c97d9764b
class Viral(Concisely): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> result = '' <NEW_LINE> for item in self.json(): <NEW_LINE> <INDENT> for name in ['platform', 'type']: <NEW_LINE> <INDENT> if name in item: <NEW_LINE> <INDENT> result += '{:>20} | '.format(name + ':' + item[name]) <NEW_LINE> <DEDENT> <DE...
docstring for Viral.
62598ee43539df3088eca902
class RTSParsingException(IOError): <NEW_LINE> <INDENT> pass
This exception occurs when a serious issue occurred while parsing an RTS packet.
62598ee497e22403b3839540
class WireableObject: <NEW_LINE> <INDENT> def toWire(self): <NEW_LINE> <INDENT> return b"wire"
Object with bytes representation as a constant toWire value
62598ee4be8e80087fbbd69d
class TestDelimitedInfixOperator(object): <NEW_LINE> <INDENT> def test_double_star_delimited_operator(self): <NEW_LINE> <INDENT> matches = DoubleStarDelimitedInfixOperator(fnmatch) <NEW_LINE> assert ('foo.txt' **matches** '*.txt') <NEW_LINE> <DEDENT> def test_star_delimited_operator(self): <NEW_LINE> <INDENT> matches =...
Test operator creation via `*DelimitedInfixOperator` classes.
62598ee4a8370b77170eea34
class TestSiblingsNotMarry(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> gedcom = open('inputs/siblings_not_marry.txt', 'r') <NEW_LINE> self.fam = parser.parse(gedcom) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> self.fam = None <NEW_LINE> <DEDENT> def test_siblings_true(se...
Class to test that siblings have not married
62598ee485dfad0860cbed90
class TestActivityCRUDOperations(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.app = app.test_client() <NEW_LINE> with self.app as app_: <NEW_LINE> <INDENT> with app_.session_transaction() as sess: <NEW_LINE> <INDENT> sess['user'] = 'test@user.com' <NEW_LINE> <DEDENT> <DEDENT> DB['ac...
Test class is used to test the CRUD operations of a user if he/she is logged in This functionality includes: create activity read activity update activity delete activity
62598ee43c8af77a43b6725b
class OrganizingCollection(ResourceBase): <NEW_LINE> <INDENT> def __init__(self, bigip): <NEW_LINE> <INDENT> super(OrganizingCollection, self).__init__(bigip) <NEW_LINE> base_uri = self.__class__.__name__.lower() + '/' <NEW_LINE> self._meta_data['uri'] = self._meta_data['container']._meta_data['uri'] + base_...
Base class for objects that collect resources under them. ``OrganizingCollection`` objects fulfill the following functions: * represent a uri path fragment immediately 'below' /mgmt/tm * provide a list of dictionaries that contain uri's to other resources on the device.
62598ee410dbd63aa1c6f1c2
class Command(BaseCommand): <NEW_LINE> <INDENT> args = '<filename>' <NEW_LINE> help = 'Import SWID tags from a file into the DB. ' 'The file must contain one swid tag per line.' <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('args', nargs='*') <NEW_LINE> <DEDENT> def handl...
Required class to be recognized by manage.py.
62598ee401c39578d7f113f9
class UserLoginTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> user = User.objects.create_user(username="Yoshi54", email="yoshi54@caramail.com", password="FANDECYRILHANOUNA") <NEW_LINE> user.save() <NEW_LINE> <DEDENT> def test_sign_in_page(self): <NEW_LINE> <INDENT> response = self.client.g...
Tests of the account view
62598ee40c0af96317c549ed
class IStaticApplication(Interface): <NEW_LINE> <INDENT> pass
Static application interfaces
62598ee4cc0a2c1114479653
class AutomationSequenceComponentType(BaseSequenceComponentType): <NEW_LINE> <INDENT> display_name = QCoreApplication.translate('AutomationSequenceComponentType', 'Automation') <NEW_LINE> menu_text = QCoreApplication.translate('AutomationSequenceComponentType', '&Automation') <NEW_LINE> node_default_name = QCoreApplica...
Sequence component type for automation nodes.
62598ee460cbc95b0636298d
class AppTestHsplit(BaseNumpyAppTest): <NEW_LINE> <INDENT> def test_0D_array(self): <NEW_LINE> <INDENT> from numpypy import array <NEW_LINE> from numpypy.lib.shape_base import hsplit <NEW_LINE> a= array(1) <NEW_LINE> try: <NEW_LINE> <INDENT> hsplit(a,2) <NEW_LINE> assert (0) <NEW_LINE> <DEDENT> except ValueError: <NEW_...
only testing for integer splits.
62598ee4be383301e0251e2a
class BaseConfig(object): <NEW_LINE> <INDENT> def __init__(self, loaders): <NEW_LINE> <INDENT> if not loaders: <NEW_LINE> <INDENT> if any(self._iter_config_props()): <NEW_LINE> <INDENT> raise AssertionError('Class has ConfigProperty attributes: must provide loader(s)') <NEW_LINE> <DEDENT> <DEDENT> self._update_property...
Base class to hold configuration settings
62598ee4d58c6744b42db5df
class Review(BaseModel): <NEW_LINE> <INDENT> place_id = "" <NEW_LINE> user_id = "" <NEW_LINE> text = "" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs)
The Review class
62598ee401c39578d7f113fa
class LogTarget: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.fd = None <NEW_LINE> <DEDENT> def write(self, data, level, logger): <NEW_LINE> <INDENT> raise NotImplementedError("LogTarget.write is an abstract method") <NEW_LINE> <DEDENT> def flush(self): <NEW_LINE> <INDENT> raise NotImplementedError(...
Abstract class for logging targets.
62598ee4627d3e7fe0e054d9
class Payment(models.Model): <NEW_LINE> <INDENT> account = models.ForeignKey( Account, on_delete=models.CASCADE, related_name="payments") <NEW_LINE> to_account = models.ForeignKey(Account, on_delete=models.CASCADE) <NEW_LINE> amount = models.DecimalField(max_digits=20, decimal_places=10) <NEW_LINE> direction = models.C...
Model representing Payment from one account to another
62598ee4fff4ab517ebcbe2f
@add_metaclass(ABCMeta) <NEW_LINE> class MonitoredQuantity(object): <NEW_LINE> <INDENT> def __init__(self, requires=None, name=None): <NEW_LINE> <INDENT> self.requires = requires <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def initialize(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>...
The base class for monitored-quantities. To monitor a non-Theano quanity in Blocks you have to implement this interface for it. The initialize method initializes accumulators and the parameters needed to compute this quantity, accumulate method accumulates results for every batch, and finallly readout is called to get...
62598ee4c432627299fa1608
class Ngrams(MentionSpace): <NEW_LINE> <INDENT> def __init__( self, n_min: int = 1, n_max: int = 5, split_tokens: Collection[str] = [] ) -> None: <NEW_LINE> <INDENT> MentionSpace.__init__(self) <NEW_LINE> self.n_min = n_min <NEW_LINE> self.n_max = n_max <NEW_LINE> self.split_rgx = ( r"(" + r"|".join(map(re.escape, sort...
Define the space of Mentions as all n-grams in a Sentence. Define the space of Mentions as all n-grams (n_min <= n <= n_max) in a Sentence *x*, indexing by **character offset**. :param n_min: Lower limit for the generated n_grams. :param n_max: Upper limit for the generated n_grams. :param split_tokens: Tokens, on wh...
62598ee4b7558d5895461c97
class Book(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200) <NEW_LINE> author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) <NEW_LINE> summary = models.TextField(max_length=1000, help_text="Please enter a BRIEF description of the book") <NEW_LINE> isbn = models.CharField...
Model representing a book (but not a specific copy of a book)
62598ee4dd821e528d6d7596
class Key(ConvertMixin): <NEW_LINE> <INDENT> def __init__(self, name, path, key_alg): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.key_alg = key_alg <NEW_LINE> self.path = path <NEW_LINE> self.file = None <NEW_LINE> self.formats = {} <NEW_LINE> self.create_key() <NEW_LINE> <DEDENT> def create_key(self): <NEW_LI...
A representation of the key file
62598ee416aa5153ce3feb4e
class UserLoginApiView(ObtainAuthToken): <NEW_LINE> <INDENT> renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES
Handle user authentication tokens
62598ee4498bea3a75a56187
class DecoratorNonKeyLengthException(ArgvalidateException): <NEW_LINE> <INDENT> def __init__(self, func_name, expected_count, passed_count): <NEW_LINE> <INDENT> self.func_name = func_name <NEW_LINE> self.expected_count = expected_count <NEW_LINE> self.passed_count = passed_count <NEW_LINE> msg = '%s: wrong number of no...
Exception for invalid decorator non-keyword argument count. This exception provides the following attributes: * func_name Name of function that caused the exception to be raised (str, read-only). * expected_count Number of arguments that were expected (int, read-only). * passed_count Number of argum...
62598ee4d7e4931a7ef3a6ef
class SecurityTest(EndToEndTest): <NEW_LINE> <INDENT> def __init__(self, test_context): <NEW_LINE> <INDENT> super(SecurityTest, self).__init__(test_context=test_context) <NEW_LINE> <DEDENT> def producer_consumer_have_expected_error(self, error): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> for node in self.producer.nod...
These tests validate security features.
62598ee48e7ae83300ee76e1
class WhitespaceTokenizer(Transformer): <NEW_LINE> <INDENT> def transform(self, texts): <NEW_LINE> <INDENT> return map(lambda s: s.split(), texts)
Tokenize text on whitespace. Useful for using the output of some other tokenization system.
62598ee48c0ade5d55dc29ac
class DocHtmlEscaped(Dict[str, Any]): <NEW_LINE> <INDENT> def __init__(self, doc: Any) -> None: <NEW_LINE> <INDENT> self.__doc = doc <NEW_LINE> <DEDENT> def __getitem__(self, key: str) -> str: <NEW_LINE> <INDENT> return ( str(self.__doc[key]) .replace('&', '&amp;') .replace('<', '&lt;') .replace('>', '&gt;') .replace('...
Small helper class to escape html elements. >>> DocHtmlEscaped(from_data(dict(title='> >< int & "" "')))['title'] '&gt; &gt;&lt; int &amp; &quot;&quot; &quot;'
62598ee47b25080760ed5aec
class multiplyStringsBigInteger: <NEW_LINE> <INDENT> def multiply(self, num1, num2): <NEW_LINE> <INDENT> l1, l2 = len(num1), len(num2) <NEW_LINE> l3 = l1 + l2 <NEW_LINE> res = [0 for i in range(l3)] <NEW_LINE> for i in range(l1 - 1, -1, -1): <NEW_LINE> <INDENT> carry = 0 <NEW_LINE> for j in range(l2 - 1, -1, -1): <NEW_...
MyBigInteger class
62598ee42ae34c7f260a9739
class CAbort(Test): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> source = self.params.get('source', default='abort.c') <NEW_LINE> c_file = os.path.join(self.datadir, source) <NEW_LINE> c_file_name = os.path.basename(c_file) <NEW_LINE> dest_c_file = os.path.join(self.srcdir, c_file_name) <NEW_LINE> shutil.co...
A test that calls C standard lib function abort(). params: :param tarball: Path to the c-source file relative to deps dir.
62598ee4dd821e528d6d7597
class BoilerPlantImprovements(BSElement): <NEW_LINE> <INDENT> class MeasureName(BSElement): <NEW_LINE> <INDENT> element_type = "xs:string" <NEW_LINE> element_enumerations = [ "Replace boiler", "Replace burner", "Decentralize boiler", "Insulate boiler room", "Add energy recovery", "Convert gas-fired unit to boiler loop"...
Boiler plant improvements.
62598ee4d486a94d0ba2a61e
class DtFillGap(DtDualToolSelectGap): <NEW_LINE> <INDENT> def __init__(self, iface, toolBar): <NEW_LINE> <INDENT> super().__init__(iface, toolBar, QtGui.QIcon(":/fillGap.png"), QtCore.QCoreApplication.translate("digitizingtools", "Fill gap with a new feature (interactive mode)"), QtGui.QIcon(":/fillGapBatch.png"), Qt...
Fill gaps between selected features of the active layer with new features
62598ee421a7993f00c645bf
class UsermodelRetrieveAPIView(RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Usermodel.objects.all() <NEW_LINE> serializer_class = UsermodelSerializer <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> lookup_field = 'userid' <NEW_LIN...
Retrieve, update and delete Usermodel table
62598ee4d486a94d0ba2a61f
class Utf8Validator: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def decode(self, b): <NEW_LINE> <INDENT> type = UTF8VALIDATOR_DFA[b] <NEW_LINE> if self.state != UTF8_ACCEPT: <NEW_LINE> <INDENT> self.codepoint = (b & 0x3f) | (self.codepoint << 6) <NEW_LINE> <DEDENT> else...
Incremental UTF-8 validator with constant memory consumption (minimal state). Implements the algorithm "Flexible and Economical UTF-8 Decoder" by Bjoern Hoehrmann (http://bjoern.hoehrmann.de/utf-8/decoder/dfa/).
62598ee47047854f4633da27
class ContactConfig(AppConfig): <NEW_LINE> <INDENT> name = "contact" <NEW_LINE> verbose_name = _("contact")
Class representing a Django application and its configuration.
62598ee4d7e4931a7ef3a6f0
class BaseInterface(BaseNXObject): <NEW_LINE> <INDENT> def _get_port_selector_json(self, port_type, port_name): <NEW_LINE> <INDENT> name = self._get_name_for_json() <NEW_LINE> port_blk = {'name': name, 'fromCard': self.module, 'toCard': self.module, 'fromPort': self.port, 'toPort': self.port} <NEW_LINE> port_blk = {'in...
Abstract class used to provide base functionality to other Interface classes.
62598ee43d592f4c4edb9547
class AzureFirewallFqdnTag(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'fqdn_tag_name': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key':...
Azure Firewall FQDN Tag Resource. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: str :param tag...
62598ee43c8af77a43b6725c
class OAUTH_Server(oauth2.Server): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(self.__class__, self).__init__(*args, **kwargs) <NEW_LINE> self.add_signature_method(oauth2.SignatureMethod_PLAINTEXT()) <NEW_LINE> self.add_signature_method(oauth2.SignatureMethod_HMAC_SHA1()) <NEW_LIN...
Handles all the oauth requests
62598ee4e76e3b2f99fd708b
class HoldingsStorage(FolioApi): <NEW_LINE> <INDENT> def get_holdings(self, **kwargs): <NEW_LINE> <INDENT> return self.call("GET", "/holdings-storage/holdings", query=kwargs) <NEW_LINE> <DEDENT> def set_holding(self, holding: dict): <NEW_LINE> <INDENT> return self.call("POST", "/holdings-storage/holdings", data=holding...
Holdings Records Storage API **Storage for holdings in the inventory**
62598ee43617ad0b5ee04782
class ServiceProviderTemplateTestCase(unittest.TestCase): <NEW_LINE> <INDENT> HERE_DIR = _HERE_DIR <NEW_LINE> SERVICE_TMPL_NAME = 'ndgsecurity_securedapp' <NEW_LINE> SERVICE_CONF_DIR = 'securedapp' <NEW_LINE> SERVICE_CONF_DIRPATH = path.join(HERE_DIR, SERVICE_CONF_DIR) <NEW_LINE> SERVICE_CONF_DIR_FILES = ( 'pki', 'requ...
Test create configuration for an application secured with NDG Security filters
62598ee4adb09d7d5dc08c19
class RESTPublisherTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> rest_publisher = publishers.RESTPublisher() <NEW_LINE> mappings = publishers.VerbMappings(get={'method': get_user}, get_all={'method': get_all}, add={'method': add_user}, edit={'method': edit_user}, delete={'method'...
Tests for the RESTPublisher Class. These tests use the externally defined functions for the resource to to published, i.e. users.
62598ee455399d3f05624b84
class SellableItem(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SellableItem, self).__init__(name)
item that can be 'selled' to another unit by exchanging other items (like money or goods) this is done by completing all the transactions
62598ee4f548e778e5969be8
class GetMetricsInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(GetMetricsInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_ClientID(self, value): <NEW_LINE> <INDENT> super(GetMetricsInputSet, self)._set_input('ClientID', value) <NEW_LINE> <...
An InputSet with methods appropriate for specifying the inputs to the GetMetrics Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598ee44e4d562566370a6c
class closeScanner_result: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'io', (TIOError, TIOError.thrift_spec), None, ), (2, TType.STRUCT, 'ia', (TIllegalArgument, TIllegalArgument.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, io=None, ia=None,): <NEW_LINE> <INDENT> self.io = io <NEW_LINE> self....
Attributes: - io - ia: if the scannerId is invalid
62598ee4eab8aa0e5d30a3cb
class Updater(AIL_Updater): <NEW_LINE> <INDENT> def __init__(self, version): <NEW_LINE> <INDENT> super(Updater, self).__init__(version) <NEW_LINE> self.r_serv_onion = self.config.get_redis_conn("ARDB_Onion") <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> self.r_serv_onion.sunionstore('domain_update_v3.4', 'f...
default Updater.
62598ee45fdd1c0f98e5c601
class CreditInvoice(Wizard): <NEW_LINE> <INDENT> __name__ = 'account.invoice.credit' <NEW_LINE> start = StateView('account.invoice.credit.start', 'account_invoice.credit_start_view_form', [ Button('Cancel', 'end', 'tryton-cancel'), Button('Credit', 'credit', 'tryton-ok', default=True), ]) <NEW_LINE> credit = StateActio...
Credit Invoice
62598ee44428ac0f6e656ba6
class PolynomialRing(PolynomialRingInterface): <NEW_LINE> <INDENT> def __init__(self, n_vars): <NEW_LINE> <INDENT> self._n_vars = n_vars <NEW_LINE> <DEDENT> def n_vars(self): <NEW_LINE> <INDENT> return self._n_vars
Polynomial ring with explicit dimension.
62598ee4009cb60464cffba2
class TestHandleScoreChanged(ModuleStoreTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.course = CourseFactory.create(org='TestX', number='TS01', run='2016_Q1') <NEW_LINE> self.user = UserFactory.create() <NEW_LINE> self.subsection_grade = Mock() <NEW_LINE> <DEDENT> @...
Test case for handle_score_changed django signal handler
62598ee46aa9bd52df0d3503
class PainAdminSite(AdminSite): <NEW_LINE> <INDENT> site_header = _('PAIN Administration') <NEW_LINE> site_title = _('PAIN Administration') <NEW_LINE> site_url = None
Custom django-admin site.
62598ee4e1aae11d1e7cdb68
class PipelineStopIteration(Exception): <NEW_LINE> <INDENT> pass
This stops the iteration of `next()` in pipeline tasks. Pipeline tasks should raise this excetions in the `next()` method to stop the iteration of the task and to proceed to `finish()`. Note that if `next()` recieves input data as an argument, it is not required to ever raise this exception. The pipeline will procee...
62598ee4435de62698e9a42a
class Connection: <NEW_LINE> <INDENT> socket = None <NEW_LINE> ipv4 = None <NEW_LINE> port = None <NEW_LINE> ipv6 = None <NEW_LINE> def __init__(self, ipv4, ipv6, port): <NEW_LINE> <INDENT> self.ipv4 = ipv4 <NEW_LINE> self.ipv6 = ipv6 <NEW_LINE> self.port = int(port) <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <I...
Crea le connessioni a directory e peers Attributes: socket: socket per le comunicazioni ipv4: indirizzo ipv4 ipv6: indirizzo ipv6 port: porta
62598ee48e7ae83300ee76e2
class UnSqueeze(Layer): <NEW_LINE> <INDENT> def __init__(self, factor=2, **kwargs): <NEW_LINE> <INDENT> self.factor = factor <NEW_LINE> super(UnSqueeze, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def call(self, inputs): <NEW_LINE> <INDENT> height, width, channel = K.int_shape(inputs)[1:] <NEW_LINE> assert channel % (...
shape=[h, w, c] ==> shape=[h*n, w*n, c/(n*n)]
62598ee44c34283577618936
@testcase(groups=['system_test', 'system_test.vcenter', 'system_test.vcenter.deploy_vcenter_dvs_run_ostf']) <NEW_LINE> class DeployWithVMware(ActionTest, BaseActions, VMwareActions): <NEW_LINE> <INDENT> plugin_name = "fuel-plugin-vmware-dvs" <NEW_LINE> plugin_path = DVS_PLUGIN_PATH <NEW_LINE> plugin_version = DVS_PLUGI...
Deploy cluster with vCenter and dvs plugin. Scenario: 1. Upload plugin to the master node 2. Install plugin 3. Create cluster 4. Configure dvs settings (depends on yaml config) 5. Add nodes (depends on yaml config) 6. Configure vmware settings (depends on yaml config) 7. Deploy the cluster ...
62598ee499fddb7c1ca6212f
class HashTagDecorator: <NEW_LINE> <INDENT> SEARCH_RE = re.compile(r'#\w+') <NEW_LINE> def replace(self, match, block_type): <NEW_LINE> <INDENT> if block_type == BLOCK_TYPES.CODE: <NEW_LINE> <INDENT> return match.group(0) <NEW_LINE> <DEDENT> return DOM.create_element('em', {'class': 'hash_tag'}, match.group(0))
Wrap hash tags in spans with specific class.
62598ee467a9b606de544622
class SignalEvent(Event): <NEW_LINE> <INDENT> def __init__(self, strategy_id, symbol, datetime, signal_type, strength): <NEW_LINE> <INDENT> self.type = 'SIGNAL' <NEW_LINE> self.strategy_id = strategy_id <NEW_LINE> self.symbol = symbol <NEW_LINE> self.datetime = datetime <NEW_LINE> self.signal_type = signal_type <NEW_LI...
handle event and generate signal to portfolio object
62598ee497e22403b3839544
class GetStatusTest(TestCase): <NEW_LINE> <INDENT> @patch('bundlewrap.items.svc_upstart.svc_running') <NEW_LINE> def test_running_ok(self, svc_running): <NEW_LINE> <INDENT> svc = svc_upstart.SvcUpstart(MagicMock(), "foo", {'running': True}) <NEW_LINE> svc_running.return_value = True <NEW_LINE> status = svc.get_status()...
Tests bundlewrap.items.svc_upstart.SvcUpstart.get_status.
62598ee4be8e80087fbbd6a1
class FilterIdInvalid(BadRequest): <NEW_LINE> <INDENT> ID = "FILTER_ID_INVALID" <NEW_LINE> MESSAGE = __doc__
The specified filter ID is invalid
62598ee42eb69b55b15a06b3
@dataclass <NEW_LINE> class GetMoveGroupResponsePayload(MoveGroupResponsePayload): <NEW_LINE> <INDENT> num_moves: utils.UInt8Field <NEW_LINE> total_duration: utils.UInt32Field
Response to request to get a move group.
62598ee4e5267d203ee69f59
class V1Scale(object): <NEW_LINE> <INDENT> def __init__(self, kind=None, api_version=None, metadata=None, spec=None, status=None): <NEW_LINE> <INDENT> self.swagger_types = { 'kind': 'str', 'api_version': 'str', 'metadata': 'V1ObjectMeta', 'spec': 'V1ScaleSpec', 'status': 'V1ScaleStatus' } <NEW_LINE> self.attribute_map ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598ee4d486a94d0ba2a621
class GetPresetPlayback(TestMixins.GetMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> CATEGORY = TestCategory.CONTROL <NEW_LINE> PID = 'PRESET_PLAYBACK' <NEW_LINE> EXPECTED_FIELD = 'mode'
Get the preset playback.
62598ee430bbd7224646828d
class AfterFilterAction(Generic[ET], abc.ABC): <NEW_LINE> <INDENT> @property <NEW_LINE> @abc.abstractmethod <NEW_LINE> def __event_builder__(self) -> "Type[EventBuilder]": <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, e: ET, emitted_from: Any): <NEW_LINE> <INDENT> self.e = e <NEW_LINE> self.emitted_fr...
Base class-based action Usage example:: from telethon import custom from garnet import action, events Usage:: class AfterWrongIntAction(action.AfterFilterAction[custom.Message]): async def call(self) -> None: await self.e.reply(f"Hey! {self.e.raw_text} can not be int!")
62598ee4a79ad1619776866d