code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class GSPAuction(Auction): <NEW_LINE> <INDENT> def __init__(self, candidates=[], n_winners=1): <NEW_LINE> <INDENT> Auction.__init__(self, candidates) <NEW_LINE> self.n_winners = min(n_winners, len(candidates)) <NEW_LINE> self.candidates = sorted(self.candidates, key=lambda x: -x['bid'] *...
This is the most fundamental GSP auction. Given the number of winners: n_winners 1. rank candidates by bid * quality_score 2. select the top n_winners as winners. 3. the price of each winner is bid' * quality_score' / quality_score, where bid' and quality_score' are for the next candidate.
6259905507d97122c42181f0
class ConnectionFailureToRemoteLibvirtInstance(MCVirtException): <NEW_LINE> <INDENT> pass
Connection failure whilst attempting to obtain a remote libvirt connection.
62599055cc0a2c111447c532
class PyFenicsDolfinx(PythonPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/FEniCS/dolfinx" <NEW_LINE> url = "https://github.com/FEniCS/dolfinx/archive/0.1.0.tar.gz" <NEW_LINE> git = "https://github.com/FEniCS/dolfinx.git" <NEW_LINE> maintainers = ["js947", "chrisrichardson", "garth-wells"] <NEW_LINE> vers...
Python interface library to Next generation FEniCS problem solving environment
6259905594891a1f408ba199
class Dialog1b(QDialog): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QDialog.__init__(self) <NEW_LINE> Dialog.setWindowTitle(self, "tile stitching") <NEW_LINE> btn_start = QPushButton("&start") <NEW_LINE> btn_start.clicked.connect(self.start_stitching) <NEW_LINE> l1 = QLabel('grid size x') <NEW_LINE> se...
Dialog1b(QDialog) asks fr metadata for the stitching process offers to upload results to omero under a given ID
6259905523e79379d538da42
class Ship(Card): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> Card.__init__(self, data) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Ship({})'.format(self.name) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Ship({})'.format( self.name.__repr__(), )
Represents a ship card.
6259905507f4c71912bb0980
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> load_status()
Loads data into newly created database
625990554e4d56256637394d
class TestPullGpupsSparse(unittest.TestCase): <NEW_LINE> <INDENT> def test_static_graph(self): <NEW_LINE> <INDENT> startup_program = fluid.Program() <NEW_LINE> train_program = fluid.Program() <NEW_LINE> slots = [] <NEW_LINE> with fluid.program_guard(train_program, startup_program): <NEW_LINE> <INDENT> l = fluid.layers....
Test PullGpupsSparse op.
62599055baa26c4b54d507ea
class SumInventory(SumBase): <NEW_LINE> <INDENT> __intypes__ = [inventory.Inventory] <NEW_LINE> def update(self, store, context): <NEW_LINE> <INDENT> value = self.eval_args(context)[0] <NEW_LINE> store[self.handle].add_inventory(value)
Calculate the sum of the inventories. The result is an Inventory.
62599055adb09d7d5dc0bab1
class Recipient(NamedTuple): <NEW_LINE> <INDENT> messenger: str <NEW_LINE> user: TypeUser <NEW_LINE> address: str
Class is used to represent a message recipient.
625990558e71fb1e983bd010
class mnist_co(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_path, nt, num_datapoints=None): <NEW_LINE> <INDENT> self.data_path = data_path <NEW_LINE> self.num_totalpoints = len(fnmatch.filter(os.listdir(self.data_path), '*.hkl')) <NEW_LINE> if num_datapoints is not None: <NEW_LINE> <INDENT> self.num_datapoints...
Assumes that there is a root directory which contains each individual video saved as 1.hkl, 2.hkl....N.hkl Clip IDs may be provided or picked at random given the number to be picked
6259905532920d7e50bc7595
class IImport(IPythonNode): <NEW_LINE> <INDENT> fromimport = Attribute("The module name from import or None") <NEW_LINE> names = Attribute(u"List of tuples containing (importname, asname)")
Import line.
62599055dd821e528d6da423
class BlenderVRConfigFileOperator(Operator): <NEW_LINE> <INDENT> bl_label = "Manipulate BlenderVR Configuration File" <NEW_LINE> bl_idname = 'bvr.configfile' <NEW_LINE> bl_options = {'REGISTER'} <NEW_LINE> action = bpy.props.StringProperty(options={'HIDDEN'}, default="undefined") <NEW_LINE> def execute(self, context): ...
Load/reload/create BlenderVR configuration file. When the file is loaded, its available screens sets is used to refresh tool ui (list of screens sets).
625990554a966d76dd5f0438
class Source(BaseModel): <NEW_LINE> <INDENT> originAbsenceDetection: bool = False
Models a source.
62599055d7e4931a7ef3d5c5
class ComponentPattern(object): <NEW_LINE> <INDENT> _components = None <NEW_LINE> @staticmethod <NEW_LINE> def guess_components(): <NEW_LINE> <INDENT> if not settings.env_root: <NEW_LINE> <INDENT> return () <NEW_LINE> <DEDENT> comp = [] <NEW_LINE> for base in os.listdir(settings.cases_dir): <NEW_LINE> <INDENT> full = o...
tests from a component name
6259905545492302aabfda1f
class ShiningLaser(Ability): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.name = 'Shining Laser' <NEW_LINE> self.element = Elements.LIGHT <NEW_LINE> self.mana_cost = 7 <NEW_LINE> self.attack_power = 20 <NEW_LINE> self.category = Category.MAGIC <NEW_LINE> <DEDENT> @prope...
A charge ability that takes one turn to activate.
6259905599cbb53fe6832427
class SubFormatSSR_Transition(FixedTransition): <NEW_LINE> <INDENT> command_attributes = {'tlmsid': 'OFMTSSSR'} <NEW_LINE> state_keys = ['subformat'] <NEW_LINE> transition_key = 'subformat' <NEW_LINE> transition_val = 'SSR'
Transition to telemetry SSR subformat
625990553eb6a72ae038bba8
class Solution: <NEW_LINE> <INDENT> def sortColors2(self, colors, k): <NEW_LINE> <INDENT> self.quickSort(0, len(colors) - 1, colors) <NEW_LINE> <DEDENT> def quickSort(self, start, end, colors): <NEW_LINE> <INDENT> if start >= end: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> pivot = colors[start + (end - start) // 2]...
@param colors: A list of integer @param k: An integer @return: nothing
62599055e64d504609df9e74
@base.ReleaseTracks(base.ReleaseTrack.GA) <NEW_LINE> class Create(base.CreateCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> _Args(parser) <NEW_LINE> flags.AddClusterAutoscalingFlags(parser, hidden=True) <NEW_LINE> flags.AddLocalSSDFlag(parser, suppressed=True) <NEW_LINE> fl...
Create a node pool in a running cluster.
6259905516aa5153ce401a2d
class DeclineTaskView(TaskApprovePermitMixin, UpdateView): <NEW_LINE> <INDENT> model = Task <NEW_LINE> form_class = DeclineTaskForm <NEW_LINE> template_name = 'task_management/task_decline_form.html' <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> result = super(DeclineTaskView, self).post(requ...
View for decline task
62599055e76e3b2f99fd9f47
class InvalidRequest(AnalytixError): <NEW_LINE> <INDENT> pass
Exception thrown when a request to be made to the YouTube Analytics API is not valid.
62599055adb09d7d5dc0bab3
class Enviroment: <NEW_LINE> <INDENT> def __init__(self, name,probDistro, paramsDistro=[],desc=None,dicObj={}): <NEW_LINE> <INDENT> self.name=name <NEW_LINE> self.probDistro=probDistro <NEW_LINE> self.paramsDistro=paramsDistro <NEW_LINE> self.desc=desc <NEW_LINE> self.dicObj=cp.deepcopy(dicObj) <NEW_LINE> <DEDENT> def ...
docstring for Enviroment.
6259905563d6d428bbee3d1c
class RegressionDataset(StructuredDataset): <NEW_LINE> <INDENT> def __init__(self, df, dep_var_name, protected_attribute_names, privileged_classes, instance_weights_name='', categorical_features=[], na_values=[], custom_preprocessing=None, metadata=None): <NEW_LINE> <INDENT> if custom_preprocessing: <NEW_LINE> <INDENT>...
Base class for regression datasets.
62599055004d5f362081fa91
class Users(AbstractUser): <NEW_LINE> <INDENT> mobile = models.CharField(max_length=11, unique=True, verbose_name='手机号') <NEW_LINE> email_active = models.BooleanField(default=False, verbose_name="邮箱验证状态") <NEW_LINE> default_address = models.ForeignKey('Address', related_name='users', null=True, blank=True, on_delete=mo...
自定义用户模型类/继承系统模型类并添加自定义字段
62599055d7e4931a7ef3d5c7
class MEUnit(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, side_channels, groups, downsample, ignore_group, **kwargs): <NEW_LINE> <INDENT> super(MEUnit, self).__init__(**kwargs) <NEW_LINE> self.downsample = downsample <NEW_LINE> mid_channels = out_channels // 4 <NEW_LINE> if downsample...
MENet unit. Parameters: ---------- in_channels : int Number of input channels. out_channels : int Number of output channels. side_channels : int Number of side channels. groups : int Number of groups in convolution layers. downsample : bool Whether do downsample. ignore_group : bool Whether ign...
62599055379a373c97d9a56e
class DescribeTrainingJobsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Offset = None <NEW_LINE> self.Limit = None <NEW_LINE> self.CreationTimeAfter = None <NEW_LINE> self.CreationTimeBefore = None <NEW_LINE> self.NameContains = None <NEW_LINE> self.StatusEquals = None <NEW_LI...
DescribeTrainingJobs请求参数结构体
6259905555399d3f05627a69
class V1EnvVarSource(object): <NEW_LINE> <INDENT> def __init__(self, config_map_key_ref=None, field_ref=None, resource_field_ref=None, secret_key_ref=None): <NEW_LINE> <INDENT> self.swagger_types = { 'config_map_key_ref': 'V1ConfigMapKeySelector', 'field_ref': 'V1ObjectFieldSelector', 'resource_field_ref': 'V1ResourceF...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599055009cb60464d02a7f
class BasicNetworkSwitch(IPMixin, PortMixin, Device): <NEW_LINE> <INDENT> _clusto_type = 'networkswitch' <NEW_LINE> _driver_name = 'basicnetworkswitch' <NEW_LINE> _portmeta = {'pwr-nema-5' : {'numports':1}, 'nic-eth' : {'numports':24}}
Basic network switch driver
62599055be8e80087fbc05cb
class SiteDetail(generics.RetrieveAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.SiteSerializer <NEW_LINE> lookup_field = 'domain' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> domain = self.kwargs['domain'] <NEW_LINE> return Site.objects.filter(domain=domain)
Individual SecureTheNews site and its latest scan results
6259905507d97122c42181f5
class DeclareMethodTicketFieldValidityRuleTests(TestBase): <NEW_LINE> <INDENT> pass
The client MUST provide a valid access ticket giving "active" access to the realm in which the exchange exists or will be created, or "passive" access if the if-exists flag is set. Client creates access ticket with wrong access rights and attempts to use in this method.
6259905516aa5153ce401a2e
class StanzaHandled(Exception): <NEW_LINE> <INDENT> pass
StanzaHandled: An Exception which means that the stanza was handled. If a stanza handler doesn't raise this (or a StanzaError), then the stanza wasn't handled, and the dispatcher goes on to try some more dispatchers.
62599055e64d504609df9e75
class Schedule(EventBinder): <NEW_LINE> <INDENT> def __init__(self, schedule): <NEW_LINE> <INDENT> self.schedule = schedule <NEW_LINE> <DEDENT> def bind(self, callback): <NEW_LINE> <INDENT> self.schedule.do(functools.partial(callback, None)) <NEW_LINE> <DEDENT> def get_filter(self): <NEW_LINE> <INDENT> raise NotImpleme...
A class for binding rules to cron-like schedules. This uses the schedule module to provide human-readable scheduling syntax.
625990553c8af77a43b689e5
class ValidateAlembic(api.InstancePlugin): <NEW_LINE> <INDENT> families = ["alembic"] <NEW_LINE> order = inventory.get_order(__file__, "ValidateAlembic") <NEW_LINE> label = "Alembic" <NEW_LINE> actions = [RepairAlembic] <NEW_LINE> optional = True <NEW_LINE> hosts = ["houdini"] <NEW_LINE> def process(self, instance): <N...
Validates Alembic settings
62599055baa26c4b54d507ee
class SNSRegionConfig(RegionConfig): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.topics = {} <NEW_LINE> self.topics_count = 0 <NEW_LINE> <DEDENT> def parse_subscription(self, params, region, subscription): <NEW_LINE> <INDENT> topic_arn = subscription.pop('TopicArn') <NEW_LINE> topic_name = topic_ar...
SNS configuration for a single AWS region :ivar topics: Dictionary of topics [name] :ivar topics_count: Number of topics in the region
62599055adb09d7d5dc0bab5
class VmMigrateView(View): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> vm_uuid = kwargs.get('vm_uuid', '') <NEW_LINE> vm_manager = VmManager() <NEW_LINE> vm = vm_manager.get_vm_by_uuid(vm_uuid=vm_uuid, related_fields=( 'host', 'host__group', 'host__group__center', 'image', 'mac_ip')...
虚拟机迁移类视图
625990558e71fb1e983bd014
class Config: <NEW_LINE> <INDENT> SITECONFFILE = '/etc/codebayrc.py' <NEW_LINE> USERCONFFILE = '.codebayrc.py' <NEW_LINE> def loadConfigFile(self, filename): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> f = open(filename) <NEW_LINE> <DEDENT> except IOError: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> ...
Configuration holder class.
625990550a50d4780f706864
class ArrayOfEnum(ARRAY): <NEW_LINE> <INDENT> def bind_expression(self, bindvalue): <NEW_LINE> <INDENT> return cast(bindvalue, self) <NEW_LINE> <DEDENT> def result_processor(self, dialect, coltype): <NEW_LINE> <INDENT> super_rp = super(ArrayOfEnum, self).result_processor( dialect, coltype) <NEW_LINE> def handle_raw_str...
Helper class to support arrays of enums in PostgreSQL
62599055b830903b9686ef23
class Delete(base.DeleteCommand): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('sink_name', help='The name of the sink to delete.') <NEW_LINE> util.AddNonProjectArgs(parser, 'Delete a sink') <NEW_LINE> parser.display_info.AddCacheUpdater(None) <NEW_LINE> <DEDENT...
Deletes a sink. Deletes a sink and halts the export of log entries associated with that sink. Deleting a sink does not affect log entries already exported through the deleted sink, and will not affect other sinks that are exporting the same log(s).
6259905545492302aabfda22
class State: <NEW_LINE> <INDENT> def __init__(self, tokenize=defaults.TOKENIZE, diff=defaults.DIFF, revert_radius=reverts.defaults.RADIUS, revert_detector=None): <NEW_LINE> <INDENT> self.tokenize = tokenize <NEW_LINE> self.diff = diff <NEW_LINE> if revert_detector is None: <NEW_LINE> <INDENT> self.revert_detector = rev...
Represents the state of word persistence in a page. See `<https://meta.wikimedia.org/wiki/Research:Content_persistence>`_ :Parameters: tokenize : function( `str` ) --> list( `str` ) A tokenizing function diff : function(list( `str` ), list( `str` )) --> list( `ops` ) A function to perform a dif...
625990553617ad0b5ee07693
class Solution: <NEW_LINE> <INDENT> def sortList(self, head): <NEW_LINE> <INDENT> if not head or not head.next: <NEW_LINE> <INDENT> return head <NEW_LINE> <DEDENT> middle = sortList(head) <NEW_LINE> right = self.findMiddle(middle.next) <NEW_LINE> middle.next = None <NEW_LINE> left = self.sortList(head) <NEW_LINE> retur...
@param head: The first node of the linked list. @return: You should return the head of the sorted linked list, using constant space complexity.
62599055d7e4931a7ef3d5c9
class RebootSignal(NTCError): <NEW_LINE> <INDENT> pass
Error for sending reboot signal.
62599055fff4ab517ebced6e
class PostCommentDetailView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Comment.objects.all() <NEW_LINE> serializer_class = serializers.CommentSerializer <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> post_id = self.kwargs.get('post_id') <NEW_LINE> comment_id = self.kwargs.get('pk') <NE...
Get specific comment on specific post
6259905515baa723494634de
class DistMatrix(): <NEW_LINE> <INDENT> def __init__(self, data, row_items=None, col_items=None): <NEW_LINE> <INDENT> self.dim = data.shape <NEW_LINE> self.X = np.array(data) <NEW_LINE> self.row_items = row_items <NEW_LINE> self.col_items = col_items <NEW_LINE> <DEDENT> def get_KNN(self, i, k): <NEW_LINE> <INDENT> idxs...
Distance matrix. .. attribute:: dim Matrix dimension. .. attribute:: X Matrix data. .. attribute:: row_items Items corresponding to matrix rows. .. attribute:: col_items Items corresponding to matrix columns.
6259905599cbb53fe683242b
class DragDropListbox(tkinter.Listbox): <NEW_LINE> <INDENT> def __init__(self, master, **kw): <NEW_LINE> <INDENT> kw["selectmode"] = tkinter.SINGLE <NEW_LINE> tkinter.Listbox.__init__(self, master, kw) <NEW_LINE> self.bind("<Button-1>", self.setCurrent) <NEW_LINE> self.bind("<B1-Motion>", self.shiftSelection) <NEW_LINE...
A Tkinter listbox with drag'n'drop reordering of entries.
6259905573bcbd0ca4bcb7dd
class FPN(SegmentationModel): <NEW_LINE> <INDENT> def __init__( self, encoder_name: str = "resnet34", encoder_depth: int = 5, encoder_weights: Optional[str] = "imagenet", decoder_pyramid_channels: int = 256, decoder_segmentation_channels: int = 128, decoder_merge_policy: str = "add", decoder_dropout: float = 0.2, in_ch...
FPN_ is a fully convolution neural network for image semantic segmentation Args: encoder_name: name of classification model (without last dense layers) used as feature extractor to build segmentation model. encoder_depth: number of stages used in decoder, larger depth - more features are generated. ...
62599055cad5886f8bdc5b26
class MultiStepRelaxFWWorkflow(AbstractFWWorkflow): <NEW_LINE> <INDENT> def __init__(self, structure, pseudos, ksampling=1000, relax_algo="atoms_only", accuracy="normal", spin_mode="polarized", smearing="fermi_dirac:0.1 eV", charge=0.0, scf_algorithm=None, autoparal=False, max_restart=10, folder=None, **extra_abivars):...
Workflow for structural relaxations performed in a multi-step procedure. Using a small number of maximum relaxation steps the overall process is automatically split in as many FWs are needed.
6259905599cbb53fe683242c
class ResourceGroup(MyDocument): <NEW_LINE> <INDENT> __collection__ = 'resource_group' <NEW_LINE> __lazy__ = False <NEW_LINE> name = StringField()
资源套餐组,不同的套餐组有不同的限额
625990550fa83653e46f6430
class APNs(object): <NEW_LINE> <INDENT> def __init__(self, use_sandbox=False, cert_file=None, key_file=None, enhanced=False): <NEW_LINE> <INDENT> super(APNs, self).__init__() <NEW_LINE> self.use_sandbox = use_sandbox <NEW_LINE> self.cert_file = cert_file <NEW_LINE> self.key_file = key_file <NEW_LINE> self._feedback_con...
A class representing an Apple Push Notification service connection
625990563c8af77a43b689e6
class SimulatedAnnealingAcceptanceFunction(AbstractAcceptanceFunction): <NEW_LINE> <INDENT> def __init__(self, diff_multiplier=1, multiplier=1): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._diff_multiplier = diff_multiplier <NEW_LINE> self._multiplier = multiplier <NEW_LINE> <DEDENT> def accept(self, delta_v...
An acceptance function for simulated annealing. A smaller quality value is assumed to be better than a bigger one. Parameters ---------- diff_multiplier : int or float, optional The delta_value will be multiplied by this multiplier. A bigger value leads to more solutions being accepted, while a smaller value ...
625990567d847024c075d927
class ServicesRecordFile: <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.servicesfile = filename <NEW_LINE> <DEDENT> def write(self, services): <NEW_LINE> <INDENT> f=open(self.servicesfile, 'w') <NEW_LINE> f.write("<services>") <NEW_LINE> for service in services: <NEW_LINE> <INDENT> f.write(...
a snap service record file, contains list of services configured, to restore
625990563539df3088ecd7f3
class UpdateNetworkProfile(neutronV20.UpdateCommand): <NEW_LINE> <INDENT> resource = RESOURCE <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument("--remove-tenant", action='append', dest='remove_tenants', help=_("Remove tenant from the network profile. " "You can repeat this option...
Update network profile's information.
6259905671ff763f4b5e8cfd
class Elevation(IntEnum): <NEW_LINE> <INDENT> ALL, BOT_MODERATORS, GUILD_OWNERS, BOT_OWNERS = range(4)
Basic permission elevation levels.
62599056d53ae8145f9199b1
class Timeout(Publisher, DirectPublisherMixin): <NEW_LINE> <INDENT> def __init__(self, scheduler, timeout_thunk): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.scheduler = scheduler <NEW_LINE> self.timeout_thunk = timeout_thunk <NEW_LINE> self.cancel = None <NEW_LINE> <DEDENT> def start(self, interval): <NEW_L...
A publisher that can shedule timeouts for itself. When a timeout occurs, an event is published on the default topic. The timeout_thunk is called to get the actual event.
6259905655399d3f05627a6d
class ConsoleTerminateEvent(ConsoleEvent): <NEW_LINE> <INDENT> def __init__(self, command: Optional["Command"], io: IO, exit_code: int) -> None: <NEW_LINE> <INDENT> super().__init__(command, io) <NEW_LINE> self._exit_code = exit_code <NEW_LINE> <DEDENT> @property <NEW_LINE> def exit_code(self) -> int: <NEW_LINE> <INDEN...
An event triggered by after the execution of a command.
62599056a17c0f6771d5d648
class TransactionsMixin(object): <NEW_LINE> <INDENT> pass
Redis Transaction Commands Mixin
625990564e4d562566373956
class ToTensorTransform(BaseTransform): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ToTensorTransform, self).__init__() <NEW_LINE> self.name = "To-Tensor" <NEW_LINE> if torch.cuda.is_available(): <NEW_LINE> <INDENT> self.device = torch.device('cuda:1') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>...
Transforms data to pytorch-tensors.
6259905615baa723494634e1
class InvenioWebSubmitAdminWarningNoUpdate(Exception): <NEW_LINE> <INDENT> pass
Exception used when a no update was made as a result of an action
62599056a219f33f346c7d53
class VOCSegmentation(Dataset): <NEW_LINE> <INDENT> NUM_CLASSES = 21 <NEW_LINE> def __init__(self, args, base_dir='datasets/VOCdevkit/VOC2012/', split='train'): <NEW_LINE> <INDENT> super(VOCSegmentation, self).__init__() <NEW_LINE> self.base_dir = base_dir <NEW_LINE> self.image_dir = os.path.join(self.base_dir, 'JPEGIm...
PascalVoc dataset
625990560a50d4780f706866
class UserOwnContributedProjectAPIView(ProjectAPIView): <NEW_LINE> <INDENT> serializer_class = ProjectInlineUserSerializer <NEW_LINE> permission_classes = [permissions.IsAuthenticated] <NEW_LINE> search_fields = ('name',) <NEW_LINE> ordering_fields = ('name', 'project_type', 'timestamp') <NEW_LINE> filter_fields = ('pr...
get: 【参与任务】 获取当前用户参与的任务列表 post: 没有post方法
62599056d6c5a102081e366d
class AbstractSymbol: <NEW_LINE> <INDENT> def __init__(self, id, project): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.project = project <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return self.id <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.id == other.id
Base class for all other classes in this file.
6259905682261d6c52730971
@dataclass <NEW_LINE> class NodeShallowing(NodeMove): <NEW_LINE> <INDENT> _inherited_slots: ClassVar[List[str]] = [] <NEW_LINE> class_class_uri: ClassVar[URIRef] = KGCL.NodeShallowing <NEW_LINE> class_class_curie: ClassVar[str] = "kgcl:NodeShallowing" <NEW_LINE> class_name: ClassVar[str] = "node shallowing" <NEW_LINE> ...
The opposite of node deepening.
625990568e7ae83300eea5dd
class AuthorRegistration(APIView): <NEW_LINE> <INDENT> parser_classes = (MultiPartParser, FormParser, JSONParser) <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> serializer = RegistrationSerializer(data = request.DATA) <NEW_LINE> if serializer.is_valid(raise_exception = True): <NEW_LINE> <INDENT> author = seria...
Takes incoming JSON, validates it and builds a Author/User Model
62599056e5267d203ee6ce3e
@implementer(IActivity) <NEW_LINE> class Activity(Item): <NEW_LINE> <INDENT> pass
Item Subclass for Activity
62599056009cb60464d02a84
class QuantumLinuxBridgeVIFDriver(vif.VIFDriver): <NEW_LINE> <INDENT> def get_bridge_name(self, network_id): <NEW_LINE> <INDENT> return ("brq" + network_id)[:LINUX_DEV_LEN] <NEW_LINE> <DEDENT> def get_dev_name(self, iface_id): <NEW_LINE> <INDENT> return ("tap" + iface_id)[:LINUX_DEV_LEN] <NEW_LINE> <DEDENT> def plug(se...
VIF driver for Linux Bridge when running Quantum.
6259905699cbb53fe683242f
class Migration(migrations.Migration): <NEW_LINE> <INDENT> dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('ws', '0035_bump_car_year_validator'), ] <NEW_LINE> operations = [ migrations.AddField( model_name='participant', name='temp_user', field=models.ForeignKey( default=None, null=True, on...
An lousy migration which is just working around Django's ORM. The whole point of this migration is to add a FK constraint to `user_id`. In raw SQL, it would be as simple as adding the constraint, since the column is already not nullable. However, I cannot find a way to get Django to recognize that `user_id` (an Integ...
6259905601c39578d7f141df
class IconWidget(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None, icon=QIcon(), iconSize=QSize(), **kwargs): <NEW_LINE> <INDENT> sizePolicy = kwargs.pop("sizePolicy", QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)) <NEW_LINE> super().__init__(parent, **kwargs) <NEW_LINE> self.__icon = QIcon(icon) <NEW_L...
A widget displaying an `QIcon`
62599056be8e80087fbc05d2
class DescribeWeeklyReportNonlocalLoginPlacesResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.WeeklyReportNonlocalLoginPlaces = None <NEW_LINE> self.TotalCount = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if para...
DescribeWeeklyReportNonlocalLoginPlaces返回参数结构体
62599056a17c0f6771d5d649
class MultiGraphConvLayer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, mem_dim, layers, heads, dropout): <NEW_LINE> <INDENT> super(MultiGraphConvLayer, self).__init__() <NEW_LINE> self.mem_dim = mem_dim <NEW_LINE> self.layers = layers <NEW_LINE> self.head_dim = self.mem_dim // self.layers <NEW_LINE> self.heads = ...
A GCN module operated on dependency graphs.
6259905694891a1f408ba19e
class TestV1Job(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 testV1Job(self): <NEW_LINE> <INDENT> pass
V1Job unit test stubs
625990560fa83653e46f6435
class NumericScalarArg(Argument): <NEW_LINE> <INDENT> def get_arg(self): <NEW_LINE> <INDENT> if isinstance(self.default, Missing): <NEW_LINE> <INDENT> if self.required is True: <NEW_LINE> <INDENT> arg = ' = '.join([self.new_name_converted, '0']) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> arg = ' = '.join([self.new_n...
argument of numeric scalar type
6259905663b5f9789fe866c2
class DirectoryError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, directory): <NEW_LINE> <INDENT> self._message = message <NEW_LINE> self._directory = directory <NEW_LINE> <DEDENT> @property <NEW_LINE> def message(self): <NEW_LINE> <INDENT> return self._message <NEW_LINE> <DEDENT> @property <NEW_LINE> de...
This error is thrown when the upload_status module cannot access a directory
62599056435de62698e9d353
class Negative(Function): <NEW_LINE> <INDENT> def forward(self, x): <NEW_LINE> <INDENT> x = self._convert2tensor(x) <NEW_LINE> self.x = x <NEW_LINE> if isinstance(self.x, Constant): <NEW_LINE> <INDENT> return Constant(-x.value) <NEW_LINE> <DEDENT> return Tensor(-x.value, function=self) <NEW_LINE> <DEDENT> def backward(...
element-wise negative y = -x
625990568e71fb1e983bd019
class AnagraficaStatiArticoliFilter(AnagraficaFilter): <NEW_LINE> <INDENT> def __init__(self, anagrafica): <NEW_LINE> <INDENT> AnagraficaFilter.__init__(self, anagrafica, 'anagrafica_stati_articoli_filter_table') <NEW_LINE> self._widgetFirstFocus = self.denominazione_filter_entry <NEW_LINE> <DEDENT> def draw(self): <NE...
Filtro per la ricerca nell'anagrafica degli stati articolo
62599056e64d504609df9e78
class ArticleViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Article.objects.all() <NEW_LINE> serializer_class = ArticleSerializer <NEW_LINE> permission_classes = (TopicsAppPermission,)
API endpoint for articles
6259905663d6d428bbee3d24
@dataclass(frozen=True) <NEW_LINE> class GetUpdates(Request): <NEW_LINE> <INDENT> offset: Optional[int] = None <NEW_LINE> limit: Optional[int] = None <NEW_LINE> timeout: Optional[int] = None <NEW_LINE> allowed_updates: Optional[List[UpdateType]] = None <NEW_LINE> def parse_result(self, data) -> List['api.Update']: <NEW...
Represents GetUpdates request object: https://core.telegram.org/bots/api#getupdates
625990561f037a2d8b9e5314
class DdosCustomPolicy(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'etag': {'readonly': True}, 'resource_guid': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'public_ip_addresses': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key'...
A DDoS custom policy in a resource group. Variables are only populated by the server, and will be ignored when sending a request. :param id: Resource ID. :type id: str :ivar name: Resource name. :vartype name: str :ivar type: Resource type. :vartype type: str :param location: Resource location. :type location: str :p...
6259905632920d7e50bc759b
class ThiefBlueprint(Blueprint): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("thief", 2, 20) <NEW_LINE> self.add_component(Health, 5) <NEW_LINE> self.add_component(Movable, 2) <NEW_LINE> self.add_component(Collecter, 2, 50, ResourceCategory.MINERAL)
Used to create a copy of a thief (Rebels collecter unit)
62599056dc8b845886d54b16
class Answer(TranslationMixin): <NEW_LINE> <INDENT> tracker = FieldTracker() <NEW_LINE> question = models.ForeignKey(WorksheetQuestion) <NEW_LINE> sequence_number = models.IntegerField( help_text=_( 'Used to order the answers for a question into the correct ' 'sequence.'), blank=False, null=False, default=0, ) <NEW_LIN...
Answer lesson model. Each lesson can have zero or more questions associated with it. The question will have one or more answers and the answer will have an indication if it is a correct answer or not. One question could have more than one correct answers (or no correct answers).
62599056435de62698e9d354
class WindChillMinFormula(object): <NEW_LINE> <INDENT> def __init__(self, index): <NEW_LINE> <INDENT> self.index = index <NEW_LINE> <DEDENT> index = None <NEW_LINE> min_windchill = None <NEW_LINE> def append(self, sample): <NEW_LINE> <INDENT> value_temp = sample[self.index[0]] <NEW_LINE> value_wind = sample[self.index[...
Minimum WindChill temperature. Requires temperature and wind speed in Km/h.
62599056d7e4931a7ef3d5cf
class MPPT(object): <NEW_LINE> <INDENT> def __init__(self, system, name): <NEW_LINE> <INDENT> self._algebs.extend(['pwa']) <NEW_LINE> self._fnamey.extend(['P_w^{opt}']) <NEW_LINE> <DEDENT> def init1(self, dae): <NEW_LINE> <INDENT> dae.y[self.pwa] = mmax(mmin(2 * dae.x[self.omega_m] - 1, 1), 0) <NEW_LINE> <DEDENT> def g...
MPPT control algorithm
625990564a966d76dd5f0442
class SearchClient(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def supported_sizes(self): <NEW_LINE> <INDENT> return self._supported_sizes_map.keys() <NEW_LINE> <DEDENT> @property <NEW_LINE> def supported_styles(self): <NEW_LINE> <INDENT> return self._supported_styles_map.keys() <NEW_LINE> <DEDENT> def _size_to_n...
Base class for all search clients, providing utility methods common to all classes. Requires the subclass to define the following: PROPERTIES: + _supported_sizes_map (Dict) mapping of external supported sizes to internal (API) supported sizes e.g. {'large': 'xxlarge', 'medium': 'xlarge|large|medium', 'sma...
62599056e5267d203ee6ce40
class SelectorDIC(ModelSelector): <NEW_LINE> <INDENT> def select(self): <NEW_LINE> <INDENT> warnings.filterwarnings("ignore", category=DeprecationWarning) <NEW_LINE> DIC_scores = [] <NEW_LINE> results = [] <NEW_LINE> antiRes = [] <NEW_LINE> try: <NEW_LINE> <INDENT> for n_component in self.n_components: <NEW_LINE> <INDE...
select best model based on Discriminative Information Criterion Biem, Alain. "A model selection criterion for classification: Application to hmm topology optimization." Document Analysis and Recognition, 2003. Proceedings. Seventh International Conference on. IEEE, 2003. http://citeseerx.ist.psu.edu/viewdoc/download?d...
62599056097d151d1a2c25bd
class BugFreeLoginOrCondition(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.executable_path = chrome_driver <NEW_LINE> self.driver = webdriver.Chrome(executable_path=self.executable_path) <NEW_LINE> self.url = "http://localhost/bugfree" <NEW_LINE> open_url(self.driver,self.url) <NEW_...
登录后查询或条件
6259905607f4c71912bb098c
class RepresentationMaker(object): <NEW_LINE> <INDENT> def __init__(self, dw_conn, scope): <NEW_LINE> <INDENT> self.dw_conn = dw_conn <NEW_LINE> self.scope = scope <NEW_LINE> self.dim_reps = [] <NEW_LINE> self.fts_reps = [] <NEW_LINE> <DEDENT> def check_table_type(self, table, typelist): <NEW_LINE> <INDENT> for table_t...
Creates a DWRepresentation object from an associated program scope
62599056a17c0f6771d5d64a
class BadObjectType(ODBError): <NEW_LINE> <INDENT> pass
The object had an unsupported type
625990567047854f46340911
class Demo(ModuleMixin): <NEW_LINE> <INDENT> order = 1 <NEW_LINE> label = 'Introduction' <NEW_LINE> verbose_name = '我的桌面' <NEW_LINE> icon = '<i class="material-icons">account_balance</i>' <NEW_LINE> @property <NEW_LINE> def urls(self): <NEW_LINE> <INDENT> index_view = generic.TemplateView.as_view(template_name='demo/in...
Home page module
62599056460517430c432afa
class home(mainHandler): <NEW_LINE> <INDENT> def get(self, **kwargs): <NEW_LINE> <INDENT> user = users.get_current_user() <NEW_LINE> if user: <NEW_LINE> <INDENT> username = user.nickname() <NEW_LINE> loginLink = users.create_login_url(self.request.uri) <NEW_LINE> logoutLink = users.create_logout_url(self.request.uri) <...
Handler class for home
62599056d99f1b3c44d06bf2
class Stack(object): <NEW_LINE> <INDENT> def __init__(self, depth): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def push(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def pop(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def is_empty(self): <NEW_LINE> <INDENT> pass
FIFO
6259905623e79379d538da4e
class PhotoopException(PydlException): <NEW_LINE> <INDENT> pass
Exceptions raised by :mod:`pydl.photoop` that don't fit into a standard exception class like :exc:`ValueError`.
625990564428ac0f6e659a8c
class _ExecutionContext(object): <NEW_LINE> <INDENT> def __init__( self, watermarks, keyed_states): <NEW_LINE> <INDENT> self.watermarks = watermarks <NEW_LINE> self.keyed_states = keyed_states <NEW_LINE> self._step_context = None <NEW_LINE> <DEDENT> def get_step_context(self): <NEW_LINE> <INDENT> if not self._step_cont...
Contains the context for the execution of a single PTransform. It holds the watermarks for that transform, as well as keyed states.
62599056097d151d1a2c25be
class GeneralConfig(ro.ReadOnly): <NEW_LINE> <INDENT> RANDOM_SEED = 0 <NEW_LINE> LOGGING_LEVEL = logging.INFO
Container for general configurations.
625990568e71fb1e983bd01c
class SnapshotPatch(Model): <NEW_LINE> <INDENT> _attribute_map = { 'tags': {'key': 'tags', 'type': 'object'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(SnapshotPatch, self).__init__(**kwargs) <NEW_LINE> self.tags = kwargs.get('tags', None)
Snapshot patch. :param tags: Resource tags :type tags: object
62599056b5575c28eb713775
class ReprMixin(SuperBase): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> __repr_slots__ = () <NEW_LINE> @repr_compat <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> attr_names = [] <NEW_LINE> attr_names_set = set() <NEW_LINE> for parent_class in self.__class__.__mro__: <NEW_LINE> <INDENT> if hasattr(parent_cla...
A :term:`mixin` class inherited in front of/instead of object which gives any object a decent __repr__ function. The object can additionally define a list in one of __slots__ or __repr_slots__ which gives attributes for this repr function to report. If __repr_slots__ is given, it will take precedence over any __slots_...
62599056b830903b9686ef27
class GsStatusLaunchMergeToolCommand(TextCommand, GitCommand): <NEW_LINE> <INDENT> def run(self, edit): <NEW_LINE> <INDENT> interface = ui.get_interface(self.view.id()) <NEW_LINE> valid_ranges = (interface.get_view_regions("unstaged_files") + interface.get_view_regions("untracked_files") + interface.get_view_regions("m...
Launch external merge tool for selected file.
62599056dd821e528d6da429
class RandomAllyCast(Component): <NEW_LINE> <INDENT> def get_targets(self, selected, caster, players, monsters): <NEW_LINE> <INDENT> if isinstance(type(caster), type(players[0])): <NEW_LINE> <INDENT> return [random.choice([player for player in players if not player.fallen])] <NEW_LINE> <DEDENT> return [r...
Returns a random ally for casting a move
625990564a966d76dd5f0444
class PhonemeList(MutableSequence): <NEW_LINE> <INDENT> def __init__(self, blocks: Union[Phoneme, Iterable[Phoneme]]): <NEW_LINE> <INDENT> if isinstance(blocks, Phoneme): <NEW_LINE> <INDENT> self._pho_list = [blocks] <NEW_LINE> <DEDENT> elif isinstance(blocks, Iterable): <NEW_LINE> <INDENT> self._pho_list = list(blocks...
A list of phonemes. Can be printed into a .pho string formatted file
625990568e7ae83300eea5e1
class LSTM(nn.Module): <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> super(LSTM, self).__init__() <NEW_LINE> self.hidden_dim = params['nhid'] <NEW_LINE> self.n_layers = params['nlayers'] <NEW_LINE> self.batch = params['batch'] <NEW_LINE> self.seq = params['seq'] <NEW_LINE> self.dropout = params['d...
LSTM neural network Args: params (dict): holds the program hyperparameters
625990562ae34c7f260ac63a
class Scope(object): <NEW_LINE> <INDENT> next_id = 0 <NEW_LINE> def __init__(self, name, parent=None): <NEW_LINE> <INDENT> self.id = Scope.next_id <NEW_LINE> Scope.next_id += 1 <NEW_LINE> self.name = name <NEW_LINE> self.parent = parent <NEW_LINE> self.children = [] <NEW_LINE> self.symbols = {} <NEW_LINE> self.typename...
A scope works like a dictionary of symbols, but that can store multiple values for the same symbol name. This is necessary because some symbols may be overloaded. Internally, all values for a key are stored as a list, but the standard dict access method (`__getitem__`) will only return the first value for a key. To ge...
6259905629b78933be26ab6e
class King(Piece): <NEW_LINE> <INDENT> name = 'King' <NEW_LINE> value = 1000 <NEW_LINE> symbol = 'K' <NEW_LINE> max_moves = 1 <NEW_LINE> number = 1 <NEW_LINE> def __init__(self, colour=PLAIN): <NEW_LINE> <INDENT> super(King, self).__init__(colour=colour) <NEW_LINE> self.can_castle = True <NEW_LINE> <DEDENT> def possibl...
The King piece. Do not lose this one! ;-) >>> piece = King(WHITE) >>> str(piece) 'K' >>> print piece K >>> start = 'E1' >>> piece.possibleMoves(start) [['D2'], ['E2'], ['F2'], ['F1'], ['D1']] >>> piece.castlingMoves(start) ['C1', 'G1'] After the King has moved once, it should not have the castling moves anymore. ...
6259905607f4c71912bb098e
@dataclass(frozen=True) <NEW_LINE> class Ping(Event): <NEW_LINE> <INDENT> payload: bytes = b"" <NEW_LINE> def response(self) -> "Pong": <NEW_LINE> <INDENT> return Pong(payload=self.payload)
The Ping event can be sent to trigger a ping frame and is fired when a Ping is received. **wsproto does not automatically send a pong response to a ping event.** To comply with the RFC you MUST send a pong even as soon as is practical. The :meth:`response` method provides a suitable event for this purpose. Fields: ....
62599056009cb60464d02a88
class AccountRetencionSoportada(ModelSQL, ModelView): <NEW_LINE> <INDENT> __name__ = 'account.retencion.soportada' <NEW_LINE> name = fields.Char('Number', required=True) <NEW_LINE> amount = fields.Numeric('Amount', digits=(16, 2), required=True) <NEW_LINE> date = fields.Date('Date', required=True) <NEW_LINE> tax = fiel...
Account Retencion Soportada
62599056be8e80087fbc05d6