code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class ResultsPage(BasePage): <NEW_LINE> <INDENT> def iter_recipes(self): <NEW_LINE> <INDENT> for div in self.parser.select(self.document.getroot(), 'div.m_search_result'): <NEW_LINE> <INDENT> tds = self.parser.select(div, 'td') <NEW_LINE> if len(tds) == 2: <NEW_LINE> <INDENT> title = NotAvailable <NEW_LINE> thumbnail_u...
Page which contains results as a list of recipies
62598f530a366e3fb87dbe51
class TwitterListener(StreamListener): <NEW_LINE> <INDENT> def __init__(self, fetched_tweets_filename): <NEW_LINE> <INDENT> self.fetched_tweets_filename = fetched_tweets_filename <NEW_LINE> <DEDENT> def on_data(self, data): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> print(data) <NEW_LINE> with open(self.fetched_tweet...
This is a basic listener class that just prints received tweets to stdout.
62598f53d18da76e235b6b78
class MaxWeight(PolicyOnState, PolicyOnStateAndArrivals): <NEW_LINE> <INDENT> def __init__(self, state_space: str, costs: mm.NodesData): <NEW_LINE> <INDENT> super(MaxWeight, self).__init__(state_space=state_space) <NEW_LINE> self.costs = costs <NEW_LINE> <DEDENT> def compute_matchings_state(self, state: mm.State): <NEW...
This policy, given a State state, gives any feasible Matching u which maximise the following optimisation problem: u\cdot \nabla h(state) where h(state)=\sum_{i\in \mathcal{D}\cup\mathcal{S}} c_i x_i^2. i.e, it matches the most costly nodes (a product of the individual cost and the number of item in the node) in priori...
62598f53711fe17d825dfb7b
class JointPipeline(Pipeline): <NEW_LINE> <INDENT> def __init__(self, learner_attach, learner_label, decoder): <NEW_LINE> <INDENT> if not learner_attach.can_predict_proba: <NEW_LINE> <INDENT> raise ValueError('Attachment model does not know how to predict ' 'probabilities.') <NEW_LINE> <DEDENT> if not learner_label.can...
Parser that performs attach, direction, and labelling tasks. For the moment, this assumes AD.L models, but we hope to explore possible generalisations of this idea over time. In our working shorthand, this would be an AD.L:adl parser, ie. one that has separate attach-direct model and label model (AD.L); but which tre...
62598f53507cdc57c63a4222
class BernoulliNB(NBModel): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, sklearn_class=naive_bayes.BernoulliNB, **kwargs)
Implements a Bernoulli Naive Bayes model. :Params: features : `list` ( :class:`revscoring.Feature` ) The features that the model will be trained on version : str A version string representing the version of the model `**kwargs` Passed to :class:`sklearn.naive_bayes.BernoulliNB`
62598f53462c4b4f79dbae86
class Node(AuditedModel): <NEW_LINE> <INDENT> name = models.TextField(validators=[alphanumeric]) <NEW_LINE> system = models.ForeignKey('System', related_name='nodes') <NEW_LINE> unique_together = ('system', 'name') <NEW_LINE> def get_image(self, local=False, private=False): <NEW_LINE> <INDENT> if local: <NEW_LINE> <IND...
Node database abstraction that allows users to bind ports and their names.
62598f53507cdc57c63a4224
class AuthError(Exception): <NEW_LINE> <INDENT> pass
Exception raised on auth failure.
62598f545e10d32532ce332a
class NanotubeSelection(Selection): <NEW_LINE> <INDENT> def __init__(self, pdb, indexes = None, nanotubeIndexes = None, *args, **kwargs): <NEW_LINE> <INDENT> self.set_pdb(pdb) <NEW_LINE> self.indexes = indexes <NEW_LINE> self.nanotubeIndexes = nanotubeIndexes <NEW_LINE> super(NanotubeSelection,self).__init__(*args, **k...
create selections from a pdb that contains a nanotube
62598f54925a0f43d25e74bb
class Floor: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.symbole = ' ' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.symbole
Floor innerclass to create instance
62598f54d164cc6175820408
class NumType(xsi.Enumeration): <NEW_LINE> <INDENT> decode = { 'Integer': 1, 'Decimal': 2, 'Scientific': 3 } <NEW_LINE> aliases = { None: 'Integer' }
numtype enumeration:: (Integer | Decimal | Scientific ) 'Integer' Defines constants for the above numeric types. Usage example:: NumType.Scientific Note that:: NumType.DEFAULT == NumType.Integer For more methods see :py:class:`~pyslet.xml.xsdatatypes.Enumeration`
62598f5456b00c62f0fb1d40
class DisplayObject(object): <NEW_LINE> <INDENT> _read_flags = 'r' <NEW_LINE> def __init__(self, data=None, url=None, filename=None): <NEW_LINE> <INDENT> if data is not None and isinstance(data, string_types): <NEW_LINE> <INDENT> if data.startswith('http') and url is None: <NEW_LINE> <INDENT> url = data <NEW_LINE> file...
An object that wraps data to be displayed.
62598f540a366e3fb87dbe57
class CheckVatNumberTestCase(TestCase): <NEW_LINE> <INDENT> def assert_result_equals(self, expected, actual): <NEW_LINE> <INDENT> self.assertIsInstance(actual, VatNumberCheckResult) <NEW_LINE> self.assertEqual(expected.is_valid, actual.is_valid) <NEW_LINE> self.assertEqual(expected.business_name, actual.business_name) ...
Test case for :func:`check_vat_number`.
62598f54925a0f43d25e74bd
class CliPrompter(BasePrompter): <NEW_LINE> <INDENT> def pass_input(self, prompt): <NEW_LINE> <INDENT> return getpass(prompt=prompt) <NEW_LINE> <DEDENT> def prompt_info(self, name, desc="", type_f=None): <NEW_LINE> <INDENT> info = None <NEW_LINE> prompt_str = name + ": " <NEW_LINE> while info is None: <NEW_LINE> <INDEN...
Grab info from the user using stdin.
62598f54bf627c535bcb0907
class ScreenWidgetError(RuntimeError): <NEW_LINE> <INDENT> pass
Base exception for errors of the screenwidget module.
62598f54796e427e5384dc1f
class SnapdItem(ProviderItem): <NEW_LINE> <INDENT> __gtype_name__ = "NxSnapdItem" <NEW_LINE> snap = None <NEW_LINE> enhanced_source = None <NEW_LINE> def __init__(self, snap): <NEW_LINE> <INDENT> ProviderItem.__init__(self) <NEW_LINE> self.snap = snap <NEW_LINE> <DEDENT> def get_id(self): <NEW_LINE> <INDENT> return "sn...
A SnapdItem is a reference to either a remote or local snapd.Snap
62598f54d18da76e235b6b7d
class AuthenticationError(Exception): <NEW_LINE> <INDENT> def __init__(self, message: str): <NEW_LINE> <INDENT> self.message = message
This exception is raised on authentication failure.
62598f540a366e3fb87dbe5b
class Firewall(_messages.Message): <NEW_LINE> <INDENT> class AllowedValueListEntry(_messages.Message): <NEW_LINE> <INDENT> IPProtocol = _messages.StringField(1) <NEW_LINE> ports = _messages.StringField(2, repeated=True) <NEW_LINE> <DEDENT> allowed = _messages.MessageField('AllowedValueListEntry', 1, repeated=True) <NEW...
A Firewall resource. Messages: AllowedValueListEntry: A AllowedValueListEntry object. Fields: allowed: The list of rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. creationTimestamp: [Output Only] Creation timestamp in RFC3339text f...
62598f54ff9c53063f519adc
class Alarme: <NEW_LINE> <INDENT> ON = 1 <NEW_LINE> OFF = 0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.etat = Alarme.OFF <NEW_LINE> self.heure = Heure() <NEW_LINE> self.son = { "etat" : Alarme.ON, "musique" : "", "volume" : 0 } <NEW_LINE> self.aube = { "etat" : Alarme.OFF, "duree" : 100, "intensite" : 50 }...
Structure de donnees permettant de representer une alarme : *heure de l'alarme *etat : ON/OFF *son : etat, choix de la musique et du volume *aube : etat, duree, intensite
62598f54bf627c535bcb090b
class ExpenseCategorySerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.ExpenseCategory <NEW_LINE> fields = '__all__'
Define the serializer for the item model.
62598f5421a7993f00c65406
class AnalyticListResponse(object): <NEW_LINE> <INDENT> def __init__(self, data=None, pagination=None): <NEW_LINE> <INDENT> self.swagger_types = { 'data': 'list[Analytic]', 'pagination': 'Pagination' } <NEW_LINE> self.attribute_map = { 'data': 'data', 'pagination': 'pagination' } <NEW_LINE> self._data = data <NEW_LINE>...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f5421a7993f00c65408
class Beast(): <NEW_LINE> <INDENT> def __init__(self, settings): <NEW_LINE> <INDENT> start = randint(0,3) <NEW_LINE> self.x = start_border_x(settings, start) <NEW_LINE> self.y = start_border_y(settings, start) <NEW_LINE> self.v = settings['v_max'] <NEW_LINE> self.v_max = settings['v_max'] <NEW_LINE> self.eats = 0 <NEW_...
Beasts that seek food
62598f54a8ecb03325870696
class LatestArticle(CMSPlugin): <NEW_LINE> <INDENT> category = models.ManyToManyField(CMSCategory, verbose_name=_('category'), blank=True) <NEW_LINE> author = models.ManyToManyField(User, verbose_name=_('authors'), blank=True) <NEW_LINE> article_num = models.IntegerField(_(u'number of articles'), default=5) <NEW_LINE> ...
This model will save latest articles' id for plugin
62598f5421a7993f00c6540a
class EventView(View): <NEW_LINE> <INDENT> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> event_id = kwargs['event_id'] <NEW_LINE> event = Event.objects.get(id=event_id) <NEW_LINE> if request.is_ajax() and request.method == "GET": <NEW_LINE> <INDENT> return render(request, 'calendar/modal_popup.html'...
A generic event view for both modal and regular calendar. Modify to fit your needs.
62598f545e10d32532ce3331
class FCtrlError(FHDRError): <NEW_LINE> <INDENT> pass
Wrong Frame Control (FCtrl) in the frame header.
62598f54167d2b6e312b6415
class IPNListenerView(View): <NEW_LINE> <INDENT> @csrf_exempt <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> transaction_id = request.POST.get('txn_id') <NEW_LINE> try: <NEW_LINE> <INDENT> self.payment_transaction = PaymentTransaction.objects.get( transaction_id=transaction_id) <NEW_LINE> ...
This view handles an IPN from PayPal.
62598f54eab8aa0e5d30b20d
class ArcCreateView(PermissionRequiredMixin, generics.CreateAPIView): <NEW_LINE> <INDENT> serializer_class = ArcCreateSerializer <NEW_LINE> object_permission_required = 'fiction_outlines.edit_outline' <NEW_LINE> permission_required = 'fiction_outlines_api.valid_user' <NEW_LINE> def dispatch(self, request, *args, **kwar...
API for creating arcs. Uses a custom serializer, as Arcs are generated via special methods inside a transaction. Provides HTTP method: - POST: Accepts data compatible with :class:`fiction_outlines_api.serializers.ArcCreateSerializer`
62598f5415fb5d323ce7e1c0
class UtteranceEmbedder(CachedEmbedder): <NEW_LINE> <INDENT> def __init__(self, token_embedder, lstm_dim): <NEW_LINE> <INDENT> super(UtteranceEmbedder, self).__init__() <NEW_LINE> self._token_embedder = token_embedder <NEW_LINE> self._bilstm = BidirectionalSourceEncoder( token_embedder.embed_dim, lstm_dim, LSTMCell) <N...
Takes a string, embeds the tokens using the token_embedder, and passes the embeddings through a biLSTM padded / masked up to sequence_length. Returns the concatenation of the two front and end hidden states. Args: token_embedder (TokenEmbedder): used to embed each token lstm_dim (int): output dim of the lstm
62598f5421a7993f00c6540d
class AffineHull(Approach): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.fallback_approach = NearestNeighbor() <NEW_LINE> <DEDENT> def guess(self, data, candidate): <NEW_LINE> <INDENT> approach_base = AffineBase() <NEW_LINE> sample_indices = [] <NEW_LINE> i = 0 <NEW_LIN...
In a 2D x-y-Diagram: Connects closest x values and draws a line between the y values. The y value at the required x is returned. Mathematically more correct: Find the closest coordinates, which produce an affine hull for the given coordinates and return the value above the given coordinates which lies in the plane of ...
62598f54462c4b4f79dbae98
class NuSVC (SparseBaseLibSVM, ClassifierMixin): <NEW_LINE> <INDENT> def __init__(self, nu=0.5, kernel='rbf', degree=3, gamma=0.0, coef0=0.0, shrinking=True, probability=False, tol=1e-3): <NEW_LINE> <INDENT> SparseBaseLibSVM.__init__(self, 'nu_svc', kernel, degree, gamma, coef0, tol, 0., nu, 0., shrinking, probability)
NuSVC for sparse matrices (csr). See :class:`sklearn.svm.NuSVC` for a complete list of parameters Notes ----- For best results, this accepts a matrix in csr format (scipy.sparse.csr), but should be able to convert from any array-like object (including other sparse representations). Examples -------- >>> import numpy...
62598f54bf627c535bcb0915
class ArchivePrefixConflict(ArchiveTarException): <NEW_LINE> <INDENT> pass
Selected prefix conflicts with existing files
62598f54796e427e5384dc2d
class PropertyTypeStat(BaseStatistic): <NEW_LINE> <INDENT> STORED_KIND_NAME = '__Stat_PropertyType__' <NEW_LINE> property_type = model.StringProperty() <NEW_LINE> entity_bytes = model.IntegerProperty(default=0) <NEW_LINE> builtin_index_bytes = model.IntegerProperty(default=0) <NEW_LINE> builtin_index_count = model.Inte...
An aggregate of all properties across the entire application by type. There is an instance of the PropertyTypeStat for every property type (google.appengine.api.datastore_types._PROPERTY_TYPES) in use by the application in its datastore. Attributes: property_type: the property type associated with the statistic ins...
62598f545e10d32532ce3334
class SynonymDeleteMultipleTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> skip_on_database = ['gpdb'] <NEW_LINE> scenarios = [ ('Fetch synonym Node URL', dict(url='/browser/synonym/obj/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(SynonymDeleteMultipleTestCase, self).setUp() <NEW_LINE> self.db_name = pa...
This class will delete added synonym under schema node.
62598f545166f23b2e242878
class TabbedPanelStrip(GridLayout): <NEW_LINE> <INDENT> tabbed_panel = ObjectProperty(None)
A strip intended to be used as background for Heading/Tab. This does not cover the blank areas in case the tabs don't cover the entire width/height of the TabbedPanel(use StripLayout for that).
62598f546fece00bbaccae2c
class ThreadedHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def initialize(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ThreadedHandler, self).initialize() <NEW_LINE> self.executor = ThreadPoolExecutor(*args, **kwargs)
To make use of this class: 1. subclass your handler. Place the ThreadedHandler first in case of multiple inheritance (see http://stackoverflow.com/a/20450978/ for details): `class TimeConsumedHandler(ThreadedHandler)` 2. define methods handlers with decorator: `@tornado.gen.coroutine def get(self):` 3...
62598f54d164cc617582041c
class ReplaceValueDialog(QtGui.QDialog, dreplacevalue.Ui_Dialog): <NEW_LINE> <INDENT> update_data = QtCore.pyqtSignal(object) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.facade = face.Facade() <NEW_LINE> self.facade.input_registe...
User Logic to deal with split a column from one into two based on user supplied separator (currently regex does not work)
62598f54bf627c535bcb0919
class GuestSuspendNegativeTest(GuestSuspendBaseTest): <NEW_LINE> <INDENT> def do_guest_suspend(self, **args): <NEW_LINE> <INDENT> s, o = self._check_guest_suspend_log(**args) <NEW_LINE> if not s: <NEW_LINE> <INDENT> self.test.fail("Guest reports support Suspend even if it's" " disabled in qemu. Output:\n '%s'" % o)
This class is used to test the situation which sets 'disable_s3/s4' to '1' in qemu cli. Guest should disable suspend function in this case.
62598f54462c4b4f79dbae9f
class ThreadClientReceive(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, conn): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.connexion = conn <NEW_LINE> self.verrou=threading.Lock() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> nom = self.getName() <NEW_LINE> while True: <NEW_...
dérivation d'un objet thread pour gérer la connexion avec un client
62598f54ff9c53063f519aec
class ContactPerson(models.Model): <NEW_LINE> <INDENT> name = models.CharField(u"Namn t.ex. 'Karl Karlsson'", max_length=255) <NEW_LINE> email = models.EmailField(u"E-post") <NEW_LINE> phone = models.CharField(u"Telefon", max_length=255, blank=True) <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE...
Person i en organisation som agerar kontakt för en eller flera tjänster.
62598f54eab8aa0e5d30b217
class ReadSeisWave(object): <NEW_LINE> <INDENT> def __init__(self,fileadress): <NEW_LINE> <INDENT> self.fileadress = fileadress <NEW_LINE> self.filename = fileadress.split('/') <NEW_LINE> print('Will read the file: %s' % self.filename) <NEW_LINE> <DEDENT> def getHead(self): <NEW_LINE> <INDENT> f = open(self.fileadress,...
读取地震波形数据文件
62598f546fece00bbaccae30
class OSFBasicAuthentication(BasicAuthentication): <NEW_LINE> <INDENT> def authenticate(self, request): <NEW_LINE> <INDENT> user_auth_tuple = super(OSFBasicAuthentication, self).authenticate(request) <NEW_LINE> if user_auth_tuple is not None: <NEW_LINE> <INDENT> self.authenticate_twofactor_credentials(user_auth_tuple[0...
Custom DRF authentication class for API call with email, password, and two-factor if necessary.
62598f540a366e3fb87dbe6d
class ResourceInstance(object): <NEW_LINE> <INDENT> def __init__(self, client, instance): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> kind = instance['kind'] <NEW_LINE> if kind.endswith('List') and 'items' in instance: <NEW_LINE> <INDENT> kind = instance['kind'][:-4] <NEW_LINE> for item in instance['items']: <N...
A parsed instance of an API resource. It exists solely to ease interaction with API objects by allowing attributes to be accessed with '.' notation.
62598f54925a0f43d25e74d3
class invalid_image(block_error): <NEW_LINE> <INDENT> pass
Image cannot be processed for some reason.
62598f54796e427e5384dc33
class N1kvNetworkBinding(model_base.BASEV2): <NEW_LINE> <INDENT> __tablename__ = 'cisco_ml2_n1kv_network_bindings' <NEW_LINE> network_id = sa.Column(sa.String(36), sa.ForeignKey('networks.id', ondelete="CASCADE"), primary_key=True) <NEW_LINE> network_type = sa.Column(sa.String(32), nullable=False) <NEW_LINE> segmentati...
Represents binding of virtual network to network profiles.
62598f54711fe17d825dfb98
class EventSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> scheduler = EventGamerSerializer(many=False) <NEW_LINE> game = GameSerializer(many=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Event <NEW_LINE> fields = ('id', 'game', 'event_time', 'location', 'scheduler', 'joined')
JSON serializer for events
62598f54ff9c53063f519aee
class AudioSource(object): <NEW_LINE> <INDENT> def __init__(self, source, streaming=False, position=(0, 0)): <NEW_LINE> <INDENT> super(AudioSource, self).__init__() <NEW_LINE> self._instances = [] <NEW_LINE> self._streaming = streaming <NEW_LINE> self._source = source <NEW_LINE> self._attenuation_distance = 1 <NEW_LINE...
Configures playback parameters for an audio source. Playing an :obj:`audio.AudioSource` creates a new :obj:`audio.AudioPlayer` from its playback parameters, and provides control for all existing player instances. Attributes: streaming (bool, read only): True if the audio source is streaming from disk, Fal...
62598f5421a7993f00c65417
class TestHumanParser(unittest.TestCase): <NEW_LINE> <INDENT> def test_make_string_as_dict(self): <NEW_LINE> <INDENT> actual_result = HumanParser(test_data.SUB_DF_H_OUTPUT) .make_string_as_dict() <NEW_LINE> self.assertIsNotNone(actual_result) <NEW_LINE> self.assertIsInstance(actual_result, dict) <NEW_LINE> s...
unittests for class HumanParser
62598f54eab8aa0e5d30b219
class Clients(object): <NEW_LINE> <INDENT> def __init__(self, credential, api_info=None): <NEW_LINE> <INDENT> self.credential = credential <NEW_LINE> self.api_info = api_info or {} <NEW_LINE> self.cache = {} <NEW_LINE> <DEDENT> def __getattr__(self, client_name): <NEW_LINE> <INDENT> return OSClient.get(client_name)(sel...
This class simplify and unify work with OpenStack python clients.
62598f5421a7993f00c65419
class EmailBackend(base.BaseEmailBackend): <NEW_LINE> <INDENT> def send_messages(self, emails): <NEW_LINE> <INDENT> if len(emails) == 0: <NEW_LINE> <INDENT> future = Future() <NEW_LINE> future.set_result(0) <NEW_LINE> return future <NEW_LINE> <DEDENT> @_close_connection_on_finish <NEW_LINE> def _send(messages): <NEW_LI...
Asynchronous email back-end that uses a thread pool for sending emails.
62598f54796e427e5384dc37
class ListOrganization(MyBaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.write('get') <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> self.write('post')
创建Organization
62598f5456b00c62f0fb1d5b
class Publisher(object): <NEW_LINE> <INDENT> END_STREAM = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.subscribers_by_channel = defaultdict(list) <NEW_LINE> <DEDENT> def _get_subscribers_lists(self, channel): <NEW_LINE> <INDENT> if isinstance(channel, str): <NEW_LINE> <INDENT> yield self.subscribers_by_ch...
Contains a list of subscribers that can can receive updates. Each subscriber can have its own private data and may subscribe to different channel.
62598f5476d4e153a661c0b3
class ObisDownload(object): <NEW_LINE> <INDENT> def __init__(self, uuid): <NEW_LINE> <INDENT> super(ObisDownload, self).__init__() <NEW_LINE> self.uuid = uuid <NEW_LINE> self.file_path = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<OBIS Occurrence Download>\n uuid: ' + self.uuid <NEW_LINE>...
ObisDownload class methods: - uuid: get uuid for the download - status: get download status - fetch: retrieve the download
62598f54167d2b6e312b6425
class NotWorkerMod(Exception): <NEW_LINE> <INDENT> pass
Class to tell that we are facing a non worker module but a standard one
62598f54bf627c535bcb0921
class ProjectForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Project <NEW_LINE> exclude = ('title_slug', 'person') <NEW_LINE> <DEDENT> class Media: <NEW_LINE> <INDENT> css = { 'all': ('common/css/ui-lightness/jquery-ui-timepicker-addon.css', 'common/css/ui-lightness/jquery-ui-1.9.0.cu...
Project model form
62598f545166f23b2e242882
class ModulationAmount(Parameter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ModulationAmount, self).__init__(-63, 63, 0)
A parameter representing a modulation amount.
62598f5421a7993f00c6541d
class ElasticNetRegularization: <NEW_LINE> <INDENT> def __init__(self, alpha, l1_ratio=0.5): <NEW_LINE> <INDENT> assert l1_ratio <= 1.0 <NEW_LINE> assert alpha != 0 <NEW_LINE> self.alpha = alpha <NEW_LINE> self.l1_reg = LassoRegularization(l1_ratio) <NEW_LINE> self.l2_reg = RidgeRegularization(1 - l1_ratio) <NEW_LINE> ...
L1 and L2 Regularization
62598f55d18da76e235b6b8a
@dataclass <NEW_LINE> class ExternalVariable(VariableType): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> name = "external_variable" <NEW_LINE> namespace = OVAL_DEFINITIONS_5_NAMESPACE <NEW_LINE> <DEDENT> possible_value: List[PossibleValueType] = field( default_factory=list, metadata={ "type": "Element", } ) <NEW...
The external_variable element extends the VariableType and defines a variable with some external source. The actual value(s) for the variable is not provided within the OVAL file, but rather it is retrieved during the evaluation of the OVAL Definition from an external source. An unbounded set of possible- value and po...
62598f55507cdc57c63a4246
class IntervalsDelegate(CustomDelegate): <NEW_LINE> <INDENT> __metaclass__ = DocumentationMetaclass <NEW_LINE> def paint(self, painter, option, index): <NEW_LINE> <INDENT> painter.save() <NEW_LINE> self.drawBackground(painter, option, index) <NEW_LINE> intervals_container = variant_to_pyobject(index.model().data(index,...
Custom delegate for visualizing camelot.container.IntervalsContainer data:
62598f555e10d32532ce333b
class TestCommitMixinHooks: <NEW_LINE> <INDENT> class Data(Base, commit_mixin.CommitMixin): <NEW_LINE> <INDENT> __tablename__ = "data" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.before_commit_counter = 0 <NEW_LINE> self.after_commit_counter...
verify correct behavior with the hooks we have selected
62598f55167d2b6e312b6429
class TestJsonBrowserSearchRequest(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 testJsonBrowserSearchRequest(self): <NEW_LINE> <INDENT> pass
JsonBrowserSearchRequest unit test stubs
62598f55a8ecb033258706ac
class Raise(Test): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> source = self.params.get('source', default='raise.c') <NEW_LINE> c_file = self.get_data(source) <NEW_LINE> if c_file is None: <NEW_LINE> <INDENT> self.cancel('Test is missing data file %s' % source) <NEW_LINE> <DEDENT> c_file_name = os.path.bas...
A test that calls raise() to signals to itself. :param source: name of the source file located in data path :param signal_number: Which signal number should be raised
62598f5556b00c62f0fb1d60
class Queue(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pipe = os.pipe() <NEW_LINE> fcntl.fcntl(self.pipe[0], fcntl.F_SETFL, os.O_NONBLOCK) <NEW_LINE> self.buf = [] <NEW_LINE> self._ibuf = [] <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> os.close(self.pipe[0]) <NEW_LINE> os.cl...
An inter-process queue that uses the same interface as the Python Queue.Queue class. Internally, the queue uses a pipe for processes to communicate. Queue elements are separated by new lines. Reading from the pipe is done in a non-blocking way. To use this Queue class, create a Queue object before fork. Then, both pr...
62598f5515fb5d323ce7e1d6
class TestLiquidationApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = bitmex_client.apis.liquidation_api.LiquidationApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_liquidation_get(self): <NEW_LINE> <INDENT> pass
LiquidationApi unit test stubs
62598f55711fe17d825dfba4
class Commutativity(object): <NEW_LINE> <INDENT> def __init__(self, cost = 1): <NEW_LINE> <INDENT> self.name = "Commutative Laws" <NEW_LINE> self.cost = cost <NEW_LINE> <DEDENT> def getSuccessors(self, statement, i, goalCoHash = None): <NEW_LINE> <INDENT> if statement.type(i) == "conjunction" or statement.type(i) == "d...
a & b == b & a
62598f550a366e3fb87dbe7b
class Source: <NEW_LINE> <INDENT> def __init__(self, stream=None): <NEW_LINE> <INDENT> if stream is None: <NEW_LINE> <INDENT> stream = Stream() <NEW_LINE> <DEDENT> self.stream = stream <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <INDENT> raise NotImplementedError
A Source implements an .update() method which scrapes articles from a single source and pushes them to a Stream.
62598f5556b00c62f0fb1d64
class MLIDPassportOCRResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ID = None <NEW_LINE> self.Name = None <NEW_LINE> self.DateOfBirth = None <NEW_LINE> self.Sex = None <NEW_LINE> self.DateOfExpiration = None <NEW_LINE> self.IssuingCountry = None <NEW_LINE> self.Nationality = N...
MLIDPassportOCR返回参数结构体
62598f5576d4e153a661c0bd
class EventReactor: <NEW_LINE> <INDENT> TIMER_INTERVAL = 0.1 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self._thread = Thread(target=self._run) <NEW_LINE> self._queue = Queue() <NEW_LINE> self._observers = [] <NEW_LINE> self._last_timer_event = 0 <NEW_LINE> <DEDENT> def get_queue(self): <NEW_LINE> <INDENT> retu...
Notify registered observers for events posted to the queue.
62598f556fece00bbaccae42
class LinksModel(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'links' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> hash_id = db.Column(db.Integer) <NEW_LINE> url = db.Column(db.String(200)) <NEW_LINE> hash = db.Column(db.String(10)) <NEW_LINE> hits = db.Column(db.Integer) <NEW_LINE> def __init__...
LinksModel: SQLAlchemy Model for links table CREATE TABLE links ( id INTEGER NOT NULL, url VARCHAR(200), hash_id INTEGER NOT NULL, hash VARCHAR(10), hits INTEGER, PRIMARY KEY (id) )
62598f55d164cc6175820432
class DenoisingDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, xs, sigma): <NEW_LINE> <INDENT> super(DenoisingDataset, self).__init__() <NEW_LINE> self.xs = xs <NEW_LINE> self.sigma = sigma <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> batch_x = self.xs[index] <NEW_LINE> batch_y = torch...
Dataset wrapping tensors. Arguments: xs (Tensor): clean image patches sigma: noise level, e.g., 25
62598f5521a7993f00c6542b
class EmptyFacility(object): <NEW_LINE> <INDENT> pass
EmptyFacility used in initial component creation of a component declared as a facility so that its type at least indicates what is intended until the actual component is created
62598f55711fe17d825dfbac
class SpacelessExtension(Extension): <NEW_LINE> <INDENT> tags = ['spaceless'] <NEW_LINE> def parse(self, parser): <NEW_LINE> <INDENT> lineno = parser.stream.next().lineno <NEW_LINE> body = parser.parse_statements(['name:endspaceless'], drop_needle=True) <NEW_LINE> return nodes.CallBlock( self.call_method('_strip_spaces...
Removes whitespace between HTML tags, including tab and newline characters. Works exactly like Django's own tag.
62598f55eab8aa0e5d30b22d
class Login(GenericAPIView): <NEW_LINE> <INDENT> permission_classes = (AllowAny,) <NEW_LINE> serializer_class = LoginSerializer <NEW_LINE> token_model = Token <NEW_LINE> response_serializer = TokenSerializer <NEW_LINE> def login(self): <NEW_LINE> <INDENT> self.user = self.serializer.validated_data['user'] <NEW_LINE> se...
Check the credentials and return the REST Token if the credentials are valid and authenticated. Calls Django Auth login method to register User ID in Django session framework Accept the following POST parameters: username, password Return the REST Framework Token Object's key.
62598f55796e427e5384dc49
class PriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.heap = [None] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.heap) - 1 <NEW_LINE> <DEDENT> def append(self, key): <NEW_LINE> <INDENT> if key is None: <NEW_LINE> <INDENT> raise ValueError('Cannot insert None...
Heap-based priority queue implementation.
62598f55d164cc6175820435
class Anchors(keras.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, size, stride, ratios=None, scales=None, *args, **kwargs): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.stride = stride <NEW_LINE> self.ratios = ratios <NEW_LINE> self.scales = scales <NEW_LINE> if ratios is None: <NEW_LINE> <INDENT> sel...
Keras layer for generating achors for a given shape.
62598f55167d2b6e312b6437
class RoleAnalyzerSpec(NamedTuple): <NEW_LINE> <INDENT> files: List[BufferedFile] <NEW_LINE> expected: RoleAnalysis
Spec data for a RoleAnalyzer test.
62598f55d18da76e235b6b92
class ArchivableProject(Project): <NEW_LINE> <INDENT> def __init__(self, suite, name, deps, workingSets, theLicense, **kwArgs): <NEW_LINE> <INDENT> d = suite.dir <NEW_LINE> Project.__init__(self, suite, name, "", [], deps, workingSets, d, theLicense, **kwArgs) <NEW_LINE> <DEDENT> def getBuildTask(self, args): <NEW_LINE...
A project that can be part of any distribution, native or not. Users should subclass this class and implement the nyi() methods. The files listed by getResults(), which must be under output_dir(), will be included in the archive under the prefix archive_prefix().
62598f55925a0f43d25e74ea
class TeamStats(models.Model): <NEW_LINE> <INDENT> team = models.ForeignKey(Team, on_delete=models.CASCADE) <NEW_LINE> tournament = models.ForeignKey(Tournament, on_delete=models.CASCADE) <NEW_LINE> zone = models.CharField(default='', max_length=64, blank=True) <NEW_LINE> won = models.PositiveIntegerField(default=0) <N...
Stats for a team in a given tournament.
62598f5556b00c62f0fb1d6e
class GetTokenResponseDto(object): <NEW_LINE> <INDENT> swagger_types = { 'access_token': 'str', 'token_type': 'str', 'expires_in': 'str' } <NEW_LINE> attribute_map = { 'access_token': 'Access_token', 'token_type': 'Token_type', 'expires_in': 'Expires_in' } <NEW_LINE> def __init__(self, access_token=None, token_type=Non...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f55bf627c535bcb0936
class AutoRestSwaggerBATHeaderService(object): <NEW_LINE> <INDENT> def __init__( self, base_url=None): <NEW_LINE> <INDENT> self.config = AutoRestSwaggerBATHeaderServiceConfiguration(base_url) <NEW_LINE> self._client = ServiceClient(None, self.config) <NEW_LINE> client_models = {k: v for k, v in models.__dict__.items() ...
Test Infrastructure for AutoRest :ivar config: Configuration for client. :vartype config: AutoRestSwaggerBATHeaderServiceConfiguration :ivar header: Header operations :vartype header: .operations.HeaderOperations :param str base_url: Service URL
62598f555166f23b2e242896
class SettingsDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(SettingsDialog, self).__init__(parent) <NEW_LINE> load_ui_widget(os.path.join(os.path.dirname(__file__), 'settings.ui'), self) <NEW_LINE> try: <NEW_LINE> <INDENT> self.port.addItems(populate_serial_ports()) <NE...
Settings dialog.
62598f55925a0f43d25e74ec
class PermissionCheckboxTableSelectMultiple(CheckboxSelectMultiple): <NEW_LINE> <INDENT> def render(self, name, value, attrs=None, choices=()): <NEW_LINE> <INDENT> if value is None: value = [] <NEW_LINE> has_id = attrs and 'id' in attrs <NEW_LINE> final_attrs = self.build_attrs(attrs, name=name) <NEW_LINE> output = [u'...
A C{CheckboxSelectMultiple} widget that renders as a table instead of list
62598f55d18da76e235b6b94
class Polygon_MakerDialogTest(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 test_icon_png(self): <NEW_LINE> <INDENT> path = ':/plugins/Polygon_Maker/icon.png' <NEW_LINE> icon = QIcon(path) <NEW_L...
Test rerources work.
62598f55711fe17d825dfbb4
class testFileStorage(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.storage = FileStorage() <NEW_LINE> self.my_model = BaseModel() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.remove("file.json") <NEW_LINE> <DEDENT> except FileNotFoundError:...
Testing the FileStorage class
62598f55796e427e5384dc51
class LegitHarvestCommand(LegitWindowCmd, WindowCommand): <NEW_LINE> <INDENT> def run(self, select_branch=False): <NEW_LINE> <INDENT> repo = self.get_repo() <NEW_LINE> if not repo: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if select_branch: <NEW_LINE> <INDENT> self.show_branches_panel(repo, partial(self.harvest, r...
Documentation coming soon.
62598f55711fe17d825dfbb6
class LogicAND(Neuron): <NEW_LINE> <INDENT> def core(self, inps, settings): <NEW_LINE> <INDENT> results = {} <NEW_LINE> for into in inps: <NEW_LINE> <INDENT> for i in into: <NEW_LINE> <INDENT> if i in results: <NEW_LINE> <INDENT> if settings["Method"] == "MUL": <NEW_LINE> <INDENT> results[i] *= into[i] <NEW_LINE> <DEDE...
returns the values multiplied together
62598f55d18da76e235b6b97
class ShouldSkip(DjangoRequestView): <NEW_LINE> <INDENT> URI = "tests/should_skip" <NEW_LINE> DEFAULT_MODEL = TestControlOperationParamsModel <NEW_LINE> DEFAULT_RESPONSES = { http_client.OK: ShouldSkipResponse, http_client.BAD_REQUEST: FailureResponseModel } <NEW_LINE> TAGS = { "get": ["Tests"] } <NEW_LINE> @session_mi...
Check if the test passed in the last run according to results DB. Args: test_id (number): the identifier of the test. token (str): token of the session.
62598f555166f23b2e24289e
class VersionCommand(Command): <NEW_LINE> <INDENT> command_spec = { COMMAND_NAME : 'version', COMMAND_NAME_ALIASES : ['ver'], MIN_ARGS : 0, MAX_ARGS : 0, SUPPORTED_SUB_ARGS : 'l', FILE_URIS_OK : False, PROVIDER_URIS_OK : False, URIS_START_ARG : 0, } <NEW_LINE> help_spec = { HELP_NAME : 'version', HELP_NAME_ALIASES : ['...
Implementation of gsutil version command.
62598f55796e427e5384dc55
class InventorySerializer(BaseModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Inventory
Inventory Model serializer
62598f5515fb5d323ce7e1ee
class ArmAddonInstallGitButton(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "arm_addon.install_git" <NEW_LINE> bl_label = "Install Git" <NEW_LINE> bl_description = "Git is required for Armory Updater to work" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> webbrowser.open('https://git-scm.com') <NEW_...
Install Git
62598f555166f23b2e2428a0
class PreTokenizedTaggingInstance(TaggingInstance): <NEW_LINE> <INDENT> def __init__(self, text: List[str], label: List[str], index: int=None): <NEW_LINE> <INDENT> super(PreTokenizedTaggingInstance, self).__init__(text, label, index) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> @overrides <NEW_LINE> def read_from_line(c...
This is a ``TaggingInstance`` where the text has been pre-tokenized. Thus the ``text`` member variable here is actually a ``List[str]``, instead of a ``str``. When using this ``Instance``, you `must` use the ``NoOpWordSplitter`` as well, or things will break. You probably also do not want any kind of filtering (thou...
62598f55711fe17d825dfbbc
class Index(tuple): <NEW_LINE> <INDENT> def __new__(cls,pid,iid): <NEW_LINE> <INDENT> self=super(Index,cls).__new__(cls,pid+iid) <NEW_LINE> self.names=pid._fields+iid._fields <NEW_LINE> self.icls=iid.__class__ <NEW_LINE> return self <NEW_LINE> <DEDENT> def __getnewargs__(self): <NEW_LINE> <INDENT> return self.pid,self....
This class provides an index for a microscopic degree of freedom, including the spatial part and internal part. Attributes ---------- names : tuple of string The names of the microscopic degrees of freedom. icls : Class The class of the internal part of the index.
62598f5515fb5d323ce7e1f0
class LogActivityResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None)
A ResultSet with methods tailored to the values returned by the LogActivity Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62598f55bf627c535bcb0942
class JsgfLexer(RegexLexer): <NEW_LINE> <INDENT> name = 'JSGF' <NEW_LINE> aliases = ['jsgf'] <NEW_LINE> filenames = ['*.jsgf'] <NEW_LINE> mimetypes = ['application/jsgf', 'application/x-jsgf', 'text/jsgf'] <NEW_LINE> flags = re.MULTILINE | re.UNICODE <NEW_LINE> tokens = { 'root': [ include('comments'), include('non-com...
For `JSpeech Grammar Format <https://www.w3.org/TR/jsgf/>`_ grammars. .. versionadded:: 2.2
62598f55a8ecb033258706c8
class AddForm(forms.Form): <NEW_LINE> <INDENT> entry_date = forms.DateField(label="Entry Date:") <NEW_LINE> entry_date.widget.attrs.update({'class': 'change-el', 'id': 'add_entrydate', 'readonly': 'readonly'}) <NEW_LINE> start_time = forms.TimeField(label="Start Time:") <NEW_LINE> start_time.widget.attrs.update({'class...
Add entry form This Class creates a form which allows users to add an entry into the timetracking portion of the app. See :class:`ChangeEntry` for a detailed description of these two classes as they have a high coupling factor.
62598f555166f23b2e2428a4
class SRPIterator(VmaxObjectIterator): <NEW_LINE> <INDENT> def __init__(self, vmax: RestFunctions): <NEW_LINE> <INDENT> super().__init__(vmax.get_srp, 'srpId', 'srp')
SRP iterator
62598f55925a0f43d25e74fa
class HttpServer(object): <NEW_LINE> <INDENT> def __init__(self, debug_mode=False, access_logging=None, static_path='./static', adapters=None): <NEW_LINE> <INDENT> settings = { "debug": debug_mode, "log_function": self.log_request, } <NEW_LINE> if access_logging is not None: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT>...
HTTP server class.
62598f5521a7993f00c6543f
class ResponseListener(listener.ConnectionListener): <NEW_LINE> <INDENT> def __init__(self, config, connector, count, timeout=30, condition=None, logger=LOG): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> self.config = config <NEW_LINE> self.connector = connector <NEW_LINE> self._security = None <NEW_LINE> self.t...
Listener that waits for a message response. :arg config: :py:class:`pymco.config.Config` instance. :arg count: number of expected messages. :arg timeout: seconds we should wait for messages. :arg condition: by default a :py:class:`threading.Condition` object for synchronization purposes, but you can use any object...
62598f5676d4e153a661c0d7
class Instructor: <NEW_LINE> <INDENT> __slots__ = ["icwid", "name", "dept", "instruc_dd"] <NEW_LINE> def __init__(self, icwid, name, dept): <NEW_LINE> <INDENT> self.icwid = icwid <NEW_LINE> self.name = name <NEW_LINE> self.dept = dept <NEW_LINE> self.instruc_dd = defaultdict(int) <NEW_LINE> <DEDENT> def add_stud_count(...
This class creates an instance of instructor including the attributes: CWID, name, dept, courses taught, and number of students in that class
62598f56bf627c535bcb0946
class getVersionInfo_args(object): <NEW_LINE> <INDENT> def __init__(self, versionInfo=None,): <NEW_LINE> <INDENT> self.versionInfo = versionInfo <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spe...
Attributes: - versionInfo
62598f56ff9c53063f519b18
class APILimitOffsetPagination(LimitOffsetPagination): <NEW_LINE> <INDENT> default_limit = 5 <NEW_LINE> max_limit = 50
Pagination class
62598f5656b00c62f0fb1d80
class Relation(models.Model): <NEW_LINE> <INDENT> RELATION_TYPE_BLOCK ='b' <NEW_LINE> RELATION_TYPE_FOLLOW='f' <NEW_LINE> CHOICES_RELATION_TYPE = ( (RELATION_TYPE_FOLLOW, 'Follow'), (RELATION_TYPE_BLOCK, 'Block'), ) <NEW_LINE> from_user = models.ForeignKey( User, on_delete=models.CASCADE, related_name='relations_by_fro...
User 간의 MTM 연결 중개테이블
62598f5621a7993f00c65441