code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PaypalProcessorConfiguration(SingletonModel): <NEW_LINE> <INDENT> retry_attempts = models.PositiveSmallIntegerField( default=0, verbose_name=_( 'Number of times to retry failing Paypal client actions (e.g., payment creation, payment execution)' ) ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = "Paypal... | This is a configuration model for PayPal Payment Processor | 62598f8dac7a0e7691f720cd |
class ShowContainer(show.ShowOne): <NEW_LINE> <INDENT> log = logging.getLogger(__name__ + '.ShowContainer') <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ShowContainer, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'container', metavar='<container>', help='Container name t... | Show container information | 62598f8d6aa9bd52df0d4a90 |
class _Attachments: <NEW_LINE> <INDENT> def __init__(self, client=None): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> <DEDENT> def find_by_id(self, attachment, params={}, **options): <NEW_LINE> <INDENT> path = "/attachments/%s" % (attachment) <NEW_LINE> return self.client.get(path, params, **options) <NEW_LINE> ... | An _attachment_ object represents any file attached to a task in Asana,
whether it's an uploaded file or one associated via a third-party service
such as Dropbox or Google Drive. | 62598f8d6e29344779b00218 |
class DummyFolder(Folder): <NEW_LINE> <INDENT> def getPhysicalPath(self): <NEW_LINE> <INDENT> return () | Stitch in an implementation for getPhysicalPath | 62598f8d498bea3a75a576e8 |
class Notification(BaseAnimation): <NEW_LINE> <INDENT> LOCK_PRIORITY = 3 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(Notification, self).__init__() <NEW_LINE> <DEDENT> def start(self, spec): <NEW_LINE> <INDENT> if not self.connect(): <NEW_LINE> <INDENT> logger.error('LED Ring: Notification: Could not aquir... | The OS notification animation for an LED ring board.
This is a wrapper over Pi Hat and LED Speaker. | 62598f8ddd821e528d6d8af8 |
class FilterModule: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def filters(): <NEW_LINE> <INDENT> return {"test_filter": a_test_filter} | Filter plugin. | 62598f8de76e3b2f99fd85f4 |
class YtccException(Exception): <NEW_LINE> <INDENT> pass | A general parent class of all Exceptions that are used in Ytcc. | 62598f8d442bda511e95c022 |
class HyperlinkManager(object): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> self.text = text <NEW_LINE> self.text.tag_config("hyper", foreground="blue", underline=1) <NEW_LINE> self.text.tag_bind("hyper", "<Enter>", self._enter) <NEW_LINE> self.text.tag_bind("hyper", "<Leave>", self._leave) <NEW_L... | A class to easily add clickable hyperlinks to Text areas.
Usage:
callback = lambda : webbrowser.open("http://www.google.com/")
text = tk.Text(...)
hyperman = tkHyperlinkManager.HyperlinkManager(text)
text.insert(tk.INSERT, "click me", hyperman.add(callback))
From http://effbot.org/zone/tkinter-text-hyperlink.... | 62598f8d38b623060ffa8c5a |
class OutputLogMinorMode(MinorMode, LoggingSTC): <NEW_LINE> <INDENT> keyword = "OutputLog" <NEW_LINE> caption = "Output Log" <NEW_LINE> default_classprefs = ( IntParam('best_width', 500), IntParam('best_height', 200), IntParam('min_width', 100), IntParam('min_height', 200), BoolParam('show', False), BoolParam('always_s... | An error log using message passing.
This log is designed to be associated with a major mode that
implements the JobOutputMixin. In the stdoutCallback and
stderrCallback of the JobOutputMixin, you should call showMessage
to display the output in the log. | 62598f8d4e696a045264dbe7 |
class Action1(Action): <NEW_LINE> <INDENT> def execute(self, instance): <NEW_LINE> <INDENT> pass | Stop | 62598f8df7d966606f747ba2 |
class BinaryClassifier(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_features, hidden_dim, output_dim, dropout): <NEW_LINE> <INDENT> super(BinaryClassifier, self).__init__() <NEW_LINE> self.fc1 = nn.Linear(input_features, hidden_dim) <NEW_LINE> self.fc2 = nn.Linear(hidden_dim, output_dim) <NEW_LINE> self.dro... | Define a neural network that performs binary classification.
The network should accept your number of features as input, and produce
a single sigmoid value, that can be rounded to a label: 0 or 1, as output.
Notes on training:
To train a binary classifier in PyTorch, use BCELoss.
BCELoss is binary cross entropy loss,... | 62598f8d50485f2cf55dab3a |
class beginUpdateBlob_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, aze=None, knf=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.aze = aze <NEW_LINE> self.knf = knf <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(... | Attributes:
- success
- aze
- knf | 62598f8dbaa26c4b54d4ee78 |
class ResultFailure(ResultError): <NEW_LINE> <INDENT> def __init__(self, message="", orig_exc_type="", orig_exc_msg=""): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.orig_exc_type = orig_exc_type <NEW_LINE> self.orig_exc_msg = orig_exc_msg | Raised when getting a result from an actor that failed.
| 62598f8d4428ac0f6e6580e9 |
class TextEdit(QWidget): <NEW_LINE> <INDENT> def __init__(self, name="", description="", defaultValue="", parent=None): <NEW_LINE> <INDENT> super(TextEdit, self).__init__(parent=parent) <NEW_LINE> self.__name = name <NEW_LINE> self.__description = description <NEW_LINE> self.__currentValue = defaultValue <NEW_LINE> sel... | Text Edit class.
Args:
name (str, optional): Text of the button. Defaults to "".
description (str, optional): Tooltip. Defaults to "".
defaultValue (str, optional): Default value ID. Defaults to "".
parent (QtWidgets, optional): Parent widget. Defaults to None. | 62598f8db5575c28eb712aac |
class TestGenericRelationship(unittest.TestCase): <NEW_LINE> <INDENT> def test_create_rel_with_name(self): <NEW_LINE> <INDENT> gr = GenericRelationship(from_table="tableA", to_table="tableB", name="REL_test", conditions="col1 = col2") <NEW_LINE> self.assertEqual("REL_test", gr.name) <NEW_LINE> <DEDENT> def test_create_... | Tests the GenericRelationship class. Most of the methods are inherited from ForeignKey,
so only differences are tested. | 62598f8d55399d3f056260df |
class PlatzigramLoginView(LoginView): <NEW_LINE> <INDENT> template_name = 'users/login.html' <NEW_LINE> redirect_authenticated_user = True | Class Based View that manages the login of the users. | 62598f8d96565a6dacd2cd5a |
class ResamplerError(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, msg, cause=None): <NEW_LINE> <INDENT> super(ResamplerError, self).__init__( "{}, caused by exception: {}".format(msg, cause) if cause is not None else msg ) <NEW_LINE> self._cause = cause | Error failed when a resampler has failed in an unrecoverable manner. | 62598f8da4f1c619b294e1ad |
class Dict(dict): <NEW_LINE> <INDENT> def __init__(self,**kw): <NEW_LINE> <INDENT> super(Dict,self).__init__(**kw) <NEW_LINE> <DEDENT> def __getattr__(self,key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[key] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise AttributeError(r"'Dict' object ha... | Simple dict but also support access x.y style
>>> d1 = Dict()
>>> d1['x']=100
>>> d1.x
100
>>> d1.y = 200
>>> d1['y']
200
>>> d2 = Dict(a=1,b=2,c='3')
>>> d2.c
'3'
>>> d2['empty']
Traceback (most recent call last):
...
KeyError:'empty'
>>> d2.empty
Traceback (most recent call last):
...
AttributeError:'Dict' ob... | 62598f8d10dbd63aa1c7077d |
class OSUtils(object): <NEW_LINE> <INDENT> def popen(self, command, stdout=None, stderr=None, env=None, cwd=None): <NEW_LINE> <INDENT> p = subprocess.Popen(command, stdout=stdout, stderr=stderr, env=env, cwd=cwd) <NEW_LINE> return p <NEW_LINE> <DEDENT> def is_windows(self): <NEW_LINE> <INDENT> return platform.system().... | Convenience wrapper around common system functions | 62598f8d16aa5153ce4000ca |
class RequerimentListView(ModelListProjectFilter): <NEW_LINE> <INDENT> model = RequerimentService.get_requeriment_model() <NEW_LINE> paginate_by = 20 <NEW_LINE> list_display = ('code','title', 'description','type') <NEW_LINE> action_template = 'requeriment/choose_action.html' <NEW_LINE> top_bar = 'requeriment/top_bar.h... | #class:US005
List of project's requeriments | 62598f8d3cc13d1c6d46532d |
class IngestionPolicyMapping(object): <NEW_LINE> <INDENT> swagger_types = { 'accounts': 'list[str]', 'groups': 'list[str]', 'ingestion_policy_id': 'str' } <NEW_LINE> attribute_map = { 'accounts': 'accounts', 'groups': 'groups', 'ingestion_policy_id': 'ingestionPolicyId' } <NEW_LINE> def __init__(self, accounts=None, gr... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f8d45492302aabfc09b |
class DataError(InterfaceError, ValueError): <NEW_LINE> <INDENT> pass | An error caused by invalid query input. | 62598f8d63d6d428bbee237f |
class MAVLink_mission_item_int_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_MISSION_ITEM_INT <NEW_LINE> name = 'MISSION_ITEM_INT' <NEW_LINE> fieldnames = ['target_system', 'target_component', 'seq', 'frame', 'command', 'current', 'autocontinue', 'param1', 'param2', 'param3', 'param4', 'x', 'y', 'z'... | Message encoding a mission item. This message is emitted to
announce the presence of a mission item and to
set a mission item on the system. The mission item can be
either in x, y, z meters (type: LOCAL) or x:lat, y:lon,
z:altitude. Local frame is Z-down, right handed (NED), global
frame is Z-up, right ... | 62598f8d24f1403a92685691 |
class String(Column): <NEW_LINE> <INDENT> DEFAULT_SIZE = 40 <NEW_LINE> def __init__( self, name, size=None ): <NEW_LINE> <INDENT> if not size: <NEW_LINE> <INDENT> size = String.DEFAULT_SIZE <NEW_LINE> <DEDENT> Column.__init__( self, "string", name, size ) <NEW_LINE> <DEDENT> def postgres_type( self ): <NEW_LINE> <INDEN... | The string type for pygration table columns. | 62598f8d379a373c97d98bdb |
class Netflow5(NetflowBase): <NEW_LINE> <INDENT> __hdr__ = NetflowBase.__hdr__ + ( ('flow_sequence', 'I', 0), ('engine_type', 'B', 0), ('engine_id', 'B', 0), ('reserved', 'H', 0), ) <NEW_LINE> class NetflowRecord(NetflowBase.NetflowRecordBase): <NEW_LINE> <INDENT> __hdr__ = ( ('src_addr', 'I', 0), ('dst_addr', 'I', 0),... | Netflow Version 5. | 62598f8d097d151d1a2c0bed |
class Adventurer(BaseModel): <NEW_LINE> <INDENT> name: str <NEW_LINE> profession: str <NEW_LINE> level: int <NEW_LINE> alignment: Alignment | A person often late for dinner but with a tale or two to tell.
Attributes:
name (str): Name of this adventurer
profession (str): Profession of this adventurer
level (int): Level of this adventurer
alignment (Alignment): Alignment of this adventurer | 62598f8dfb3f5b602db47f94 |
class TransientResultException(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> super(Exception, self).__init__(message) | Raised when attempting to access results for a task that hasn't
completed. | 62598f8d91af0d3eaad399c6 |
class CallsGraphConfig(object): <NEW_LINE> <INDENT> graph_styles = { 'graph': { 'rankdir': 'LR', 'splines': 'false', 'bgcolor': 'black', 'color': 'yellow', 'labeljust': 'r', 'fontcolor': 'orange', 'ranksep': '2.8 equally', 'nodesep': '.05' }, 'nodes': { 'shape': 'box3d', 'color': 'white', 'fontcolor': 'grey', 'width': ... | Graphviz configuration for calls graph | 62598f8d4428ac0f6e6580eb |
class ZeptoLoader: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> <DEDENT> def load_module(self, fullname): <NEW_LINE> <INDENT> if fullname in sys.modules: <NEW_LINE> <INDENT> mod = sys.modules[fullname] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> mod = imp.n... | Custom module loader for zepto files. | 62598f8d15baa72349461b40 |
class KLCrossEntropyGradient(Operator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(functional.domain, functional.domain, linear=False) <NEW_LINE> <DEDENT> def _call(self, x): <NEW_LINE> <INDENT> if functional.prior is None: <NEW_LINE> <INDENT> tmp = np.log(x) <NEW_LINE> <DEDENT> else: ... | The gradient operator of this functional. | 62598f8d8da39b475be02da4 |
class MessageInlineAdmin(TabularInline): <NEW_LINE> <INDENT> model = Message <NEW_LINE> form = make_ajax_form(Message, {'author': 'user'}, MessageAdminForm) <NEW_LINE> form.Meta.fields = MessageAdminForm.Meta.fields <NEW_LINE> form.Meta.widgets = MessageAdminForm.Meta.widgets <NEW_LINE> max_num = 20 <NEW_LINE> extra = ... | Inline admin des messages d'un thread | 62598f8d30dc7b766599f41f |
class AbstractBasicMessagingEndpoint(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstract_attribute <NEW_LINE> def exchange(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstract_attribute <NEW_LINE> def queue(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstract_attribute <NEW_LINE> def callback_method(sel... | Abstract base class for Enterprise Integration Patterns,
in specific Messaging Endpoints. | 62598f8d0383005118f6d2c0 |
class TestOp5Integration(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 testOp5Integration(self): <NEW_LINE> <INDENT> pass | Op5Integration unit test stubs | 62598f8d8e71fb1e983bb678 |
class BaseModel(models.Model): <NEW_LINE> <INDENT> created_on = models.DateTimeField(auto_now_add=True, editable=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True | parent model which will be inherited by all other child models | 62598f8d9b70327d1c57e965 |
class DropPartitionsResult(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'partitions', (TType.STRUCT,(Partition, Partition.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, partitions=None,): <NEW_LINE> <INDENT> self.partitions = partitions <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE... | Attributes:
- partitions | 62598f8df8510a7c17d7df5a |
class MainPageLocators(object): <NEW_LINE> <INDENT> GO_BUTTON = (By.ID, 'submit') | A class for main page locators. All main page locators should come here | 62598f8d8c0ade5d55dc346f |
class ClientType(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Тип Клиента' <NEW_LINE> verbose_name_plural = 'Типы Клиентов' <NEW_LINE> <DEDENT> objects = models.Manager() <NEW_LINE> id = models.AutoField(primary_key=True) <NEW_LINE> name = models.CharField(verbose_name='Тип клиента... | описание таблицы Тип Клиента | 62598f8d004d5f362081eddd |
class VoxelDataSeries(DataSeries): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> DataSeries.__init__(self, *args, **kwargs) <NEW_LINE> self.__cache = cache.Cache(maxsize=1000) <NEW_LINE> <DEDENT> def makeLabel(self): <NEW_LINE> <INDENT> display = self.displayCtx.getDisplay(self.overlay) <... | The ``VoxelDataSeries`` class is a :class:`DataSeries` class which
provides some functionality useful to data series that represent data
from a voxel in an :class:`.Image` overlay.
It contains a built-in cache which is used to prevent repeated access
to data from the same voxel.
Sub-classes may need to override:
-... | 62598f8d07f4c71912baf00c |
class EntityContext(InstanceContext): <NEW_LINE> <INDENT> def __init__(self, version, service_sid, identity): <NEW_LINE> <INDENT> super(EntityContext, self).__init__(version) <NEW_LINE> self._solution = {'service_sid': service_sid, 'identity': identity, } <NEW_LINE> self._uri = '/Services/{service_sid}/Entities/{identi... | PLEASE NOTE that this class contains preview products that are subject
to change. Use them with caution. If you currently do not have developer
preview access, please contact help@twilio.com. | 62598f8d5f7d997b871f91bc |
class IngredientViewSet(BaseRecipeViewSet): <NEW_LINE> <INDENT> queryset = Ingredient.objects.all() <NEW_LINE> serializer_class = serializers.IngredientSerializer | Manage ingredients in the database | 62598f8d507cdc57c63a4957 |
class VatRollInvoiceOCRRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageBase64 = None <NEW_LINE> self.ImageUrl = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageBase64 = params.get("ImageBase64") <NEW_LINE> self.ImageUrl = params.get("I... | VatRollInvoiceOCR请求参数结构体
| 62598f8d596a89723612783f |
class ReadcomiconlineIssueExtractor(ReadcomiconlineBase, ChapterExtractor): <NEW_LINE> <INDENT> subcategory = "issue" <NEW_LINE> pattern = BASE_PATTERN + r"(/Comic/[^/?#]+/[^/?#]+\?id=(\d+))" <NEW_LINE> test = ("https://readcomiconline.li/Comic/W-i-t-c-h/Issue-130?id=22289", { "url": "30d29c5afc65043bfd384c010257ec2d0e... | Extractor for comic-issues from readcomiconline.li | 62598f8d435de62698e9b9b7 |
class BlockdiagModule(BlockdiagFile): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> super(BlockdiagModule, self).__init__() <NEW_LINE> self._module = BlockdiagSection(comment="module") <NEW_LINE> self._inputs = BlockdiagSection(comment="inputs") <NEW_LINE> self._outputs =... | Class representing a module as a blockdiag file. | 62598f8d71ff763f4b5e7339 |
class ReactionStatistic(Statistic): <NEW_LINE> <INDENT> def getStatistic(self): <NEW_LINE> <INDENT> indicies = self._shim.getReactionIndicies() <NEW_LINE> value_dict = {} <NEW_LINE> for idx in indicies: <NEW_LINE> <INDENT> value_dict = self._addValues(value_dict, idx) <NEW_LINE> <DEDENT> result = {} <NEW_LINE> for key ... | Abstract class for computing reaction statistics that iterate across
reactions and compute aggregations of the results.
Classes that inherit must provide the following method:
_getValues(self, dict, idx) - provides a scalar number for a reaction, where
dict is an initially empty dictionary, idx is the reaction ... | 62598f8dd6c5a102081e1d0c |
class Evaluate(Resource): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> some_json = request.get_json() <NEW_LINE> expression = some_json['expression'] <NEW_LINE> validation(expression) <NEW_LINE> standResult = standardExpr(expression) <NEW_LINE> postfixResult = changeToPostfix(standResult) <NEW_LINE> result =... | Class which carry out main task of microservice | 62598f8d1f037a2d8b9e3ca3 |
class Membership(Edge): <NEW_LINE> <INDENT> meta = { "ontology": "gch", "typename": "Membership", "hierarchy": "gch/Entity.Edge.Membership" } <NEW_LINE> def __init__(self, attributes={}, tags=set([])): <NEW_LINE> <INDENT> super(Membership, self).__init__(attributes, tags) | Membership link | 62598f8d23e79379d538c0c8 |
class ReverseSequence(Sequence): <NEW_LINE> <INDENT> def __init__(self, wc): <NEW_LINE> <INDENT> self.name = wc.name + "*" <NEW_LINE> self.seq = seq_comp(wc.seq) <NEW_LINE> self.nseq = None <NEW_LINE> self.length = wc.length <NEW_LINE> self.num = wc.num <NEW_LINE> self.reversed = True <NEW_LINE> self.wc = wc | Complements of defined sequences | 62598f8d96565a6dacd2cd5c |
@attr(shard=1) <NEW_LINE> class CreateFakeCertTest(TestCase): <NEW_LINE> <INDENT> USERNAME = "test" <NEW_LINE> COURSE_KEY = CourseLocator(org='edX', course='DemoX', run='Demo_Course') <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(CreateFakeCertTest, self).setUp() <NEW_LINE> self.user = UserFactory.create(userna... | Tests for the create_fake_certs management command. | 62598f8da17c0f6771d5be0b |
class IdenticalDatasets(OcelotError): <NEW_LINE> <INDENT> pass | Multiple datasets with the same identifying attributes were found | 62598f8d63b5f9789fe84d3b |
class _UnitRegistry(object): <NEW_LINE> <INDENT> def __init__(self, init=[], equivalencies=[]): <NEW_LINE> <INDENT> if isinstance(init, _UnitRegistry): <NEW_LINE> <INDENT> equivalencies = init.equivalencies <NEW_LINE> init = init.all_units <NEW_LINE> <DEDENT> self._reset_units() <NEW_LINE> self._reset_equivalencies() <... | Manages a registry of the enabled units. | 62598f8d99cbb53fe6830a9b |
class ManifestNotFound(Exception): <NEW_LINE> <INDENT> pass | Manifest (.manifest) file not found. | 62598f8deab8aa0e5d30b943 |
class HashIdHyperlinkedIdentityFieldTests(BaseFieldsTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(HashIdHyperlinkedIdentityFieldTests, self).setUp() <NEW_LINE> class TestSerializer(Serializer): <NEW_LINE> <INDENT> manufacturer = fields.HashIdHyperlinkedIdentityField( lookup_url_kwarg="extern... | Unit tests for the HashIdHyperlinkedIdentityField. | 62598f8d8da39b475be02da7 |
class FromAddressScrollTable(ScrollingFragment): <NEW_LINE> <INDENT> jsClass = u'Quotient.Compose.FromAddressScrollTable' <NEW_LINE> def __init__(self, store): <NEW_LINE> <INDENT> ScrollingFragment.__init__( self, store, FromAddress, None, (FromAddressAddressColumn(), FromAddress.smtpHost, FromAddress.smtpPort, FromAdd... | L{xmantissa.scrolltable.ScrollingFragment} subclass for browsing
and editing L{FromAddress} items. | 62598f8d0c0af96317c55f51 |
class ExceptionReporterFilter(object): <NEW_LINE> <INDENT> def get_request_repr(self, request): <NEW_LINE> <INDENT> if request is None: <NEW_LINE> <INDENT> return repr(None) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return build_request_repr(request, POST_override=self.get_post_parameters(request)) <NEW_LINE> <DEDE... | Base for all exception reporter filter classes. All overridable hooks
contain lenient default behaviors. | 62598f8d07d97122c4216872 |
class GameServicer(object): <NEW_LINE> <INDENT> def StartGame(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def PlayGame(self, requ... | Missing associated documentation comment in .proto file. | 62598f8d24f1403a92685693 |
class IDummy(zope.interface.Interface): <NEW_LINE> <INDENT> dummy = zope.schema.Text(title=u'dummy') <NEW_LINE> dummy2 = zope.schema.Text(title=u'dummy2') | Interface for test entity. | 62598f8dec188e330fdf8468 |
class DraftListView(LoginRequiredMixin, ListView): <NEW_LINE> <INDENT> model = Post <NEW_LINE> template_name = 'blog/post_draft_list.html' <NEW_LINE> context_object_name = 'posts_draft' <NEW_LINE> login_url = '/login/' <NEW_LINE> redirect_field_name = 'blog/post_list.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> ... | docstring for DraftListView. | 62598f8da8ecb03325870dcc |
class Command(BaseCommand): <NEW_LINE> <INDENT> def add_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument('--start', type=int, nargs='?', help='Well to start at', default=1) <NEW_LINE> parser.add_argument('--end', type=int, nargs='?', help='Well to end at', default=50) <NEW_LINE> parser.add_argument('--n... | Run from command line:
python manage.py legacy_records | 62598f8d38b623060ffa8c60 |
class DiscordLogFilter(logging.Filter): <NEW_LINE> <INDENT> def filter(self, record): <NEW_LINE> <INDENT> ignored_messages = ( "PyNaCl is not installed, voice will NOT be supported", ) <NEW_LINE> return not record.getMessage() in ignored_messages | Filter to hide uninformative/annoying discord errors | 62598f8dcad5886f8bdc4e71 |
class CompatOptionParser(optparse.OptionParser): <NEW_LINE> <INDENT> class CustomFormatter(optparse.IndentedHelpFormatter): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> optparse.IndentedHelpFormatter.__init__(self,*args, **kwargs) <NEW_LINE> <DEDENT> def format_option_preserve_nl(self, o... | An option parser which emulates the behaviour of the old sim_vehicle.sh; if passed -C, the first argument not understood starts a list of arguments that are passed straight to mavproxy | 62598f8d090684286d5934ba |
class BoolCol(OptCol): <NEW_LINE> <INDENT> def __init__(self, name, **kwargs): <NEW_LINE> <INDENT> OptCol.__init__(self, name, choices={True: 'Yes', False: 'No'}, coerce_fn=bool, **kwargs) | Output Yes/No values for truthy or falsey values.
| 62598f8db5575c28eb712aaf |
class DeserializedObject(object): <NEW_LINE> <INDENT> def __init__(self, obj, m2m_data=None): <NEW_LINE> <INDENT> self.object = obj <NEW_LINE> self.m2m_data = m2m_data <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<%s: %s(pk=%s)>" % ( self.__class__.__name__, self.object._meta.label, self.object.p... | A deserialized model.
Basically a container for holding the pre-saved deserialized data along
with the many-to-many data saved with the object.
Call ``save()`` to save the object (with the many-to-many data) to the
database; call ``save(save_m2m=False)`` to save just the object fields
(and not touch the many-to-many ... | 62598f8d4428ac0f6e6580ef |
class ParseHistoricalBoxScores(luigi.Task): <NEW_LINE> <INDENT> def requires(self): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> def output(self): <NEW_LINE> <INDENT> return luigi.LocalTarget(os.path.join(cfg.DATA_PARSED, 'box-scores.csv')) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> box_scores = [] <NE... | Parse the historical box score xlsx files into a single csv | 62598f8de76e3b2f99fd85fb |
class Buffer: <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> self.size = int(val['size_']) <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> return self.val['data_'] <NEW_LINE> <DEDENT> def bytes_literal(self): <NEW_LINE> <INDENT> if self.size > 0: ... | A arrow::Buffer value. | 62598f8da05bb46b3848a446 |
class ItemClass(str, Enum): <NEW_LINE> <INDENT> GENERIC_PASSWORD = kSecClassGenericPassword <NEW_LINE> INTERNET_PASSWORD = kSecClassInternetPassword | Keychain item class.
* `GENERIC_PASSWORD` - The value that indicates a generic password item.
* `INTERNET_PASSWORD` - The value that indicates an Internet password item. | 62598f8d82261d6c5272fcba |
class DownloadResponseValidator(object): <NEW_LINE> <INDENT> def __call__(self, test_case, response, **assertions): <NEW_LINE> <INDENT> self.assert_download_response(test_case, response) <NEW_LINE> for key, value in assertions.iteritems(): <NEW_LINE> <INDENT> assert_func = getattr(self, 'assert_%s' % key) <NEW_LINE> as... | Utility class to validate DownloadResponse instances. | 62598f8d0383005118f6d2c4 |
class SetupLoaderFactory(object): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> <DEDENT> def __call__(self, distribution, path, interpretor, trust=-99): <NEW_LINE> <INDENT> setup_cfg = os.path.join(path, 'monteur.cfg') <NEW_LINE> if os.path.isfile(setup_cfg): <NE... | Load a monteur package.
| 62598f8d16aa5153ce4000d0 |
class GalleryApplicationVersion(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'provisioning_state': {'readonly': True}, 'replication_status': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key... | Specifies information about the gallery Application Version that you want to create or update.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar id: Resource Id.
:vartype id: str
:ivar name: Resource name... | 62598f8d435de62698e9b9ba |
class CreateServiceResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ServiceId = None <NEW_LINE> self.ServiceName = None <NEW_LINE> self.ServiceDesc = None <NEW_LINE> self.OuterSubDomain = None <NEW_LINE> self.InnerSubDomain = None <NEW_LINE> self.CreatedTime = None <NEW_LINE> se... | CreateService response structure.
| 62598f8dfbf16365ca793c7a |
class SparkVarianceThreshold(VarianceThreshold, SparkSelectorMixin): <NEW_LINE> <INDENT> def fit(self, Z): <NEW_LINE> <INDENT> X = Z[:, 'X'] if isinstance(Z, DictRDD) else Z <NEW_LINE> def mapper(X): <NEW_LINE> <INDENT> X = check_array(X, ('csr', 'csc'), dtype=np.float64) <NEW_LINE> if hasattr(X, "toarray"): <NEW_LINE>... | Feature selector that removes all low-variance features.
This feature selection algorithm looks only at the features (X), not the
desired outputs (y), and can thus be used for unsupervised learning.
Parameters
----------
threshold : float, optional
Features with a training-set variance lower than this threshold w... | 62598f8d004d5f362081eddf |
class TestInternalServerError(TestSuite): <NEW_LINE> <INDENT> def test_init(self): <NEW_LINE> <INDENT> expected = "Internal Error" <NEW_LINE> mock_data = {"Status": {"Message": expected}} <NEW_LINE> actual = InternalServerError(mock_data) <NEW_LINE> self.assertEqual(str(actual), expected) | TestInternalServerError testa unitariamente a classe
agregadora de serviços InternalServerError | 62598f8d63d6d428bbee2385 |
class SpendingByCategoryFederalAccountsViewSet(APIView): <NEW_LINE> <INDENT> @cache_response() <NEW_LINE> def post(self, request, pk, format=None): <NEW_LINE> <INDENT> json_request = request.data <NEW_LINE> filters = json_request.get("filters", None) <NEW_LINE> queryset = FinancialAccountsByProgramActivityObjectClass.o... | This route takes a federal_account DB ID and returns the data required to visualized
the Spending By Category graphic. | 62598f8dec188e330fdf846a |
class SiteHelper(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> if 'data' in data: <NEW_LINE> <INDENT> data = data['data']['site'] <NEW_LINE> <DEDENT> self._data = data <NEW_LINE> self.__dict__.update(**data) <NEW_LINE> <DEDENT> def list_uri(self, name=None, site_id=None): <NEW_LINE> <INDENT... | Class used to help with common API things in testing. | 62598f8d21a7993f00c65b43 |
class ScoringFormChoiceField(forms.ChoiceField): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> kwargs['choices'] = [EMPTY_CHOICE] + SCORING_FORM_CHOICES <NEW_LINE> super(ScoringFormChoiceField, self).__init__(**kwargs) | Field for selecting which scoring form (buttons) should display. | 62598f8d596a897236127843 |
class MSE(Loss): <NEW_LINE> <INDENT> def loss(self, predicted, actual): <NEW_LINE> <INDENT> return np.sum((predicted - actual)**2) <NEW_LINE> <DEDENT> def grad(self, predicted, actual): <NEW_LINE> <INDENT> return 2 * (predicted - actual) | Total square error | 62598f8d07d97122c4216875 |
class Protocol: <NEW_LINE> <INDENT> def __init__(self, host): <NEW_LINE> <INDENT> self.conn = Connection(host=host) <NEW_LINE> self.reconnect = False <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.conn.__enter__() <NEW_LINE> return self <NEW_LINE> <DEDENT> def __exit__(self, exception, value, traceba... | JVC projector protocol, understands how to send commands and handle the responses | 62598f8d462c4b4f79dbb5cf |
class RMSProp(Optimizer): <NEW_LINE> <INDENT> def __init__(self, lr, rho, eps=1e-7): <NEW_LINE> <INDENT> Optimizer.__init__(self, lr=lr, rho=rho, eps=eps) <NEW_LINE> <DEDENT> def get_updates(self, params, grads, lr, rho, eps): <NEW_LINE> <INDENT> updates = [] <NEW_LINE> for param, grad in zip(params, grads): <NEW_LINE>... | Implements Hinton's "RMSProp" method presented in his Coursera lecture 6.5.
Essentially, it sits right in-between AdaGrad and AdaDelta by being a
windowed version of AdaGrad.
The updates are:
g²_{e+1} = ρ * g²_e + (1-ρ) * ∇p_e²
p_{e+1} = p_e - (lr / √g²_{e+1}) * ∇p_e
Note that in this case just initializing ... | 62598f8dbaa26c4b54d4ee80 |
class TestOneRefLikeClusters(TestCase): <NEW_LINE> <INDENT> def test_GivenSequencesWithDifferentLengths_Fails(self): <NEW_LINE> <INDENT> sequences = ["AT", "AA", "CCC"] <NEW_LINE> with self.assertRaises(ValueError): <NEW_LINE> <INDENT> sequences_are_one_reference_like(sequences) <NEW_LINE> <DEDENT> <DEDENT> def test_Gi... | Disclaimer:
A heuristic is used to determine whether a set of sequences
is 'one-ref like' based on a length threshold and a distance threshold.
If either of those parameters is changed, below tests can start to fail;
I placed in assertions to point to why. | 62598f8d287bf620b6271784 |
@jwtauth <NEW_LINE> class PluginDataHandler(APIRequestHandler): <NEW_LINE> <INDENT> SUPPORTED_METHODS = ["GET"] <NEW_LINE> def get(self, plugin_group=None, plugin_type=None, plugin_code=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> filter_data = dict(self.request.arguments) <NEW_LINE> if not plugin_group: <NEW_LI... | Get completed plugin output data from the DB. | 62598f8d50485f2cf55dab40 |
class AttributeOperand(FrozenClass): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.NodeId = NodeId() <NEW_LINE> self.Alias = '' <NEW_LINE> self.BrowsePath = RelativePath() <NEW_LINE> self.AttributeId = 0 <NEW_LINE> self.IndexRange = '' <NEW_LINE> self._freeze() <NEW_LINE> <DEDENT> def to_binary(self)... | :ivar NodeId:
:vartype NodeId: NodeId
:ivar Alias:
:vartype Alias: String
:ivar BrowsePath:
:vartype BrowsePath: RelativePath
:ivar AttributeId:
:vartype AttributeId: UInt32
:ivar IndexRange:
:vartype IndexRange: String | 62598f8d4428ac0f6e6580f1 |
class Shader(object): <NEW_LINE> <INDENT> X = U = 0 <NEW_LINE> Y = V = 1 <NEW_LINE> Z = W = 2 <NEW_LINE> def __init__(self, light_source=LightSource(), colour=np.array([255, 204, 204, 255]), distance_shading=True, cutoff_distance=None): <NEW_LINE> <INDENT> self._light_source = light_source <NEW_LINE> self._colour = col... | The Shader applies shading to patches, based on the orienation of the
patches' normals to the light-source.
Currently, only the position of the light source matters, but there is at
least a skeleton for implementing light directionality and such at a later
stage. The standard Camera object can be used as a light sourc... | 62598f8de76e3b2f99fd85fd |
class DataStore(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.entries = [] <NEW_LINE> <DEDENT> @property <NEW_LINE> def count(self): <NEW_LINE> <INDENT> return len(self.entries) <NEW_LINE> <DEDENT> def append(self, entry): <NEW_LINE> <INDENT> self.entries.append(entry) <NEW_LINE> <DEDENT> de... | In memory data store | 62598f8dd6c5a102081e1d10 |
class ValueRangeField(DummyField): <NEW_LINE> <INDENT> replacements = { '_max': (ValueAndUnitField, {}), '_min': (ValueAndUnitField, {}), } | A field for representing a range of values.
Creating a ValueRangeField named 'normal_range', for example, will (under the hood) create the fields:
* ``normal_range_max``, the maximum value of the range (a :py:class:`~indivo.fields.ValueAndUnitField`)
* ``normal_range_min``, the minimum value of the range (a :py:class... | 62598f8d656771135c489248 |
class DocumentPlugin(CMSPlugin): <NEW_LINE> <INDENT> document = models.ForeignKey( 'document_library.Document', verbose_name=_('Document'), ) | Class to extend the `CMSPlugin` pluginmodel. | 62598f8dd4950a0f3b110c1c |
class InstitutionViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Institution.objects.all() <NEW_LINE> serializer_class = InstitutionSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly, ) <NEW_LINE> authentication_classes = (CsrfExemptSessionAuthentication, ) <NEW_LINE> def l... | This viewset automatically provides `list`, `create`, `retrieve`,
`update` and `destroy` actions.
Additionally we also provide an extra `highlight` action. | 62598f8da05bb46b3848a448 |
class Manager(rpc.RPCServer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Manager, self).__init__(port) <NEW_LINE> self.dhcp = isc.ISCController() <NEW_LINE> self.reload_allocations() <NEW_LINE> <DEDENT> def update_networks(self): <NEW_LINE> <INDENT> self.reload_allocations() <NEW_LINE> <DEDENT> d... | Class represents DHCP manager that servers two requests:
1. Adding subnets
2. Adding ipmi/mgmt ips to DHCP | 62598f8df7d966606f747bab |
class TestGetDocxPagesRequest(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 testGetDocxPagesRequest(self): <NEW_LINE> <INDENT> pass | GetDocxPagesRequest unit test stubs | 62598f8d3539df3088ecbe88 |
@tvm._ffi.register_object <NEW_LINE> class Realize(Stmt): <NEW_LINE> <INDENT> def __init__(self, func, value_index, dtype, bounds, condition, body): <NEW_LINE> <INDENT> self.__init_handle_by_constructor__( _ffi_api.Realize, func, value_index, dtype, bounds, condition, body) | Realize node.
Parameters
----------
func : Operation
The operation to create the function.
value_index : int
The output value index
dtype : str
The data type of the operation.
bounds : list of range
The bound of realize
condition : PrimExpr
The realize condition.
body : Stmt
The realize bo... | 62598f8d6e29344779b00222 |
class PreflightUnloadException(ControlFlowException): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return '[PreflightUnloadException]' | Exception class used by an app unload itself. This exception should
only be raised in a 'preflight' event handler. | 62598f8d55399d3f056260e7 |
class IndexTemplateTestsBlankDB(IndexTemplateTests): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('blank_db', True) <NEW_LINE> super(IndexTemplateTestsBlankDB, self).__init__(*args, **kwargs) | Class extends the normal set of template tests but sets a 'blank_db' parameter to test the templates with an empty database | 62598f8d9b70327d1c57e96b |
class ChoiceStatusManutencaoCorretiva(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = VERBOSE_CHOICE_STATUS_MANUTENCAO_CORRETIVA <NEW_LINE> verbose_name_plural = VERBOSE_PLURAL_CHOICE_STATUS_MANUTENCAO_CORRETIVA <NEW_LINE> <DEDENT> criado = models.DateTimeField( auto_now_add=True, auto... | Opções de status para manutenção corretiva. | 62598f8d15fb5d323ce7e8fa |
class zero_mean_unit_variance(object): <NEW_LINE> <INDENT> def __init__(self, train_folds, parameters): <NEW_LINE> <INDENT> self.norm_dim = None <NEW_LINE> self.mean = 0 <NEW_LINE> self.var = 0 <NEW_LINE> self.fit(train_folds, parameters) <NEW_LINE> return <NEW_LINE> <DEDENT> def get_mean(self, train_folds, parameters)... | Basically just a wrapper for scikit PCA
| 62598f8deab8aa0e5d30b947 |
@ISISSansSystemTest(SANSInstrument.SANS2D) <NEW_LINE> class SANS2DMinimalBatchReductionTest_V2(systemtesting.MantidSystemTest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(SANS2DMinimalBatchReductionTest_V2, self).__init__() <NEW_LINE> config['default.instrument'] = 'SANS2D' <NEW_LINE> self.tolera... | Minimal script to perform full reduction in batch mode
| 62598f8dd7e4931a7ef3bc6a |
class Nothing(Schema): <NEW_LINE> <INDENT> @from_simple <NEW_LINE> def validate(self, obj): <NEW_LINE> <INDENT> return False | A validator that invalidates all objects.
Examples
--------
>>> Nothing().is_valid('Forty two')
False
>>> Nothing().is_valid(42)
False
>>> Nothing().is_valid(None)
False | 62598f8d63d6d428bbee2387 |
class User(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> first_name = models.CharField(_('first name'), max_length=30, blank=True) <NEW_LINE> last_name = models.CharField(_('last name'), max_length=30, blank=True) <NEW_LINE> email = models.EmailField(_('email address'), blank=False, unique=True, error_messag... | An abstract base class implementing a fully featured User model with
admin-compliant permissions.
Username and password are required. Other fields are optional. | 62598f8dec188e330fdf846c |
class PID: <NEW_LINE> <INDENT> def __init__(self, P=1.0, I=0.0, D=1.0, Derivator=0, Integrator=0, Integrator_max=500, Integrator_min=-500): <NEW_LINE> <INDENT> self.Kp=P <NEW_LINE> self.Ki=I <NEW_LINE> self.Kd=D <NEW_LINE> self.Derivator=Derivator <NEW_LINE> self.Integrator=Integrator <NEW_LINE> self.Integrator_max=Int... | Discrete PID control | 62598f8d442bda511e95c02c |
class Seabird(Bird): <NEW_LINE> <INDENT> def __init__(self, kind, call, diving_depth): <NEW_LINE> <INDENT> super().__init__(kind, call) <NEW_LINE> self.diving_depth = diving_depth <NEW_LINE> <DEDENT> def get_description(self): <NEW_LINE> <INDENT> return f'{super().description()} and also, a {self.kind} dives to a depth... | Subclass of Bird superclass for sea birds | 62598f8dac7a0e7691f720d7 |
class TemplateString: <NEW_LINE> <INDENT> pattern = re.compile(r"{{\s*(.*?)\s*}}") <NEW_LINE> def __init__(self, output): <NEW_LINE> <INDENT> self.output = output <NEW_LINE> self.expression = None <NEW_LINE> <DEDENT> def _match(self, match): <NEW_LINE> <INDENT> self.expression = Expression(match.group(1), output=self.o... | Template string converter | 62598f8d76d4e153a661c7e5 |
class DataFrames(dict): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(DataFrames, self).__init__() <NEW_LINE> for key, item in kwargs.items(): <NEW_LINE> <INDENT> setattr(self, key, item) <NEW_LINE> <DEDENT> <DEDENT> def append_new_frame(self, name=None, data=None, **kwargs): <NEW_LINE> <I... | Stores information for delivery elements (sheets / files, eg. delivery_info, data, analyse_info, sampling_info).
Use element name as key in this dictionary of Frame()-objects | 62598f8d379a373c97d98be3 |
class SubjectDescriptorTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.person = Person.objects.create(name="Mario", surname="Rossi") <NEW_LINE> self.gas = GAS.objects.create(name="GASteropode") <NEW_LINE> self.supplier = Supplier.objects.create(name="GoodCompany") <NEW_LINE> <DEDENT> def t... | Tests related to the ``SubjectDescriptor`` descriptor | 62598f8dd53ae8145f918059 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.