code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ConcatTimeWindow(TimeWindow): <NEW_LINE> <INDENT> def __init__(self, windows): <NEW_LINE> <INDENT> if len(windows) < 1: <NEW_LINE> <INDENT> raise ValueError('At least one window should be given.') <NEW_LINE> <DEDENT> self.windows = windows <NEW_LINE> starts = [w.absolute_start for w in self.windows[1:]] <NEW_LINE... | Sequence of consecutive time windows. | 6259904d91af0d3eaad3b263 |
class LimitExceededException(DatahubException): <NEW_LINE> <INDENT> def __init__(self, status_code, request_id, error_code, error_msg): <NEW_LINE> <INDENT> super(LimitExceededException, self).__init__(status_code, request_id, error_code, error_msg) | Too many request. | 6259904dbe383301e0254c5a |
@ppd.distribute() <NEW_LINE> class HelmholtzSystem(object): <NEW_LINE> <INDENT> def __init__(self, computationinfo, alpha=0.5,beta=0.5,delta=0.5): <NEW_LINE> <INDENT> self.alpha = alpha <NEW_LINE> self.beta = beta <NEW_LINE> self.delta = delta <NEW_LINE> self.internalassembly = computationinfo.faceAssembly() <NEW_LINE>... | Assemble a system to solve a Helmholtz problem using the DG formulation of Gittelson et al.
It's parallelised so will only assemble the relevant bits of the system for the partition managed by
this process. | 6259904da219f33f346c7c41 |
class BindServiceView(ServiceView): <NEW_LINE> <INDENT> service_id = managed_services[0] <NEW_LINE> diagnostics_module_name = "bind" <NEW_LINE> description = description <NEW_LINE> show_status_block = True <NEW_LINE> form_class = BindForm <NEW_LINE> def get_initial(self): <NEW_LINE> <INDENT> initial = super().get_initi... | A specialized view for configuring Bind. | 6259904d3eb6a72ae038ba9b |
class ValidationError(Exception): <NEW_LINE> <INDENT> def __init__(self, message=None): <NEW_LINE> <INDENT> self.message = message | This exception is used in tasks to indicate that a requirement has not been met. | 6259904d16aa5153ce40192d |
class ProtoError(Exception): <NEW_LINE> <INDENT> pass | Generic errors. | 6259904d07d97122c42180e3 |
class ComplexFormation(MEReaction): <NEW_LINE> <INDENT> def __init__(self, id): <NEW_LINE> <INDENT> MEReaction.__init__(self, id) <NEW_LINE> self._complex_id = None <NEW_LINE> self.complex_data_id = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def complex(self): <NEW_LINE> <INDENT> return self._model.metabolites.get_b... | Formation of a functioning enzyme complex that can act as a catalyst for
metabolic reactions or other reactions involved in gene expression.
This reaction class produces a reaction that combines the protein subunits
and any cofactors or prosthetic groups into a complete enzyme complex.
:param str _complex_id:
Nam... | 6259904d0a50d4780f7067dd |
class LocatedElementPermission(permissions.BasePermission): <NEW_LINE> <INDENT> message = 'Adding customers not allowed.' <NEW_LINE> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> print('perm', request.method, view) <NEW_LINE> return isinstance(obj, LocatedElement) | Located element permission. | 6259904dbaa26c4b54d506eb |
class ExistFileHandler(Base): <NEW_LINE> <INDENT> async def get(self): <NEW_LINE> <INDENT> md5 = self.get_argument("md5") <NEW_LINE> suffix = self.get_argument("suffix") <NEW_LINE> file_context = syncFile.Component("files") <NEW_LINE> try: <NEW_LINE> <INDENT> self.write_dict({"ieExist": file_context.is_exist_md5(md5, s... | 获取md5文件是否存在
文件分块上传接口::
http://127.0.0.1:8095/file/exist
get:访问
需要参数:md5,suffix
suffix标识后缀名,如png mp4 jpg等 | 6259904d8da39b475be04631 |
class AutoencoderWrapper(WrapperBase): <NEW_LINE> <INDENT> def __init__(self, batch_env): <NEW_LINE> <INDENT> super(AutoencoderWrapper, self).__init__(batch_env) <NEW_LINE> batch_size, height, width, _ = self._batch_env.observ.get_shape().as_list() <NEW_LINE> ae_height = int(math.ceil(height / self.autoencoder_factor))... | Transforms the observations taking the bottleneck
state of an autoencoder | 6259904d21a7993f00c673a9 |
class NSNitroNserrDigestupdateFailed(NSNitroGslbErrors): <NEW_LINE> <INDENT> pass | Nitro error code 1988
Digest update before RSA Sign operation returned error | 6259904dd10714528d69f0ae |
class Sinusoid(Signal): <NEW_LINE> <INDENT> def __init__(self, freq=440, amp=1.0, offset=0, func=np.sin): <NEW_LINE> <INDENT> self.freq = freq <NEW_LINE> self.amp = amp <NEW_LINE> self.offset = offset <NEW_LINE> self.func = func <NEW_LINE> <DEDENT> @property <NEW_LINE> def period(self): <NEW_LINE> <INDENT> return 1.0 /... | Represents a sinusoidal signal. | 6259904dec188e330fdf9ce0 |
class TallyRoles(enum.IntEnum): <NEW_LINE> <INDENT> screenIndexRole = Qt.UserRole + 1 <NEW_LINE> tallyIndexRole = Qt.UserRole + 2 <NEW_LINE> RhTallyRole = Qt.UserRole + 3 <NEW_LINE> TxtTallyRole = Qt.UserRole + 4 <NEW_LINE> LhTallyRole = Qt.UserRole + 5 <NEW_LINE> TextRole = int(Qt.DisplayRole) <NEW_LINE> def get_tally... | Role definitions to specify column mapping in :class:`TallyListModel` to
a ``QtQuick.TableView`` | 6259904dbe383301e0254c5c |
class RicciScalar(object): <NEW_LINE> <INDENT> def __init__(self,Ric,g): <NEW_LINE> <INDENT> self.Ric = Ric <NEW_LINE> self.g = g <NEW_LINE> <DEDENT> def value(self): <NEW_LINE> <INDENT> Ric = self.Ric <NEW_LINE> g = self.g <NEW_LINE> RS = 0 <NEW_LINE> for mu in [0,1,2,3]: <NEW_LINE> <INDENT> for nu in [0,1,2,3]: <... | Calculate Ricci scalar from Ricci tensor | 6259904d0a366e3fb87dde27 |
class UITestCase(unittest.TestCase): <NEW_LINE> <INDENT> net = False <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(UITestCase, self).setUp() <NEW_LINE> patch() <NEW_LINE> pywikibot.config.colorized_output = True <NEW_LINE> pywikibot.config.transliterate = False <NEW_LINE> pywikibot.ui.transliteration_target = N... | UI tests. | 6259904d4e696a045264e841 |
class CreateCustomerGatewayRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CustomerGatewayName = None <NEW_LINE> self.IpAddress = None <NEW_LINE> self.Tags = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.CustomerGatewayName = params.get("Custo... | CreateCustomerGateway请求参数结构体
| 6259904dcb5e8a47e493cba7 |
class M3_OT_export(bpy.types.Operator, ExportHelper): <NEW_LINE> <INDENT> bl_idname = "m3.export" <NEW_LINE> bl_label = "Export M3 Model" <NEW_LINE> bl_options = {'UNDO'} <NEW_LINE> filename_ext = ".m3" <NEW_LINE> filter_glob = StringProperty(default="*.m3", options={'HIDDEN'}) <NEW_LINE> filepath = bpy.props.StringPro... | Export a M3 file | 6259904d29b78933be26aae3 |
class AdvancedEditForm(AdagiosForm): <NEW_LINE> <INDENT> register = forms.CharField( required=False, help_text=_("Set to 1 if you want this object enabled.")) <NEW_LINE> name = forms.CharField(required=False, label=_("Generic Name"), help_text=_("This name is used if you want other objects to inherit (with the use attr... | A form for pynag.Model.Objectdefinition
This form will display a charfield for every attribute of the objectdefinition
"Every" attribute means:
* Every defined attribute
* Every inherited attribute
* Every attribute that is defined in nagios object definition html | 6259904de64d504609df9df0 |
class HTTP1ServerConnection(object): <NEW_LINE> <INDENT> def __init__(self, stream, params=None, context=None): <NEW_LINE> <INDENT> self.stream = stream <NEW_LINE> if params is None: <NEW_LINE> <INDENT> params = HTTP1ConnectionParameters() <NEW_LINE> <DEDENT> self.params = params <NEW_LINE> self.context = context <NEW_... | An HTTP/1.x server. | 6259904d498bea3a75a58f62 |
class UserProfileForm(forms.ModelForm): <NEW_LINE> <INDENT> first_name = forms.CharField(label='First Name', required=False) <NEW_LINE> last_name = forms.CharField(label='Last Name', required=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = UserProfile <NEW_LINE> exclude = ('clients', 'user', 'active', 'create... | Lets a user edit its profile. | 6259904d004d5f362081fa09 |
class PriceSheetApi(LogisticsMessageApi): <NEW_LINE> <INDENT> def freight_list(self, url, method): <NEW_LINE> <INDENT> resp = request(url=f"{Admin_Host}{url}", method=method, headers=json_header, cookies=self.cookie) <NEW_LINE> return resp <NEW_LINE> <DEDENT> def freight_add(self, url, method, in_body, channel_id): <NE... | 报价单 | 6259904de76e3b2f99fd9e42 |
class AdjustArmatureOrigin(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.adjust_armature_origin" <NEW_LINE> bl_label = "[Urchin] Adjust Armature Origin" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> bpy.ops.object.select_by_type(type='ARMATURE') <... | Adjust Armature Origin: move armature to world origin | 6259904d50485f2cf55dc3ce |
class Sites(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._sites = [] <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return repr(self._sites) <NEW_LINE> <DEDENT> def set_defaults(self, section): <NEW_LINE> <INDENT> self.base_content = section.get('base_content', 'site#content.ba... | A container that maps site wild-cards on to a dictionary | 6259904d50485f2cf55dc3cf |
class Tariff(models.Model): <NEW_LINE> <INDENT> id = fields.UUIDField(pk=True) <NEW_LINE> cargo_type = fields.ForeignKeyField('models.CargoType') <NEW_LINE> date = fields.DateField(index=True) <NEW_LINE> rate = fields.FloatField() | Модель тарифа | 6259904d07f4c71912bb0877 |
class PostDetailView(LoginRequiredMixin, DetailView): <NEW_LINE> <INDENT> template_name = 'posts/post_detail.html' <NEW_LINE> slug_field = 'id' <NEW_LINE> slug_url_kwarg = 'post_id' <NEW_LINE> queryset = Post.objects.all() <NEW_LINE> context_object_name = 'post' | Return a detail view about one post | 6259904d21a7993f00c673ab |
class Gaussian(Noise): <NEW_LINE> <INDENT> def __init__(self, offset=0., scale=1.): <NEW_LINE> <INDENT> Noise.__init__(self) <NEW_LINE> self.scale = scale <NEW_LINE> self.offset = offset <NEW_LINE> self.variance = scale*scale <NEW_LINE> <DEDENT> def log_likelihood(self, mu, varsigma, y): <NEW_LINE> <INDENT> n = y.shape... | Gaussian Noise Model. | 6259904d3c8af77a43b6895f |
class Recipe(models.Model): <NEW_LINE> <INDENT> user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE) <NEW_LINE> title = models.CharField(max_length=255) <NEW_LINE> time_minutes = models.IntegerField() <NEW_LINE> price = models.DecimalField(max_digits=5,decimal_places=2) <NEW_LINE> link = models.... | recipe object model | 6259904d63d6d428bbee3c0e |
class PlotLine(object): <NEW_LINE> <INDENT> def __init__(self, mesh, mapping): <NEW_LINE> <INDENT> hmin = MPI.min(None, mesh.hmin()) <NEW_LINE> self.mesh = UnitIntervalMesh(int(1.0/hmin)) <NEW_LINE> self.V = FunctionSpace(self.mesh, "CG", 1) <NEW_LINE> self.F = {} <NEW_LINE> self.mapping = mapping <NEW_LINE> <DEDENT> d... | Line plot along x=[0,1] in a domain of any dimension. The mapping
argument maps from the interval [0,1] to a xD coordinate (a list when
dim>1). | 6259904dec188e330fdf9ce2 |
class ReplicapoolupdaterZoneOperationsListRequest(_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 ReplicapoolupdaterZoneOperationsListRequest object.
Fields:
filter: Optional. Filter expression for filtering listed resources.
maxResults: Optional. Maximum count of results to be returned. Maximum
value is 500 and default value is 500.
pageToken: Optional. Tag returned by a previous list request truncate... | 6259904d26068e7796d4dd87 |
class UnzipFunction(Function): <NEW_LINE> <INDENT> name = 'unzip' <NEW_LINE> def __call__(self, filename, flags=''): <NEW_LINE> <INDENT> sh = ShellFunction(self.build, self.log, self.verbose, self.message) <NEW_LINE> if 'o' not in flags: <NEW_LINE> <INDENT> flags += 'o' <NEW_LINE> <DEDENT> if flags: <NEW_LINE> <INDENT>... | Execute unzip command, default is 'unzip filename', and it'll guess the extracted
directory and return it. It'll overwrite existed by default. | 6259904d379a373c97d9a46e |
class LoadedMod: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.__name__ = name <NEW_LINE> self._vars = {} <NEW_LINE> self._funcs = {} <NEW_LINE> self._classes = {} <NEW_LINE> self._attrs = {} <NEW_LINE> <DEDENT> def __getattr__(self, item): <NEW_LINE> <INDENT> if item in self._attrs: <NEW_LINE>... | The LoadedMod class allows for the module loaded onto the sub to return
custom sequencing, for instance it can be iterated over to return all
functions | 6259904dd6c5a102081e3561 |
class Context(Token): <NEW_LINE> <INDENT> def __init__(self, label, certain=False): <NEW_LINE> <INDENT> self.label = [p or None for p in label] <NEW_LINE> self.certain = certain <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Context([ %s , certain=%s ])" % ( ', '.join(_none_str(l) for l in self.lab... | Represents a bit of context for the paragraphs. This gets compressed
with the paragraph tokens to define the full scope of a paragraph. To
complicate matters, sometimes what looks like a Context is actually the
entity which is being modified (i.e. a paragraph). If we are certain
that this is only context, (e.g. "In Sub... | 6259904d23e79379d538d940 |
class NormalizeScanOrder(ProjectSpecificMixin, APIView): <NEW_LINE> <INDENT> parser_classes = (JSONParser,) <NEW_LINE> permission_classes = (ProjectSpecificPermissions,) <NEW_LINE> permissions = { 'POST': ('main.change_document',) } <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> qs = Document.objects ... | Normalize the order of a document's scans. Items will remain in the same
order, but their `ordering` property will be equally spaced out.
@param step: integer indicating the step between each ordering value.
Default 100. | 6259904d30c21e258be99c49 |
class MetroDateInput(DateInput): <NEW_LINE> <INDENT> input_type = 'text' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> kwargs['attrs'] = {'class': 'metrodatepicker input-control'} <NEW_LINE> super(MetroDateInput, self).__init__(*args, **kwargs) | A date input, Date ranging from yesterday to last day of this timeslot. Using Y-m-d
converted to a nice picker using jquery datetimepicker in genericForm.html | 6259904d3cc13d1c6d466b7c |
class AdaptedDTPHandler(DTPHandler): <NEW_LINE> <INDENT> file_path = None <NEW_LINE> _new_file_id = None <NEW_LINE> _file_uploader = None <NEW_LINE> @property <NEW_LINE> def file_obj(self): <NEW_LINE> <INDENT> if self.file_path is None: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> elif self._file_uploader is Non... | DTPHandler is the class handling data transfer between the server and the clients.
AdaptedDTPHandler inherits from it to adapt the file upload process (from the FTP client
to the server) to the use of cloudalpha.file_system.FileSystem subclasses. | 6259904d0fa83653e46f6322 |
class AuthModeUnknown(CFMEException): <NEW_LINE> <INDENT> pass | Raised if an invalid authenctication mode is passed to
:py:func:`cfme.configure.configuration.ServerAuthentication.configure_auth` | 6259904d8e7ae83300eea4d8 |
class OfflineRequest(DummyRequest): <NEW_LINE> <INDENT> implements(IRequest) | Use this in places where you don't have an HTTP request to get alternate
registration of IContextURL. | 6259904d23e79379d538d941 |
class Matyas(Problem2D): <NEW_LINE> <INDENT> def init_tensors(self, seed=None): <NEW_LINE> <INDENT> return [tf.random_uniform(shape, minval=-10, maxval=10, seed=seed) for shape in self.param_shapes] <NEW_LINE> <DEDENT> def objective(self, params, data=None, labels=None): <NEW_LINE> <INDENT> x, y = tf.split(params[0], 2... | Matyas function (a function with a single global minimum in a valley). | 6259904dd4950a0f3b111865 |
class ShowChassisHardwareSchema(MetaParser): <NEW_LINE> <INDENT> schema = { Optional("@xmlns:junos"): str, "chassis-inventory": { Optional("@xmlns"): str, "chassis": { Optional("@junos:style"): str, Optional("chassis-module"): ListOf({ Optional("chassis-re-dimm-module"): ListOf({ "die-rev": str, "mfr-id": str, "name": ... | schema = {
Optional("@xmlns:junos"): str,
"chassis-inventory": {
Optional("@xmlns"): str,
"chassis": {
Optional("@junos:style"): str,
"chassis-module": [
{
"chassis-sub-module": [
{
"c... | 6259904d8e71fb1e983bcf09 |
@dataclasses.dataclass <NEW_LINE> class VisualPoint(Point): <NEW_LINE> <INDENT> token : str = 'X' <NEW_LINE> fore : str = '' <NEW_LINE> back : str = '' <NEW_LINE> style : str = '' <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> super().__post_init__() <NEW_LINE> if len(self.token) != 1: <NEW_LINE> <INDENT> ra... | VisualPoint dataclass that holds the point 'token' and the point 'color'. | 6259904d462c4b4f79dbce45 |
class Encoder256(tf.Module): <NEW_LINE> <INDENT> def __init__(self, base_depth, feature_size, name=None): <NEW_LINE> <INDENT> super(Encoder256, self).__init__(name=name) <NEW_LINE> self.feature_size = feature_size <NEW_LINE> conv = functools.partial( tf.keras.layers.Conv2D, padding="SAME", activation=tf.nn.leaky_relu) ... | Feature extractor for input image size 256*256.
| 6259904dd10714528d69f0b0 |
class RemoveRoleCmd(Command): <NEW_LINE> <INDENT> aliases = ('@rem-role',) <NEW_LINE> syntax = "<role> from <player>" <NEW_LINE> lock = 'perm(grant roles)' <NEW_LINE> def run(self, this, actor, args): <NEW_LINE> <INDENT> from mudslingcore.objects import Player <NEW_LINE> try: <NEW_LINE> <INDENT> role = self.game.db.mat... | @rem-role <role> from <player>
Removes a role from a player. | 6259904d15baa723494633d1 |
class TemplateStore: <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self._config = config <NEW_LINE> self._templates = [] <NEW_LINE> self._listeners = [] <NEW_LINE> <DEDENT> def getTemplates(self): <NEW_LINE> <INDENT> return self._templates <NEW_LINE> <DEDENT> def getTemplate(self, name): <NEW_LINE... | TemplateStore is responsible for managing the Templates which the eXe server
has loaded, and loading and saving them | 6259904d4428ac0f6e659977 |
class ImportServiceClassTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.import_name_patcher = patch( "{src}.import_name".format(**PATH), autospec=True, ) <NEW_LINE> self.import_name = self.import_name_patcher.start() <NEW_LINE> self.addCleanup(self.import_name_patcher.stop) <NEW_LINE> <DED... | Test the import_service_class function. | 6259904d45492302aabfd919 |
@ns.route('/complete/<int:id>') <NEW_LINE> @ns.response(404, 'Todo not found') <NEW_LINE> @ns.param('id', "The task identifier") <NEW_LINE> class TodoCompleted(Resource): <NEW_LINE> <INDENT> @ns.marshal_with(todo, code=201) <NEW_LINE> @ns.doc('complete_todo') <NEW_LINE> def put(self,id): <NEW_LINE> <INDENT> return DAO.... | View completed todos and mark uncompleted todos as complete | 6259904df7d966606f7492da |
class ErrorResponse(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'error': {'key': 'error', 'type': 'ErrorDefinition'}, } <NEW_LINE> def __init__( self, *, error: Optional["ErrorDefinition"] = None, **kwargs ): <NEW_LINE> <INDENT> super(ErrorResponse, self).__init__(**kwargs) <NEW_LINE> self.error... | Error response.
:param error: Error description.
:type error: ~azure.mgmt.digitaltwins.v2020_03_01_preview.models.ErrorDefinition | 6259904dd6c5a102081e3562 |
class AnalyzerConfig(command.ProcessCommandConfig): <NEW_LINE> <INDENT> def __init__(self, status, driver, script, description, max_depth=5, just_config=False): <NEW_LINE> <INDENT> super(AnalyzerConfig, self).__init__(driver, script, description, max_depth, just_config) <NEW_LINE> self.output_path_components = lambda r... | Gathers configuration information for the Analyzer | 6259904ddc8b845886d54a02 |
class CreateVpnGatewayRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VpcId = None <NEW_LINE> self.VpnGatewayName = None <NEW_LINE> self.InternetMaxBandwidthOut = None <NEW_LINE> self.InstanceChargeType = None <NEW_LINE> self.InstanceChargePrepaid = None <NEW_LINE> <DEDENT> def ... | CreateVpnGateway请求参数结构体
| 6259904dd6c5a102081e3563 |
class ProjectLoader(object): <NEW_LINE> <INDENT> help = "Load project record." <NEW_LINE> def __init__(self) -> None: <NEW_LINE> <INDENT> self.cvterm_contained_in = Cvterm.objects.get( name="contained in", cv__name="relationship" ) <NEW_LINE> <DEDENT> def store_project(self, name: str, filename: str) -> Project: <NEW_L... | Load project. | 6259904d4e696a045264e843 |
class _Counter(collections.defaultdict): <NEW_LINE> <INDENT> def __init__(self, iterable=(), **kwargs): <NEW_LINE> <INDENT> super(_Counter, self).__init__(int, **kwargs) <NEW_LINE> self.update(iterable) <NEW_LINE> <DEDENT> def most_common(self): <NEW_LINE> <INDENT> return sorted(six.iteritems(self), key=itemgetter(1), ... | Partial replacement for Python 2.7 collections.Counter. | 6259904d6e29344779b01a88 |
class TestArgumentParsing(TestCase): <NEW_LINE> <INDENT> @parameterized.expand([ ([], Namespace(domain='lobby.wildfiregames.com', login='xpartamupp', log_level=30, xserver=None, xdisabletls=False, nickname='WFGBot', password='XXXXXX', room='arena')), (['--debug'], Namespace(domain='lobby.wildfiregames.com', login='xpar... | Test handling of parsing command line parameters. | 6259904d71ff763f4b5e8bed |
class Graph: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.nodes = [] <NEW_LINE> <DEDENT> def add_node(self, payload): <NEW_LINE> <INDENT> self.nodes.append(Node(len(self.nodes), payload)) <NEW_LINE> return len(self.nodes) - 1 <NEW_LINE> <DEDENT> def add_edge(self, node_i, node_j): <NEW_LINE> <INDENT... | A graph class. It has nodes and vertices. | 6259904d23e79379d538d943 |
class CategoryMenu(CMSAttachMenu): <NEW_LINE> <INDENT> name = _('Zinnia Category Menu') <NEW_LINE> def get_nodes(self, request): <NEW_LINE> <INDENT> nodes = [] <NEW_LINE> nodes.append(NavigationNode(_('Categories'), reverse('zinnia_category_list'), 'categories')) <NEW_LINE> for category in Category.objects.all(): <NEW_... | Menu for the categories | 6259904d8da39b475be04636 |
class Map: <NEW_LINE> <INDENT> def GET(self): <NEW_LINE> <INDENT> pass <NEW_LINE> return render.addr() | 百度地图
GET()
return spage.addr() | 6259904d73bcbd0ca4bcb6cf |
class RSA(DSLdapObject): <NEW_LINE> <INDENT> def __init__(self, conn, dn=None): <NEW_LINE> <INDENT> assert dn is None <NEW_LINE> super(RSA, self).__init__(instance=conn) <NEW_LINE> self._dn = 'cn=RSA,cn=encryption,%s' % DN_CONFIG <NEW_LINE> self._create_objectclasses = ['top', 'nsEncryptionModule'] <NEW_LINE> self._rdn... | Manage the "cn=RSA,cn=encryption,cn=config" object
- Set the certificate name
- Database path
- ssl token name | 6259904d8e71fb1e983bcf0b |
class SubException(Exception): <NEW_LINE> <INDENT> pass | A basic exception class. | 6259904d462c4b4f79dbce47 |
class IOLoopKernelRestarter(KernelRestarter): <NEW_LINE> <INDENT> loop = Instance('tornado.ioloop.IOLoop') <NEW_LINE> def _loop_default(self): <NEW_LINE> <INDENT> warnings.warn("IOLoopKernelRestarter.loop is deprecated in jupyter-client 5.2", DeprecationWarning, stacklevel=4, ) <NEW_LINE> return ioloop.IOLoop.current()... | Monitor and autorestart a kernel. | 6259904d63d6d428bbee3c12 |
class PackageLoader(object): <NEW_LINE> <INDENT> def __init__(self, system, package_manager): <NEW_LINE> <INDENT> self._system = system <NEW_LINE> self._package_manager = package_manager <NEW_LINE> self._repositories = {} <NEW_LINE> logger.debug("The system repository location is %s" % self._system.get_repositories_pat... | Loads nusoft packages from a repository.
:param _system: The system
:param _package_manager: The package manager to load packages into | 6259904d596a897236128fd2 |
class MSG(BaseMSG): <NEW_LINE> <INDENT> def parse(self): <NEW_LINE> <INDENT> c = self.get("B") <NEW_LINE> if c == 240: <NEW_LINE> <INDENT> self.offset += 5 <NEW_LINE> c = self.get("B") <NEW_LINE> <DEDENT> self.msgtype = c <NEW_LINE> try: <NEW_LINE> <INDENT> msgcls = MSGType(self.msgtype).cls <NEW_LINE> <DEDENT> except ... | All messages.
This class identify the specific message type and calls the proper
parser. | 6259904da8ecb03325872659 |
class StoreDoesNotExistError(RuntimeError): <NEW_LINE> <INDENT> pass | Raised if you attempt to read a store that doesn't exist | 6259904d91af0d3eaad3b26b |
class Event: <NEW_LINE> <INDENT> def __init__(self, e_type, active, passive, detail): <NEW_LINE> <INDENT> self.e_type = e_type <NEW_LINE> self.active = active <NEW_LINE> self.passive = passive <NEW_LINE> self.detail = detail | An event in a GameRec. These have a type and some clarifying values
e_types active passive detail
START players None (game_num, rules)
VOTE voter votee ...
DECIDE voters victim ...
KILL (live)mafia victim ...
TARGET actor target ... | 6259904d0c0af96317c57784 |
class Suppress(object): <NEW_LINE> <INDENT> def __init__(self, exception_type): <NEW_LINE> <INDENT> self.type = exception_type <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __exit__(self, exc_type, exc_val, exc_tb): <NEW_LINE> <INDENT> if not exc_val or isinstance(exc_val, se... | IGNORE EXCEPTIONS | 6259904dec188e330fdf9ce6 |
class LoginRoleDeleteTestCase(BaseTestGenerator): <NEW_LINE> <INDENT> scenarios = [ ('Check Role Node', dict(url='/browser/role/obj/')) ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.role_name = "role_delete_%s" % str(uuid.uuid4())[1:8] <NEW_LINE> self.role_id = roles_utils.create_role(self.server, self.role_na... | This class has delete role scenario | 6259904ddc8b845886d54a04 |
class BlockResource(resource.Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(BlockResource, self).__init__() <NEW_LINE> self.content = ("This is the resource's default content. It is padded " "with numbers to be large enough to trigger blockwise " "transfer.\n"... | Example resource which supports GET and PUT methods. It sends large
responses, which trigger blockwise transfer. | 6259904de76e3b2f99fd9e47 |
class AzureTableStorageConfiguration(Configuration): <NEW_LINE> <INDENT> def __init__(self, url, **kwargs): <NEW_LINE> <INDENT> if url is None: <NEW_LINE> <INDENT> raise ValueError("Parameter 'url' must not be None.") <NEW_LINE> <DEDENT> super(AzureTableStorageConfiguration, self).__init__(**kwargs) <NEW_LINE> self.url... | Configuration for AzureTableStorage
Note that all parameters used to create this instance are saved as instance
attributes.
:param url: The URL of the service account or table that is the targe of the desired operation.
:type url: str | 6259904d82261d6c527308ea |
class SpecialFileError(EnvironmentError): <NEW_LINE> <INDENT> pass | Raised when trying to do a kind of operation (e.g. copying) which is
not supported on a special file (e.g. a named pipe) | 6259904d6e29344779b01a8a |
@export <NEW_LINE> class Biaxial001(CartesianStrain): <NEW_LINE> <INDENT> def __init__(self, C11, C12, C44, zeta): <NEW_LINE> <INDENT> exx = eyy = 1 <NEW_LINE> ezz = -2 * C12 / C11 <NEW_LINE> super(Biaxial001, self).__init__(deformation_matrix=np.diag([exx, eyy, ezz])) | Bi-axial [001] strain for III-V semiconductors. | 6259904de76e3b2f99fd9e48 |
class GetSessionIdRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(GetSessionIdRequest, self).__init__( '/captcha:getsessionid', 'POST', header, version) <NEW_LINE> self.parameters = parameters | 获取会话id | 6259904dd486a94d0ba2d40d |
class VoiceEqualityDynamicsFeature(featuresModule.FeatureExtractor): <NEW_LINE> <INDENT> id = 'T6' <NEW_LINE> def __init__(self, dataOrStream=None, *arguments, **keywords): <NEW_LINE> <INDENT> featuresModule.FeatureExtractor.__init__(self, dataOrStream=dataOrStream, *arguments, **keywords) <NEW_LINE> self.name = 'Voic... | Not implemented
TODO: implement | 6259904d50485f2cf55dc3d5 |
class Like(db.Model): <NEW_LINE> <INDENT> post_id = db.IntegerProperty(required=True) <NEW_LINE> username = db.StringProperty(required=True) <NEW_LINE> created = db.DateTimeProperty(auto_now_add=True) <NEW_LINE> @classmethod <NEW_LINE> def by_name(cls, name): <NEW_LINE> <INDENT> return cls.all().filter("username =", na... | Like is a model class which has the following attributes
post_id: The associted posts's id
username: Author of the like
created: Timestamp of the creation of teh like | 6259904dd4950a0f3b111867 |
class InvalidSize(Exception): <NEW_LINE> <INDENT> pass | Raised when a string cannot be parsed into a file size.
For example:
>>> from humanfriendly import parse_size
>>> parse_size('5 Z')
Traceback (most recent call last):
File "humanfriendly/__init__.py", line 267, in parse_size
raise InvalidSize(format(msg, size, tokens))
humanfriendly.InvalidSize: Failed to parse... | 6259904d8da39b475be04637 |
class TemporaryDirectory(object): <NEW_LINE> <INDENT> def __init__(self, suffix="", prefix=None, dir=None): <NEW_LINE> <INDENT> if "RAM_DISK" in os.environ: <NEW_LINE> <INDENT> import uuid <NEW_LINE> name = uuid.uuid4().hex <NEW_LINE> dir_name = os.path.join(os.environ["RAM_DISK"].strip(), name) <NEW_LINE> os.mkdir(dir... | Create and return a temporary directory. This has the same
behavior as mkdtemp but can be used as a context manager. For
example:
with TemporaryDirectory() as tmpdir:
...
Upon exiting the context, the directory and everything contained
in it are removed. | 6259904d76d4e153a661dc9c |
class Doulist(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.doulist_id = -99999 <NEW_LINE> self.url_id = 0 <NEW_LINE> self.url_increment = 25 <NEW_LINE> self.item_type = '' <NEW_LINE> return <NEW_LINE> <DEDENT> def init(self): <NEW_LINE> <INDENT> self.doulist_id = input('please enter the id of the... | instruct how to crawl the doulist page | 6259904d462c4b4f79dbce48 |
class AliasPathType(Model): <NEW_LINE> <INDENT> _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, } <NEW_LINE> def __init__(self, path=None, api_versions=None): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.api_versions = api_versions | The type of the paths for alias. .
:param path: The path of an alias.
:type path: str
:param api_versions: The API versions.
:type api_versions: list[str] | 6259904dd99f1b3c44d06ae2 |
class IntExtState(object): <NEW_LINE> <INDENT> def __init__(self, internal_state, external_state): <NEW_LINE> <INDENT> self.external_state = external_state <NEW_LINE> self.internal_state = internal_state <NEW_LINE> <DEDENT> @property <NEW_LINE> def meta(self): <NEW_LINE> <INDENT> return self.external_state.meta <NEW_LI... | Represents a State which is also the state of a finite state machine | 6259904d596a897236128fd3 |
class Delegated(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.delegate = Delegate() <NEW_LINE> <DEDENT> def subscribe(self, functor): <NEW_LINE> <INDENT> self.delegate.subscribe(functor) <NEW_LINE> <DEDENT> def unsubscribe(self, functor): <NEW_LINE> <INDENT> self.delegate.unsubscribe(functor... | A base class for delegated classes | 6259904d91af0d3eaad3b26d |
class TrackingOverlay(): <NEW_LINE> <INDENT> def __init__(self, shell): <NEW_LINE> <INDENT> self._local = TrackedVariablesConfig(shell=shell) <NEW_LINE> self._global = TrackedVariablesConfig(global_scope=True) <NEW_LINE> <DEDENT> def flush(self, global_scope=False): <NEW_LINE> <INDENT> if global_scope: <NEW_LINE> <INDE... | Represents an overlay of tracking configuration, which contains the global
scope shadowed by the configuration of the local (shell) scope. | 6259904dbe383301e0254c64 |
class EntryMonth(EntryArchiveMixin, BaseMonthArchiveView): <NEW_LINE> <INDENT> @property <NEW_LINE> def private_context_data(self): <NEW_LINE> <INDENT> year = self.kwargs['year'] <NEW_LINE> month = self.kwargs['month'] <NEW_LINE> ttl = '%s年%s月' % (year, month) <NEW_LINE> breadcrumbs = [Link('%s年' % year, reverse('blog:... | Mixin month. | 6259904db830903b9686ee9f |
class BandwidthInfoSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "CdnBandwidth": fields.Float(required=False, load_from="CdnBandwidth"), "Time": fields.Int(required=False, load_from="Time"), } | BandwidthInfo - BandwidthInfo | 6259904d379a373c97d9a474 |
class Unprintable_Card(Card): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "<unprintable>" | A card that won't reveal its rank or suit wheen printed | 6259904d24f1403a926862f2 |
class FirewallPolicy(neutron.NeutronResource): <NEW_LINE> <INDENT> PROPERTIES = ( NAME, DESCRIPTION, SHARED, AUDITED, FIREWALL_RULES, ) = ( 'name', 'description', 'shared', 'audited', 'firewall_rules', ) <NEW_LINE> ATTRIBUTES = ( NAME_ATTR, DESCRIPTION_ATTR, FIREWALL_RULES_ATTR, SHARED_ATTR, AUDITED_ATTR, TENANT_ID, ) ... | A resource for the FirewallPolicy resource in Neutron FWaaS. | 6259904db5575c28eb7136ee |
class DescribeQuotaResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.QuotaSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("QuotaSet") is not None: <NEW_LINE> <INDENT> self.QuotaSet = [] <NEW_LINE> f... | DescribeQuota返回参数结构体
| 6259904d3cc13d1c6d466b82 |
class ProfileUpdateView(UpdateView): <NEW_LINE> <INDENT> profile = None <NEW_LINE> def get_initial(self): <NEW_LINE> <INDENT> data = model_to_dict(self.object) <NEW_LINE> data.update(model_to_dict(self.object.profile.user)) <NEW_LINE> data.update(model_to_dict(self.object.profile)) <NEW_LINE> return data <NEW_LINE> <DE... | Generic class to update member profiles. | 6259904d07d97122c42180ed |
class IsOwnerOrAdmin(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.user.is_staff: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> if request.data.get('is_staff', False): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> return... | Custom permission to only allow owners of an object to edit it.
We also ensure non-staff users are not allowed to elevate their privileges | 6259904dd53ae8145f9198ab |
class SumO2K(ReduceLayerO2K): <NEW_LINE> <INDENT> def call(self, inputs, **kwargs): <NEW_LINE> <INDENT> return K.sum(inputs, self._axes, self._keepdims) | Custom Keras Sum layer generated by onnx2keras. | 6259904d71ff763f4b5e8bf1 |
class BaseAuthException(Exception): <NEW_LINE> <INDENT> code = 0 | Базовый класс исключений | 6259904d0a50d4780f7067e2 |
@registry.register_problem <NEW_LINE> class QuoraQuestionPairs(text_problems.TextConcat2ClassProblem): <NEW_LINE> <INDENT> _QQP_URL = ("https://firebasestorage.googleapis.com/v0/b/" "mtl-sentence-representations.appspot.com/o/" "data%2FQQP.zip?alt=media&token=700c6acf-160d-" "4d89-81d1-de4191d02cb5") <NEW_LINE> @proper... | Quora duplicate question pairs binary classification problems. | 6259904d8e7ae83300eea4de |
class CreateExclude(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(CreateExclude, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'id', metavar='<osvmexclude-object-id>', help=_('Id of the element to exclude (domain, project, user)') ) <NEW_LINE> pa... | Create osvmexclude | 6259904de76e3b2f99fd9e4a |
class ReadINI(object): <NEW_LINE> <INDENT> def __init__(self, *dir_paths): <NEW_LINE> <INDENT> self.config = configparser.ConfigParser() <NEW_LINE> self.config.optionxform = str <NEW_LINE> for d in dir_paths: <NEW_LINE> <INDENT> f = os.path.join(d, "config.ini") <NEW_LINE> if os.path.exists(f): <NEW_LINE> <INDENT> self... | Read ini file | 6259904dd4950a0f3b111868 |
class StinoImportLibraryCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, library_path): <NEW_LINE> <INDENT> if stino.arduino_info['init_done']: <NEW_LINE> <INDENT> stino.import_lib(self.view, edit, library_path) <NEW_LINE> <DEDENT> <DEDENT> def is_enabled(self): <NEW_LINE> <INDENT> state = F... | Import Library. | 6259904d1f037a2d8b9e5291 |
class ProductDetail(DetailView): <NEW_LINE> <INDENT> model = Product <NEW_LINE> template_name = 'shop/list_detail.html' <NEW_LINE> context_object_name = 'product' | Карточка товара | 6259904d21a7993f00c673b3 |
class ddbTestObject(PerlWrapper): <NEW_LINE> <INDENT> __metaclass__ = ddb_api <NEW_LINE> __table__ = 'test' <NEW_LINE> _attr_data = { '_id' : ['','read/write'], '_test' : [0,'read/write'], '_test_readonly' : [0,'read'] } <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> PerlWrapper.__init__( self, 'DDB::PROTEIN') <NEW... | DDB test object. | 6259904d07f4c71912bb087f |
class AdminConsole(validation.Validated): <NEW_LINE> <INDENT> ATTRIBUTES = { PAGES: validation.Optional(validation.Repeated(AdminConsolePage)), } | Class representing admin console directives in application info.
| 6259904db57a9660fecd2ec7 |
class TestModelsBackOffDecreaseType(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 testModelsBackOffDecreaseType(self): <NEW_LINE> <INDENT> pass | ModelsBackOffDecreaseType unit test stubs | 6259904d76d4e153a661dc9d |
@python_2_unicode_compatible <NEW_LINE> class IntervalSchedule(models.Model): <NEW_LINE> <INDENT> DAYS = DAYS <NEW_LINE> HOURS = HOURS <NEW_LINE> MINUTES = MINUTES <NEW_LINE> SECONDS = SECONDS <NEW_LINE> MICROSECONDS = MICROSECONDS <NEW_LINE> PERIOD_CHOICES = PERIOD_CHOICES <NEW_LINE> every = models.IntegerField(_('eve... | Schedule executing every n seconds. | 6259904dd99f1b3c44d06ae4 |
class GsLogByAuthorCommand(LogMixin, WindowCommand, GitCommand): <NEW_LINE> <INDENT> def run_async(self, **kwargs): <NEW_LINE> <INDENT> email = self.git("config", "user.email").strip() <NEW_LINE> self._entries = [] <NEW_LINE> commiter_str = self.git("shortlog", "-sne", "HEAD") <NEW_LINE> for line in commiter_str.split(... | Open a quick panel containing all committers for the active
repository, ordered by most commits, Git name, and email.
Once selected, display a quick panel with all commits made
by the specified author. | 6259904d009cb60464d02983 |
class EventManager: <NEW_LINE> <INDENT> bus = EventBus() <NEW_LINE> @classmethod <NEW_LINE> def add_event_handler(cls, handler: EventHandler) -> None: <NEW_LINE> <INDENT> for event in handler.events: <NEW_LINE> <INDENT> cls.bus.subscribe(event, handler.func) <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def remo... | INTERNAL API | 6259904d097d151d1a2c24ba |
class TestUtils(unittest.TestCase): <NEW_LINE> <INDENT> def test_has_attribute(self): <NEW_LINE> <INDENT> obj = self.get_test_obj() <NEW_LINE> actual1 = utils.has_attribute(obj, "value") <NEW_LINE> actual2 = utils.has_attribute(obj, "one.value") <NEW_LINE> actual3 = utils.has_attribute(obj, "one.two.Three.value") <NEW_... | Tests for function utils | 6259904d3539df3088ecd6ee |
class TreeBuilderWithComment(etree.TreeBuilder): <NEW_LINE> <INDENT> def comment(self, data): <NEW_LINE> <INDENT> self.start(etree.Comment, {}) <NEW_LINE> self.data(data) <NEW_LINE> self.end(etree.Comment) | Class to parse comment nodes with ElementTree | 6259904d596a897236128fd4 |
class TestK8sIoApimachineryPkgApisMetaV1Preconditions(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 testK8sIoApimachineryPkgApisMetaV1Preconditions(self): <NEW_LINE> <INDENT> pass | K8sIoApimachineryPkgApisMetaV1Preconditions unit test stubs | 6259904ea8ecb0332587265d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.