code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Hls(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'fragments_per_ts_segment': {'key': 'fragmentsPerTsSegment', 'type': 'int'}, } <NEW_LINE> def __init__( self, *, fragments_per_ts_segment: Optional[int] = None, **kwargs ): <NEW_LINE> <INDENT> super(Hls, self).__init__(**kwargs) <NEW_LINE> se...
HTTP Live Streaming (HLS) packing setting for the live output. :param fragments_per_ts_segment: The number of fragments in an HTTP Live Streaming (HLS) TS segment in the output of the live event. This value does not affect the packing ratio for HLS CMAF output. :type fragments_per_ts_segment: int
6259905607d97122c4218214
class ApiDocsMalhas(ApiDocsService): <NEW_LINE> <INDENT> @property <NEW_LINE> def produces(self): <NEW_LINE> <INDENT> return ["image/svg+xml", "application/vnd.geo+json", "application/json"] <NEW_LINE> <DEDENT> def _paths_responses(self, operation_id): <NEW_LINE> <INDENT> if operation_id == "idGet": <NEW_LINE> <INDENT>...
Special case for /api/v2/malhas It's the only that doesn't provide info in responses, also, the `produces` entry is filled here by hand
6259905694891a1f408ba1ab
class Scene: <NEW_LINE> <INDENT> def __init__(self, description: str): <NEW_LINE> <INDENT> self.description = description <NEW_LINE> self.dialogue = [] <NEW_LINE> <DEDENT> def add_dialogue(self, description: str, *, author: str=None): <NEW_LINE> <INDENT> if author: <NEW_LINE> <INDENT> self.dialogue.append(Dialogue(auth...
The script's scene
625990564e4d562566373971
class SelectAbspath_Field(Select_Field): <NEW_LINE> <INDENT> def get_links(self, links, resource, field_name, languages): <NEW_LINE> <INDENT> return get_abspath_links(self, links, resource, field_name, languages) <NEW_LINE> <DEDENT> def update_links(self, resource, field_name, source, target, languages, old_base, new_b...
Select_Field with values linking to resources abspath
6259905699cbb53fe6832449
class DeclareQueuePublisher(Publisher): <NEW_LINE> <INDENT> def send(self, conn, msg, timeout=None): <NEW_LINE> <INDENT> queue = kombu.entity.Queue( channel=conn.channel, exchange=self.exchange, durable=self.durable, auto_delete=self.auto_delete, name=self.routing_key, routing_key=self.routing_key, queue_arguments=self...
Publisher that declares a default queue When the exchange is missing instead of silently creating an exchange not binded to a queue, this publisher creates a default queue named with the routing_key. This is mainly used to not miss notifications in case of nobody consumes them yet. If the future consumer binds the de...
62599056596a897236129065
class Solution: <NEW_LINE> <INDENT> def twoSum2(self, nums, target): <NEW_LINE> <INDENT> nums.sort() <NEW_LINE> count, l, r = 0, 0, len(nums)-1 <NEW_LINE> while l < r: <NEW_LINE> <INDENT> cur_sum = nums[l] + nums[r] <NEW_LINE> if cur_sum > target: <NEW_LINE> <INDENT> count += r - l <NEW_LINE> r -= 1 <NEW_LINE> <DEDENT>...
@param nums: an array of integer @param target: An integer @return: an integer 443. 两数之和 II 给一组整数,问能找出多少对整数,他们的和大于一个给定的目标值。 样例 对于 numbers = [2, 7, 11, 15], target = 24 的情况,返回 1。因为只有11 + 15可以大于24。 挑战 Do it in O(1) extra space and O(nlogn) time.
6259905623849d37ff85262f
class DeployTarget(object): <NEW_LINE> <INDENT> def __init__(self, host, username): <NEW_LINE> <INDENT> self._host = host <NEW_LINE> self._username = username <NEW_LINE> self._shell_client = ShellClientFactory.create(host, username) <NEW_LINE> <DEDENT> def deploy_binary(self, source_tar, dest_dir): <NEW_LINE> <INDENT> ...
A "deploy target" is the host to which clusterrunner will be deployed to. Deployment entails putting in place the clusterrunner binaries and configuration only. This class is not responsible for manipulating processes and stopping/starting services.
6259905621bff66bcd7241cf
class PageLoaderTestCase(LoginEnrollmentTestCase): <NEW_LINE> <INDENT> def check_all_pages_load(self, course_id): <NEW_LINE> <INDENT> store = modulestore() <NEW_LINE> course = store.get_course(course_id) <NEW_LINE> self.enroll(course, True) <NEW_LINE> items = store.get_items(course_id) <NEW_LINE> if len(items) < 1: <NE...
Base class that adds a function to load all pages in a modulestore.
625990564e4d562566373972
class Bot: <NEW_LINE> <INDENT> def __init__(self, number_of_users, max_posts_per_user, max_like_per_user): <NEW_LINE> <INDENT> self.users_count = number_of_users <NEW_LINE> self.max_posts = max_posts_per_user <NEW_LINE> self.max_likes = max_like_per_user <NEW_LINE> <DEDENT> def user_signup(self): <NEW_LINE> <INDENT> ur...
Automated bot for user registration, post creation and post liked.
625990568e71fb1e983bd034
class InvalidLogFormatException(Exception): <NEW_LINE> <INDENT> pass
Thrown when an invalid logformat is passed.
625990563eb6a72ae038bbca
class DbLinkedList(): <NEW_LINE> <INDENT> def __init__(self, value=None): <NEW_LINE> <INDENT> self.head = None <NEW_LINE> self.tail = None <NEW_LINE> self.length = 0 <NEW_LINE> if value: <NEW_LINE> <INDENT> self.push(value) <NEW_LINE> <DEDENT> <DEDENT> def push(self, value=None): <NEW_LINE> <INDENT> new_node = Node(val...
Instantiate a doubly linked list.
62599056fff4ab517ebced8f
class AccountIntrastatCode(models.Model): <NEW_LINE> <INDENT> _name = "account.intrastat.code" <NEW_LINE> _description = "Intrastat Code" <NEW_LINE> _translate = False <NEW_LINE> _order = "nckey" <NEW_LINE> name = fields.Char(string="Name") <NEW_LINE> nckey = fields.Char(string="NC Key") <NEW_LINE> code = fields.Char(s...
Codes used for the intrastat reporting. The list of commodity codes is available on: http://www.intrastat.ro/doc/CN_2020.xml
6259905632920d7e50bc75b2
class ParseStreamingManifestRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.MediaManifestContent = None <NEW_LINE> self.ManifestType = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.MediaManifestContent = params.get("MediaManifestContent") <NEW...
ParseStreamingManifest请求参数结构体
625990563cc13d1c6d466cab
class DirSchema(MetaParser): <NEW_LINE> <INDENT> schema = { 'dir': { 'dir_name': str, 'total_bytes': str, 'total_free_bytes': str, Optional('location'): str, Optional('files'): {Any(): {Optional('size'): str, Optional('date'): str, Optional('permission'): str, Optional('index'): str, Optional('time'): str, Optional('da...
Schema for * dir * dir {directory} * dir location {location} * dir {directory} location {location}
6259905615baa723494634fe
class FTP(ftplib.FTP): <NEW_LINE> <INDENT> def __init__(self, host, user=None, passwd=None, netrcfile=None, logger=None): <NEW_LINE> <INDENT> auths = parse_netrc(netrcfile) <NEW_LINE> if host in auths: <NEW_LINE> <INDENT> if user is None: <NEW_LINE> <INDENT> user = auths[host]['login'] <NEW_LINE> <DEDENT> if passwd is ...
Initialize object for simpler ftp operations. The FTP object has an attribute ``ftp`` which is the actual ftplib.FTP() object. This can be used for operations not supported by this class. :param host: ftp host name :param user: user name (default=netrc value or anonymous) :param passwd: password (default=netrc value...
625990567cff6e4e811b6fae
class SimBot(Bot): <NEW_LINE> <INDENT> def __init__(self, sim, name, owner): <NEW_LINE> <INDENT> super().__init__(name, owner) <NEW_LINE> self.sensors = [] <NEW_LINE> self.sim = sim <NEW_LINE> self.observer = Observer(self.notify) <NEW_LINE> self.agent.observable.attachObserver(self.observer) <NEW_LINE> <DEDENT> def ad...
Bot for Simulator
625990560fa83653e46f6451
class ZConsError(RuntimeError): <NEW_LINE> <INDENT> pass
Base class for zcons exceptions.
625990568da39b475be04758
class MainHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def initialize(self, conn): <NEW_LINE> <INDENT> self.conn = conn <NEW_LINE> <DEDENT> @gen.coroutine <NEW_LINE> def delete(self): <NEW_LINE> <INDENT> c = self.conn.cursor() <NEW_LINE> c.execute('DELETE FROM logged_requests') <NEW_LINE> c.execute('DELETE ...
Handler.
6259905682261d6c52730980
class Generator(Base): <NEW_LINE> <INDENT> def __init__(self, text, cursor): <NEW_LINE> <INDENT> self.t = text <NEW_LINE> self.c = cursor <NEW_LINE> self.first = False <NEW_LINE> return <NEW_LINE> <DEDENT> def do_string(self, t): <NEW_LINE> <INDENT> self.t.insertString(self.c, t, False) <NEW_LINE> <DEDENT> def do_i(sel...
Returns an object capable of transforming an abstract representation of text into actual text in OpenOffice.
6259905630dc7b76659a0d35
class AbstractDatabase(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def connect(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def run_stored_procedure(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractme...
Abstract base class to serve as parent for different implementations of databases.
6259905694891a1f408ba1ac
class ProcessIntruder(ProcessPlayer): <NEW_LINE> <INDENT> def __init__(self, env, id, state, episode_count): <NEW_LINE> <INDENT> super(ProcessIntruder, self).__init__(env, id, state, episode_count) <NEW_LINE> self.role = 'intruder' <NEW_LINE> self.action_space = Config.INTRUDER_ACTION_SPACE <NEW_LINE> self.nb_actions =...
docstring for ProcessIntruder.
6259905607d97122c4218217
class VariableSetListPrinter(object): <NEW_LINE> <INDENT> GLOBALSET = None <NEW_LINE> def __init__(self, val): <NEW_LINE> <INDENT> self.val = val <NEW_LINE> <DEDENT> def to_string(self): <NEW_LINE> <INDENT> return str(self.val.address) <NEW_LINE> <DEDENT> def children(self): <NEW_LINE> <INDENT> if VariableSetListPrinte...
Print a variable_set_list.
6259905676e4537e8c3f0af8
class CreateInvoiceForm(forms.ModelForm): <NEW_LINE> <INDENT> due_date = forms.DateTimeField(initial=datetime.now() + timedelta(days=30)) <NEW_LINE> create_date = forms.DateTimeField(initial=datetime.now()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Invoice <NEW_LINE> fields = ('title', 'description', "amount",...
Form to create an invoice
625990568e71fb1e983bd036
class NoCountPaginator(paginator.Paginator): <NEW_LINE> <INDENT> def get_count(self): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def page(self): <NEW_LINE> <INDENT> output = super(NoCountPaginator, self).page() <NEW_LINE> del output['meta']['total_count'] <NEW_LINE> return output
Paginator class that avoids a COUNT query and provides no total count.
625990572ae34c7f260ac654
class TestCarnEating(object): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.copy_carn_kills_herb = Carnivore.carn_kills_herb <NEW_LINE> self.copy_params = Carnivore.params.copy() <NEW_LINE> self.carn = Carnivore(20, 13) <NEW_LINE> self.herbs = [Herbivore(20, 13), Herbivore(12)] <NEW_LINE> <DEDENT> def t...
Collects tests that allows us to override method carn_kill_herb and change default parameters.
62599057379a373c97d9a591
class SalsahError(Exception): <NEW_LINE> <INDENT> pass
Error in getting data from SALSAH
62599057e5267d203ee6ce5c
class Detect(Thread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> self.capteur = 7 <NEW_LINE> GPIO.setmode(GPIO.BCM) <NEW_LINE> GPIO.setup(self.capteur, GPIO.IN) <NEW_LINE> time.sleep(2) <NEW_LINE> self.move = False <NEW_LINE> self.submit_mail = False <NEW_LINE> <DEDENT>...
Launche the detector.
6259905710dbd63aa1c72130
class NumberRangeInput(GenericInput): <NEW_LINE> <INDENT> _sub_types = NumberInput._sub_types <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> var_attrs = ("main_caption", "r_max", "r_min", "shadow", "shadow_2", "user_can_add") <NEW_LINE> GenericInput.__init__(self,var_attrs) <NEW_LINE> self.__dict__["input_type"] = ...
The NumberRangeInput defines an input element where a user must specify a low and a high value. **A RangeInput response is a list of 2 numerical values** The NumberRangeElement descends from GenericInput and tightens the ``_var_attrs`` whitelist to the following attributes: -- main_caption -- r_max -- r_min -- s...
62599057009cb60464d02aa2
class AttnGRU: <NEW_LINE> <INDENT> def __init__(self, num_units, is_train, bn): <NEW_LINE> <INDENT> self.num_units = num_units <NEW_LINE> self.is_train = is_train <NEW_LINE> self.bn = bn <NEW_LINE> <DEDENT> def __call__(self, inputs, state, attention): <NEW_LINE> <INDENT> with tf.variable_scope('AttnGRU'): <NEW_LINE> <...
Attention-based GRU (used by the Episodic Memory Module).
62599057f7d966606f74936f
class WinLoginsGraph(BaseGraphPlugin): <NEW_LINE> <INDENT> NAME = 'WinLogins' <NEW_LINE> DISPLAY_NAME = 'Windows logins' <NEW_LINE> def generate(self): <NEW_LINE> <INDENT> query = 'tag:logon-event' <NEW_LINE> return_fields = [ 'computer_name', 'username', 'logon_type', 'logon_process' ] <NEW_LINE> events = self.event_s...
Graph plugin for Windows logins.
62599057baa26c4b54d50813
class PurchaseReport(ReportMixin): <NEW_LINE> <INDENT> __name__ = 'report.purchase' <NEW_LINE> @classmethod <NEW_LINE> def get_context(cls, records, data): <NEW_LINE> <INDENT> Purchase = Pool().get('purchase.purchase') <NEW_LINE> Party = Pool().get('party.party') <NEW_LINE> Product = Pool().get('product.product') <NEW_...
Purchase Report
62599057596a897236129067
class GenerationTransformer(tf.keras.models.Model): <NEW_LINE> <INDENT> def __init__(self, vocab_size, num_layers, model_dims, attention_depth, num_heads, hidden_dims): <NEW_LINE> <INDENT> super(GenerationTransformer, self).__init__() <NEW_LINE> self.embedding_layer = WordAndPositionalEmbedding(model_dims, vocab_size) ...
Transformer language model
6259905723849d37ff852633
class WhoisDk(WhoisEntry): <NEW_LINE> <INDENT> regex = { 'domain_name': r'Domain: *(.+)', 'creation_date': r'Registered: *(.+)', 'expiration_date': r'Expires: *(.+)', 'dnssec': r'Dnssec: *(.+)', 'status': r'Status: *(.+)', 'registrant_handle': r'Registrant\s*(?:.*\n){1}\s*H...
Whois parser for .dk domains
62599057b5575c28eb713783
class Clause(object): <NEW_LINE> <INDENT> def __init__(self, conjunction=True, exprs=None): <NEW_LINE> <INDENT> self._and = conjunction <NEW_LINE> self._exprs = [] if exprs is None else exprs <NEW_LINE> <DEDENT> def is_and(self): <NEW_LINE> <INDENT> return self._and <NEW_LINE> <DEDENT> def add(self, expr): <NEW_LINE> <...
Set of expressions connected by AND or OR.
6259905721bff66bcd7241d3
class TestBudgetDetail(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 testBudgetDetail(self): <NEW_LINE> <INDENT> pass
BudgetDetail unit test stubs
6259905701c39578d7f141ee
class SentenceModel(metaclass=ABCMeta): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.session = tf.Session() <NEW_LINE> self.graph = tf.get_default_graph() <NEW_LINE> <DEDENT> @property <NEW_LINE> @abstractmethod <NEW_LINE> def model(self) -> tf.keras.models.Model: <NEW_LINE> <INDENT> raise NotImplem...
Base class for a sentence model Attributes ---------- session: tf.Session The tensorflow session. graph: tf.Graph The tensorflow graph.
625990578e7ae83300eea5fc
class Logger(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def create_logger(self): <NEW_LINE> <INDENT> logger = logging.getLogger(__name__) <NEW_LINE> logger.setLevel(logging.INFO) <NEW_LINE> ch = logging.StreamHandler() <NEW_LINE> ch.setLevel(logging.INFO) <NEW_LINE> fo...
Logger object to use in functions
62599057d53ae8145f9199d1
class Attention(Layer): <NEW_LINE> <INDENT> def __init__(self, attention_dim, **kwargs): <NEW_LINE> <INDENT> self.attention_dim = attention_dim <NEW_LINE> super(Attention, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def build(self, input_shape): <NEW_LINE> <INDENT> self.hidden_dim = input_shape[2] <NEW_LINE> self.W = ...
Attention operation for temporal data. # Input shape 3D tensor with shape: `(samples, steps, features)`. # Output shape 2D tensor with shape: `(samples, features)`.
625990574a966d76dd5f0460
class service(object): <NEW_LINE> <INDENT> def __init__(self, serviceName, servicePort, serviceIP=""): <NEW_LINE> <INDENT> self.serviceName = serviceName <NEW_LINE> self.servicePort = servicePort <NEW_LINE> self.serviceIP = serviceIP <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s %s:%s" % (self....
Stores variables for a service
62599057097d151d1a2c25da
class FengHuangSpider(RedisCrawlSpider): <NEW_LINE> <INDENT> name = "fenghuang" <NEW_LINE> redis_key = settings.caijing_start_urls <NEW_LINE> allowed_domains = ['news.ifeng.com'] <NEW_LINE> rules = (Rule( LinkExtractor( allow=r"news.ifeng.com/a/\d{8}/\d*",), callback="parse_article", follow=True), ) <NEW_LINE> def pars...
凤凰网 Spider
62599057460517430c432b09
class AllAppsAllLogsSummaryConverter(AllLogsConverter): <NEW_LINE> <INDENT> all_in_one_gvc_tljs_log_path = "/data/mixs_logs/%s/apps/*/%s/%s" % (AllLogsConverter.json_log_dir, AllLogsConverter.all_in_one_log_dir, AllLogsConverter.all_in_one_gvc_tljs_file) <NEW_LINE> apps_stats_path = "%s/%s" % (AllLogsConverter.stats_lo...
Convert all json file, or all_in_one_json_log for each user to one coordinated file for each user.
625990577047854f4634092f
class InferenceWrapperBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def build_model(self, model_config): <NEW_LINE> <INDENT> tf.compat.v1.logging.fatal("Please implement build_model in subclass") <NEW_LINE> <DEDENT> def _create_restore_fn(self, checkpoint_path, saver...
Base wrapper class for performing inference with an image-to-text model.
625990578e7ae83300eea5fd
class FashionMNIST(AbstractDomainInterface): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(FashionMNIST, self).__init__() <NEW_LINE> im_transformer = transforms.Compose([transforms.ToTensor()]) <NEW_LINE> root_path = './workspace/datasets/fmnist' <NEW_LINE> self.D1_train_ind = torch.arange(0,...
FashionMNIST: 60,000 train + 10,000 test. D1: (50,000 train + 10,000 valid) + (10,000 test) D2: 60,000 valid + 10,000 test.
62599057462c4b4f79dbcf75
class CreateLicenseeView(LoginRequiredMixin, SuccessMessageMixin, CreateView): <NEW_LINE> <INDENT> model = Licensee <NEW_LINE> fields = ['first_name', 'last_name', 'designation', 'organization_name', 'mobile', 'email', 'status'] <NEW_LINE> template_name = 'licensee_form.html' <NEW_LINE> success_message = "%(first_name)...
Create new licensee
6259905710dbd63aa1c72131
class Host(): <NEW_LINE> <INDENT> def __init__(self, ip_address, mac_address): <NEW_LINE> <INDENT> self.ip_address = ip_address <NEW_LINE> self.mac_address = mac_address <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%s%s" % (self.ip_address, self.mac_address)
:return: string with IP address, string with mac address
6259905738b623060ffaa306
class Crash(angr.SimProcedure): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> DeepAngr(procedure=self).api_crash()
Implements DeepState_Crash, which notifies us of a crashing test.
6259905763d6d428bbee3d3f
class Amenity(BaseModel): <NEW_LINE> <INDENT> name = "" <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(self, *args, **kwargs)
class Amenity that inherits from BaseModel public class attribute: name: string - empty string
6259905707d97122c421821a
class EdisonArduinoGpioIn(GpioIn, _EdisonArduinoGpioBase): <NEW_LINE> <INDENT> def __init__(self, pin_config): <NEW_LINE> <INDENT> super().__init__(pin_config) <NEW_LINE> gpio.configure_out(self._out_pin) <NEW_LINE> gpio.configure_in(self._pullup_pin) <NEW_LINE> <DEDENT> @property <NEW_LINE> def pullup(self): <NEW_LINE...
Intel Edison Arduino board GPIO input driver. Provides automated muxing.
6259905799cbb53fe683244f
class VirtKey(object): <NEW_LINE> <INDENT> def __init__(self, hyper, id_, opts): <NEW_LINE> <INDENT> self.opts = opts <NEW_LINE> self.hyper = hyper <NEW_LINE> self.id = id_ <NEW_LINE> path = os.path.join(self.opts["pki_dir"], "virtkeys", hyper) <NEW_LINE> if not os.path.isdir(path): <NEW_LINE> <INDENT> os.makedirs(path...
Used to manage key signing requests.
62599057a8ecb03325872787
class TacTemp: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<TacTemp %s>"%self.name
should be Immutable
62599057f7d966606f749370
class XMarkerTriangle(XMarkerBase): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(XMarkerTriangle, self).__init__(parent) <NEW_LINE> self.update() <NEW_LINE> <DEDENT> def setPath(self): <NEW_LINE> <INDENT> path = QPainterPath() <NEW_LINE> path.moveTo(self._wrs*0.5,self._hrs*0.2) <NEW_LI...
A Triangle
625990573c8af77a43b689f8
class TestScrewer(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.screwer = Screwer('5') <NEW_LINE> <DEDENT> def test_setup_screwer(self): <NEW_LINE> <INDENT> self.assertEqual(self.screwer.mode, '5') <NEW_LINE> <DEDENT> def test_exit_screwer(self): <NEW_LINE> <INDENT> self.assertEqual(...
Tests the Jobset Class
6259905707d97122c421821b
class MigrationTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.ms = gdata.apps.migration.service.MigrationService( email=admin_email, password=admin_password, domain=domain) <NEW_LINE> self.ms.ProgrammaticLogin() <NEW_LINE> <DEDENT> def testImportMail(self): <NEW_LINE> <INDENT> se...
Test for the MigrationService.
6259905723e79379d538da6c
class LocalConfig(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def parseConfigFile(self): <NEW_LINE> <INDENT> config = ConfigParser.ConfigParser() <NEW_LINE> cfg_file = os.path.join(getUserFolder(),DEFAULT_CONFIG_FILE_NAME) <NEW_LINE> config.read(cfg_file) <NEW_LINE> self.sour...
Stores the local paths to the datasets
6259905716aa5153ce401a54
class ClipboardGrabFormat(BaseGrabFormat): <NEW_LINE> <INDENT> def _can_read(self, request): <NEW_LINE> <INDENT> if request.mode[1] not in 'i?': <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> if request.filename != '<clipboard>': <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return bool(self._init_pillow()...
The ClipboardGrabFormat provided a means to grab image data from the clipboard, using the uri "<clipboard>" This functionality is provided via Pillow. Note that "<clipboard>" is only supported on Windows. Parameters for reading ---------------------- No parameters.
6259905724f1403a92686387
class DenseDilated(nn.Module): <NEW_LINE> <INDENT> def __init__(self, k=9, dilation=1, stochastic=False, epsilon=0.0): <NEW_LINE> <INDENT> super(DenseDilated, self).__init__() <NEW_LINE> self.dilation = dilation <NEW_LINE> self.stochastic = stochastic <NEW_LINE> self.epsilon = epsilon <NEW_LINE> self.k = k <NEW_LINE> <...
Find dilated neighbor from neighbor list edge_index: (2, batch_size, num_points, k)
625990570a50d4780f706877
class ImmutableCollection(object): <NEW_LINE> <INDENT> def __init__(self, init_data=None): <NEW_LINE> <INDENT> self.class_name = self.__class__.__name__ <NEW_LINE> if init_data: <NEW_LINE> <INDENT> if isinstance(init_data, dict): <NEW_LINE> <INDENT> self.collection = init_data <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDE...
Construct an immutable collection from a dictionary.
625990573eb6a72ae038bbd0
class ActorCritic(object): <NEW_LINE> <INDENT> def __init__(self, env, inSize, outSize,layers,gamma, lrPi, lrV ): <NEW_LINE> <INDENT> self.inSize = inSize <NEW_LINE> self.outSize = outSize <NEW_LINE> self.pi = Pi(inSize, outSize, layers) <NEW_LINE> self.V = V(inSize, outSize, layers) <NEW_LINE> self.gamma = gamma <NEW_...
The world's simplest agent!
62599057adb09d7d5dc0badb
class TestLogout(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> super(TestLogout, cls).setUpTestData() <NEW_LINE> cls.tester = User.objects.create_user(username='authtester', email='authtester@example.com', password='password') <NEW_LINE> cls.logout_url = reverse('tcm...
Test for logout view method
6259905732920d7e50bc75b7
class TaskLoggingConfiguration(_messages.Message): <NEW_LINE> <INDENT> @encoding.MapUnrecognizedFields('additionalProperties') <NEW_LINE> class LogLevelsValue(_messages.Message): <NEW_LINE> <INDENT> class AdditionalProperty(_messages.Message): <NEW_LINE> <INDENT> class ValueValueValuesEnum(_messages.Enum): <NEW_LINE> <...
Logging configuration for the task. Messages: LogLevelsValue: Map of logger name to log4j log level. Fields: logLevels: Map of logger name to log4j log level.
625990577047854f46340931
class MineCraftProxy(Extension): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> name = type(self).__name__ <NEW_LINE> super().__init__(name) <NEW_LINE> self.mc = None <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> message = self.read() <NEW_LINE> topic = message.get(...
继承 Extension 之后你将获得: self.actuator_sub self.sensor_pub self.logger
62599057462c4b4f79dbcf77
class SearchDialog(ActionCancelDialog): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> ActionCancelDialog.__init__(self, parent, title="Search", actionButtonLabel="Filter") <NEW_LINE> searchLabel = wx.StaticText(self.panel, wx.NewId(), 'Query:') <NEW_LINE> self.query = wx.TextCtrl(self.panel, wx.Ne...
The Search dialog. It allows to search for a query in the list of entries. @group Events: __on* @sort: __*, g*
625990578e71fb1e983bd03b
class BasicBlock(nn.Module): <NEW_LINE> <INDENT> expansion = 1 <NEW_LINE> __constants__ = ['downsample'] <NEW_LINE> def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1, base_width=64, dilation=1, norm_layer=None): <NEW_LINE> <INDENT> super(BasicBlock, self).__init__() <NEW_LINE> if norm_layer is No...
A wrapup of a residual block
625990570fa83653e46f6457
class ParameterNumberError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, *args): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> super(ParameterNumberError, self).__init__(message, *args)
Raise an error when the number of parameter given by the user do not correspond to the number of parameters detected in the symbolic expression of the immittance.
625990578da39b475be0475e
class ResultViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = models.Result.objects.all() <NEW_LINE> serializer_class = serializers.ResultSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticated]
ViewSet for the Result class
6259905794891a1f408ba1af
class Article(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'article' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> uid = db.Column(db.Integer, nullable=False, index=True) <NEW_LINE> content = db.Column(db.Text) <NEW_LINE> created = db.Column(db.DateTime, nullable=False) <NEW_LINE> updated = db.Co...
文章
62599057009cb60464d02aa7
class GodZilla: <NEW_LINE> <INDENT> def __init__(self, name, health=100): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._health_points = health <NEW_LINE> self._damage = randint(10, 50) <NEW_LINE> <DEDENT> def attack(self, player): <NEW_LINE> <INDENT> player.lower_hp(self._damage) <NEW_LINE> print("you have los...
A monster should have the following attributes: * a name * hit points * maximum damage they can inflict A single method: * an attack method, which acceptsthe player and deducts maximum damage from the player's hitpoints
6259905776e4537e8c3f0afe
class NonNoisyImages(Dataset): <NEW_LINE> <INDENT> def __init__(self, img_path, transform=None): <NEW_LINE> <INDENT> self.filelist = create_non_noisy_filelist(img_path) <NEW_LINE> self.transform = transform <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> img = Image.open(self.filelist[index]) <NEW...
Dataset for reference images to be noised on the fly in the network.
6259905707d97122c421821d
class TransportError(Exception): <NEW_LINE> <INDENT> def __init__(self, source, err, msg=''): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> if isinstance(err, socket.error): <NEW_LINE> <INDENT> self.errno, self.msg = err.args <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.errno = err <NEW_LINE> self.msg = msg...
Transport related errors.
62599057ac7a0e7691f73a53
class VirtualMachineError(Exception): <NEW_LINE> <INDENT> pass
Virtual machine error exception.
62599057596a897236129069
class Breadcrumb(object): <NEW_LINE> <INDENT> def __init__(self, name, url): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.url = url <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.__unicode__() <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return u"%s,%s" % (self.name, se...
Breadcrumb can have methods to customize breadcrumb object, Breadcrumbs class send to us name and url.
62599057e76e3b2f99fd9f71
class ExplorationStats(object): <NEW_LINE> <INDENT> def __init__( self, exp_id, exp_version, num_actual_starts, num_completions, state_stats_mapping): <NEW_LINE> <INDENT> self.exp_id = exp_id <NEW_LINE> self.exp_version = exp_version <NEW_LINE> self.num_actual_starts = num_actual_starts <NEW_LINE> self.num_completions ...
Domain object representing analytics data for an exploration.
6259905724f1403a92686388
class UserSchema(ma.Schema): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = UserModel <NEW_LINE> fields = ("username", "password", "id") <NEW_LINE> load_only = ( "password", ) <NEW_LINE> dump_only = ("id",)
Schema for dump/load user model.
62599057adb09d7d5dc0badd
class GratisDNSProviderTests(TestCase, IntegrationTestsV2): <NEW_LINE> <INDENT> Provider = Provider <NEW_LINE> provider_name = "gratisdns" <NEW_LINE> domain = "denisa.dk" <NEW_LINE> gratisdns_session = "0123456789abcdef0123456789abcdef" <NEW_LINE> def _filter_post_data_parameters(self): <NEW_LINE> <INDENT> return ["log...
TestCase for GratisDNS
6259905745492302aabfda4b
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'chart_axis33.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename = test_di...
Test file created by XlsxWriter against a file created by Excel.
6259905729b78933be26ab7e
class WeaponDatabase(object): <NEW_LINE> <INDENT> def __len__(self): <NEW_LINE> <INDENT> return _weapon_scripts._length <NEW_LINE> <DEDENT> def __getitem__(self, item): <NEW_LINE> <INDENT> for info in self: <NEW_LINE> <INDENT> if info.class_name != item: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> return info <NEW...
WeaponDatabase accessor class.
62599057a17c0f6771d5d65a
class ComputeForwardingRulesAggregatedListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> pageToken = _messages.StringField(3) <NEW_LINE> project = _messages.StringField(4, requi...
A ComputeForwardingRulesAggregatedListRequest object. Fields: filter: Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: FIELD_NAME COMPARISON_STRING LITERAL_STRING. The FIELD_NAME is the name of the field you want to compar...
62599057e5267d203ee6ce62
class WMS13GetMapGIFDatasetTestCase(wmsbase.WMS13GetMapTestCase): <NEW_LINE> <INDENT> layers = ("mosaic_MER_FRS_1PNPDE20060822_092058_000001972050_00308_23408_0077_RGB_reduced",) <NEW_LINE> bbox = (8.5, 32.2, 25.4, 46.3) <NEW_LINE> frmt = "image/gif"
Test a GetMap request with a dataset series.
6259905715baa72349463506
@gin.configurable <NEW_LINE> class TransparentEncDecAttention(EncDecAttention): <NEW_LINE> <INDENT> def __init__(self, layers_per_encoder_module=gin.REQUIRED, layers_per_decoder_module=gin.REQUIRED, encoder_num_modules=gin.REQUIRED, decoder_num_modules=gin.REQUIRED, dropout_rate=0.0, **kwargs): <NEW_LINE> <INDENT> supe...
Transparent multi-head attention over encoder output.
62599057dc8b845886d54b39
class sortdict(collections.OrderedDict): <NEW_LINE> <INDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> if key in self: <NEW_LINE> <INDENT> del self[key] <NEW_LINE> <DEDENT> super(sortdict, self).__setitem__(key, value) <NEW_LINE> <DEDENT> if pycompat.ispypy: <NEW_LINE> <INDENT> def update(self, src): <NEW_...
a simple sorted dictionary >>> d1 = sortdict([(b'a', 0), (b'b', 1)]) >>> d2 = d1.copy() >>> d2 sortdict([('a', 0), ('b', 1)]) >>> d2.update([(b'a', 2)]) >>> list(d2.keys()) # should still be in last-set order ['b', 'a']
62599057498bea3a75a5909a
class SCAError(Exception): <NEW_LINE> <INDENT> pass
Error class for everything SCA-related (e.g. invalid rules or categories)
6259905707d97122c421821e
class Window(object): <NEW_LINE> <INDENT> def __init__(self, windowID): <NEW_LINE> <INDENT> self._display = Display() <NEW_LINE> self._root = self._display.screen().root <NEW_LINE> self._window = self._display.create_resource_object('window', windowID) <NEW_LINE> <DEDENT> def reserve_space(self, left=0, right=0, top=0,...
Abstract object representing the X Window of an application obtained with the window ID.
62599057a219f33f346c7d79
class TestModule(unittest.TestCase): <NEW_LINE> <INDENT> def test_configure(self): <NEW_LINE> <INDENT> here = os.path.abspath(os.path.dirname(__file__)) <NEW_LINE> dirs = [os.path.join(here, 'templates')] <NEW_LINE> configure(dirs) <NEW_LINE> self.assertIsInstance(config.engine, MustacheEngine, 'config.engine is invali...
Test the formalchemy_mustache module.
625990574428ac0f6e659aaf
class AbsLoss(LossSelfOperator): <NEW_LINE> <INDENT> @property <NEW_LINE> def _symbol(self): <NEW_LINE> <INDENT> return sympy.Symbol("|{}|".format(self.loss1.loss_text)) <NEW_LINE> <DEDENT> def forward(self, x_dict={}, **kwargs): <NEW_LINE> <INDENT> loss, x_dict = self.loss1.eval(x_dict, return_dict=True, return_all=Fa...
Apply the `abs` operation to the loss. Examples -------- >>> import torch >>> from pixyz.distributions import Normal >>> from pixyz.losses import LogProb >>> p = Normal(loc=torch.tensor(0.), scale=torch.tensor(1.), var=["x"], ... features_shape=[10]) >>> loss_cls = LogProb(p).abs() # equals to AbsLoss(LogPr...
62599057097d151d1a2c25df
class S3ScenarioTaskModel(S3Model): <NEW_LINE> <INDENT> names = ["scenario_task"] <NEW_LINE> def model(self): <NEW_LINE> <INDENT> T = current.T <NEW_LINE> s3 = current.response.s3 <NEW_LINE> scenario_id = self.scenario_scenario_id <NEW_LINE> task_id = self.project_task_id <NEW_LINE> tablename = "scenario_task" <NEW_LIN...
Scenario Tasks Model
625990573539df3088ecd81b
class TerminusDeleteWordCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, forward=False): <NEW_LINE> <INDENT> view = self.view <NEW_LINE> terminal = Terminal.from_id(view.id()) <NEW_LINE> if not terminal: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if len(view.sel()) != 1 or not view.sel()...
On Windows, ctrl+backspace and ctrl+delete are used to delete words However, there is no standard key to delete word with ctrl+backspace a workaround is to repeatedly apply backspace to delete word
6259905794891a1f408ba1b0
class Links(object): <NEW_LINE> <INDENT> def __init__(self, collection): <NEW_LINE> <INDENT> self.collection = list(collection) <NEW_LINE> self.index = len(self.collection) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return map(lambda r: Link(r), self.collection) <NEW_LINE> <DEDENT> def route_for(self, ...
Links =============== This returns an instance of the Links domain model
62599057ac7a0e7691f73a55
class MarkdownContext: <NEW_LINE> <INDENT> def __init__(self, size=6): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self._arr = [None] * size <NEW_LINE> <DEDENT> def clear(self, idx=0): <NEW_LINE> <INDENT> self._arr[idx:] = [None] * (self.size - idx) <NEW_LINE> <DEDENT> def insert(self, idx, val): <NEW_LINE> <INDENT...
Manage depth-based context from header tags in markdown. Example Markdown: # Header1 ## Header2 #### Header4 Represents as the following internally: [Header1, Header2, None, Header4, None, None] Insertions clears the subsequent levels; thus, inserting at Header3 clears the array values of 3, 4, 5.
62599057e76e3b2f99fd9f73
class VariantCondition(object): <NEW_LINE> <INDENT> __slots__ = ( '_user_id', '_variation_key', ) <NEW_LINE> @property <NEW_LINE> def user_id(self): <NEW_LINE> <INDENT> return self._user_id <NEW_LINE> <DEDENT> @user_id.setter <NEW_LINE> def user_id(self, value): <NEW_LINE> <INDENT> self._user_id = msgbuffers.validate_s...
Generated message-passing structure.
62599057b57a9660fecd2ff0
class Unknown(Variable): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<unknown>'
A variable which type is unknown.
625990574e4d56256637397c
class ItsiSession(OAuth2Session): <NEW_LINE> <INDENT> def get_user(self): <NEW_LINE> <INDENT> user_json = self.get(USER_JSON_URL) <NEW_LINE> return json.loads(user_json.content)
An OAuth 2.0 Session container for ITSI Portal. This is a simple wrapper around the OAuth2Session class, and provides a convenience method for getting user data from ITSI Portal. Documentation for OAuth2Session can be found here: https://rauth.readthedocs.org/en/latest/api/#oauth-2-0-sessions
6259905707d97122c421821f
class FinishCommand(BaseFinishCommand, PivotalTrackerCommand): <NEW_LINE> <INDENT> def _merge_branch(self, branch, *args): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.git.get_branch(branch) <NEW_LINE> self.story <NEW_LINE> <DEDENT> finally: <NEW_LINE> <INDENT> self.git.get_branch(self.branch) <NEW_LINE> <DEDENT> ...
Finish a story branch.
6259905724f1403a92686389
class JobPrePostDispatcher(Dispatcher): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(JobPrePostDispatcher, self).__init__('avocado.plugins.job.prepost')
Calls extensions before Job execution Automatically adds all the extension with entry points registered under 'avocado.plugins.job.prepost'
62599057d53ae8145f9199d7
class GRPCTestServerStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.SimpleMethod = channel.unary_unary( "/GRPCTestServer/SimpleMethod", request_serializer=test__server__pb2.Request.SerializeToString, response_deserializer=test__server__pb2.Response.FromString, ) <NEW_LINE> self.C...
Missing associated documentation comment in .proto file
625990573eb6a72ae038bbd4
class WKBSpatialElement(SpatialElement, expression.Function): <NEW_LINE> <INDENT> def __init__(self, desc, srid=4326, geometry_type='GEOMETRY'): <NEW_LINE> <INDENT> assert isinstance(desc, (six.binary_type, buffer)) <NEW_LINE> self.desc = desc <NEW_LINE> self.srid = srid <NEW_LINE> self.geometry_type = geometry_type <N...
Represents a Geometry value as expressed in the OGC Well Known Binary (WKB) format. Extends expression.Function so that in a SQL expression context the value is interpreted as 'GeomFromWKB(value)' or as the equivalent function in the currently used database .
625990578da39b475be04761
class Solution(object): <NEW_LINE> <INDENT> def removeElement(self, nums, val): <NEW_LINE> <INDENT> old_size = len(nums) <NEW_LINE> new_index = 0 <NEW_LINE> for curr_index in range(old_size): <NEW_LINE> <INDENT> curr_val = nums[curr_index] <NEW_LINE> if curr_val != val: <NEW_LINE> <INDENT> nums[new_index] = curr_val <N...
idea: 2 index pointers: new_index, points at new ends curr_index, walk through the array return new_index
62599057d486a94d0ba2d53e
class NumBinner(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, columns_to_bin, cat_columns, num_columns): <NEW_LINE> <INDENT> self.columns_to_bin = columns_to_bin <NEW_LINE> self.cat_columns = cat_columns <NEW_LINE> self.num_columns = num_columns <NEW_LINE> <DEDENT> def transform(self, data): ...
Binnig data in specified numerical columns values using 3 uniform quantiles (from 0 to 1). Usage example: `new_cat_cols, new_num_cols, modified_df = NumBinner(columns_to_bin, cat_cols, num_cols).fit_transform(df)`
6259905729b78933be26ab7f
class ProjectsLocationsModelsService(base_api.BaseApiService): <NEW_LINE> <INDENT> _NAME = u'projects_locations_models' <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> super(SpeechV1p1beta1.ProjectsLocationsModelsService, self).__init__(client) <NEW_LINE> self._upload_configs = { } <NEW_LINE> <DEDENT> def Cr...
Service class for the projects_locations_models resource.
6259905710dbd63aa1c72134
class MongoAdvancedSearchFilter(BaseFilterBackend): <NEW_LINE> <INDENT> def filter_queryset(self, request, queryset, view): <NEW_LINE> <INDENT> as_kwargs = get_as_kwargs(request) <NEW_LINE> if as_kwargs: <NEW_LINE> <INDENT> queryset = queryset.filter(**as_kwargs) <NEW_LINE> <DEDENT> return queryset
mongo高级搜索过滤器
62599057baa26c4b54d5081b
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Category - 种类 Django 要求模型必须继承models.Model
625990577d847024c075d951