code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class GroupSummary(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_group_name_value', '_group_id_value', '_group_external_id_value', '_member_count_value', '_group_management_type_value', ] <NEW_LINE> _has_required_fields = True <NEW_LINE> def __init__(self, group_name=None, group_id=None, group_management_type=None, g... | Information about a group.
:ivar team_common.GroupSummary.group_external_id: External ID of group. This
is an arbitrary ID that an admin can attach to a group.
:ivar team_common.GroupSummary.member_count: The number of members in the
group.
:ivar team_common.GroupSummary.group_management_type: Who is allowed t... | 62598f0455399d3f05624f84 |
class My5CFolder(object): <NEW_LINE> <INDENT> def __init__(self, folder_path, file_class=My5cFile): <NEW_LINE> <INDENT> self.folder_path = folder_path <NEW_LINE> self.file_class = file_class <NEW_LINE> self.extension = 'my5c.txt' <NEW_LINE> <DEDENT> def find_chrom_file(self, chrom): <NEW_LINE> <INDENT> search_string = ... | The My5CFolder class provides an interface to a folder of my5c files.
the :meth:`interactions` method is called with a
:class:`pybedtools.Interval` object, and the chrom attribute is used to
identify the my5c file in the folder containing the relevant
interactions. The :class:`My5cFile` object corresponding to that
ch... | 62598f04a8370b77170eee3b |
class ThreadedExpiringConnectionPool(AbstractConnectionPool): <NEW_LINE> <INDENT> def __init__(self, minconn, maxconn, *args, max_idle_time=600, **kwargs): <NEW_LINE> <INDENT> AbstractConnectionPool.__init__( self, minconn, maxconn, *args, **kwargs) <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> self._max_idle_tim... | A thread-safe connection pool, that additionally closes down
connections that have been idle for a configurable interval
(default 600 seconds = 10 minutes).
The expiration timer logic is not as efficient as it could be:
a Timer object (which involves an entire thread) is spawned for
every call to putconn(), and then o... | 62598f043617ad0b5ee04b8a |
class AppAuthHandler(AuthHandler): <NEW_LINE> <INDENT> OAUTH_HOST = 'api.twitter.com' <NEW_LINE> OAUTH_ROOT = '/oauth2/' <NEW_LINE> def __init__(self, consumer_key, consumer_secret): <NEW_LINE> <INDENT> self.consumer_key = consumer_key <NEW_LINE> self.consumer_secret = consumer_secret <NEW_LINE> self._bearer_token = ''... | Application-only authentication handler | 62598f044f88993c371efa1a |
class PageNumberFragment(reportlab.platypus.paraparser.ParaFrag): <NEW_LINE> <INDENT> def __init__(self, attributes): <NEW_LINE> <INDENT> reportlab.platypus.paraparser.ParaFrag.__init__(self) <NEW_LINE> self.counting_from = attributes.get('countingFrom', 1) <NEW_LINE> <DEDENT> @property <NEW_LINE> def text(self): <NEW_... | A fragment whose `text` is computed at access time. | 62598f045fcc89381b26565a |
class SetAutoPC(DebuggerSetBoolSubcommand): <NEW_LINE> <INDENT> in_list = True <NEW_LINE> min_abbrev = len("autop") <NEW_LINE> infopc_cmd = None <NEW_LINE> def run(self, args): <NEW_LINE> <INDENT> run_set_bool(self, args) <NEW_LINE> if self.settings["autopc"]: <NEW_LINE> <INDENT> if self.infopc_cmd is None: <NEW_LINE> ... | **set autopc** [ **on** | **off** ]
Run the `info pc` command every time we enter the debugger.
See also:
---------
`show autopc` | 62598f0450812a4eaa62011b |
class Jsonifier(object): <NEW_LINE> <INDENT> def __init__(self, json_=json, **kwargs): <NEW_LINE> <INDENT> self.json = json_ <NEW_LINE> self.dumps_args = kwargs <NEW_LINE> <DEDENT> def dumps(self, data, **kwargs): <NEW_LINE> <INDENT> for k, v in self.dumps_args.items(): <NEW_LINE> <INDENT> kwargs.setdefault(k, v) <NEW_... | Used to serialized and deserialize to/from JSon | 62598f0471ff763f4b5e61c3 |
class LoginForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[DataRequired()]) <NEW_LINE> password = PasswordField('Password', validators=[DataRequired()]) | Form to login | 62598f047047854f4633de27 |
class Price(models.Model): <NEW_LINE> <INDENT> product = models.ForeignKey(Product, on_delete=models.CASCADE) <NEW_LINE> price = models.DecimalField(_("Price"), max_digits=14, decimal_places=6) <NEW_LINE> quantity = models.IntegerField( _("Discount Quantity"), default=2, help_text=_("Use this price only for this quanti... | A Price for a product.
Separating it out lets us have different prices for the same
product for different purposes. For example for quantity
discounts. The current price should be the one with the earliest
expires date, and the highest quantity that's still below the user
specified (IE: ordered) quantity, that match... | 62598f04283ffb24f3cf230c |
class PermissionError(StandardError, TracBaseError): <NEW_LINE> <INDENT> title = N_("Forbidden") <NEW_LINE> def __init__(self, action=None, resource=None, env=None, msg=None): <NEW_LINE> <INDENT> self.action = action <NEW_LINE> self.resource = resource <NEW_LINE> self.env = env <NEW_LINE> if self.action: <NEW_LINE> <IN... | Insufficient permissions to perform the operation.
:since 1.0.5: the `msg` attribute is deprecated and will be removed in
1.3.1. Use the `message` property instead. | 62598f04fbf16365ca792afb |
class ARGB(BaseDataType): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> data = iter(data) <NEW_LINE> (self.alpha, self.red, self.green, self.blue) = tuple(ord(c) for c in islice(data, 4)) <NEW_LINE> self.end = 4 | SWFのARGB構造をロードする | 62598f043346ee7daa336b96 |
class Role(atom.core.XmlElement): <NEW_LINE> <INDENT> _qname = GACL_TEMPLATE % 'role' <NEW_LINE> value = 'value' | The gAcl:role element. | 62598f04091ae3566870367b |
class ServerInterface (object): <NEW_LINE> <INDENT> def check_channel_request(self, kind, chanid): <NEW_LINE> <INDENT> return OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED <NEW_LINE> <DEDENT> def get_allowed_auths(self, username): <NEW_LINE> <INDENT> return 'password' <NEW_LINE> <DEDENT> def check_auth_none(self, username): ... | This class defines an interface for controlling the behavior of Paramiko
in server mode.
Methods on this class are called from Paramiko's primary thread, so you
shouldn't do too much work in them. (Certainly nothing that blocks or
sleeps.) | 62598f04167d2b6e312b59fc |
class DriverBase(object): <NEW_LINE> <INDENT> def __init__(self, num=0, width=0, height=0, c_order=ChannelOrder.RGB, gamma=None): <NEW_LINE> <INDENT> if num == 0: <NEW_LINE> <INDENT> num = width * height <NEW_LINE> if num == 0: <NEW_LINE> <INDENT> raise ValueError( "Either num or width and height must be provided!") <N... | Base driver class to build other drivers from | 62598f04656771135c4880ed |
class MySecondClass: <NEW_LINE> <INDENT> MyClass = MyClass | Class that uses MyClass | 62598f04f548e778e5969fe9 |
class ISchemaView(IBrowserPage): <NEW_LINE> <INDENT> pass | A publishable view of a zope 3 schema
| 62598f048a349b6b43684ca5 |
class LookupLeaf(LookupTreeElem): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(LookupLeaf, self).__init__() <NEW_LINE> self.lookups = kwargs <NEW_LINE> <DEDENT> def evaluate(self, item): <NEW_LINE> <INDENT> result = all(lookup(k, v, item) for k, v in self.lookups.items()) <NEW_LINE> retur... | Class for a leaf in the lookup expression tree | 62598f0455399d3f05624f88 |
class Response(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> if not data or 0xff not in data[:2]: <NEW_LINE> <INDENT> raise DynamixelError("Bad Header! ({data})".format(data=data)) <NEW_LINE> <DEDENT> if Dynamixel._checksum(data[2:-1]) != data[-1]: <NEW_LINE> <INDENT> raise DynamixelError("... | A response object for communicating with the Dx.
The response object is used to validate the data for safety purposes.
Parameters
----------
data : list of byte
The data received from the Dx.
Attributes
----------
data : list of byte
The data received from the Dx.
response_id : byte
The ID of the respons... | 62598f049f28863672817258 |
class SetMfaFlagRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.OpUin = None <NEW_LINE> self.LoginFlag = None <NEW_LINE> self.ActionFlag = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.OpUin = params.get("OpUin") <NEW_LINE> if params.get("Logi... | SetMfaFlag request structure.
| 62598f047047854f4633de29 |
class MultipleEntries(FieldType): <NEW_LINE> <INDENT> pass | Multiple Entries typed field. | 62598f04956e5f7376df4bad |
class OkButton(TooltipButton): <NEW_LINE> <INDENT> def __init__(self, name='okButton', **kwargs): <NEW_LINE> <INDENT> super(OkButton, self).__init__( name=name, up_image="content/gui/images/buttons/ok.png", hover_image="content/gui/images/buttons/ok_h.png", down_image="content/gui/images/buttons/ok.png", **kwargs) | The OkButton is a shortcut for an ImageButton with our OK / apply icon.
Its default attributes are:
name="okButton"
up_image="content/gui/images/buttons/ok.png"
hover_image="content/gui/images/buttons/ok_h.png"
down_image="content/gui/images/buttons/ok.png" | 62598f04091ae3566870367d |
class Pull(BaseUpdateArrayOperator): <NEW_LINE> <INDENT> operator = "$pull" | `$pull` update array query operator
Example:
```python
class Sample(Document):
results: List[int]
Pull(In(Sample.result, [1,2,3,4,5])
```
Will return query object like
```python
{"$pull": { "results": { $in: [1,2,3,4,5] }}}
```
MongoDB docs:
<https://docs.mongodb.com/manual/reference/operator/update/pull/> | 62598f04d486a94d0ba2aa2a |
class BadGUIDException(Exception): <NEW_LINE> <INDENT> pass | Raised when a profile does not have a GUID or the GUID is unknown. | 62598f0426068e7796d4b3ba |
class UserProfile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User,on_delete=models.CASCADE) <NEW_LINE> imageProfil = models.ImageField(upload_to = "imagesDeProfil/",blank=True,verbose_name = "Image de Profil", default='static/images/profil_defaut.png') <NEW_LINE> slug_username = models.SlugField(def... | Profil d'un membre de la communauté Bookinner | 62598f045fcc89381b26565c |
class Plugin(plugin.Plugin): <NEW_LINE> <INDENT> urls = ( '/', 'index', ) <NEW_LINE> class index: <NEW_LINE> <INDENT> def GET(self): <NEW_LINE> <INDENT> return "none" <NEW_LINE> <DEDENT> def POST(self): <NEW_LINE> <INDENT> global items <NEW_LINE> try: <NEW_LINE> <INDENT> input = web.input() <NEW_LINE> if 'pwd' in input... | web gui plugin - http web page | 62598f047cff6e4e811b4449 |
class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('id', 'username', 'date_of_creation') <NEW_LINE> read_only_fields = ('date_of_creation',) | Meta class to map serializer's fields with the model fields. | 62598f04cc40096d6161970b |
class AddUserAskView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> userask_form = UserAskForm(request.POST) <NEW_LINE> if userask_form.is_valid(): <NEW_LINE> <INDENT> user_ask = userask_form.save(commit=True) <NEW_LINE> return HttpResponse('{"status":"success"}', content_type='application/json... | "
用户添加咨询 | 62598f04d8ef3951e32c7384 |
class SysinvLldpPlugin(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.manager = manager.SysinvLldpDriverManager() <NEW_LINE> <DEDENT> def lldp_has_neighbour(self, name): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.manager.lldp_has_neighbour(name) <NEW_LINE> <DEDENT> except except... | Implementation of the Plugin. | 62598f04377c676e912f6297 |
class XMPHelper: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def extract_xmp(file_path, open_forupdate=False): <NEW_LINE> <INDENT> xmpfile = libxmp.XMPFiles(file_path=file_path, open_forupdate=open_forupdate) <NEW_LINE> libxmp.XMPFiles() <NEW_LINE> xmp = xmpfile.get_xmp() <NEW_LINE> xmpfile.close_file() <NEW_LINE> ret... | This class provide extract xmp for dumping xmp of file. | 62598f04a8370b77170eee41 |
class CreateUserForm(forms.Form): <NEW_LINE> <INDENT> new_username = forms.CharField(max_length=100) <NEW_LINE> new_password = forms.CharField(max_length=100) <NEW_LINE> account_password = forms.CharField(widget=forms.PasswordInput) <NEW_LINE> admin = forms.BooleanField(required=False) | Credential Form | 62598f04a219f33f346c5292 |
class GraphicsContextGalry(GraphicsContextBase): <NEW_LINE> <INDENT> pass | The graphics context provides the color, line styles, etc... See the gtk
and postscript backends for examples of mapping the graphics context
attributes (cap styles, join styles, line widths, colors) to a particular
backend. In GTK this is done by wrapping a gtk.gdk.GC object and
forwarding the appropriate calls to i... | 62598f04091ae3566870367f |
class ListSigningCertificatesInputSet(InputSet): <NEW_LINE> <INDENT> def set_AWSAccessKeyId(self, value): <NEW_LINE> <INDENT> super(ListSigningCertificatesInputSet, self)._set_input('AWSAccessKeyId', value) <NEW_LINE> <DEDENT> def set_AWSSecretKeyId(self, value): <NEW_LINE> <INDENT> super(ListSigningCertificatesInputSe... | An InputSet with methods appropriate for specifying the inputs to the ListSigningCertificates
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f04d486a94d0ba2aa2c |
class PluginModelBase(ModelBase): <NEW_LINE> <INDENT> def __new__(cls, name, bases, attrs): <NEW_LINE> <INDENT> new_class = super(PluginModelBase, cls).__new__(cls, name, bases, attrs) <NEW_LINE> found = False <NEW_LINE> for base in bases: <NEW_LINE> <INDENT> if base.__name__ == "CMSPlugin": <NEW_LINE> <INDENT> found =... | Metaclass for all plugins. | 62598f0450812a4eaa62011e |
class RetriableEvent(Event): <NEW_LINE> <INDENT> __slots__ = ('_status', ) <NEW_LINE> def __init__(self, queue_name, row): <NEW_LINE> <INDENT> super(RetriableEvent, self).__init__(queue_name, row) <NEW_LINE> self._status = EV_DONE <NEW_LINE> <DEDENT> def tag_done(self): <NEW_LINE> <INDENT> self._status = EV_DONE <NEW_L... | Event which can be retried
Consumer is supposed to tag them after processing. | 62598f04cc40096d6161970c |
class Brain(object): <NEW_LINE> <INDENT> def __init__(self, structure): <NEW_LINE> <INDENT> self.structure = structure <NEW_LINE> self.coefficients = initialize_coeffs(structure, 0, 1) <NEW_LINE> self.intercepts = initialize_intercepts(structure, 0, 1) <NEW_LINE> self.f = relu <NEW_LINE> <DEDENT> def propagate(self, in... | Initialize the Brain. Structure is a list with the hidden neurons tructure. Ex: structure = [6, 2, 4] if there are 6 inputs. | 62598f04f548e778e5969fed |
class StreamAlertOutput(object): <NEW_LINE> <INDENT> _outputs = {} <NEW_LINE> def __new__(cls, output): <NEW_LINE> <INDENT> StreamAlertOutput._outputs[output.__service__] = output <NEW_LINE> return output <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def create_dispatcher(cls, service, region, account_id, prefix, config)... | Class to be used as a decorator to register all OutputDispatcher subclasses | 62598f040fa83653e46f3949 |
class EquivalentTree(): <NEW_LINE> <INDENT> def __init__(self, RawTree_object, thresh): <NEW_LINE> <INDENT> raw_tree=RawTree_object.tree <NEW_LINE> trunk=[] <NEW_LINE> spiny_strahler=range(1,min(4,thresh)) <NEW_LINE> smooth_strahler=range(4,min(raw_tree[0].strahler, thresh)) <NEW_LINE> tracker=0 <NEW_LINE> tracking={} ... | This class helps to carry out the simplification of the original cell.
Based on Strahler numbers of compartments, it groups them into three different
categories and then either leaves them intact or carries out simplification
procedures described in the original paper. It has only one attribute,
'.tree', which is a li... | 62598f0455399d3f05624f8c |
class Friend(models.Model): <NEW_LINE> <INDENT> to_user = models.ForeignKey(AUTH_USER_MODEL, related_name='friends') <NEW_LINE> from_user = models.ForeignKey(AUTH_USER_MODEL, related_name='_unused_friend_relation') <NEW_LINE> created = models.DateTimeField(default=datetime.datetime.now) <NEW_LINE> objects = FriendshipM... | Model to represent Friendships | 62598f049f2886367281725c |
class AudioDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, csv_file, base_audio_path, stft_transform=None): <NEW_LINE> <INDENT> self._base_audio_path = base_audio_path <NEW_LINE> self._table = pd.read_csv(csv_file) <NEW_LINE> self._audio_data = {} <NEW_LINE> self._stft_transform = stft_transform <NEW_LINE> ind... | Audio dataset | 62598f047047854f4633de2d |
class Timer: <NEW_LINE> <INDENT> display = None <NEW_LINE> alarm = None <NEW_LINE> button = None <NEW_LINE> def __init__(self, display, alarm, button): <NEW_LINE> <INDENT> self.display = display <NEW_LINE> self.alarm = alarm <NEW_LINE> self.button = button <NEW_LINE> logging.info('Timer:init') <NEW_LINE> thread = threa... | Handle the main clock timer loop
| 62598f04ab23a570cc2d429f |
class ComboBoxDelegateQt(QStyledItemDelegate): <NEW_LINE> <INDENT> def __init__(self, choices=None, parent=None): <NEW_LINE> <INDENT> QStyledItemDelegate.__init__(self, parent) <NEW_LINE> self.choices = choices if (choices is not None and type(choices) is list) else [] <NEW_LINE> <DEDENT> def createEditor(self, parent,... | Delegate for editing a list of choices via a combobox.
The choices attribute is a list of either values or (key, value) tuples.
In the first case, the str rep of the values are directly displayed in the combobox.
In the latter case, the str rep of only the keys are displayed in the combobox, and the values can be any o... | 62598f043346ee7daa336b99 |
class StartIndis(Treeview): <NEW_LINE> <INDENT> def __init__(self, master, **kwargs): <NEW_LINE> <INDENT> super().__init__( master, selectmode="extended", height=5, columns=("fid",), **kwargs ) <NEW_LINE> self.heading("#0", text=_("Name")) <NEW_LINE> self.column("#0", width=250) <NEW_LINE> self.column("fid", width=80) ... | List of starting individuals | 62598f0463b5f9789fe83bc6 |
@admin.register(DPU) <NEW_LINE> class DPUAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> pass | DPU admin. | 62598f04d486a94d0ba2aa2e |
class InstanceBasedLearningExtractor(object): <NEW_LINE> <INDENT> def __init__(self, templates, type_descriptor=None, trace=False): <NEW_LINE> <INDENT> self.token_dict = TokenDict() <NEW_LINE> parsed_plus_templates = [(parse_template(self.token_dict, t), t) for t in templates] <NEW_LINE> parsed_plus_epages = [(p, parse... | Implementation of the instance based learning algorithm to
extract data from web pages. | 62598f044a966d76dd5ed93b |
class CartoPaginator(Paginator): <NEW_LINE> <INDENT> def __init__(self, json_collection_attribute, base_url, params=None): <NEW_LINE> <INDENT> self.json_collection_attribute = json_collection_attribute <NEW_LINE> super(CartoPaginator, self).__init__(base_url, params) <NEW_LINE> <DEDENT> def get_urls(self, initial_url):... | Used internally to retrieve results paginated | 62598f0450812a4eaa62011f |
class ProposalMovedOutsideOfMainDossierError(Exception): <NEW_LINE> <INDENT> pass | The proposal have been moved outside of its main dossier which is not allowed.
| 62598f04aad79263cf42d277 |
class SequentialBatchEmulator(BaseBatchEmulator): <NEW_LINE> <INDENT> def __init__(self, env_creator, num_emulators, auto_reset=True, extra_vars='all', init_env_id=1000): <NEW_LINE> <INDENT> super(SequentialBatchEmulator, self).__init__(env_creator, num_emulators) <NEW_LINE> inputs, outputs, extra_outputs = self._creat... | SequentialBatchEmulator creates num_emulators environments and updates them one by one.
It doesn't use multiprocessing.
SequentialBatchEmulator is mainly used for testing and evaluation of already trained network. | 62598f04f548e778e5969fef |
class FeatureCollectionTest(AbstractGetRequestTest): <NEW_LINE> <INDENT> pass | Class for tests every possible GET request for FeatureCollectionResource | 62598f0455399d3f05624f8e |
class Star(GameSprite): <NEW_LINE> <INDENT> __image_path = "./res/images/star.png" <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.speedx = random.randint(-1, 1) <NEW_LINE> self.speedy = random.randint(1, 3) <NEW_LINE> super().__init__(Star.__image_path, self.speedx, self.speedy) <NEW_LINE> width = SCREEN_RECT.... | 星 | 62598f04ad47b63b2c5a6280 |
class ArabicTransliterator: <NEW_LINE> <INDENT> def __unicode__(self): <NEW_LINE> <INDENT> return u"Arabic Transliterator Base Class" <NEW_LINE> <DEDENT> def __load_dictionary(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def do(self, data): <NEW_LINE> <INDENT> trans_data = u"" <NEW_LINE> for c in data: <NEW_LINE... | Arabic Transliterator Base Class
| 62598f0463b5f9789fe83bc8 |
class SNLinear(Linear): <NEW_LINE> <INDENT> def __init__(self, in_size, out_size, use_gamma=False, nobias=False, initialW=None, initial_bias=None, Ip=1): <NEW_LINE> <INDENT> self.Ip = Ip <NEW_LINE> self.u = None <NEW_LINE> self.use_gamma = use_gamma <NEW_LINE> super(SNLinear, self).__init__( in_size, out_size, nobias, ... | Linear layer with Spectral Normalization.
Args:
in_size (int): Dimension of input vectors. If ``None``, parameter
initialization will be deferred until the first forward data pass
at which time the size will be determined.
out_size (int): Dimension of output vectors.
wscale (float): Scaling... | 62598f044a966d76dd5ed93d |
class CreateMultipleSecurityGroupTests(OSIntegrationTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(self.__class__, self).__start__() <NEW_LINE> guid = self.__class__.__name__ + '-' + str(uuid.uuid4()) <NEW_LINE> self.sec_grp_name = guid + 'name' <NEW_LINE> self.neutron = neutron_utils.neutron... | Test for the CreateSecurityGroup class and how it interacts with security
groups within other projects with the same name | 62598f0426068e7796d4b3c0 |
class WindowInfoNode(Node, ArmLogicTreeNode): <NEW_LINE> <INDENT> bl_idname = 'LNWindowInfoNode' <NEW_LINE> bl_label = 'Window Info' <NEW_LINE> bl_icon = 'CURVE_PATH' <NEW_LINE> def init(self, context): <NEW_LINE> <INDENT> self.outputs.new('NodeSocketInt', 'Width') <NEW_LINE> self.outputs.new('NodeSocketInt', 'Height') | Window info node | 62598f047b180e01f3e4857c |
class Solution: <NEW_LINE> <INDENT> def isPalindrome(self, s: str) -> bool: <NEW_LINE> <INDENT> new_ls = [] <NEW_LINE> for i in s: <NEW_LINE> <INDENT> is_str = re.findall('\w|\d', i, re.S) <NEW_LINE> if is_str: <NEW_LINE> <INDENT> new_ls.append(i) <NEW_LINE> <DEDENT> <DEDENT> new_s = ''.join(new_ls).lower() <NEW_LINE> ... | 好简单 好简单 简单到没啥好说的了
第一个是伪代码 用的双指针
第二个python切片 | 62598f04dc8b845886d52030 |
class OrchestratorProfile(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'orchestrator_type': {'required': True}, 'orchestrator_version': {'required': True}, } <NEW_LINE> _attribute_map = { 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, 'orchestrator_version': {'key': 'orchestratorVe... | Contains information about orchestrator.
All required parameters must be populated in order to send to Azure.
:ivar orchestrator_type: Required. Orchestrator type.
:vartype orchestrator_type: str
:ivar orchestrator_version: Required. Orchestrator version (major, minor, patch).
:vartype orchestrator_version: str | 62598f04656771135c4880f5 |
class LocationDetail(APIView): <NEW_LINE> <INDENT> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> loc = Location.objects.get(pk=pk) <NEW_LINE> if loc.user == self.request.user: <NEW_LINE> <INDENT> return loc <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise PermissionDenied <NEW_LINE> <DEDENT>... | Retrieve, update or delete location details for authenticated user. | 62598f044c34283577618d53 |
class DNDict: <NEW_LINE> <INDENT> def __init__(self, default_func, insert_after_missing=False): <NEW_LINE> <INDENT> self._missing = default_func <NEW_LINE> self._dict = {} <NEW_LINE> self.insert_after_missing = insert_after_missing <NEW_LINE> <DEDENT> def __delitem__(self, key): <NEW_LINE> <INDENT> if type(key) is np.n... | Default dictionary with support for np.ndarray->tuple key conversion
| 62598f04f548e778e5969ff1 |
class AllowBacktracking(gym.Wrapper): <NEW_LINE> <INDENT> def __init__(self, env): <NEW_LINE> <INDENT> super(AllowBacktracking, self).__init__(env) <NEW_LINE> self._cur_x = 0 <NEW_LINE> self._max_x = 0 <NEW_LINE> <DEDENT> def reset(self, **kwargs): <NEW_LINE> <INDENT> self._cur_x = 0 <NEW_LINE> self._max_x = 0 <NEW_LIN... | Use deltas in max(X) as the reward, rather than deltas
in X. This way, agents are not discouraged too heavily
from exploring backwards if there is no way to advance
head-on in the level. | 62598f04099cdd3c6367490c |
class RutrackerModify(object): <NEW_LINE> <INDENT> schema = {'type': 'object', 'properties': { 'username': {'type': 'string'}, 'password': {'type': 'string'} }, "additionalProperties": False} <NEW_LINE> auth_cache = {} <NEW_LINE> @plugin.priority(127) <NEW_LINE> def on_task_urlrewrite(self, task, config): <NEW_LINE> <I... | Usage:
rutracker_auth:
username: 'username_here'
password: 'password_here' | 62598f044527f215b58e8965 |
class DateSearch(Enum): <NEW_LINE> <INDENT> between = 'between' <NEW_LINE> equals = 'equals' <NEW_LINE> @staticmethod <NEW_LINE> def list(): <NEW_LINE> <INDENT> return list(map(lambda output: output.value, DateSearch)) | Enum representing supported date search on Near Earth Objects. | 62598f044f88993c371efa20 |
class DataStreamMonitoring(SimpleExtension, MonitoringExtension): <NEW_LINE> <INDENT> PREFIX_SEPARATOR = '_' <NEW_LINE> def __init__(self, variables, data_stream, updates=None, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault("after_epoch", True) <NEW_LINE> kwargs.setdefault("before_first_epoch", True) <NEW_LINE> super... | Monitors Theano variables and monitored-quantities on a data stream.
By default monitoring is done before the first and after every epoch.
Parameters
----------
variables : list of :class:`~tensor.TensorVariable` and
:class:`MonitoredQuantity`
The variables to monitor. The variable names are used as record
... | 62598f04f9cc0f698b1c4804 |
class Get(base.Command): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def Args(parser): <NEW_LINE> <INDENT> parser.add_argument('name', help='Resource view name') <NEW_LINE> <DEDENT> def Run(self, args): <NEW_LINE> <INDENT> zone_views_client = self.context['zoneViewsClient'] <NEW_LINE> region_views_client = self.contex... | Gets information about a single resource view. | 62598f043d592f4c4edb9955 |
class ProcessIsNotStartedError(Exception): <NEW_LINE> <INDENT> pass | The exception occurs when we call some methods of ReadingProc before calling start(). | 62598f0460cbc95b06362d9e |
class TestImport(unittest.TestCase): <NEW_LINE> <INDENT> def test_import_agent(self): <NEW_LINE> <INDENT> from parlai.core.agents import Agent <NEW_LINE> assert Agent <NEW_LINE> <DEDENT> def test_import_teacher(self): <NEW_LINE> <INDENT> from parlai.core.agents import Teacher <NEW_LINE> assert Teacher <NEW_LINE> <DEDEN... | Make sure the package is alive. | 62598f0463b5f9789fe83bcd |
class Comment(ndb.Model): <NEW_LINE> <INDENT> content = ndb.TextProperty(required = True) <NEW_LINE> author = ndb.UserProperty() <NEW_LINE> date = ndb.DateTimeProperty(auto_now_add = True) | Models an individual Comment. | 62598f0426068e7796d4b3c4 |
class LoginForm(forms.Form): <NEW_LINE> <INDENT> username = forms.CharField(max_length=40,required=True,error_messages={ "required": "请输入用户名" }) <NEW_LINE> password = forms.CharField(max_length=50, required=True, error_messages={ "required": "请输入密码" }) | 登录form | 62598f04dc8b845886d52034 |
class RegistryPlugin(common.WindowsCommandPlugin): <NEW_LINE> <INDENT> __abstract = True <NEW_LINE> @classmethod <NEW_LINE> def args(cls, parser): <NEW_LINE> <INDENT> super(RegistryPlugin, cls).args(parser) <NEW_LINE> parser.add_argument( "--hive-offsets", default=None, type="ArrayIntParser", help="A list of hive offse... | A generic registry plugin. | 62598f047047854f4633de35 |
class Statement(NodeNG): <NEW_LINE> <INDENT> is_statement = True <NEW_LINE> def next_sibling(self): <NEW_LINE> <INDENT> stmts = self.parent.child_sequence(self) <NEW_LINE> index = stmts.index(self) <NEW_LINE> try: <NEW_LINE> <INDENT> return stmts[index + 1] <NEW_LINE> <DEDENT> except IndexError: <NEW_LINE> <INDENT> ret... | Statement node adding a few attributes | 62598f045fdd1c0f98e5ca0f |
class ExportInfo(bb.Struct): <NEW_LINE> <INDENT> __slots__ = [ '_export_as_value', '_export_as_present', ] <NEW_LINE> _has_required_fields = False <NEW_LINE> def __init__(self, export_as=None): <NEW_LINE> <INDENT> self._export_as_value = None <NEW_LINE> self._export_as_present = False <NEW_LINE> if export_as is not Non... | Export information for a file.
:ivar files.ExportInfo.export_as: Format to which the file can be exported
to. | 62598f045fcc89381b265662 |
class UserInfoView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> page_flag = 'userinfo' <NEW_LINE> user = request.user <NEW_LINE> address = Address.objects.get_default_address(user=user) <NEW_LINE> con = get_redis_connection('default') <NEW_LINE> history = "history_%d"%user.... | 用户中心-信息页 | 62598f044a966d76dd5ed943 |
@register_event_type <NEW_LINE> class AlarmEvent(Event): <NEW_LINE> <INDENT> ALARM_COUNT = 12 <NEW_LINE> ALARM_EVENTS = ["alarm{:d}".format(n) for n in range(0, ALARM_COUNT)] <NEW_LINE> HANDLED_EVENTS = ALARM_EVENTS <NEW_LINE> def __init__(self, event_name, event_params=None): <NEW_LINE> <INDENT> if event_name not in s... | Wrap alarm events. | 62598f04851cf427c66b6d38 |
class TestFileFileYAMLReaderMultiplePatterns(unittest.TestCase): <NEW_LINE> <INDENT> @patch('satpy.readers.yaml_reader.recursive_dict_update') <NEW_LINE> @patch('satpy.readers.yaml_reader.yaml', spec=yr.yaml) <NEW_LINE> def setUp(self, _, rec_up): <NEW_LINE> <INDENT> patterns = ['a{something:3s}.bla', 'a0{something:2s}... | Test units from FileYAMLReader with multiple readers. | 62598f04cc40096d61619711 |
class PyOrdereddict(PythonPackage): <NEW_LINE> <INDENT> pypi = "ordereddict/ordereddict-1.1.tar.gz" <NEW_LINE> version('1.1', sha256='1c35b4ac206cef2d24816c89f89cf289dd3d38cf7c449bb3fab7bf6d43f01b1f') | A drop-in substitute for Py2.7's new collections.
OrderedDict that works in Python 2.4-2.6. | 62598f05a05bb46b384892e6 |
class Getter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.redis = RedisClient() <NEW_LINE> self.crawlers_cls = crawlers_cls <NEW_LINE> self.crawlers = [crawler_cls() for crawler_cls in self.crawlers_cls] <NEW_LINE> <DEDENT> def is_full(self): <NEW_LINE> <INDENT> return self.redis.count() >=... | getter of proxypool | 62598f05656771135c4880fb |
class DropFlagAction(Action): <NEW_LINE> <INDENT> def __init__(self, player): <NEW_LINE> <INDENT> super(DropFlagAction, self).__init__(player) <NEW_LINE> <DEDENT> def toString(self): <NEW_LINE> <INDENT> return "d " + str(self.player.team.id) + " " + str(self.player.id) | Action that makes the player drop the flag at its current position. | 62598f0555399d3f05624f95 |
class AssessmentOfferedSearch(osid_searches.OsidSearch): <NEW_LINE> <INDENT> def search_among_assessments_offered(self, assessment_offrered_ids): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def order_assessment_offered_results(self, assessment_offered_search_order): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get... | ``AssessmentOfferedSearch`` defines the interface for specifying assessment search options. | 62598f057047854f4633de37 |
class Solution: <NEW_LINE> <INDENT> def closestKValues(self, root, target, k): <NEW_LINE> <INDENT> nums = [] <NEW_LINE> result = [] <NEW_LINE> self.traverse(root, nums) <NEW_LINE> right = self.binarySearch(nums, target) <NEW_LINE> left = right - 1 <NEW_LINE> for _ in range(k): <NEW_LINE> <INDENT> if self.is_left_close(... | @param root: the given BST
@param target: the given target
@param k: the given k
@return: k values in the BST that are closest to the target | 62598f057c178a314d78bf0e |
class QBOMTreeView(QtWidgets.QTreeView): <NEW_LINE> <INDENT> def moveCursor(self, cursorAction, modifiers): <NEW_LINE> <INDENT> if cursorAction == QtWidgets.QAbstractItemView.MoveNext: <NEW_LINE> <INDENT> index = self.currentIndex() <NEW_LINE> if index.isValid(): <NEW_LINE> <INDENT> if index.column()+1 < self.model().c... | implements movecursor to keep editting of rows as pleasant as
it can be | 62598f0563b5f9789fe83bd1 |
class QueriesResource(QueryBase): <NEW_LINE> <INDENT> template = templates.Query <NEW_LINE> def prepare(self, request, instance, template=None): <NEW_LINE> <INDENT> if template is None: <NEW_LINE> <INDENT> template = self.template <NEW_LINE> <DEDENT> posthook = functools.partial(query_posthook, request=request) <NEW_LI... | Resource for accessing the queries a shared with or owned by a user | 62598f055fc7496912d477ac |
class ImageCampaignResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | A ResultSet with methods tailored to the values returned by the ImageCampaign Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62598f055166f23b2e241e50 |
class CrossCovariance(function.Function): <NEW_LINE> <INDENT> def __init__(self, reduce='half_squared_sum'): <NEW_LINE> <INDENT> self.y_centered = None <NEW_LINE> self.z_centered = None <NEW_LINE> self.covariance = None <NEW_LINE> if reduce not in ('half_squared_sum', 'no'): <NEW_LINE> <INDENT> raise ValueError( "only ... | Cross-covariance loss. | 62598f05dc8b845886d52038 |
class HtmlParser(object): <NEW_LINE> <INDENT> url_filed = 'href' <NEW_LINE> parser = 'html.parser' <NEW_LINE> encoding = 'utf-8' <NEW_LINE> def __init__(self, base_url=None): <NEW_LINE> <INDENT> self.__base_url = base_url <NEW_LINE> <DEDENT> def simple_tags(self, data, tag=None, patterns=None, attributes=None): <NEW_LI... | 网页解析器,可以继承此类,实现更复杂功能 | 62598f05656771135c4880fd |
class Agilent364XA(Instrument): <NEW_LINE> <INDENT> def set_voltage(self, level: float): <NEW_LINE> <INDENT> if (level > 20) or (level < 0): <NEW_LINE> <INDENT> raise exceptions.MalformedParamterException(level, "between 0 - 20 V") <NEW_LINE> <DEDENT> self.instrument.write(f"VOLTage {level}") <NEW_LINE> <DEDENT> def ge... | Agilent Single Output Power Supply VISA interface
This class provides basic functionality for the Agilent E3640A power supply.
.. note::
It may work with any Agilent 364XA power supplies,
however only the above has been mentioned. | 62598f058a349b6b43684cb5 |
class BatchSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, sampler, batch_size, drop_last = False,size = 320): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> if not isinstance(sampler, Sampler): <NEW_LINE> <INDENT> raise ValueError("sampler should be an instance of " "torch.utils.data.Sampler, but got sample... | Wraps another sampler to yield a mini-batch of indices.
Args:
sampler (Sampler): Base sampler.
batch_size (int): Size of mini-batch.
drop_last (bool): If ``True``, the sampler will drop the last batch if
its size would be less than ``batch_size``
Example:
>>> list(BatchSampler(SequentialSample... | 62598f057047854f4633de39 |
class Invitation(Persistent): <NEW_LINE> <INDENT> implements(IInvitation) <NEW_LINE> def __init__(self, target, email, inviter, roles): <NEW_LINE> <INDENT> storage = IInvitationStorage(target) <NEW_LINE> self.email = email <NEW_LINE> self.inviter = inviter <NEW_LINE> self.set_target(target) <NEW_LINE> self.roles = role... | The `Invitation` object is used for storing who has invited who for
which context. | 62598f05099cdd3c63674910 |
class EquiposForm(forms.Form): <NEW_LINE> <INDENT> equipos = forms.ModelChoiceField(queryset=Equipo.objects.none()) <NEW_LINE> codigo = forms.CharField(max_length=100, required=False) <NEW_LINE> temperatura_maxima = forms.CharField(max_length=100, required=False, label='Temperatura máxima (ºC)') <NEW_LINE> temperatura_... | Formulario que permite escoger un equipo del laboratorio para mostrar sus registros de tempertura. | 62598f05aad79263cf42d282 |
class CNNFuturesData(object): <NEW_LINE> <INDENT> def __init__(self, resource): <NEW_LINE> <INDENT> self._resource = resource <NEW_LINE> self.data = None <NEW_LINE> <DEDENT> @Throttle(MIN_TIME_BETWEEN_UPDATES) <NEW_LINE> def update(self): <NEW_LINE> <INDENT> from raschietto import Raschietto, Matcher <NEW_LINE> if (sel... | Get data from cnn.com. | 62598f05bf627c535bcafee8 |
class DescribeRoMinScaleResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Memory = None <NEW_LINE> self.Volume = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Memory = params.get("Memory") <NEW_LINE> self.Volume... | DescribeRoMinScale返回参数结构体
| 62598f054a966d76dd5ed947 |
class Nil: <NEW_LINE> <INDENT> def __bool__(self): <NEW_LINE> <INDENT> return False | Class of indicator value for unset properties | 62598f05be7bc26dc925139d |
class CC_ESTABLISHMENT_CONFIRMED(Layer3): <NEW_LINE> <INDENT> constructorList = [ie for ie in Header(3, 6)] <NEW_LINE> def __init__(self, with_options=True, **kwargs): <NEW_LINE> <INDENT> Layer3.__init__(self) <NEW_LINE> self.extend([ Type1_TV('RepeatInd', T=0xD, V=1, Dict=Repeat_dict, Tr... | ME -> Net
Local
# content #
Cond: Repeat indicator (4 bits), only if BearerCap && BearerCap2
Bearer capability (1 to 8 bytes), see 9.3.17b.2
Cond: Bearer capability 2 (1 to 8 bytes), see see 9.3.17b.2
Opt: Cause (2 to 30 bytes)
Cond: Supported codecs (3 to max bytes), if UMTS supported | 62598f050fa83653e46f3957 |
class FEDMultiLineBraces(RuleSetChecker): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = 'multi-line-brace' <NEW_LINE> self.errorLevel = ERROR_LEVEL.LOG <NEW_LINE> self.errorMsg_shouldEnterAfterOpenningBrace = 'should "enter" after the opening brace in "${selector}"' <NEW_LINE> self.errorMsg_shou... | {
"summary":"多行CSS风格的括号检查",
"desc":"用于检查多行风格下的 <code>{</code> 和 <code>}</code> 的编写风格,前后空格符和回车符的情况等。"
} | 62598f05283ffb24f3cf2320 |
class PriceListService(object): <NEW_LINE> <INDENT> OPTS_KEYS_TO_PERSIST = ['Code', 'Description', 'Comments', 'PreSelected'] <NEW_LINE> SERVICE = "PriceList" <NEW_LINE> def __init__(self, http_client): <NEW_LINE> <INDENT> self.__http_client = http_client <NEW_LINE> <DEDENT> @property <NEW_LINE> def http_client(self): ... | :class:`fortnox.PriceListService` is used by :class:`fortnox.Client` to make
actions related to PriceList resource.
Normally you won't instantiate this class directly. | 62598f055fdd1c0f98e5ca14 |
class RSEAllocationManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super(RSEAllocationManager, self).get_queryset().filter(deleted_date__isnull=True) <NEW_LINE> <DEDENT> def all(self, deleted=False): <NEW_LINE> <INDENT> if deleted: <NEW_LINE> <INDENT> return super(RSEAllo... | RSEAllocation objects are transactional in that they are never actually deleted they are just flagged as deleted
This custom manager allows all() to return on objects which have not been flagged as deleted | 62598f05099cdd3c63674911 |
class DirectionalExpectimaxAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def expectimax(self, gameState, depth, agentIndex): <NEW_LINE> <INDENT> if depth == 0 or gameState.isWin() or gameState.isLose(): <NEW_LINE> <INDENT> return self.evaluationFunction(gameState) <NEW_LINE> <DEDENT> nextAgent = (agentIndex + 1) % ... | Your expectimax agent | 62598f05d486a94d0ba2aa3c |
class TapsAffData(object): <NEW_LINE> <INDENT> def __init__(self, location): <NEW_LINE> <INDENT> from tapsaff import TapsAff <NEW_LINE> self._is_taps_aff = None <NEW_LINE> self.taps_aff = TapsAff(location) <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_taps_aff(self): <NEW_LINE> <INDENT> return self._is_taps_aff <NEW_... | Class for handling the data retrieval for pins. | 62598f05adb09d7d5dc09025 |
class GradeSystemSearch(osid_searches.OsidSearch): <NEW_LINE> <INDENT> def search_among_grade_systems(self, grade_system_ids): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def order_grade_system_results(self, grade_system_search_order): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_grade_system_search_record(sel... | The interface for governing grade system searches. | 62598f055fc7496912d477ae |
class FileEntry(object): <NEW_LINE> <INDENT> def __init__(self, entry_detail, addenda_record=[]): <NEW_LINE> <INDENT> self.entry_detail = entry_detail <NEW_LINE> self.addenda_record = [] <NEW_LINE> for index, addenda in enumerate(addenda_record): <NEW_LINE> <INDENT> self.addenda_record.append( AddendaRecord( self.entry... | Holds:
EntryDetail (1)
AddendaRecord (n) <-- for some types of entries there can be more than one | 62598f05167d2b6e312b5a11 |
class get_default_configuration_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT,(ConfigVariable, ConfigVariable.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_... | Attributes:
- success | 62598f05656771135c488101 |
class PoolManagerAPI(object): <NEW_LINE> <INDENT> RPC_API_VERSION = '1.0' <NEW_LINE> def __init__(self, topic=None): <NEW_LINE> <INDENT> self.topic = topic if topic else cfg.CONF.pool_manager_topic <NEW_LINE> target = messaging.Target(topic=self.topic, version=self.RPC_API_VERSION) <NEW_LINE> self.client = rpc.get_clie... | Client side of the Pool Manager RPC API.
API version history:
API version history:
1.0 - Initial version | 62598f05f548e778e5969ffd |
class InputStream(object): <NEW_LINE> <INDENT> def __init__(self, feed_key_callback): <NEW_LINE> <INDENT> assert callable(feed_key_callback) <NEW_LINE> self.feed_key_callback = feed_key_callback <NEW_LINE> self.reset() <NEW_LINE> if _DEBUG_RENDERER_INPUT: <NEW_LINE> <INDENT> self.LOG = open(_DEBUG_RENDERER_INPUT_FILENA... | Parser for VT100 input stream.
Feed the data through the `feed` method and the correct callbacks of the
`input_processor` will be called.
::
def callback(key):
pass
i = InputStream(callback)
i.feed('data...')
:attr input_processor: :class:`~prompt_toolkit.key_binding.InputProcessor` instance. | 62598f05fbf16365ca792b11 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.