code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class BpmFinderProceed(wx.Frame): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> wx.Frame.__init__(self, parent, id=wx.ID_ANY, title=u"BpmFinderProceed", pos=wx.DefaultPosition, size=wx.Size(174, 135), style=wx.DEFAULT_FRAME_STYLE | wx.TAB_TRAVERSAL) <NEW_LINE> self.SetSizeHintsSz(wx.DefaultSize, w... | Subprocess proceed gui. | 62598fccbe7bc26dc925203e |
class RootParser(Tap): <NEW_LINE> <INDENT> field: str = '1' <NEW_LINE> def configure(self): <NEW_LINE> <INDENT> self.add_subparsers(help='All sub parser') <NEW_LINE> self.add_subparser('sub', SubParser) | <Root Parser> | 62598fcc377c676e912f6f5c |
class FunctionalFixture(PloneSandboxLayer): <NEW_LINE> <INDENT> defaultBases = (PLONE_APP_CONTENTTYPES_FIXTURE,) <NEW_LINE> def setUpZope(self, app, configurationContext): <NEW_LINE> <INDENT> import eea.ldapadmin <NEW_LINE> import plone.dexterity <NEW_LINE> import plone.app.textfield <NEW_LINE> self.loadZCML(package=pl... | Fixture | 62598fccff9c53063f51aa16 |
class TemperatureLog: <NEW_LINE> <INDENT> def add(self,record): <NEW_LINE> <INDENT> raise NotImplementedError('TemperatureLog.add(...)') <NEW_LINE> <DEDENT> def write(line): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_max_min(self,channel): <NEW_LINE> <INDENT> xs,ys=self.extract(channel) <NEW_LINE> ys_for_peri... | Used to store temperature values
Abstract class, needs to be implemented by descendents | 62598fcc71ff763f4b5e7b4c |
class PerlDevelCycle(PerlPackage): <NEW_LINE> <INDENT> homepage = "http://search.cpan.org/~lds/Devel-Cycle-1.12/lib/Devel/Cycle.pm" <NEW_LINE> url = "http://search.cpan.org/CPAN/authors/id/L/LD/LDS/Devel-Cycle-1.12.tar.gz" <NEW_LINE> version('1.12', '3d9a963da87b17398fab9acbef63f277') | Find memory cycles in objects | 62598fcca219f33f346c6bd4 |
class Test_prob_1to1(TestProbMethod_1to1, prob): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(Test_prob_1to1, self).setUp() <NEW_LINE> self.disc._input_sample_set.estimate_volume_mc() <NEW_LINE> calcP.prob(self.disc) | Test :meth:`bet.calculateP.calculateP.prob` on a 1 to 1 map. | 62598fcc55399d3f056268e4 |
class MxNode(JuniperNode): <NEW_LINE> <INDENT> pass | Class Node to create JunOS mx node objects. | 62598fcc091ae35668704ff5 |
class TestHandleNumber: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> @pytest.mark.facade <NEW_LINE> @pytest.mark.sqlalchemy <NEW_LINE> def test_invalid_format(): <NEW_LINE> <INDENT> artifacts = _create_artifacts() <NEW_LINE> artifacts.open_api.type = "number" <NEW_LINE> artifacts.open_api.format = "unsupported" <NEW_LI... | Tests for _handle_number. | 62598fcc956e5f7376df5863 |
class DiskMetaTileStorage(MetaTileStorageImpl): <NEW_LINE> <INDENT> def __init__(self, root='.', dir_mode='hilbert', levels=range(0, 22), stride=1, format=None, readonly=False, gzip=False): <NEW_LINE> <INDENT> assert isinstance(root, six.string_types) <NEW_LINE> if not isinstance(format, FormatBundle): <NEW_LINE> <INDE... | Store ``MetaTile`` on a file system.
:param root: Required, root directory of the storage, must be a
absolute filesystem path.
:type root: str
:param dir_mode: Specifies how the directory names are calculated from
metatile index, possible choices are:
`simple`
Same as the tile api url schema, ``z... | 62598fccf9cc0f698b1c54b9 |
class Lista(object): <NEW_LINE> <INDENT> def __init__(self, Primero=None): <NEW_LINE> <INDENT> self.PrimerNodo = Primero <NEW_LINE> self.UltimoNodo = None <NEW_LINE> self.size= 0 <NEW_LINE> <DEDENT> def getSize(self): <NEW_LINE> <INDENT> return self.size <NEW_LINE> <DEDENT> def Eliminar (self, ind): <NEW_LINE> <INDENT>... | docstring for Lista | 62598fcc3346ee7daa33782d |
class AboutPageView(TemplateView): <NEW_LINE> <INDENT> template_name = 'basic/about.html' | This class is responsible for the About View | 62598fccdc8b845886d53988 |
class TestFindSum(object): <NEW_LINE> <INDENT> def test_findSum_10(self): <NEW_LINE> <INDENT> assert findSum([3, 5], 10) == 23 <NEW_LINE> <DEDENT> def test_findSum_1000(self): <NEW_LINE> <INDENT> assert findSum([3, 5], 1000) == 266333 | This function is to test main.py's functions | 62598fcc97e22403b383b2d3 |
class FeedForwardNetwork(nn.Block): <NEW_LINE> <INDENT> def __init__(self, hidden_size, filter_size, relu_dropout, train, **kwargs): <NEW_LINE> <INDENT> super(FeedForwardNetwork, self).__init__(**kwargs) <NEW_LINE> self.hidden_size = hidden_size <NEW_LINE> self.filter_size = filter_size <NEW_LINE> self.relu_dropout = r... | Fully connected feedforward network | 62598fcc283ffb24f3cf3c52 |
class ThreadPool: <NEW_LINE> <INDENT> def __init__(self, num_workers, q_size=0): <NEW_LINE> <INDENT> self.requestsQueue = Queue.Queue(q_size) <NEW_LINE> self.resultsQueue = Queue.Queue() <NEW_LINE> self.workers = [] <NEW_LINE> self.workRequests = {} <NEW_LINE> self.createWorkers(num_workers) <NEW_LINE> <DEDENT> def cre... | A thread pool, distributing work requests and collecting results.
See the module doctring for more information. | 62598fcc7c178a314d78d86c |
class InterBoundaryIter(object): <NEW_LINE> <INDENT> def __init__(self, stream, boundary): <NEW_LINE> <INDENT> self._stream = stream <NEW_LINE> self._boundary = boundary <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def next(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDEN... | A Producer that will iterate over boundaries. | 62598fccf9cc0f698b1c54ba |
class ImpalaEngineSpec(BaseEngineSpec): <NEW_LINE> <INDENT> engine = 'impala' <NEW_LINE> time_grains = ( Grain("Time Column", _('Time Column'), "{col}"), Grain("minute", _('minute'), "TRUNC({col}, 'MI')"), Grain("hour", _('hour'), "TRUNC({col}, 'HH')"), Grain("day", _('day'), "TRUNC({col}, 'DD')"), Grain("week", _('wee... | Engine spec for Cloudera's Impala | 62598fcc5fcc89381b266333 |
class NameSchemaNode(colander.SchemaNode): <NEW_LINE> <INDENT> schema_type = colander.String <NEW_LINE> max_len = 100 <NEW_LINE> editing = None <NEW_LINE> def validator(self, node, value): <NEW_LINE> <INDENT> context = self.bindings['context'] <NEW_LINE> request = self.bindings['request'] <NEW_LINE> editing = self.edit... | Convenience Colander schemanode used to represent the name (aka
``__name__``) of an object in a propertysheet or add form which allows for
customizing the detection of whether editing or adding is being done, and
setting a max length for the name.
By default it uses the context's ``check_name`` API to ensure that the ... | 62598fcc3617ad0b5ee06515 |
class FieldQuery(Persistent): <NEW_LINE> <INDENT> implements(IFieldQuery) <NEW_LINE> _field_id = None <NEW_LINE> _fieldname = None <NEW_LINE> def __init__(self, field, comparator, value): <NEW_LINE> <INDENT> if fieldtypes.IField.providedBy(field): <NEW_LINE> <INDENT> field = field.__name__ <NEW_LINE> <DEDENT> self._fie... | FieldQuery is field / value / comparator entry. Field is persisted
using serialization (tuple of dotted name of interface, fieldname),
but resolution of field object is cached indefinitely in volatile. | 62598fccff9c53063f51aa1a |
@dataclass(order=True, frozen=True) <NEW_LINE> class FlatIndex: <NEW_LINE> <INDENT> invalid: bool <NEW_LINE> idx: Union[int, typing.Tuple[int, int]] | Flat indexes for both invalids and valids.
If invalid, there is no flat index.
The goal there is just to align the first invalids temporally rather than preserving flattened order.
Therefore, flat_idx is just a tuple of t and s. t comes first so sorting them puts t's together. | 62598fcc4c3428357761a68c |
class DiskItem(object): <NEW_LINE> <INDENT> name = None <NEW_LINE> is_dir = None <NEW_LINE> is_removed = None <NEW_LINE> remove_date = None <NEW_LINE> path=None <NEW_LINE> def __init__(self, name, is_dir=False, is_removed=False, remove_date=None, path=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.is_dir =... | Describes disk items.
Fields:
* name -- last elemet of path
* is_dir
* is_removed
* remove_date
* path -- path to item, relative to disk folder | 62598fcc71ff763f4b5e7b50 |
class DeviceManage(ModelDateMixin): <NEW_LINE> <INDENT> name = models.CharField(max_length=50, verbose_name='设备名称') <NEW_LINE> device_id = models.CharField(max_length=30, unique=True, verbose_name='设备id') <NEW_LINE> brand = models.CharField(max_length=20, verbose_name='设备品牌') <NEW_LINE> phone_model = models.CharField(m... | app表,设备管理 | 62598fccab23a570cc2d4f55 |
class AccountViewSet(ModelViewSet): <NEW_LINE> <INDENT> queryset = Account.objects.all() <NEW_LINE> serializer_class = AccountSerializer <NEW_LINE> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> serializer = AccountSerializer(data=request.data) <NEW_LINE> data = {} <NEW_LINE> if serializer.is_valid(): ... | View of Account | 62598fcc7cff6e4e811b5df6 |
class SortedSetEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if isinstance(o, set): <NEW_LINE> <INDENT> return sorted(o) <NEW_LINE> <DEDENT> return json.JSONEncoder.default(self, o) | Encode sets as sorted lists. | 62598fcca219f33f346c6bd8 |
class CellChars(enum.Enum): <NEW_LINE> <INDENT> FLAG = 'F' <NEW_LINE> BOMB = '*' <NEW_LINE> MISTAKE = 'O' <NEW_LINE> WRONG_FLAG = 'x' <NEW_LINE> NOT_OPENED = '.' <NEW_LINE> OPENED = lambda s: str(s or ' ') | Текстовое представление клеток поля | 62598fcca05bb46b3848ac3a |
class OperationDnsKeyContext(_messages.Message): <NEW_LINE> <INDENT> newValue = _messages.MessageField('DnsKey', 1) <NEW_LINE> oldValue = _messages.MessageField('DnsKey', 2) | A OperationDnsKeyContext object.
Fields:
newValue: The post-operation DnsKey resource.
oldValue: The pre-operation DnsKey resource. | 62598fccf9cc0f698b1c54bb |
@dataclass(frozen=True) <NEW_LINE> class EventInvalidReceivedWithdrawExpired(Event): <NEW_LINE> <INDENT> attempted_withdraw: WithdrawAmount <NEW_LINE> reason: str | Event emitted when an invalid withdraw expired event is received. | 62598fcccc40096d6161a3bf |
class Optional(RuleWrapper): <NEW_LINE> <INDENT> def __init__(self, rule, default=None): <NEW_LINE> <INDENT> super(Optional, self).__init__(rule) <NEW_LINE> self.default = default if default is not None else '' <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '[ {rule!r} ]'.format(rule=self.rule) <NEW... | Optionally match a rule. | 62598fcc4527f215b58ea29f |
class ChapterStart(State): <NEW_LINE> <INDENT> def process(self, parser): <NEW_LINE> <INDENT> values = re.match(': start (\d*.\d*),', parser.remaining) <NEW_LINE> parser.root.update({'start': int(float(values.groups()[0])), 'start_time': values.groups()[0]}) <NEW_LINE> parser.remaining = parser.remaining[values.end():]... | Inicio do Capitulo. | 62598fcc283ffb24f3cf3c57 |
class MaskExtract(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "mask.extraction" <NEW_LINE> bl_label = "Extract masked areas" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return context.active_object is not None and context.active_ob... | Decimate Masked Areas | 62598fccec188e330fdf8c67 |
class WebdriverBaseTest(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> @read_browser_config("padded_sel.json") <NEW_LINE> def setUpClass(cls, **kwargs): <NEW_LINE> <INDENT> logger.debug(kwargs) <NEW_LINE> cls.browser = Webdriver(**kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cl... | Base Test Class with support for creating and tearing down the browser object | 62598fccab23a570cc2d4f56 |
class TopologyAssociation(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'association_type': {'key': 'associationType', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, name: Optional[str] = None, resour... | Resources that have an association with the parent resource.
:param name: The name of the resource that is associated with the parent resource.
:type name: str
:param resource_id: The ID of the resource that is associated with the parent resource.
:type resource_id: str
:param association_type: The association type of... | 62598fcc63b5f9789fe85549 |
class SoftwareIsolationEmbedding(MessageRateEmbedding): <NEW_LINE> <INDENT> def __init__(self, vsdn, connector): <NEW_LINE> <INDENT> super(SoftwareIsolationEmbedding, self).__init__( vsdn=vsdn, connector=connector, logname='SoftwareIsolationEmbedding' ) <NEW_LINE> <DEDENT> def calculate_limit(self, entity, update=True)... | Concrete implementation of ``MessageRateEmbedding`` for software isolation
on a hypervisor node.
Args:
logger (logging.Logger): Logger object
vsdn (data.dbinterfaces.Vsdn): Object representing VSDN for
which ratelimit should be embedded
connector (data.dbinterfaces.StormConnector): Connector object... | 62598fcc377c676e912f6f60 |
class PortfolioParamsValidatorMixin(BaseParamsValidatorMixin): <NEW_LINE> <INDENT> pass | Mixin with validators for validate
request parameters. | 62598fcc5fcc89381b266335 |
class Average(object): <NEW_LINE> <INDENT> def __init__(self, set_size): <NEW_LINE> <INDENT> self.average = 0 <NEW_LINE> self.time = 0 <NEW_LINE> self.price = None <NEW_LINE> self.set_size = set_size <NEW_LINE> self.points = [] <NEW_LINE> <DEDENT> def update(self, point): <NEW_LINE> <INDENT> if len(self.points) < self.... | Attributes:
average -- the current average at a particular tick
time -- the current time tick for this average
set_size -- the subset size for this moving average
points -- the list of points currently part of the moving average | 62598fcc7b180e01f3e49238 |
class UnparsedEntryTests(TestCase, EntryTestsMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.entry = UnparsedEntry(" This is a bogus entry. \n") <NEW_LINE> <DEDENT> def test_fromString(self): <NEW_LINE> <INDENT> self.assertEqual(" This is a bogus entry. \n", self.entry._string) <NEW_LINE> ... | Tests for L{UnparsedEntry} | 62598fcc167d2b6e312b734a |
class Embedding(t.nn.Module): <NEW_LINE> <INDENT> def __init__(self, vocab_size=1000, embedding_size=512, padding_idx=0, max_length=2048, dropout=0.1, scale_word_embedding=True): <NEW_LINE> <INDENT> super(Embedding, self).__init__() <NEW_LINE> self.word_embedding = t.nn.Embedding(vocab_size, embedding_size, padding_idx... | combine word embedding and position embedding | 62598fcc851cf427c66b8685 |
class SchoolList(ListCreateAPIView): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication, BasicAuthentication, SessionAuthentication) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> queryset = School.objects.all() <NEW_LINE> serializer_class = SchoolSerializer | This endpoint Lists Schools with GET requests, and Creates a new School with POST request
By making a ``GET`` request you can list all the Schools. Each school has the following attributes
* **id** - The ID of the School (int)
* **name** - The NAME of the school (str)
* **community_name** - The Community Unit Name in... | 62598fcc3d592f4c4edbb286 |
class UnfulfilledPromiseSentinel: <NEW_LINE> <INDENT> def __init__(self, fulfillingJobName: str, file_id: str, unpickled: Any) -> None: <NEW_LINE> <INDENT> self.fulfillingJobName = fulfillingJobName <NEW_LINE> self.file_id = file_id <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __setstate__(stateDict: Dict[str, Any]... | This should be overwritten by a proper promised value.
Throws an exception when unpickled. | 62598fccec188e330fdf8c69 |
class DoubleTapCallback(PointerXYCallback): <NEW_LINE> <INDENT> on_events = ['doubletap'] | Returns the mouse x/y-position on doubletap event. | 62598fccadb09d7d5dc0a94e |
class FederalLobbying(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/InfluenceExplorer/FederalLobbying') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return FederalLobbyingInputSet() <NEW_LINE> <DEDENT>... | Create a new instance of the FederalLobbying Choreography. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 62598fcc4c3428357761a691 |
class CaseType: <NEW_LINE> <INDENT> THT = 'THT' <NEW_LINE> SMD = 'SMD' | A class for holding constants for part types
.. note:: will be changed to enum when Python version allows it | 62598fcc377c676e912f6f61 |
class ContactsUpdateAPIview(UpdateAPIView): <NEW_LINE> <INDENT> queryset = Contacts.objects.all() <NEW_LINE> serializer_class = ContactsSerializer <NEW_LINE> def perform_update(self, serializer): <NEW_LINE> <INDENT> serializer.save() | Handle the URL to update contacts | 62598fcc091ae35668704ffd |
class Player(): <NEW_LINE> <INDENT> def __init__(self,name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.alive = 1 | The player doesn't necessarily have to be human.
The bots can also use the player class. | 62598fcc656771135c489a44 |
class TotalsCommitteePage(object): <NEW_LINE> <INDENT> swagger_types = { 'pagination': 'OffsetInfo', 'results': 'list[TotalsCommittee]' } <NEW_LINE> attribute_map = { 'pagination': 'pagination', 'results': 'results' } <NEW_LINE> def __init__(self, pagination=None, results=None): <NEW_LINE> <INDENT> self._pagination = N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598fcc60cbc95b06364711 |
class CreateAccountsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.InstanceId = None <NEW_LINE> self.Accounts = None <NEW_LINE> self.Password = None <NEW_LINE> self.Description = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.InstanceId = para... | CreateAccounts request structure.
| 62598fcc8a349b6b43686613 |
class ImportExportModelAdmin(ImportExportMixin, admin.ModelAdmin): <NEW_LINE> <INDENT> pass | Subclass of ModelAdmin with import/export functionality. | 62598fcc167d2b6e312b734c |
class CfgTestCase(base.JbutlerTestCase): <NEW_LINE> <INDENT> def test_defaults(self): <NEW_LINE> <INDENT> config = cfg.JbutlerConfigParser() <NEW_LINE> self.assertEqual('jobs', config.jobdir) <NEW_LINE> self.assertEqual('templates', config.templatedir) <NEW_LINE> self.assertTrue(config.ssl_verify) <NEW_LINE> <DEDENT> d... | Test the cfg module of jbutler | 62598fcc5fc7496912d48461 |
class ModeManager( object ): <NEW_LINE> <INDENT> def __init__( self ): <NEW_LINE> <INDENT> self.modes = { '__quitting__': kQuittingMode } <NEW_LINE> self.current_mode = None <NEW_LINE> <DEDENT> def register_mode( self, mode_name, mode ): <NEW_LINE> <INDENT> assert mode_name not in self.modes <NEW_LINE> self.modes[ mode... | A class that manages switching between modes. | 62598fccff9c53063f51aa20 |
class ConnectFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, message=None): <NEW_LINE> <INDENT> if message is None: <NEW_LINE> <INDENT> self.header = "CONNECT" <NEW_LINE> self.message = {"header": self.header} <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> super(ConnectFrame, self).__init__(message) <NEW_LINE> <DED... | Connect frame sent by the client to the broker | 62598fcca219f33f346c6bde |
class Section: <NEW_LINE> <INDENT> def __init__( self, data: pnd.DataFrame, p1: Point, p2: Point, reverse: bool = False, z_adjustment: Union[None, float] = None ): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> self.p1, self.p2 = p1, p2 <NEW_LINE> self.projection = None <NEW_LINE> self.line = None <NEW_LINE> self.date... | A Section view of a set of x,y,z coordinates.
Parameters:
data (pandas.DataFrame) : contains the data to project.
p1 (shapely.Point) : the start of a line of section.
p2 (shapely.Point) : the end of a line of section.
reverse (bool) : reverse the order of points in the section.
z_adjustment (float)... | 62598fcc4c3428357761a693 |
class ArgumentParser(argparse.ArgumentParser): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.throw_errors = False <NEW_LINE> super(ArgumentParser, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def error(self, message): <NEW_LINE> <INDENT> if self.throw_errors: <NEW_LINE> <INDEN... | Derived argument parser that provides a flag for throwing exceptions
normally handled internally by argparse. | 62598fcc377c676e912f6f62 |
class RegistrationRequest(RequestBase): <NEW_LINE> <INDENT> challenge = models.ForeignKey( Challenge, help_text="To which project does the user want to register?", on_delete=models.CASCADE, ) <NEW_LINE> @property <NEW_LINE> def base_object(self): <NEW_LINE> <INDENT> return self.challenge <NEW_LINE> <DEDENT> @property <... | When a user wants to join a project, admins have the option of reviewing
each user before allowing or denying them. This class records the needed
info for that. | 62598fcc3346ee7daa337832 |
class Proudcer(threading.Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.headers = {'User-Agent': USER_AGENT[randrange(0, len(USER_AGENT))]} <NEW_LINE> self.session = requests.Session() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while not ... | URLs for RentHouse INPUT TO QUQUE | 62598fcc55399d3f056268ef |
class IgnoreMessage(ListeningSocketError): <NEW_LINE> <INDENT> pass | Signal that this message should be ignored | 62598fcc7b180e01f3e4923a |
class NutnrJCsppTelemeteredDriver(SimpleDatasetDriver): <NEW_LINE> <INDENT> def _build_parser(self, stream_handle): <NEW_LINE> <INDENT> parser_config = { DataSetDriverConfigKeys.PARTICLE_CLASSES_DICT: { METADATA_PARTICLE_CLASS_KEY: NutnrJCsppMetadataTelemeteredDataParticle, DATA_PARTICLE_CLASS_KEY: NutnrJCsppTelemetere... | The nutnr_j_cspp telemetered driver class extends the SimpleDatasetDriver. | 62598fcc50812a4eaa620dcf |
class InvestmentDeleteTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> create_user() <NEW_LINE> investment = create_investment() <NEW_LINE> self.valid_args = {"investment_id": investment.id} <NEW_LINE> self.valid_url = "/investments/delete/{}/".format(investment.id) <NEW_LINE> <DEDENT> def test_... | Tests for the delete investment view | 62598fccfbf16365ca794492 |
class AppCluster(object): <NEW_LINE> <INDENT> def __init__(self, name, uuid, state, type): <NEW_LINE> <INDENT> if not uuid or not name or not state: <NEW_LINE> <INDENT> __log__.error("Must provide the name, state, and uuid!") <NEW_LINE> return <NEW_LINE> <DEDENT> if not isinstance(type, AppClusterType): <NEW_LINE> <IND... | Model for application clusters. Typically, the UUID is provided by the environment.
:param str name: Name for the AppCluster.
:param str uuid: Unique identifier for the AppCluster.
:param str state: State of the AppCluster.
:param AppClusterType type: Type of AppCluster. | 62598fcca219f33f346c6be0 |
class Plugin (plugin.TransformPlugin): <NEW_LINE> <INDENT> id=__name__ <NEW_LINE> options = [ plugin.Option('oper', 'IRI/Qname of the operator to unnest', default="rif:And"), plugin.Option('prop', 'IRI/Qname of value property of that operator', default="rif:formula"), ] <NEW_LINE> def __init__(self, oper='rif:And', pro... | Rewrite so that and(a,and(b,c)) is just and(a,b,c), etc | 62598fccaad79263cf42eba5 |
class RekallAction(actions.ActionPlugin): <NEW_LINE> <INDENT> in_rdfvalue = rekall_types.RekallRequest <NEW_LINE> out_rdfvalues = [rekall_types.RekallResponse] <NEW_LINE> def Run(self, args): <NEW_LINE> <INDENT> session_args = args.session.ToDict() <NEW_LINE> if "filename" not in session_args and args.device: <NEW_LINE... | Runs a Rekall command on live memory. | 62598fcc55399d3f056268f1 |
class RequestHandler(pyjsonrpc.HttpRequestHandler): <NEW_LINE> <INDENT> @pyjsonrpc.rpcmethod <NEW_LINE> def getPreferenceForUser(self, user_id): <NEW_LINE> <INDENT> logger.debug("news_recommendation_service - getPreferenceForUser") <NEW_LINE> db = mongodb_client.get_db() <NEW_LINE> model = db[PREFERENCE_MODEL_TABLE_NAM... | Get user's preference in an ordered class list | 62598fcc091ae35668705001 |
class JsonSystemLoggerTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.logger = JsonSystemLogger() <NEW_LINE> <DEDENT> def test_exception(self): <NEW_LINE> <INDENT> self.assertIsNone(self.logger.exception("Exception")) <NEW_LINE> <DEDENT> def test_error(self): <NEW_LINE> <INDENT> s... | Tests for JsonSystemLogger.
| 62598fcc9f28863672818a68 |
class Array2D: <NEW_LINE> <INDENT> def __init__(self, num_rows, num_cols): <NEW_LINE> <INDENT> self.rows = Array(num_rows) <NEW_LINE> for i in range(num_rows): <NEW_LINE> <INDENT> self.rows[i] = Array(num_cols) <NEW_LINE> <DEDENT> <DEDENT> def num_rows(self): <NEW_LINE> <INDENT> return len(self.rows) <NEW_LINE> <DEDENT... | Implementation of the Array2D ADT using an array of arrays. | 62598fcc4527f215b58ea2a6 |
class DeclarativeColumnsMetaclass(type): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> attrs["_meta"] = opts = TableOptions(attrs.get("Meta", None)) <NEW_LINE> columns = [(name_, attrs.pop(name_)) for name_, column in attrs.items() if isinstance(column, Column)] <NEW_LINE> columns.sort(l... | Metaclass that converts Column attributes on the class to a dictionary
called ``base_columns``, taking into account parent class ``base_columns``
as well. | 62598fccad47b63b2c5a7c32 |
class ProductSaleType(models.Model): <NEW_LINE> <INDENT> _name = 'ilusiones.product.sale.type' <NEW_LINE> pay_day = fields.Integer(string='Dia de cobro') <NEW_LINE> sale_type = fields.Selection( selection=[ ('Prepago', 'Prepago'), ('Plan', 'Plan'), ('Activación', 'Activación') ], string='Tipo de venta' ) <NEW_LINE> sal... | ProductSaleType is a bundle of products.
Products on bundle depends of sale type.
Arguments:
models {Model} -- [Odoo Model]
Raises:
ValidationError -- [On fields constraints] | 62598fcc656771135c489a48 |
class FileServerServicer(binary_data_pb2_grpc.FileServerServicer): <NEW_LINE> <INDENT> def __init__(self, availible_server_space, database_filename): <NEW_LINE> <INDENT> self._DATABASE_FILENAME = database_filename <NEW_LINE> self._AVAILIBLE_SERVER_SPACE = availible_server_space <NEW_LINE> <DEDENT> def ValidateFileServe... | Interfaces exported by the server.
| 62598fcd97e22403b383b2df |
class TouristObjectUpdateView(UpdateView): <NEW_LINE> <INDENT> model = TouristObject <NEW_LINE> form_class = TouristObjectForm <NEW_LINE> template_name = 'places/edit.html' | Tourist object update view | 62598fcd0fa83653e46f52c0 |
class IntervalTimerExecutor(BaseTimerExecutor): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> pass | intverval timer executor TODO NOT IMPLEMENTED NOW | 62598fcd377c676e912f6f64 |
class ChinaBankMixin(object): <NEW_LINE> <INDENT> def _parse_table(self, zoom): <NEW_LINE> <INDENT> my_table = zoom.xpath("./table")[0] <NEW_LINE> trs = my_table.xpath("./tbody/tr") <NEW_LINE> table = [] <NEW_LINE> for tr in trs: <NEW_LINE> <INDENT> tr_line = [] <NEW_LINE> tds = tr.xpath("./td") <NEW_LINE> for td in td... | 适用于中国银行的数据解析混入类 | 62598fcdd8ef3951e32c8048 |
class ProposalModelAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = JobProposal | Admin table for SolarCalculator model. | 62598fcdadb09d7d5dc0a954 |
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ( 'userid', 'password', 'is_active', 'is_staff', 'is_superuser', 'best_way_to_find', 'best_way_to_contact', 'phone', 'email', 'teams', ) <NEW_LINE... | A form for updating users. Includes all the fields on
the user, but replaces the password field with admin's
password hash display field. | 62598fcdcc40096d6161a3c4 |
class MongoDb(Plugin, DebianPlugin, UbuntuPlugin): <NEW_LINE> <INDENT> plugin_name = 'mongodb' <NEW_LINE> profiles = ('services',) <NEW_LINE> packages = ('mongodb-server',) <NEW_LINE> var_puppet_gen = "/var/lib/config-data/puppet-generated/mongodb" <NEW_LINE> files = ( '/etc/mongodb.conf', var_puppet_gen + '/etc/mongod... | MongoDB document database
| 62598fcd60cbc95b06364717 |
class SellingPublisher: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._seller = None <NEW_LINE> self._name = name <NEW_LINE> self._topic = "{}.{}".format(WAMP_TOPIC_PREFIX, self._name) <NEW_LINE> self._api_id = UUID('627f1b5c-58c2-43b1-8422-a34f7d3f5a04').bytes <NEW_LINE> <DEDENT> async def on_... | Publisher that sells the data on the XBR market. | 62598fcd167d2b6e312b7352 |
class CampaignExperimentError(enum.IntEnum): <NEW_LINE> <INDENT> UNSPECIFIED = 0 <NEW_LINE> UNKNOWN = 1 <NEW_LINE> DUPLICATE_NAME = 2 <NEW_LINE> INVALID_TRANSITION = 3 <NEW_LINE> CANNOT_CREATE_EXPERIMENT_WITH_SHARED_BUDGET = 4 <NEW_LINE> CANNOT_CREATE_EXPERIMENT_FOR_REMOVED_BASE_CAMPAIGN = 5 <NEW_LINE> CANNOT_CREATE_EX... | Enum describing possible campaign experiment errors.
Attributes:
UNSPECIFIED (int): Enum unspecified.
UNKNOWN (int): The received error code is not known in this version.
DUPLICATE_NAME (int): An active campaign or experiment with this name already exists.
INVALID_TRANSITION (int): Experiment cannot be updated... | 62598fcdff9c53063f51aa26 |
class BasePyClock(Window): <NEW_LINE> <INDENT> def __init__(self, title, init_width=230, init_height=230): <NEW_LINE> <INDENT> super(BasePyClock, self).__init__() <NEW_LINE> self.set_title(title=title) <NEW_LINE> self.resize(width=init_width, height=init_height) <NEW_LINE> self.set_position(position=WIN_POS_CENTER) <NE... | Base class for PyClock. | 62598fcd3d592f4c4edbb28e |
class ByteArray(SimpleModel): <NEW_LINE> <INDENT> __type_name__ = 'base64Binary' <NEW_LINE> __namespace__ = "http://www.w3.org/2001/XMLSchema" <NEW_LINE> class Attributes(SimpleModel.Attributes): <NEW_LINE> <INDENT> encoding = BINARY_ENCODING_USE_DEFAULT <NEW_LINE> <DEDENT> def __new__(cls, **kwargs): <NEW_LINE> <INDEN... | Canonical container for arbitrary data. Every protocol has a different
way of encapsulating this type. E.g. xml-based protocols encode this as
base64, while HttpRpc just hands it over.
Its native python format is a sequence of ``str`` objects for Python 2.x
and a sequence of ``bytes`` objects for Python 3.x. | 62598fcd956e5f7376df586b |
class Motif(motifs.Motif, dict): <NEW_LINE> <INDENT> multiple_value_keys = set(['BF', 'OV', 'HP', 'BS', 'HC', 'DT', 'DR']) <NEW_LINE> reference_keys = set(['RX', 'RA', 'RT', 'RL']) | Store the information for one TRANSFAC motif.
This class inherits from the Bio.motifs.Motif base class, as well
as from a Python dictionary. All motif information found by the parser
is stored as attributes of the base class when possible; see the
Bio.motifs.Motif base class for a description of these attributes. All
... | 62598fcd7c178a314d78d87a |
class Test_capture_output(unittest.TestCase): <NEW_LINE> <INDENT> def test_std_out(self): <NEW_LINE> <INDENT> with dcs.capture_output() as (out, err): <NEW_LINE> <INDENT> print('Hello, World!') <NEW_LINE> <DEDENT> output = out.getvalue().strip() <NEW_LINE> error = err.getvalue().strip() <NEW_LINE> self.assertEqual(out... | Tests the capture_output function with these cases:
capture standard output
capture standard error | 62598fcda219f33f346c6be4 |
class ServiceProvider(object): <NEW_LINE> <INDENT> def __init__(self, infoset): <NEW_LINE> <INDENT> self._root = infoset <NEW_LINE> self.name = testXMLValue(self._root.find(nspath("Name"))) <NEW_LINE> self.url = testXMLValue(self._root.find(nspath("OnlineResource"))) <NEW_LINE> self.keywords = extract_xml_list(self._ro... | Implements IServiceProviderMetatdata | 62598fcdd8ef3951e32c8049 |
class ModlidadForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Modlidad | docstring for ModlidadForm | 62598fcdab23a570cc2d4f5b |
class ProductBySubCategoryView(generics.ListAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.ProductSerializer <NEW_LINE> lookup_field = 'subcategory_id' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = models.Product.objects.filter(subcategory_id=self.kwargs['subcategory_id']) <NEW_LINE> r... | List all products with category and subcategories by subcategory. | 62598fcdad47b63b2c5a7c36 |
class CouldNotRestartSplunk(CommandExecutionFailure): <NEW_LINE> <INDENT> pass | Raised when a Splunk restart fails. | 62598fcdf9cc0f698b1c54c2 |
class AbstractProductClass(models.Model): <NEW_LINE> <INDENT> name = models.CharField(_('Name'), max_length=128) <NEW_LINE> slug = AutoSlugField(_('Slug'), max_length=128, unique=True, populate_from='name') <NEW_LINE> requires_shipping = models.BooleanField(_("Requires shipping?"), default=True) <NEW_LINE> track_stock ... | Used for defining options and attributes for a subset of products.
E.g. Books, DVDs and Toys. A product can only belong to one product class.
At least one product class must be created when setting up a new
Oscar deployment.
Not necessarily equivalent to top-level categories but usually will be. | 62598fcd377c676e912f6f66 |
class QueueFactory(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.__counter = 0 <NEW_LINE> self.__names = [] <NEW_LINE> self.q = Queue.Queue() <NEW_LINE> <DEDENT> def _makeMethod(self, constant, methodName, argc): <NEW_LINE> <INDENT> def __method(*args): <NEW... | Constructs a new object wrapping a Queue.Queue, complete with constants
and sending functions for each type of message that can be put into the
queue.
Creating a new object using this class is done like so:
q = QueueFactory("progress")
And then adding messages to it is done like so:
q.addMessage("init", 0)
... | 62598fcdbe7bc26dc9252048 |
class BaseFileInfo(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def filename(self): <NEW_LINE> <INDENT> raise NotImplementedError('This property must be implemented in a subclass!') <NEW_LINE> <DEDENT> @property <NEW_LINE> def extension(self): <NEW_LINE> <INDENT> return self.filename.rsplit('.', 1)[-1].lower() <NE... | Base class for gathering data about an
object that represents a file. | 62598fcd5fcc89381b26633b |
class Identifier: <NEW_LINE> <INDENT> pattern: str <NEW_LINE> target: str <NEW_LINE> def __init__(self, identifiers_config): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.pattern = identifiers_config["pattern"] <NEW_LINE> self.target = identifiers_config["target"] <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> pri... | A helper class: Given a booking's target field and a pattern this class determines a match | 62598fcd656771135c489a4e |
class Material(models.Model): <NEW_LINE> <INDENT> data = models.TextField('Данные') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Материал' <NEW_LINE> verbose_name_plural = 'Материалы' | Материалы для калькулятора | 62598fcdcc40096d6161a3c6 |
class Module: <NEW_LINE> <INDENT> def __init__(self, *args1, **args2): <NEW_LINE> <INDENT> self.modules = [] <NEW_LINE> for i in args1: <NEW_LINE> <INDENT> self.load(i) <NEW_LINE> <DEDENT> for i, j in args2.items(): <NEW_LINE> <INDENT> self.load(i, **j) <NEW_LINE> <DEDENT> <DEDENT> def load(self, module, **args): <NEW_... | This class is used to load/unload plugins.
It calls functions which are defined inside the plugin files
according to their names. These name functions correspond to irc
event commands. | 62598fcd97e22403b383b2e5 |
class PrognosticGroupStage8(_CaseInsensitiveEnum): <NEW_LINE> <INDENT> zero = '0' <NEW_LINE> ia = 'IA' <NEW_LINE> ib = 'IB' <NEW_LINE> iia = 'IIA' <NEW_LINE> iib = 'IIB' <NEW_LINE> iiia = 'IIIA' <NEW_LINE> iiic = 'IIIC' <NEW_LINE> iv = 'IV' <NEW_LINE> unknown = 'Unknown' | American Joint Committee on Cance (AJCC) edition 8's prognostic group stage | 62598fcd4c3428357761a69d |
class KeywordQueryEventListener(EventListener): <NEW_LINE> <INDENT> def on_event(self, event, extension): <NEW_LINE> <INDENT> items = [] <NEW_LINE> if event.get_argument(): <NEW_LINE> <INDENT> pw_length = int(event.get_argument()) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> pw_length = int(extension.preferences['pw_l... | Class that listens to the Keyboard event | 62598fcd0fa83653e46f52c6 |
class ModulesConfig(BaseConfig): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> super(ModulesConfig, self).__init__(data) <NEW_LINE> python_requires = data.get('python_requires', MISSING) <NEW_LINE> if python_requires == MISSING: <NEW_LINE> <INDENT> raise KeyError('python_requires is required') <NEW_... | Configuration for modules. | 62598fcd091ae35668705009 |
class BackupsCollectionResource(resource.BaseResource): <NEW_LINE> <INDENT> def __init__(self, storage_driver): <NEW_LINE> <INDENT> self.db = storage_driver <NEW_LINE> <DEDENT> @policy.enforce('backups:get_all') <NEW_LINE> def on_get(self, req, resp, project_id): <NEW_LINE> <INDENT> user_id = req.get_header('X-User-ID'... | Handler for endpoint: /v2/{project_id}/backups | 62598fcdbf627c535bcb188a |
class LogLorentz1D(Fittable1DModel): <NEW_LINE> <INDENT> amplitude = Parameter(default=1) <NEW_LINE> log_x_0 = Parameter(default=0) <NEW_LINE> fwhm = Parameter(default=1) <NEW_LINE> @staticmethod <NEW_LINE> def evaluate(x, amplitude, log_x_0, fwhm): <NEW_LINE> <INDENT> return (amplitude * ((fwhm / 2.) ** 2) / ((np.log(... | One dimensional log-Lorentzian model.
Parameters
----------
amplitude : float
Peak value
log_x_0 : float
Position of the peak in log space.
fwhm : float
Full width at half maximum
See Also
--------
Gaussian1D, Box1D, RickerWavelet1D
Notes
-----
Model formula:
.. math::
f(x) = \frac{A \gamma^{2}}{\g... | 62598fcd71ff763f4b5e7b60 |
class IsType(Validator): <NEW_LINE> <INDENT> no_type = 'Type does not exist.' <NEW_LINE> no_subtype = 'Type is not a descendant type of {parent}' <NEW_LINE> def __init__(self, parent: str = None) -> None: <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> <DEDENT> def _repr_args(self): <NEW_LINE> <INDENT> return 'pare... | Validator which succeeds if the value it is passed is a registered
resource type.
:param parent: If set, type must be a subtype of such resource.
By default accept any resource. | 62598fcdd8ef3951e32c804b |
class ProxyServerPage(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{F66C99F8-D7C0-43C6-88C7-DC15435C5321}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C0FC1503-7E6F-11D2-AABF-00C04FA375F1}', 10, 2) | Esri Proxy Server property page. | 62598fcddc8b845886d5399c |
class InvalidJSONfile(Exception): <NEW_LINE> <INDENT> def __init__(self, fName): <NEW_LINE> <INDENT> self.msg = "Skipping simulation for {}\n".format(fName) | Raised when the json file fed to the program has problems | 62598fcdadb09d7d5dc0a95a |
class Deck: <NEW_LINE> <INDENT> def __init__(self, seed=42): <NEW_LINE> <INDENT> random.seed(seed) <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def shuffle(self, reset=False): <NEW_LINE> <INDENT> if reset: <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> n = self.countCards() <NEW_LINE> if n > 1: <NEW_LINE> <INDENT>... | A class to represent a deck of 52 poker-style playing cards. | 62598fcd3d592f4c4edbb294 |
class Url(StringMixin, Raw): <NEW_LINE> <INDENT> def __init__(self, endpoint=None, absolute=False, scheme=None, **kwargs): <NEW_LINE> <INDENT> super(Url, self).__init__(**kwargs) <NEW_LINE> self.endpoint = endpoint <NEW_LINE> self.absolute = absolute <NEW_LINE> self.scheme = scheme <NEW_LINE> <DEDENT> def output(self, ... | A string representation of a Url
:param str endpoint: Endpoint name. If endpoint is ``None``, ``request.endpoint`` is used instead
:param bool absolute: If ``True``, ensures that the generated urls will have the hostname included
:param str scheme: URL scheme specifier (e.g. ``http``, ``https``) | 62598fcdf9cc0f698b1c54c4 |
class Feedback (object): <NEW_LINE> <INDENT> def __init__ (self, error="", success="", status=None): <NEW_LINE> <INDENT> self.error = error <NEW_LINE> self.success = success <NEW_LINE> self.status = status <NEW_LINE> <DEDENT> def __str__ (self): <NEW_LINE> <INDENT> return render_template('interface.html', ... | provides some basic functions for rendering the html template.
basically error and success message are set in __init__().
__str__() returns the rendered template including error and
success message(s) | 62598fcd0fa83653e46f52c8 |
class EducationLevelApiTestCase(NamedModelApiTestCase): <NEW_LINE> <INDENT> factory_class = factories.EducationLevelModelFactory <NEW_LINE> model_class = models.EducationLevel <NEW_LINE> serializer_class = serializers.EducationLevelSerializer <NEW_LINE> url_detail = "education-level-detail" <NEW_LINE> url_list = "educa... | EducationLevel API unit test class. | 62598fcdec188e330fdf8c77 |
class StorageHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.containers = list() <NEW_LINE> <DEDENT> def attachContainer(self, container): <NEW_LINE> <INDENT> self.containers.append(container) <NEW_LINE> <DEDENT> def detachContainer(self, container): <NEW_LINE> <INDENT> matches = [] <N... | Base class. Children take care of specific ``StorageContainer``s.
Handlers for "ephemeral/volatile" containers may not need take care of
closing them down. This is needed for persistent storage handlers, though.
Children should minimally implement
* attachContainer()
* detachContainer()
* close() | 62598fcd4527f215b58ea2b0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.