code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DevelopmentConfig(Config): <NEW_LINE> <INDENT> DEBUG =True <NEW_LINE> SQLALCHEMY_ECHO=True | Develpoment configurations | 62599063379a373c97d9a71a |
class ExportAsCombineAPIHandler(APIHandler): <NEW_LINE> <INDENT> @web.authenticated <NEW_LINE> def get(self): <NEW_LINE> <INDENT> log.warning("Export as combine function has not been cleaned up") <NEW_LINE> self.finish() <NEW_LINE> <DEDENT> @web.authenticated <NEW_LINE> def post(self): <NEW_LINE> <INDENT> log.warning("... | ##############################################################################
Handler for exporting a project or part of a project as a COMBINE archive
############################################################################## | 6259906391f36d47f2231a0d |
class SaltLoadPillar(ioflo.base.deeding.Deed): <NEW_LINE> <INDENT> Ioinits = {'opts': '.salt.opts', 'pillar': '.salt.pillar', 'grains': '.salt.grains', 'modules': '.salt.loader.modules', 'pillar_refresh': '.salt.var.pillar_refresh', 'road_stack': '.salt.road.manor.stack', 'master_estate_name': '.salt.track.master_estat... | Load up the initial pillar for the minion
do salt load pillar | 6259906355399d3f05627c1c |
class V1ListMeta(object): <NEW_LINE> <INDENT> swagger_types = { '_continue': 'str', 'resource_version': 'str', 'self_link': 'str' } <NEW_LINE> attribute_map = { '_continue': 'continue', 'resource_version': 'resourceVersion', 'self_link': 'selfLink' } <NEW_LINE> def __init__(self, _continue=None, resource_version=None, ... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 625990635166f23b2e244acf |
class ViewFavouriteIdeasSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> user_profile = UserProfileSerializer() <NEW_LINE> idea_feed = IdeaFeedItemSerializer() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = UserFavouriteIdeas <NEW_LINE> fields = ('id', 'user_profile', 'idea_feed') <NEW_LINE> extra_kwarg... | Serializes user favourite ideas | 6259906399cbb53fe68325df |
class ValidationResults(namedtuple('ValidationResults', _validation_fields)): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return ("Correct: " + str(len(self.correct)) + "\n" + "False positive: " + str(len(self.false_positive)) + "\n" + "False negative: " + str(len(self.false_negative))) | Object returned by validation.
Results from comparing frames identified by a proposed state definition
to the frames identified by the user. Checks for correct results, false
positives (proposed definition finds frames the user didn't) and false
negatives (user finds frames the proposed definition didn't).
Parameters... | 6259906366673b3332c31af9 |
class SettingsMixin(object): <NEW_LINE> <INDENT> settings = db.Column(JSONEncodedDict()) <NEW_LINE> settings_default = {} <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.settings = dict(self.settings_default) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> if self.settings is not None and ke... | A mixin class for SQLAlchemy Model classes that provides a
JSON-encoded dictionary of free-form *settings*. These values are
accessed by subscripting the model object. | 62599063435de62698e9d505 |
class EOLModeSelect(BufferBusyActionMixin, RadioAction): <NEW_LINE> <INDENT> name = "Line Endings" <NEW_LINE> inline = False <NEW_LINE> localize_items = True <NEW_LINE> default_menu = ("Transform", -999) <NEW_LINE> items = ['Unix (LF)', 'DOS/Windows (CRLF)', 'Old-style Apple (CR)'] <NEW_LINE> modes = [wx.stc.STC_EOL_LF... | Switch line endings
Converts all line endings to the specified line ending. This can be used
if there are multiple styles of line endings in the file. | 625990638e7ae83300eea78b |
class TestQuoteResponse(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return QuoteResponse( na... | QuoteResponse unit test stubs | 62599063a8370b77170f1acb |
class NewClient(object): <NEW_LINE> <INDENT> def __init__(self, facade_lab): <NEW_LINE> <INDENT> self.lab = facade_lab <NEW_LINE> <DEDENT> def start_lab(self): <NEW_LINE> <INDENT> if self.lab.can_be_started(): <NEW_LINE> <INDENT> print("start lab") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> print("can not start lab"... | 新的客户类 | 625990634428ac0f6e659c30 |
class McLaneResponse(BaseEnum): <NEW_LINE> <INDENT> HOME = re.compile(r'Port: 00') <NEW_LINE> PORT = re.compile(r'Port: (\d+)') <NEW_LINE> READY = re.compile(r'(\d+/\d+/\d+\s+\d+:\d+:\d+\s+)(RAS|PPS)\s+(.*)>') <NEW_LINE> PUMP = re.compile(r'(Status|Result).*(\d+)' + NEWLINE) <NEW_LINE> BATTERY = re.compile(r'Battery:\s... | Expected device response strings | 6259906399cbb53fe68325e0 |
class Visualizer(object): <NEW_LINE> <INDENT> def __init__(self, env='default', **kwargs): <NEW_LINE> <INDENT> self.vis = visdom.Visdom(env=env, **kwargs) <NEW_LINE> self.index = {} <NEW_LINE> self.log_text = '' <NEW_LINE> <DEDENT> def reinit(self, env='default', **kwargs): <NEW_LINE> <INDENT> self.vis = visdom.Visdom(... | 封装了visdom的基本操作,但是你仍然可以通过`self.vis.function`
或者`self.function`调用原生的visdom接口
比如
self.text('hello visdom')
self.histogram(t.randn(1000))
self.line(t.arange(0, 10),t.arange(1, 11)) | 62599063f548e778e596cc86 |
class UserForm(forms.Form): <NEW_LINE> <INDENT> usr = forms.CharField(min_length=2, max_length=20, widget=widgets.TextInput(attrs={'class': 'form-control', 'placeholder': '用户名'})) <NEW_LINE> pwd = forms.CharField(min_length=3, widget=widgets.PasswordInput(attrs={'class': 'form-control', 'placeholder': '密码(不少于3位)'})) <N... | forms组件:注册 | 62599063009cb60464d02c35 |
class AssociationDefinition(EntityDefinition): <NEW_LINE> <INDENT> def __init__(self, definition_dict = dict(), src_alias = "", dst_alias = "", edm_api = None, entity_sets_api = None): <NEW_LINE> <INDENT> super().__init__(definition_dict = definition_dict, edm_api = edm_api, entity_sets_api = entity_sets_api) <NEW_LINE... | A class representing an association definition
An AssociationDefinition is an EntityDefinition with a defined source and destination. | 62599063f548e778e596cc87 |
class Pattern(Unit): <NEW_LINE> <INDENT> def set(self, value): <NEW_LINE> <INDENT> self._value = value <NEW_LINE> <DEDENT> def _draw_label_text(self, l): <NEW_LINE> <INDENT> l.set_text(">") <NEW_LINE> <DEDENT> def _draw_image(self, pbuff, gc, size): <NEW_LINE> <INDENT> ps = [(self._x, self._y), (self._x + size, self._y... | A unit for pattern feeding the neural network. | 62599063435de62698e9d506 |
class ApplicationRate(object): <NEW_LINE> <INDENT> swagger_types = { 'interval': 'ApplicationIntervals', 'indexer': 'Indexer', 'customers': 'Customer' } <NEW_LINE> attribute_map = { 'interval': 'interval', 'indexer': 'indexer', 'customers': 'customers' } <NEW_LINE> def __init__(self, interval=None, indexer=None, custom... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259906324f1403a9268644d |
class BMSBackupSummariesQueryObject(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, type: Optional[Union[str, "Type"]] = None, **kwargs ): <NEW_LINE> <INDENT> super(BMSBackupSummariesQueryObject, self).__init__(**kwargs) <NE... | Query parameters to fetch backup summaries.
:ivar type: Backup management type for this container. Possible values include: "Invalid",
"BackupProtectedItemCountSummary", "BackupProtectionContainerCountSummary".
:vartype type: str or ~azure.mgmt.recoveryservicesbackup.passivestamp.models.Type | 62599063b7558d5895464aad |
@implementer(IAddress) <NEW_LINE> class SSHTransportAddress(util.FancyEqMixin, object): <NEW_LINE> <INDENT> compareAttributes = ('address',) <NEW_LINE> def __init__(self, address): <NEW_LINE> <INDENT> self.address = address <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'SSHTransportAddress(%r)' % (... | Object representing an SSH Transport endpoint.
This is used to ensure that any code inspecting this address and
attempting to construct a similar connection based upon it is not
mislead into creating a transport which is not similar to the one it is
indicating.
@ivar address: A instance of an object which implements ... | 625990635fdd1c0f98e5f682 |
class AceCard (PlayingCard): <NEW_LINE> <INDENT> def __init__(self, suit): <NEW_LINE> <INDENT> self.value = 14 <NEW_LINE> self.suit = suit <NEW_LINE> self.card = (14, suit) <NEW_LINE> <DEDENT> def give_value(self): <NEW_LINE> <INDENT> return (self.value) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return... | Class for an Ace | 6259906332920d7e50bc7745 |
class CatkeysFile(base.TranslationStore): <NEW_LINE> <INDENT> Name = "Haiku catkeys file" <NEW_LINE> Mimetypes = ["application/x-catkeys"] <NEW_LINE> Extensions = ["catkeys"] <NEW_LINE> def __init__(self, inputfile=None, unitclass=CatkeysUnit): <NEW_LINE> <INDENT> self.UnitClass = unitclass <NEW_LINE> base.TranslationS... | A catkeys translation memory file | 62599063442bda511e95d8d9 |
class MQConnectionError( Exception ): <NEW_LINE> <INDENT> pass | specialized exception
| 6259906356b00c62f0fb3fcb |
class Event(object): <NEW_LINE> <INDENT> def __init__(self, topic, data): <NEW_LINE> <INDENT> self.__topic = topic <NEW_LINE> self.__data = data <NEW_LINE> <DEDENT> @property <NEW_LINE> def topic(self): <NEW_LINE> <INDENT> return self.__topic <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> ... | PUB/SUB event container
this is an opaque data structure that represents a single, entire
event: ``topic`` and ``data`` | 625990630c0af96317c578de |
class CognitiveServicesAccountKeys(Model): <NEW_LINE> <INDENT> _attribute_map = { 'key1': {'key': 'key1', 'type': 'str'}, 'key2': {'key': 'key2', 'type': 'str'}, } <NEW_LINE> def __init__(self, key1=None, key2=None): <NEW_LINE> <INDENT> self.key1 = key1 <NEW_LINE> self.key2 = key2 | The access keys for the cognitive services account.
:param key1: Gets the value of key 1.
:type key1: str
:param key2: Gets the value of key 2.
:type key2: str | 62599063d6c5a102081e3823 |
class Gardener(Smarter): <NEW_LINE> <INDENT> def action(self, player, game): <NEW_LINE> <INDENT> LOGGER.info('player has %d action(s)', player.actions) <NEW_LINE> candidate = super().action(player, game) <NEW_LINE> if not candidate: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> elif candidate.actions or Thief not... | bloat your deck as much as possible to make points with gardens | 62599063fff4ab517ebcef27 |
class ProjectCommentForm(wtf.Form): <NEW_LINE> <INDENT> objid = wtforms.TextField( 'Ticket/Request id', [wtforms.validators.Required()] ) <NEW_LINE> useremail = wtforms.TextField( 'Email', [wtforms.validators.Required()] ) | Form to represent project. | 625990634f6381625f19a023 |
class UpdateProfilePic(APIView): <NEW_LINE> <INDENT> schema = schemas.ManualSchema(fields=[ coreapi.Field( "profile_pic", required=False, location="form", schema=coreschema.Object( description="Test this API with Postmen" ) ) ]) <NEW_LINE> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def post(self, re... | post:
API for update user profile picture. Auth token required. | 62599063f548e778e596cc88 |
class Rows(CustomRows): <NEW_LINE> <INDENT> def __init__(self, rowcls): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.rowcls = rowcls <NEW_LINE> <DEDENT> def instanciate_row(self, rows, request, subdata): <NEW_LINE> <INDENT> rows.append( self.rowcls( request=request, post_data=subdata, parent=rows)) | This is not a decorator, but a plain descriptor to be used to host a list of
elements in a :class:`Form`. The elements are instances of *rowcls*, or of
the form itself, if *rowcls* is passed as :data:`None`. | 62599063ac7a0e7691f73be4 |
class _ldau_TLUJ(Keyword): <NEW_LINE> <INDENT> name = "ldau_TLUJ" <NEW_LINE> ptype = dict <NEW_LINE> atype = "numbers" | on site coulomb interaction (`mandatory`). Units: ``.
.. warning:: This keyword is still listed as development level. Use it
knowing that it is subject to change or removal.
Returns:
list: This vector of numbers contains the parameters of the DFT+U calculations, based on a corrective functional inspired by the ... | 625990633d592f4c4edbc5dc |
class Frazione(models.Model): <NEW_LINE> <INDENT> nome = models.CharField(max_length=30) <NEW_LINE> comune = models.ForeignKey(Comune) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.nome <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.nome | Modello che implementa l'entità Frazione di appartenenza di un monitor nel db | 625990637d847024c075dad5 |
class FakeCheckingDhcpThread(FakeAmpqThread): <NEW_LINE> <INDENT> def _get_message(self, mac): <NEW_LINE> <INDENT> nodes = [{'uid': '90', 'status': 'ready', 'data': [{'mac': mac, 'server_id': '10.20.0.20', 'yiaddr': '10.20.0.133', 'iface': 'eth0'}]}, {'uid': '91', 'status': 'ready', 'data': [{'mac': mac, 'server_id': '... | Thread to be used with test_task_managers.py | 6259906376e4537e8c3f0c82 |
class inputSrv(Thread): <NEW_LINE> <INDENT> def out(self, _txt): <NEW_LINE> <INDENT> self.utils_c.echo("inputSrv:> "+_txt) <NEW_LINE> <DEDENT> def __init__(self, _utils_c, _refresh=1): <NEW_LINE> <INDENT> super(inputSrv,self).__init__() <NEW_LINE> self.utils_c = _utils_c <NEW_LINE> self.refreshRate = _refresh <NEW_LINE... | classdocs | 625990634e4d562566373b07 |
class FieldArray(BaseField): <NEW_LINE> <INDENT> def __init__(self, substructure, length_provider=None, **kwargs): <NEW_LINE> <INDENT> BaseField.__init__(self, **kwargs) <NEW_LINE> self.substructure = substructure <NEW_LINE> self._value = list() <NEW_LINE> if isinstance(length_provider, FieldPlaceholder): <NEW_LINE> <I... | Field which contains a list of some other field.
In some protocols, there exist repeated substructures which are present in a
variable number. The variable nature of these fields make a DispatchField
and DispatchTarget combination unsuitable; instead a FieldArray may be
used to pack/unpack these fields to/from a list.... | 62599063e5267d203ee6cf3e |
class ReadBlocks(Reader): <NEW_LINE> <INDENT> def __init__(self,src,isEndBlock=lambda line:line=="\n"): <NEW_LINE> <INDENT> Reader.__init__(self,src) <NEW_LINE> self.isEndBlock = isEndBlock <NEW_LINE> <DEDENT> def rowGenerator(self): <NEW_LINE> <INDENT> buf = [] <NEW_LINE> for line in sys.stdin: <NEW_LINE> <INDENT> if ... | Returns blocks of non-empty lines, separated by empty lines | 62599063f548e778e596cc89 |
class FlexRequest(Request): <NEW_LINE> <INDENT> def __init__(self, prognosis: Prognosis, requested_flexibility: Series = None, **kwargs): <NEW_LINE> <INDENT> self.requested_flexibility = requested_flexibility <NEW_LINE> super().__init__(**kwargs) <NEW_LINE> self.prognosis = prognosis | A FlexRequest describes requested commitments to deviate from a prognosis.
A commitment for a certain timeslot of e.g. 10 MW indicates a request to increase consumption (or decrease
production) by 10 MW.
A nan value indicates availability to deviate by any amount. | 6259906345492302aabfdbdb |
class ClientCutText(CompositeType): <NEW_LINE> <INDENT> def __init__(self, text = ""): <NEW_LINE> <INDENT> CompositeType.__init__(self) <NEW_LINE> self.padding = (UInt16Be(), UInt8()) <NEW_LINE> self.size = UInt32Be(len(text)) <NEW_LINE> self.message = String(text) | Client cut text message message
Use to simulate copy paste (ctrl-c ctrl-v) only for text | 6259906332920d7e50bc7746 |
class DirectoryServiceSettingsResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'pagination_info': 'PaginationInfo', 'items': 'list[DirectoryServiceSettings]' } <NEW_LINE> attribute_map = { 'pagination_info': 'pagination_info', 'items': 'items' } <NEW_LINE> def __init__(self, pagination_info=None, items=None): <N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599063adb09d7d5dc0bc6a |
class PowerFeatures(SpectralSource): <NEW_LINE> <INDENT> def __init__(self, fftLn = 512, windowLen = 320, windowShift = 160): <NEW_LINE> <INDENT> SpectralSource.__init__(self, fftLn) <NEW_LINE> self._windowLen = windowLen <NEW_LINE> self._windowShift = windowShift <NEW_LINE> self._normalizer = (2.0**16-1)**2 / 4 * sel... | Delivers the averaged power over segments of speech of deignated length for use in Janus | 625990639c8ee82313040d08 |
class Profile(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.systran_types = { 'id': 'str', 'private': 'bool' } <NEW_LINE> self.attribute_map = { 'id': 'id', 'private': 'private' } <NEW_LINE> self.id = None <NEW_LINE> self.private = None <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <IND... | NOTE: This class is auto generated by the systran code generator program.
Do not edit the class manually. | 6259906324f1403a9268644e |
class ObtainSocialTokenPairView(generics.CreateAPIView): <NEW_LINE> <INDENT> authentication_classes = [] <NEW_LINE> permission_classes = [] <NEW_LINE> serializer_class = ObtainSocialTokenPairSerializer <NEW_LINE> def create(self, req, *args, **kwargs): <NEW_LINE> <INDENT> body = json.loads(str(req.body, encoding='utf-8... | Class View for user to obtain JWT token | 625990638da39b475be048e9 |
class BindProductsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId") | BindProducts返回参数结构体
| 62599063097d151d1a2c276b |
class IndexView(generic.ListView): <NEW_LINE> <INDENT> template_name = 'polls/index.html' <NEW_LINE> context_object_name = 'latest_question_list' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Question.objects.filter(pub_date__lte=timezone.now()).order_by('-pub_date')[:5] | Django generic view for the index page. | 62599063796e427e5384fe76 |
class Vectorizer: <NEW_LINE> <INDENT> mels = 1 <NEW_LINE> mfccs = 2 <NEW_LINE> speechpy_mfccs = 3 | Chooses which function to call to vectorize audio
Options:
mels: Convert to a compressed Mel spectrogram
mfccs: Convert to a MFCC spectrogram
speechpy_mfccs: Legacy option to convert to MFCCs using old library | 625990632ae34c7f260ac7e8 |
class AdminMatchEdit(LoggedInHandler): <NEW_LINE> <INDENT> def get(self, match_key): <NEW_LINE> <INDENT> self._require_admin() <NEW_LINE> match = Match.get_by_id(match_key) <NEW_LINE> self.template_values.update({ "match": match }) <NEW_LINE> path = os.path.join(os.path.dirname(__file__), '../../templates/admin/match_e... | Edit a Match. | 62599063d268445f2663a6dd |
class IsSuperUserOrReadOnly(permissions.IsAdminUser): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return bool(request.user and request.user.is_superuser) | For use with admin-level change views. | 625990634e4d562566373b08 |
class StandardizeFloatCols(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, cols=None): <NEW_LINE> <INDENT> pdu._is_cols_input_valid(cols) <NEW_LINE> self.cols = cols <NEW_LINE> self.standard_scaler = StandardScaler() <NEW_LINE> self._is_fitted = False <NEW_LINE> <DEDENT> def transform(self, df,... | Standard-scale the columns in the data frame.
Apply sklearn.preprocessing.StandardScaler_ to `cols`
.. _sklearn.preprocessing.StandardScaler : https://is.gd/cdMuLr
Attributes
----------
cols : list
List of columns in the data to be scaled | 625990637d847024c075dad7 |
class UserViewSet(BaseViewSet): <NEW_LINE> <INDENT> permission_code = 'user' <NEW_LINE> queryset = User.objects.all().prefetch_related('groups') <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> filter_class = UserFilter <NEW_LINE> filter_backends = (DjangoFilterBackend, OrderingFilter) <NEW_LINE> def perform_des... | Vista maestro de usuarios
FILTROS:
username: coicidencia o valor exacto
first_name: coicidencia o valor exacto
last_name: coicidencia o valor exacto
is_active: valor exacto | 62599063a219f33f346c7f08 |
class ReceiveInput(Event): <NEW_LINE> <INDENT> pass | Some input arrived (fieldcode or other input) | 6259906324f1403a9268644f |
class Solution: <NEW_LINE> <INDENT> def longestPalindrome(self, s): <NEW_LINE> <INDENT> ret = [0, 0, 1] <NEW_LINE> for i in range(len(s)): <NEW_LINE> <INDENT> r1 = find_longest_alindrome(s, i, i) <NEW_LINE> r2 = find_longest_alindrome(s, i, i + 1) <NEW_LINE> if r1[0] > ret[0]: <NEW_LINE> <INDENT> ret = r1 <NEW_LINE> <D... | @param s: input string
@return: the longest palindromic substring | 625990634f88993c371f10a0 |
class CharNode(Node): <NEW_LINE> <INDENT> def __init__(self, *, is_captured: bool=False, **kwargs) -> None: <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.is_captured = is_captured | A node that is meant to be matched against regular text characters
:ivar is_captured: set this node for capturing
:private: | 62599063a8ecb0332587291a |
class Logger(object): <NEW_LINE> <INDENT> def __init__(self, name, fields, directory=".", delimiter=',', resume=True): <NEW_LINE> <INDENT> self.filename = name + ".csv" <NEW_LINE> self.directory = process(path.join(directory), True) <NEW_LINE> self.file = path.join(self.directory, self.filename) <NEW_LINE> self.fields ... | Logs values in a csv file.
Args:
name (str): Filename without extension.
fields (list or tuple): Field names (column headers).
directory (str, optional): Directory to save file (default '.').
delimiter (str, optional): Delimiter for values (default ',').
resume (bool, optional): If True it appends ... | 625990632ae34c7f260ac7e9 |
class BaseLeapTest(unittest.TestCase): <NEW_LINE> <INDENT> __name__ = "leap_test" <NEW_LINE> _system = platform.system() <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.old_path = os.environ['PATH'] <NEW_LINE> cls.old_home = os.environ['HOME'] <NEW_LINE> cls.tempdir = tempfile.mkdtemp(pr... | Base Leap TestCase | 62599063379a373c97d9a720 |
class XLBook: <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> self.workbook = xlrd.open_workbook(file) <NEW_LINE> self.mysheets = {} <NEW_LINE> for name in self.workbook.sheet_names(): <NEW_LINE> <INDENT> data = to_array(XLSheet( self.workbook.sheet_by_name(name))) <NEW_LINE> self.mysheets[name] = dat... | XLSBook reader
It reads xls, xlsm, xlsx work book | 62599063097d151d1a2c276d |
class DuplicateVariables(Exception): <NEW_LINE> <INDENT> def __init__(self, variables): <NEW_LINE> <INDENT> super().__init__( 'Variable/s "{}" used more than once in a utility' ' definition'.format(variables) ) | Exception for duplicate parameters in a utility definition. | 6259906356ac1b37e6303868 |
class StorageLoggerDecorator(StorageDecorator): <NEW_LINE> <INDENT> def put(self, key: str, data: str): <NEW_LINE> <INDENT> print(' - put "%s:%s"' % (key, data)) <NEW_LINE> return self._component.put(key, data) <NEW_LINE> <DEDENT> def get(self, key: str) -> str: <NEW_LINE> <INDENT> data = self._component.get(key) <NEW_... | Logging decorator class, for Storage class.
Log to console when put() and get() methods are called. | 62599063796e427e5384fe78 |
class BillItem(db.Model): <NEW_LINE> <INDENT> __tablename__ = "bill_items" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> bill_id = db.Column(db.Integer,db.ForeignKey('bills.id')) <NEW_LINE> item_id = db.Column(db.Integer,db.ForeignKey('items.id')) <NEW_LINE> item_price = db.Column(db.DECIMAL(10,2)... | Create a Bill Items table | 625990631f037a2d8b9e53ec |
class JFS(FS): <NEW_LINE> <INDENT> _type = "jfs" <NEW_LINE> _mkfs = "mkfs.jfs" <NEW_LINE> _modules = ["jfs"] <NEW_LINE> _labelfs = fslabeling.JFSLabeling() <NEW_LINE> _defaultFormatOptions = ["-q"] <NEW_LINE> _maxSize = Size("8 TiB") <NEW_LINE> _formattable = True <NEW_LINE> _linuxNative = True <NEW_LINE> _dump = True ... | JFS filesystem | 625990630c0af96317c578e0 |
class MnistReader(object): <NEW_LINE> <INDENT> def __init__(self, role): <NEW_LINE> <INDENT> self.__dict__.update(mnist_constants) <NEW_LINE> if role not in ['train', 'test']: <NEW_LINE> <INDENT> raise ValueError('Invalid Role: {}'.format(role)) <NEW_LINE> <DEDENT> if role == 'train': <NEW_LINE> <INDENT> train_data_fil... | Mnist Reader reads mnist dataset from downloaded files.
| 6259906366673b3332c31aff |
class SourceStructure(BaseAnnotation): <NEW_LINE> <INDENT> data = True <NEW_LINE> def __init__(self, doc): <NEW_LINE> <INDENT> super().__init__(io.STRUCTURE_FILE, doc) <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> return io.read_data(self.doc, self) <NEW_LINE> <DEDENT> def write(self, structure): <NEW_LINE> <... | Every annotation available in a source document. | 6259906345492302aabfdbde |
class RedisComponent(Component): <NEW_LINE> <INDENT> def __init__(self, connections: Dict[str, Dict[str, Any]] = None, **default_client_args): <NEW_LINE> <INDENT> assert check_argument_types() <NEW_LINE> if not connections: <NEW_LINE> <INDENT> default_client_args.setdefault('context_attr', 'redis') <NEW_LINE> connectio... | Creates one or more :class:`aioredis.Redis` resources.
If ``connections`` is given, a Redis client resource will be published for each key in the
dictionary, using the key as the resource name. Any extra keyword arguments to the component
constructor will be used as defaults for omitted configuration values.
If ``con... | 6259906363d6d428bbee3e0a |
class TestRevisionedResource(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 testRevisionedResource(self): <NEW_LINE> <INDENT> pass | RevisionedResource unit test stubs | 62599063d7e4931a7ef3d707 |
class Timer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Timer, self).__init__() <NEW_LINE> self.old_time = 0 <NEW_LINE> self.new_time = 0 <NEW_LINE> self.last_time = 0 <NEW_LINE> self.diff_time = 0 <NEW_LINE> self.speed_factor = 0 <NEW_LINE> self.num_frames = 0 <NEW_LINE> self.frames = 0 ... | A class that updates fps and speedfactor
requires: pygame | 625990630a50d4780f706941 |
class GetRspvs(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> def get(self, rspv_id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> rspv_id = int(rspv_id) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> return { "status": 404, "error": "Url need an integer" }, 404 <NEW_LINE> <DEDENT> new_rspv = repv_v... | Class to get all RSPVS | 625990637047854f46340ac2 |
class AutoCompleteSelectWidget(forms.widgets.TextInput): <NEW_LINE> <INDENT> add_link = None <NEW_LINE> def __init__(self, channel, help_text = u'', show_help_text = True, plugin_options = {}, *args, **kwargs): <NEW_LINE> <INDENT> self.plugin_options = plugin_options <NEW_LINE> super(forms.widgets.TextInput, self).__in... | widget to select a model and return it as text | 62599063f548e778e596cc8d |
class Boolean(odoorpc_Boolean, BaseField): <NEW_LINE> <INDENT> pass | Equivalent of the `fields.Boolean` class. | 6259906345492302aabfdbdf |
class rnn_model: <NEW_LINE> <INDENT> def __init__(self, model_def): <NEW_LINE> <INDENT> def create_lstm(model_def): <NEW_LINE> <INDENT> cell = rnn.BasicLSTMCell(model_def.hidden_size, forget_bias=0.0, state_is_tuple=True, reuse=tf.get_variable_scope().reuse) <NEW_LINE> if model_def.keep_prob < 1 : <NEW_LINE> <INDENT> c... | define a cnn model | 625990634a966d76dd5f05f9 |
class BuildIOTable(BuildTasksTable): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BuildIOTable, self).__init__(*args, **kwargs) <NEW_LINE> self.default_orderby = "-disk_io" <NEW_LINE> <DEDENT> def setup_columns(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BuildIOTable, self).s... | Same as tasks table but the Disk IO column is default displayed | 6259906324f1403a92686450 |
class ImportHelper: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def import_error_handling(import_this_module, modulescope): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> exec("import %s " % import_this_module) in modulescope <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDENT> print("This program requires %s in ... | This class simply allows for the dynamic loading of modules which are not apart of the stdlib.
It specifies which module cannot be imported and provides the proper pip install command as output to the user. | 625990635166f23b2e244ad7 |
class deleteTable_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'tableName', None, None, ), ) <NEW_LINE> def __init__(self, tableName=None,): <NEW_LINE> <INDENT> self.tableName = tableName <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TB... | Attributes:
- tableName: name of table to delete | 625990637b25080760ed8863 |
class Arbeitgeber(Base): <NEW_LINE> <INDENT> __tablename__ = "arbeitgeber" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String) | an employer can have more than one addresses and offer more than one jobs | 6259906338b623060ffaa3d3 |
class DualPointEstimateTracer(PointEstimateTracer): <NEW_LINE> <INDENT> def __init__(self, model: FilteredStateSpaceModelFreeProposal): <NEW_LINE> <INDENT> super().__init__(model) <NEW_LINE> <DEDENT> def append(self, ζ, η, objective): <NEW_LINE> <INDENT> super().append(torch.cat([ζ, η]), objective) | Tracer for dual optimization algorithms. | 62599063442bda511e95d8dc |
class HistogramValidator(object): <NEW_LINE> <INDENT> def __init__(self, product, sensor, fdr=_BASE_DIR): <NEW_LINE> <INDENT> super(HistogramValidator, self).__init__() <NEW_LINE> try: <NEW_LINE> <INDENT> info = _MEMBER_INFO[product] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> raise NotImplementedError( f"... | Convience for iterating over a set of histograms | 625990633eb6a72ae038bd64 |
class Combination: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> dices = [] <NEW_LINE> self.dices = dices <NEW_LINE> order = [] <NEW_LINE> self.order = order <NEW_LINE> calc_string = "" <NEW_LINE> self.calc_string = calc_string <NEW_LINE> self.result = 0 <NEW_LINE> self.calc_rule = 1 <NEW_LINE> self.dice ... | a Combination consists of up to 4 dices and a result | 625990638e71fb1e983bd1d0 |
class FindUsersInputSet(InputSet): <NEW_LINE> <INDENT> def set_Email(self, value): <NEW_LINE> <INDENT> super(FindUsersInputSet, self)._set_input('Email', value) <NEW_LINE> <DEDENT> def set_FacebookID(self, value): <NEW_LINE> <INDENT> super(FindUsersInputSet, self)._set_input('FacebookID', value) <NEW_LINE> <DEDENT> def... | An InputSet with methods appropriate for specifying the inputs to the FindUsers
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62599063498bea3a75a59182 |
class JsonFileInteractiveLevelReader: <NEW_LINE> <INDENT> def __init__(self, message='Enter with a level path: '): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> def read(self): <NEW_LINE> <INDENT> level_path = input(self.message) <NEW_LINE> return JsonFileLevelReader(level_path).read() | JSON File interactive level reader. | 6259906316aa5153ce401be1 |
@symbolic_multi <NEW_LINE> class Chain(IParameterized): <NEW_LINE> <INDENT> def __init__(self, *processors): <NEW_LINE> <INDENT> self._processors = processors <NEW_LINE> <DEDENT> def __call__(self, *args): <NEW_LINE> <INDENT> out = args <NEW_LINE> for p in self._processors: <NEW_LINE> <INDENT> out = p.to_format(symboli... | A composition of symbolic functions:
Chain(f, g, h)(x) is f(g(h(x)))
tuple_of_output_tensors = my_chain(input_tensor_0, input_tensor_1, ...)
If the last function in the chain returns just a single output, Chain can also be called in the
symbolic_simple format:
output_tensor = my_chain.symbolic_simple(input_0, in... | 62599063cb5e8a47e493cd07 |
class Status(enum.Enum): <NEW_LINE> <INDENT> Unknown = -1 <NEW_LINE> Shutdown = 0 <NEW_LINE> Standby = 1 <NEW_LINE> Pause = 2 <NEW_LINE> Appointment = 3 <NEW_LINE> Cooking = 4 <NEW_LINE> Preheat = 5 <NEW_LINE> Cooked = 6 <NEW_LINE> PreheatFinish = 7 <NEW_LINE> PreheatPause = 8 <NEW_LINE> Pause2 = 9 | Status | 62599063f548e778e596cc8e |
class W27(VOSIWarning, XMLWarning): <NEW_LINE> <INDENT> message_template = "The form element must not occur more than once" | The `form` element must not occur more than once. | 625990638a43f66fc4bf3894 |
class IRowTypesCriterionSettings(Interface): <NEW_LINE> <INDENT> type_name = schema.TextLine( title=_(u"General type name"), description=_(u"A descriptive name for the content type you want to define"), default=u"", missing_value=u"", required=True, ) <NEW_LINE> types_matched = schema.Tuple( title=_(u'Select all native... | Single configuration entry for types criterion | 62599063627d3e7fe0e08590 |
class problemBase(object): <NEW_LINE> <INDENT> def __init__(self, name, noseed=False): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> if not noseed: <NEW_LINE> <INDENT> np.random.seed(seed=0) <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> @p... | Base class for all CS problems. The problems follow
the quation below:
.. math::
A x = b
A = M B
where :math:`A` is an operator acting on a sparse signal :math:`x`
and :math:`b` is the observation vector. :math:`A` can be factored
into :math:`M` which represents the system response and :math:`B`
basis that s... | 62599063009cb60464d02c3d |
class OccupantQuantityType(BSElement): <NEW_LINE> <INDENT> element_type = "xs:string" <NEW_LINE> element_enumerations = [ "Peak total occupants", "Adults", "Children", "Average residents", "Workers on main shift", "Full-time equivalent workers", "Average daily salaried labor hours", "Registered students", "Staffed beds... | Type of quantitative measure for capturing occupant information about the premises. The value is captured by the Occupant Quantity term. | 62599063d7e4931a7ef3d708 |
class NN(object): <NEW_LINE> <INDENT> def __init__(self, network_architecture,learning_rate=0.001, batch_size=100): <NEW_LINE> <INDENT> self.sess = tf.InteractiveSession() <NEW_LINE> self.network_architecture = network_architecture <NEW_LINE> self.learning_rate = learning_rate <NEW_LINE> self.batch_size = batch_size <N... | Denoising Autoencoder with an sklearn-like interface implemented using TensorFlow.
adapted from https://jmetzen.github.io/2015-11-27/vae.html | 625990638e71fb1e983bd1d1 |
class AttributeVisitor(ast.NodeVisitor): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.is_usable = True <NEW_LINE> self.name = [] <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return '.'.join(self.name) <NEW_LINE> <DEDENT> def visit_Attribute(self, node): <NEW_LINE> <INDENT> self.generi... | Process attribute node and build the name of the attribute if possible.
Currently only simple expressions are supported (like `foo.bar.baz`).
If it is not possible to get attribute name as string `is_usable` is
set to `True`.
After `visit()` method call `get_name()` method can be used to get
attribute name if `is_usa... | 6259906307f4c71912bb0b3d |
class GenericSelect(QDialog, Ui_Dialog): <NEW_LINE> <INDENT> ADD, SEARCH = range(2) <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(GenericSelect, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self._stackedWidget = QStackedWidget() <NEW_LINE> self.contentsPlaceholder.addWidget(se... | Common selection interface | 6259906345492302aabfdbe1 |
class Layer(ABC, Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass | Abstract class for Layer | 625990637d847024c075dadc |
class TestCSInsertUserRequest(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 testCSInsertUserRequest(self): <NEW_LINE> <INDENT> pass | CSInsertUserRequest unit test stubs | 6259906324f1403a92686451 |
class UngriddedBoundedCube(UngriddedCube): <NEW_LINE> <INDENT> def __init__(self, data, metadata, coords): <NEW_LINE> <INDENT> from cis.data_io.Coord import CoordList <NEW_LINE> from cis.utils import listify <NEW_LINE> def getmask(arr): <NEW_LINE> <INDENT> mask = np.ma.getmaskarray(arr) <NEW_LINE> try: <NEW_LINE> <INDE... | Cube of variables that share a set of ungridded coordinates.
Definitely not lazy in data management. Mostly copies UngriddedData except,
Methods:
__init__: Fork of cis.read_data_list to open necessary data and applies quality control.
data_flattened: A 2D array where each variable is flattened.
bounds_flattened: The ... | 62599063a8ecb0332587291e |
class TrackNode(_Node): <NEW_LINE> <INDENT> def __init__(self, path=None, parent=None): <NEW_LINE> <INDENT> super(TrackNode, self).__init__(path, parent) <NEW_LINE> if path: <NEW_LINE> <INDENT> path = os.path.join(self._path, u'.meta') <NEW_LINE> self.metadata = json.loads(open(path, 'r').read()) <NEW_LINE> (self.metad... | Track node. | 625990632ae34c7f260ac7ed |
class CmdSyntaxError(FTPCmdError): <NEW_LINE> <INDENT> errorCode = SYNTAX_ERR | Raised when a command syntax is wrong. | 6259906391f36d47f2231a12 |
class issueOTP_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (OTPResult, OTPResult.thrift_spec), None, ), (1, TType.STRUCT, 'e', (ChannelException, ChannelException.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = succes... | Attributes:
- success
- e | 62599063460517430c432bd7 |
class PostsViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> queryset = Posts.objects.all().filter().order_by("-published") <NEW_LINE> serializer_class = PostsSerializer <NEW_LINE> def retrieve(self, request, *args, **kwargs): <NEW_LINE> <INDENT> postId = kwargs['pk'... | API endpoint that allows users to be viewed or edited. | 6259906392d797404e3896e0 |
class ScriptIntentHandler(intent.IntentHandler): <NEW_LINE> <INDENT> def __init__(self, intent_type, config): <NEW_LINE> <INDENT> self.intent_type = intent_type <NEW_LINE> self.config = config <NEW_LINE> <DEDENT> @asyncio.coroutine <NEW_LINE> def async_handle(self, intent_obj): <NEW_LINE> <INDENT> speech = self.config.... | Respond to an intent with a script. | 6259906332920d7e50bc774d |
class AlgorithmApplicationRunExit(RunExit): <NEW_LINE> <INDENT> @property <NEW_LINE> def state(self) -> str: <NEW_LINE> <INDENT> return 'application' <NEW_LINE> <DEDENT> def deepcopy(self): <NEW_LINE> <INDENT> return AlgorithmApplicationRunExit(self.reason) | Run Exit of Algorithm is Application specific | 625990631f5feb6acb1642f1 |
@dataclasses.dataclass <NEW_LINE> class ValidationIssue: <NEW_LINE> <INDENT> type: str <NEW_LINE> identifier: str <NEW_LINE> value: Any | None = None | Error or warning message. | 62599063a79ad1619776b640 |
class EnforceVolumeBackedForZeroDiskFlavorTestCase( test.TestCase, integrated_helpers.InstanceHelperMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(EnforceVolumeBackedForZeroDiskFlavorTestCase, self).setUp() <NEW_LINE> self.glance = self.useFixture(nova_fixtures.GlanceFixture(self)) <NEW_LINE> se... | Tests for the os_compute_api:servers:create:zero_disk_flavor policy rule
These tests explicitly rely on microversion 2.1. | 625990634428ac0f6e659c3a |
class InitializeOAuthResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_AuthorizationURL(self): <NEW_LINE> <INDENT> return self._output.get('AuthorizationURL', None) <NEW_LINE> <DEDENT> def get_CallbackID(self): <NEW_LINE> <... | A ResultSet with methods tailored to the values returned by the InitializeOAuth Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62599063fff4ab517ebcef2f |
class DBConnector_Basic(db.RealDatabaseMixin, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> d = self.setUpRealDatabase() <NEW_LINE> def make_dbc(_): <NEW_LINE> <INDENT> self.dbc = connector.DBConnector(mock.Mock(), self.db_url, os.path.abspath('basedir')) <NEW_LINE> self.dbc.start() <NEW_... | Basic tests of the DBConnector class - all start with an empty DB | 625990638a43f66fc4bf3896 |
class ExtractFeature(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, function, on, new): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> self.on = on <NEW_LINE> self.new = new <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform... | Apply a arbitrary function on a dataframe column and create a new
column to save the result. | 62599063cc0a2c111447c653 |
class TestBrocadeMechDriverV2(test_db_plugin.NeutronDbPluginV2TestCase): <NEW_LINE> <INDENT> _mechanism_name = MECHANISM_NAME <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> _mechanism_name = MECHANISM_NAME <NEW_LINE> ml2_opts = { 'mechanism_drivers': ['brocade'], 'tenant_network_types': ['vlan']} <NEW_LINE> for opt, v... | Test Brocade VCS/VDX mechanism driver.
| 62599063009cb60464d02c3f |
class DataFrameSelector(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, data_type=None): <NEW_LINE> <INDENT> if data_type == None: <NEW_LINE> <INDENT> self.data_type = [np.number] <NEW_LINE> <DEDENT> self.data_type = data_type <NEW_LINE> self.attribute_names = None <NEW_LINE> <DEDENT> def fit(s... | Select columns from a dataframe according to datatypes.
See pandas.DataFrame.select_dtypes(include=[], exclude=[]):
For all numeric types use the numpy dtype numpy.number
For strings you must use the object dtype
For datetimes, use np.datetime64, ‘datetime’ or ‘datetime64’
For timedeltas, use np.timedelta64, ‘timedel... | 62599063627d3e7fe0e08592 |
class UserIDSchema(ma.Schema): <NEW_LINE> <INDENT> id = fields.Str(required=True) <NEW_LINE> @validates("id") <NEW_LINE> def validate_id(self, value): <NEW_LINE> <INDENT> user = User.query.filter_by(id=value).first() <NEW_LINE> if not user: <NEW_LINE> <INDENT> raise ValidationError(f"User id {value} does not exist.") | Validate user id | 6259906376e4537e8c3f0c8a |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.