code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class MessageProxyModel(QSortFilterProxyModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MessageProxyModel, self).__init__() <NEW_LINE> self.setDynamicSortFilter(True) <NEW_LINE> self.setFilterRole(Qt.UserRole) <NEW_LINE> self.setSortCaseSensitivity(Qt.CaseInsensitive) <NEW_LINE> self.setSortRo...
Provides sorting and filtering capabilities for the MessageDataModel. Filtering is based on a collection of exclude and highlight filters.
62598fb7cc0a2c111447b128
class SimulationSpace(goos.Model): <NEW_LINE> <INDENT> type = goos.ModelNameType("simulation_space") <NEW_LINE> mesh = goos.types.PolyModelType(MeshModel) <NEW_LINE> sim_region = goos.types.ModelType(goos.Box3d) <NEW_LINE> pml_thickness = goos.types.ListType(goos.types.IntType(), min_size=6, max_size=6) <NEW_LINE> refl...
Defines a simulation space. A simulation space contains information regarding the permittivity distributions but not the fields, i.e. no information regarding sources and wavelengths. Attributes: name: Name to identify the simulation space. Must be unique. mesh: Meshing information. This describes how the sim...
62598fb797e22403b383b022
class ParsingContext: <NEW_LINE> <INDENT> parenthesis_count = 0 <NEW_LINE> curly_bracket_count = 0 <NEW_LINE> square_bracket_count = 0 <NEW_LINE> in_single_quote = False <NEW_LINE> in_double_quote = False <NEW_LINE> def __init__(self, line): <NEW_LINE> <INDENT> self.line = line <NEW_LINE> <DEDENT> def in_global_express...
Class for determining where to split rmd options
62598fb7ec188e330fdf89ac
class Rename(Command): <NEW_LINE> <INDENT> def __init__(self, callback, uid, script, directories, new_word, refactor): <NEW_LINE> <INDENT> self.script = script <NEW_LINE> self.new_word = new_word <NEW_LINE> self.jedi_refactor = refactor <NEW_LINE> self.directories = directories <NEW_LINE> super(Rename, self).__init__(c...
Get back a python definition where to go
62598fb79f288636728188e0
class EventType(object): <NEW_LINE> <INDENT> def __init__(self, gateway): <NEW_LINE> <INDENT> self.INCOMING_CALL = gateway.jvm.pctelelog.events.EventType.INCOMING_CALL <NEW_LINE> self.MISSED_CALL = gateway.jvm.pctelelog.events.EventType.MISSED_CALL <NEW_LINE> self.CALL_ENDED = gateway.jvm.pctelelog.events.EventType.CAL...
The counterpart for EventType.java enum
62598fb7009cb60464d0163f
class Polynomial(object): <NEW_LINE> <INDENT> def __init__(self, polynomial): <NEW_LINE> <INDENT> self.polynomial = tuple(polynomial) <NEW_LINE> <DEDENT> def get_polynomial(self): <NEW_LINE> <INDENT> return self.polynomial <NEW_LINE> <DEDENT> def __neg__(self): <NEW_LINE> <INDENT> return Polynomial(map(lambda x: (-x[0]...
Class supporting basic arithmetic, simplification, evaluation, and pretty-printing of polynomials.
62598fb7379a373c97d99132
class RequestCoordinatorWrapperException(DeltaException): <NEW_LINE> <INDENT> pass
Is raised when request coordinator wrapper encounters error.
62598fb74a966d76dd5eeff4
class SchemaCache(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._loaded = {} <NEW_LINE> <DEDENT> def _load_base_schema(self, schema_filename): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self._loaded[schema_filename] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> with open(...
Caches loaded schemas
62598fb7a219f33f346c6922
class BaseHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> __TOKEN_LIST = {} <NEW_LINE> def __init__(self, application, request, **kwargs): <NEW_LINE> <INDENT> super(BaseHandler, self).__init__(application, request, **kwargs) <NEW_LINE> <DEDENT> def generate_token(self): <NEW_LINE> <INDENT> while True: <NEW_LIN...
检测用户登陆
62598fb7f9cc0f698b1c535b
class Wedge(Patch): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> pars = (self.center[0], self.center[1], self.r, self.theta1, self.theta2, self.width) <NEW_LINE> fmt = "Wedge(center=(%g, %g), r=%g, theta1=%g, theta2=%g, width=%s)" <NEW_LINE> return fmt % pars <NEW_LINE> <DEDENT> @docstring.dedent_interpd ...
Wedge shaped patch.
62598fb7091ae35668704d3d
class HDF4FileHandler(BaseFileHandler): <NEW_LINE> <INDENT> def __init__(self, filename, filename_info, filetype_info): <NEW_LINE> <INDENT> super(HDF4FileHandler, self).__init__(filename, filename_info, filetype_info) <NEW_LINE> self.file_content = {} <NEW_LINE> file_handle = SD(self.filename, SDC.READ) <NEW_LINE> self...
Small class for inspecting a HDF5 file and retrieve its metadata/header data.
62598fb7460517430c4320ec
class TestUploadSessionDetail(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 testUploadSessionDetail(self): <NEW_LINE> <INDENT> pass
UploadSessionDetail unit test stubs
62598fb72ae34c7f260ab1fa
class CodeMessageException(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, code, msg): <NEW_LINE> <INDENT> super(CodeMessageException, self).__init__("%d: %s" % (code, msg)) <NEW_LINE> self.code = code <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def error_dict(self): <NEW_LINE> <INDENT> return cs_error(self.msg...
An exception with integer code and message string attributes. Attributes: code (int): HTTP error code msg (str): string describing the error
62598fb7aad79263cf42e8f1
class PlotWindow(PlotWidget): <NEW_LINE> <INDENT> def __init__(self, title=None, **kargs): <NEW_LINE> <INDENT> mkQApp() <NEW_LINE> self.win = QtGui.QMainWindow() <NEW_LINE> PlotWidget.__init__(self, **kargs) <NEW_LINE> self.win.setCentralWidget(self) <NEW_LINE> for m in ['resize']: <NEW_LINE> <INDENT> setattr(self, m, ...
(deprecated; use PlotWidget instead)
62598fb7bd1bec0571e15151
class AdaDelta(Optimizer): <NEW_LINE> <INDENT> def __init__(self, beta= 0.9, epsilon=1e-7, **kwargs) -> None: <NEW_LINE> <INDENT> super(AdaDelta, self).__init__(**kwargs) <NEW_LINE> self.D = [] <NEW_LINE> self.beta = beta <NEW_LINE> self.cache = [] <NEW_LINE> self.delta = [] <NEW_LINE> self.eps = epsilon <NEW_LINE> sel...
Implementation of AdaDelta (Adaptive Delta). AdaDelta has no learning rate. It uses different from of Adagrad and RMSprop. Beta recomended as a default. Arguments : ----------- beta : Update coefficient. >>> type : float >>> Default : 0.9 epsilon : Clip value to get rid of 0 division error....
62598fb77c178a314d78d5bc
class TaskForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Task <NEW_LINE> fields = ['task_title', 'task_description', 'task_due'] <NEW_LINE> widgets={ 'task_title': forms.TextInput(attrs = {'placeholder': 'Give the task a name here.'}), 'task_description': forms.Textarea(attrs={'place...
A form for a Task
62598fb7fff4ab517ebcd906
class StateManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super(StateManager, self).get_queryset().filter( state=self.state_filter) <NEW_LINE> <DEDENT> def get_or_create(self, **kwargs): <NEW_LINE> <INDENT> return self.get_queryset().get_or_create( state=self.state_filte...
For searching/creating State Chats only.
62598fb7be383301e025391a
class Post: <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def _rawtext(self): <NEW_LINE> <INDENT> with open(self.path, 'r') as f: <NEW_LINE> <INDENT> rt = f.read() <NEW_LINE> self._rawtext = lambda: rt <NEW_LINE> return rt <NEW_LINE> <DEDENT> <DEDENT> def _md(sel...
Abstracts the concept of Post. Efficiency-wise it is terrible and needs lazy-loading.
62598fb79f288636728188e2
class MelodyAutocompleteEngine: <NEW_LINE> <INDENT> autocompleter: Autocompleter <NEW_LINE> def __init__(self, config: Dict[str, Any]) -> None: <NEW_LINE> <INDENT> self.autocompleter = SimplePrefixTree(config['weight_type']) if config['autocompleter'] == 'simple' else CompressedPrefixTree(config['...
An autocomplete engine that suggests melodies based on a few intervals. The values stored are Melody objects, and the corresponding prefix sequence for a Melody is its interval sequence. Because the prefix is based only on interval sequence and not the starting pitch or duration of the notes, it is possible for diffe...
62598fb7ff9c53063f51a76d
class Trainer(object): <NEW_LINE> <INDENT> def __init__(self, storage, **kwargs): <NEW_LINE> <INDENT> self.storage = storage <NEW_LINE> self.logger = logging.getLogger(__name__) <NEW_LINE> <DEDENT> def train(self, *args, **kwargs): <NEW_LINE> <INDENT> raise self.TrainerInitializationException() <NEW_LINE> <DEDENT> def ...
Base class for all other trainer classes.
62598fb7a219f33f346c6924
class RunMethodGUI(RunMethodBase): <NEW_LINE> <INDENT> def __init__(self, frame): <NEW_LINE> <INDENT> self.frame = frame <NEW_LINE> self.current_dmu = None <NEW_LINE> self.increment = 0 <NEW_LINE> <DEDENT> def get_categories(self): <NEW_LINE> <INDENT> return self.frame.construct_categories() <NEW_LINE> <DEDENT> def get...
This class implements running routing from GUI. Attributes: frame (Tk Frame): main GUI frame. current_dmu (StringVar): StringVar object that tracks when when DMU changes during solution process. increment (double): progress bar increment. Args: frame (Tk Frame): main GUI frame.
62598fb74428ac0f6e658641
class TR(WebElement): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> tagName = "tr"
Defines a table row
62598fb744b2445a339b6a03
class CreateNewClientTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client.defaults['HTTP_AUTHORIZATION'] = get_token() <NEW_LINE> <DEDENT> def test_create_valid_client(self): <NEW_LINE> <INDENT> valid_payload = { "name": "Ian Marcos", "surname": "Carvalho", "email": "ianmarcoscarvalho@gm...
Test module for inserting a new Client
62598fb78e7ae83300ee91bf
class UriSpec(PipelineSpec): <NEW_LINE> <INDENT> pass
Data spec for URI string.
62598fb77047854f4633f4f5
class ModifyJidujilu(ModifyYuedujilu): <NEW_LINE> <INDENT> grok.context(Interface) <NEW_LINE> grok.name('modify_jidujilu') <NEW_LINE> grok.require('zope2.View')
AJAX action for jidu jilu.
62598fb7f548e778e596b6c4
class ComputeNodeDeleteUserOptions(Model): <NEW_LINE> <INDENT> def __init__(self, timeout=30, client_request_id=None, return_client_request_id=False, ocp_date=None): <NEW_LINE> <INDENT> self.timeout = timeout <NEW_LINE> self.client_request_id = client_request_id <NEW_LINE> self.return_client_request_id = return_client_...
Additional parameters for delete_user operation. :param timeout: The maximum time that the server can spend processing the request, in seconds. The default is 30 seconds. Default value: 30 . :type timeout: int :param client_request_id: The caller-generated request identity, in the form of a GUID with no decoration s...
62598fb73317a56b869be5dd
class ODSWriter(BookWriter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> BookWriter.__init__(self) <NEW_LINE> self._native_book = None <NEW_LINE> <DEDENT> def open(self, file_name, **keywords): <NEW_LINE> <INDENT> BookWriter.open(self, file_name, **keywords) <NEW_LINE> self._native_book = ezodf.newdoc( ...
open document spreadsheet writer
62598fb72ae34c7f260ab1fc
class Solution: <NEW_LINE> <INDENT> def validWordSquare(self, words): <NEW_LINE> <INDENT> if len(words) == 0 or len(words) == 1: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> for i in range(1, len(words)): <NEW_LINE> <INDENT> for j in range(i, len(words)): <NEW_LINE> <INDENT> if words[i][j] != words[j][i]: <NEW_L...
@param words: a list of string @return: a boolean
62598fb721bff66bcd722d88
class insert(ignore): <NEW_LINE> <INDENT> def __init__(self, label=None): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> <DEDENT> def apply(self, runner, obj): <NEW_LINE> <INDENT> runner[self.label or obj.__name__].add(obj)
A decorator to explicitly mark that a method of a :class:`~mush.Plug` should be added to a runner by :meth:`~mush.Plug.add_to`. The `label` parameter can be used to indicate a different label at which to add the method, instead of using the name of the method.
62598fb7283ffb24f3cf39a4
class UpdateOwnStatus(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return obj.user_profile.id == request.user.id
allow user to update their own status
62598fb79c8ee82313040203
@python_2_unicode_compatible <NEW_LINE> class Essay(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=20) <NEW_LINE> sub_title = models.CharField(max_length=30, blank=True) <NEW_LINE> body = MDTextField() <NEW_LINE> created_time = models.DateTimeField() <NEW_LINE> modified_time = models.DateTimeFie...
文章的数据库表稍微复杂一点,主要是涉及的字段更多。
62598fb7cc40096d6161a269
class overlappedGenesH3K4Profile(TrackerImages): <NEW_LINE> <INDENT> pass
Chromatin profile per gene
62598fb730dc7b766599f96d
class IdentityNode(ActivationNode): <NEW_LINE> <INDENT> def f(self, x): <NEW_LINE> <INDENT> return x <NEW_LINE> <DEDENT> def derivative(self, x): <NEW_LINE> <INDENT> if isinstance(x, np.ndarray): <NEW_LINE> <INDENT> return np.ones(x.shape) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return 1.0
A node where the activation function is the identity: f(x) = x.
62598fb710dbd63aa1c70cd8
class ItemSimilarity(BaseSimilarity): <NEW_LINE> <INDENT> def __init__(self, model, distance, num_best=None): <NEW_LINE> <INDENT> BaseSimilarity.__init__(self, model, distance, num_best) <NEW_LINE> <DEDENT> def get_similarity(self, source_id, target_id): <NEW_LINE> <INDENT> source_preferences = self.model.preferences_f...
Returns the degree of similarity, of two items, based on its preferences by the users. Implementations of this class define a notion of similarity between two items. Implementations should return values in the range 0.0 to 1.0, with 1.0 representing perfect similarity. Parameters ---------- `model`: DataModel ...
62598fb726068e7796d4ca78
class CreateLiveCallbackRuleResponse(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")
CreateLiveCallbackRule返回参数结构体
62598fb7167d2b6e312b7094
class MockedGoogleAnalyticsSource(GoogleAnalyticsSource): <NEW_LINE> <INDENT> def __init__(self, mocked_value): <NEW_LINE> <INDENT> super(MockedGoogleAnalyticsSource, self).__init__('', 0) <NEW_LINE> self.mocked_value = mocked_value <NEW_LINE> self.last_query = None <NEW_LINE> <DEDENT> def _query(self, **kwargs): <NEW_...
This class is used to mock values returned by Google Analytics API
62598fb77c178a314d78d5be
class EnzymeFamily(Base): <NEW_LINE> <INDENT> __tablename__ = ENZYME_FAMILY_TABLE_NAME <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> expasy_id = Column(String(16), unique=True, index=True, nullable=False, doc='The ExPASy enzyme code.') <NEW_LINE> parent_id = Column(Integer, ForeignKey(f'{EnzymeSuperFamil...
Third level entry
62598fb7fff4ab517ebcd908
class TestView(cocos.layer.Layer): <NEW_LINE> <INDENT> def __init__(self, assets): <NEW_LINE> <INDENT> super(TestView, self).__init__() <NEW_LINE> self.assets = assets <NEW_LINE> nwidget.events.clear(cocos.director.director.window) <NEW_LINE> self.is_event_handler = True <NEW_LINE> ui = CocosWidget() <NEW_LINE> self.ad...
Testing class
62598fb7796e427e5384e8b5
class Attachments(ExtractionMode): <NEW_LINE> <INDENT> __mode__ = 'attachments' <NEW_LINE> def __init__(self, identification_json, basedir=''): <NEW_LINE> <INDENT> super(Attachments, self).__init__(identification_json, basedir=basedir) <NEW_LINE> <DEDENT> def specs(self): <NEW_LINE> <INDENT> basedir, attachments = self...
Attachments extraction mode
62598fb79f288636728188e4
class AsciiFont: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def primary(arg_printable): <NEW_LINE> <INDENT> return "\x1b[10m{0}\x1b[0m".format(arg_printable) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def alternate(arg_printable, arg_alternate_font_no): <NEW_LINE> <INDENT> inserted_no = "1" <NEW_LINE> if int(arg_al...
docstring
62598fb7aad79263cf42e8f4
class PID(object): <NEW_LINE> <INDENT> def __init__(self, pLocalPID, pIdent=0): <NEW_LINE> <INDENT> if not isInteger(pLocalPID) or not isInteger(pIdent): <NEW_LINE> <INDENT> raise InvalidParameter() <NEW_LINE> <DEDENT> self.mLocalPID = pLocalPID <NEW_LINE> self.mIdent = pIdent <NEW_LINE> <DEDENT> def __eq__(self, pOthe...
PID native (non-PB) representation.
62598fb7379a373c97d99136
class ScorecardTemplateItem(object): <NEW_LINE> <INDENT> def __init__(self, scorecard_templates, scorecard): <NEW_LINE> <INDENT> self._scorecard_templates = scorecard_templates <NEW_LINE> self._requestor = self._scorecard_templates._requestor <NEW_LINE> self._data = scorecard <NEW_LINE> self._id = scorecard["id"] <NEW_...
This class represents a scorecard template. It's instantiated by the :class:`proknow.ScorecardTemplates.ScorecardTemplates` class as a complete representation of the scorecard. Attributes: id (str): The id of the scorecard (readonly). data (dict): The complete representation of the scorecard as returned from t...
62598fb791f36d47f2230f39
class JsonHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.file_name = "data.json" <NEW_LINE> <DEDENT> def dump_file(self, x): <NEW_LINE> <INDENT> storage = self.load_file() <NEW_LINE> with open(self.file_name, "w+") as f: <NEW_LINE> <INDENT> if storage is None: <NEW_LINE> <INDENT> city...
Attributes: file_name: File name to which json objects are stored Methods: dump_file(object), load_file(): Used by all other methods, delete_event_in_file(event_id), update_event_in_file(event_id, field_name, field_value).
62598fb74f88993c371f059d
class SessionPeekHelper6(SessionPeekHelper5): <NEW_LINE> <INDENT> pass
Helper class for implementing session peek feature This class works with data constructed by :class:`~plainbox.impl.session.suspend.SessionSuspendHelper6` which has been pre-processed by :class:`SessionPeekHelper` (to strip the initial envelope). The only goal of this class is to reconstruct session state meta-data.
62598fb74c3428357761a3dc
class CeilometerApiPlatformTests(ceilometermanager.CeilometerBaseTest): <NEW_LINE> <INDENT> def test_check_alarm(self): <NEW_LINE> <INDENT> fail_msg = "Creation instance failed" <NEW_LINE> create_kwargs = {} <NEW_LINE> if 'neutron' in self.config.network.network_provider: <NEW_LINE> <INDENT> network = [net.id for net i...
TestClass contains tests that check basic Ceilometer functionality.
62598fb78a349b6b4368635d
class OdmlCsvTable(OdmlTable): <NEW_LINE> <INDENT> def __init__(self, load_from=None): <NEW_LINE> <INDENT> super(OdmlCsvTable, self).__init__(load_from=load_from) <NEW_LINE> <DEDENT> def write2file(self, save_to): <NEW_LINE> <INDENT> self.consistency_check() <NEW_LINE> with open(save_to, 'w') as csvfile: <NEW_LINE> <IN...
Class to create a csv-file from an odml-file
62598fb7091ae35668704d41
class TypeDeclarationFixup(FileMatch): <NEW_LINE> <INDENT> regexp = RE_FILE_BEGIN <NEW_LINE> def gen_patches(self) -> Iterable[Patch]: <NEW_LINE> <INDENT> if self.file.filename_matches('qom/object.h'): <NEW_LINE> <INDENT> self.debug("skipping object.h") <NEW_LINE> return <NEW_LINE> <DEDENT> decl_types: List[Type[TypeDe...
Common base class for code that will look at a set of type declarations
62598fb7956e5f7376df570e
class Pupil_Server(Plugin): <NEW_LINE> <INDENT> def __init__(self, g_pool,address="tcp://127.0.0.1:5000"): <NEW_LINE> <INDENT> super(Pupil_Server, self).__init__(g_pool) <NEW_LINE> self.order = .9 <NEW_LINE> self.context = zmq.Context() <NEW_LINE> self.socket = self.context.socket(zmq.PUB) <NEW_LINE> self.address = add...
pupil server plugin
62598fb721bff66bcd722d8a
class MacroLoadError(Exception): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return ERROR_LOAD_MACRO.format(self.args[0], self.args[1])
Raise this error if an exception occurs during macro import.
62598fb7e5267d203ee6ba20
class DefaultNAT(object): <NEW_LINE> <INDENT> def __init__(self, engine): <NEW_LINE> <INDENT> self.engine = engine <NEW_LINE> <DEDENT> @property <NEW_LINE> def status(self): <NEW_LINE> <INDENT> return self.engine.data["default_nat"] <NEW_LINE> <DEDENT> def enable(self): <NEW_LINE> <INDENT> self.engine.data["default_nat...
Default NAT on the engine is used to automatically create NAT configurations based on internal routing. This simplifies the need to create specific NAT rules, primarily for outbound traffic. .. note:: You must call engine.update() to commit any changes.
62598fb797e22403b383b027
class CRFLoss_gd(nn.Module): <NEW_LINE> <INDENT> def __init__(self, tagset_size, start_tag, end_tag, average_batch=True): <NEW_LINE> <INDENT> super(CRFLoss_gd, self).__init__() <NEW_LINE> self.tagset_size = tagset_size <NEW_LINE> self.average_batch = average_batch <NEW_LINE> self.crit = nn.CrossEntropyLoss(size_average...
loss for greedy decode loss, i.e., although its for CRF Layer, we calculate the loss as .. math:: \sum_{j=1}^n \log (p(\hat{y}_{j+1}|z_{j+1}, \hat{y}_{j})) instead of .. math:: \sum_{j=1}^n \log (\phi(\hat{y}_{j-1}, \hat{y}_j, \mathbf{z}_j)) - \log (\sum_{\mathbf{y}' \in \mathbf{Y}(\mathbf{Z})} \prod_{j=1}...
62598fb72c8b7c6e89bd38e7
class Line(Curve): <NEW_LINE> <INDENT> _revit_object_class = DB.Line <NEW_LINE> @classmethod <NEW_LINE> def new(cls, pt1, pt2): <NEW_LINE> <INDENT> pt1 = XYZ(pt1) <NEW_LINE> pt2 = XYZ(pt2) <NEW_LINE> line = DB.Line.CreateBound(pt1.unwrap(), pt2.unwrap()) <NEW_LINE> return cls(line) <NEW_LINE> <DEDENT> @property <NEW_LI...
DB.Line Wrapper >>> line = Line.new([-10,0], [10,0]) >>> # or >>> line = Line.new(ExistingLineObject) >>> line.create_detail()
62598fb7be383301e025391e
class MedianFilterGpuTools(PluginTools): <NEW_LINE> <INDENT> pass
A plugin to apply 2D/3D median filter on a GPU. The 3D capability is enabled through padding. Note that the kernel_size in 2D will be kernel_size x kernel_size and in 3D case kernel_size x kernel_size x kernel_size.
62598fb7dc8b845886d536da
class Update(ApiNavigator, Operator): <NEW_LINE> <INDENT> bl_idname = "api_navigator.update" <NEW_LINE> bl_label = "API Navigator Update" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> api_update() <NEW_LINE> return {'FINISHED'}
Update the tree structure
62598fb732920d7e50bc6171
class Road(object): <NEW_LINE> <INDENT> def __init__(self, coordinate): <NEW_LINE> <INDENT> self.coordinate=coordinate
Class definition of road. Each road is considered to be a square.
62598fb7be7bc26dc9251eed
class V1ListRunArtifactsResponse(object): <NEW_LINE> <INDENT> openapi_types = { 'count': 'int', 'results': 'list[V1RunArtifact]', 'previous': 'str', 'next': 'str' } <NEW_LINE> attribute_map = { 'count': 'count', 'results': 'results', 'previous': 'previous', 'next': 'next' } <NEW_LINE> def __init__(self, count=None, res...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
62598fb723849d37ff8511d5
class TestShowColormaps(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> plt.close('all') <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> plt.close('all') <NEW_LINE> <DEDENT> def test_all(self): <NEW_LINE> <INDENT> fig = psyc.show_colormaps(use_qt=False) <NEW_LINE> self.assertEqu...
Test the :func:`psy_simple.colors.show_colormaps` function
62598fb799fddb7c1ca62e7c
class Database: <NEW_LINE> <INDENT> def __init__(self, connection_string): <NEW_LINE> <INDENT> engine = sa.create_engine(connection_string) <NEW_LINE> Session.configure(bind=engine) <NEW_LINE> Base.metadata.create_all(engine) <NEW_LINE> <DEDENT> def _nomade_model(self): <NEW_LINE> <INDENT> with session_scope() as sessi...
Class responsible for dealing with simple database operations. (e.g. get migration ID, set current migration ID).
62598fb744b2445a339b6a05
class RegistrationForm(forms.Form): <NEW_LINE> <INDENT> username = forms.RegexField(regex=r'^\w+$', max_length=30, widget=forms.TextInput(attrs=attrs_dict), label=_(u'username')) <NEW_LINE> email = forms.EmailField(widget=forms.TextInput(attrs=dict(attrs_dict, maxlength=75)), label=_(u'email address')) <NEW_LINE> passw...
Form for registering a new user account. Validates that the requested username is not already in use, and requires the password to be entered twice to catch typos. Subclasses should feel free to add any additional validation they need, but should either preserve the base ``save()`` or implement a ``save()`` which acc...
62598fb74a966d76dd5eeffb
class S3Error(CloudBackupLibError): <NEW_LINE> <INDENT> def __init__(self, tree, status, msg=None): <NEW_LINE> <INDENT> self.src = 's3' <NEW_LINE> self.err_no = status <NEW_LINE> self.tree = tree <NEW_LINE> if tree: <NEW_LINE> <INDENT> self._parse() <NEW_LINE> <DEDENT> elif msg: <NEW_LINE> <INDENT> self.msg = msg <NEW_...
Amazon S3 error
62598fb7bf627c535bcb15c6
class BootstrapTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.msa = AlignIO.read("TreeConstruction/msa.phy", "phylip") <NEW_LINE> <DEDENT> def test_bootstrap(self): <NEW_LINE> <INDENT> msa_list = list(Consensus.bootstrap(self.msa, 100)) <NEW_LINE> self.assertEqual(len(msa_list), ...
Test for bootstrap methods.
62598fb73317a56b869be5df
@projects_api.route('/<int:project_id>/sprints/<int:sprint_id>/report') <NEW_LINE> class SprintReport(Resource): <NEW_LINE> <INDENT> def get(self, project_id, sprint_id): <NEW_LINE> <INDENT> result = get_sprint_report(project_id, sprint_id) <NEW_LINE> return result
Operations related to report generation for sprint
62598fb72ae34c7f260ab200
class ModelFormValidation(FormValidation): <NEW_LINE> <INDENT> resource = ModelResource <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> if 'resource' not in kwargs: <NEW_LINE> <INDENT> raise ImproperlyConfigured("You must provide a 'resource' to 'ModelFormValidation' classes.") <NEW_LINE> <DEDENT> self.res...
Override tastypie's standard ``FormValidation`` since this does not care about URI to PK conversion for ``ToOneField`` or ``ToManyField``.
62598fb756ac1b37e6302310
class Conversion(models.Model): <NEW_LINE> <INDENT> deposit = models.OneToOneField(Deposit, related_name='conversion', on_delete=models.DO_NOTHING) <NEW_LINE> from_coin = models.ForeignKey(Coin, verbose_name="From Coin", on_delete=models.DO_NOTHING, related_name='conversions_from') <NEW_LINE> from_address = models.Char...
Once a :class:`models.Deposit` has been scanned, assuming it has a valid address or account/memo, the destination cryptocurrency/token will be sent to the user. Successful conversion attempts are logged here, allowing for reference of where the coins came from, where they went, and what fees were taken.
62598fb71b99ca400228f5c2
class FDSStorage(Storage): <NEW_LINE> <INDENT> def __init__(self,client_conf=None,base_url=None): <NEW_LINE> <INDENT> if client_conf is None: <NEW_LINE> <INDENT> client_conf = settings.FDFS_CLIENT_CONF <NEW_LINE> <DEDENT> self.client_conf = client_conf <NEW_LINE> if base_url is None: <NEW_LINE> <INDENT> base_url = sett...
文件存储
62598fb7627d3e7fe0e06fd4
class CurrentPedalboardObserver(ApplicationObserver): <NEW_LINE> <INDENT> def __init__(self, current_controller): <NEW_LINE> <INDENT> super(CurrentPedalboardObserver, self).__init__() <NEW_LINE> self._current_controller = current_controller <NEW_LINE> <DEDENT> def on_bank_updated(self, bank, update_type, index, origin,...
This viewer allows change the current pedalboard if it is updated or removed or if your bank is updated or removed.
62598fb7283ffb24f3cf39a8
class AuthTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = app.test_client() <NEW_LINE> self.user = { 'username': 'haddie', 'email': 'test@example.com', 'password': 'test_password'} <NEW_LINE> with app.app_context(): <NEW_LINE> <INDENT> db.create_all() <NEW_LINE> <DEDE...
This represents the authentication testcase
62598fb7cc40096d6161a26b
class WeekendShift(Shift): <NEW_LINE> <INDENT> def __init__(self, time, config): <NEW_LINE> <INDENT> super().__init__(time, config) <NEW_LINE> <DEDENT> def check_between(self, day, worker): <NEW_LINE> <INDENT> holidays = self.conf.holidays <NEW_LINE> before_day = holidays[holidays.index(day) - self.conf.day_between_wee...
max_weekend - максимум смен в выходные за месяц
62598fb73d592f4c4edbafe4
class Day(db.Model): <NEW_LINE> <INDENT> __tablename__ = "sp_days" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> day = db.Column(db.Integer) <NEW_LINE> points = db.Column(db.Integer) <NEW_LINE> player_id = db.Column(db.Integer, db.ForeignKey("sp_players.id")) <NEW_LINE> player = db.relationship("Pl...
Model for Day
62598fb732920d7e50bc6173
class MetricsExampleModel(BaseModel): <NEW_LINE> <INDENT> summary: Optional[Dict[str, Any]] <NEW_LINE> output: Optional[Dict[str, Any]] <NEW_LINE> data: Optional[List[Any]] <NEW_LINE> @classmethod <NEW_LINE> def from_metrics(cls, metrics: MetricsExample) -> "MetricsExampleModel": <NEW_LINE> <INDENT> return cls.parse_ob...
A variant of `MetricsExample` based on model.
62598fb7ff9c53063f51a773
class UpdateUEcFirewallResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = {}
UpdateUEcFirewall - 更新防火墙信息,新增和删除规则
62598fb7a8370b77170f0503
class ResourceRequirements(object): <NEW_LINE> <INDENT> def __init__(self, requirement_dict=None): <NEW_LINE> <INDENT> self._requirements = requirement_dict if requirement_dict else {} <NEW_LINE> <DEDENT> def set(self, key, value): <NEW_LINE> <INDENT> if key == "tags": <NEW_LINE> <INDENT> self._set_tag(tags=value) <NEW...
ResourceRequirements class. Contains methods for getting and setting requirement values as well as processing requirements into formats supported by allocators.
62598fb7091ae35668704d45
class SubscriptionNotFound(UserError): <NEW_LINE> <INDENT> def __init__(self, msg='Subscription not found'): <NEW_LINE> <INDENT> UserError.__init__(self, msg)
Raised when a subscription is not found.
62598fb77047854f4633f4fb
class Spectrum(object): <NEW_LINE> <INDENT> def __init__(self,filepath, name): <NEW_LINE> <INDENT> self.filepath = filepath <NEW_LINE> self.name = name <NEW_LINE> self._data, self.spec_dict = self.get_spec() <NEW_LINE> self.x = self._data['x'] <NEW_LINE> self.y = self._data['y'] <NEW_LINE> self.xy_measure = np.array([s...
导入仪器数据,将其数据定义成一个光谱对象,主要属性有`data`和`spec_dict`
62598fb7fff4ab517ebcd90d
class GameSprit(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, image_name, speed = 1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.image = pygame.image.load(image_name) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.speed = speed <NEW_LINE> self.speedy = 0 <NEW_LINE> <DEDENT> def...
飞机大战游戏精灵
62598fb7aad79263cf42e8f9
class Keys(DbEntityKeys, BuiltFormKeys, TemplateKeys, SRSKeys): <NEW_LINE> <INDENT> class Fab(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def ricate(cls, key): <NEW_LINE> <INDENT> return "__".join(cls.prefixes() + [key]) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def prefixes(cls): <NEW_LINE> <INDENT> prefix ...
Keys representing names by which to identity Policies, DBEntities, DbEntityInterests, Media, and Media content types. These values could be represented as instantiations of a reference table, but for now this is adequate. Some of these will also be represented as classes, which might cause the key to be embedded in the...
62598fb767a9b606de5460f7
class GroupsV2GroupV2ClanInfo(object): <NEW_LINE> <INDENT> swagger_types = { 'clan_callsign': 'str', 'clan_banner_data': 'ComponentsschemasGroupsV2ClanBanner' } <NEW_LINE> attribute_map = { 'clan_callsign': 'clanCallsign', 'clan_banner_data': 'clanBannerData' } <NEW_LINE> def __init__(self, clan_callsign=None, clan_ban...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598fb799cbb53fe6830ffc
class SubordinateComponents(Section): <NEW_LINE> <INDENT> ROOT_NAME = 'dsc' <NEW_LINE> type = xmlmap.StringField("@type") <NEW_LINE> c = xmlmap.NodeListField("e:c01", Component) <NEW_LINE> def hasSeries(self): <NEW_LINE> <INDENT> if len(self.c) and (self.c[0].level == 'series' or (self.c[0].c and self.c[0].c[0])): <NEW...
Description of Subordinate Components (dsc element); container lists and series. Expected node element passed to constructor: `ead/archdesc/dsc`.
62598fb71b99ca400228f5c3
class MarriageItem: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I16, 'pos', None, -1, ), (2, TType.I32, 'itemCfgId', None, 0, ), ) <NEW_LINE> def __init__(self, pos=thrift_spec[1][4], itemCfgId=thrift_spec[2][4],): <NEW_LINE> <INDENT> self.pos = pos <NEW_LINE> self.itemCfgId = itemCfgId <NEW_LINE> <DEDENT> def ...
Attributes: - pos - itemCfgId
62598fb7283ffb24f3cf39a9
class Cmd(AlfOperator): <NEW_LINE> <INDENT> __slots__ = ( 'appname', 'args', ) <NEW_LINE> alf_schema = schema.Cmd <NEW_LINE> def _parse_mandatory_args(self, args, kwargs): <NEW_LINE> <INDENT> super(Cmd, self)._parse_mandatory_args(args, kwargs) <NEW_LINE> self.args = list(args[:]) <NEW_LINE> del(args[:]) <NEW_LINE> <DE...
A Command representation, see http://renderman.pixar.com/resources/current/tractor/scriptingOperators.html#cmd Examples -------- @snippet test_examples.py alf_cmd
62598fb7498bea3a75a57c48
class ClusterListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[Cluster]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["Cluster"]] = None, next_link: Optional[str] = None, **kwargs ): <NEW_LINE...
The response of the List Event Hubs Clusters operation. :param value: The Event Hubs Clusters present in the List Event Hubs operation results. :type value: list[~azure.mgmt.eventhub.v2021_11_01.models.Cluster] :param next_link: Link to the next set of results. Empty unless the value parameter contains an incomplete ...
62598fb77c178a314d78d5c4
class ViewCheckerBlock(XBlock): <NEW_LINE> <INDENT> has_children = True <NEW_LINE> state = String(scope=Scope.user_state) <NEW_LINE> position = 0 <NEW_LINE> def student_view(self, context): <NEW_LINE> <INDENT> msg = "{} != {}".format(self.state, self.scope_ids.usage_id) <NEW_LINE> assert self.state == unicode(self.scop...
XBlock for testing user state in views.
62598fb77d847024c075c4e2
class SSA: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = np.array(data) <NEW_LINE> try: <NEW_LINE> <INDENT> self.index = list(data.index) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> self.index = [i for i in range(self.data.shape[0])] <NEW_LINE> <DEDENT> self.M = None <NEW_LINE> self....
Generic instance of a SSA analysis Args: data: array like, input time series, must be one dimensional Attributes: data (array): input time series index (index): index of the time series M (int): Window length N2 (int): Reduced length X (numpy matrix): Trajectory matrix covmat (numpy matrix)...
62598fb7f548e778e596b6cb
@attr(shard=10) <NEW_LINE> class StudioHelpTest(StudioCourseTest): <NEW_LINE> <INDENT> def test_studio_help_links(self): <NEW_LINE> <INDENT> page = DashboardPage(self.browser) <NEW_LINE> page.visit() <NEW_LINE> click_studio_help(page) <NEW_LINE> links = studio_help_links(page) <NEW_LINE> expected_links = [{ 'href': u'h...
Tests for Studio help.
62598fb73346ee7daa3376db
class UserReceivingFormMixin(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.user = kwargs.pop("user", None) <NEW_LINE> super(UserReceivingFormMixin, self).__init__(*args, **kwargs)
Mixin for user receiving in forms. It should be used with UserPassingViewMixin
62598fb7009cb60464d01649
class THSGN(THSHQ): <NEW_LINE> <INDENT> path = 'gn' <NEW_LINE> url = f"{base_url}{path}/" <NEW_LINE> api_name = "同花顺概念" <NEW_LINE> def _parse_head_in_page(self): <NEW_LINE> <INDENT> tr_css = '.m-table tbody tr' <NEW_LINE> trs = self.driver.find_elements_by_css_selector(tr_css) <NEW_LINE> dates = [tr.find_element_by_css...
同花顺概念
62598fb74a966d76dd5eeffe
class Outlier_StandardDev(OutlierMethod): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def execute(self, data): <NEW_LINE> <INDENT> self.mean = mean([value[1] for value in data]) <NEW_LINE> self.std = std([value[1] for value in data]) <NEW_LINE> <DEDENT> def get_scores(self, data...
Statistical outlier detection method using the standard deviation. Usually, items with score > 2 are considered as outliers.
62598fb74527f215b58e9ffc
class ComputeCauseEffectStructure(MapReduce): <NEW_LINE> <INDENT> description = "Computing concepts" <NEW_LINE> @property <NEW_LINE> def subsystem(self): <NEW_LINE> <INDENT> return self.context[0] <NEW_LINE> <DEDENT> def empty_result(self, *args): <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> @staticmethod <NEW_LIN...
Engine for computing a |CauseEffectStructure|.
62598fb7baa26c4b54d4f3e0
class syncthreads_count(Stub): <NEW_LINE> <INDENT> _description_ = '<syncthreads_count()>'
syncthreads_count(predictate) An extension to numba.cuda.syncthreads where the return value is a count of the threads where predicate is true.
62598fb7a8370b77170f0505
class Aug30(Version): <NEW_LINE> <INDENT> def __init__(self, options=None): <NEW_LINE> <INDENT> import parameters_new as parameters <NEW_LINE> self.name = "Aug30" <NEW_LINE> self.Nmin = 280 <NEW_LINE> self.Nmax = 560 <NEW_LINE> self.buried_cutoff = 15.00; self.buried_cutoff_sq...
This is a test to set up rules for different propka versions
62598fb799fddb7c1ca62e7e
class SiteObject(): <NEW_LINE> <INDENT> def __init__(self, filename, md5, site_prefix='', dir_prefix=''): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> self.md5 = md5 <NEW_LINE> self.dir_prefix = dir_prefix <NEW_LINE> self.site_prefix = site_prefix <NEW_LINE> <DEDENT> @property <NEW_LINE> def s3_key(self): <N...
An abstract class for an individual object that can be uploaded to S3
62598fb70fa83653e46f5008
class RateLimitation(asyncpokepyExceptions): <NEW_LINE> <INDENT> def __init__(self, error='Your IP address is being ratelimited by the API. Try again later. Continued overworking may result in your IP being blocked.'): <NEW_LINE> <INDENT> self.error = error <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> ret...
Raised when you are being ratelimited
62598fb771ff763f4b5e789e
class LingerBaseAdapterFactory(LingerPlugin): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LingerBaseAdapterFactory, self).__init__() <NEW_LINE> self.item = LingerBaseAdapter <NEW_LINE> <DEDENT> def get_instance(self, configuration): <NEW_LINE> <INDENT> return self.item(configuration) <NEW_LINE> <D...
Base adapter factory for linger
62598fb74428ac0f6e658648
class UserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> password1 = forms.CharField(label='Password', widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField(label='Password confirmation', widget=forms.PasswordInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('email', '...
A form for creating new users. Includes all the required fields, plus a repeated password.
62598fb74a966d76dd5eefff
class ScreenShotError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, details=None): <NEW_LINE> <INDENT> super().__init__(message) <NEW_LINE> self.details = details or {}
Error handling class.
62598fb7236d856c2adc94d3
class InputStream: <NEW_LINE> <INDENT> def probe(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> vim.eval("getchar(0)") <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> raise UserInterrupt()
Get a character from Vim's input stream. Used to check for keyboard interrupts.
62598fb7aad79263cf42e8fb
class IntegrityError(CacaoAccountingException): <NEW_LINE> <INDENT> pass
Clase para generar errores de Integridad.
62598fb75166f23b2e243503
class PixivAuthFailed(PixivError): <NEW_LINE> <INDENT> pass
Auth error
62598fb7442bda511e95c582
class Development(Config): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> TESTING = True
Configurations for development
62598fb7be8e80087fbbf190
class RedHatSssd(sssd, RedHatPlugin): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> super(RedHatSssd, self).setup()
sssd-related Diagnostic Information on Red Hat based distributions
62598fb7cc0a2c111447b134