code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DeleteMatchRegEx(commands.Cog): <NEW_LINE> <INDENT> def __init__(self, bot: commands.Bot, config: helpers.Config, log: logging.Logger): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.config = config <NEW_LINE> self.log = log <NEW_LINE> self.log.info("Loaded Cog DeleteMatchRegEx") <NEW_LINE> <DEDENT> @commands... | Deletes messages if they don't match a RegEx. Used to keep lobby channel on topic | 62598f785e10d32532ce3584 |
class CacheKeyGenerator(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def combine_cache_keys(cache_keys): <NEW_LINE> <INDENT> if len(cache_keys) == 1: <NEW_LINE> <INDENT> return cache_keys[0] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> combined_id = Target.maybe_readable_combine_ids(cache_key.id for cache_key... | Generates cache keys for versions of target sets. | 62598f781f5feb6acb162564 |
class Analytics: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def data_insert(table_name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if request.method == 'OPTIONS': <NEW_LINE> <INDENT> response = make_resp(msg="OK", status_code=200) <NEW_LINE> respon... | Analytics Data Insertion Class
Connects to Google's BigQuery Tables. You must specify the table_name to be looked up in a TableManager file.
Payload is collected from the POST request and inserted as a row into the respective table
| 62598f7891af0d3eaad3973a |
class LogParser(object): <NEW_LINE> <INDENT> LOG_NAME_RE = re.compile(r'.*') <NEW_LINE> def parse(self, lines): <NEW_LINE> <INDENT> raise NotImplementedError | Methods for parsing information from Hadoop logs | 62598f78baa26c4b54d4ebe0 |
class helloWorld_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRING, 'success', 'UTF8', 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._fast_decode is not None and isinstance(ip... | Attributes:
- success | 62598f78c432627299fa2906 |
class from_address_t(type_modifier_t): <NEW_LINE> <INDENT> def __init__(self, function, arg_ref): <NEW_LINE> <INDENT> modifier = lambda type_: declarations.FUNDAMENTAL_TYPES[ 'unsigned int' ] <NEW_LINE> type_modifier_t.__init__( self, function, arg_ref, modifier ) <NEW_LINE> if not is_ptr_or_array( self.arg.type ): <NE... | Handles a single input variable.
Replaces the actual argument type with some integral type, so you
could use :mod:`ctypes` package.
void do_something(int** image) -> do_something(unsigned int image_address) | 62598f788a43f66fc4bf1aad |
class TopicHandler(Handler): <NEW_LINE> <INDENT> DOC_PREVIEW_NUMBER = 5 <NEW_LINE> @classmethod <NEW_LINE> @update_decorator <NEW_LINE> def handle(cls, bot, update, args): <NEW_LINE> <INDENT> topic_name = ' '.join(args) <NEW_LINE> news_db.connect(reuse_if_open=True) <NEW_LINE> try: <NEW_LINE> <INDENT> section = Section... | Handles /topic query | 62598f78d164cc61758208a4 |
class AfCDailyCats(Task): <NEW_LINE> <INDENT> name = "afc_dailycats" <NEW_LINE> number = 3 <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> cfg = self.config.tasks.get(self.name, {}) <NEW_LINE> self.prefix = cfg.get("prefix", "Category:AfC submissions by date/") <NEW_LINE> self.content = cfg.get("content", "{{AfC submis... | A task to create daily categories for [[WP:AFC]]. | 62598f78d10714528d69d7fd |
class ObjectDoesNotExist(Exception): <NEW_LINE> <INDENT> pass | We tried to get a single object but it does not exist in AWS. | 62598f7866656f66f7d59d21 |
@dataclass(frozen=True) <NEW_LINE> class UpdatedHeadBlockEvent(Event): <NEW_LINE> <INDENT> head_block_number: BlockNumber | Event triggered after updating the head block and all events. | 62598f78287bf620b62714e7 |
class BoyanFeatures(Feature): <NEW_LINE> <INDENT> __mapping = { 0 : np.array([0.0 , 0.0 , 0.0 , 1.0 ]), 1 : np.array([0.0 , 0.0 , 0.25, 0.75]), 2 : np.array([0.0 , 0.0 , 0.5 , 0.5 ]), 3 : np.array([0.0 , 0.0 , 0.75, 0.25]), 4 : np.array([0.0 , 0.0 , 1.0 , 0.0 ]), 5 : np.array([0.0 , 0.25, 0.75, 0.0 ]), 6 : np.array([0.... | Features for the Boyan Chain.
[See page 6 of the iLSTD paper](https://papers.nips.cc/paper/3092-ilstd-eligibility-traces-and-convergence-analysis.pdf)
for an example using the chain with these features. | 62598f78d99f1b3c44d04fdb |
class OWLOntologyIRIMapper(object): <NEW_LINE> <INDENT> def get_document_iri(self): <NEW_LINE> <INDENT> raise NotImplementedError() | Marker class | 62598f781d351010ab8f346f |
class TestPerson(unittest.TestCase): <NEW_LINE> <INDENT> def testSetStageName(self): <NEW_LINE> <INDENT> self.person1 = Person.Person("Selena Gómez") <NEW_LINE> self.person1.setStageName("Selena") <NEW_LINE> self.assertEqual("Selena", self.person1.getStageName()) <NEW_LINE> <DEDENT> def testSetRealName(self): <NEW_LINE... | Pruebas unitarias para la clase Person | 62598f788da39b475be02b12 |
class RouterStatusBgpPeerStatus(_messages.Message): <NEW_LINE> <INDENT> class StatusValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> DOWN = 0 <NEW_LINE> UNKNOWN = 1 <NEW_LINE> UP = 2 <NEW_LINE> <DEDENT> advertisedRoutes = _messages.MessageField('Route', 1, repeated=True) <NEW_LINE> ipAddress = _messages.StringField... | A RouterStatusBgpPeerStatus object.
Enums:
StatusValueValuesEnum: Status of the BGP peer: {UP, DOWN}
Fields:
advertisedRoutes: Routes that were advertised to the remote BGP peer
ipAddress: IP address of the local BGP interface.
linkedVpnTunnel: URL of the VPN tunnel that this BGP peer controls.
name: Name o... | 62598f786fece00bbaccb2bc |
class SortedList: <NEW_LINE> <INDENT> def __init__(self, query, min_score=30, limit=9): <NEW_LINE> <INDENT> self._query = query.lower().strip() <NEW_LINE> self._min_score = min_score <NEW_LINE> self._limit = limit <NEW_LINE> self._items = SortedCollection(key=lambda i: i.score) <NEW_LINE> <DEDENT> def __len__(self): <N... | List maintains result items in a sorted order
(sorted by a score, which is a similarity between item's name and a query)
and limited to a number `limit` passed into the constructor | 62598f7816aa5153ce3ffe2e |
class NamespaceElement(object): <NEW_LINE> <INDENT> def __init__(self, name="", description="", value="", **kwargs): <NEW_LINE> <INDENT> if "pb" in kwargs: <NEW_LINE> <INDENT> self._pb = kwargs.get("pb") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self._pb = PbNamespaceElement() <NEW_LINE> self._pb.Value = value <NEW... | Namespace element of a metric.
A namespace element is static when the `value` attribute is set
and where the `name` attribute is not set. This is the case when the
namespace does not change based on what is being collected.
A dynamic namespace element is defined by an element that contains
non-static data relative ... | 62598f7882261d6c5272fb6b |
class ReshapeRewriter(DFPatternCallback): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(require_type=True, rewrite_once=True) <NEW_LINE> self.pattern = ( wildcard().has_attr({"Composite": ethosu_patterns.ReshapeParams.composite_name}) )(wildcard()) <NEW_LINE> <DEDENT> def callback( self, ... | This pass brings the reshape out of the partitioned function | 62598f78d6c5a102081e1a76 |
class HTML: <NEW_LINE> <INDENT> def __init__(self, web_dir, title, refresh=0): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.web_dir = web_dir <NEW_LINE> self.img_dir = os.path.join(self.web_dir, 'images') <NEW_LINE> if not os.path.exists(self.web_dir): <NEW_LINE> <INDENT> os.makedirs(self.web_dir) <NEW_LINE> ... | This HTML class allows us to save images and write texts into a single HTML file.
It consists of functions such as <add_header> (add a text header to the HTML file),
<add_images> (add a row of images to the HTML file), and <save> (save the HTML to the disk).
It is based on Python library 'dominate', a Python library f... | 62598f78b57a9660fecd13ae |
class City(BaseModel): <NEW_LINE> <INDENT> city_id = "" <NEW_LINE> user_id = "" <NEW_LINE> name = "" <NEW_LINE> description = "" <NEW_LINE> number_rooms = 0 <NEW_LINE> number_bathrooms = 0 <NEW_LINE> max_guest = 0 <NEW_LINE> price_by_night = 0 <NEW_LINE> latitude = 0.0 <NEW_LINE> longitude = 0.0 <NEW_LINE> amenity_ids ... | A place to stay | 62598f78d10714528d69d7fe |
class ElencoVolontariGiovani(ElencoVolontari): <NEW_LINE> <INDENT> def risultati(self): <NEW_LINE> <INDENT> oggi = date.today() <NEW_LINE> nascita_minima = date(oggi.year - Persona.ETA_GIOVANE, oggi.month, oggi.day) <NEW_LINE> return super(ElencoVolontariGiovani, self).risultati().filter( data_nascita__gt=nascita_minim... | args: QuerySet<Sede>, Sedi per le quali compilare gli elenchi sostenitori | 62598f7891af0d3eaad3973c |
class Lista_Pontos2D: <NEW_LINE> <INDENT> def __init__(self, pts): <NEW_LINE> <INDENT> laux = [] <NEW_LINE> for i in pts: <NEW_LINE> <INDENT> laux.append(i) <NEW_LINE> <DEDENT> self.pts = laux <NEW_LINE> self.n = len(self.pts) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.pts) <NEW_LINE> <D... | Classe que representa uma lista de pontos no plano representados por
objetos da classe Ponto2D.
Os atributos de estado desta classe serão `pts` e `n`:
`pts` (list): lista de referências a objetos da classe Ponto2D e
`n` (int) : número de pontos em `pts`. | 62598f7807d97122c42165d2 |
class NodeAliasUpdator(NetworkUpdator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(NodeAliasUpdator, self).__init__() <NEW_LINE> <DEDENT> def get_description(self): <NEW_LINE> <INDENT> return 'Updates node alias attribute' <NEW_LINE> <DEDENT> def update(self, network): <NEW_LINE> <INDENT> issues ... | Update node alias attribute | 62598f78cad5886f8bdc4c53 |
class Media(object): <NEW_LINE> <INDENT> def __init__(self, geometry, style, bitmap): <NEW_LINE> <INDENT> self.geometry = geometry <NEW_LINE> self.style = style <NEW_LINE> self.bitmap = bitmap <NEW_LINE> <DEDENT> def render(self, device): <NEW_LINE> <INDENT> g = self.geometry <NEW_LINE> surface = self.bitmap.get_surfac... | <sf:media sfa:ID="SFDImageInfoDowngrader-0" sf:placeholder="true" key:inheritance="prototype" key:tag="Media">
<sf:geometry sfa:ID="SFDAffineGeometry-16" sf:aspectRatioLocked="true">
....
</sf:geometry>
<sf:style>
<sf:graphic-style-ref sfa:IDREF="SFDGraphicStyle-16"/>
</sf:style>
<sf:placeholder-size ... | 62598f78d53ae8145f917dc6 |
class Input(Module): <NEW_LINE> <INDENT> def __init__(self, label=None, seed=None, add_to_container=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(label, seed, add_to_container) <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self.input_nodes = {} <NEW_LINE> <DEDENT> def on_add(self, spa): <NEW_LINE> <INDENT> Module.... | A SPA module for providing external inputs to other modules.
The parameters passed to this module indicate the module input name
and the function to execute to generate inputs to that module.
The functions should always return strings, which will then be parsed
by the relevant vocabulary. For example::
def input1... | 62598f78c432627299fa2908 |
class EventApiV1(ApiMixin, RequestHandler): <NEW_LINE> <INDENT> @tornado.web.authenticated <NEW_LINE> def get(self, iuid): <NEW_LINE> <INDENT> self.check_admin() <NEW_LINE> event = self.get_doc(iuid) <NEW_LINE> if event.get(constants.DOCTYPE) != constants.EVENT: <NEW_LINE> <INDENT> raise tornado.web.HTTPError(404, reas... | Return event data. | 62598f78d164cc61758208a7 |
class SetPresetMergemodeWithExtraData(TestMixins.SetWithDataMixin, OptionalParameterTestFixture): <NEW_LINE> <INDENT> PID = 'PRESET_MERGEMODE' | Send a SET PRESET_MERGEMODE command with extra data. | 62598f7866656f66f7d59d23 |
class MeteringLabel(neutron.NeutronResource): <NEW_LINE> <INDENT> PROPERTIES = ( NAME, DESCRIPTION, ) = ( 'name', 'description', ) <NEW_LINE> properties_schema = { NAME: properties.Schema( properties.Schema.STRING, _('Name of the metering label.') ), DESCRIPTION: properties.Schema( properties.Schema.STRING, _('Descript... | A resource for creating neutron metering label. | 62598f7876d4e153a661c547 |
class FedexProcessShipmentRequest(FedexBaseService): <NEW_LINE> <INDENT> def __init__(self, config_obj, *args, **kwargs): <NEW_LINE> <INDENT> self._config_obj = config_obj <NEW_LINE> self._version_info = {'service_id': 'ship', 'major': '7', 'intermediate': '0', 'minor': '0'} <NEW_LINE> self.RequestedShipment = None <NE... | This class allows you to process (create) a new FedEx shipment. You will
need to populate the data structures in self.RequestedShipment, then
send the request. Label printing is supported and very configurable,
returning an ASCII representation with the response as well. | 62598f78b5575c28eb71295e |
class TestPyPrime(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_001_is_zero_not_prime(self): <NEW_LINE> <INDENT> self.assertFalse(pyprime(0)) <NEW_LINE> <DEDENT> def test_002_is_one_not_prime(self): <NEW_LINE> <INDENT> self.assertFalse(pyprime(1), msg='Fo... | test for pyprime | 62598f78a4f1c619b294df1d |
class HashableRLP(rlp.Serializable): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_dict(cls, field_dict): <NEW_LINE> <INDENT> return cls(**field_dict) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_bytes(cls, serialized_bytes): <NEW_LINE> <INDENT> return rlp.decode(serialized_bytes, cls) <NEW_LINE> <DEDENT... | An extension of :class:`rlp.Serializable`. In adition to the below
functions, the class is iterable.
Use like:
::
class MyRLP(HashableRLP):
fields = (
('name1', rlp.sedes.big_endian_int),
('name2', rlp.sedes.binary),
etc...
)
my_obj = MyRLP(name2=b'\xff', ... | 62598f7882261d6c5272fb6c |
class AuthAPIView(generics.CreateAPIView): <NEW_LINE> <INDENT> permission_classes = (AllowAny,) <NEW_LINE> queryset = User.objects.filter(is_active=True) <NEW_LINE> serializer_class = AuthSerializer <NEW_LINE> @transaction.atomic <NEW_LINE> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE>... | Authentication ViewSet | 62598f78dc8b845886d52ee5 |
class MyLSTMCell(RNNCell): <NEW_LINE> <INDENT> def __init__(self, num_units, num_proj, forget_bias=1.0, activation=None): <NEW_LINE> <INDENT> super(MyLSTMCell, self).__init__(_reuse=True) <NEW_LINE> self._num_units = num_units <NEW_LINE> self._num_proj = num_proj <NEW_LINE> self._forget_bias = forget_bias <NEW_LINE> se... | Your own basic LSTMCell implementation that is compatible with TensorFlow. To solve the compatibility issue, this
class inherits TensorFlow RNNCell class.
For reference, you can look at the TensorFlow LSTMCell source code. To locate the TensorFlow installation path, do
the following:
1. In Python, type 'import tensor... | 62598f788e71fb1e983bb3e6 |
class AssetFile: <NEW_LINE> <INDENT> STATIC_FILE = 'static' <NEW_LINE> ASSET = 'asset' <NEW_LINE> def __init__(self, asset_type, name, content_type, path, size): <NEW_LINE> <INDENT> self.__type = asset_type <NEW_LINE> if self.__type not in (self.STATIC_FILE, self.ASSET): <NEW_LINE> <INDENT> raise ValueError("Invalid as... | A single static file that the server can serve | 62598f780383005118f6d033 |
class Score(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def first_quarter(self) -> str: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def second_quarter(self) -> str: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def third_quarter(self) -> str: <NEW_LINE> <IN... | Abstract interface for team score. | 62598f786aa9bd52df0d4808 |
class _ArbitraryExtensionFileFromPattern(_FileFromPattern): <NEW_LINE> <INDENT> def _post(self, value, song): <NEW_LINE> <INDENT> super_object = super(_ArbitraryExtensionFileFromPattern, self) <NEW_LINE> return super_object._post(value, song, False) | Allows filename-like output with extensions different from the song. | 62598f78d6c5a102081e1a78 |
class SortedSetEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, obj): <NEW_LINE> <INDENT> if isinstance(obj, set): <NEW_LINE> <INDENT> return sorted(obj) <NEW_LINE> <DEDENT> return json.JSONEncoder.default(self, obj) | Encode sets as sorted lists. | 62598f780fa83653e46f4822 |
class Mul(BinPredicate): <NEW_LINE> <INDENT> def __init__(self, vars): <NEW_LINE> <INDENT> BinPredicate.__init__(self, vars, "mul") <NEW_LINE> self.lb = min(self.get_lb(0) * self.get_lb(1), self.get_lb(0) * self.get_ub(1), self.get_ub(0) * self.get_lb(1), self.get_ub(0) * self.get_ub(1)) <NEW_LINE> self.ub = max(self.g... | Multiplication expression to equal the multiplication of the two operands.
Cannot be used as a top-level constraint.
.. code-block:: python
var1 = Variable(0, 10)
var2 = Variable(0, 100)
mulxp1 = var2 * var1
mulexp2 = var2 * 10
.. warning::
Cannot be used with all solvers and
:class:`.Const... | 62598f784e696a045264da98 |
class ControlFunctionOracle: <NEW_LINE> <INDENT> def __init__(self, function, **kwargs): <NEW_LINE> <INDENT> if isinstance(function, int): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> import dormouse <NEW_LINE> self.function = dormouse.to_truth_tabl... | Synthesize a negation controlled by an arbitrary control function.
This creates a circuit for a NOT gate which is controlled by an arbitrary
Boolean control function. The control function is provided as integer
representation of the function's truth table in binary notation. For
example, for the majority-of-three fu... | 62598f78596a8972361275ae |
class TestBrick(TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> with patch.object(Ball, "__init__", lambda x, y, z: None): <NEW_LINE> <INDENT> ball_mock = Ball(None, None) <NEW_LINE> ball_mock._rect = pygame.Rect(0, 0, 10, 10) <NEW_LINE> ball_mock._moving = True <NEW_LINE> ball_mock.angle = ... | class which testing Brick | 62598f7815baa723494618b2 |
class NodeListIter(Iterator): <NEW_LINE> <INDENT> def __init__(self, lst): <NEW_LINE> <INDENT> self._SENTINEL = Sentinel() <NEW_LINE> self._lst = lst <NEW_LINE> self._ptr = _utils.NodeList_get_first_iter(lst._ptr) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'NodeListIter'+str(list(self))... | An iterator to iterate over NodeList.
.. note::
Despite the fact that it wraps a pointer, this class does not extend
the PointerWrapper class since there is no need to free the pointer. | 62598f781d351010ab8f3472 |
class TestsError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg=""): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.msg | Exception lancée lorsque les tests échouent | 62598f7815baa723494618b3 |
class ThematicBreakParser(BlockElementParser): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def parse(code, index, auxiliary=None): <NEW_LINE> <INDENT> success, index = BlockElementParser.check_indent(code, index) <NEW_LINE> if not success: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> if index >= len(code): <NEW... | The thematic break parser.
A line consisting of 0-3 spaces of indentation, followed by a
sequence of three or more matching -, _, or * characters, each
followed optionally by any number of spaces, forms a thematic break. | 62598f7882261d6c5272fb6d |
class Failure(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, errno, strerror): <NEW_LINE> <INDENT> super(Failure, self).__init__() <NEW_LINE> self.errno = errno <NEW_LINE> self.strerror = strerror <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '[{}] {}'.format(self.errno, self.strerror) | A FAILED response from the server | 62598f7823849d37ff8509f0 |
class ConnectionSet(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ConnectionSet, self).__init__() <NEW_LINE> self.function_codes = CanOpenPredefinedConnectionSet.copy() <NEW_LINE> <DEDENT> def setup_from_eds(self, eds): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def determine_service(self... | @summary: opencan 2.a services | 62598f7823e79379d538be2e |
class TranslationForm(ChecksumForm): <NEW_LINE> <INDENT> contentsum = ChecksumField(required=True) <NEW_LINE> translationsum = ChecksumField(required=True) <NEW_LINE> target = PluralField(required=False) <NEW_LINE> fuzzy = FuzzyField(required=False) <NEW_LINE> review = forms.ChoiceField( label=_('Review state'), choice... | Form used for translation of single string. | 62598f7821bff66bcd722599 |
class MeanAbsoluteError(Loss): <NEW_LINE> <INDENT> __extra_registration_keys__ = ['MAE'] <NEW_LINE> def __call__(self, outputs): <NEW_LINE> <INDENT> err = self.diff(outputs) <NEW_LINE> if self.weight is not None: <NEW_LINE> <INDENT> return abs(self.weight * err).sum() / self.weight.sum() <NEW_LINE> <DEDENT> return abs(... | Mean-absolute-error (MAE) loss function.
Notes
-----
The mean absolute error (MAE) loss computes the mean difference between the
output of a computation graph :math:`x = (x_1, \dots, x_d)` and its expected
target value :math:`t = (t_1, \dots, t_d)`. Mathematically,
.. math::
\begin{eqnarray*}
\mathcal{L}(x, t)... | 62598f78be8e80087fbbe995 |
class IAddloginEvent(Interface): <NEW_LINE> <INDENT> pass | 用户登陆事件 | 62598f789b70327d1c57e6e5 |
class TestPingService(BaseTestCase): <NEW_LINE> <INDENT> def test_ping(self): <NEW_LINE> <INDENT> response = self.client.get('/api/v1/ping') <NEW_LINE> data = json.loads(response.data.decode()) <NEW_LINE> self.assertEqual(response.status_code, 200) <NEW_LINE> self.assertIn('pong!', data['message']) <NEW_LINE> self.asse... | Tests for the Users Service. | 62598f78287bf620b62714ec |
class RosePopenEvent(Event): <NEW_LINE> <INDENT> LEVEL = Event.VV <NEW_LINE> def __init__(self, command, stdin): <NEW_LINE> <INDENT> self.command = command <NEW_LINE> self.stdin = stdin <NEW_LINE> Event.__init__(self, command, stdin) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> command = self.command <NEW... | An event raised before a shell command call. | 62598f78d53ae8145f917dca |
class Image(TimeStampModel): <NEW_LINE> <INDENT> file = models.ImageField() <NEW_LINE> location = models.CharField(max_length=140) <NEW_LINE> caption = models.TextField() <NEW_LINE> creator = models.ForeignKey(user_models.User, on_delete=models.PROTECT, null=True, related_name='images') <NEW_LINE> tags = TaggableManage... | Image Model | 62598f787b25080760ed6dd5 |
class BaseSimpleTest(object): <NEW_LINE> <INDENT> name = None <NEW_LINE> def __init__(self, str): <NEW_LINE> <INDENT> self.str = str <NEW_LINE> <DEDENT> def run(self, data): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.str | Abstract base class for simple tests | 62598f781d351010ab8f3475 |
class DetunedSum(object): <NEW_LINE> <INDENT> LAST_ID = 0 <NEW_LINE> def __init__(self, base, sigma, chans=(1,2), **kwargs): <NEW_LINE> <INDENT> self.base = base <NEW_LINE> self.sigma = sigma <NEW_LINE> self.chans = chans <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self._pulses = [] <NEW_LINE> <DEDENT> def add(self, amp... | A generator for pulses containing a sum of one or more detuned rotation
pulses in a single pair of I/Q channels. | 62598f786fece00bbaccb2c1 |
class account_budget_crossvered_summary_report(osv.osv_memory): <NEW_LINE> <INDENT> _name = 'account.budget.crossvered.summary.report' <NEW_LINE> _description = 'Account Budget crossvered summary report' <NEW_LINE> _columns = { 'date_from': fields.date('Start of period', required=True), 'date_to': fields.date('End of ... | This wizard provides the crossovered budget summary report' | 62598f7815fb5d323ce7e65f |
class CommentsError(Exception): <NEW_LINE> <INDENT> pass | Base for all comment-plugin related exceptions. | 62598f7816aa5153ce3ffe34 |
class Notification(models.Model): <NEW_LINE> <INDENT> source_id = models.IntegerField() <NEW_LINE> target_id = models.IntegerField() <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> init_date = models.DateTimeField(auto_now=True) <NEW_LINE> ack_date = models.DateTimeField(null=True) <NEW_LINE> descri... | check configs for description_id and category_id
| 62598f7823e79379d538be2f |
@OFPAction.register_action_type(ofproto.OFPAT_SET_FIELD, ofproto.OFP_ACTION_SET_FIELD_SIZE) <NEW_LINE> class OFPActionSetField(OFPAction): <NEW_LINE> <INDENT> def __init__(self, field=None, **kwargs): <NEW_LINE> <INDENT> super(OFPActionSetField, self).__init__() <NEW_LINE> assert len(kwargs) == 1 <NEW_LINE> key = kwarg... | Set field action
This action modifies a header field in the packet.
The set of keywords available for this is same as OFPMatch.
Example::
set_field = OFPActionSetField(eth_src="00:00:00:00:00") | 62598f7882261d6c5272fb6e |
class Command: <NEW_LINE> <INDENT> def __init__(self, plugin, name, handler, permission, channels, exclude_channels, client_cmd_pass, client_cmd_perm, prefix, usage): <NEW_LINE> <INDENT> if not (channels == None or hasattr(channels, "__iter__")): <NEW_LINE> <INDENT> raise ValueError("'channels' must be a finite iterabl... | A class representing a input-triggered command.
Has information about the command itself, its usage, when and who to call when
action should be taken. | 62598f7838b623060ffa89ce |
class OperationProxy(ABC): <NEW_LINE> <INDENT> def __init__(self, client, operation: Operation): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.cache: Optional[Cache] = self.client.cache <NEW_LINE> self.operation = operation <NEW_LINE> self.fields: Optional[Tuple[SelectedField]] = None <NEW_LINE> self.variabl... | The operation proxy class provides callable instances where the query,
variables and an optional operation name can be passed by.
An instance of this class is not intended to be called directly.
Use it's sub classes instead. | 62598f78ec188e330fdf81d6 |
class HardException(KojakException): <NEW_LINE> <INDENT> pass | Throw this exception when an error occurs that is significant enough
to abort the scenario. | 62598f780fa83653e46f4826 |
class Spectrum(object): <NEW_LINE> <INDENT> def __init__(self, wave, flux, wave_unit=u.AA, unit=(u.erg / u.s / u.cm**2 / u.AA)): <NEW_LINE> <INDENT> self.wave = np.asarray(wave, dtype=np.float64) <NEW_LINE> self.flux = np.asarray(flux, dtype=np.float64) <NEW_LINE> if self.wave.shape != self.flux.shape: <NEW_LINE> <INDE... | A spectrum, representing wavelength and spectral density values.
Parameters
----------
wave : list_like
Wavelength values.
flux : list_like
Spectral flux density values.
wave_unit : `~astropy.units.Unit`
Unit on wavelength.
unit : `~astropy.units.BaseUnit`
For now, only units with flux density in energ... | 62598f7871ff763f4b5e70a2 |
class Tag(InnerObjectWrapper): <NEW_LINE> <INDENT> pass | Definition of tag in Elasticsearch, very similar to Django ORM tables. | 62598f784e696a045264da9a |
class QNLITask(AbstractGlueTask): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> is_pair = True <NEW_LINE> class_labels = ['not_entailment', 'entailment'] <NEW_LINE> metric = Accuracy() <NEW_LINE> super(QNLITask, self).__init__(class_labels, metric, is_pair) <NEW_LINE> <DEDENT> def get_dataset(self, segmen... | The SQuAD NLI task on GLUE benchmark. | 62598f78baa26c4b54d4ebe8 |
class LocalInstallScripts(install_scripts.install_scripts): <NEW_LINE> <INDENT> command_name = 'install_scripts' <NEW_LINE> def _make_wsgi_scripts_only(self, dist, executable, is_wininst): <NEW_LINE> <INDENT> header = easy_install.get_script_header("", executable, is_wininst) <NEW_LINE> wsgi_script_template = ENTRY_POI... | Intercepts console scripts entry_points. | 62598f7891af0d3eaad39742 |
class TTask(object): <NEW_LINE> <INDENT> def __init__(self, queue, task_id=0, tube="", raw_data=None): <NEW_LINE> <INDENT> self.task_id = unpack_long_long(task_id) <NEW_LINE> self.tube = tube <NEW_LINE> self.raw_data = raw_data <NEW_LINE> self.queue = queue <NEW_LINE> self.modified = False <NEW_LINE> <DEDENT> def ack(s... | Tarantool queue task wrapper.
.. warning::
Don't instantiate it with your bare hands | 62598f78cad5886f8bdc4c59 |
class MazeSolver(Solver): <NEW_LINE> <INDENT> def __init__(self, builder): <NEW_LINE> <INDENT> self._builder = builder <NEW_LINE> <DEDENT> @property <NEW_LINE> def builder(self) -> Builder: <NEW_LINE> <INDENT> return self._builder <NEW_LINE> <DEDENT> def solve(self): <NEW_LINE> <INDENT> start_time = time.time() <NEW_LI... | Solver getting the maze builder as input and finding the path from the starting point to the finish | 62598f7821bff66bcd72259b |
class PatchSettings(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'patch_mode': {'key': 'patchMode', 'type': 'str'}, 'enable_hotpatching': {'key': 'enableHotpatching', 'type': 'bool'}, } <NEW_LINE> def __init__( self, *, patch_mode: Optional[Union[str, "WindowsVMGuestPatchMode"]] = None, enable_ho... | Specifies settings related to VM Guest Patching on Windows.
:ivar patch_mode: Specifies the mode of VM Guest Patching to IaaS virtual machine.:code:`<br
/>`:code:`<br />` Possible values are::code:`<br />`:code:`<br />` **Manual** - You control
the application of patches to a virtual machine. You do this by applyin... | 62598f7915fb5d323ce7e661 |
class UDPMixin: <NEW_LINE> <INDENT> PACKET_SIZE = 256 <NEW_LINE> def push(self, message, addr_port): <NEW_LINE> <INDENT> msg_b = message.encode(self.ENCODING) <NEW_LINE> self.socket.sendto(msg_b, addr_port) <NEW_LINE> <DEDENT> def pull(self): <NEW_LINE> <INDENT> msg_b, addr_port = self.socket.recvfrom(self.PACKET_SIZE)... | Make connection UDP oriented instead of the default TCP. | 62598f79bde94217f3707302 |
class XGBBase(SklLearner): <NEW_LINE> <INDENT> preprocessors = default_preprocessors = [ HasClass(), Continuize(), RemoveNaNColumns(), ] <NEW_LINE> def __init__(self, preprocessors=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(preprocessors=preprocessors) <NEW_LINE> self.params = kwargs <NEW_LINE> <DEDENT> @Skl... | Base class for xgboost (classification and regression) learners | 62598f7963f4b57ef0085a0a |
class _ExceptionRetryArgs( collections.namedtuple( '_ExceptionRetryArgs', ['http', 'http_request', 'exc', 'num_retries', 'max_retry_wait'])): <NEW_LINE> <INDENT> pass | Bundle of information for retriable exceptions.
:type http: :class:`httplib2.Http` (or conforming alternative)
:param http: instance used to perform requests.
:type http_request: :class:`Request`
:param http_request: the request whose response was a retriable error
:type exc: :class:`Exception` subclass
:param exc: ... | 62598f79d4950a0f3b110ad2 |
class UserSlotProcessesManager(): <NEW_LINE> <INDENT> def __init__(self, ic): <NEW_LINE> <INDENT> self.ic = ic <NEW_LINE> <DEDENT> def get_or_create_user_slot_process(self, slot_obj, target_uri): <NEW_LINE> <INDENT> usp = self.find_user_slot_process(slot_obj, target_uri) <NEW_LINE> if usp: <NEW_LINE> <INDENT> created =... | Manages UserSlotProcesses in Runtime
Helps to solve signal persistence problem
Manages UserSlotProcesses and UserSlots? | 62598f79a8ecb03325870b40 |
class DESeq (object): <NEW_LINE> <INDENT> def __init__(self, count, group, repl, out): <NEW_LINE> <INDENT> self._table_count = count <NEW_LINE> self._groups_name = group <NEW_LINE> self._replic = repl <NEW_LINE> self._output = out <NEW_LINE> self._message = Message() <NEW_LINE> self._logfc_column = 6 <NEW_LINE> self._p... | Run DESeq analysis | 62598f790fa83653e46f4828 |
class WidgetManager(object): <NEW_LINE> <INDENT> def __init__(self, dialog, parent=None, root=None): <NEW_LINE> <INDENT> if dialog and not isinstance(dialog, c4d.gui.GeDialog): <NEW_LINE> <INDENT> raise TypeError('expected GeDialog') <NEW_LINE> <DEDENT> if parent and not isinstance(parent, WidgetManager): <NEW_LINE> <I... | A #WidgetManager takes care of all #BaseWidget instances in a single dialog.
It contains a command-queue that is being executed everytime the dialog
gets priority in the main-thread, manages widget ID assignment and more.
# Members
dialog: A #weakref.ref to the dialog that owns this #WidgetManager.
cid (int): The curr... | 62598f791f037a2d8b9e3a24 |
class AddGameDialog(Dialog, GameDialogCommon): <NEW_LINE> <INDENT> def __init__(self, parent, game=None, runner=None, callback=None): <NEW_LINE> <INDENT> super(AddGameDialog, self).__init__("Add a new game", parent=parent) <NEW_LINE> self.game = game <NEW_LINE> self.saved = False <NEW_LINE> self.set_default_size(DIALOG... | Add game dialog class. | 62598f794d74a7450cd58b72 |
@register_command <NEW_LINE> class ShellcodeCommand(GenericCommand): <NEW_LINE> <INDENT> _cmdline_ = "shellcode" <NEW_LINE> _syntax_ = "{:s} (search|get)".format(_cmdline_) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(ShellcodeCommand, self).__init__(prefix=True) <NEW_LINE> return <NEW_LINE> <DEDENT> def d... | ShellcodeCommand uses @JonathanSalwan simple-yet-awesome shellcode API to
download shellcodes. | 62598f797c178a314d78cde0 |
class WsgiMounter(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def default(e, s): <NEW_LINE> <INDENT> s("404 Not found", []) <NEW_LINE> return [] <NEW_LINE> <DEDENT> def __init__(self, mounts=None): <NEW_LINE> <INDENT> self.mounts = mounts or { } <NEW_LINE> self.mounts = dict([(k, WsgiApplication(v)) for k,v i... | Simple mounter object for wsgi callables. Takes a dict where the keys are
uri fragments and values are :class:`spyne.application.Application`
instances. | 62598f798e05c05ec3f6eae2 |
class CanvasAccountCourseRoles(UserRESTDispatch): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> roles = [] <NEW_LINE> account_id = kwargs['canvas_account_id'] <NEW_LINE> try: <NEW_LINE> <INDENT> for r in get_course_roles_in_account(self.blti.account_sis_id): <NEW_LINE> <INDENT> roles.... | Performs actions on a Canvas account course roles
GET returns 200 with account course roles. | 62598f7907d97122c42165da |
class Game(): <NEW_LINE> <INDENT> def __init__(self, wheel, table): <NEW_LINE> <INDENT> self.wheel = wheel <NEW_LINE> self.table = table <NEW_LINE> self.players = None <NEW_LINE> <DEDENT> def run(self, players): <NEW_LINE> <INDENT> self.players = players | Runs the roulette simulation.
Each round consists of the following phases:
1. Place bets
2. Spin wheel
3. Resolve all bets | 62598f793eb6a72ae0389f7a |
class SandboxTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> TestCase.setUpClass() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls): <NEW_LINE> <INDENT> TestCase.tearDownClass() <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> TestCase.setUp... | Sandbox integration tests.
| 62598f79d10714528d69d806 |
@dc.dataclass(eq=False, repr=False) <NEW_LINE> class AstIfStmt(AstDecl): <NEW_LINE> <INDENT> if_part: Tuple[AstExpr, AstBlockStmt] = dc.field( default_factory=lambda: (AstExpr(), AstBlockStmt()) ) <NEW_LINE> elif_parts: List[Tuple[AstExpr, AstBlockStmt]] = dc.field(default_factory=list) <NEW_LINE> else_part: Optional[A... | Ast node for an if statement. | 62598f7915baa723494618b8 |
class NewUserView(generic.FormView): <NEW_LINE> <INDENT> form_class = NewUserForm <NEW_LINE> template_name = 'harrispierce/new_user/new_user.html' <NEW_LINE> success_url = reverse_lazy('index_perso') <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> form = self.form_class(request.POST) <NEW_LINE> if form.is_valid... | A view that creates a new user. | 62598f790a366e3fb87dc302 |
class PolymorphicBase(models.base.ModelBase): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> full_mro = set( tuple([mro for b in bases for mro in b.__mro__]) + bases ) <NEW_LINE> base_polymorphic = set( [b for b in full_mro if issubclass(b, Polymorphic)] ) <NEW_LINE> attrs['_polymorphic_d... | Looking for classes in all classes that inherit from class polymorphic.
Adding:
- polymorphic models to class as attributes
- polymorphic descendants to bases class as attributes
- set is_polymorphic flag to bases class if class is polymorphic | 62598f7976d4e153a661c54e |
class Request(object): <NEW_LINE> <INDENT> def __init__(self, operation='', content=None, params=None, headers=None, api=None): <NEW_LINE> <INDENT> self._api = None <NEW_LINE> self._api_mod = api <NEW_LINE> self._operation = operation <NEW_LINE> self._content = content <NEW_LINE> self._params = params or {} <NEW_LINE> ... | General data for a Zaqar request
Transport will generate a request object and send to this the API to be
processed.
:param operation: Operation to identify the API call being processed,
i.e: 'get_queues', 'get_messages'
:type operation: str
:param content: Request's body. Default: None
:type content: str
:param params... | 62598f7907d97122c42165db |
@attr.s <NEW_LINE> class CertificateStatus(object): <NEW_LINE> <INDENT> status_type = attr.ib() <NEW_LINE> response = attr.ib() <NEW_LINE> def as_bytes(self): <NEW_LINE> <INDENT> return _constructs.CertificateStatus.build(Container( status_type=self.status_type, response=self.response, )) <NEW_LINE> <DEDENT> @classmeth... | An object representing a CertificateStatus struct | 62598f791d351010ab8f3478 |
class ETensor_torch(_ETensor_torch): <NEW_LINE> <INDENT> def mul(self, a): <NEW_LINE> <INDENT> n, d = self.float_to_rational(a) <NEW_LINE> self.rational_mul(n, d) <NEW_LINE> self.counter += 1 <NEW_LINE> if self.aux.max() > 2 ** (63 - 16): <NEW_LINE> <INDENT> self.aux_buffer.append(self.aux) <NEW_LINE> self.aux = self.a... | Original implementation -- not optimally space efficient | 62598f79b57a9660fecd13b7 |
class Observer(abc.ABC): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def update(self, subject: Subject) -> None: <NEW_LINE> <INDENT> pass | The Observer interface declares the update method, used by subjects. | 62598f79b830903b9686e10f |
class MemoryAttribute( ModelHolder[MemoryModel], ConcreteAttribute, Attribute[ MemoryContext, MemoryPopulation, MemoryModel, MemoryIndividual, 'MemoryAttribute' ] ): <NEW_LINE> <INDENT> def __init__( self, model: MemoryModel, name: str, cls: 'type' ): <NEW_LINE> <INDENT> super().__init__( model=model, name=name, type=c... | The :class:`MemoryAttribute` is designed to define attributes that resides in memory. It
inherits of all the behavior from the :class:`Attribute <galactic.context.Attribute>` class.
It's possible to modify a value for an attribute using an individual identifier.
Example
-------
>>> from galactic.context.memory i... | 62598f7963f4b57ef0085a0b |
class _Link_Impl(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._scheduler = scheduler.current() <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self._lastT = 0 <NEW_LINE> <DEDENT> def send(self, func): <NEW_LINE> <INDENT> t = self._scheduler.currentTime + sel... | Represents latency in information propagation from one agent to another one
(normally between a trader and a market).
Ensures that sending packets via a link preserves their order.
Parameters:
**latency**
function called for each packet in order to determine
when it will appear at the destination point | 62598f79dc8b845886d52eee |
class Body(): <NEW_LINE> <INDENT> def __init__(self, faces): <NEW_LINE> <INDENT> [f1, f2, f3, f4, f5, f6] = faces <NEW_LINE> self.face1 = f1 <NEW_LINE> self.face2 = f2 <NEW_LINE> self.face3 = f3 <NEW_LINE> self.face4 = f4 <NEW_LINE> self.face5 = f5 <NEW_LINE> self.face6 = f6 <NEW_LINE> <DEDENT> def add(self, a, dim): <... | Body object for the cube, strictly 3d. | 62598f794e696a045264da9c |
class User(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> email = db.Column(db.String(256), nullable=False, unique=True) <NEW_LINE> password = db.Column(db.String(256), nullable=False) <NEW_LINE> bucketlists = db.relationship( 'Bucketlist', orde... | This class defines the users table | 62598f79d4950a0f3b110ad3 |
class AddressViewSet(mixins.CreateModelMixin, mixins.UpdateModelMixin, GenericViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.UserAddressSerializer <NEW_LINE> permission_classes = [IsAuthenticated] <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return self.request.user.addresses.filter(is_deleted=F... | 用户地址新增与修改 | 62598f7971ff763f4b5e70a6 |
class MergeLayer(lasagne.layers.MergeLayer, Layer): <NEW_LINE> <INDENT> def __init__(self, incomings, name=None): <NEW_LINE> <INDENT> from ..graph import current_graph <NEW_LINE> self.graph = current_graph() <NEW_LINE> lasagne.layers.MergeLayer.__init__(self, incomings=incomings, name=name) <NEW_LINE> _ = self.name_sco... | This class represents a layer that aggregates input from multiple layers.
It should be subclassed when implementing new types of layers that obtain
their input from multiple layers.
:param incomings: A list of layers. | 62598f7923849d37ff8509f6 |
class FalconAuthMiddleware(object): <NEW_LINE> <INDENT> def __init__(self, backend, exempt_routes=None, exempt_methods=None): <NEW_LINE> <INDENT> self.backend = backend <NEW_LINE> if not isinstance(backend, AuthBackend): <NEW_LINE> <INDENT> raise ValueError( 'Invalid authentication backend {0}. ' 'Must inherit `falcon.... | Creates a falcon auth middleware that uses given authentication backend, and some
optional configuration to authenticate requests. After initializing the
authentication backend globally you can override the backend as well as
other configuration for a particular resource by setting the `auth` attribute
on it to an inst... | 62598f7907d97122c42165dc |
class TDataSet(typing.NamedTuple): <NEW_LINE> <INDENT> datadir: pathlib.Path <NEW_LINE> inputs: typing.List[pathlib.Path] <NEW_LINE> opts: typing.List[str] = [] <NEW_LINE> exp: Expected = Expected() <NEW_LINE> outname: str = '' <NEW_LINE> ref: typing.Optional[DictT] = None <NEW_LINE> oo_opts: DictT = {} <NEW_LINE> scm:... | A namedtuple object keeps test data to test cases with no file outputs.
| 62598f79e76e3b2f99fd836c |
class CategoryTax(ModelSQL): <NEW_LINE> <INDENT> _name = 'product.category-ekd.account.tax' <NEW_LINE> _table = 'ekd_category_taxes_rel' <NEW_LINE> _description = __doc__ <NEW_LINE> category = fields.Many2One('product.category', 'Category', ondelete='CASCADE', select=1, required=True) <NEW_LINE> tax = fields.Many2One('... | Category - Tax | 62598f7966673b3332c2fcfd |
class SentryRedisTtlProcessor(SentryProcessor): <NEW_LINE> <INDENT> _KEY = 'SENTRY_TTL' <NEW_LINE> def __init__(self, redis_host='localhost', redis_port=6379, ttl=1): <NEW_LINE> <INDENT> self.redis = redis.Redis(host=redis_host, port=redis_port) <NEW_LINE> self.ttl = ttl <NEW_LINE> <DEDENT> def _allowed(self): <NEW_LIN... | Processor for TTL handled by redis, which should work better for multiple server processes or versions | 62598f7930dc7b766599f196 |
class CJSON(filereader.Reader): <NEW_LINE> <INDENT> def __init__(self, source, *args, **kwargs): <NEW_LINE> <INDENT> super(CJSON, self).__init__(source, *args, **kwargs) <NEW_LINE> self.representation = dict() <NEW_LINE> <DEDENT> def parse(self): <NEW_LINE> <INDENT> super(CJSON, self).parse() <NEW_LINE> json_data = jso... | A reader for chemical JSON (CJSON) log files. | 62598f791d351010ab8f347b |
class _Node(TreeMap._Node): <NEW_LINE> <INDENT> __slots__ = '_balance_factor' <NEW_LINE> def __init__(self, element, parent=None, left=None, right=None): <NEW_LINE> <INDENT> super().__init__(element, parent, left, right) <NEW_LINE> self._balance_factor = 0 | Node class for AVL maintains height value for balancing.
We use convention that a "None" child has height 0, thus a leaf has height 1. | 62598f790383005118f6d03c |
class userLogin_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (UserTicket, UserTicket.thrift_spec), None, ), (1, TType.STRUCT, 'ouch', (InvalidOperation, InvalidOperation.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, ouch=None,): <NEW_LINE> <INDENT> self.success = succe... | Attributes:
- success
- ouch | 62598f7982261d6c5272fb71 |
class LazyLoaderModulePackageTest(TestCase): <NEW_LINE> <INDENT> module_name = 'loadertestmodpkg' <NEW_LINE> module_key = 'loadertestmodpkg.test' <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.opts = salt.config.minion_config(None) <NEW_LINE> cls.opts['grains'] = grains(cls.opts) <NEW_L... | Test the loader of salt with changing modules | 62598f798a349b6b43685b7d |
class APIError(Exception): <NEW_LINE> <INDENT> def __init__(self, error, field='', message=''): <NEW_LINE> <INDENT> super(APIError, self).__init__(message) <NEW_LINE> self.error = error <NEW_LINE> self.field = field <NEW_LINE> self.message = message | the base APIError which contains error(required), field(optional) and message(optional). | 62598f79ac7a0e7691f71e54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.