code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class _FDNd(FDMK): <NEW_LINE> <INDENT> def __init__(self, dim, kernel_size, order, dx=1.0, constraint='moment', boundary='Dirichlet'): <NEW_LINE> <INDENT> super(_FDNd, self).__init__(dim, kernel_size, order, dx, constraint) <NEW_LINE> padwidth = [] <NEW_LINE> for k in reversed(self._kernel_size): <NEW_LINE> <INDENT> pa... | Finite difference automatically handle boundary conditions
Arguments for class:`_FDNd`:
dim (int): dimension
kernel_size (tuple of int): finite difference kernel size
boundary (string): 'Dirichlet' or 'Periodic'
Arguments for class:`FDMK`:
order, dx, constraint | 62598f0697e22403b3839981 |
class BaseHandler(webapp.RequestHandler): <NEW_LINE> <INDENT> def message_received(self, message): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def handle_exception(self, exception, debug_mode): <NEW_LINE> <INDENT> super(BaseHandler, self).handle_exception(exception, debug_mode) <NEW_LINE> if sel... | A webapp baseclass for XMPP handlers.
Implements a straightforward message delivery pattern. When a message is
received, message_received is called with a Message object that encapsulates
the relevant details. Users can reply using the standard XMPP API, or the
convenient .reply() method on the Message object. | 62598f06fbf16365ca792b3c |
class SequentalExecutor(PoolOfPoolsMixin, Executor): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SequentalExecutor, self).__init__() <NEW_LINE> self._max_workers = 1 <NEW_LINE> <DEDENT> def submit(self, fn, *args, **kwargs): <NEW_LINE> <INDENT> future = Future() <NEW_LINE> try: <N... | Debug executor. No concurrency, it just yields elements one by one. | 62598f067b180e01f3e48598 |
class MiniPlots(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__( self, parent = None , nplot = 16, dpi = 100): <NEW_LINE> <INDENT> QtGui.QWidget.__init__( self, parent) <NEW_LINE> self.nplot = nplot <NEW_LINE> self.canvas = MiniCanvas(self.nplot, dpi=dpi) <NEW_LINE> self.updateGeometry() <NEW_LINE> self.vbl = QtGui.QV... | Class encapsulating a matplotlib plot | 62598f0650812a4eaa62013c |
class ImgFace(Face): <NEW_LINE> <INDENT> def __init__(self, img_file, width=None, height=None, is_url=False): <NEW_LINE> <INDENT> Face.__init__(self) <NEW_LINE> self.img_file = img_file <NEW_LINE> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.is_url = is_url <NEW_LINE> <DEDENT> def update_pixmap(se... | Creates a node Face using an external image file.
:param img_file: path to the image file.
:param None width: if provided, image will be scaled to this width (in pixels)
:param None height: if provided, image will be scaled to this height (in pixels)
:param False is_url: if True, img_file is considered a URL and the i... | 62598f0660cbc95b06362dd3 |
class AmplitudeModule(hardwareModule.HardwareModule): <NEW_LINE> <INDENT> def __init__(self, **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> self.device_mutex = QtCore.QMutex() <NEW_LINE> <DEDENT> def getFunctionality(self, message): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def processMessage(self,... | These modules will always provide a single functionality with the
name 'module_name.amplitude_modulation'. This functionality is
primarily used by illumination.illumination. | 62598f06ad47b63b2c5a62ba |
class NeedDone(Need): <NEW_LINE> <INDENT> def _resolve(self, tasker, framer, frame, **kwa): <NEW_LINE> <INDENT> parms = super(NeedDone, self)._resolve( **kwa) <NEW_LINE> if framer: <NEW_LINE> <INDENT> if framer == 'me': <NEW_LINE> <INDENT> framer = self._act.frame.framer <NEW_LINE> <DEDENT> parms['framer'] = framer = f... | NeedDone Need Special Need | 62598f06aad79263cf42d2b2 |
class G2CommandParameterTypeError(G2CommandParameterError): <NEW_LINE> <INDENT> def __init__(self, *types): <NEW_LINE> <INDENT> if len(types) == 1: <NEW_LINE> <INDENT> super().__init__('command expects 1 parameter with type {:s}'.format(types[0])) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super().__init__('command ... | Raised when the types of parameters passed to the command do not match expectations | 62598f063d592f4c4edb998b |
class RRTThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> threading.Thread.__init__(self, daemon=True) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while not stopevent.is_set(): <NEW_LINE> <INDENT> RRT(cmap, cmap.get_start()) <NEW_LINE> time.sleep(100) <NEW_LINE> cmap.rese... | Thread to run RRT separate from main thread
| 62598f06dc8b845886d52069 |
class Cluster(object): <NEW_LINE> <INDENT> def __init__(self, signer=None, sketch_dist_fn=None, max_dist=0, min_support=1, sketch_operator=operator.__and__, sketch_bits=0): <NEW_LINE> <INDENT> self.union_find = UnionFind() <NEW_LINE> self.signer = signer <NEW_LINE> self.buckets = defaultdict(dict) <NEW_LINE> self.sketc... | Clusters sets with Jaccard similarity above threshold with high
probability.
Algorithm based on Rajaraman, "Mining of Massive Datasets":
1. Generate set signature
2. Use LSH to map similar signatures to same buckets
3. Use UnionFind to merge buckets containing same values | 62598f065166f23b2e241e83 |
class OldVersionCleaner(ChangeRecordCleaner): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(OldVersionCleaner, self).__init__(*args, **kwargs) <NEW_LINE> self.age_limit = settings.BTW_CLEAN_CRS_OLDER_THAN <NEW_LINE> <DEDENT> def check_not_latest(self, obj, verbose=True): <NEW_LINE> ... | Clean old versions of :class:`.Entry` records. Contrarily to
:class:`.ChangeRecordCollapser`, this cleaner does cause
:class:`.Chunk` objects to become hidden to the system.
This cleans :class:`.ChangeRecord` objects that:
* Are not published, and
* Are not the latest version of an ``Entry``, and
* Are old enough, ... | 62598f06d486a94d0ba2aa6a |
class MockHTTPResponse: <NEW_LINE> <INDENT> response_file = "" <NEW_LINE> def __init__(self, request): <NEW_LINE> <INDENT> if isinstance(request, urllib.request.Request): <NEW_LINE> <INDENT> if request._full_url.endswith("ouVRL5arzUg=="): <NEW_LINE> <INDENT> self.headers = {"Content-Length": 3614184} <NEW_LINE> <DEDENT... | This mocks `urllib.request.urlopen` for custom response text. | 62598f06ab23a570cc2d42be |
class FlaskOAuth(OAuth): <NEW_LINE> <INDENT> def remote_app(self, name, register=True, **kwargs): <NEW_LINE> <INDENT> app = FlaskOAuthRemoteApp(self, name, **kwargs) <NEW_LINE> if register: <NEW_LINE> <INDENT> assert name not in self.remote_apps, 'application already registered' <NEW_LINE> self.remote_apps[n... | Registry for remote applications. In the future this will also
be the central class for OAuth provider functionality. | 62598f064527f215b58e899f |
class PriorityItem(NamedTuple): <NEW_LINE> <INDENT> priority: float <NEW_LINE> item: Any <NEW_LINE> def __lt__(self, other: 'PriorityItem'): <NEW_LINE> <INDENT> if not isinstance(other, PriorityItem): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> return self.priority < other.priority <NEW_LINE> <DEDENT>... | Helper to sort an unorderable ``item`` by a ``priority``
This class implements a total ordering based on ``priority``;
``item`` is ignored for comparisons. This allows using an arbitrary
``item`` in a :py:class:`~.PriorityStore` with a well-defined ``priority``.
The original :py:class:`simpy.resources.store.PriorityI... | 62598f063617ad0b5ee04bd0 |
class ConnectionException(Exception): <NEW_LINE> <INDENT> pass | Connection exception
| 62598f064a966d76dd5ed979 |
class JSON(String): <NEW_LINE> <INDENT> scalar = ir.JSONScalar <NEW_LINE> column = ir.JSONColumn | JSON values. | 62598f06be7bc26dc92513b6 |
class SosProgramParent: <NEW_LINE> <INDENT> def add_polynomial(self, basis, name='c'): <NEW_LINE> <INDENT> coef = self.add_variables(len(basis), name) <NEW_LINE> poly = Polynomial(dict(zip(basis, coef))) <NEW_LINE> return poly, coef <NEW_LINE> <DEDENT> def add_sos_polynomial(self, basis, name='Q'): <NEW_LINE> <INDENT>... | Derived classes must implement the following methods:
- add_variables(size, name)
- add_psd_variable(size, name)
- add_linear_constraint(constraint)
- add_linear_cost(expression)
- solve()
- minimum()
- substitute_minimizer(expression) | 62598f064f88993c371efa3e |
class ArticleTest(ModelTestCase): <NEW_LINE> <INDENT> model = Document <NEW_LINE> field_tests = { 'title': { 'max_length': 300, 'verbose_name': 'titre', }, 'content': { 'verbose_name': 'contenu', }, 'slug': { 'unique': True, 'max_length': 100, } } <NEW_LINE> model_tests = { 'ordering': ('title',), } <NEW_LINE> @classme... | Test the Article model. | 62598f06f9cc0f698b1c4821 |
class DjangoFilterBackend(BaseFilterBackend): <NEW_LINE> <INDENT> default_filter_set = ModelFilterSet <NEW_LINE> def get_filter_class(self, view, queryset=None): <NEW_LINE> <INDENT> filter_class_default = getattr( view, "filter_class_default", self.default_filter_set ) <NEW_LINE> filter_class = getattr(view, "filter_cl... | DRF filter backend which integrates with ``django-url-filter``
This integration backend can be specified in global DRF settings::
# settings.py
REST_FRAMEWORK = {
'DEFAULT_FILTER_BACKENDS': [
'url_filter.integrations.drf.DjangoFilterBackend',
]
}
Alternatively filter backend c... | 62598f06ec188e330fdf7356 |
class TableBatchGenerator(object): <NEW_LINE> <INDENT> def __init__(self, table, keys, attributes_to_get=None, consistent_read=False): <NEW_LINE> <INDENT> self.table = table <NEW_LINE> self.keys = keys <NEW_LINE> self.consumed_units = 0 <NEW_LINE> self.attributes_to_get = attributes_to_get <NEW_LINE> self.consistent_re... | A low-level generator used to page through results from
batch_get_item operations.
:ivar consumed_units: An integer that holds the number of
ConsumedCapacityUnits accumulated thus far for this
generator. | 62598f065fcc89381b26567e |
class AssignmentTestMixin(object): <NEW_LINE> <INDENT> def build_role_assignment_query_url(self, effective=False, **filters): <NEW_LINE> <INDENT> query_params = '?effective' if effective else '' <NEW_LINE> for k, v in six.iteritems(filters): <NEW_LINE> <INDENT> query_params += '?' if not query_params else '&' <NEW_LINE... | To hold assignment helper functions. | 62598f067047854f4633de6d |
class DistanceModelWrapper(wrappers.EnvironmentWrapper): <NEW_LINE> <INDENT> def __init__(self, environment, distance_fn, max_episode_steps = None, baseline_distance = None, distance_reward_weight = 1., environment_reward_weight = 0.): <NEW_LINE> <INDENT> self._environment = environment <NEW_LINE> self._distance_fn = d... | Embed observation images and add predicted distance reward. | 62598f065fdd1c0f98e5ca46 |
class Artist(object): <NEW_LINE> <INDENT> def __init__(self, json_dict): <NEW_LINE> <INDENT> self._body = json_dict['artist'] <NEW_LINE> self._url = self._body['url'] <NEW_LINE> self._api_path = self._body['api_path'] <NEW_LINE> self._id = self._body['id'] <NEW_LINE> self._songs = [] <NEW_LINE> self._num_son... | An artist from the Genius.com database.
Attributes:
name: (str) Artist name.
num_songs: (int) Total number of songs listed on Genius.com | 62598f06f548e778e596a02e |
class Genus(TaxonomicRank): <NEW_LINE> <INDENT> tribe = models.ForeignKey( Tribe, models.SET_NULL, blank=True, null=True ) <NEW_LINE> objects = GenusManager() <NEW_LINE> class Meta(TaxonomicRankMeta): <NEW_LINE> <INDENT> verbose_name_plural = _('Genera') | Model which represents a taxonomic rank of type 'Genus'. | 62598f06091ae356687036c1 |
class Particle(object): <NEW_LINE> <INDENT> def __init__(self, mp=1.0, xp=zeros(2), vp=zeros(2)): <NEW_LINE> <INDENT> GC.ParticleID += 1 <NEW_LINE> self.id = GC.ParticleID <NEW_LINE> self.mass = mp <NEW_LINE> self.pos = xp <NEW_LINE> self.vel = vp <NEW_LINE> self.accel = zeros(2) <NEW_LINE> self.mu = 0.0; <NEW_... | variables:
self.id = ParticleID
self.mass = mp
self.pos = xp
self.vel = vp
self.accel = zeros(2)
self.mu = 0.0;
self.stress = zeros(3)
self.strain = zeros(3)
self.p = 0.0
self.strainRate = zeros(3)
self.deformationGradient = identity(2)
self.recordParticleTra... | 62598f06fbf16365ca792b42 |
class Client(object): <NEW_LINE> <INDENT> def __init__(self, config, args): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.args = args <NEW_LINE> self.client_action = "SEND" <NEW_LINE> if args.select: <NEW_LINE> <INDENT> self.client_action = "SELECT" <NEW_LINE> <DEDENT> elif args.ignore: <NEW_LINE> <INDENT> s... | Clipboard Manager. | 62598f067b180e01f3e4859b |
class Comment(Component): <NEW_LINE> <INDENT> def __init__(self, dbcomp): <NEW_LINE> <INDENT> super(Comment, self).__init__(dbcomp) <NEW_LINE> self.component_id = dbcomp.details['id'] <NEW_LINE> self.sequence_id = dbcomp.details['sequenceid'] <NEW_LINE> self.comment = dbcomp.details['comment'] <NEW_LINE> self.broadcast... | Comment | 62598f06bf627c535bcaff1c |
class TestUniformRandomKOutGraph(object): <NEW_LINE> <INDENT> def test_regularity(self): <NEW_LINE> <INDENT> n = 10 <NEW_LINE> k = 3 <NEW_LINE> G = random_uniform_k_out_graph(n, k) <NEW_LINE> assert_true(all(d == k for v, d in G.out_degree())) <NEW_LINE> <DEDENT> def test_no_self_loops(self): <NEW_LINE> <INDENT> n = 10... | Unit tests for the
:func:`~networkx.generators.directed.random_uniform_k_out_graph`
function. | 62598f065166f23b2e241e87 |
class MplYAxisProperties(MplAxisProperties): <NEW_LINE> <INDENT> _input_ports = [ ("offset_position", "basic:String", {'optional': True}), ("view_interval", "basic:String", {'optional': True, 'docstring': 'If ignore is False, the order of vmin, vmax does not matter; the original axis orientation will be preserved. In a... | None
| 62598f060fa83653e46f398b |
class TestPaymentCardInfoLookupRequestAllOf(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 testPaymentCardInfoLookupRequestAllOf(self): <NEW_LINE> <INDENT> pass | PaymentCardInfoLookupRequestAllOf unit test stubs | 62598f069f2886367281729d |
class ReducedVariable(AST): <NEW_LINE> <INDENT> def __init__(self, tensor, subscripts, labels): <NEW_LINE> <INDENT> super(ReducedVariable, self).__init__('reducedvariable') <NEW_LINE> if (not tensor.diagonal and len(subscripts) != tensor.totalmode) or (tensor.diagonal and len(subscripts) != tensor.totalmode // 2): <NEW... | Reduced tensor variable node.
.. note:: `ReducedVariable` nodes have type ``reducedvariable``.
Parameters
----------
tensor : `TensorDeclaration`
The tensor that this variable belongs to.
subscripts : `tuple` of `Index`
List of subscripts. Length must be compatible with ``tensor.mode``.
labels : `tuple` of `I... | 62598f06167d2b6e312b5a43 |
class Float(KatcpType): <NEW_LINE> <INDENT> name = "float" <NEW_LINE> def encode(self, value, major): <NEW_LINE> <INDENT> if isinstance(value, float): <NEW_LINE> <INDENT> return b"%r" % (value,) <NEW_LINE> <DEDENT> elif isinstance(value, int) or isinstance(value, numbers.Integral): <NEW_LINE> <INDENT> return b"%r" % (f... | The KATCP float type.
Parameters
----------
min : float
The minimum allowed value. Ignored if not given.
max : float
The maximum allowed value. Ignored if not given. | 62598f06ab23a570cc2d42c0 |
class PayWithAmazonEvent(models.Model): <NEW_LINE> <INDENT> sellerid = models.CharField(u'SellerId', max_length=50) <NEW_LINE> sellerorderid = models.CharField(u'SellerOrderId', max_length=512, blank=True, null=True) <NEW_LINE> transactionposteddate = models.DateTimeField(u'TransactionPostedDate', blank=True, null=True... | An event related to your Pay with Amazon account. | 62598f06fbf16365ca792b44 |
class Transfer(models.Model): <NEW_LINE> <INDENT> account = models.ForeignKey("ledger.Account", on_delete=models.PROTECT) <NEW_LINE> transaction = models.ForeignKey("ledger.Transaction", on_delete=models.PROTECT) <NEW_LINE> amount = models.DecimalField(max_digits=11, decimal_places=2) <NEW_LINE> description = models.Ch... | A Transfer is a single debit or a credit on an Account. Multiple
Transfers are grouped together by a Transaction to form a single
accounting journal entry. Positive amounts represent debits and
negative amounts credits. | 62598f0650812a4eaa620140 |
class WindowsUtil: <NEW_LINE> <INDENT> def __init__(self, ip_address=None, user_name=None, password=None): <NEW_LINE> <INDENT> self.ip_addr = ip_address <NEW_LINE> self.user = user_name <NEW_LINE> self.password = password <NEW_LINE> try: <NEW_LINE> <INDENT> self.connection = winrm.Session(self.ip_addr, auth=(self.user,... | Utility which uses windows remote management module for interacting with
remote windows host using WS-Management Protocol (A standard SOAP based
protocol).Please check ../docs/windows_remote_mgmnt.txt file for more
details about one time configuration required in the host. | 62598f06ad47b63b2c5a62c2 |
class BMProcessInfo: <NEW_LINE> <INDENT> def __init__(self, proc, comp, logfile, port=None): <NEW_LINE> <INDENT> self.__proc = proc <NEW_LINE> self.__comp = comp <NEW_LINE> self.__logfile = logfile <NEW_LINE> self.__port = port <NEW_LINE> <DEDENT> def get_pid(self): <NEW_LINE> <INDENT> if not self.__proc: <NEW_LINE> <I... | rief Convenience class for storing information about a running blockmon process
| 62598f06aad79263cf42d2ba |
class utils_test(unittest.TestCase): <NEW_LINE> <INDENT> def test_pmf_norm_01(self): <NEW_LINE> <INDENT> xVals = np.arange(0, 30, 1) <NEW_LINE> mu = 0.0 <NEW_LINE> yVals = poisson.pmf(xVals, mu) <NEW_LINE> assert xVals.shape == yVals.shape, "Error: Shape assertion failed." <NEW_LINE> norm = checkPMFnorm(yVals, 'Poisson... | Test cases for the utils module. | 62598f065fdd1c0f98e5ca4a |
class Rat: <NEW_LINE> <INDENT> def __init__(self, sym, row, col): <NEW_LINE> <INDENT> self.symbol = sym <NEW_LINE> self.row = row <NEW_LINE> self.col = col <NEW_LINE> self.num_sprouts_eaten = 0 <NEW_LINE> <DEDENT> def set_location(self, row, col): <NEW_LINE> <INDENT> self.row = row <NEW_LINE> self.col = col <NEW_LINE> ... | A rat caught in a maze. | 62598f067047854f4633de71 |
class ExpenseLineSchema(BaseLineSchema): <NEW_LINE> <INDENT> ht = colander.SchemaNode(AmountType()) <NEW_LINE> tva = colander.SchemaNode(AmountType()) | Expense line schema, validates the different expense line schemes | 62598f06dc8b845886d52071 |
class HashTable: <NEW_LINE> <INDENT> def __init__(self, capacity): <NEW_LINE> <INDENT> self.capacity = capacity <NEW_LINE> self.table = [None] * capacity <NEW_LINE> self.items = 0 <NEW_LINE> <DEDENT> def get_num_slots(self): <NEW_LINE> <INDENT> return len(self.table) <NEW_LINE> <DEDENT> def get_load_factor(self): <NEW_... | A hash table that with `capacity` buckets
that accepts string keys
Implement this. | 62598f06099cdd3c6367492c |
class MathExp: <NEW_LINE> <INDENT> def __init__(self, exp): <NEW_LINE> <INDENT> self.variables_table = {} <NEW_LINE> exp = exp_check(exp) <NEW_LINE> function = get_function(exp) <NEW_LINE> if function is not None: <NEW_LINE> <INDENT> self.token = function <NEW_LINE> self.left = None <NEW_LINE> arg = exp[len(self.token)... | Expression parser class | 62598f065fc7496912d477c9 |
class FileConfigError(OptionError): <NEW_LINE> <INDENT> pass | Error with file configuration | 62598f064c34283577618d94 |
class AdImage(AbstractImage, models.Model): <NEW_LINE> <INDENT> is_active = models.BooleanField( default=True, editable=False, help_text=_(u"Not currently in use, but could hide images when " u"unticked if implemented")) <NEW_LINE> order = models.IntegerField( default=0, editable=False, help_text=_(u"Not currently in u... | Model containing info about images used for offers / wants.
'easy_thumbnails' module used to manage image thumbnails. | 62598f064f88993c371efa41 |
class Candidate(Base): <NEW_LINE> <INDENT> __tablename__ = 'candidates' <NEW_LINE> __table_args__ = { 'mysql_engine': 'InnoDB', 'mysql_charset': 'utf8', } <NEW_LINE> EMPTY_CANDIDATE = 0 <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> number = Column(Integer, nullable=False) <NEW_LINE> firstname = Column(Un... | Election candidate.
A candidate is associated with a candidate number, a voting
:py:class:`District` and a political :py:class:`Party`. | 62598f064527f215b58e89a7 |
class FzOR(FuzzyTerm): <NEW_LINE> <INDENT> def __init__(self, *operands): <NEW_LINE> <INDENT> if len(operands) < 2: <NEW_LINE> <INDENT> raise ValueError("Two or operand required") <NEW_LINE> <DEDENT> self._terms = operands <NEW_LINE> <DEDENT> def Clone(self): <NEW_LINE> <INDENT> return FzOR(*self._terms) <NEW_LINE> <DE... | A fuzzy OR operator class | 62598f063d592f4c4edb9995 |
class TFReporter(object): <NEW_LINE> <INDENT> def __init__(self, log_dir=None, summary_writer=None): <NEW_LINE> <INDENT> assert log_dir or summary_writer, 'Please specify a log_dir or a writer' <NEW_LINE> if summary_writer: <NEW_LINE> <INDENT> self.writer = summary_writer <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> s... | Reporting to tensorboard without tensorflow ops. | 62598f06377c676e912f62bc |
class SyncCogCommandTests(SyncCogTestCase, CommandTestCase): <NEW_LINE> <INDENT> async def test_sync_roles_command(self): <NEW_LINE> <INDENT> ctx = helpers.MockContext() <NEW_LINE> await self.cog.sync_roles_command(self.cog, ctx) <NEW_LINE> self.cog.role_syncer.sync.assert_called_once_with(ctx.guild, ctx) <NEW_LINE> <D... | Tests for the commands in the Sync cog. | 62598f06cc40096d61619730 |
class StoredModel(object): <NEW_LINE> <INDENT> def __init__(self, name, restore=True, model_path='.', silent=False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.savepath = ''.join((model_path, '/', self._sanitize_filename(name), '.model')) <NEW_LINE> self.loaded = False <NEW_LINE> if restore and self.restore()... | A generic model that can be subclassed by a learner. Provides saving
and restoring via pickling. | 62598f06d8ef3951e32c73a9 |
class GmailService: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = 'Gmail Service' <NEW_LINE> self.priority = 0 <NEW_LINE> self.updatePeriod = 5 <NEW_LINE> self.updateCount = 5 <NEW_LINE> if os.path.isfile('client_secret.json'): <NEW_LINE> <INDENT> self.CLIENT_SECRET_FILE = 'client_secret.json'... | Gmail Service Class
Used to poll a users gmail account every 5 minutes to determine if there are unread messages
from within the past day. It then takes that data, and updates a priority. | 62598f06167d2b6e312b5a49 |
class Testing(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> Debug = True | configurations for testing with a separate test database | 62598f06aad79263cf42d2be |
class MenuChoice(object): <NEW_LINE> <INDENT> def __init__(self, text, user_input, input_checker): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> self.user_input = user_input <NEW_LINE> self.input_checker = input_checker | Simple text menu choice. | 62598f065fdd1c0f98e5ca4e |
class AbstractStep(object): <NEW_LINE> <INDENT> def __init__(self, name: str, source_key: str = None, overwrite: bool = False, delete: bool = False): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.__source_key = source_key <NEW_LINE> self._overwrite = overwrite <NEW_LINE> self._delete = delete <NEW_LINE> <DEDENT>... | Interface for step types to implement. | 62598f064527f215b58e89a9 |
class Solution(object): <NEW_LINE> <INDENT> def integerBreak(self, n): <NEW_LINE> <INDENT> dp = [1] * (n + 1) <NEW_LINE> for i in range(2, n + 1): <NEW_LINE> <INDENT> dp[i] = max([max(dp(j), j) * max(dp(i-j), i-j) for j in range(1, i)]) <NEW_LINE> <DEDENT> return dp[-1] | Wrong. | 62598f06656771135c48813a |
@python_2_unicode_compatible <NEW_LINE> class LocalFile(models.Model): <NEW_LINE> <INDENT> id = models.CharField(max_length=32, primary_key=True) <NEW_LINE> extension = models.CharField(max_length=40, choices=file_formats.choices, blank=True) <NEW_LINE> available = models.BooleanField(default=False) <NEW_LINE> file_siz... | The bottom layer of the contentDB schema, defines the local state of files on the device storage. | 62598f06283ffb24f3cf235b |
class DBDuplicateEntry(DBError): <NEW_LINE> <INDENT> def __init__(self, columns=None, inner_exception=None, value=None): <NEW_LINE> <INDENT> super().__init__(inner_exception) <NEW_LINE> self.columns = columns or [] <NEW_LINE> self.value = value | Duplicate entry at unique column error.
:kwarg columns: a list of unique columns have been attempted to write a
duplicate entry.
:type columns: list
:kwarg value: a value which has been attempted to write. The value will
be None, if we can't extract it for a particular database backend. | 62598f06be7bc26dc92513bb |
class Expression: <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def __call__(self, val): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self.__str__()) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _val_of_exp(exp, val): <NEW_LINE>... | Base class for all mathematical Expressions.
Combiner operators such as + and * are
implemented here.
``Expression`` and all subclasses are immutable | 62598f06ff9c53063f519110 |
class log: <NEW_LINE> <INDENT> __SEP = ',' <NEW_LINE> __CRL = '\n' <NEW_LINE> def __init__(self, path): <NEW_LINE> <INDENT> self.__file = open(path, 'a') <NEW_LINE> <DEDENT> def clear(self): <NEW_LINE> <INDENT> self.__file.truncate(0) <NEW_LINE> self.__file.write( 'FRAME_TYPE' + log.__SEP + 'EVENT' + log.__SEP + 'DATE'... | Classe responsável por gerar o log de eventos acontecidos na
camada de enlace. Salva um arquivo no formato CSV. | 62598f06d486a94d0ba2aa76 |
class DownloadLatestPython2(RedirectView): <NEW_LINE> <INDENT> permanent = False <NEW_LINE> def get_redirect_url(self, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> latest_python2 = Release.objects.released().python2().latest() <NEW_LINE> <DEDENT> except Release.DoesNotExist: <NEW_LINE> <INDENT> latest_python... | Redirec to latest Python 2 release | 62598f06167d2b6e312b5a4b |
class IpForwardingUtilsIfconfig(IpForwardingUtilsBase): <NEW_LINE> <INDENT> def __init__(self, logger): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> def _RunIfconfig(self, args=None, options=None): <NEW_LINE> <INDENT> args = args or [] <NEW_LINE> options = options or {} <NEW_LINE> command = ['ifconfig']... | System IP address configuration utilities. | 62598f065fdd1c0f98e5ca50 |
class LammpsDihedrals(LammpsTopology): <NEW_LINE> <INDENT> pass | An interface to write *Dihedrals* section
in Lammps' data file (or molecule file). | 62598f06f548e778e596a038 |
class ImageDb(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.days = {} <NEW_LINE> <DEDENT> def add_image(self, date, hour, minute, second, interesting=False): <NEW_LINE> <INDENT> if not date in self.days.keys(): <NEW_LINE> <INDENT> self.days[date] = Day(date) <NEW_LINE> <DEDENT> self.days[dat... | Use this class to .
Args:
sizes (dict): This dict ... | 62598f06851cf427c66b6d79 |
class DuplicateNumberError(Error): <NEW_LINE> <INDENT> pass | Duplicate number assigned to field. | 62598f06099cdd3c6367492f |
class V1beta1NetworkPolicyPort(object): <NEW_LINE> <INDENT> def __init__(self, protocol=None, port=None): <NEW_LINE> <INDENT> self.swagger_types = { 'protocol': 'V1Protocol', 'port': 'str' } <NEW_LINE> self.attribute_map = { 'protocol': 'protocol', 'port': 'port' } <NEW_LINE> self._protocol = protocol <NEW_LINE> self._... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f065fc7496912d477cc |
class TFAutoModelForMultipleChoice: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise EnvironmentError( "TFAutoModelForMultipleChoice is designed to be instantiated " "using the `TFAutoModelForMultipleChoice.from_pretrained(pretrained_model_name_or_path)` or " "`TFAutoModelForMultipleChoice.from_config(... | This is a generic model class that will be instantiated as one of the model classes of the library---with a
multiple choice classifcation head---when created with the when created with the
:meth:`~transformers.TFAutoModelForMultipleChoice.from_pretrained` class method or the
:meth:`~transformers.TFAutoModelForMultipleC... | 62598f0626068e7796d4b407 |
class Subnet(BaseACIObject): <NEW_LINE> <INDENT> def __init__(self, subnet_name, parent=None): <NEW_LINE> <INDENT> if not isinstance(parent, BridgeDomain): <NEW_LINE> <INDENT> raise TypeError('Parent of Subnet class must be BridgeDomain') <NEW_LINE> <DEDENT> super(Subnet, self).__init__(subnet_name, parent) <NEW_LINE> ... | Subnet : roughly equivalent to fvSubnet | 62598f07aad79263cf42d2c1 |
class Table(object): <NEW_LINE> <INDENT> def __init__(self, header): <NEW_LINE> <INDENT> header_row, self.formatters = zip(*header) <NEW_LINE> self.data = [header_row] <NEW_LINE> self.columns = len(header_row) <NEW_LINE> <DEDENT> def add_row(self, row): <NEW_LINE> <INDENT> assert self.columns == len(row) <NEW_LINE> for... | ASCII readable table class | 62598f075fdd1c0f98e5ca52 |
class DialectKWArgs(object): <NEW_LINE> <INDENT> _dialect_kwargs_traverse_internals = [ ("dialect_options", InternalTraversal.dp_dialect_options) ] <NEW_LINE> @classmethod <NEW_LINE> def argument_for(cls, dialect_name, argument_name, default): <NEW_LINE> <INDENT> construct_arg_dictionary = DialectKWArgs._kw_registry[di... | Establish the ability for a class to have dialect-specific arguments
with defaults and constructor validation.
The :class:`.DialectKWArgs` interacts with the
:attr:`.DefaultDialect.construct_arguments` present on a dialect.
.. seealso::
:attr:`.DefaultDialect.construct_arguments` | 62598f073617ad0b5ee04bde |
class Database: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.set_players() <NEW_LINE> self.set_servers() <NEW_LINE> <DEDENT> def set_players(self): <NEW_LINE> <INDENT> if 'player' not in self.bot.db.get_tables(): <NEW_LINE> <INDENT> self.bot.logger.info('Created databa... | Database storage for the bot. | 62598f078a349b6b43684cf6 |
class Category(models.Model): <NEW_LINE> <INDENT> title = models.CharField( "Category", max_length=50, null=False, blank=False ) <NEW_LINE> color = models.CharField( "Color", max_length=14, null=True, blank=True ) <NEW_LINE> slug = models.SlugField( unique=True, help_text="Suggested value automatically generated from t... | Represents the category for a payment. | 62598f07cc40096d61619733 |
class AndNode(Node): <NEW_LINE> <INDENT> def __init__(self, left, right): <NEW_LINE> <INDENT> super().__init__(left, right) <NEW_LINE> <DEDENT> def eval(self): <NEW_LINE> <INDENT> return self._children[0].eval() & self._children[1].eval() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "AndNode( ({0}... | Node representing the AND operator. This node has two children. | 62598f07ff9c53063f519114 |
class MigrateConnectionString(ZenPackMigration): <NEW_LINE> <INDENT> version = Version(3, 0, 0) <NEW_LINE> def migrate(self, dmd): <NEW_LINE> <INDENT> overridden_on = dmd.Devices.getOverriddenObjects( 'zDeviceTemplates', showDevices=True) <NEW_LINE> for thing in overridden_on: <NEW_LINE> <INDENT> if TEMPLATE_NAME in th... | Main class that contains the migrate() method.
Note version setting. | 62598f07ec188e330fdf7364 |
class ClassicGetDayView(AbstractDayView): <NEW_LINE> <INDENT> Model = ClassicDiaryDay | Получаем инфу об конкретном классическом дне | 62598f075fdd1c0f98e5ca54 |
class RaftBase(object): <NEW_LINE> <INDENT> pass | Raft Base object. | 62598f07091ae356687036cf |
class ForwardingRulesFetcher(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument( '--regions', metavar='REGION', help='If provided, forwarding rules from the given regions are shown.', nargs='*', default=None) <NEW_LINE> parser.add_argument( '--global', action... | Mixin class for displaying forwarding rules.
Derived classes must implement CreateGlobalRequests and
CreateRegionalRequests. | 62598f07f548e778e596a03c |
class CreateKeypairsTests(OSSourceFileTestsCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.keypair_creator = None <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> if self.keypair_creator: <NEW_LINE> <INDENT> self.keypair_creator.clean() <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> os.rem... | Tests for the OpenStackKeypair class | 62598f079f288636728172ab |
class CLOCk(SCPINode): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "CLOCk" <NEW_LINE> args = [] <NEW_LINE> class REFerence(SCPINode): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "REFerence" <NEW_LINE> args = [] <NEW_LINE> class EXTernal(SCPINode, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE>... | SOURce:RADio:ARB:CLOCk
Arguments: | 62598f07283ffb24f3cf2361 |
class TwitterAuthResponse(models.Model): <NEW_LINE> <INDENT> voter_device_id = models.CharField( verbose_name="voter_device_id initiating Twitter Auth", max_length=255, null=False, blank=False, unique=True) <NEW_LINE> datetime_of_authorization = models.DateTimeField(verbose_name='date and time of action', null=False, a... | This is the authResponse data from a Twitter authentication | 62598f07d8ef3951e32c73ad |
class TokenScanner(object): <NEW_LINE> <INDENT> def __init__(self, path_or_str): <NEW_LINE> <INDENT> if os.path.exists(path_or_str): <NEW_LINE> <INDENT> self.io = io.open(path_or_str, 'rU', encoding='utf8') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if sys.version_info < (3, 0): <NEW_LINE> <INDENT> if isinstance(pat... | The scanner reads a gherkin doc (typically read from a `.feature` file) and creates a token for
each line.
The tokens are passed to the parser, which outputs an AST (Abstract Syntax Tree).
If the scanner sees a `#` language header, it will reconfigure itself dynamically to look for
Gherkin keywords for the associated... | 62598f074c34283577618d9e |
class Test_genLinkograph_Exceptions(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> tMatrix = np.array([[0.33, 0.33, 0.34], [0., 0.5, 0.5], [0.5, 0.5, 0]]) <NEW_LINE> if self.id().split('.')[-1] == 'test_exceptions': <NEW_LINE> <INDENT> self.testParams = [ {'model': Model.Model(tMatrix... | Basic unit tests for testing the genLinograph function exceptions. | 62598f07f9cc0f698b1c4829 |
class PhpToken: <NEW_LINE> <INDENT> TOKEN_MAP = { 'T_OPEN_TAG': 'T_OPEN_TAG', 'T_ARRAY': 'T_ARRAY', 'T_WHITESPACE': 'T_WHITESPACE', 'BRACE_OPEN': '(', 'BRACE_CLOSE': ')', } <NEW_LINE> @classmethod <NEW_LINE> def equals(cls, code, value): <NEW_LINE> <INDENT> return cls.TOKEN_MAP[code] == value | Checks php tokens.
| 62598f079f288636728172ac |
class SavedArrangementException(Exception): <NEW_LINE> <INDENT> pass | A problem was encountered while saving or restoring an arrangement. | 62598f07ab23a570cc2d42c7 |
class ReaderProxy(ReaderProxyBase): <NEW_LINE> <INDENT> is_geo2grid_reader = True <NEW_LINE> is_polar2grid_reader = True <NEW_LINE> def get_all_products(self) -> list[str]: <NEW_LINE> <INDENT> return ADVERTISED_DATASETS <NEW_LINE> <DEDENT> def get_default_products(self) -> list[str]: <NEW_LINE> <INDENT> return DEFAULT_... | Provide Polar2Grid-specific information about this reader's products. | 62598f07956e5f7376df4bd7 |
class CookieFactory(CandyFactory): <NEW_LINE> <INDENT> def make(self): <NEW_LINE> <INDENT> return Cookie() | CookieFactory concrete class | 62598f078a349b6b43684cfa |
class TopView(MethodView): <NEW_LINE> <INDENT> def get(self, percentage): <NEW_LINE> <INDENT> cnt = Movies.objects().count() <NEW_LINE> limit = cnt * int(percentage) / float(100) <NEW_LINE> movies = Movies.objects[:int(round(limit, 0))] <NEW_LINE> return render_template('list.html', movies=movies) | This class retrieves the top-k movies existing in the database. K is
is passed as a parameter. The actual number of existing movies is
found and based on that and the value of K we figure out which movies
should be displayed. | 62598f07656771135c488142 |
class Cone(Axial): <NEW_LINE> <INDENT> def __init__(self, radius=1.0, color=Rgb(), pos=Vector([0, 0, 0]), axis=Vector([1, 0, 0])): <NEW_LINE> <INDENT> super(Cone, self).__init__(radius=radius, color=color, pos=Vector(pos)) <NEW_LINE> self.axis = Vector(axis) <NEW_LINE> <DEDENT> def init_model(self, scene): <NEW_LINE> <... | A Cone object | 62598f074f88993c371efa47 |
class ConfigurationSearchd(models.Model): <NEW_LINE> <INDENT> sp_configuration_id = models.PositiveIntegerField() <NEW_LINE> sp_searchd_id = models.PositiveIntegerField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = "sp_configuration_searchd" | Table *sp_configuration_searchd*: stores the connections between configurations and searchd entities. | 62598f07f9cc0f698b1c482a |
class Solution2(object): <NEW_LINE> <INDENT> def construct_bst(self, li): <NEW_LINE> <INDENT> print(li) <NEW_LINE> if not li: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> root = TreeNode(li[0]) <NEW_LINE> i = 1 <NEW_LINE> while i < len(li): <NEW_LINE> <INDENT> if li[i] > root.value: <NEW_LINE> <INDENT> break <NE... | Tree. Divide and Conquer. O(n^2). | 62598f0760cbc95b06362de9 |
class MockedToday(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> date_patcher = mock.patch.object( utils.datetime, 'date', mock.Mock(wraps=datetime.date) ) <NEW_LINE> mocked_date = date_patcher.start() <NEW_LINE> mocked_date.today.return_value = datetime.date(1984, 12, 22) <NEW_LINE> self.... | Mock today please | 62598f07ff9c53063f519118 |
class GSHHSFeature(Feature): <NEW_LINE> <INDENT> _geometries_cache = {} <NEW_LINE> def __init__(self, scale='auto', levels=None, **kwargs): <NEW_LINE> <INDENT> super(GSHHSFeature, self).__init__(cartopy.crs.PlateCarree(), **kwargs) <NEW_LINE> if scale not in ('auto', 'a', 'coarse', 'c', 'low', 'l', 'intermediate', 'i',... | An interface to the GSHHS dataset.
See http://www.ngdc.noaa.gov/mgg/shorelines/gshhs.html
Args:
* scale:
The dataset scale. One of 'auto', 'coarse', 'low', 'intermediate',
'high, or 'full' (default is 'auto').
* levels:
A list of integers 1-4 corresponding to the desired GSHHS feature
levels to draw ... | 62598f07167d2b6e312b5a53 |
@loggable <NEW_LINE> class ChatEvent(MessageEvent): <NEW_LINE> <INDENT> def __init__(self, frame, pid, target, text): <NEW_LINE> <INDENT> super(ChatEvent, self).__init__(frame, pid) <NEW_LINE> self.target = target <NEW_LINE> self.text = text <NEW_LINE> self.to_all = (self.target == 0) <NEW_LINE> self.to_allies = (self.... | Records in-game chat events. | 62598f0771ff763f4b5e621b |
class Differentiator: <NEW_LINE> <INDENT> def __init__(self, fs, alpha=1.0): <NEW_LINE> <INDENT> self.T = 1.0 / fs <NEW_LINE> self.alpha = alpha <NEW_LINE> self.x_1 = 0.0 <NEW_LINE> self.xD_1 = 0.0 <NEW_LINE> <DEDENT> def differentiate(self, x): <NEW_LINE> <INDENT> xD = (((1 + self.alpha) / self.T) * (x - self.x_1)) - ... | Time domain differentiation using the alpha transform | 62598f07956e5f7376df4bd8 |
class FinBertQARanker(TorchDevice, Match2DocRanker): <NEW_LINE> <INDENT> batch_size = 16 <NEW_LINE> required_keys = {"text"} <NEW_LINE> def __init__( self, pretrained_model_name_or_path: str = os.path.join(cur_dir, "models/bert-qa"), model_path: str = os.path.join(cur_dir, "models/2_finbert-qa-50_512_16_3e6.pt"), max_l... | :class:`FinBertQARanker` Compute QA relevancy scores using a fine-tuned BERT model. | 62598f07851cf427c66b6d81 |
class itkGradientToMagnitudeImageFilterICVF22ID2(itkGradientToMagnitudeImageFilterICVF22ID2_Superclass): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor define... | Proxy of C++ itkGradientToMagnitudeImageFilterICVF22ID2 class | 62598f07fbf16365ca792b54 |
class TestInlineResponse400InvalidRequestBody(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 testInlineResponse400InvalidRequestBody(self): <NEW_LINE> <INDENT> pass | InlineResponse400InvalidRequestBody unit test stubs | 62598f07be7bc26dc92513c0 |
class RandomDirections: <NEW_LINE> <INDENT> def __init__(self, directions): <NEW_LINE> <INDENT> self.directions = directions <NEW_LINE> self.dim = directions.shape[1] <NEW_LINE> self.n = directions.shape[0] <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_npy(cls, path): <NEW_LINE> <INDENT> directions = np.load(pat... | random directions in the full-space | 62598f075fdd1c0f98e5ca5a |
class PGDAttack(Attack, LabelMixin): <NEW_LINE> <INDENT> def __init__( self, predict1, predict2, loss_fn=None, eps=0.3, nb_iter=40, eps_iter=0.01, rand_init=True, clip_min=0., clip_max=1., ord=np.inf, l1_sparsity=None, targeted=False): <NEW_LINE> <INDENT> super(PGDAttack, self).__init__( predict1, predict2, loss_fn, cl... | The projected gradient descent attack (Madry et al, 2017).
The attack performs nb_iter steps of size eps_iter, while always staying
within eps from the initial point.
Paper: https://arxiv.org/pdf/1706.06083.pdf
:param predict: forward pass function.
:param loss_fn: loss function.
:param eps: maximum distortion.
:param... | 62598f07091ae356687036d5 |
class FacebookAuthorizationRequestFlow(AuthorizationRequestFlow): <NEW_LINE> <INDENT> def __init__(self, adapter): <NEW_LINE> <INDENT> AuthorizationRequestFlow.__init__(self, adapter) <NEW_LINE> <DEDENT> def authorization_uri(self, state=None): <NEW_LINE> <INDENT> data = { "response_type": "code", "client_id": self.cli... | AuthorizationRequestFlow for Facebook.
| 62598f07956e5f7376df4bd9 |
class RetryMiddleware(DownloaderMiddleware): <NEW_LINE> <INDENT> RETRY_EXCEPTIONS = () <NEW_LINE> def __init__(self, spider): <NEW_LINE> <INDENT> self.spider = spider <NEW_LINE> self.settings = spider.settings <NEW_LINE> self.max_retry_count = self.settings.get_int("RETRY_COUNT") <NEW_LINE> self.retry_status_codes = se... | Retry Middleware | 62598f074527f215b58e89b5 |
class Meta(CalAccessBaseModel.Meta): <NEW_LINE> <INDENT> db_table = 'F501_502_CD' <NEW_LINE> ordering = ("-rpt_date",) | Meta model options. | 62598f0797e22403b383999b |
class MenuNode(CaktNode): <NEW_LINE> <INDENT> def render_with_args(self, context, slug, full_tree=False, template_name='treenav/menuitem.html'): <NEW_LINE> <INDENT> parent_context = context <NEW_LINE> menu = get_menu_item(slug) <NEW_LINE> if not menu: <NEW_LINE> <INDENT> return '' <NEW_LINE> <DEDENT> root = menu.to_tre... | Renders the top-level items of a named Menu model object. | 62598f07fff4ab517ebcc28e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.