code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class StoreRequest(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> stored_request = Request() <NEW_LINE> for f in ('META', 'path'): <NEW_LINE> <INDENT> setattr(stored_request, f.lower(), str(getattr(request, f))) <NEW_LINE> <DEDENT> stored_request.path = str(request.path) <NEW_LINE>... | Saves every request to db | 62598f598c3a8732951f5a93 |
class InvalidObjectReference(Exception): <NEW_LINE> <INDENT> def __init__(self, obj): <NEW_LINE> <INDENT> self.object = obj | Object reference invalid for this database. | 62598f59a8ecb03325870742 |
class Solution1: <NEW_LINE> <INDENT> def maximalRectangle(self, matrix): <NEW_LINE> <INDENT> if not matrix or not matrix[0]: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> res = 0 <NEW_LINE> m, n = len(matrix), len(matrix[0]) <NEW_LINE> hGrid = [[0 for j in range(n + 1)] for i in range(m)] <NEW_LINE> for i in range(m... | @param matrix: a boolean 2D matrix
@return: an integer | 62598f59d164cc61758204c1 |
class HomeAssistantView(object): <NEW_LINE> <INDENT> extra_urls = [] <NEW_LINE> requires_auth = True <NEW_LINE> def __init__(self, hass): <NEW_LINE> <INDENT> from werkzeug.wrappers import Response <NEW_LINE> if not hasattr(self, 'url'): <NEW_LINE> <INDENT> class_name = self.__class__.__name__ <NEW_LINE> raise Attribute... | Base view for all views. | 62598f59d164cc61758204c3 |
class GraphvizPreprocessor(markdown.preprocessors.Preprocessor): <NEW_LINE> <INDENT> def __init__(self, graphviz): <NEW_LINE> <INDENT> self.formatters = ["dot", "neato", "lefty", "dotty"] <NEW_LINE> self.graphviz = graphviz <NEW_LINE> self.start_re = re.compile(r'^<(%s)>' % '|'.join(self.formatters)) <NEW_LINE> self.en... | Find all graphviz blocks, generate images and inject image link to
generated images. | 62598f59167d2b6e312b64c1 |
@unique <NEW_LINE> class AlertStatus(IntEnum): <NEW_LINE> <INDENT> OK = 0x00 <NEW_LINE> ALERT = 0xFF | Indicates if the alert is present or not. | 62598f595e10d32532ce3389 |
class OrgApply(BaseModel): <NEW_LINE> <INDENT> org = models.ForeignKey(Organization, verbose_name=u"隶属组织") <NEW_LINE> checker = models.ForeignKey(Person, related_name='checker', null=True, blank=True, verbose_name=u'审核人', help_text=u'隶属项目') <NEW_LINE> user = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=u'用户... | 组织加入申请
by:王健 at:2016-04-18 | 62598f59507cdc57c63a42e1 |
class OrganizationMemberTeam(BaseModel): <NEW_LINE> <INDENT> __core__ = True <NEW_LINE> id = BoundedAutoField(primary_key=True) <NEW_LINE> team = FlexibleForeignKey("sentry.Team") <NEW_LINE> organizationmember = FlexibleForeignKey("sentry.OrganizationMember") <NEW_LINE> is_active = models.BooleanField(default=True) <NE... | Identifies relationships between organization members and the teams they are on. | 62598f5921a7993f00c654bb |
class DefaultQueue: <NEW_LINE> <INDENT> def __init__(self, default_func): <NEW_LINE> <INDENT> self._dq = deque() <NEW_LINE> self.default_func = default_func <NEW_LINE> <DEDENT> def add_right(self, item): <NEW_LINE> <INDENT> self._dq.append(item) <NEW_LINE> <DEDENT> def pop_left(self): <NEW_LINE> <INDENT> if self._dq: <... | LIFO queue class that takes a producer function as input. | 62598f59a8ecb03325870746 |
class PDT_OT_ViewRotD(Operator): <NEW_LINE> <INDENT> bl_idname = "pdt.viewdown" <NEW_LINE> bl_label = "Rotate Down" <NEW_LINE> bl_options = {"REGISTER", "UNDO"} <NEW_LINE> bl_description = "View Orbit Down by Delta Value" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> scene = context.scene <NEW_LINE> pg = s... | Rotate View Down. | 62598f596fece00bbaccaed7 |
class GraphColorGrid(Graph): <NEW_LINE> <INDENT> _DOC_ATTR = { 'hideLeftBottomSpines': 'bool to hide the left and bottom axis spines; default True', } <NEW_LINE> graphType = 'colorGrid' <NEW_LINE> figureSizeDefault = (9, 6) <NEW_LINE> keywordConfigurables = Graph.keywordConfigurables + ('hideLeftBottomSpines',) <NEW_LI... | Grid of discrete colored "blocks" to visualize results of a windowed analysis routine.
Data is provided as a list of lists of colors, where colors are specified as a hex triplet,
or the common HTML color codes, and based on analysis-specific mapping of colors to results.
>>> #_DOCS_SHOW g = graph.primitives.GraphCol... | 62598f59ff9c53063f519b95 |
class Scipy2Corpus(object): <NEW_LINE> <INDENT> def __init__(self, vecs): <NEW_LINE> <INDENT> self.vecs = vecs <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> for vec in self.vecs: <NEW_LINE> <INDENT> if isinstance(vec, np.ndarray): <NEW_LINE> <INDENT> yield full2sparse(vec) <NEW_LINE> <DEDENT> else: <NEW_L... | Convert a sequence of dense/sparse vectors into a streamed gensim corpus object.
See Also
--------
:func:`~gensim.matutils.corpus2csc` | 62598f598c3a8732951f5a9a |
class Dosage(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = "Dosage" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.additionalInstruction = None <NEW_LINE> self.asNeededBoolean = None <NEW_LINE> self.asNeededCodeableConcept = None <NEW_LINE> self.doseAndRate =... | How the medication is/was taken or should be taken.
Indicates how the medication is/was taken or should be taken by the
patient. | 62598f594d74a7450cd5897b |
class Datagridtable(object): <NEW_LINE> <INDENT> def __init__(self, name=None, datagridfields=[]): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> self.__datagridfields = [] <NEW_LINE> for f in datagridfields: <NEW_LINE> <INDENT> if isinstance(f, Datagridfield): <NEW_LINE> <INDENT> self.__datagridfields.append(f) <NE... | classdocs | 62598f59711fe17d825dfc3e |
class np_dhkey(BaseModel): <NEW_LINE> <INDENT> data: bytes(constr(min_length=32, max_length=32)) | a blake2b hash value of: the signature of an identity, a message subject, a string. Anything that you would like to hash | 62598f59bf627c535bcb09c6 |
class IVideo(interface.Interface): <NEW_LINE> <INDENT> title = schema.TextLine(title=_(u'Title'), required=False) <NEW_LINE> description = schema.Text(title=_(u'Description'), required=False) <NEW_LINE> rich_description = schema.Text(title=_(u'Rich Text Description'), required=False) <NEW_LINE> file = p4afile.FileField... | Objects which have video information.
| 62598f59287bf620b6271100 |
class VirtualTarget: <NEW_LINE> <INDENT> def __init__ (self, name, project): <NEW_LINE> <INDENT> if __debug__: <NEW_LINE> <INDENT> from .targets import ProjectTarget <NEW_LINE> assert isinstance(name, basestring) <NEW_LINE> assert isinstance(project, ProjectTarget) <NEW_LINE> <DEDENT> self.name_ = name <NEW_LINE> self.... | Potential target. It can be converted into jam target and used in
building, if needed. However, it can be also dropped, which allows
to search for different transformation and select only one.
name: name of this target.
project: project to which this target belongs. | 62598f59507cdc57c63a42e7 |
class Test(object): <NEW_LINE> <INDENT> def __init__(self, filename, num): <NEW_LINE> <INDENT> d = pq(filename=filename) <NEW_LINE> self.num = num <NEW_LINE> self.conclusion(d('.answer_list')) <NEW_LINE> self.question(d('.option_list')) <NEW_LINE> self.title = d('h1')[0].text <NEW_LINE> self.type = 'jump' <NEW_LINE> t ... | 测试 | 62598f5976d4e153a661c15a |
class Array: <NEW_LINE> <INDENT> class Led: <NEW_LINE> <INDENT> def __init__(self, array, index): <NEW_LINE> <INDENT> self.__dict__['array'] = array <NEW_LINE> self.__dict__['index'] = index <NEW_LINE> <DEDENT> def set(self, red=0, green=0, blue=0): <NEW_LINE> <INDENT> self.__store('red', red) <NEW_LINE> self.__store('... | Light thingy. | 62598f59bf627c535bcb09c8 |
class Rated(models.Model): <NEW_LINE> <INDENT> DIRECTION_CHOICES = (('up', 'Up'), ('down', 'Down')) <NEW_LINE> rankable = models.ForeignKey('Rankable') <NEW_LINE> userprofile = models.ForeignKey(UserProfile) <NEW_LINE> date_rated = models.DateTimeField(default=datetime.datetime.now) <NEW_LINE> direction = models.CharFi... | This is the manager for the ManyToManyField
holding the person who rates the Rankable object. | 62598f59d164cc61758204cb |
class PTBInput(object): <NEW_LINE> <INDENT> def __init__(self, config, data, name=None): <NEW_LINE> <INDENT> self.epoch_size = ((len(data) // config.batch_size) - 1) // config.num_steps <NEW_LINE> self.input_data, self.targets = reader.ptb_producer( data, config.batch_size, config.num_steps, name=name) | The input data. | 62598f5a5e10d32532ce338d |
class ViewTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.bucketlist_data = {'name': 'Go to Ibiza'} <NEW_LINE> self.response = self.client.post( reverse('create'), self.bucketlist_data, format='json' ) <NEW_LINE> <DEDENT> def test_api_can_create_a_b... | test suite for api views, sort of like controller tests in Rails | 62598f5a76d4e153a661c15c |
class RandomizedSet1(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.l = [] <NEW_LINE> self.d = {} <NEW_LINE> <DEDENT> def insert(self, val): <NEW_LINE> <INDENT> if val in self.d: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> self.d[val] = len(self.l) <NEW_LINE> self.l.append(val) <NEW_... | ERROR: type should be string, got "https://leetcode.com/problems/insert-delete-getrandom-o1/discuss/85414/2-Python-implementations-using-dictionary-and-list-(Syned-and-Asyned)-with-explanationl\n\nbeats 85.79%" | 62598f5ad18da76e235b6bdc |
class PwApp(tk.Frame): <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> tk.Frame.__init__(self, master) <NEW_LINE> master.resizable(False, False) <NEW_LINE> self.pw_fail_cnt = 0 <NEW_LINE> top = self.top = master <NEW_LINE> pw_label = tk.Label(top, text="Password") <NEW_LINE> self.raw_pw = tk.Entry(t... | Password application class | 62598f5a56b00c62f0fb1e03 |
class NeverStopStrategy(StopStrategy): <NEW_LINE> <INDENT> def should_continue(self, attempts, elapsed_time): <NEW_LINE> <INDENT> return True | A :class:`StopStrategy` that never gives up. | 62598f5a462c4b4f79dbaf50 |
class MarkovChainCell(tf.nn.rnn_cell.RNNCell): <NEW_LINE> <INDENT> def __init__(self, table): <NEW_LINE> <INDENT> assert len(table.shape) == 3 and table.shape[0] == table.shape[1] == table.shape[2] <NEW_LINE> with np.errstate(divide='ignore'): <NEW_LINE> <INDENT> self.log_table = np.log(np.asarray(table, dtype=np.float... | This cell type is only used for testing the beam decoder.
It represents a Markov chain characterized by a probability table p(x_t|x_{t-1},x_{t-2}). | 62598f5a507cdc57c63a42eb |
class BusyCursor(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> wx.BeginBusyCursor() <NEW_LINE> <DEDENT> def __exit__(self, type, value, traceback): <NEW_LINE> <INDENT> wx.EndBusyCursor() | Wrapper around wx.BeginBusyCursor and wx.EndBusyCursor, to be used with
Pythons 'with' semantics. | 62598f5a9b70327d1c57e2f5 |
@_NextHop.register_type(ZEBRA_NEXTHOP_IPV4) <NEW_LINE> class NextHopIPv4(_NextHop): <NEW_LINE> <INDENT> _BODY_FMT = '!4s' <NEW_LINE> BODY_SIZE = struct.calcsize(_BODY_FMT) <NEW_LINE> @classmethod <NEW_LINE> def parse(cls, buf): <NEW_LINE> <INDENT> addr = addrconv.ipv4.bin_to_text(buf[:cls.BODY_SIZE]) <NEW_LINE> rest = ... | Nexthop class for ZEBRA_NEXTHOP_IPV4 type. | 62598f5a925a0f43d25e7582 |
class _Identity(_Bijector): <NEW_LINE> <INDENT> def __init__(self, validate_args=False, name="Identity"): <NEW_LINE> <INDENT> super(_Identity, self).__init__( batch_ndims=0, event_ndims=0, is_constant_jacobian=True, validate_args=validate_args, name=name) <NEW_LINE> self._is_constant_jacobian = True <NEW_LINE> <DEDENT>... | Bijector which computes Y = g(X) = X.
Example Use:
```python
# Create the Y=g(X)=X transform which is intended for Tensors with 1 batch
# ndim and 1 event ndim (i.e., vector of vectors).
identity = Identity(batch_ndims=1, event_ndims=1)
x = [[1., 2],
[3, 4]]
x == identity.forward(x) == identity.inverse(x)
``` | 62598f5a711fe17d825dfc46 |
class Mcat(core.DirectoryDumperMixin, Mfind): <NEW_LINE> <INDENT> __name = "mcat" <NEW_LINE> table_header = [ dict(name="Range start", cname="start", width=12), dict(name="Range end", cname="end", width=12), dict(name="path", width=80), dict(name="Dumped As", cname="dump_name", width=80), ] <NEW_LINE> def collect(self)... | Returns the contents available in memory for a given file.
Ranges of the file that are not present in memory are returned blank. | 62598f5a8c3a8732951f5aa4 |
class CompareVersions(unittest.TestCase): <NEW_LINE> <INDENT> def test_version_pairs_1(self): <NEW_LINE> <INDENT> self.assertTrue(is_not_secure('2.1', '2.0.2')) <NEW_LINE> <DEDENT> def test_version_pairs_2(self): <NEW_LINE> <INDENT> self.assertTrue(is_not_secure('2.0.1', '2.0')) <NEW_LINE> <DEDENT> def test_version_pai... | Testing that comparison of version numbers are correct. No setup needed for these. | 62598f5a462c4b4f79dbaf54 |
class Notice(db.Document): <NEW_LINE> <INDENT> title = db.StringField(required=True) <NEW_LINE> content = db.StringField(required=True) <NEW_LINE> url = db.StringField() <NEW_LINE> create_time = db.IntField(default=time_int) <NEW_LINE> is_read = db.BooleanField(default=False) <NEW_LINE> read_time = db.IntField() <NEW_L... | 通知模型 | 62598f5a8c3a8732951f5aa5 |
class MiscDisplayConfig(Config): <NEW_LINE> <INDENT> CONFIG = justbases.BasesConfig.DISPLAY_CONFIG <NEW_LINE> _FIELD_MAP = { "show_approx_str": ("Indicate if value is approximate?", JustSelector(bool)) } | Miscellaneous display options. | 62598f5a5166f23b2e24292e |
class PoolGetAllLifetimeStatisticsOptions(Model): <NEW_LINE> <INDENT> def __init__(self, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None): <NEW_LINE> <INDENT> super(PoolGetAllLifetimeStatisticsOptions, self).__init__() <NEW_LINE> self.timeout = timeout <NEW_LINE> self.client_request_id... | Additional parameters for get_all_lifetime_statistics operation.
:param timeout: The maximum time that the server can spend processing the
request, in seconds. The default is 30 seconds. Default value: 30 .
:type timeout: int
:param client_request_id: The caller-generated request identity, in the
form of a GUID with... | 62598f5abf627c535bcb09d0 |
class SignalCatcher: <NEW_LINE> <INDENT> _m = _signal <NEW_LINE> def __init__(self, ed, bufsize:int=256): <NEW_LINE> <INDENT> self._pipe_setup(ed) <NEW_LINE> self.bufsize = bufsize <NEW_LINE> self.sd_buffers_resize(bufsize) <NEW_LINE> self._m.set_wakeup_fd(self._pipe_w) <NEW_LINE> <DEDENT> def _pipe_setup(self, ed): <N... | Signal-catching class; shouldn't be instantiated more than once.
Note that while they aren't listed in the auto-generated docs, you can
also access all attributes and methods of gonium.posix._signal as
attributes of objects of this type. | 62598f5a796e427e5384dce6 |
class CfUsb: <NEW_LINE> <INDENT> def __init__(self, device=None, devid=0): <NEW_LINE> <INDENT> self.dev = None <NEW_LINE> self.handle = None <NEW_LINE> self._last_write = 0 <NEW_LINE> self._last_read = 0 <NEW_LINE> if device is None: <NEW_LINE> <INDENT> devices = _find_devices() <NEW_LINE> try: <NEW_LINE> <INDENT> self... | Used for communication with the Crazyradio USB dongle | 62598f5a462c4b4f79dbaf56 |
class ConfigDict(OrderedDict): <NEW_LINE> <INDENT> def __init__(self, a_list): <NEW_LINE> <INDENT> self.schema = self.get_item_schema() <NEW_LINE> super(ConfigDict, self).__init__([(e["name"], e) for e in a_list]) <NEW_LINE> <DEDENT> def get_item_schema(self): <NEW_LINE> <INDENT> return {"name": {"type": "string", "req... | A NetCDF file is composed of Attributes, Variables, and Dimensions. These components are all
ordered within the file. We will use an OrderedDict supplemented with some validation abilities
to implement configuration elements for each of these components to a NetCDF file.
This "Abstract" ConfigDict implements the base ... | 62598f5a5166f23b2e242930 |
class Attendance(models.Model): <NEW_LINE> <INDENT> METHOD_CHOICES = ( (1, 'fingerprint'), (2, 'rfid'), (3, 'password'), (4, 'manual'), ) <NEW_LINE> staff = models.ForeignKey(Staff, related_name='attendances', on_delete=models.CASCADE) <NEW_LINE> when = models.DateTimeField(auto_now_add=True) <NEW_LINE> method = models... | Records a single attendance | 62598f5a8c3a8732951f5aa8 |
class Paginator(paginator.Paginator): <NEW_LINE> <INDENT> def get_limit(self): <NEW_LINE> <INDENT> hard_limit = getattr(settings, 'HARD_API_LIMIT_PER_PAGE', 500) <NEW_LINE> return min(super(Paginator, self).get_limit(), hard_limit) <NEW_LINE> <DEDENT> def get_offset(self): <NEW_LINE> <INDENT> return min(super(Paginator... | Paginator with a hard limit on results per page. | 62598f5a796e427e5384dce8 |
class ClientException(Exception): <NEW_LINE> <INDENT> message = 'Unknown Error' <NEW_LINE> def __init__(self, code, message=None, url=None, method=None): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> self.message = message or self.__class__.message <NEW_LINE> self.url = url <NEW_LINE> self.method = method <NEW_LINE> ... | The base exception class for all exceptions this library raises. | 62598f5a462c4b4f79dbaf58 |
class CdpConnection(CdpBase, trio.abc.AsyncResource): <NEW_LINE> <INDENT> def __init__(self, ws): <NEW_LINE> <INDENT> super().__init__(ws, session_id=None, target_id=None) <NEW_LINE> self.sessions = dict() <NEW_LINE> <DEDENT> async def aclose(self): <NEW_LINE> <INDENT> await self.ws.aclose() <NEW_LINE> <DEDENT> @asyncc... | Contains the connection state for a Chrome DevTools Protocol server.
CDP can multiplex multiple "sessions" over a single connection. This class
corresponds to the "root" session, i.e. the implicitly created session that
has no session ID. This class is responsible for reading incoming WebSocket
messages and forwarding ... | 62598f5abf627c535bcb09d4 |
class TestStack(unittest.TestCase): <NEW_LINE> <INDENT> _stack = Stack() <NEW_LINE> def test_stack(self): <NEW_LINE> <INDENT> self.assertEqual(True, self._stack.is_empty()) <NEW_LINE> self._stack.push(1) <NEW_LINE> self._stack.push('a') <NEW_LINE> self.assertEqual('a', self._stack.peek()) <NEW_LINE> self.assertEqual('a... | Unit tests of Stack class. | 62598f5abf627c535bcb09d6 |
class DDPGModel(BaseModel): <NEW_LINE> <INDENT> def __init__(self, topology, gamma, tau, actor_activation, actor_optimizer, critic_optimizer): <NEW_LINE> <INDENT> super().__init__(topology) <NEW_LINE> self.prediction_type = 'policy' <NEW_LINE> self.gamma = gamma <NEW_LINE> self.tau = tau <NEW_LINE> self.actor_activatio... | A deep deterministic policy gradient model.
Used for policy-based predictions in a continuous action space.
Takes in a base topology, which is a headless Keras computation graph for state transformation.
Adds layers to that as needed for actor and critic networks, including incorporating actions.
Parameters
---------... | 62598f5a5e10d32532ce3394 |
class DummyJob(object): <NEW_LINE> <INDENT> pass | Dummy job for the JobRegistry test. | 62598f5ad164cc61758204d6 |
class RNNCellTrainer(Trainer): <NEW_LINE> <INDENT> def __init__(self, root_dir, hidden_size=128, lr=0.0005, epochs=50, batch_size=512, device='gpu', logfile='train_loss.log', verbose=1): <NEW_LINE> <INDENT> super().__init__(root_dir, hidden_size, lr, epochs, batch_size, device, logfile, verbose) <NEW_LINE> <DEDENT> def... | Trainer class for training the LSTMCell model (RNNCellModel). Defines methods for:
- Initializing dataset
- Initializing data loader
- Initializing model
- Initializing criterion
- Initializing optimizer | 62598f5abf627c535bcb09d8 |
class AdvSection(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = _(u"ad section") <NEW_LINE> verbose_name_plural = _(u"ad sections") <NEW_LINE> ordering = ['name'] <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> name = models.CharFiel... | Section for advertisement. For example, homepage, or feeds page. | 62598f5a6fece00bbaccaeed |
class PostableResource(Resource): <NEW_LINE> <INDENT> maxMem = 100 * 1024 <NEW_LINE> maxFields = 1024 <NEW_LINE> maxSize = 10 * 1024 * 1024 <NEW_LINE> def http_POST(self, request): <NEW_LINE> <INDENT> return server.parsePOSTData( request, self.maxMem, self.maxFields, self.maxSize ).addCallback(lambda res: self.render(r... | A L{Resource} capable of handling the POST request method.
@cvar maxMem: maximum memory used during the parsing of the data.
@type maxMem: C{int}
@cvar maxFields: maximum number of form fields allowed.
@type maxFields: C{int}
@cvar maxSize: maximum size of the whole post allowed.
@type maxSize: C{int} | 62598f5a167d2b6e312b64da |
class CRUDABC(Generic[T]): <NEW_LINE> <INDENT> _table: sql.Composable <NEW_LINE> _return_constructor: Type[T] <NEW_LINE> def __init__( self, table: sql.Composable, return_constructor: Type[T] ) -> None: <NEW_LINE> <INDENT> self._table = table <NEW_LINE> self._return_constructor = return_constructor | Encapsulate object creation behavior for all CRUD objects. | 62598f5a91af0d3eaad39364 |
class DB(Base): <NEW_LINE> <INDENT> __tablename__ = 'db' <NEW_LINE> id = Column(Integer, primary_key = True) <NEW_LINE> name = Column(String) <NEW_LINE> user = Column(String) <NEW_LINE> password = Column(String) <NEW_LINE> tns = Column(String) <NEW_LINE> deploy_time = Column(String) <NEW_LINE> remark = Column(String) | 数据库信息表 | 62598f5aa8ecb0332587075e |
class NeuralNetwork(object): <NEW_LINE> <INDENT> def __init__(self, input, hidden, output, non_lin=Nonlinear(), bias=False, alpha=1, ): <NEW_LINE> <INDENT> if bias: <NEW_LINE> <INDENT> self._BIAS = True <NEW_LINE> self._INPUT = input + 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._BIAS = False <NEW_LINE> self._... | Neural network
--------------
This is my neural netowrk class, it basically holds all
my variables and uses my other functions/classes | 62598f5a4d74a7450cd58986 |
class TradeStrategy2(TradeStrategyBase): <NEW_LINE> <INDENT> s_keep_stock_threshold = 10 <NEW_LINE> s_buy_change_threshold = -0.10 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.keep_stock_day = 0 <NEW_LINE> <DEDENT> def buy_strategy(self,trade_ind,trade_day,trade_days): <NEW_LINE> <INDENT> if self.keep_stock_... | 交易策略2:均值回复策略,当股份连续两个交易日下跌,
且下跌幅度超过阀值默认s_buy_change_threshold(-10%),
买入股票并持有s_keep_stock_threshold(10)天 | 62598f5a8c3a8732951f5ab0 |
class SpecExcludePantsIniIntegrationTest(PantsRunIntegrationTest): <NEW_LINE> <INDENT> def test_exclude_spec_pants_ini(self): <NEW_LINE> <INDENT> def output_to_list(output_filename): <NEW_LINE> <INDENT> with open(output_filename, 'r') as results_file: <NEW_LINE> <INDENT> return set([line.rstrip() for line in results_fi... | Tests the functionality of the exclude_specs option in pants.ini . | 62598f5a5e10d32532ce3396 |
class PingResponse(object): <NEW_LINE> <INDENT> def __init__(self, parameters): <NEW_LINE> <INDENT> assert len(parameters) == 0 | @todoc | 62598f5a21a7993f00c654d5 |
class BillLineItem(JSONDict): <NEW_LINE> <INDENT> def __init__(self, ignore_required=False, **kwargs): <NEW_LINE> <INDENT> required = () <NEW_LINE> if ignore_required == True: <NEW_LINE> <INDENT> required = () <NEW_LINE> <DEDENT> super(BillLineItem, self).__init__('BillLineItem', required, **kwargs) | This models the BillLineItem object. It allows you to further describe a Bill,
assigning amounts among individual line items.
Required:
============= ========== =====================================================
*Argument* *Description*
------------------------ ----------------------------... | 62598f5abf627c535bcb09dc |
class PrivateTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = get_user_model().objects.create_user( "test@londonappdev.com", "password" ) <NEW_LINE> self.client = APIClient() <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_tags(self)... | Test the authorized user tags API | 62598f5a5e10d32532ce3397 |
class RoverDetailAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ["id", "rover_name"] | Docstring | 62598f5a6fece00bbaccaef1 |
class Comment(Barrier): <NEW_LINE> <INDENT> def __init__(self, text: str, qubits, circ): <NEW_LINE> <INDENT> super().__init__(qubits, circ) <NEW_LINE> self._text = text <NEW_LINE> <DEDENT> def inverse(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def qasm(self): <NEW_LINE> <INDENT> return "// {}".format(se... | Code comment. | 62598f5a21a7993f00c654d7 |
class AbstractAircraft(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def create_wing(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def create_tail(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def create_wheels(self): <NEW_LINE> <IND... | Aircraft creator. Just interfaces. | 62598f5a8c3a8732951f5ab4 |
class Options(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "options" <NEW_LINE> self.a10_url="/axapi/v3/overlay-tunnel/options" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.nvgre_key_mode_lower24 = "" <NE... | Class Description::
Partition specific overlay-tunnel configuration.
Class options supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param nvgre_key_mode_lower24: {"default": 0, "optional": true, "type": "number", "description": "Use the lower 24-b... | 62598f5a5e10d32532ce3398 |
class Team(object): <NEW_LINE> <INDENT> def __init__(self, draft_pos, strategy_name, budget: int = DEFAULT_BUDGET, team_config=None): <NEW_LINE> <INDENT> if team_config is None: <NEW_LINE> <INDENT> raise ValueError("Required param team_config is missing") <NEW_LINE> <DEDENT> self.team_config = team_config <NEW_LINE> se... | Keeps track of each team | 62598f5a507cdc57c63a42ff |
class utDotProduct(sut.UT): <NEW_LINE> <INDENT> uDot = '\u22c5' <NEW_LINE> def __init__(self, dskey, dskey2): <NEW_LINE> <INDENT> super().__init__('dotproduct', dskey, dskey2) <NEW_LINE> self.rhs = sut.UTDsAux(self.args[0]) <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> super().reset() <NEW_LINE> self.rhs.res... | Test operations on two datasets class. | 62598f5a925a0f43d25e7596 |
class RecurringEvent(Event): <NEW_LINE> <INDENT> __mapper_args__ = {'polymorphic_identity': 'recurringevent'} <NEW_LINE> __table_args__ = None <NEW_LINE> id = Column(ForeignKey('event.id', ondelete='CASCADE'), primary_key=True) <NEW_LINE> rrule = Column(String(RECURRENCE_MAX_LEN)) <NEW_LINE> exdate = Column(Text) <NEW_... | Represents an individual one-off instance of a recurring event,
including cancelled events. | 62598f5a8c3a8732951f5ab6 |
class Normalize(Layer): <NEW_LINE> <INDENT> def __init__(self, p, eps=1e-10, bigdl_type="float"): <NEW_LINE> <INDENT> super(Normalize, self).__init__(None, bigdl_type, p, eps) | Normalizes the input Tensor to have unit L_p norm. The smoothing parameter eps prevents
division by zero when the input contains all zero elements (default = 1e-10).
p can be the max value of double
>>> normalize = Normalize(1e-5, 1e-5)
creating: createNormalize | 62598f5a796e427e5384dcf9 |
class UpgradeOperationHistoricalStatusInfoPaged(Paged): <NEW_LINE> <INDENT> _attribute_map = { 'next_link': {'key': 'nextLink', 'type': 'str'}, 'current_page': {'key': 'value', 'type': '[UpgradeOperationHistoricalStatusInfo]'} } <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(UpgradeOperationH... | A paging container for iterating over a list of :class:`UpgradeOperationHistoricalStatusInfo <azure.mgmt.compute.v2017_12_01.models.UpgradeOperationHistoricalStatusInfo>` object | 62598f5abe8e80087fbbe5be |
class core(task.ConfigWithoutSection): <NEW_LINE> <INDENT> local_scheduler = parameter.BoolParameter( default=False, description='Use local scheduling') <NEW_LINE> scheduler_host = parameter.Parameter( default='localhost', description='Hostname of machine running remote scheduler', config_path=dict(section='core', name... | Keeps track of a bunch of environment params.
Uses the internal luigi parameter mechanism.
The nice thing is that we can instantiate this class
and get an object with all the environment variables set.
This is arguably a bit of a hack. | 62598f5abf627c535bcb09e4 |
class CreditCard(Base): <NEW_LINE> <INDENT> __tablename__ = "creditcards" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> credit_card_name = Column(String(255)) <NEW_LINE> minimum_balance = Column(REAL) <NEW_LINE> current_balance = Column(REAL) <NEW_LINE> account_id = Column(Integer) | Credit cards table. `account_id` is an `Account.id` | 62598f5a711fe17d825dfc5c |
class OdfwRegistrationProfile(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(User, unique=True, verbose_name=_('user')) <NEW_LINE> activation_key = models.CharField(_('activation key'), max_length=40) <NEW_LINE> objects = OdfwRegistrationManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = _... | *Replaces the default RegistrationProfile class in order to override
*the manager it uses with our custom one. Tried just subclassing
*RegistrationProfile and changing the manager but it wasn't working
*properly, causing strange errors on save.
***
A simple profile which stores an activation key for use during
use... | 62598f5a56b00c62f0fb1e1d |
class Post(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=150, verbose_name="title") <NEW_LINE> content = models.TextField(blank=False, verbose_name="content") <NEW_LINE> user = models.ForeignKey(User, related_name="user_creator", verbose_name="User creator") <NEW_LINE> users_likes = models.Many... | Post Model. | 62598f5a21a7993f00c654df |
class GPUInstanceProfile(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> MIG1_G = "MIG1g" <NEW_LINE> MIG2_G = "MIG2g" <NEW_LINE> MIG3_G = "MIG3g" <NEW_LINE> MIG4_G = "MIG4g" <NEW_LINE> MIG7_G = "MIG7g" | GPUInstanceProfile to be used to specify GPU MIG instance profile for supported GPU VM SKU.
| 62598f5abf627c535bcb09e6 |
class OrderStatus(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'status': {'required': True}, 'update_date_time': {'readonly': True}, 'additional_order_details': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'update_date_time': {'key': 'updateDateTime... | Represents a single status change.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param status: Required. Status of the order as per the allowed status types. Possible values
include: "Untracked", "Awaitin... | 62598f5a462c4b4f79dbaf6c |
class ExceptionsTest(TestCase): <NEW_LINE> <INDENT> def test_raises_404(self): <NEW_LINE> <INDENT> self.assertRaises(NotFoundException, raise_exceptions, 404, {}) <NEW_LINE> <DEDENT> def test_raises_unknown_exception_type(self): <NEW_LINE> <INDENT> ex = None <NEW_LINE> try: <NEW_LINE> <INDENT> raise_exceptions(400, {})... | Tests for the Exceptions module. | 62598f5a8c3a8732951f5abc |
class StaffingAgencyEmployeeApprovalForm(forms.Form): <NEW_LINE> <INDENT> def __init__(self, employee, admin, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.employee = employee <NEW_LINE> self.admin = admin <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> cleaned_data = ... | Form to approve a staff employee | 62598f5a925a0f43d25e759e |
class Album: <NEW_LINE> <INDENT> def __init__(self, json_resp): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.name = json_resp['name'] <NEW_LINE> self.artist = '' <NEW_LINE> for artist in json_resp['artists']: <NEW_LINE> <INDENT> self.artist += artist['name'] + ',' <NEW_LINE> <DEDENT> self.artist = self.artist[:-1]... | A class representing Album metadata. Should contain these attributes after being initialized:
name (album name), artist (name of the artist/artists), release_date (as datetime object)
and a tracklist dictionary containing track names as keys and their number as values. | 62598f5ad164cc61758204e1 |
class StopClause(contract.ContractClause): <NEW_LINE> <INDENT> title = 'Stop request' <NEW_LINE> description = 'Send a request to _ah/stop.' <NEW_LINE> lifecycle_point = contract.STOP <NEW_LINE> error_level = contract.WARNING <NEW_LINE> def evaluate_clause(self, app_container): <NEW_LINE> <INDENT> url = 'http://{0}:{1}... | Validate that the application responds correctly to _ah/stop.
The application shouldn't respond with status code 500 but all other
status codes are fine. | 62598f5a4d74a7450cd5898d |
class OUNoise: <NEW_LINE> <INDENT> def __init__(self, size, mu, theta, sigma): <NEW_LINE> <INDENT> self.mu = mu * np.ones(size) <NEW_LINE> self.theta = theta <NEW_LINE> self.sigma = sigma <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.state = copy.copy(self.mu) <NEW_LINE> <DEDENT>... | Ornstein-Uhlenbeck process | 62598f5a462c4b4f79dbaf6e |
class Invoker: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.commands = {} <NEW_LINE> self.draw_effect = DrawEffect() <NEW_LINE> <DEDENT> def add_command(self, name, command): <NEW_LINE> <INDENT> self.commands[str(name)] = command <NEW_LINE> <DEDENT> def do_effect(self, name): <NEW_LINE> <INDENT> sel... | Invoker & Receiver. | 62598f5a5e10d32532ce339d |
class ReferenceCatalogXMLAdapter(catalog.CatalogXMLAdapter): <NEW_LINE> <INDENT> adapts(IReferenceCatalog, ISetupEnviron) <NEW_LINE> _LOGGER_ID = NAME <NEW_LINE> name = NAME | XML im- and exporter for the reference catalog.
| 62598f5b5166f23b2e242946 |
class GitPathTool: <NEW_LINE> <INDENT> _cwd = None <NEW_LINE> _root = None <NEW_LINE> @classmethod <NEW_LINE> def set_cwd(cls, cwd): <NEW_LINE> <INDENT> if not cwd: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> cwd = os.getcwdu() <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> cwd = os.getcwd() <NEW_LINE>... | Converts `git diff` paths to absolute paths or relative paths to cwd.
This class should be used throughout the project to change paths from
the paths yielded by `git diff` to correct project paths | 62598f5b9b70327d1c57e312 |
class CartesianGrid: <NEW_LINE> <INDENT> def __init__(self, nx=10, ny=10, xmin=0.0, xmax=1.0, ymin=0.0, ymax=0.0): <NEW_LINE> <INDENT> self.nx, self.ny = nx, ny <NEW_LINE> self.ntotal = nx*ny <NEW_LINE> self.xmin, self.xmax = xmin, xmax <NEW_LINE> self.ymin, self.ymax = ymin, ymax <NEW_LINE> self.dx = (xmax - xmin)/(nx... | Simple class to generate a computational grid and apply boundary conditions | 62598f5b76d4e153a661c17b |
class CheckVRRPStatus(VThunderBaseTask): <NEW_LINE> <INDENT> @axapi_client_decorator <NEW_LINE> def execute(self, vthunder): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> vrrp_status = self.axapi_client.system.action.check_vrrp_status() <NEW_LINE> if vrrp_status: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> else:... | Task to check VRRP status | 62598f5bbf627c535bcb09ea |
class PluginWithoutUi(HookBaseClass): <NEW_LINE> <INDENT> @property <NEW_LINE> def item_filters(self): <NEW_LINE> <INDENT> return ["plugin.property_test"] <NEW_LINE> <DEDENT> def accept(self, settings, item): <NEW_LINE> <INDENT> return {"accepted": True} <NEW_LINE> <DEDENT> def validate(self, settings, item): <NEW_LINE... | Plugin for creating generic publishes in Shotgun | 62598f5b287bf620b6271124 |
class _TXTResourceData: <NEW_LINE> <INDENT> def __init__(self, in_bytes, offset): <NEW_LINE> <INDENT> length = struct.unpack('!B', in_bytes[offset: offset + 1])[0] <NEW_LINE> self.text = in_bytes[offset + 1: offset + 1 + length].decode('utf-8') <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f'Текст (... | Класс для данных DNS записи типа TXT | 62598f5bbe8e80087fbbe5c6 |
class SelfGeneratedCertsSignalTest(ModuleStoreTestCase): <NEW_LINE> <INDENT> shard = 4 <NEW_LINE> ENABLED_SIGNALS = ['course_published'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(SelfGeneratedCertsSignalTest, self).setUp() <NEW_LINE> CertificateGenerationConfiguration.objects.create(enabled=True) <NEW_LINE>... | Tests for enabling/disabling self-generated certificates according to course-pacing. | 62598f5bd164cc61758204e5 |
class Stack(object): <NEW_LINE> <INDENT> def __call__(self, data): <NEW_LINE> <INDENT> return self._stack_arrs(data, True) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _stack_arrs(arrs, use_shared_mem=False): <NEW_LINE> <INDENT> if isinstance(arrs[0], mx.nd.NDArray): <NEW_LINE> <INDENT> if use_shared_mem: <NEW_LINE... | Stack the input data samples to construct the batch. | 62598f5bbe8e80087fbbe5c8 |
class NoMapsInFileError(Exception): <NEW_LINE> <INDENT> pass | An error raised when a file is opened and no maps are found. | 62598f5b8c3a8732951f5ac2 |
class CallEvent(WithCall, WithListeners): <NEW_LINE> <INDENT> def __init__(self, assembly, name, call): <NEW_LINE> <INDENT> assert isinstance(assembly, Assembly), 'Invalid assembly %s' % assembly <NEW_LINE> assert isinstance(name, str), 'Invalid name %s' % name <NEW_LINE> WithCall.__init__(self, call) <NEW_LINE> WithLi... | Provides the event call.
@see: Callable, WithCall, WithListeners | 62598f5b5166f23b2e24294a |
class ExpressRouteCircuitPeeringConfig(Model): <NEW_LINE> <INDENT> _attribute_map = { 'advertised_public_prefixes': {'key': 'advertisedPublicPrefixes', 'type': '[str]'}, 'advertised_public_prefixes_state': {'key': 'advertisedPublicPrefixesState', 'type': 'str'}, 'customer_asn': {'key': 'customerASN', 'type': 'int'}, 'r... | Specifies the peering configuration.
:param advertised_public_prefixes: The reference of
AdvertisedPublicPrefixes.
:type advertised_public_prefixes: list[str]
:param advertised_public_prefixes_state: AdvertisedPublicPrefixState of
the Peering resource. Possible values are 'NotConfigured', 'Configuring',
'Configured... | 62598f5b9b70327d1c57e316 |
class VistaSP2x86(obj.Profile): <NEW_LINE> <INDENT> _md_major = 6 <NEW_LINE> _md_minor = 0 <NEW_LINE> _md_build = 6002 <NEW_LINE> _md_memory_model = '32bit' <NEW_LINE> _md_os = 'windows' <NEW_LINE> _md_vtype_module = 'volatility.plugins.overlays.windows.vista_sp2_x86_vtypes' <NEW_LINE> _md_product = ["NtProductWinNt"] | A Profile for Windows Vista SP2 x86 | 62598f5b287bf620b6271128 |
class TestImportDsc(ComponentTestBase): <NEW_LINE> <INDENT> def test_debian_import(self): <NEW_LINE> <INDENT> def _dsc(version): <NEW_LINE> <INDENT> return os.path.join(DEB_TEST_DATA_DIR, 'dsc-native', 'git-buildpackage_%s.dsc' % version) <NEW_LINE> <DEDENT> dsc = _dsc('0.4.14') <NEW_LINE> assert import_dsc(['arg0', ds... | Test importing of src.rpm files | 62598f5bbe8e80087fbbe5ca |
class SmsPackagesStatistics(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.PackageCreateTime = None <NEW_LINE> self.PackageCreateUnixTime = None <NEW_LINE> self.PackageEffectiveTime = None <NEW_LINE> self.PackageEffectiveUnixTime = None <NEW_LINE> self.PackageExpiredTime = None <NEW_LI... | 套餐包信息统计响应包体
| 62598f5b4d74a7450cd58991 |
class ReuseTCPServer(SocketServer.TCPServer): <NEW_LINE> <INDENT> def server_bind(self): <NEW_LINE> <INDENT> self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) <NEW_LINE> self.socket.bind(self.server_address) | Reuse the port so that when we kill it we don't have to wait 4 minutes
before we can use the port again
https://stackoverflow.com/a/18858817/2698494 | 62598f5b462c4b4f79dbaf76 |
@method_decorator(login_required, name='dispatch') <NEW_LINE> class MessageDetailView(DetailView, FormMixin): <NEW_LINE> <INDENT> form_class = CreateResponse <NEW_LINE> context_object_name = 'list' <NEW_LINE> model = Message <NEW_LINE> template_name = 'view_message_patient.html' <NEW_LINE> def get_queryset(self): <NEW_... | Class for detail Message from the User. | 62598f5bbe8e80087fbbe5cc |
class ClubEventAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> form = CustomClubEventAdminForm <NEW_LINE> fieldsets = [ (None, {'fields': 'region event date location time organizer_email ' 'info_question ' .split()}), ] <NEW_LINE> radio_fields = {'event': admin.HORIZONTAL} <NEW_LINE> actions = ['notify_webmaster'] <NEW_LI... | Customize presentation of ClubEvent instance in admin.
| 62598f5b76d4e153a661c183 |
class NetPackettesterSecurity(NetPackettesterSecuritySchema): <NEW_LINE> <INDENT> cli_command = "/mgmt/tm/net/packet-tester/security" <NEW_LINE> def rest(self): <NEW_LINE> <INDENT> response = self.device.get(self.cli_command) <NEW_LINE> response_json = response.json() <NEW_LINE> if not response_json: <NEW_LINE> <INDENT... | To F5 resource for /mgmt/tm/net/packet-tester/security
| 62598f5b925a0f43d25e75a8 |
class AbstractListener(threading.Thread): <NEW_LINE> <INDENT> class StopException(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> _HANDLED_EXCEPTIONS = tuple() <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(AbstractListener, self).__init__() <NEW_LINE> def wrapper(f): <NEW_LINE> <INDENT> de... | A class implementing the basic behaviour for event listeners.
Instances of this class can be used as context managers. This is equivalent
to the following code::
listener.start()
listener.wait()
try:
with_statements()
finally:
listener.stop()
:param kwargs: A mapping from callback att... | 62598f5b167d2b6e312b64f2 |
class EffectiveRoute(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'address_prefix': {'key': 'addressPrefix', 'type': '[str]'}, 'next_hop_ip_address': {'key': 'nextHopIpAddress', 'type': '[str]... | Effective Route.
:param name: The name of the user defined route. This is optional.
:type name: str
:param source: Who created the route. Possible values are: 'Unknown',
'User', 'VirtualNetworkGateway', and 'Default'. Possible values include:
'Unknown', 'User', 'VirtualNetworkGateway', 'Default'
:type source: str or... | 62598f5b8c3a8732951f5ac7 |
class TestStudyParameter(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return StudyParameter( ... | StudyParameter unit test stubs | 62598f5bbe8e80087fbbe5ce |
class Replace(function.Function): <NEW_LINE> <INDENT> def __init__(self, stack, fn_name, args): <NEW_LINE> <INDENT> super(Replace, self).__init__(stack, fn_name, args) <NEW_LINE> self._mapping, self._string = self._parse_args() <NEW_LINE> if not isinstance(self._mapping, collections.Mapping): <NEW_LINE> <INDENT> raise ... | A function for performing string substitutions.
Takes the form::
{ "Fn::Replace" : [
{ "<key_1>": "<value_1>", "<key_2>": "<value_2>", ... },
"<key_1> <key_2>"
] }
And resolves to::
"<value_1> <value_2>"
This is implemented using python str.replace on each key. The order in
which repl... | 62598f5b76d4e153a661c185 |
class Default(Enum): <NEW_LINE> <INDENT> _ = 0 | Singleton class and value to indicate a default parameter value,
for cases where None is a meaningful user provided value.
For example: `def f(x:Union[int, Default]=Default._): ...`
see: https://www.python.org/dev/peps/pep-0484/#support-for-singleton-types-in-unions | 62598f5b925a0f43d25e75aa |
class ListTable(list): <NEW_LINE> <INDENT> DECIMAL = "{0:.2f}" <NEW_LINE> def get_html(self): <NEW_LINE> <INDENT> html = ["<table border=\"1\">"] <NEW_LINE> row = self[0] <NEW_LINE> html.append("<tr>") <NEW_LINE> for col in row: <NEW_LINE> <INDENT> html.append("<th>{0}</th>".format(col)) <NEW_LINE> <DEDENT> html.append... | Overridden list class which takes a 2-dimensional list of
the form [["a", "b", "c"], [1,2,3],[4,5,6]], and renders an HTML
Table in IPython Notebook:
| a | b | c | <-- Treated as header row
| 1 | 2 | 3 |
| 4 | 5 | 6 |
Note that the first sub-list is treated as a list of headers. | 62598f5b91af0d3eaad3937f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.