code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Tips(_tiw): <NEW_LINE> <INDENT> def __init__(self, text="Tips", idx=0, parent=None): <NEW_LINE> <INDENT> super(Tips, self).__init__(text=text, idx=idx, parent=parent)
Tips formatted help text ( with bulb icon )
625990747047854f46340cf2
class Trip(models.Model): <NEW_LINE> <INDENT> driver = models.ForeignKey(User, on_delete=models.CASCADE, related_name='driver' ) <NEW_LINE> passengers = models.ManyToManyField(User, related_name='passengers', blank=True ) <NEW_LINE> departure_date = models.DateTimeField() <NEW_LINE> origin = models.CharField(max_length...
A Trip represents a single A-to-B trip with one driver and multiple passengers
625990744f6381625f19a147
class MediaTypeModel(BaseMixin, me.Document): <NEW_LINE> <INDENT> media_type_id = me.IntField(primary_key=True) <NEW_LINE> media_type = me.StringField() <NEW_LINE> meta = {'collection': 'media_types'}
Media types
62599074a8370b77170f1d05
class BoxField(Field): <NEW_LINE> <INDENT> def __init__(self, xpadding=0, ypadding=0): <NEW_LINE> <INDENT> super(BoxField, self).__init__() <NEW_LINE> self.xpadding = xpadding <NEW_LINE> self.ypadding = ypadding <NEW_LINE> <DEDENT> def add_rectangle(self, rectangle): <NEW_LINE> <INDENT> if not self.rectangles: <NEW_LIN...
A field that packs itself into a box, ie for rounded corner use.
62599074ad47b63b2c5a9188
class SIRFStatusPV: <NEW_LINE> <INDENT> BIT_DISCONN = 0b000001 <NEW_LINE> BIT_SIINTLK = 0b000010 <NEW_LINE> BIT_LLINTLK = 0b000100 <NEW_LINE> BIT_AMPLERR = 0b001000 <NEW_LINE> BIT_PHSEERR = 0b010000 <NEW_LINE> BIT_DTUNERR = 0b100000 <NEW_LINE> PV_SIRIUS_INTLK = 0 <NEW_LINE> PV_LLRF_INTLK = 1 <NEW_LINE> PV_AMPL_ERR = 2 ...
SI RF Status PV.
6259907455399d3f05627e53
class ClientMock(action_mocks.ActionMock): <NEW_LINE> <INDENT> in_rdfvalue = None <NEW_LINE> out_rdfvalues = [rdfvalue.RDFString] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ClientMock, self).__init__() <NEW_LINE> server_stubs.ClientActionStub.classes["ReturnHello"] = self <NEW_LINE> self.__name__ = "Retur...
Mock of client actions.
625990744a966d76dd5f0824
class StringFormatter(object): <NEW_LINE> <INDENT> def __init__(self, format_string): <NEW_LINE> <INDENT> self.format_string = format_string <NEW_LINE> <DEDENT> def _get_format_string(self): <NEW_LINE> <INDENT> return self._format_string <NEW_LINE> <DEDENT> def _set_format_string(self, value): <NEW_LINE> <INDENT> self....
Many handlers format the log entries to text format. This is done by a callable that is passed a log record and returns an unicode string. The default formatter for this is implemented as a class so that it becomes possible to hook into every aspect of the formatting process.
6259907421bff66bcd7245a3
class TestPropertyEc2Subnet(BaseRuleTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestPropertyEc2Subnet, self).setUp() <NEW_LINE> self.collection.register(Subnet()) <NEW_LINE> self.success_templates = [ 'test/fixtures/templates/good/properties_ec2_vpc.yaml', ] <NEW_LINE> <DEDENT> def test_fi...
Test Ec2 Subnet Resources
625990748e7ae83300eea9cd
class NewToken(object): <NEW_LINE> <INDENT> swagger_types = { 'friendly_name': 'str' } <NEW_LINE> attribute_map = { 'friendly_name': 'friendlyName' } <NEW_LINE> def __init__(self, friendly_name=None): <NEW_LINE> <INDENT> self._friendly_name = None <NEW_LINE> self.discriminator = None <NEW_LINE> self.friendly_name = fri...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259907426068e7796d4e277
class HTTPClient(object): <NEW_LINE> <INDENT> def __init__(self, url, method='GET', headers=None, cookies=None): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.session = requests.session() <NEW_LINE> self.method = method.upper() <NEW_LINE> if self.method not in METHODS: <NEW_LINE> <INDENT> raise UnSupportMethodExce...
http请求的client。初始化时传入url、method等,可以添加headers和cookies,但没有auth、proxy。 >>> HTTPClient('http://www.baidu.com').send() <Response [200]>
6259907401c39578d7f143d2
class TestMaxInteger(unittest.TestCase): <NEW_LINE> <INDENT> def test(self): <NEW_LINE> <INDENT> self.assertEqual(max_integer([2,3]), 3) <NEW_LINE> <DEDENT> def testFail(self): <NEW_LINE> <INDENT> with self.assertRaises(TypeError): <NEW_LINE> <INDENT> max_integer(['f', 3]) <NEW_LINE> <DEDENT> <DEDENT> def testString(se...
First time using Unittest
6259907455399d3f05627e54
class TerminalNode(ASTNode.ASTNode): <NEW_LINE> <INDENT> def __init__(self, numeric=None, variables=None, symbol=None): <NEW_LINE> <INDENT> self.numeric = numeric <NEW_LINE> self.variables = variables <NEW_LINE> self.symbol = symbol <NEW_LINE> <DEDENT> def printAST(self): <NEW_LINE> <INDENT> print(self.symbol, end='')
ASTNode inherited class that implement the terminal node which have a value for evaluation.
62599074aad79263cf4300f3
class Dataset(object): <NEW_LINE> <INDENT> def __init__(self, imgSeqs=None): <NEW_LINE> <INDENT> if imgSeqs is None: <NEW_LINE> <INDENT> self._imgSeqs = [] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._imgSeqs = imgSeqs <NEW_LINE> <DEDENT> self._imgStacks = {} <NEW_LINE> self._labelStacks = {} <NEW_LINE> <DEDENT>...
Base class for managing data. Used to create training batches.
62599074f9cc0f698b1c5f69
class PLNot(UnaryOperator[PLFormula], PLFormula): <NEW_LINE> <INDENT> @property <NEW_LINE> def operator_symbol(self) -> OpSymbol: <NEW_LINE> <INDENT> return Symbols.NOT.value <NEW_LINE> <DEDENT> def truth(self, i: PropositionalInterpretation): <NEW_LINE> <INDENT> return not self.f.truth(i) <NEW_LINE> <DEDENT> def to_nn...
Propositional Not.
6259907432920d7e50bc7983
class UserView(CreateAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.CreateUserSerializer
用户注册:url(r"^users/$", views.UserView.as_view())
625990744e4d562566373d43
class OSUpdatesTestSummary(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'execution_status': {'key': 'executionStatus', 'type': 'str'}, 'test_status': {'key': 'testStatus', 'type': 'str'}, 'grade': {'key': 'grade', 'type': 'str'}, 'test_run_time': {'key': 'testRunTime', 'type': 'str'}, 'os_update_...
The summary of some tests. :param execution_status: The status of the last test. Possible values include: "None", "InProgress", "Processing", "Completed", "NotExecuted", "Incomplete", "Failed", "Succeeded". :type execution_status: str or ~test_base.models.ExecutionStatus :param test_status: The status of last test. P...
625990747b180e01f3e49d02
class IsotonicMethods(_AccessorMethods): <NEW_LINE> <INDENT> _module_name = 'sklearn.isotonic' <NEW_LINE> @property <NEW_LINE> def IsotonicRegression(self): <NEW_LINE> <INDENT> return self._module.IsotonicRegression <NEW_LINE> <DEDENT> def isotonic_regression(self, *args, **kwargs): <NEW_LINE> <INDENT> func = self._mod...
Accessor to ``sklearn.isotonic``.
6259907456b00c62f0fb420d
class LearningAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, env, learning=False, epsilon=1.0, alpha=0.5): <NEW_LINE> <INDENT> super(LearningAgent, self).__init__(env) <NEW_LINE> self.planner = RoutePlanner(self.env, self) <NEW_LINE> self.valid_actions = self.env.valid_actions <NEW_LINE> self.learning = learning ...
An agent that learns to drive in the Smartcab world. This is the object you will be modifying.
62599074a8370b77170f1d08
class CommandResolver(object): <NEW_LINE> <INDENT> def resolve( self, args, application ): <NEW_LINE> <INDENT> raise NotImplementedError()
Returns the command to execute for the given console arguments.
62599074e1aae11d1e7cf4ac
class SdkCommandMock(SdkCommand): <NEW_LINE> <INDENT> @property <NEW_LINE> def cmd_factory(self): <NEW_LINE> <INDENT> return self._cmd_factory <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return "test_cmd" <NEW_LINE> <DEDENT> def get_arguments(self): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def ...
Very simple sdk mock command.
625990744527f215b58eb63e
class ComparisonTestFramework(BitcoinTestFramework): <NEW_LINE> <INDENT> def set_test_params(self): <NEW_LINE> <INDENT> self.num_nodes = 2 <NEW_LINE> self.setup_clean_chain = True <NEW_LINE> <DEDENT> def add_options(self, parser): <NEW_LINE> <INDENT> parser.add_option("--testbinary", dest="testbinary", default=os.geten...
Test framework for doing p2p comparison testing Sets up some bitcoind binaries: - 1 binary: test binary - 2 binaries: 1 test binary, 1 ref binary - n>2 binaries: 1 test binary, n-1 ref binaries
625990747047854f46340cf5
class InternalDataError(errors.Error): <NEW_LINE> <INDENT> pass
Problem with internal checkpkg data structures.
6259907492d797404e3897f9
class env_Original(Environment): <NEW_LINE> <INDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> special = self._special_set.get(key) <NEW_LINE> if special: <NEW_LINE> <INDENT> special(self, key, value) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if not SCons.Environment.is_valid_construction_var(key): <NE...
Original __setitem__()
62599074dd821e528d6da620
class SelectorDIC(ModelSelector): <NEW_LINE> <INDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", category=DeprecationWarning) <NEW_LINE> n_components_range = range(self.min_n_components, self.max_n_components + 1) <NEW_LINE> highest_DIC = float('-inf') <NEW_LINE> best_model = self.base_mode...
select best model based on Discriminative Information Criterion Biem, Alain. "A model selection criterion for classification: Application to hmm topology optimization." Document Analysis and Recognition, 2003. Proceedings. Seventh International Conference on. IEEE, 2003. http://citeseerx.ist.psu.edu/viewdoc/download?d...
625990747c178a314d78e889
class WeeklyReportBruteAttack(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MachineIp = None <NEW_LINE> self.Username = None <NEW_LINE> self.SrcIp = None <NEW_LINE> self.Count = None <NEW_LINE> self.AttackTime = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDE...
专业周报密码破解数据。
625990744428ac0f6e659e6b
class UsageError(CommandantError): <NEW_LINE> <INDENT> pass
Raised when too few command-line arguments are provided.
6259907444b2445a339b75fc
class Trigger_Monitor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pins = ['GP16', 'GP13'] <NEW_LINE> self.outputPin = Pin(self.pins[0], mode=Pin.OUT, value=1) <NEW_LINE> self.inputPin = Pin(self.pins[1], mode=Pin.IN, pull=Pin.PULL_UP) <NEW_LINE> self.triggerCount = 0 <NEW_LINE> self._trigg...
Is there a way to change the callback?
6259907476e4537e8c3f0ebc
class ListSelect(SlaveView): <NEW_LINE> <INDENT> builder_file = 'list_select.glade' <NEW_LINE> def __init__(self, df_data=None): <NEW_LINE> <INDENT> self.df_data = df_data <NEW_LINE> super(ListSelect, self).__init__() <NEW_LINE> <DEDENT> def create_ui(self): <NEW_LINE> <INDENT> super(ListSelect, self).create_ui() <NEW_...
.. versionchanged:: 0.21 Specify :attr:`builder_file` instead of :attr:`builder_path` to support loading ``.glade`` file from ``.zip`` files (e.g., in app packaged with Py2Exe).
62599074796e427e538500b6
class LOEA16_6: <NEW_LINE> <INDENT> play = Hit(ALL_CHARACTERS, 5)
Shard of Sulfuras
625990742c8b7c6e89bd5125
class ConcatTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> call('echo \'File1\' > file1', shell=True) <NEW_LINE> call('echo \'File2\' > file2', shell=True) <NEW_LINE> <DEDENT> def test_concat(self): <NEW_LINE> <INDENT> expected_output = 'File1\n\nFile2\n\n' <NEW_LINE> call('py solutio...
docstring for ConcatTest
6259907597e22403b383c83f
class PrintHandler(Handler): <NEW_LINE> <INDENT> def handle(self, data): <NEW_LINE> <INDENT> pprint.pprint(data)
Simple handler that only prints data.
62599075627d3e7fe0e087c5
class AxesWidget(Widget): <NEW_LINE> <INDENT> def __init__(self, ax): <NEW_LINE> <INDENT> self.ax = ax <NEW_LINE> self.canvas = ax.figure.canvas <NEW_LINE> self.cids = [] <NEW_LINE> <DEDENT> def connect_event(self, event, callback): <NEW_LINE> <INDENT> cid = self.canvas.mpl_connect(event, callback) <NEW_LINE> self.cids...
Widget that is connected to a single :class:`~matplotlib.axes.Axes`. To guarantee that the widget remains responsive and not garbage-collected, a reference to the object should be maintained by the user. This is necessary because the callback registry maintains only weak-refs to the functions, which are member functi...
62599075009cb60464d02e78
class FCB(ControlBlock): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ControlBlock.__init__(self) <NEW_LINE> self.index = [ ] <NEW_LINE> self.linkCount = 0 <NEW_LINE> self.openCount = 0 <NEW_LINE> <DEDENT> def nBlocks(self): <NEW_LINE> <INDENT> return len(self.index) <NEW_LINE> <DEDENT> def incrOpenCount...
FCB is the file control block. Note that there is the FCB on disk and in-memory FCB. The difference is in-memory one would have a count, but not on-disk. The name technically is not part of the FCB but kept by directory. it also does not know which directory it belongs to. The constructor should be called only by the ...
625990754c3428357761bbf3
class GiscedataPolissaTarifaPeriodes(osv.osv): <NEW_LINE> <INDENT> _name = 'giscedata.polissa.tarifa.periodes' <NEW_LINE> _inherit = 'giscedata.polissa.tarifa.periodes' <NEW_LINE> _columns = { 'product_gkwh_id': fields.many2one( 'product.product', 'Generation kWh', ondelete='restrict' ), }
Periodes de les Tarifes.
62599075f9cc0f698b1c5f6a
class _OptimizeHyperparametersEval(object): <NEW_LINE> <INDENT> def __init__(self, gp, opt_kwargs): <NEW_LINE> <INDENT> self.gp = gp <NEW_LINE> self.opt_kwargs = opt_kwargs <NEW_LINE> <DEDENT> def __call__(self, samp): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return scipy.optimize.minimize(self.gp.update_hyperparam...
Helper class to support parallel random starts of MAP estimation of hyperparameters. Parameters ---------- gp : :py:class:`GaussianProcess` instance Instance to wrap to allow parallel optimization of. opt_kwargs : dict Dictionary of keyword arguments to be passed to :py:func:`scipy.optimize.minimize`.
625990758a349b6b43687b96
class Until(TemporalOp): <NEW_LINE> <INDENT> nargs = 2 <NEW_LINE> def tex_print(self): <NEW_LINE> <INDENT> args_tex = tuple(arg.tex_print for arg in self.args) <NEW_LINE> a, b = self.interval <NEW_LINE> if math.isinf(b): <NEW_LINE> <INDENT> return r" U ".join(args_tex)
The Until operator
625990757b180e01f3e49d03
class Bound: <NEW_LINE> <INDENT> def __init__(self, pointList: [Point]): <NEW_LINE> <INDENT> self.southWest = pointList[0].copy() <NEW_LINE> self.northEast = pointList[0].copy() <NEW_LINE> for point in pointList: <NEW_LINE> <INDENT> self.southWest.x = point.x if point.x < self.southWest.x else self.southWest.x <NEW_LIN...
class Bound Bound of points
62599075a8370b77170f1d09
class TableXmlDumpPageGenerator: <NEW_LINE> <INDENT> def __init__(self, xmlfilename): <NEW_LINE> <INDENT> self.xmldump = xmlreader.XmlDump(xmlfilename) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for entry in self.xmldump.parse(): <NEW_LINE> <INDENT> if _table_start_regex.search(entry.text): <NEW_LINE> ...
Generator to yield all pages that seem to contain an HTML table.
62599075a8370b77170f1d0a
class TestLangQuirks(TestLang): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.purge() <NEW_LINE> self.quirks = True
Test language selectors with quirks.
6259907556b00c62f0fb420f
class InferenceEngine(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.knowledge_base = list() <NEW_LINE> self.inference_scratch_pad = list() <NEW_LINE> <DEDENT> def tell(self, cnf_sentence): <NEW_LINE> <INDENT> for item in self.knowledge_base: <NEW_LINE> <INDENT> if cmp(cnf_sentence, item) == ...
Description of the resolution inference engine
625990757047854f46340cf7
class Task(models.Model): <NEW_LINE> <INDENT> id = models.AutoField(primary_key=True) <NEW_LINE> TaskID = models.CharField(max_length=125,verbose_name='任务ID') <NEW_LINE> Taskname = models.CharField(max_length=125, verbose_name='任务名称') <NEW_LINE> Starttime = models.DateTimeField(default=timezone.now, verbose_name='开始时间'...
任务信息
625990759c8ee82313040e26
class Chain(object): <NEW_LINE> <INDENT> def __init__(self, *elements, **kwargs): <NEW_LINE> <INDENT> self.source, *self.codecs, self.channel = self.elements = elements <NEW_LINE> self.levels = len(self.codecs) + 1 <NEW_LINE> self.verbosity = kwargs.pop("verbosity", 0) <NEW_LINE> self.broken_string = colortools.colored...
It simulates an information transmitting chain.
6259907599cbb53fe6832829
class preprocessing_interface(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def tokenization(self, parameter_dictionary): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def stemming(self, parameter_dictionary): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def l...
this class is an interface for processing libraries
6259907544b2445a339b75fd
class Kutta4(odespy.Solver): <NEW_LINE> <INDENT> quick_description = "Explicit 4th-order Kutta method. LR Hellevik implementation" <NEW_LINE> def advance(self): <NEW_LINE> <INDENT> u, f, n, t = self.u, self.f, self.n, self.t <NEW_LINE> dt = t[n+1] - t[n] <NEW_LINE> dt3 = dt/3.0 <NEW_LINE> K1 = dt*f(u[n], t[n]) <NEW_LIN...
Kutta 4 method by LR Hellevik:: u[n+1] = u[n] + (K1 + 3*K2 + 3*K3 + K4)/8.0 where:: dt3 = dt/3.0 K1 = dt*f(u[n], t[n]) K2 = dt*f(u[n] + K1/3.0, t[n] + dt3) K3 = dt*f(u[n] - K1/3 + K2, t[n] + 2*dt3) K4 = dt*f(u[n] + K1 - K2 + K3, t[n] + dt)
625990758e7ae83300eea9d0
class JustScale(): <NEW_LINE> <INDENT> def __init__(self, tones=None): <NEW_LINE> <INDENT> self._tones = None <NEW_LINE> self._pitch_mapping = None <NEW_LINE> try: <NEW_LINE> <INDENT> self.tones = tones.intervals <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> self.tones = tones <NEW_LINE> <DEDENT> <DEDE...
This class implements arbitrary just intonation scales.
62599075091ae35668706577
class MLChainGroup(AppGroup): <NEW_LINE> <INDENT> def __init__( self, add_default_commands=True, create_app=None, add_version_option=True, load_dotenv=True, set_debug_flag=True, **extra ): <NEW_LINE> <INDENT> params = list(extra.pop("params", None) or ()) <NEW_LINE> if add_version_option: <NEW_LINE> <INDENT> params.app...
Special subclass of the :class:`AppGroup` group that supports loading more commands from the configured Flask app. Normally a developer does not have to interface with this class but there are some very advanced use cases for which it makes sense to create an instance of this. For information as of why this is useful ...
62599075aad79263cf4300f6
class ProjectConfigDownload(ProjectMixIn, base.BaseDownloadCommand): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ProjectConfigDownload, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'name', help='Name of the project.' ) <NEW_LINE> return parser <NEW_LINE> <DEDEN...
Gets some configuration information about a project. Note that this config info is not simply the contents of project.config; it generally contains fields that may have been inherited from parent projects.
6259907532920d7e50bc7986
class ExpoPSPol2D_pdf(PDF2) : <NEW_LINE> <INDENT> def __init__ ( self , name , x , y , psy = None , nx = 2 , ny = 2 , tau = None ) : <NEW_LINE> <INDENT> PDF2.__init__ ( self , name , x , y ) <NEW_LINE> taumax = 100 <NEW_LINE> mn,mx ...
Product of exponential and phase space factor, modulated by the positive polynom in 2D f(x,y) = exp(tau*x) * PS(y) * Pnk(x,y) where - PS (y) is a phase space function for y-axis (Ostap::Math::PhaseSpaceNL) - Pnk(x,y) is positive non-factorizable polynom Pnk(x,y) = sum^{i=n}_{i=0}sum{j=k}_{j=0} a^2_{ij} B^n_i(x) B^k_j...
625990755fcc89381b266df8
class UnsupportedEvent(Exception): <NEW_LINE> <INDENT> pass
Unsupported CoT Event.
625990755166f23b2e244d14
class EchoComponent(ComponentXMPP): <NEW_LINE> <INDENT> def __init__(self, jid, secret, server, port): <NEW_LINE> <INDENT> ComponentXMPP.__init__(self, jid, secret, server, port) <NEW_LINE> self.add_event_handler("message", self.message) <NEW_LINE> <DEDENT> def message(self, msg): <NEW_LINE> <INDENT> msg.reply("Thanks ...
A simple SleekXMPP component that echoes messages.
62599075bf627c535bcb2e0b
class ValidationError(BoobyError): <NEW_LINE> <INDENT> pass
This exception should be raised when a `value` doesn't validate. See :mod:`validators`.
6259907591f36d47f2231b2e
class TestEncodingCluster(object): <NEW_LINE> <INDENT> @pytest.fixture() <NEW_LINE> def r(self, request): <NEW_LINE> <INDENT> return _get_client(RedisCluster, request=request, decode_responses=True) <NEW_LINE> <DEDENT> @pytest.fixture() <NEW_LINE> def r_no_decode(self, request): <NEW_LINE> <INDENT> return _get_client( ...
We must import the entire class due to the seperate fixture that uses RedisCluster as client class instead of the normal Redis instance. FIXME: If possible, monkeypatching TestEncoding class would be preferred but kinda impossible in reality
625990755fdd1c0f98e5f8bc
class BaseData( object ): <NEW_LINE> <INDENT> def __init__(self, name,type="BaseData"): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = type <NEW_LINE> <DEDENT> def show( self ): <NEW_LINE> <INDENT> itsme = "\n%s \n\t name = %s" % (self.type, self.name) <NEW_LINE> for item in dir(self): <NEW_LINE> <INDENT> ...
Base class for container objects storing event data in memory (as numpy arrays mainly). Useful for passing the data to e.g. ipython for further investigation
6259907501c39578d7f143d4
class Generic_dbutils(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def tname(self, table): <NEW_LINE> <INDENT> if table != 'biosequence': <NEW_LINE> <INDENT> return table <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return 'bioentry' <NEW_LINE> <DEDENT> <DEDENT> def las...
Default database utilities.
6259907599fddb7c1ca63a74
class TaskAborted(Exception): <NEW_LINE> <INDENT> pass
The task has been aborted. This is similiar to JobAborted, but derives from Exception instead of BaseException. The TaskAborted exception is used to communicate to Celery to 'fail' the job. The JobAborted exception cannot be used; since its base is BaseException, it will cause the Celery worker to exit. So when Job...
625990758a349b6b43687b98
class RunTest: <NEW_LINE> <INDENT> def __init__(self, server=None): <NEW_LINE> <INDENT> self.speedTest = speedtest.Speedtest() <NEW_LINE> if server: <NEW_LINE> <INDENT> self.server = server <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.server = "" <NEW_LINE> <DEDENT> <DEDENT> def runPing(self): <NEW_LINE> <INDENT>...
By encapsulating SpeedTest into a class, it makes more obvious to run only ping tests
625990753317a56b869bf1e5
class PermissionComparisonNode(ResolverNode): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def handle_token(cls, parser, token): <NEW_LINE> <INDENT> bits = token.contents.split() <NEW_LINE> if 5 < len(bits) < 3: <NEW_LINE> <INDENT> raise template.TemplateSyntaxError("'%s' tag takes three, " "four or five arguments" % bi...
Implements a node to provide an "if user/group has permission on object"
625990757047854f46340cf9
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('category name'), max_length=20) <NEW_LINE> created_time = models.DateTimeField(_('create time'), auto_now_add=True) <NEW_LINE> last_modified_time = models.DateTimeField(_('last modified time'), auto_now=True) <NEW_LINE> def __unicode__(self): ...
储存文章的分类信息
62599075dd821e528d6da622
class Field(GDALBase): <NEW_LINE> <INDENT> def __init__(self, feat, index): <NEW_LINE> <INDENT> self._feat = feat <NEW_LINE> self._index = index <NEW_LINE> fld_ptr = capi.get_feat_field_defn(feat.ptr, index) <NEW_LINE> if not fld_ptr: <NEW_LINE> <INDENT> raise OGRException('Cannot create OGR Field, invalid pointer give...
This class wraps an OGR Field, and needs to be instantiated from a Feature object.
62599075be8e80087fbc09d2
class Deflector: <NEW_LINE> <INDENT> def __init__(self, tem): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._tem = tem <NEW_LINE> self._getter = None <NEW_LINE> self._setter = None <NEW_LINE> self.key = 'def' <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> x, y = self.get() <NEW_LINE> return f'{sel...
Generic microscope deflector object defined by X/Y values Must be subclassed to set the self._getter, self._setter functions.
625990752c8b7c6e89bd5128
class BaseQuery(orm.Query): <NEW_LINE> <INDENT> def get_or_404(self, ident, description=None): <NEW_LINE> <INDENT> rv = self.get(ident) <NEW_LINE> if rv is None: <NEW_LINE> <INDENT> abort(404, description=None) <NEW_LINE> <DEDENT> return rv <NEW_LINE> <DEDENT> def first_or_404(self, description=None): <NEW_LINE> <INDEN...
The default query object used for models, and exposed as :attr:`~SQLAlchemy.Query`. This can be subclassed and replaced for individual models by setting the :attr:`~Model.query_class` attribute. This is a subclass of a standard SQLAlchemy :class:`~sqlalchemy.orm.query.Query` class and has all the methods of a standard...
62599075379a373c97d9a962
class VariableRecoveryFastState(VariableRecoveryStateBase): <NEW_LINE> <INDENT> def __init__(self, block_addr, analysis, arch, func, stack_region=None, register_region=None, processor_state=None): <NEW_LINE> <INDENT> super().__init__(block_addr, analysis, arch, func, stack_region=stack_region, register_region=register_...
The abstract state of variable recovery analysis. :ivar KeyedRegion stack_region: The stack store. :ivar KeyedRegion register_region: The register store.
62599075cc0a2c111447c771
class Layer(object): <NEW_LINE> <INDENT> def __init__(self, num_neurons, num_inputs, activation, derivative): <NEW_LINE> <INDENT> self.neurons = [Neuron(num_inputs, activation, derivative) for i in range(0, num_neurons, 1)] <NEW_LINE> <DEDENT> def process(self, inputs): <NEW_LINE> <INDENT> return [neuron.process(inputs...
A layer is a layer of neurons in a neural network (sometimes called Synapses) @property (Array<Neuron>) neurons - The neurons in the layer
62599075aad79263cf4300f8
class Controller(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.add_flag = self.del_flag = self.open_flag = False <NEW_LINE> self.browser = web.Browser("websites_saved.json") <NEW_LINE> self.browser.load_links() <NEW_LINE> self.GUI = G.MainGUI(self) <NEW_LINE> self.GUI.window.mainloop() <NEW_LINE> ...
Manage: GUI vs Back-End code
625990755166f23b2e244d16
class ChoiceAndCharInputWidget(ExtendedMultiWidget): <NEW_LINE> <INDENT> def __init__(self, choices=None, attrs=None, widgets=None, widget_css_class='choice-and-char-widget', **kwargs): <NEW_LINE> <INDENT> if not attrs: <NEW_LINE> <INDENT> attrs = {} <NEW_LINE> <DEDENT> if not widgets: <NEW_LINE> <INDENT> widgets = ( S...
Renders choice field and char field next to each other.
625990758e7ae83300eea9d3
class LogoutThenLoginView(LogoutView): <NEW_LINE> <INDENT> next_page = settings.LOGIN_URL <NEW_LINE> template_name = 'registration/logged_out.html'
Thoát xong nhảy tới trang login.
625990755fc7496912d48f0a
class PersonTag(Row): <NEW_LINE> <INDENT> table_name = 'person_tag' <NEW_LINE> primary_key = 'person_tag_id' <NEW_LINE> fields = { 'person_tag_id': Parameter(int, "Person setting identifier"), 'person_id': Person.fields['person_id'], 'email': Person.fields['email'], 'tag_type_id': TagType.fields['tag_type_id'], 'tagnam...
Representation of a row in the person_tag. To use, instantiate with a dict of values.
625990753539df3088ecdbd8
class WatchdogWorkerProcess(WorkerProcess): <NEW_LINE> <INDENT> def _start_file_watcher(self, project_dir): <NEW_LINE> <INDENT> restart_callback = WatchdogRestarter(self._restart_event) <NEW_LINE> watcher = WatchdogFileWatcher() <NEW_LINE> watcher.watch_for_file_changes( project_dir, restart_callback)
Worker that runs the chalice dev server.
62599075627d3e7fe0e087c9
@total_ordering <NEW_LINE> class RateLimitItem(metaclass=RateLimitItemMeta): <NEW_LINE> <INDENT> __slots__ = ["namespace", "amount", "multiples", "granularity"] <NEW_LINE> GRANULARITY: Granularity <NEW_LINE> def __init__( self, amount: int, multiples: Optional[int] = 1, namespace: str = "LIMITER" ): <NEW_LINE> <INDENT>...
defines a Rate limited resource which contains the characteristic namespace, amount and granularity multiples of the rate limiting window. :param amount: the rate limit amount :param multiples: multiple of the 'per' :attr:`GRANULARITY` (e.g. 'n' per 'm' seconds) :param namespace: category for the specific rate limit
6259907501c39578d7f143d5
class GaussRV(RV_with_mean_and_cov): <NEW_LINE> <INDENT> def _sample(self, N): <NEW_LINE> <INDENT> R = self.C.Right <NEW_LINE> D = rnd.randn(N, len(R)) @ R <NEW_LINE> return D
Gaussian (Normal) multivariate random variable.
6259907599fddb7c1ca63a75
class TemplateArgsTest(InvenioTestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setup_app(cls, app): <NEW_LINE> <INDENT> from invenio.ext.template.context_processor import template_args <NEW_LINE> from invenio.modules.collections.views.collections import index <NEW_LINE> @template_args(index) <NEW_LINE> def fo...
Test ``template_args`` decorator.
6259907597e22403b383c844
class __API(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> if 'LIBCASM' in os.environ: <NEW_LINE> <INDENT> libname = os.environ['LIBCASM'] <NEW_LINE> <DEDENT> elif 'CASM_PREFIX' in os.environ: <NEW_LINE> <INDENT> libname = glob.glob(join(os.environ['CASM_PREFIX'], 'lib', 'libcasm.*'))[0] <NEW_LINE...
Hidden class of which there will be only one instance Attributes ---------- lib_casm: ctypes.CDLL Handle to libcasm.* lib_ccasm: ctypes.CDLL Handle to libccasm.*
62599075d268445f2663a7fe
@method_decorator(csp_exempt, name="dispatch") <NEW_LINE> class CreateFlatPage(LoginRequiredMixin, PermissionRequiredMixin, CreateView): <NEW_LINE> <INDENT> permission_required = "flatpage.add_flatpage" <NEW_LINE> model = flatpages.models.FlatPage <NEW_LINE> form_class = forms.FlatPage <NEW_LINE> def get_success_url(se...
Create flat page.
625990758a349b6b43687b9a
class updateDataVersion_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.I32, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAcce...
Attributes: - success
625990753317a56b869bf1e6
class PhysicalCoordinate(Coord): <NEW_LINE> <INDENT> def __init__(self, model_view): <NEW_LINE> <INDENT> super().__init__(model_view) <NEW_LINE> self.cval = None <NEW_LINE> self.dmtype = "PhysicalCoordinate" <NEW_LINE> for ele in model_view.xpath('.//INSTANCE[@dmrole="coords:PhysicalCoordinate.cval"]'): <NEW_LINE> <IND...
classdocs
625990753346ee7daa338301
class MachineTranslationTest(TestCase): <NEW_LINE> <INDENT> def test_support(self): <NEW_LINE> <INDENT> machine_translation = DummyTranslation() <NEW_LINE> self.assertTrue(machine_translation.is_supported('cs')) <NEW_LINE> self.assertFalse(machine_translation.is_supported('de')) <NEW_LINE> <DEDENT> def test_translate(s...
Testing of machine translation core.
62599075be7bc26dc9252af6
class Connector(AbstractConnector): <NEW_LINE> <INDENT> def __init__(self, index, statuses, resultsQueue, freeWorker, cfg, warebox, enc_dir, lockfile_fd): <NEW_LINE> <INDENT> AbstractConnector.__init__(self, index, statuses, resultsQueue, freeWorker) <NEW_LINE> self.cfg = cfg <NEW_LINE> self.warebox = warebox <NEW_LINE...
CryptoConnector extend the prototypes.Connector.Connector
62599075435de62698e9d74a
class V1beta3_ServiceSpec(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'createExternalLoadBalancer': 'bool', 'portalIP': 'str', 'ports': 'list[V1beta3_ServicePort]', 'publicIPs': 'list[str]', 'selector': 'dict', 'sessionAffinity': 'str' } <NEW_LINE> self.attributeMap = { 'c...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259907566673b3332c31d40
class MoveTo(Action): <NEW_LINE> <INDENT> def __init__(self, bot, pos): <NEW_LINE> <INDENT> super(MoveTo, self).__init__(bot) <NEW_LINE> self.pos = pos <NEW_LINE> <DEDENT> def do(self): <NEW_LINE> <INDENT> delta = self.pos - self.bot.pos <NEW_LINE> if delta.length() < 1: <NEW_LINE> <INDENT> self.bot.move(delta) <NEW_LI...
I would move to a coordinate, but John has been concentrating on mining
62599075d486a94d0ba2d8fb
class WideResNet16(WideResNet): <NEW_LINE> <INDENT> blocks_per_group = ( (16 - 4) // 6, (16 - 4) // 6, (16 - 4) // 6, )
16-layer wide residual network with v1 structure.
6259907556ac1b37e6303983
class IdaCMD(DisasCMD): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def identify(path): <NEW_LINE> <INDENT> return os.path.split(path)[-1].split('.')[0].lower().startswith("ida") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def name(): <NEW_LINE> <INDENT> return "IDA" <NEW_LINE> <DEDENT> def createDatabase(self, binar...
DisasCMD implementation for the IDA disassembler.
62599075379a373c97d9a964
class McCallModel: <NEW_LINE> <INDENT> def __init__(self, α=0.2, β=0.98, γ=0.7, c=6.0, σ=2.0, w_vec=None, p_vec=None): <NEW_LINE> <INDENT> self.α, self.β, self.γ, self.c = α, β, γ, c <NEW_LINE> self.σ = σ <NEW_LINE> if w_vec is None: <NEW_LINE> <INDENT> n = 60 <NEW_LINE> self.w_vec = np.linspace(10, 20, n) <NEW_LINE> a...
Stores the parameters and functions associated with a given model.
62599075a05bb46b3848bdcc
class DAO(object): <NEW_LINE> <INDENT> def data_dyad(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def data_monad(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def iter(self): <NEW_LINE> <INDENT> raise NotImplementedError()
I'm not actually sure how abstractions/interfaces are implemented in Python. But here you go. It's supposed to describe the interface of how input--output pairs are retrieved.
62599075091ae3566870657b
class BaseModel: <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if len(kwargs) > 0: <NEW_LINE> <INDENT> for key, value in kwargs.items(): <NEW_LINE> <INDENT> if key == "updated_at": <NEW_LINE> <INDENT> value = datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%f") <NEW_LINE> <DEDENT> elif key ==...
class for all other classes to inherit from
625990755fc7496912d48f0b
class Twitter: <NEW_LINE> <INDENT> HASH_TAG = "#BCDev" <NEW_LINE> TWITTER_STATUS_LENGTH = 140 <NEW_LINE> DEFAULT_TWITTER_URL_LENGTH = 23 <NEW_LINE> ELLIPSIS = u"\u2026" <NEW_LINE> def __init__(self, twitter_credentials, twitter_config_store): <NEW_LINE> <INDENT> auth = tweepy.OAuthHandler(twitter_credentials['consumer_...
Class for interacting with the Tweepy API and formatting twitter statuses.
62599075adb09d7d5dc0bead
class Circle: <NEW_LINE> <INDENT> def __init__(self, radius): <NEW_LINE> <INDENT> self.radius = radius <NEW_LINE> <DEDENT> @property <NEW_LINE> def diameter(self): <NEW_LINE> <INDENT> return self.radius * 2 <NEW_LINE> <DEDENT> @diameter.setter <NEW_LINE> def diameter(self, value): <NEW_LINE> <INDENT> self.radius = valu...
create a circle class that represents a simple circle
6259907501c39578d7f143d6
class PluginTemplateEngine(): <NEW_LINE> <INDENT> def __init__(self, config: dict, dotbot: dict) -> None: <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.dotbot = dotbot <NEW_LINE> self.logger_level = '' <NEW_LINE> self.bot = None <NEW_LINE> self.logger = None <NEW_LINE> <DEDENT> def init(self, bot: ChatbotEng...
.
62599075f9cc0f698b1c5f6d
class market_environment(object): <NEW_LINE> <INDENT> def __init__(self, name, pricing_date): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.pricing_date = pricing_date <NEW_LINE> self.constants = {} <NEW_LINE> self.lists = {} <NEW_LINE> self.curves = {} <NEW_LINE> <DEDENT> def add_constant(self, key, constant): ...
Class to model a market environment relevant for valuation. Attributes ========== name : string name of the market environment pricing_date : datetime object date of the market environment Methods ======= add_constant : adds a constant (e.g. model parameter) get_constant: gets a constant add_list : ...
62599075baa26c4b54d50bf2
class _PlottingContext(_RCAesthetics): <NEW_LINE> <INDENT> _keys = _context_keys <NEW_LINE> _set = staticmethod(_set_context)
Light wrapper on a dict to set context temporarily.
6259907563b5f9789fe86aa8
class TrackValidation: <NEW_LINE> <INDENT> def __init__(self, trackname): <NEW_LINE> <INDENT> self.track_name = trackname <NEW_LINE> self.pct_overhead_ops = 0.0 <NEW_LINE> self.pct_overhead_ops_acceptable = False <NEW_LINE> self.pct_ops_failed = 0.0 <NEW_LINE> self.pct_failed_ops_acceptable = False <NEW_LINE> self.op_r...
Class for deciding whether a track summary from a run should be considered valid based on the overheads and response times recorded
6259907599cbb53fe683282e
class Undo: <NEW_LINE> <INDENT> def __init__(self, folderToStore): <NEW_LINE> <INDENT> self.whatToUndo = [] <NEW_LINE> self.separator = ',' <NEW_LINE> self.folderToStore = folderToStore <NEW_LINE> self.fileOps = FileOperations() <NEW_LINE> <DEDENT> def add(self, oldPath, oldFilename, newPath, newFilename): <NEW_LINE> <...
This class allows the creation of an undo file and allows using an existing undo file to undo the file operations that were performed earlier
625990757047854f46340cfd
class TokenManager(object): <NEW_LINE> <INDENT> def __init__(self, username=None, password=None, client_id=None, client_secret=None, app_url=defaults.APP_URL): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.password = password <NEW_LINE> self.client_id = client_id <NEW_LINE> self.client_secret = client_se...
jut authentication token manager which handles the refreshing of auth tokens as well as caching of valid authentication tokens
625990754527f215b58eb642
class h3(html_tag): <NEW_LINE> <INDENT> pass
Represents the third-highest ranking heading.
6259907592d797404e3897fd
class LRFinder(Callback): <NEW_LINE> <INDENT> def __init__(self, min_lr=1e-5, max_lr=1e-2, steps_per_epoch=None, epochs=None, beta=0.9): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.min_lr = min_lr <NEW_LINE> self.max_lr = max_lr <NEW_LINE> self.total_iterations = steps_per_epoch * epochs <NEW_LINE> self.iter...
The Learning Rate range test: a callback for finding the optimal learning rate range This function will # Usage ``` lr_finder = LRFinder(min_lr=1e-5, max_lr=1e-2, steps_per_epoch=np.ceil(data_size/batch_size), epo...
62599075a05bb46b3848bdcd
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = _(messages.PLURAL_SYS_CONN_RESULTS_MSG)
Metadata for model.
625990754a966d76dd5f082e
class XP2003x64TimerVType(obj.ProfileModification): <NEW_LINE> <INDENT> conditions = {'os': lambda x: x == 'windows', 'memory_model': lambda x: x == '64bit', 'major': lambda x: x < 6} <NEW_LINE> def modification(self, profile): <NEW_LINE> <INDENT> profile.vtypes.update({ 'tagTIMER' : [ None, { 'head' : [ 0x00, ['_HEAD'...
Apply the tagTIMER for XP and 2003 x64
625990755166f23b2e244d1a
class IUshahidiMapView(Interface): <NEW_LINE> <INDENT> pass
Marker Interface for Ushahidi Map View
6259907597e22403b383c847
class NumericValidator(RequiredValidator): <NEW_LINE> <INDENT> def validate(self, value): <NEW_LINE> <INDENT> if value is not None: <NEW_LINE> <INDENT> if not isinstance(value, Number): <NEW_LINE> <INDENT> raise ValidationError("{value} ({type}) is not numeric".format( value=value, type=type(value))) <NEW_LINE> <DEDENT...
Tests that the provided value is a python numeric type.
62599075009cb60464d02e80
class SimpleProductSearchHandler(MultipleObjectMixin): <NEW_LINE> <INDENT> paginate_by = settings.OSCAR_PRODUCTS_PER_PAGE <NEW_LINE> def __init__(self, request_data, full_path, categories=None): <NEW_LINE> <INDENT> self.categories = categories <NEW_LINE> self.kwargs = {'page': request_data.get('page', 1)} <NEW_LINE> se...
A basic implementation of the full-featured SearchHandler that has no faceting support, but doesn't require a Haystack backend. It only supports category browsing. Note that is meant as a replacement search handler and not as a view mixin; the mixin just does most of what we need it to do.
62599075adb09d7d5dc0beaf
class BoundaryTree: <NEW_LINE> <INDENT> def __init__(self, position, label, children=None, parent=None): <NEW_LINE> <INDENT> self.position = position <NEW_LINE> self.label = label <NEW_LINE> if children is None: <NEW_LINE> <INDENT> self.children = [] <NEW_LINE> self.childnum = 0 <NEW_LINE> <DEDENT> else: <NEW_LINE> <IN...
Boundary Tree. Parameters ---------- position : np.array Position vector of a point. label : np.array or float Label of a point. children : List of BoundaryTrees, optional List of child nodes (default []). parent : BoundaryTree, optional Parent node (default None).
62599075167d2b6e312b8233