code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class AppErr(Exception): <NEW_LINE> <INDENT> pass | An exception for all application errors. | 625990410fa83653e46f617f |
class PathError(FileSysObjectsError): <NEW_LINE> <INDENT> pass | Path error. | 62599041b57a9660fecd2d20 |
class DurationEdit(QtWidgets.QFormLayout): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.hours_widget = QtWidgets.QSpinBox() <NEW_LINE> self.addRow("Hours", self.hours_widget) <NEW_LINE> self.minutes_widget = QtWidgets.QSpinBox() <NEW_LINE... | A widget to allow editing an hours minute seconds duration. | 6259904121bff66bcd723f0f |
class OUNoise: <NEW_LINE> <INDENT> def __init__( self, size: int, mu: float = 0.0, theta: float = 0.15, sigma: float = 0.2 ): <NEW_LINE> <INDENT> self.state = np.float64(0.0) <NEW_LINE> self.mu = mu * np.ones(size) <NEW_LINE> self.theta = theta <NEW_LINE> self.sigma = sigma <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> d... | Ornstein-Uhlenbeck process.
Taken from Udacity deep-reinforcement-learning github repository:
https://github.com/udacity/deep-reinforcement-learning/blob/master/
ddpg-pendulum/ddpg_agent.py | 625990411f5feb6acb163e98 |
class LongGapAGNMetric(BaseMetric): <NEW_LINE> <INDENT> def __init__(self, metricName='longGapAGNMetric', mjdcol='observationStartMJD', units='days', xgaps=10, badval=-666, **kwargs): <NEW_LINE> <INDENT> cols = [mjdcol] <NEW_LINE> super(LongGapAGNMetric, self).__init__(cols, metricName, units=units, **kwargs) <NEW_LINE... | max delta-t and average of the top-10 longest gaps.
| 6259904130c21e258be99ab2 |
class FuelTypes (models.Model): <NEW_LINE> <INDENT> class Meta (object): <NEW_LINE> <INDENT> db_table = 'fuel_types' <NEW_LINE> <DEDENT> id = models.AutoField (primary_key = True) <NEW_LINE> name = models.CharField (max_length = 30, null = False) <NEW_LINE> comment = models.CharField (max_length = 100) <NEW_LIN... | Типы топлива | 6259904124f1403a9268621f |
class EdgeError(GraphError): <NEW_LINE> <INDENT> def __init__(self, edge): <NEW_LINE> <INDENT> self.edge = edge | Consider raising any child of :class:`EdgeError` instead. | 625990418da39b475be04493 |
class Binding(object): <NEW_LINE> <INDENT> def __init__(self, variable, constant): <NEW_LINE> <INDENT> super(Binding, self).__init__() <NEW_LINE> self.variable = variable <NEW_LINE> self.constant = constant <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Binding({!r}, {!r})'.format(self.variable, se... | Represents a binding of a constant to a variable, e.g. 'Nosliw' might be
bound to'?d'
Attributes:
variable (Variable): The name of the variable associated with this binding
constant (Constant): The value of the variable | 6259904123e79379d538d7a4 |
class GetAccountInfoResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'request_id': 'str', 'took': 'float', 'data': 'AccountInfo' } <NEW_LINE> attribute_map = { 'request_id': 'requestId', 'took': 'took', 'data': 'data' } <NEW_LINE> def __init__(self, request_id=None, took=0.0, data=None): <NEW_LINE> <INDENT> self... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259904107f4c71912bb06d7 |
class StdOut: <NEW_LINE> <INDENT> def __init__(self, stream, modulenames): <NEW_LINE> <INDENT> self.stdout = stream <NEW_LINE> self.modulenames = modulenames <NEW_LINE> <DEDENT> def __getattr__(self, attribute): <NEW_LINE> <INDENT> if attribute not in self.__dict__ or attribute == '__doc__': <NEW_LINE> <INDENT> return ... | Filter stdout or stderr from specific modules
So far this is just used for pkg_resources | 62599041d164cc617582221c |
class Region(MPTTModel): <NEW_LINE> <INDENT> parent = TreeForeignKey( to='self', on_delete=models.CASCADE, related_name='children', blank=True, null=True, db_index=True ) <NEW_LINE> name = models.CharField( max_length=50, unique=True ) <NEW_LINE> slug = models.SlugField( unique=True ) <NEW_LINE> class MPTTMeta: <NEW_LI... | Country/Regin/City where place location. Every instance of this class can be parent for the other one | 625990414e696a045264e774 |
class GetVideoByReadableIDResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((json) The response from Khan Academy.) | 62599041b5575c28eb71361c |
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> alpha = float("-inf") <NEW_LINE> beta = float("inf") <NEW_LINE> def max_value(gameState, depth, alpha, beta): <NEW_LINE> <INDENT> actions = gameState.getLegalActions(0) <NEW_LINE> if not actions or depth... | Your minimax agent with alpha-beta pruning (question 3) | 6259904163b5f9789fe86411 |
class KMP: <NEW_LINE> <INDENT> def __init__(self,pattern,text): <NEW_LINE> <INDENT> self.pattern = pattern <NEW_LINE> self.text = text <NEW_LINE> self._prefix = [] <NEW_LINE> <DEDENT> def build_prefix(self): <NEW_LINE> <INDENT> pattern = self.pattern <NEW_LINE> m = len(pattern) <NEW_LINE> p = [None]*m <NEW_LINE> p[0] =... | KMP(text,pattern) -> find all pattern matches in text
Atributes:
text Text
pattern Pattern
prefix Prefix function for pattern | 6259904123849d37ff852360 |
class SleepIQData(object): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self.beds = {} <NEW_LINE> self.update() <NEW_LINE> <DEDENT> @Throttle(MIN_TIME_BETWEEN_UPDATES) <NEW_LINE> def update(self): <NEW_LINE> <INDENT> self._client.login() <NEW_LINE> beds = self._cl... | Gets the latest data from SleepIQ. | 62599041507cdc57c63a6042 |
class HelperTests(TestCase): <NEW_LINE> <INDENT> skip = cryptSkip or dependencySkip <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.mockos = MockOS() <NEW_LINE> <DEDENT> def test_verifyCryptedPassword(self): <NEW_LINE> <INDENT> password = 'secret string' <NEW_LINE> salt = 'salty' <NEW_LINE> crypted = crypt.crypt(p... | Tests for helper functions L{verifyCryptedPassword}, L{_pwdGetByName} and
L{_shadowGetByName}. | 625990411d351010ab8f4dc4 |
class TemporaryFilter(QObject): <NEW_LINE> <INDENT> def __init__(self, filepath): <NEW_LINE> <INDENT> super(TemporaryFilter, self).__init__() <NEW_LINE> filepath = os.path.abspath(filepath) <NEW_LINE> if not os.path.isfile(filepath): <NEW_LINE> <INDENT> raise IOError("Assertion Error: os.path.isfile(filepath)") <NEW_LI... | Temporary event filter installed at qApp to catch events
while executing QDialog::exec.
The filter automatically clicks &Import button,
and automatically selects file by using native ui hooks. | 62599041cad5886f8bdc59d0 |
class NotInstalled(PloneSite): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUp(cls): <NEW_LINE> <INDENT> fiveconfigure.debug_mode = True <NEW_LINE> import quintagroup.captcha.core <NEW_LINE> import quintagroup.plonecaptchas <NEW_LINE> zcml.load_config('configure.zcml', quintagroup.captcha.core) <NEW_LINE> zcml.lo... | Only package register, without installation into portal
| 6259904129b78933be26aa16 |
class VcsCfg(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.b_key = "vcs-cfg" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.vcs_status = "" <NEW_LINE> for keys, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self,keys, value) | This class does not support CRUD Operations please use parent.
:param vcs_status: {"default": 0, "type": "number", "description": "Display VCS status in prompt, eg. vMaster, vBlade", "format": "flag"}
:param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py` | 6259904123e79379d538d7a5 |
class LSTMEncoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_features, hidden_size: int = 200, batch_first: bool = True, bidirectional: bool = True): <NEW_LINE> <INDENT> super(LSTMEncoder, self).__init__() <NEW_LINE> self.lstm = nn.LSTM(in_features, hidden_size, batch_first=batch_first, bidirectional=bidirec... | This module encodes a sequence into a single vector using an LSTM. | 6259904126068e7796d4dbed |
class EventCRCError(Exception): <NEW_LINE> <INDENT> pass | Error for when a event hass a mismatched CRC. | 6259904115baa72349463238 |
class ClusterModule(MultyvacModule): <NEW_LINE> <INDENT> def get(self, id): <NEW_LINE> <INDENT> r = self.multyvac._ask(Multyvac._ASK_GET, '/cluster/%s' % id) <NEW_LINE> c = r['cluster'] <NEW_LINE> if c['requested_at']: <NEW_LINE> <INDENT> c['requested_at'] = MultyvacModule.convert_str_to_datetime(c['requested_at']) <NE... | Top-level Cluster module. Use this through ``multyvac.cluster``. | 62599041a79ad1619776b326 |
class LoanRequestForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = LoanRequest <NEW_LINE> fields = ['dni', 'first_name', 'last_name', 'email', 'gender', 'loan_amount'] <NEW_LINE> <DEDENT> def clean(self): <NEW_LINE> <INDENT> cleaned_data = super(LoanRequestForm, self).clean() <NEW_LINE> email... | Loan request form. | 6259904130c21e258be99ab4 |
class Bundle(FileWrapperMixin): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def from_file(file_obj): <NEW_LINE> <INDENT> if not isinstance(file_obj, File): <NEW_LINE> <INDENT> file_obj = File(file_obj, binary=False) <NEW_LINE> <DEDENT> return Bundle(file_obj) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def fromFile(f... | Represents murano bundle contents. | 62599041d99f1b3c44d06944 |
class OperationParametersWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(OperationParametersWidget, self).__init__(parent=parent) <NEW_LINE> <DEDENT> @property <NEW_LINE> def params(self): <NEW_LINE> <INDENT> return {} | A base class for widgets that specify operation parameters. | 62599041baa26c4b54d50550 |
class GoogleActionsSyncView(OpenPeerPowerView): <NEW_LINE> <INDENT> url = "/api/cloud/google_actions/sync" <NEW_LINE> name = "api:cloud:google_actions/sync" <NEW_LINE> @_handle_cloud_errors <NEW_LINE> async def post(self, request): <NEW_LINE> <INDENT> opp = request.app["opp"] <NEW_LINE> cloud: Cloud = opp.data[DOMAIN] ... | Trigger a Google Actions Smart Home Sync. | 6259904115baa72349463239 |
class AuditEvent(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = jobs_pb2.AuditEvent <NEW_LINE> rdf_deps = [ rdfvalue.RDFDatetime, rdfvalue.RDFURN, ] <NEW_LINE> def __init__(self, initializer=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(initializer=initializer, **kwargs) <NEW_LINE> if not self.id: ... | An RDF wrapper for the `AuditEvent` protobuf. | 625990416fece00bbacccc58 |
class SpecialMixerComponent(MixerComponent): <NEW_LINE> <INDENT> def _create_strip(self): <NEW_LINE> <INDENT> return SelectChanStripComponent() | Class encompassing several selecting channel strips to form a mixer | 62599041097d151d1a2c230f |
class CXRDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, image_dir, mask_dir,type="train",split_ratio=0.2, transform=None): <NEW_LINE> <INDENT> self.image_dir = image_dir <NEW_LINE> self.mask_dir = mask_dir <NEW_LINE> self.transform = transform <NEW_LINE> self.masks = os.listdir(mask_dir) <NEW_LINE> if type=="... | CAUTON: Some masks of the images from img_dir are missing. Hence, only processing those images whose masks are available | 62599041d99f1b3c44d06945 |
class I4pProfile(UserenaLanguageBaseProfile, AskbotBaseProfile): <NEW_LINE> <INDENT> GENDER_TYPE = ( ('M', _('male')), ('F', _('female')) ) <NEW_LINE> user = models.ForeignKey(User, related_name='profile') <NEW_LINE> gender = models.CharField(max_length=1, choices=GENDER_TYPE, null=True, blank=True) <NEW_LINE> motto = ... | Userena Profile with language switch | 6259904196565a6dacd2d8de |
class DrilldownExecutionTest(unittest.TestCase): <NEW_LINE> <INDENT> dir_path = os.path.dirname(os.path.realpath(__file__)) <NEW_LINE> with open("./cpi/events/power8.yaml") as f: <NEW_LINE> <INDENT> clean_output = [] <NEW_LINE> events_list = f.read().replace(" ", "").splitlines() <NEW_LINE> for event in events_list: <N... | Class to test drilldown execution | 625990413c8af77a43b68890 |
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class Level(): <NEW_LINE> <INDENT> def __init__(self, country_id=0): <NEW_LINE> <INDENT> self.product = self.factory_method() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def factory_method(self): <NEW_LINE> <INDENT> pass | Declare the factory method, which returns an object of type Product.
Creator may also define a default implementation of the factory
method that returns a default ConcreteProduct object.
Call the factory method to create a Product object. | 6259904163b5f9789fe86413 |
class Station(Producer): <NEW_LINE> <INDENT> key_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_key.json") <NEW_LINE> value_schema = avro.load(f"{Path(__file__).parents[0]}/schemas/arrival_value.json") <NEW_LINE> def __init__(self, station_id, name, color, direction_a=None, direction_b=None): <NEW_LIN... | Defines a single station | 6259904123849d37ff852362 |
class StaticShipsProvider(ShipsProvider): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> ShipsProvider.__init__(self, config) <NEW_LINE> self._ships = dict( (k, entities.Ship( k, ip=v['ip'], endpoint=v.get('endpoint'), docker_port=self._from_ship_or_defaults(v, 'docker_port'), socket_path=self._fro... | Static ship provider.
Provides a set of ships defined by static configuration in the 'ships' YAML
map. This is the default provider and most commonly used. It is also the
original way of defining ships in Maestro. | 625990416e29344779b018fa |
class MeraMusicalEntity(MusicalEntity): <NEW_LINE> <INDENT> def __init__(self, labelled_canonical): <NEW_LINE> <INDENT> if TYPE_SET not in self.__dict__: <NEW_LINE> <INDENT> self.__dict__[TYPE_SET] = set() <NEW_LINE> <DEDENT> if MeraMusicalEntity not in self.__dict__[TYPE_SET]: <NEW_LINE> <INDENT> self.__dict__[TYPE_SE... | Abstract. Every musical entity should inherit from this in order to have a canonical name and source | 6259904176d4e153a661dbc8 |
class MultitenantOrgFilter(admin.RelatedFieldListFilter): <NEW_LINE> <INDENT> multitenant_lookup = 'pk__in' <NEW_LINE> def field_choices(self, field, request, model_admin): <NEW_LINE> <INDENT> if request.user.is_superuser: <NEW_LINE> <INDENT> return super(MultitenantOrgFilter, self).field_choices(field, request, model_... | Admin filter that shows only organizations the current
user is associated with in its available choices | 62599041cad5886f8bdc59d1 |
class SimpleTextQuestionViewReviewer(QuestionViewReviewer): <NEW_LINE> <INDENT> name = 'simple_text_question' <NEW_LINE> template_name = 'revisor/simple_text_question.html' | SimpleTextQuestionViewReviewer class represents the implementation of the reviewer view for a question object
This view is built to be extended from the different question types of the Derb system
By itself, this view shows the simple question created by the template administrator, including
the question text and help ... | 6259904129b78933be26aa17 |
class RunMessage(Base): <NEW_LINE> <INDENT> __tablename__ = 'run_log' <NEW_LINE> run_id = Column( String(32), ForeignKey('workflow_run.run_id'), primary_key=True ) <NEW_LINE> pos = Column(Integer, primary_key=True) <NEW_LINE> message = Column(Text, nullable=False) <NEW_LINE> run = relationship('RunObject', back_populat... | Log for messages created by workflow runs. Primarily used for error
messages by now. | 6259904123e79379d538d7a7 |
@pytest.mark.ckan_config("ckan.plugins", "example_iresourcecontroller") <NEW_LINE> @pytest.mark.usefixtures("clean_db", "with_plugins", "with_request_context") <NEW_LINE> class TestExampleIResourceController(object): <NEW_LINE> <INDENT> def test_resource_controller_plugin_create(self): <NEW_LINE> <INDENT> user = factor... | Tests for the plugin that uses IResourceController.
| 6259904126068e7796d4dbef |
class Update: <NEW_LINE> <INDENT> __slots__ = ["_dev", "id", "name", "grp", "_fullname", "_sigs", "_func", "_ext_args", "_logger", "_old"] <NEW_LINE> def __init__(self, dev, id_, name, sigs, func, ext_args=None, grp=""): <NEW_LINE> <INDENT> self._dev = dev <NEW_LINE> self.id = id_ <NEW_LINE> self.name = name <NEW_LINE>... | Update is the type of operation executed on node to display the result on
control. | 62599041a79ad1619776b328 |
class SparseFaceReaderAdapter: <NEW_LINE> <INDENT> sparse_reader: SparseFaceReader <NEW_LINE> def __init__(self, sparse_reader: SparseFaceReader): <NEW_LINE> <INDENT> self.sparse_reader = sparse_reader <NEW_LINE> <DEDENT> def __iter__(self) -> Iterator[Dict[str, List[Any]]]: <NEW_LINE> <INDENT> return self.iter_from(0)... | Adapts a sparse face embedding dump to behave like a dense one.
Warning: the resulting iterator is infinite. | 625990418a43f66fc4bf343a |
class Mutation(graphene.ObjectType): <NEW_LINE> <INDENT> send_model = SendModels.Field() | Root mutation. | 6259904166673b3332c316a2 |
class DescriptorError(SqlAlchemyMediaException): <NEW_LINE> <INDENT> pass | A sub-class instance of this exception may raised when an error has
occurred in :class:`.BaseDescriptor` and it's subtypes. | 62599041b830903b9686edce |
class UserRoleDetail(generics.GenericAPIView): <NEW_LINE> <INDENT> permission_classes = (IsOwnerOrReadOnly,) <NEW_LINE> def get_user_role_object(self, role_id): <NEW_LINE> <INDENT> return Role.get_object(pk=role_id) <NEW_LINE> <DEDENT> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> form = UserRoleDetailF... | 用户角色详情 | 6259904116aa5153ce401796 |
class PersistentLocalsFunction(object): <NEW_LINE> <INDENT> def __init__(self, func): <NEW_LINE> <INDENT> self._locals = {} <NEW_LINE> self._func = new.instancemethod(func, self, PersistentLocalsFunction) <NEW_LINE> signature = inspect.getargspec(func) <NEW_LINE> signature[0].pop(0) <NEW_LINE> signature = inspect.forma... | Wrapper class for the 'persistent_locals' decorator.
Refer to the docstring of instances for help about the wrapped
function. | 62599041d99f1b3c44d06947 |
@blueprint.route('/<dataset:dataset>/resources/new/upload', endpoint='upload_new_resource') <NEW_LINE> class UploadNewResourceView(ProtectedDatasetView, UploadNewResource): <NEW_LINE> <INDENT> pass | Handle upload on POST if authorized. | 62599041379a373c97d9a2d3 |
@tag('rate-limit-note') <NEW_LINE> class TestNoteViewRateLimit(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> new_project = Project(gitlab_id=747) <NEW_LINE> new_project.save() <NEW_LINE> new_user = UserIdentifier.objects.create( user_identifier = 'duo-atlas-hypnotism-curry-creatable-rubble' ) <NEW... | Test the ratelimiting for NoteCreateView. | 6259904176d4e153a661dbc9 |
class CoreThread(util.KegbotThread): <NEW_LINE> <INDENT> def __init__(self, kb_env, name): <NEW_LINE> <INDENT> util.KegbotThread.__init__(self, name) <NEW_LINE> self._kb_env = kb_env <NEW_LINE> <DEDENT> def PostEvent(self, event): <NEW_LINE> <INDENT> if isinstance(event, kbevent.QuitEvent): <NEW_LINE> <INDENT> self._lo... | Convenience wrapper around a threading.Thread | 6259904115baa7234946323c |
class SCDOM_RESULT(enum.IntEnum): <NEW_LINE> <INDENT> SCDOM_OK = 0 <NEW_LINE> SCDOM_INVALID_HWND = 1 <NEW_LINE> SCDOM_INVALID_HANDLE = 2 <NEW_LINE> SCDOM_PASSIVE_HANDLE = 3 <NEW_LINE> SCDOM_INVALID_PARAMETER = 4 <NEW_LINE> SCDOM_OPERATION_FAILED = 5 <NEW_LINE> SCDOM_OK_NOT_HANDLED = (-1) | Result value for Sciter DOM functions. | 62599041711fe17d825e15f2 |
class ProtocolHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._handlers = dict() <NEW_LINE> self._handlers['PULL-DOC-REQ'] = ServerSession.pull <NEW_LINE> self._handlers['PUSH-DOC'] = ServerSession.push <NEW_LINE> self._handlers['PATCH-DOC'] = ServerSession.patch <NEW_LINE> self._handl... | A Bokeh server may be expected to receive any of the following protocol
messages:
* ``EVENT``
* ``PATCH-DOC``
* ``PULL-DOC-REQ``
* ``PUSH-DOC``
* ``SERVER-INFO-REQ``
The job of ``ProtocolHandler`` is to direct incoming messages to the right
specialized handler for each message type. When the server receives a new
mes... | 62599041d53ae8145f919708 |
class UserGameProfile(models.Model): <NEW_LINE> <INDENT> game = models.ForeignKey(GameDetail) <NEW_LINE> game_user_name = models.CharField(max_length=100) <NEW_LINE> user = models.ForeignKey(UserProfile, related_name="games") <NEW_LINE> region = models.CharField(max_length=10) <NEW_LINE> external_user_id = models.Integ... | Used to bind the user profile to each game the user participates in.
Related name field is for the serializers to relate back to there and get the list of all the games a user has. | 625990414e696a045264e777 |
class WorkingCopy(BaseWorkingCopy): <NEW_LINE> <INDENT> DIRECTORY = '.mockvcs' <NEW_LINE> def lock(self, path): <NEW_LINE> <INDENT> log.info("simulated lock on: {}...".format(path)) <NEW_LINE> <DEDENT> def save(self, message=None): <NEW_LINE> <INDENT> log.info("simulated save") <NEW_LINE> <DEDENT> @property <NEW_LINE> ... | Simulated working copy. | 62599041b5575c28eb71361f |
class DeleteTokenView(View): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def post(request): <NEW_LINE> <INDENT> token_id = json.loads(request.body).get("id", None) <NEW_LINE> if not token_id or not GeyeTokenModel.instance.is_exist(token_id): <NEW_LINE> <INDENT> return JsonResponse({"code": 1004, "message": "token id不存... | 删除某条token | 6259904196565a6dacd2d8e0 |
class ConsoleFormatter(logging.Formatter): <NEW_LINE> <INDENT> date_format = "%H:%M:%S" <NEW_LINE> default_format = "%(asctime)s [%(levelname)s] %(msg)s" <NEW_LINE> info_format = "%(msg)s" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(fmt=ConsoleFormatter.default_format, datefmt=ConsoleFormatter.d... | კლასით განვსაზღვრავთ ტერმინალში გამოტანილი მესიჯის ფორმატს. | 6259904163b5f9789fe86417 |
class PlayfieldView(GridLayout): <NEW_LINE> <INDENT> def __init__(self, game, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.game = game <NEW_LINE> self.cols = game.columns <NEW_LINE> self.spacing = ['1dp'] <NEW_LINE> for row in range(game.rows-1, -1, -1): <NEW_LINE> <INDENT> for column in ra... | This is a view into the game's Playfield.
Rows and columns are counted from 0. | 625990411d351010ab8f4dca |
class Future(threading.local): <NEW_LINE> <INDENT> def __init__(self, cell_datetime_objects=False, netcdf_promote=False, strict_grib_load=False, netcdf_no_unlimited=False, clip_latitudes=False): <NEW_LINE> <INDENT> self.__dict__['cell_datetime_objects'] = cell_datetime_objects <NEW_LINE> self.__dict__['netcdf_promote']... | Run-time configuration controller. | 62599041379a373c97d9a2d5 |
class ListNetworksResultSet(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) <NEW_LINE> <DEDENT> def get_NewAccessToken(self): <NEW_LINE> <INDENT> return ... | A ResultSet with methods tailored to the values returned by the ListNetworks Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 6259904176d4e153a661dbca |
class OverloadedFuncDef(FuncBase, SymbolNode, Statement): <NEW_LINE> <INDENT> __slots__ = ('items', 'unanalyzed_items', 'impl') <NEW_LINE> items: List[OverloadPart] <NEW_LINE> unanalyzed_items: List[OverloadPart] <NEW_LINE> impl: Optional[OverloadPart] <NEW_LINE> def __init__(self, items: List['OverloadPart']) -> None:... | A logical node representing all the variants of a multi-declaration function.
A multi-declaration function is often an @overload, but can also be a
@property with a setter and a/or a deleter.
This node has no explicit representation in the source program.
Overloaded variants must be consecutive in the source file. | 62599041b57a9660fecd2d27 |
class UserRegistration(APIView): <NEW_LINE> <INDENT> def post(self, request, format=None): <NEW_LINE> <INDENT> user = request.data <NEW_LINE> user['username'] = 'sf' + str(random.randint(1, 100)) + '_' + user['first_name'] + '_' + user['last_name'] <NEW_LINE> user_serializer = UserSerializer(d... | List the details of user | 6259904123e79379d538d7ab |
class SafeTranslationsTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> if 'LANG' in iter(list(os.environ.keys())): <NEW_LINE> <INDENT> os.environ.__delitem__('LANG') <NEW_LINE> <DEDENT> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> if 'LANG' in iter(list(os.environ.keys())): <NEW_LIN... | Test translations work. | 6259904126068e7796d4dbf3 |
class gitpostreceiveinputparser(gitreceiveinputparser): <NEW_LINE> <INDENT> pass | input parser for the 'post-receive' phase
available fields:
- reporoot (str) => root of the repo
- receivedrevs =>
(list of tuples: (<old-value> <new-value> <ref-name>))
- head (str) => sha1 of HEAD | 6259904115baa7234946323e |
class HelperLowBatIP(HMDevice): <NEW_LINE> <INDENT> def __init__(self, device_description, proxy, resolveparamsets=False): <NEW_LINE> <INDENT> super().__init__(device_description, proxy, resolveparamsets) <NEW_LINE> self.ATTRIBUTENODE.update({"LOW_BAT": [0]}) <NEW_LINE> <DEDENT> def low_batt(self, channel=None): <NEW_L... | This Helper adds easy access to read the LOWBAT state | 62599041596a897236128f05 |
class FuzzyEnum(Enum): <NEW_LINE> <INDENT> case_sensitive = False <NEW_LINE> substring_matching = False <NEW_LINE> def __init__(self, values, default_value=Undefined, case_sensitive=False, substring_matching=False, **kwargs): <NEW_LINE> <INDENT> self.case_sensitive = case_sensitive <NEW_LINE> self.substring_matching = ... | An case-ignoring enum matching choices by unique prefixes/substrings. | 6259904116aa5153ce40179a |
class RandomPairs(PairsGenerator): <NEW_LINE> <INDENT> def __init__(self, spk1, spk2, no_silent=False, no_auto=True): <NEW_LINE> <INDENT> PairsGenerator.__init__(self, spk1, spk2, no_silent) <NEW_LINE> self.no_auto = no_auto <NEW_LINE> <DEDENT> def get_pairs(self, nb_pairs): <NEW_LINE> <INDENT> cells1 = numpy.array(lis... | RandomPairs(SpikeList, SpikeList, no_silent, no_auto). Inherits from PairsGenerator.
Generator that will return random pairs of elements.
Inputs:
spk1 - First SpikeList object to take cells from
spk2 - Second SpikeList object to take cells from
no_silent - Boolean to say if only non silent ce... | 6259904107d97122c4217f4c |
class Message(models.Model): <NEW_LINE> <INDENT> patient = models.ForeignKey(Patient, on_delete=models.CASCADE, related_name = 'message_patient') <NEW_LINE> clinicien = models.ForeignKey(Clinicien, on_delete=models.CASCADE, related_name = 'message_clinicien') <NEW_LINE> message = models.CharField(max_length=255) <NEW_L... | Voir pour assembler message et agenda ? | 62599041d53ae8145f91970a |
class SubsectionGradeBase(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self, subsection): <NEW_LINE> <INDENT> self.location = subsection.location <NEW_LINE> self.display_name = escape(block_metadata_utils.display_name_with_default(subsection)) <NEW_LINE> self.url_name = block_metadata_utils.url_name_for_block(s... | Abstract base class for Subsection Grades. | 6259904107f4c71912bb06df |
class TestInit(TestJobList): <NEW_LINE> <INDENT> def test_init_no_job_list_provided(self): <NEW_LINE> <INDENT> endpoint = JobsList(self.session, self.request) <NEW_LINE> self.assertIsInstance(endpoint.job_list, JobListInterface) <NEW_LINE> <DEDENT> @given(job_lists()) <NEW_LINE> def test_init_job_list_provided(self, jo... | Contains unit tests for the ``__init__`` method of the endpoint | 62599041d99f1b3c44d0694a |
class FFmpegPCMAudio(AudioSource): <NEW_LINE> <INDENT> def __init__(self, source, *, executable='ffmpeg', pipe=False, stderr=None, before_options=None, options=None): <NEW_LINE> <INDENT> stdin = None if not pipe else source <NEW_LINE> args = [executable] <NEW_LINE> if isinstance(before_options, str): <NEW_LINE> <INDENT... | An audio source from FFmpeg (or AVConv).
This launches a sub-process to a specific input file given.
.. warning::
You must have the ffmpeg or avconv executable in your path environment
variable in order for this to work.
Parameters
------------
source: Union[str, BinaryIO]
The input that ffmpeg will tak... | 625990411d351010ab8f4dcc |
class is_keyword(parser.keyword): <NEW_LINE> <INDENT> def __init__(self, sString): <NEW_LINE> <INDENT> parser.keyword.__init__(self, sString) | unique_id = interface_subprogram_declaration : is_keyword | 62599041d53ae8145f91970b |
class StubSource(PlayerBase): <NEW_LINE> <INDENT> def read(self): <NEW_LINE> <INDENT> return ZEROS <NEW_LINE> <DEDENT> def skip(self, amount: int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def previous(self, amount: int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def resume(self): <NEW_LINE> <INDENT> pass <NEW_L... | Source meant to initiate audio players when constructing voice clients. | 6259904176d4e153a661dbcb |
class IssueForm(Form): <NEW_LINE> <INDENT> name = StringField('Issue', [validators.Required(message='We need an issue.'), validators.Length( max=70, message='Your \subject is a tad long.' ) ] ) <NEW_LINE> description = TextAreaField('Issue Description', [validators.required( message='Please describe your issue.')]) <NE... | This class creates an IssueForm
object. | 625990410a366e3fb87ddc93 |
class BaxterPermutations_all(DisjointUnionEnumeratedSets, BaxterPermutations): <NEW_LINE> <INDENT> def __init__(self, n=None): <NEW_LINE> <INDENT> self.element_class = Permutations().element_class <NEW_LINE> from sage.categories.examples.infinite_enumerated_sets import NonNegativeIntegers <NEW_LINE> from sage.sets.fami... | The enumerated set of all Baxter permutations.
See :class:`BaxterPermutations` for the definition of Baxter
permutations.
EXAMPLES::
sage: from sage.combinat.baxter_permutations import BaxterPermutations_all
sage: BaxterPermutations_all()
Baxter permutations | 6259904123e79379d538d7ad |
class SaltObject(object): <NEW_LINE> <INDENT> def __init__(self, salt): <NEW_LINE> <INDENT> _mods = {} <NEW_LINE> for full_func in salt: <NEW_LINE> <INDENT> mod, func = full_func.split('.') <NEW_LINE> if mod not in _mods: <NEW_LINE> <INDENT> _mods[mod] = {} <NEW_LINE> <DEDENT> _mods[mod][func] = salt[full_func] <NEW_LI... | Object based interface to the functions in __salt__
.. code-block:: python
:linenos:
Salt = SaltObject(__salt__)
Salt.cmd.run(bar) | 6259904126068e7796d4dbf5 |
class P4Register(P4State): <NEW_LINE> <INDENT> def __init__(self, p4, cli, name, n, m, timer_ms): <NEW_LINE> <INDENT> super(P4Register, self).__init__(p4, name, n, m, timer_ms) <NEW_LINE> self.cli = cli <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> self.logger.debug("register_read %s", self.name) <NEW_LINE> r... | Abstraction of a P4 register | 625990418e71fb1e983bcd7c |
class opaque_type_registrator_t( code_creator.code_creator_t , declaration_based.declaration_based_t ): <NEW_LINE> <INDENT> def __init__( self, pointee ): <NEW_LINE> <INDENT> code_creator.code_creator_t.__init__( self ) <NEW_LINE> declaration_based.declaration_based_t.__init__( self, pointee ) <NEW_LINE> self.works_on_... | This class creates code that register static sized array | 625990418e05c05ec3f6f7b2 |
class VideoGrayscale(object): <NEW_LINE> <INDENT> def __init__(self, num_output_channels=1): <NEW_LINE> <INDENT> assert num_output_channels in (1, 3) <NEW_LINE> self.num_output_channels = num_output_channels <NEW_LINE> <DEDENT> def __call__(self, video): <NEW_LINE> <INDENT> C, L, H, W = video.size() <NEW_LINE> grayscal... | Convert video (C x L x H x W) to grayscale (C' x L x H x W, C' = 1 or 3)
Args:
num_output_channels (int): (1 or 3) number of channels desired for output video | 6259904130dc7b76659a0ae0 |
class Room(models.Model): <NEW_LINE> <INDENT> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> title = models.CharField(max_length=100, blank=False, null=False) <NEW_LINE> description = models.CharField(max_length=600, blank=False, null=False) <NEW_LINE> location = models.CharField(max_length=100, blank=Tru... | Represents a room | 62599041004d5f362081f93c |
class FenicsVector(VectorInterface): <NEW_LINE> <INDENT> def __init__(self, impl): <NEW_LINE> <INDENT> self.impl = impl <NEW_LINE> <DEDENT> def make_zeros(cls, subtype): <NEW_LINE> <INDENT> impl = df.Vector(*subtype) <NEW_LINE> return cls(impl) <NEW_LINE> <DEDENT> @property <NEW_LINE> def dim(self): <NEW_LINE> <INDENT>... | Wraps a FEniCS vector to make it usable with ListVectorArray. | 625990418a43f66fc4bf3440 |
class PatchtestOEError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, exitcode=1): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.exitcode = exitcode | Exception for handling patchtest-oe errors | 6259904126238365f5fade08 |
class VerseSearchViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> serializer_class = VerseSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> results = Verse.objects.all() <NEW_LINE> if 'query' in self.request.query_params: <NEW_LINE> <INDENT> results = results.filter(text__search=self.request.... | Lists verses and provides basic searching capability.
To search, provide the `query` query string (e.g. `.../verses/?query=heart`) | 62599041baa26c4b54d50558 |
class RecoverShard(base.Task): <NEW_LINE> <INDENT> def __init__(self, executor, context, begin, end): <NEW_LINE> <INDENT> super(RecoverShard, self).__init__(executor) <NEW_LINE> self.context = context <NEW_LINE> self.begin_shard = begin <NEW_LINE> self.end_shard = end <NEW_LINE> <DEDENT> def _get_zones(self): <NEW_LINE... | Given a beginning and ending shard, create the work to recover any
zones in an undesirable state within those shards.
:return: No return value | 62599041d99f1b3c44d0694c |
class GSE2BulletinSyntaxError(Exception): <NEW_LINE> <INDENT> pass | Raised when the file is not a valid GSE2 file | 62599041d10714528d69efe4 |
class ILeadImage(model.Schema): <NEW_LINE> <INDENT> image = NamedBlobImage( title=_(u'Lead image'), required = False, ) | Marker/Form interface for LeadImage | 625990411d351010ab8f4dcd |
class RestOfPacketString(MySQLDataType): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> super(RestOfPacketString, self).__init__() <NEW_LINE> self.val = bytes(val) <NEW_LINE> self.length = len(self.val) <NEW_LINE> <DEDENT> def read_in(self, fde): <NEW_LINE> <INDENT> self.val = bytes(fde.read()) <NEW_L... | AKA the EOF string | 625990413c8af77a43b68894 |
class ITask(IDueDate, IAssignmentsAware): <NEW_LINE> <INDENT> title = schema.TextLine( title = _('Title'), description = _('Task title.'), required = True) <NEW_LINE> milestone = schema.Choice( title = _(u'Milestone'), description = _(u'Assign task to milestone.'), vocabulary = 'project.milestone.active', required = Fa... | project task | 62599041d53ae8145f91970d |
class IgesHandler(NurbsHandler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(IgesHandler, self).__init__() <NEW_LINE> self.extensions = ['.iges', '.igs'] <NEW_LINE> <DEDENT> def load_shape_from_file(self, filename): <NEW_LINE> <INDENT> self._check_filename_type(filename) <NEW_LINE> self._check_ext... | Iges file handler class
:cvar string infile: name of the input file to be processed.
:cvar string outfile: name of the output file where to write in.
:cvar list extensions: list of extensions of the input/output files.
It is equal to ['.iges', '.igs'].
:cvar list control_point_position: index of the first NURBS co... | 62599041507cdc57c63a604c |
class PrivateIngredientsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> self.user = get_user_model().objects.create_user( 'test@test.com', 'testpass' ) <NEW_LINE> self.client.force_authenticate(self.user) <NEW_LINE> <DEDENT> def test_retrieve_ingredient_... | Test the authorized user ingredients API | 62599041b57a9660fecd2d2b |
@validation_decorators.AuditsExisting(base_models.BaseModel) <NEW_LINE> class ValidateBaseModelId(beam.DoFn): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ValidateBaseModelId, self).__init__() <NEW_LINE> self._pattern = BASE_MODEL_ID_PATTERN <NEW_LINE> <DEDENT> def process(self, entity): <NEW_LINE>... | DoFn to validate model ids.
IMPORTANT: Models with special ID checks should derive from this class and
override __init__() to assign a different value to self._regex, or replace
the process() method entirely. Be sure to decorate the new class with that
specific model type. | 6259904173bcbd0ca4bcb53b |
class svn_repos_file_rev_handler_t: <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, svn_repos_file_rev_handler_t, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, svn_repos_file_rev_handle... | Proxy of C svn_repos_file_rev_handler_t struct | 6259904150485f2cf55dc235 |
class HorizontalTail(): <NEW_LINE> <INDENT> def __init__(self, attachment = None, sweep = None, taper_ratio = None, aspect_ratio = None, t_o_c = None, dihedral = None, volume = None, lever_arm = None, area = None, span = None, mac = None, net_wetted_area = None, mass = None, c_g = None, x_axe = None, z_axe = None, c_ax... | Horizontal tail plane characteristics | 6259904115baa72349463242 |
class ManageUserView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> authentication_classes = (authentication.TokenAuthentication,) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get_serializer_class(self): <NEW_LINE> <INDENT> if self.request.user.is_artist: <NEW_LINE> <INDENT... | Manage the authenticated user. | 62599041e64d504609df9d29 |
class ThinLVMVolumeDriver(LVMISCSIDriver): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ThinLVMVolumeDriver, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def check_for_setup_error(self): <NEW_LINE> <INDENT> out, err = self._execute('lvs', '--option', 'name', '--noheadings', ... | Subclass for thin provisioned LVM's. | 625990411f5feb6acb163ea4 |
class Build: <NEW_LINE> <INDENT> def __init__(self, environment): <NEW_LINE> <INDENT> self.project_name = 'name of master project' <NEW_LINE> self.project_version = None <NEW_LINE> self.environment = environment <NEW_LINE> self.projects = {} <NEW_LINE> self.targets = {} <NEW_LINE> self.compilers = [] <NEW_LINE> self.cr... | A class that holds the status of one build including
all dependencies and so on. | 62599041a79ad1619776b330 |
class queue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = list() <NEW_LINE> <DEDENT> def isEmpty(self): <NEW_LINE> <INDENT> return self.items == [] <NEW_LINE> <DEDENT> def enqueue(self, item): <NEW_LINE> <INDENT> self.items.insert(0,item) <NEW_LINE> <DEDENT> def deque(self): <NEW_LINE> <INDE... | implementing the Queue Abstract data structure | 625990413eb6a72ae038b917 |
class Solution: <NEW_LINE> <INDENT> def combine(self, n, k): <NEW_LINE> <INDENT> d = {} <NEW_LINE> for i in range(k): <NEW_LINE> <INDENT> d[i+1] = [] <NEW_LINE> <DEDENT> for num in range(1, n+1): <NEW_LINE> <INDENT> for i in range(1, k): <NEW_LINE> <INDENT> items = d[k-i] <NEW_LINE> for item in items: <NEW_LINE> <INDEN... | @see https://oj.leetcode.com/problems/combinations/ | 6259904123e79379d538d7b0 |
class JSONConfig(XMLConfig): <NEW_LINE> <INDENT> EXTENSION = '.json' <NEW_LINE> def raw_to_object(self, raw): <NEW_LINE> <INDENT> return json.loads(raw.decode('utf-8'), object_hook=from_json) <NEW_LINE> <DEDENT> def to_raw(self): <NEW_LINE> <INDENT> return json.dumps(self, indent=2, default=to_json) <NEW_LINE> <DEDENT>... | JSONConfig | 62599041596a897236128f07 |
class UserRegister(Resource): <NEW_LINE> <INDENT> parser = reqparse.RequestParser() <NEW_LINE> parser.add_argument("username", required=True, type=str) <NEW_LINE> parser.add_argument("password", required=True, type=str) <NEW_LINE> def post(self): <NEW_LINE> <INDENT> data = UserRegister.parser.parse_args() <NEW_LINE> if... | Endpoint for registering user. Data will come in this format {"username": "Lukas", "password" : "p@55w0rd"} | 6259904130c21e258be99abe |
class IntervalQuerySet(QuerySet): <NEW_LINE> <INDENT> def between(self, start: DateOrDatetime, end: DateOrDatetime, include_end_date=True) -> QuerySet: <NEW_LINE> <INDENT> if not isinstance(start, datetime.datetime): <NEW_LINE> <INDENT> start = utils.datetime_from_date(start) <NEW_LINE> <DEDENT> if not isinstance(end, ... | Менеджер объектов для модели Interval. | 62599041be383301e0254ac9 |
class ChecklistResource (ModelResource): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> queryset = Checklist.objects.all() <NEW_LINE> resource_name = 'checklistresource' <NEW_LINE> authorization = Authorization() | Checklist webservice
| 62599041d53ae8145f91970f |
class ExposureCN(AbstractPropertyMap): <NEW_LINE> <INDENT> def __init__(self, model, radius=12.0, offset=0): <NEW_LINE> <INDENT> assert(offset >= 0) <NEW_LINE> ppb = CaPPBuilder() <NEW_LINE> ppl = ppb.build_peptides(model) <NEW_LINE> fs_map = {} <NEW_LINE> fs_list = [] <NEW_LINE> fs_keys = [] <NEW_LINE> for pp1 in ppl:... | Residue exposure as number of CA atoms around its CA atom. | 62599041e76e3b2f99fd9cbd |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.