code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@command(file_cmds) <NEW_LINE> class file_mkdir(_PithosContainer): <NEW_LINE> <INDENT> @errors.Generic.all <NEW_LINE> @errors.Pithos.connection <NEW_LINE> @errors.Pithos.container <NEW_LINE> def _run(self, path): <NEW_LINE> <INDENT> self.client.create_directory(self.path) <NEW_LINE> <DEDENT> def main(self, path_or_url)...
Create a directory object Equivalent to kamaki file create --content-type='application/directory'
6259908c3346ee7daa33847b
class RepChange(JSONModel): <NEW_LINE> <INDENT> transfer = ('user_id', 'post_id', 'post_type', 'title', 'positive_rep', 'negative_rep') <NEW_LINE> def _extend(self, json, site): <NEW_LINE> <INDENT> self.on_date = datetime.date.fromtimestamp(json.on_date) <NEW_LINE> if hasattr(json, 'positive_rep') and hasattr(json, 'ne...
Describes an event which causes a change in reputation.
6259908ca8370b77170f2000
class L7HealthConfig(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Protocol = None <NEW_LINE> self.Domain = None <NEW_LINE> self.Enable = None <NEW_LINE> self.Interval = None <NEW_LINE> self.KickNum = None <NEW_LINE> self.AliveNum = None <NEW_LINE> self.Method = None <NEW_LINE> self.S...
七层健康检查配置
6259908c167d2b6e312b83b2
@dataclass <NEW_LINE> class ContextWrapper: <NEW_LINE> <INDENT> scheduler: RPCScheduler <NEW_LINE> con: Console <NEW_LINE> json_output: bool
Wraps some objects which are accessible in each command.
6259908c97e22403b383cb2c
class Room(Base): <NEW_LINE> <INDENT> __tablename__ = 'rooms' <NEW_LINE> __code_prefix__ = 'R___' <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True) <NEW_LINE> code = Column(String(36), primary_key=False, autoincrement=False, unique=True, nullable=False) <NEW_LINE> created_datetime = Column(DateTime(...
model for room
6259908c60cbc95b06365b82
class Avatar(models.Model): <NEW_LINE> <INDENT> owner = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> image = models.ImageField(upload_to="uploads/avatars/")
- owner - User foreign key - image - imagefield
6259908cec188e330fdfa4e3
class AbstractStubClass(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def client_list(request, offset=None, limit=None, client_ids=None, client_token_id=None, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def client_read(request, client_id, *args,...
Implementations need to be derived from this class.
6259908c55399d3f0562814a
class IOServicesTestStubs(object): <NEW_LINE> <INDENT> _nbio_factory = None <NEW_LINE> _native_loop = None <NEW_LINE> _use_ssl = None <NEW_LINE> def start(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def create_nbio(self): <NEW_LINE> <INDENT> nbio = self._nbio_factory() <NEW_LINE> self.addCl...
Provides a stub test method for each combination of parameters we wish to test
6259908c4c3428357761bef0
class TestMarketQuote(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 testMarketQuote(self): <NEW_LINE> <INDENT> pass
MarketQuote unit test stubs
6259908c5fcc89381b266f78
class CorreiosWSServerErrorException(Exception): <NEW_LINE> <INDENT> content = "" <NEW_LINE> http_status_code = -1 <NEW_LINE> def __init__(self, http_status_code, content=None): <NEW_LINE> <INDENT> self.content = content <NEW_LINE> self.http_status_code = http_status_code <NEW_LINE> <DEDENT> def __repr__(self, *args, *...
Classe para exceções de status diferentes de HTTP 200 recebidos do servidor dos Correios
6259908c167d2b6e312b83b3
class data(data_paths): <NEW_LINE> <INDENT> def __init__(self, keyword, no=1, method='', color='sep'): <NEW_LINE> <INDENT> config = configparser.ConfigParser() <NEW_LINE> config_file = '../config/' + keyword + '.ini' <NEW_LINE> config.read(config_file) <NEW_LINE> print(config_file) <NEW_LINE> params = config['params'] ...
Class interpreting config files given as keyword and read as '../config/' + keyword + '.ini' (relative path!) calls super class constructor data_paths which handles filenames and data structure
6259908c4c3428357761bef2
class IntroDialog(QtWidgets.QDialog, Ui_dialog_instructions): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QtWidgets.QDialog.__init__(self, parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.button_browse.clicked.connect(self.get_directory) <NEW_LINE> index = 1 <NEW_LINE> filename = f"lib...
The intro instructions dialog box. Allows selecting the output file.
6259908cdc8b845886d551f1
@combiner([DMIDecode, VW]) <NEW_LINE> class VirtWhat(object): <NEW_LINE> <INDENT> def __init__(self, dmi, vw): <NEW_LINE> <INDENT> self.is_virtual = self.is_physical = None <NEW_LINE> self.generic = '' <NEW_LINE> self.specifics = [] <NEW_LINE> if vw and not vw.errors: <NEW_LINE> <INDENT> self.is_physical = vw.is_physic...
A combiner for checking if this machine is virtual or physical by checking ``virt-what`` or ``dmidecode`` command. Prefer ``virt-what`` to ``dmidecode`` Attributes: is_virtual (bool): It's running in a virtual machine? is_physical (bool): It's running in a physical machine? generic (str): The type of the ...
6259908c167d2b6e312b83b4
class Account(models.Model): <NEW_LINE> <INDENT> username = models.CharField(blank=False, max_length=80) <NEW_LINE> persona = models.ForeignKey(Persona, models.CASCADE, related_name="accounts") <NEW_LINE> servicename = 'generic service' <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "%s: %s" % (self.servicena...
A simple, generic account encapsulating the information shared by all types of accounts.
6259908c99fddb7c1ca63bf9
class NameGenerator(object): <NEW_LINE> <INDENT> def __init__(self, mkv_order=1): <NEW_LINE> <INDENT> self.mkv = markov.Markov(order=mkv_order) <NEW_LINE> self.generated = set() <NEW_LINE> <DEDENT> def add_example_names(self, names, allow_originals=False): <NEW_LINE> <INDENT> for name in names: <NEW_LINE> <INDENT> self...
Class for generating names using markov chains. Maintains a set of the names already generated to ensure the same one is not generated twice.
6259908c26068e7796d4e57b
class wiki_files_wizard(osv.osv_memory): <NEW_LINE> <INDENT> _name = "wiki.files.wizard" <NEW_LINE> _description = "Wiki Files Wizard" <NEW_LINE> _columns = { 'file':fields.binary('File', required=True), 'filename': fields.char('File Name', size=256, required=True), 'result': fields.text('Result', readonly=True), 'stat...
wiki files
6259908c50812a4eaa6219e2
class SillyStudent(SimulatedStudent): <NEW_LINE> <INDENT> def solve_task(self, *args, **kwargs): <NEW_LINE> <INDENT> return True, 60 * 20 <NEW_LINE> <DEDENT> def report_flow(self, *args, **kwargs): <NEW_LINE> <INDENT> return FlowRating.DIFFICULT
Silly student solves any task in 1 hour and rate them as too difficult
6259908cadb09d7d5dc0c193
class OAuth2SessionIdProvider (webcookie.WebcookieSessionIdProvider, database.DatabaseConnection2): <NEW_LINE> <INDENT> key = 'oauth2' <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> database.DatabaseConnection2.__init__(self, config) <NEW_LINE> webcookie.WebcookieSessionIdProvider.__init__(self, config) <NE...
OAuth2SessionIdProvider implements session IDs based on HTTP cookies or OAuth2 Authorization headers
6259908c7cff6e4e811b767c
class TestMarketQuoteFill(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 testMarketQuoteFill(self): <NEW_LINE> <INDENT> pass
MarketQuoteFill unit test stubs
6259908cbe7bc26dc9252c72
class EventProcessor: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> async def run(cls): <NEW_LINE> <INDENT> file_path = input(constants.file_prompt) <NEW_LINE> if os.path.isfile(file_path): <NEW_LINE> <INDENT> print('Reading file...') <NEW_LINE> with open(file_path, 'r') as fd: <NEW_LINE> <INDENT> data = json.load(fd) <N...
Class for processing streaming events
6259908c5fcc89381b266f7a
class Rnn(EncoderNetwork): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def get_module_id(): <NEW_LINE> <INDENT> return 'rnn' <NEW_LINE> <DEDENT> def __init__(self, args): <NEW_LINE> <INDENT> super().__init__(args) <NEW_LINE> self.rnn_cell = None <NEW_LINE> <DEDENT> def build(self): <NEW_LINE> <INDENT> self.rnn_cell = ...
Read each keyboard configuration note by note and encode it's configuration
6259908ca05bb46b3848bf42
class Rift: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.open_rifts = {} <NEW_LINE> <DEDENT> @commands.command(pass_context=True) <NEW_LINE> async def riftopen(self, ctx, channel): <NEW_LINE> <INDENT> author = ctx.message.author <NEW_LINE> author_channel = ctx.message....
Communicate with other servers/channels!
6259908cdc8b845886d551f3
class GameSprite(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.speed = speed <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> <DEDENT> def update(self): <NEW_LINE> <I...
飞机精灵
6259908c283ffb24f3cf54db
class HomeKitGarageDoorCover(HomeKitEntity, CoverDevice): <NEW_LINE> <INDENT> def __init__(self, accessory, discovery_info): <NEW_LINE> <INDENT> super().__init__(accessory, discovery_info) <NEW_LINE> self._state = None <NEW_LINE> self._obstruction_detected = None <NEW_LINE> self.lock_state = None <NEW_LINE> <DEDENT> @p...
Representation of a HomeKit Garage Door.
6259908c7cff6e4e811b767e
class MultilineInfo(SimpleAckReply): <NEW_LINE> <INDENT> def __init__(self, line): <NEW_LINE> <INDENT> super().__init__(line) <NEW_LINE> self.lines = [] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<%s:%s (+%d)>" % (self.__class__.__name__, repr(self.line), len(self.lines))
Reply starts with ``=``: Multi-line.
6259908cd8ef3951e32c8c7b
class B(A): <NEW_LINE> <INDENT> pass
Class B. Attributes ---------- {A.Attributes} Examples -------- >>> b = B() >>> b.x 1
6259908c167d2b6e312b83b6
class ListTeamLogsResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'request_id': 'str', 'took': 'float', 'data': 'TeamLog' } <NEW_LINE> attribute_map = { 'request_id': 'requestId', 'took': 'took', 'data': 'data' } <NEW_LINE> def __init__(self, request_id=None, took=0.0, data=None): <NEW_LINE> <INDENT> self._requ...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259908cad47b63b2c5a948e
class ColorByChain(ColorFromPalette): <NEW_LINE> <INDENT> def guiCallback(self): <NEW_LINE> <INDENT> nodes = self.vf.getSelection() <NEW_LINE> if not nodes: <NEW_LINE> <INDENT> return 'Error' <NEW_LINE> <DEDENT> val = self.showForm('default', scrolledFrame = 1, width= 500, height = 200, force=1) <NEW_LINE> if val: <NEW...
The colorByChain command allows the user to color the given geometries representing the given nodes by chain. A different color is assigned to each chain. Package : Pmv Module : colorCommands Class : ColorByChain Command : colorByChain Synopsis: None <- colorByChain(nodes, geomsToColo...
6259908c71ff763f4b5e93eb
class CalibrationlessReconstructor(ReconstructorBase): <NEW_LINE> <INDENT> def __init__(self, fourier_op, linear_op=None, gradient_formulation="synthesis", n_jobs=1, verbose=0, **kwargs): <NEW_LINE> <INDENT> if linear_op is None: <NEW_LINE> <INDENT> linear_op = WaveletN( wavelet_name="sym8", nb_scale=3, dim=len(fourier...
Calibrationless reconstruction implementation. Notes ----- For the Analysis case, finds the solution for x of: ..math:: (1/2) * sum(||F x_l - y_l||^2_2, n_coils) + mu * H(W x_l) For the Synthesis case, finds the solution of: ..math:: (1/2) * sum(||F Wt alpha_l - y_l||^2_2, n_coils) + mu * H(al...
6259908c26068e7796d4e580
class ContentTypeRestrictedFileField(models.FileField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.content_types = kwargs.pop("content_types") <NEW_LINE> self.max_upload_size = kwargs.pop("max_upload_size") <NEW_LINE> super(ContentTypeRestrictedFileField, self).__init__(*args, **k...
Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] * max_upload_size - a number indicating the maximum file size allowed for upload. 2.5MB - 2621440 5MB - 5242880 10MB - 10485760 20MB - 20971...
6259908c656771135c48ae50
class TopicManager(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.namespaces = Namespace() <NEW_LINE> self.logger = logging.getLogger(__name__) <NEW_LINE> <DEDENT> def registerTopic(self, name, msgType = None): <NEW_LINE> <INDENT> parts = name.split("/") <NEW_LINE> namespace = self.namespaces...
This class is responsbile for handling topic creation and namespace registration
6259908c4a966d76dd5f0b24
class logger(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> this = _runtime_swig.new_logger(*args, **kwargs) <NEW_LINE> try: self.thi...
Proxy of C++ gr::logger class
6259908c091ae35668706883
class PCCcdb(Component): <NEW_LINE> <INDENT> name = "pcccdb" <NEW_LINE> cmd = "sh -x ./tools/wdbtools/seekglobal.sh "
docstring for PCCcdb
6259908caad79263cf4303f2
class LookupError(Exception): <NEW_LINE> <INDENT> pass
| Base class for lookup errors. | | Method resolution order: | LookupError | Exception | BaseException | object | | Methods defined here: | | __init__(self, /, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | --------------------------------------------...
6259908c4527f215b58eb7bf
class NodeStore: <NEW_LINE> <INDENT> def __init__(self, nodes): <NEW_LINE> <INDENT> self.nodes = nodes <NEW_LINE> <DEDENT> def getNode(self, nodeIdentifier): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return defer.succeed(self.nodes[nodeIdentifier]) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return defe...
I just store nodes to pose as an L{IStorage} implementation.
6259908c5fcc89381b266f7d
class TestSuiteRunner(object): <NEW_LINE> <INDENT> def __init__(self, verbosity = 1): <NEW_LINE> <INDENT> self.verbosity = verbosity <NEW_LINE> <DEDENT> def setup_test_environment(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def teardown_test_environment(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ru...
A suite runner with twisted if available.
6259908c3346ee7daa338481
class SharingPermissions(SigmaObject): <NEW_LINE> <INDENT> def __init__(self, mapid=None, global_permissions=None): <NEW_LINE> <INDENT> self.mapid = mapid <NEW_LINE> self.shared_with = {} <NEW_LINE> if global_permissions is None: <NEW_LINE> <INDENT> self.permissions = {"global": "private"} <NEW_LINE> <DEDENT> else: <NE...
Holding sharing permisions for a users' map. Currently only public/private is beeing used.
6259908cd486a94d0ba2dbf3
class MatchFirst(ParseExpression): <NEW_LINE> <INDENT> def __init__( self, exprs, savelist = False ): <NEW_LINE> <INDENT> super(MatchFirst,self).__init__(exprs, savelist) <NEW_LINE> if self.exprs: <NEW_LINE> <INDENT> self.mayReturnEmpty = any(e.mayReturnEmpty for e in self.exprs) <NEW_LINE> <DEDENT> else: <NEW_LINE> <I...
Requires that at least one C{ParseExpression} is found. If two expressions match, the first one listed is the one that will match. May be constructed using the C{'|'} operator. Example:: # construct MatchFirst using '|' operator # watch the order of expressions to match number = Word(nums) | Combine(W...
6259908c099cdd3c63676219
class StateProcessor(object): <NEW_LINE> <INDENT> def __init__(self,shape=[210, 160, 3],output_shape=[84,84]): <NEW_LINE> <INDENT> self.shape = shape <NEW_LINE> self.output_shape = output_shape[:2] <NEW_LINE> with tf.variable_scope("state_processor"): <NEW_LINE> <INDENT> self.input_state = tf.placeholder(shape=self.sha...
Processes a raw Atari iamges. Resizes it and converts it to grayscale. 图片的预处理。
6259908cad47b63b2c5a9492
class InviteView(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> current_time = timezone.localtime(timezone.now()) <NEW_LINE> accessible_time = current_time - datetime.timedelta(days=20) <NEW_LINE> no_obj = Notif...
OK 2018/2/28 邀请消息 XXX邀请 你 加入 url XXX与 你 合唱了 URL api/ve/notification/invited/ GET type标识消息类型 2:邀请消息,1:加入合唱消息
6259908c60cbc95b06365b88
@override_settings(ROOT_URLCONF=TestUrlConf) <NEW_LINE> class APITests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_list_misc_types(self): <NEW_LINE> <INDENT> MiscType.objects.create(name='Test Documents') <NEW_LINE> MiscType.objects.create(n...
Test miscellaneous documents API
6259908caad79263cf4303f4
class SBANd(SCPINode, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "SBANd" <NEW_LINE> args = ["AUTO", "LOWer", "UPPer"]
DIGital:MODopt:SBANd Arguments: AUTO, LOWer, UPPer
6259908c26068e7796d4e584
class CinderIntegrationComponent(object): <NEW_LINE> <INDENT> def getCinderIntegrationKeys(self): <NEW_LINE> <INDENT> methodname = { 'OpenStackInfrastructurePool': 'getPoolIntegrationKeys', 'OpenStackInfrastructureVolume': 'getVolumeIntegrationKeys', 'OpenStackInfrastructureVolSnapshot': 'getSnapshotInte...
Mixin for model classes that have Cinder integrations.
6259908c4a966d76dd5f0b28
class DescribeIpSetRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DescribeIpSetRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}/ipSets/{ipSetId}', 'GET', header, version) <NEW_LINE> self.parameters = parameters
查询实例的 IP 库
6259908ce1aae11d1e7cf636
class BugBecameQuestionEvent: <NEW_LINE> <INDENT> implements(IBugBecameQuestionEvent) <NEW_LINE> def __init__(self, bug, question, user): <NEW_LINE> <INDENT> self.bug = bug <NEW_LINE> self.question = question <NEW_LINE> self.user = user
See `IBugBecameQuestionEvent`.
6259908c5fcc89381b266f7f
class AesCbcPkcs7Decoder(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def uint32_bigendian_decode(bb): return tuple((b4[3] | (b4[2] << 8) | (b4[1] << 16) | (b4[0] << 24)) for b4 in iter_blocks(bb, 4, errors="strict")) <NEW_LINE> @staticmethod <NEW_LINE> def uint32_bigendian_encode(u32b): return bytes(b for u32...
AesCbcPkcs7Decoder(key, iv, **opt) Decodes/decrypts from AES CBC with PKCS#7 padding. key => [uint32]*4 => [uint32]*6 => [uint32]*8 iv => [uint32]*4 opt: cast => bytes : (default) cast the returned transcoded values to bytes. => None : do not cast, returns transcoded byte iterator instead. cach...
6259908c4527f215b58eb7c1
class UserConfig(AppConfig): <NEW_LINE> <INDENT> name = 'user'
Class to configure user
6259908c7cff6e4e811b7686
class SQLiteDB(DB): <NEW_LINE> <INDENT> def __init__(self, dbname, echo=False, extensions=None, functions=None, pragmas=None): <NEW_LINE> <INDENT> self._extensions = extensions <NEW_LINE> self._functions = functions <NEW_LINE> self._pragmas = [] if not pragmas else pragmas <NEW_LINE> super(SQLiteDB, self).__init__( dbn...
Utility for exploring and querying an SQLite database. Parameters ---------- dbname: str Path to SQLite database or ":memory:" for in-memory database echo: bool Whether or not to repeat queries and messages back to user extensions: list List of extensions to load on connection
6259908c283ffb24f3cf54e4
class Label( collections.namedtuple('Label', ['index'])): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return 'L%d' % self.index
A label heading off a basic block.
6259908c71ff763f4b5e93f1
class ClassNotFound(Exception): <NEW_LINE> <INDENT> def __init__(self, type_: str) -> None: <NEW_LINE> <INDENT> self.type_ = type_ <NEW_LINE> <DEDENT> def get_HTTP(self) -> HydraError: <NEW_LINE> <INDENT> description = f"The class {self.type_} is not a valid/defined RDFClass" <NEW_LINE> return HydraError(code=400, titl...
Error when the RDFClass is not found.
6259908ca05bb46b3848bf47
class UserSearchView(models.Model): <NEW_LINE> <INDENT> profile_id = models.IntegerField(primary_key = True) <NEW_LINE> username = models.CharField(max_length = 30) <NEW_LINE> kennitala = models.CharField(max_length = 11) <NEW_LINE> fullname = models.CharField(max_length = 600) <NEW_LINE> fullname_sans_middlename = mod...
Note to self: ForeignKeys to not work when using database views
6259908c97e22403b383cb3c
class BaseGMM(ABC): <NEW_LINE> <INDENT> def __init__(self, components, dimensions, epochs=100, w=1e-6, tol=1e-9, restarts=5, device=None): <NEW_LINE> <INDENT> self.k = components <NEW_LINE> self.d = dimensions <NEW_LINE> self.epochs = epochs <NEW_LINE> self.w = w <NEW_LINE> self.tol = tol <NEW_LINE> self.restarts = res...
ABC for GMMs fitted with EM-type methods.
6259908c283ffb24f3cf54e5
class EWSingleSourceSP(ABC): <NEW_LINE> <INDENT> def __init__(self, graph, s): <NEW_LINE> <INDENT> self.reset(graph, s) <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def path_to(self, v): <NEW_LINE> <INDENT> if v == self.s: <NEW_LINE> <INDENT> return [v], [None], 0 <NEW_LINE> <DEDENT> if self._edge_to[v] is None: <NEW...
Parent class for single source shortest pass on edge weighted graph.
6259908cbe7bc26dc9252c78
class Pseudo(OrderedEnum): <NEW_LINE> <INDENT> SINGLETON = 1
This is a pseudo feature, that can be used instead of any real feature.
6259908cadb09d7d5dc0c19f
class UnableToAcquireCommitLockError(StorageError, UnableToAcquireLockError): <NEW_LINE> <INDENT> pass
The commit lock cannot be acquired due to a timeout. This means some other transaction had the lock we needed. Retrying the transaction may succeed. However, for historical reasons, this exception is not a ``TransientError``.
6259908c283ffb24f3cf54e6
class PasswordResetAPIView(views.APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.AllowAny, ) <NEW_LINE> serializer_class = serializers.PasswordResetSerializer <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> user_profile = self.get_user_profile(request.data.get('email')) <NEW_LINE> if user_profil...
Endpoint to send email to user with password reset link.
6259908c099cdd3c6367621c
class theme(object): <NEW_LINE> <INDENT> _settings = sublime.load_settings('Base File.sublime-settings') <NEW_LINE> _prefix = 'Colorized-' <NEW_LINE> class __metaclass__(type): <NEW_LINE> <INDENT> @property <NEW_LINE> def abspath(cls): <NEW_LINE> <INDENT> theme_path = cls._settings.get('color_scheme') or "" <NEW_LINE> ...
Global object represents ST color scheme
6259908cdc8b845886d551ff
class DownloadBill(WeixinBase): <NEW_LINE> <INDENT> api_url = "https://api.mch.weixin.qq.com/pay/downloadbill" <NEW_LINE> using_cert = False <NEW_LINE> is_xml = True <NEW_LINE> error_code = {"return_code": "FAIL"} <NEW_LINE> def __init__(self, bill_date_str, bill_type=None, **kwargs): <NEW_LINE> <INDENT> super(Download...
对账单接口
6259908c5fdd1c0f98e5fbbe
class Character: <NEW_LINE> <INDENT> CharacterList = {None:None} <NEW_LINE> SNList = {None:None} <NEW_LINE> def __init__(self, name, SN, HP, SP, MP, baseAtk, baseDef, atkMulti, defMulti): <NEW_LINE> <INDENT> self.CharacterList.update({SN:self}) <NEW_LINE> self.SNList.update({name:SN}) <NEW_LINE> HP = int(HP) <NEW_LINE>...
The meta class for character managing
6259908ce1aae11d1e7cf638
class Writer(with_metaclass(ABCMeta)): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def display_message(self, message, headline=None, hyphenate=True): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def prompt_user_yesno(self, *a...
Writer connects the hardening scripts with user input: The user can be prompted for input, which is than returned to the program. The output may be simply text-based (console) or even web-based.
6259908c4c3428357761bf02
@python_2_unicode_compatible <NEW_LINE> class Valuation(dict): <NEW_LINE> <INDENT> def __init__(self, xs): <NEW_LINE> <INDENT> super(Valuation, self).__init__() <NEW_LINE> for (sym, val) in xs: <NEW_LINE> <INDENT> if isinstance(val, string_types) or isinstance(val, bool): <NEW_LINE> <INDENT> self[sym] = val <NEW_LINE> ...
A dictionary which represents a model-theoretic Valuation of non-logical constants. Keys are strings representing the constants to be interpreted, and values correspond to individuals (represented as strings) and n-ary relations (represented as sets of tuples of strings). An instance of ``Valuation`` will raise a KeyE...
6259908c283ffb24f3cf54e8
class Distribution(with_metaclass(abc.ABCMeta)): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def sample(self, means, covs, stddevs, idxs): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def survival(self, loss_ratio, mean, stddev): <NEW_LINE> <INDENT> raise NotIm...
A Distribution class models continuous probability distribution of random variables used to sample losses of a set of assets. It is usually registered with a name (e.g. LN, BT, PM) by using :class:`openquake.baselib.general.CallableDict`
6259908c71ff763f4b5e93f5
class DatabaseDispatcher(dispatcher.Base): <NEW_LINE> <INDENT> def __init__(self, conf): <NEW_LINE> <INDENT> super(DatabaseDispatcher, self).__init__(conf) <NEW_LINE> self.storage_conn = storage.get_connection(conf) <NEW_LINE> <DEDENT> def record_metering_data(self, data): <NEW_LINE> <INDENT> if not isinstance(data, li...
Dispatcher class for recording metering data into database. The dispatcher class which records each meter into a database configured in ceilometer configuration file. To enable this dispatcher, the following section needs to be present in ceilometer.conf file dispatchers = database
6259908c5fdd1c0f98e5fbc0
class TensorProducts(TensorProductsCategory): <NEW_LINE> <INDENT> @cached_method <NEW_LINE> def extra_super_categories(self): <NEW_LINE> <INDENT> return [self.base_category()] <NEW_LINE> <DEDENT> class ParentMethods: <NEW_LINE> <INDENT> @cached_method <NEW_LINE> def cell_poset(self): <NEW_LINE> <INDENT> ret = self._set...
The category of cellular algebras constructed by tensor product of cellular algebras.
6259908c60cbc95b06365b8c
class UnversionedStatusDetails(object): <NEW_LINE> <INDENT> def __init__(self, causes=None, kind=None, retry_after_seconds=None, name=None, group=None): <NEW_LINE> <INDENT> self.swagger_types = { 'causes': 'list[UnversionedStatusCause]', 'kind': 'str', 'retry_after_seconds': 'int', 'name': 'str', 'group': 'str' } <NEW_...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259908c8a349b6b43687ea9
class Code: <NEW_LINE> <INDENT> def __init__(self, code): <NEW_LINE> <INDENT> if type(code) == type([]): <NEW_LINE> <INDENT> self.code = '\n'.join(code) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.code = code <NEW_LINE> <DEDENT> self.includes = [] <NEW_LINE> self.variables = [] <NEW_LINE> <DEDENT> def prependCo...
Custom code element. it allows to add custom code in any place. This class is for example used to specify the behavior of a class method or of a function
6259908c7cff6e4e811b768c
class UserNote(models.Model): <NEW_LINE> <INDENT> timestamp = models.DateTimeField(auto_now_add=True) <NEW_LINE> admin_user = models.ForeignKey("user.User", related_name="admin_notes", on_delete=models.CASCADE, null=True) <NEW_LINE> user = models.ForeignKey("user.User", related_name="notes", on_delete=models.CASCADE) <...
An internal model to track internal admin information, such as the reason for disabling a user's account.
6259908c091ae3566870688f
class Monster(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Base, self).__init__()
Holds all of the monsters within the RPG game.
6259908cec188e330fdfa4f9
class tbxunit(lisa.LISAunit): <NEW_LINE> <INDENT> rootNode = "termEntry" <NEW_LINE> languageNode = "langSet" <NEW_LINE> textNode = "term" <NEW_LINE> def createlanguageNode(self, lang, text, purpose): <NEW_LINE> <INDENT> if isinstance(text, bytes): <NEW_LINE> <INDENT> text = text.decode("utf-8") <NEW_LINE> <DEDENT> lang...
A single term in the TBX file. Provisional work is done to make several languages possible.
6259908c4c3428357761bf06
class MultiPointArrayType(ArrayAttributeType): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__(MultiPointType())
Conversion class for MultiPoint[].
6259908c5fdd1c0f98e5fbc2
class ProductAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> form = CategoryAdminForm <NEW_LINE> fieldsets = ( (_('Content'), { 'fields': (('title', 'status'), 'slug', 'excerpt', 'content', 'categories')}), (_('Illustration'), { 'fields': ('image', 'get_thumbnail', 'image_caption'), 'classes': ('collapse', 'collapse-close...
Admin for Product model.
6259908cadb09d7d5dc0c1a5
class _Base (object): <NEW_LINE> <INDENT> Type = None <NEW_LINE> Name = None <NEW_LINE> Default = None <NEW_LINE> value = property() <NEW_LINE> length = property() <NEW_LINE> packed = property() <NEW_LINE> @classmethod <NEW_LINE> def unpack (cls, packed): <NEW_LINE> <INDENT> return cls(packed) <NEW_LINE> <DEDENT> def _...
Base class for all CoAPy option classes.
6259908c167d2b6e312b83be
class SoftwareTrigger(ivi.IviContainer): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(SoftwareTrigger, self).__init__(*args, **kwargs) <NEW_LINE> cls = 'IviPwrMeter' <NEW_LINE> grp = 'SoftwareTrigger' <NEW_LINE> ivi.add_group_capability(self, cls+grp) <NEW_LINE> <DEDENT> def send_s...
Extension IVI methods for RF power meters supporting software triggering
6259908c656771135c48ae57
class InitialTimeSignatureFeature(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'R31' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> featuresModule.FeatureExtractor.__init__(self, dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Initi...
A feature array with two elements. The first is the numerator of the first occurring time signature and the second is the denominator of the first occurring time signature. Both are set to 0 if no time signature is present. >>> s1 = stream.Stream() >>> s1.append(meter.TimeSignature('3/4')) >>> fe = features.jSymbolic....
6259908c3617ad0b5ee07d9e
class ContrastiveLoss(nn.Module): <NEW_LINE> <INDENT> def __init__(self, margin=2.0, pos_weight=0.5): <NEW_LINE> <INDENT> super(ContrastiveLoss, self).__init__() <NEW_LINE> self.pos_weight = pos_weight <NEW_LINE> self.margin = margin <NEW_LINE> <DEDENT> def forward(self, distance, label): <NEW_LINE> <INDENT> contrastiv...
Contrastive loss function. Based on: http://yann.lecun.com/exdb/publis/pdf/hadsell-chopra-lecun-06.pdf Loss is proportional to square distance when inputs are of the same type, and proportional to the square of margin - distance when the classes are different. Margin is a user-specifiable hyperparameter.
6259908cad47b63b2c5a949e
class lexicalConceptualResourceImageInfoType_model(SchemaModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = "Lexical conceptual resource image" <NEW_LINE> <DEDENT> __schema_name__ = 'lexicalConceptualResourceImageInfoType' <NEW_LINE> __schema_fields__ = ( ( u'mediaType', u'mediaType', REQUIRED )...
Groups information on the image part of the lexical/conceptual resource
6259908caad79263cf430400
class SatTable(Table): <NEW_LINE> <INDENT> no_rows_message = ( ".//td/span[contains(@data-block, 'no-rows-message') or " "contains(@data-block, 'no-search-results-message')]" ) <NEW_LINE> tbody_row = Text('./tbody/tr') <NEW_LINE> pagination = SatTablePagination() <NEW_LINE> @property <NEW_LINE> def has_rows(self): <NEW...
Satellite version of table. Includes a paginator sub-widget. If found, then the paginator is used to read all entries from the table. If the table is empty, there might be only one column with an appropriate message in the table body, or it may have no columns or rows at all. This subclass handles both possibilities....
6259908c099cdd3c63676220
class _NothingCLIInputs(NamedTuple): <NEW_LINE> <INDENT> title: str <NEW_LINE> description: str = "" <NEW_LINE> filename: str = "" <NEW_LINE> destination: str = "" <NEW_LINE> edit: str = ""
The prompts a user can respond to for `not new` in order
6259908cdc8b845886d55207
class KeyValueAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> values = [value.split('=') for value in values] <NEW_LINE> if not all(len(val) == 2 for val in values): <NEW_LINE> <INDENT> parser.error(("values for " + self.dest + " must b...
Action which splits key=value arguments into a dict.
6259908c99fddb7c1ca63c04
class RecursionDetected(RuntimeError): <NEW_LINE> <INDENT> pass
function has been detected to be recursing
6259908caad79263cf430401
class DeleteCallBackRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.BizAppId = None <NEW_LINE> self.CallId = None <NEW_LINE> self.CancelFlag = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.BizAppId = params.get("BizAppId") <NEW_LINE> self.Call...
DeleteCallBack请求参数结构体
6259908cbe7bc26dc9252c7d
class Main(base.Module): <NEW_LINE> <INDENT> parameters = { "iface": "wlan0mon", "count": 10, } <NEW_LINE> completions = list(parameters.keys()) <NEW_LINE> def do_execute(self, line): <NEW_LINE> <INDENT> process_list = [] <NEW_LINE> try: <NEW_LINE> <INDENT> for _ in range(int(self.parameters['count'])): <NEW_LINE> <IND...
Spamming Fake access points
6259908c8a349b6b43687eaf
class FollowedLabelAPIView(CustomAPIView): <NEW_LINE> <INDENT> def get(self, request, user_slug): <NEW_LINE> <INDENT> user = UserProfile.objects.filter(slug=user_slug).first() <NEW_LINE> if not user: <NEW_LINE> <INDENT> return self.error('用户不存在', 404) <NEW_LINE> <DEDENT> follows = Label.objects.filter(labelfollow__user...
关注的标签
6259908c7cff6e4e811b7692
class Selector(pg.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, width): <NEW_LINE> <INDENT> super(Selector, self).__init__() <NEW_LINE> self.image = pg.Surface((550,width)) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.image.fill(c.g)
asdsad
6259908cf9cc0f698b1c60f3
class AccountStateResponse(Model): <NEW_LINE> <INDENT> def __init__(self, balance: float=None, unrealized_pl: float=None, equity: float=None, am_data: List[List[List[str]]]=None): <NEW_LINE> <INDENT> self.swagger_types = { 'balance': float, 'unrealized_pl': float, 'equity': float, 'am_data': List[List[List[str]]] } <NE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259908de1aae11d1e7cf63d
class TokenMap(object): <NEW_LINE> <INDENT> token_class = None <NEW_LINE> token_to_host_owner = None <NEW_LINE> tokens_to_hosts_by_ks = None <NEW_LINE> ring = None <NEW_LINE> _metadata = None <NEW_LINE> def __init__(self, token_class, token_to_host_owner, all_tokens, metadata): <NEW_LINE> <INDENT> self.token_class = to...
Information about the layout of the ring.
6259908d283ffb24f3cf54f1
class UserRole: <NEW_LINE> <INDENT> COORDINATOR, RESIDENT, VOLUNTEER = '1', '2', '3' <NEW_LINE> ROLES = [ (COORDINATOR, "Coordinator"), (RESIDENT, "Resident"), (VOLUNTEER, "Volunteer") ]
Constants used in the User class.
6259908dfff4ab517ebcf468
class NonPositiveTypedValueFormat(TypedValueFormat): <NEW_LINE> <INDENT> def check_value(self, value): <NEW_LINE> <INDENT> TypedValueFormat.check_value(self, value) <NEW_LINE> if value > 0: <NEW_LINE> <INDENT> raise ValueFormatError(u"%s should not be positive" % value)
Checks that the value is a non-positive number.
6259908ddc8b845886d5520b
class NonMacroCall(Token): <NEW_LINE> <INDENT> pattern = _anything_up_to(r'|'.join([ MacroCallStart.pattern, MacroArgument.pattern, SharpComment.delimiter, ]))
Matches anything up to a MacroArgument or MacroCallStart.
6259908de1aae11d1e7cf63e
class TitForTat(Strategy): <NEW_LINE> <INDENT> @Strategy.default(COOP) <NEW_LINE> def decide(self, rs): <NEW_LINE> <INDENT> return rs
Plays what the opponent played last time.
6259908d3346ee7daa33848b
class LogarithmicStep(Step): <NEW_LINE> <INDENT> def __init__(self, alpha=1, beta=1): <NEW_LINE> <INDENT> gamma = lambda n : 1 / (np.log(n + 2) ** alpha) <NEW_LINE> eta = lambda n : 1 / (np.log(n + 2) ** beta) <NEW_LINE> super().__init__(gamma, eta) <NEW_LINE> self.alpha = alpha <NEW_LINE> self.beta = beta <NEW_LINE> <...
The logarithmic coefficient with 1/(log(n)^alpha) for gamma and 1/(log(n)^beta) for eta on step n.
6259908d099cdd3c63676223
class LeNet5(nn.Module): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(LeNet5, self).__init__() <NEW_LINE> self.convnet = nn.Sequential(OrderedDict([ ('c1', nn.Conv2d(1, 6, kernel_size=(5, 5))), ('tanh1', nn.Tanh()), ('s2', nn.MaxPool2d(kernel_size=(2, 2), stride=2)), ('c3', nn.Conv2d(6, 16, kernel_...
Input - 1x32x32 C1 - 6@28x28 (5x5 kernel) tanh S2 - 6@14x14 (2x2 kernel, stride 2) Subsampling C3 - 16@10x10 (5x5 kernel, complicated shit) tanh S4 - 16@5x5 (2x2 kernel, stride 2) Subsampling C5 - 120@1x1 (5x5 kernel) F6 - 84 tanh F7 - 10 (Output)
6259908dd486a94d0ba2dc07
class GIL_837: <NEW_LINE> <INDENT> pass
Glitter Moth
6259908d091ae35668706899
class DenseNet(chainer.Chain): <NEW_LINE> <INDENT> def __init__(self, depth=40, growth_rate=12, in_channels=16, dropout_ratio=0.2, n_class=10): <NEW_LINE> <INDENT> assert (depth - 4) % 3 == 0 <NEW_LINE> n_layers = int((depth - 4) / 3) <NEW_LINE> n_ch = [in_channels + growth_rate * n_layers * i for i in range(4)] <NEW_L...
Densely Connected Convolutional Networks see: https://arxiv.org/abs/1608.06993
6259908d50812a4eaa6219f0
class EnrollmentDecisionTask(HostedBaseTask): <NEW_LINE> <INDENT> def __init__(self, account=1, creator=1, type=1, data=None): <NEW_LINE> <INDENT> tqconn = HostedTaskQueue() <NEW_LINE> jdata = json.loads(data) <NEW_LINE> tags = [] <NEW_LINE> tags.append("creator=" + str(creator)) <NEW_LINE> tags.append("deviceId=" + jd...
class EnrollmentDicisionTask This class implements the task information and operations for enrollment decision task queue Attributes: None Notes: All sections in the basetask list as follows: owner, priority, enqueue_timestamp, account, name, tags, http_last_modified, task_retries, payload_base64 ...
6259908d4a966d76dd5f0b3a
class TabbedEditorFactory(object): <NEW_LINE> <INDENT> def getFileExtensions(self): <NEW_LINE> <INDENT> raise NotImplementedError("All subclasses of TabbedEditorFactory have to override the 'getFileExtensions' method") <NEW_LINE> <DEDENT> def canEditFile(self, filePath): <NEW_LINE> <INDENT> raise NotImplementedError("A...
Constructs instances of TabbedEditor (multiple instances of one TabbedEditor can coexist - user editing 2 layouts for example - with the ability to switch from one to another)
6259908dec188e330fdfa503
class GlueMixin: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_glue_preds(cls, pred_dict: Dict): <NEW_LINE> <INDENT> indexes = [] <NEW_LINE> predictions = [] <NEW_LINE> for pred, guid in zip(list(pred_dict["preds"]), list(pred_dict["guids"])): <NEW_LINE> <INDENT> indexes.append(int(guid.split("-")[1])) <NEW_LINE>...
Mixin for :class:`jiant.tasks.core.Task`s in the `GLUE<https://gluebenchmark.com/>`_ benchmark.
6259908d5fcc89381b266f88
class Activity(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'activities' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(100), unique=True) <NEW_LINE> artists = db.relationship('Artist', backref='activity', lazy='dynamic') <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT...
An activity, such as cycling or driving.
6259908daad79263cf430407
class GenericConversion(AbstractBasicConversion): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs)
Generic conversion class that can be used in cases that the actual asset type is not important or not supported yet in ESDL
6259908df9cc0f698b1c60f6
class Archive(FBOTableEntry): <NEW_LINE> <INDENT> fields = re.split( r"\s+", "date solicitation_number award_number agency office location archive_date ntype") <NEW_LINE> def migrations(self): <NEW_LINE> <INDENT> return (("011_%s_table.sql" % self.record_type, self.sql_table(), "DROP TABLE %s;" % self.record_type),)
Model of a Archive
6259908de1aae11d1e7cf640