code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@dataclass <NEW_LINE> class CommandInterface(ABC): <NEW_LINE> <INDENT> name: str <NEW_LINE> help: str <NEW_LINE> allow_outside_project: bool <NEW_LINE> @abstractmethod <NEW_LINE> def run(self, args: Optional[list] = None) -> None: <NEW_LINE> <INDENT> ...
Interface for a command that can be registered to the CommandManager. Attributes: name: The name of the command, also used as the name of the command that is called. help: The help text for the command. allow_outside_project: Whether the command can be called from outside a project.
62598f0aadb09d7d5dc090c5
class CategoricalDistRLTest(tf.test.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CategoricalDistRLTest, self).setUp() <NEW_LINE> self.atoms_tm1 = tf.constant([0.5, 1.0, 1.5], dtype=tf.float32) <NEW_LINE> self.atoms_t = tf.identity(self.atoms_tm1) <NEW_LINE> self.logits_q_tm1 = tf.constant( ...
Abstract base class for Distributional RL value ops tests.
62598f0a9f2886367281730e
class Matches(SQLAlchemyObjectType, MatchAttribute): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = ModelMatches <NEW_LINE> interfaces = (graphene.relay.Node,)
Matches node.
62598f0a377c676e912f62f1
class Data(object): <NEW_LINE> <INDENT> def __init__(self, board_state, policy, value) -> (chess.Board, int, int): <NEW_LINE> <INDENT> self.board_state = board_state <NEW_LINE> self.policy = policy <NEW_LINE> self.value = value
data format board_state is the board(8x8) -> input policy represents a move stored by a int number because there is a hash between moves and int(see hash) -> output value represents a result -> output
62598f0a3d592f4c4edb9a01
class NYSGeocoderDialogTest(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 test_icon_png(self): <NEW_LINE> <INDENT> path = ':/plugins/NYSGeocoder/icon.png' <NEW_LINE> icon = QIcon(path) <NEW_LINE>...
Test rerources work.
62598f0a656771135c4881a4
class OnTaskNoWorkflow(OnTaskException): <NEW_LINE> <INDENT> pass
Exception to raise when there is no workflow.
62598f0aa219f33f346c5345
class PermLevel(enum.IntEnum): <NEW_LINE> <INDENT> REVOKED = 0 <NEW_LINE> READ = 1 <NEW_LINE> REVIEW = 2 <NEW_LINE> EDIT = 3 <NEW_LINE> CREATE = 4 <NEW_LINE> ADMIN = 5
Actions permitted by a certain key. Remember to use PermLevel.SOMEVALUE.value; see documentation on LemmaType enum. Do NOT modify existing values in this enum or consistency with values in the database will be lost.
62598f0a26068e7796d4b470
class AnimationLinearFunc(AnimationLinear): <NEW_LINE> <INDENT> def __init__(self, point: BasePoint, target: Point, func: Callable): <NEW_LINE> <INDENT> super().__init__(point, target) <NEW_LINE> self.func = func <NEW_LINE> <DEDENT> def update(self, t): <NEW_LINE> <INDENT> super().update(self.func(t))
Animate from point to target as t goes from 0 to 1
62598f0ad8ef3951e32c73e0
class WhenToSaveQuantumGraphs(Enum): <NEW_LINE> <INDENT> QGRAPH = 1 <NEW_LINE> TRANSFORM = 2 <NEW_LINE> PREPARE = 3 <NEW_LINE> SUBMIT = 4 <NEW_LINE> NEVER = 5
Values for when to save the job quantum graphs.
62598f0a5fcc89381b2656b9
class GwtGenerator(java_generator.BaseJavaGenerator): <NEW_LINE> <INDENT> def __init__(self, discovery, options=None): <NEW_LINE> <INDENT> super(GwtGenerator, self).__init__(discovery, 'gwt', GwtLanguageModel(options=options), options=options) <NEW_LINE> self.api.module.SetPath('%s/shared' % self.api.values['name']) <N...
The GWT code generator.
62598f0a0fa83653e46f39fe
class ClientSecrets: <NEW_LINE> <INDENT> client_id = "" <NEW_LINE> client_secret = "" <NEW_LINE> redirect_uris = [ "https://localhost" ] <NEW_LINE> auth_uri = "https://bitbucket.org/site/oauth2/authorize" <NEW_LINE> token_uri = "https://bitbucket.org/site/oauth2/access_token" <NEW_LINE> server_base_uri = "https://api.b...
The structure of this class follows Google convention for `client_secrets.json`: https://developers.google.com/api-client-library/python/guide/aaa_client_secrets Bitbucket does not emit this structure so it must be manually constructed.
62598f0a31939e2706ed0fef
class AliasedTable(object): <NEW_LINE> <INDENT> def __init__(self, alias_name: str, table: 'typing.Type[Table]'): <NEW_LINE> <INDENT> self.alias_name = alias_name <NEW_LINE> self.alias_table = table <NEW_LINE> <DEDENT> def __getattr__(self, item): <NEW_LINE> <INDENT> return getattr(self.alias_table, item) <NEW_LINE> <D...
Represents an "aliased table". This is a transparent proxy to a :class:`.TableMeta` table, and will create the right Table objects when called. .. code-block:: python3 class User(Table): id = Column(Integer, primary_key=True, autoincrement=True) username = Column(String, nullable=False, unique=Tru...
62598f0aec188e330fdf73cb
class Page(models.Model): <NEW_LINE> <INDENT> page = models.CharField(max_length=200) <NEW_LINE> content = models.TextField() <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.page
The Page Model is used to populate content in each of the individual pages, the content is stored as HTML in the database
62598f0acc40096d61619767
class Entry(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey(User, related_name='entries', default=_user) <NEW_LINE> title = models.CharField(_(u'title'), max_length=128) <NEW_LINE> timestamp = models.DateTimeField(_(u'entry date and time')) <NEW_LINE> html = models.BooleanField(_('html in body?')) <NEW_LI...
A blog post entry. Author, title, and body are required. Other fields optional.
62598f0a956e5f7376df4c09
class GitHub(object): <NEW_LINE> <INDENT> def _access_API(self, path, params=None): <NEW_LINE> <INDENT> url = 'https://api.github.com/' + '/'.join(path) <NEW_LINE> if params and type(params) is dict: <NEW_LINE> <INDENT> url += '?' + '&'.join([str(x) + '=' + str(params[x]) for x in params.keys()]) <NEW_LINE> <DEDENT> re...
Simple api wrapper for the Github API v3. Currently only supports the small thing that SB needs it for - list of cimmots.
62598f0a97e22403b38399fa
class AddPathTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_directory(self) -> None: <NEW_LINE> <INDENT> args = ['--foo'] <NEW_LINE> with tempfile.TemporaryDirectory() as directory: <NEW_LINE> <INDENT> load.add_path(runfiles.Runfiles({'RUNFILES_DIR': directory}), args, [pathlib.PurePosixPath('foo'), pathlib.Pure...
Unit tests for the load.add_path function.
62598f0a377c676e912f62f2
class GenericLogTag(DTTag): <NEW_LINE> <INDENT> def __init__(self, name, function): <NEW_LINE> <INDENT> DTTag.__init__ ( self, name, isempty=1, modules = [LogObj, ServiceRegistry]) <NEW_LINE> self._func = function <NEW_LINE> <DEDENT> def genCode(self, indent, codeout, tagreg, tag): <NEW_LINE> <INDENT> DTCompilerUtil.ta...
the <:log:>, <:debug:>, <:warn:>, and <:error:> tags
62598f0aab23a570cc2d42f9
class Operations: <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer) -> None: <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = config <NEW_LINE> <DEDENT> @dist...
Operations async operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.iothub.v2019_11_04.models :param client: ...
62598f0a851cf427c66b6de3
class Plugin(object): <NEW_LINE> <INDENT> descr=None <NEW_LINE> name=None <NEW_LINE> descr=None <NEW_LINE> infoProvider=None <NEW_LINE> prio=0 <NEW_LINE> def setName(self,name): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> <DEDENT> def getPriority(self): <NEW_LINE> <INDENT> return self.prio <NEW_LINE> <DEDENT> def set...
Base class from which every WHALE plugin must inherit. It provides simple function so that every plugin can be configured through a text file. The config file has to be in the .ini format. See http://docs.python.org/2/library/configparser.html for further details.
62598f0a8a349b6b43684d5e
class UpdateConfiguration(actions.ActionPlugin): <NEW_LINE> <INDENT> in_rdfvalue = rdfvalue.Dict <NEW_LINE> UPDATEABLE_FIELDS = ["Client.compression", "Client.foreman_check_frequency", "Client.control_urls", "Client.max_post_size", "Client.max_out_queue", "Client.poll_min", "Client.poll_max", "Client.poll_slew", "Clien...
Updates configuration parameters on the client.
62598f0a26068e7796d4b472
class Observer(AbstractObserver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def update_placement(self, board, placement, id_to_name): <NEW_LINE> <INDENT> print(json.dumps(board.dump_as_json(id_to_name))) <NEW_LINE> <DEDENT> def update_turn(self, board, turn, id_to_name): <NEW_...
Interface for a Observer object in Santorini.
62598f0aadb09d7d5dc090c9
class FieldRef(ind.FieldRef): <NEW_LINE> <INDENT> def __init__(self, attribs): <NEW_LINE> <INDENT> super(FieldRef, self).__init__() <NEW_LINE> self.field = None <NEW_LINE> for key, value in attribs.items(): <NEW_LINE> <INDENT> setattr(self, key, value) <NEW_LINE> <DEDENT> self.Extension = []
Represents a <FieldRef> tag in v3.2 and provides methods to convert to PFA.
62598f0a7c178a314d78bfba
@python_2_unicode_compatible <NEW_LINE> class ExtractedSourceFile(models.Model): <NEW_LINE> <INDENT> source_package = models.ForeignKey( SourcePackage, related_name='extracted_source_files') <NEW_LINE> extracted_file = models.FileField( upload_to=_extracted_source_file_upload_path) <NEW_LINE> name = models.CharField(ma...
Model representing a single file extracted from a source package archive.
62598f0a9f28863672817312
@base.ReleaseTracks(base.ReleaseTrack.BETA, base.ReleaseTrack.GA) <NEW_LINE> class GetIamPolicy(base.ListCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> service_flag = common_flags.producer_service_flag( suffix='whose IAM policy is to be described') <NEW_LINE> service_flag.A...
Describes the IAM policy for a service. Gets the IAM policy for a produced service, given the service name. ## EXAMPLES To print the IAM policy for a service named `my-service`, run: $ {command} my-service
62598f0aec188e330fdf73cd
class Job(Process): <NEW_LINE> <INDENT> NoInSystem=0 <NEW_LINE> def execute(self,stime): <NEW_LINE> <INDENT> arrTime=now() <NEW_LINE> self.trace("Hello World") <NEW_LINE> Job.NoInSystem +=1 <NEW_LINE> m.observe(Job.NoInSystem) <NEW_LINE> yield request,self,server <NEW_LINE> self.trace("At last ") <NEW_LINE> t = expo...
Jobs request a gatekeeper and hold it for an exponential time
62598f0a099cdd3c63674965
class SaveIntermediateModelCallBack(xgb.callback.TrainingCallback): <NEW_LINE> <INDENT> def __init__(self, intermediate_model_dir, model_name, is_master): <NEW_LINE> <INDENT> self.callback = SaveIntermediateModel(intermediate_model_dir, model_name) <NEW_LINE> self.is_master = is_master <NEW_LINE> <DEDENT> def after_ite...
The new implementation of callback functions from 1.3.
62598f0a956e5f7376df4c0a
class Component(template.Template): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def getListData(self): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> return False
Base component for the list component.
62598f0a377c676e912f62f3
class AuthUser: <NEW_LINE> <INDENT> def __init__(self, handle): <NEW_LINE> <INDENT> self.__handle = handle <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.destroy() <NEW_LINE> <DEDENT> except (NameError, AttributeError): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> <DEDENT> def ...
Contains user-specific authorization options.
62598f0aad47b63b2c5a6334
class StolasEbooksAddTooTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def _get_mocked_bot(self): <NEW_LINE> <INDENT> head, _ = os.path.split(__file__) <NEW_LINE> bot = StolasEbooks("test.conf") <NEW_LINE> bot.markov = mock.MagicMock() <NEW_LINE> bot.connect_to_sqlite = mock.MagicMock() <NEW_LINE> bot.mastodon = mock...
Tests for StolasEbooks.add_toot_to_corpus
62598f0a656771135c4881a8
class Output: <NEW_LINE> <INDENT> def __init__(self, txid, index): <NEW_LINE> <INDENT> if isinstance(txid, int): <NEW_LINE> <INDENT> self.txid = txid.to_bytes(32, 'big') <NEW_LINE> <DEDENT> elif isinstance(txid, bytes): <NEW_LINE> <INDENT> self.txid = txid <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise Exception('...
Represents a Bitcoin input from a transaction. This is an output in the view of the previous tx, because it becomes an input of the current one.
62598f0abe7bc26dc92513f0
class SGDW(Optimizer): <NEW_LINE> <INDENT> def __init__(self, params, lr=1e-3, momentum=0, dampening=0, weight_decay=0, nesterov=False): <NEW_LINE> <INDENT> defaults = dict(lr=lr, momentum=momentum, dampening=dampening, weight_decay=weight_decay, nesterov=nesterov) <NEW_LINE> if nesterov and (momentum <= 0 or dampening...
Implements stochastic gradient descent warm (optionally with momentum). It has been proposed in `Fixing Weight Decay Regularization in Adam`_. Nesterov momentum is based on the formula from `On the importance of initialization and momentum in deep learning`__. Args: params (iterable): iterable of parameters to o...
62598f0aa219f33f346c5349
class QInstance(TextInstance): <NEW_LINE> <INDENT> def __init__(self, first_sentence, second_sentence, label): <NEW_LINE> <INDENT> super(QInstance, self).__init__(label=label) <NEW_LINE> self.first_sentence_tokenized = self.tokenizer.tokenize_for_indexer(first_sentence) <NEW_LINE> self.second_sentence_tokenized = self....
docstring for QInstance
62598f0aec188e330fdf73cf
class ChangePasswordView(APIView): <NEW_LINE> <INDENT> serializer_class = PasswordChangeRequestSerializer <NEW_LINE> @method_decorator(ensure_csrf_cookie) <NEW_LINE> @method_decorator(never_cache) <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> if request.user.is_anonymous: <NEW_LINE> <INDENT> return Response( ...
Provides the ability to change password.
62598f0ad8ef3951e32c73e2
class user_pz_info(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, user_pz_info, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, user_pz_info, name) <NEW_LINE> __repr__ = _swig_...
Proxy of C user_pz_info struct.
62598f0a5fdd1c0f98e5cabe
class BuiltInRelationship(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str' } <NEW_LINE> attribute_map = { 'id': 'id' } <NEW_LINE> required_args = { } <NEW_LINE> def __init__( self, id=None, ): <NEW_LINE> <INDENT> if id is not None: <NEW_LINE> <INDENT> self.id = id <NEW_LINE> <DEDENT> <DEDENT> def __setattr__(...
Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
62598f0a97e22403b38399ff
class TeXMacro(TeXObject): <NEW_LINE> <INDENT> has_arguments = True <NEW_LINE> doc_field_types = [ GroupedField('arguments', label=l_('Arguments'), names=('argument', 'arg', 'parameter', 'param'), can_collapse=True), GroupedField('keywordarguments', label=l_('Keyword Arguments'), names=('karg', 'kwarg', 'kparam', 'kwpa...
Description of a TeX macro or environment.
62598f0a7b180e01f3e485d7
class CueSheetReference (pyxb.binding.datatypes.ID): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'CueSheetReference') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('http://ddex.net/xml/20110630/ddex.xsd', 432, 4) <NEW_LINE> _Documentation = 'A Reference to a CueSheet.'
A Reference to a CueSheet.
62598f0a3d592f4c4edb9a07
class BookListView(TemplateTableViewMixin, TemplateTablePaginationMixin, DashboardFilterView): <NEW_LINE> <INDENT> model = Book <NEW_LINE> pagination_class = TablePagination <NEW_LINE> filterset_class = BookFilter <NEW_LINE> table_class = BookTable <NEW_LINE> template_name = 'dashboard_list.html' <NEW_LINE> alias = BOO...
View for rendering book's table.
62598f0a377c676e912f62f4
class CellRendererTextEdit(Gtk.CellRendererText): <NEW_LINE> <INDENT> __gtype_name__ = 'CellRendererTextEdit' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> Gtk.CellRendererText.__init__(self) <NEW_LINE> <DEDENT> def do_start_editing( self, event, treeview, path, background_area, cell_area, flags): <NEW_LINE> <INDE...
To be used where you normally use Gtk.CellRendererText and you want to avoid losing the text if the user clicks outside the cell (Like an 'OK' button.
62598f0aab23a570cc2d42fb
class YXProjector(OrthoProjector): <NEW_LINE> <INDENT> _cut_displayed = 'yx'
The ``YXProjector`` class enables to combine coronal and sagittal views on the same figure through 2D projections with :func:`~nilearn.plotting.plot_glass_brain`. This visualization mode can be activated by setting ``display_mode='yx'``: .. code-block:: python from nilearn.datasets import load_mni152_template ...
62598f0a50812a4eaa62017b
class ComponentFactoryPropertiesCompleter(Completer): <NEW_LINE> <INDENT> def complete( self, config, prompt, session, context, current_arguments, current ): <NEW_LINE> <INDENT> with use_ipopo(context) as ipopo: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> for idx, completer_id in enumerate(config.completers): <NEW_LIN...
Completes the property names of iPOPO Component factories
62598f0abe7bc26dc92513f1
class CustomBusinessDay(_CustomMixin, BusinessDay): <NEW_LINE> <INDENT> _cacheable = False <NEW_LINE> _prefix = 'C' <NEW_LINE> _attributes = frozenset(['n', 'normalize', 'weekmask', 'holidays', 'calendar', 'offset']) <NEW_LINE> def __init__(self, n=1, normalize=False, weekmask='Mon Tue Wed Thu Fri', holidays=None, cale...
DateOffset subclass representing possibly n custom business days, excluding holidays Parameters ---------- n : int, default 1 offset : timedelta, default timedelta(0) normalize : bool, default False Normalize start/end dates to midnight before generating date range weekmask : str, Default 'Mon Tue Wed Thu Fri' ...
62598f0aec188e330fdf73d1
class slot_state(Enum): <NEW_LINE> <INDENT> VACANT = 0 <NEW_LINE> OCCUPIED = 1
Enum for states of a slot
62598f0adc8b845886d520e7
class DefinedCustomObject(object): <NEW_LINE> <INDENT> __slots__ = ( '_robotID', '_success', ) <NEW_LINE> @property <NEW_LINE> def robotID(self): <NEW_LINE> <INDENT> return self._robotID <NEW_LINE> <DEDENT> @robotID.setter <NEW_LINE> def robotID(self, value): <NEW_LINE> <INDENT> self._robotID = msgbuffers.validate_inte...
Generated message-passing message.
62598f0acc40096d6161976a
class RawImageGLWidget(QOpenGLWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None, scaled=False): <NEW_LINE> <INDENT> QOpenGLWidget.__init__(self, parent) <NEW_LINE> self.scaled = scaled <NEW_LINE> self.image = None <NEW_LINE> self.uploaded = False <NEW_LINE> self.smooth = False <NEW_LINE> self.opts = None <NEW...
Similar to RawImageWidget, but uses a GL widget to do all drawing. Performance varies between platforms; see examples/VideoSpeedTest for benchmarking. Checks if setConfigOptions(imageAxisOrder='row-major') was set.
62598f0a4a966d76dd5ed9f4
class FrameScreen(FloatLayout): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(FrameScreen, self).__init__(**kwargs) <NEW_LINE> self.clk = None <NEW_LINE> self.conf = FrameConfiguration() <NEW_LINE> <DEDENT> def call_settings(self, dt): <NEW_LINE> <INDENT> if self.clk: <NEW_LINE> <INDENT> C...
This class handles the frame application
62598f0a377c676e912f62f5
class AllauthTwoFactorMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> match = resolve(request.path) <NEW_LINE> if not match.url_name or not match.url_name.startswith( 'two-factor-authenticate'): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> del request.session['al...
Reset the login flow if another page is loaded halfway through the login. (I.e. if the user has logged in with a username/password, but not yet entered their two-factor credentials.) This makes sure a user does not stay half logged in by mistake.
62598f0a60cbc95b06362e52
class Timeout(TimeoutError): <NEW_LINE> <INDENT> def __init__(self, lock_file): <NEW_LINE> <INDENT> self.lock_file = lock_file <NEW_LINE> return None <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> temp = "The file lock '{}' could not be acquired." .format(self.lock_file) <NEW_LINE> return temp
Raised when the lock could not be acquired in *timeout* seconds.
62598f0a7cff6e4e811b4508
class SequentialExampleScheme(IndexScheme): <NEW_LINE> <INDENT> def get_request_iterator(self): <NEW_LINE> <INDENT> return iter_(xrange(self.num_examples))
Sequential examples iterator. Returns examples in order.
62598f0ad486a94d0ba2aae7
class SimilarWords: <NEW_LINE> <INDENT> embedding_dict = dict() <NEW_LINE> file_name = "" <NEW_LINE> def __init__(self, f="./wiki-data/glove.6B.100d.txt"): <NEW_LINE> <INDENT> self.file_name = f <NEW_LINE> self.initialize_dict() <NEW_LINE> <DEDENT> def initialize_dict(self): <NEW_LINE> <INDENT> file = open(self.file_na...
Determines similarity between 2 words using GloVe
62598f0a55399d3f05625048
class Firewall(DMObject): <NEW_LINE> <INDENT> def __init__(self, instance): <NEW_LINE> <INDENT> DMObject.__init__(self, instance) <NEW_LINE> self.register_child(ExIntfConfigRelFolder()) <NEW_LINE> self.register_child(InIntfConfigRelFolder()) <NEW_LINE> self.register_child(Connectors('CONN', Connector)) <NEW_LINE> self....
This is the function configuration of ASA, assuming the name of "MFunc" element in the device_specifcation is "Firewall". Add firewall related configuration objects by call self.register_child(dmobj) in the constructor as it is done in DeviceModel.__init(self)__.
62598f0acc40096d6161976b
class TrackListPost(ResourceList): <NEW_LINE> <INDENT> def before_post(self, args, kwargs, data): <NEW_LINE> <INDENT> require_relationship(['event'], data) <NEW_LINE> if not has_access('is_track_organizer', event_id=data['event']): <NEW_LINE> <INDENT> raise ForbiddenError({'source': ''}, 'Track-organizer access is requ...
List and create Tracks
62598f0abf627c535bcaff98
class StateChangeKind(Enum): <NEW_LINE> <INDENT> none = 0 <NEW_LINE> add = 1 <NEW_LINE> update = 2 <NEW_LINE> remove = 3
A enumeration that represents the kind of state change for an actor state when saves change is called to a set of actor states.
62598f0a5fc7496912d47804
class GVDoc(object): <NEW_LINE> <INDENT> def add_node(self, node_id, label, shape="", color="", style="", fillcolor="", url="", htmloutput=False): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def add_link(self, id1, id2, style="", head="", tail="", comment=""): <NEW_LINE> <INDENT> raise NotImplemen...
Abstract Interface for Graphviz document generators. Output formats for Graphviz reports must implement this interface to be used by the report system.
62598f0abe7bc26dc92513f3
class PatientEditForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = models.Patient <NEW_LINE> fields = ['first_name', 'last_name', 'email', 'insurance_information', 'street', 'city', 'state', 'country', 'zip', 'emergency_cname', 'emergency_cnumber', 'patient_doctor','number']
Edit form for editing the available fields for a patient
62598f0a7c178a314d78bfc2
class LocaleMiddleware(object): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> if 'lang' in request.GET: <NEW_LINE> <INDENT> language = request.GET.get('lang', False) <NEW_LINE> current_site = get_current_site() <NEW_LINE> possible_languages = settings.LANGUAGES <NEW_LINE> for possible_lang...
Middleware for changing language
62598f0a5fdd1c0f98e5cac4
class SQL_insert_test(SQL_base_template): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.BASE_SQL = 'test_base' <NEW_LINE> self.VALUE_SQL = 'test_value' <NEW_LINE> <DEDENT> pass
科技统计外部数据导入脚本模版 导入表 tesc
62598f0a97e22403b3839a05
class ThreeLayerConvNet(object): <NEW_LINE> <INDENT> def __init__(self, input_dim=(3, 32, 32), num_filters=32, filter_size=7, hidden_dim=100, num_classes=10, weight_scale=1e-3, reg=0.0, dtype=np.float32): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> self.reg = reg <NEW_LINE> self.dtype = dtype <NEW_LINE> C,H,W = inp...
A three-layer convolutional network with the following architecture: conv - relu - 2x2 max pool - affine - relu - affine - softmax The network operates on minibatches of data that have shape (N, C, H, W) consisting of N images, each with height H and width W and with C input channels.
62598f0a31939e2706ed0ff4
class Option(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> class NotSpecified(object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, default=NotSpecified): <NEW_LINE> <INDENT> self.default = default <NEW_LINE> <DEDENT> def is_required(self): <NEW_LINE> <INDENT> return self.defaul...
Represents a Config option.
62598f0af9cc0f698b1c4861
class GroupInfoMember(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MemberId = None <NEW_LINE> self.ClientId = None <NEW_LINE> self.ClientHost = None <NEW_LINE> self.Assignment = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.MemberId = params.get("M...
consumer信息
62598f0aa05bb46b3848939d
class AuditCaseCategoryRelationPage(object): <NEW_LINE> <INDENT> swagger_types = { 'pagination': 'OffsetInfo', 'results': 'list[AuditCaseCategoryRelation]' } <NEW_LINE> attribute_map = { 'pagination': 'pagination', 'results': 'results' } <NEW_LINE> def __init__(self, pagination=None, results=None): <NEW_LINE> <INDENT> ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f0ad486a94d0ba2aaeb
class SimplePreviewTestCase(base.TestCase): <NEW_LINE> <INDENT> def _dock(self): <NEW_LINE> <INDENT> return self.findVisibleDock('Previe&w')
Only for very minimal testing of the Preview dock.
62598f0abe7bc26dc92513f4
class Actuator(object): <NEW_LINE> <INDENT> GPIO.setmode(GPIO.BCM) <NEW_LINE> GPIO.setwarnings(False) <NEW_LINE> def __init__(self, ena=25, in1=24, in2=23, servopin=17): <NEW_LINE> <INDENT> self.ENA = ena <NEW_LINE> self.IN1 = in1 <NEW_LINE> self.IN2 = in2 <NEW_LINE> self.SERVOPIN = servopin <NEW_LINE> GPIO.setup(self....
使用Adafruit_Python_PCA968
62598f0a9f2886367281731c
class PyTest(TestCommand): <NEW_LINE> <INDENT> user_options = TestCommand.user_options + [ ("with-coverage=", "c", "Generate coverage reports.") ] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> TestCommand.initialize_options(self) <NEW_LINE> self.with_coverage = None <NEW_LINE> <DEDENT> def finalize_optio...
Copied from py.test docs.
62598f0a71ff763f4b5e6289
class IsOAuth(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> ok, err_view = DoOAuthCheck(request, None, view) <NEW_LINE> return ok
Allows access only to OAuth authenticated users.
62598f0af548e778e596a0ae
class TodoTxtParser: <NEW_LINE> <INDENT> def __init__(self, encoding='utf-8', task_type=None): <NEW_LINE> <INDENT> self.encoding = encoding <NEW_LINE> self.task_type = task_type or Task <NEW_LINE> self.linesep = os.linesep <NEW_LINE> <DEDENT> def parse(self, target): <NEW_LINE> <INDENT> if isinstance(target, pathlib.Pa...
A parser for todo.txt-like formatted strings or files
62598f0a5fcc89381b2656bf
class VendingMachine(object): <NEW_LINE> <INDENT> def __init__(self, product, price): <NEW_LINE> <INDENT> self.product = product <NEW_LINE> self.price = price <NEW_LINE> self.cash = 0 <NEW_LINE> self.stock = 0 <NEW_LINE> <DEDENT> def restock(self, amount): <NEW_LINE> <INDENT> if amount > 0: <NEW_LINE> <INDENT> self.sto...
A vending machine that vends some product for some price. >>> v = VendingMachine('candy', 10) >>> v.vend() 'Machine is out of stock.' >>> v.restock(2) 'Current candy stock: 2' >>> v.vend() 'You must deposit $10 more.' >>> v.deposit(7) 'Current balance: $7' >>> v.vend() 'You must deposit $3 more.' >>> v.deposit(5) 'Cur...
62598f0af9cc0f698b1c4862
class NumberParam(Parameter): <NEW_LINE> <INDENT> __slots__ = tuple() <NEW_LINE> def __int__(self): <NEW_LINE> <INDENT> return int(super(NumberParam, self).value()) <NEW_LINE> <DEDENT> def __float__(self): <NEW_LINE> <INDENT> return float(super(NumberParam, self).value()) <NEW_LINE> <DEDENT> def _validate(self, val, co...
A template parameter of type "Number".
62598f0a4a966d76dd5ed9fa
class OAuthConsumer(object): <NEW_LINE> <INDENT> key = None <NEW_LINE> secret = None <NEW_LINE> def __init__(self, key, secret): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> self.secret = secret
OAuthConsumer is a data type that represents the identity of the Consumer via its shared secret with the Service Provider.
62598f0aad47b63b2c5a633e
class Edge(): <NEW_LINE> <INDENT> def __init__(self, parent, child): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.child = child <NEW_LINE> self.p_coords = [0.0]*3 <NEW_LINE> self.c_coords = [0.0]*3 <NEW_LINE> self.init_coords() <NEW_LINE> <DEDENT> def init_coords(self): <NEW_LINE> <INDENT> p_coords = s...
And edge object that exists as a connection between two nodes.
62598f0a3346ee7daa336bf7
class Queue(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> <DEDENT> def enque(self, item): <NEW_LINE> <INDENT> self.items.append(item) <NEW_LINE> <DEDENT> def deque(self, env): <NEW_LINE> <INDENT> if self.items: <NEW_LINE> <INDENT> i = 0 <NEW_LINE> count = len(self.items) <NEW...
Queue object that keeps orders in right sequence
62598f0a956e5f7376df4c10
class ProtocolNoResponseError(ProtocolError): <NEW_LINE> <INDENT> pass
Exception raised when a protocol request expects a response but does not receive one.
62598f0a5fcc89381b2656c0
class LocatorLog(Log): <NEW_LINE> <INDENT> def __init__(self, client, location): <NEW_LINE> <INDENT> super(LocatorLog, self).__init__(client, location, 'locator-node-instance', LocatorNodeInstance)
A log file in a locator node instance :ivar `vas.gemfire.LocatorNodeInstances.LocatorNodeInstance` instance: The node instance that the log belongs to :ivar `datetime.datetime` last_modified: ...
62598f0acc40096d6161976e
class RecordTypeField(object): <NEW_LINE> <INDENT> __slots__ = ['recordtype', 'index'] <NEW_LINE> def __init__(self, recordtype, index): <NEW_LINE> <INDENT> self.recordtype = recordtype <NEW_LINE> self.index = index <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_hidden(self): <NEW_LINE> <INDENT> return bool(type_get_r...
CODA Record Type Field class.
62598f0a7cff6e4e811b4510
class TableFactoryTest(TestCase): <NEW_LINE> <INDENT> def test_str(self): <NEW_LINE> <INDENT> table = TableFactory('test', fields=['one']) <NEW_LINE> self.assertIsInstance(table, SimpleTable) <NEW_LINE> self.assertEqual(1, len(table.fields)) <NEW_LINE> <DEDENT> def test_unicode(self): <NEW_LINE> <INDENT> table = TableF...
Tests the functionality of the table factory
62598f0a377c676e912f62f9
class wiki_create_menu(osv.osv_memory): <NEW_LINE> <INDENT> _name = "wiki.create.menu" <NEW_LINE> _description = "Wizard Create Menu" <NEW_LINE> _columns = { 'menu_name': fields.char('Menu Name', size=256, select=True, required=True), 'menu_parent_id': fields.many2one('ir.ui.menu', 'Parent Menu', required=True), } <NEW...
Create Menu
62598f0a7c178a314d78bfc8
class EngineRichViewHandler(EngineViewHandler): <NEW_LINE> <INDENT> def init_info(self, info): <NEW_LINE> <INDENT> super(EngineRichViewHandler, self).init_info(info) <NEW_LINE> info.on_trait_change(self.select_selected, 'initialized') <NEW_LINE> return <NEW_LINE> <DEDENT> def select_selected(self, initialized): <NEW_LI...
A handler for the EngineRichView object.
62598f0aff9c53063f519188
class KEGGGeneGetter(Obo): <NEW_LINE> <INDENT> ontology = KEGG_GENES_PREFIX <NEW_LINE> bioversions_key = "kegg" <NEW_LINE> typedefs = [from_species, from_kegg_species, has_gene_product] <NEW_LINE> def iter_terms(self, force: bool = False) -> Iterable[Term]: <NEW_LINE> <INDENT> return iter_terms(version=self._version_or...
An ontology representation of KEGG Genes.
62598f0a167d2b6e312b5ac4
class UnhandledInputHandler(object): <NEW_LINE> <INDENT> def __init__(self, options): <NEW_LINE> <INDENT> self.options = options <NEW_LINE> <DEDENT> def __call__(self, key): <NEW_LINE> <INDENT> if self.options.no_quit_key: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if key in (r'q', r'Q'): <NEW_LINE> <INDENT> raise ...
An instance of this is used as unhandled_input on the urwid.MainLoop.
62598f0afbf16365ca792bc6
class Extractor: <NEW_LINE> <INDENT> class ExtractionError(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> class InvalidFormatError(Exception): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, raise_exceptions=False, clean_urls=True): <NEW_LINE> <INDENT> self.raise_exceptions = raise_exceptions ...
Extract download info from a reddit submission.
62598f0a099cdd3c6367496c
class CollectdLogHandler(logging.Handler): <NEW_LINE> <INDENT> def __init__(self, plugin="unknown", verbose=False): <NEW_LINE> <INDENT> self.verbose = verbose <NEW_LINE> self.plugin = plugin <NEW_LINE> logging.Handler.__init__(self, level=logging.NOTSET) <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> <INDENT> t...
Log handler to forward statements to collectd A custom log handler that forwards log messages raised at level debug, info, notice, warning, and error to collectd's built in logging. Suppresses extraneous info and debug statements using a "verbose" boolean Inherits from logging.Handler Arguments plugin -- name of t...
62598f0a97e22403b3839a0b
class BitmapFunction(FunctionBase): <NEW_LINE> <INDENT> dim_domain = 2 <NEW_LINE> shape_range = tuple() <NEW_LINE> def __init__(self, filename, bounding_box=[[0., 0.], [1., 1.]], range=[0., 1.]): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> from PIL import Image <NEW_LINE> <DEDENT> except ImportError: <NEW_LINE> <INDEN...
Define a 2D function via a grayscale image. Parameters ---------- filename Path of the image representing the function. bounding_box Lower left and upper right coordinates of the domain of the function. range A pixel of value p is mapped to ``(p / 255.) * range[1] + range[0]``.
62598f0a0fa83653e46f3a0e
class Command(BaseCommand): <NEW_LINE> <INDENT> args = "<action> [<email address>]" <NEW_LINE> help = "Manages SES emails. <action> may be one of the following:\n" " verify <email> Sends a verification request for an address.\n" " list Lists all fully verified addresses.\n" ...
This is a completely optional command used to manage the user's SES email addresses. Make sure to have 'seacucumber' in INSTALLED_APPS, or this won't be available.
62598f0a3d592f4c4edb9a13
class ActivationView(ActionViewMixin, generics.GenericAPIView): <NEW_LINE> <INDENT> serializer_class = ActivationSerializer <NEW_LINE> permission_classes = ( permissions.AllowAny, ) <NEW_LINE> def _action(self, serializer): <NEW_LINE> <INDENT> serializer.user.is_active = True <NEW_LINE> serializer.user.save() <NEW_LINE...
用户激活
62598f0a4527f215b58e8a24
class FQL(object): <NEW_LINE> <INDENT> ENDPOINT = 'https://api.facebook.com/method/' <NEW_LINE> def __init__(self, access_token=None, err_handler=None): <NEW_LINE> <INDENT> self.access_token = access_token <NEW_LINE> self.err_handler = err_handler <NEW_LINE> <DEDENT> def __call__(self, query, **params): <NEW_LINE> <IND...
A maker of single and multiple FQL queries. Usage ===== Single queries: >>> q = FQL('access_token') >>> result = q("SELECT post_id FROM stream WHERE source_id = ...") >>> result [Bunch(post_id='XXXYYYZZZ'), ...] >>> result[0] Bunch(post_id='XXXYYYZZZ') >>> result[0].post_id ...
62598f0a9f28863672817322
class LockingMode(Enum): <NEW_LINE> <INDENT> CONTEXT = "context" <NEW_LINE> ALL_DATASETS = "all_datasets"
How to capture context around datasets in a model. This is used to track data provenance and to make model repeatability possible. @see :method:`Model.lock`
62598f0a71ff763f4b5e628f
class APIRouterV3(nova.api.openstack.APIRouterV3): <NEW_LINE> <INDENT> def _register_extensions(self, ext): <NEW_LINE> <INDENT> pass
Routes requests on the OpenStack API to the appropriate controller and method.
62598f0a55399d3f05625052
class PhoneFormMixinTests(TestCase): <NEW_LINE> <INDENT> def test_clean_username(self): <NEW_LINE> <INDENT> mixin = PhoneFormMixin() <NEW_LINE> mixin.data = {'username': '123'} <NEW_LINE> self.assertRaises(forms.ValidationError, lambda: mixin.clean_username()) <NEW_LINE> mixin.data = {'username': '12345678900'} <NEW_LI...
Tests for PhoneFormMixin
62598f0a377c676e912f62fb
class DataReceiverSocket(Socket): <NEW_LINE> <INDENT> def __init__(self, sck): <NEW_LINE> <INDENT> Socket.__init__(self, sck) <NEW_LINE> self.is_finished = False <NEW_LINE> self.readed_data = None <NEW_LINE> <DEDENT> def on_readable(self): <NEW_LINE> <INDENT> Socket.on_readable(self) <NEW_LINE> if len(self.rx_buffer) <...
A data-receiving endpoint of the socket. Spawned mostly on redaction to receive incoming information about node state, but can also be expressed in reporters - when redaction issues the commands. This is common both for redaction and reporter.
62598f0a5fc7496912d47809
class OperationUpdateContract(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'description': {'max_length': 1000, 'min_length': 0}, 'display_name': {'max_length': 300, 'min_length': 1}, 'url_template': {'max_length': 1000, 'min_length': 1}, } <NEW_LINE> _attribute_map = { 'template_parameters': {'key':...
API Operation Update Contract details. :ivar template_parameters: Collection of URL template parameters. :vartype template_parameters: list[~api_management_client.models.ParameterContract] :ivar description: Description of the operation. May include HTML formatting tags. :vartype description: str :ivar request: An ent...
62598f0a8a349b6b43684d70
class AutocompleteProvider: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.memory = {} <NEW_LINE> <DEDENT> def getWords(self, fragment): <NEW_LINE> <INDENT> fragment = fragment.translate(None, string.punctuation).lower() <NEW_LINE> try: <NEW_LINE> <INDENT> memory_node = get_bottom_node(fragment, self....
Provides autocomplete suggestions for word fragments. Suggestions are based off of previously provided passages typed by the user.
62598f0a50812a4eaa620182
class BatchMock(BenchBatch): <NEW_LINE> <INDENT> def bench_something(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def bench_something_else(self): <NEW_LINE> <INDENT> pass
Serve as a mock to load a batch from a module
62598f0a26068e7796d4b484
class DRA(RabinAutomaton): <NEW_LINE> <INDENT> def __init__(self, atomic_proposition_based=True): <NEW_LINE> <INDENT> super(DRA, self).__init__( deterministic=True, atomic_proposition_based=atomic_proposition_based) <NEW_LINE> self.automaton_type = 'Deterministic Rabin Automaton'
Deterministic Rabin Automaton. See Also ======== L{RabinAutomaton}
62598f0a31939e2706ed0ff9
class ShutdownPlugin(interface.WindowsRegistryPlugin): <NEW_LINE> <INDENT> NAME = u'windows_shutdown' <NEW_LINE> DESCRIPTION = u'Parser for ShutdownTime Registry value.' <NEW_LINE> FILTERS = frozenset([ interface.WindowsRegistryKeyPathFilter( u'HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\Windows')]) <NEW_LI...
Windows Registry plugin for parsing the last shutdown time of a system.
62598f0af9cc0f698b1c4866
class Popf(X86InstructionBase): <NEW_LINE> <INDENT> def __init__(self, prefix, mnemonic, operands, architecture_mode): <NEW_LINE> <INDENT> super(Popf, self).__init__(prefix, mnemonic, operands, architecture_mode) <NEW_LINE> <DEDENT> @property <NEW_LINE> def source_operands(self): <NEW_LINE> <INDENT> return [ ] <NEW_LIN...
Representation of Popf x86 instruction.
62598f0a5fc7496912d4780a
class TimeCmdTestCase(SambaToolCmdTest): <NEW_LINE> <INDENT> def test_timeget(self): <NEW_LINE> <INDENT> (result, out, err) = self.runcmd("time", os.environ["SERVER"]) <NEW_LINE> self.assertCmdSuccess(result, out, err, "Ensuring time ran successfully") <NEW_LINE> timefmt = strptime(out, "%a %b %d %H:%M:%S %Y %Z\n") <NE...
Tests for samba-tool time subcommands
62598f0a7c178a314d78bfce
class MessageStat(Base): <NEW_LINE> <INDENT> __tablename__ = "message_stats" <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> timestamp = Column(DateTime, default=datetime.utcnow) <NEW_LINE> messagecount = Column(Integer) <NEW_LINE> channelid = Column(String, ForeignKey('channels.channelid')) <NEW_LINE> def...
Total messages sent over time (Hourly)
62598f0aff9c53063f51918e
class TempDirectoryTypeRegistry: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._should_delete = {} <NEW_LINE> <DEDENT> def set_delete(self, kind, value): <NEW_LINE> <INDENT> self._should_delete[kind] = value <NEW_LINE> <DEDENT> def get_delete(self, kind): <NEW_LINE> <INDENT> return self._should_delet...
Manages temp directory behavior
62598f0aadb09d7d5dc090dd
class NVMRestoreProgressEventModel(BaseControllerEventModel): <NEW_LINE> <INDENT> event: Literal["nvm restore progress"] <NEW_LINE> bytesWritten: int <NEW_LINE> total: int
Model for `nvm restore progress` event data.
62598f0a5fcc89381b2656c4
class VerifyCodeNoneMatchError(EufySecurityError): <NEW_LINE> <INDENT> pass
Verify code none match error.
62598f0a091ae3566870374a