code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class lizi_3d: <NEW_LINE> <INDENT> def __init__(self, bounds=None): <NEW_LINE> <INDENT> self.input_dim = 3 <NEW_LINE> if bounds is None: <NEW_LINE> <INDENT> self.bounds = [[0, 1], [0, 1], [0, 1]] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.bounds = bounds <NEW_LINE> <DEDENT> self.min = [0, 0, 0] <NEW_LINE> self.... | 书中例子, | 62598f84ec188e330fdf8349 |
class InheritedTask(Task): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return super(InheritedTask, self).__str__() | Show how super doesn't work on UserDict.UserDict. | 62598f848a43f66fc4bf1c2d |
class PDT_OT_PivotOrigin(Operator): <NEW_LINE> <INDENT> bl_idname = "pdt.pivotorigin" <NEW_LINE> bl_label = "PDT Pivot to Object Origin" <NEW_LINE> bl_options = {"REGISTER", "UNDO"} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> obj = context.object <NEW_LINE> if obj is None: <NEW_LINE> ... | Set Pivot Point at Object Origin | 62598f84287bf620b627165f |
class CampaignConf(BaseConf): <NEW_LINE> <INDENT> DEFAULT_RUN_NUMBER_VALUE = "1" <NEW_LINE> def __init__(self, sc_node, parent_campaign_list): <NEW_LINE> <INDENT> BaseConf.__init__(self) <NEW_LINE> self._attrs = sc_node.attrib <NEW_LINE> self._raw_name = os.path.normpath(self._attrs.get('Id', '')) <NEW_LINE> self._name... | This class holds parameters relative to the call of a sub campaign | 62598f8450485f2cf55daa1e |
class DatabasePoolConnection: <NEW_LINE> <INDENT> def __init__(self, conn): <NEW_LINE> <INDENT> self.conn = conn <NEW_LINE> <DEDENT> def get_cursor(self): <NEW_LINE> <INDENT> return self.conn.cursor() | Wrapper for psycopg2 one connection pool from DatabasePoolHandler. | 62598f84f8510a7c17d7decd |
class Temperature(Unit): <NEW_LINE> <INDENT> units = {} | Temperature unit class container.
Temperatures are:
- Celsius: °C
- Fahrenheit: °F
- Kelvin: K | 62598f84596a89723612771e |
class TestAddUserToGroup(BaseTestCase): <NEW_LINE> <INDENT> def __get_group_users(self, group_id): <NEW_LINE> <INDENT> return self.client.get( '/auth/groups/{}/users'.format(group_id), content_type='application/json' ) <NEW_LINE> <DEDENT> def test_add_user_to_group(self): <NEW_LINE> <INDENT> user = add_user() <NEW_LINE... | Tests for add user to group | 62598f84d6c5a102081e1bf5 |
class TypeInterfaceMap(dict): <NEW_LINE> <INDENT> __metaclass__ = Singleton <NEW_LINE> def declare_interface(self, type, interface): <NEW_LINE> <INDENT> if type and type not in self: <NEW_LINE> <INDENT> self[type] = interface <NEW_LINE> <DEDENT> TypeNameInterfaceMap().declare_interface(str(interface), interface) | Singleton class to map Interface with standard python type
InterfaceWidgetMap inherits from dict class | 62598f84c432627299fa2a7b |
class ItemList(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.items = [] <NEW_LINE> self.length = 0 <NEW_LINE> self.size = 0 <NEW_LINE> <DEDENT> def append(self, item, item_size): <NEW_LINE> <INDENT> self.items.append(item) <NEW_LINE> self.length += 1 <NEW_LINE> self.size += item_size <NEW_LI... | Holds list of arbitrary items, and their total size.
Properties:
items: list of objects.
length: length of item list.
size: aggregate item size in bytes. | 62598f84f7d966606f747a94 |
class _FuncGraph(ops.Graph): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(_FuncGraph, self).__init__(*args, **kwargs) <NEW_LINE> self._building_function = True <NEW_LINE> self._outer_graph = ops.get_default_graph() <NEW_LINE> self._vscope = vs.get_variable_scope() <NEW_LINE> self._... | A helper for construction a function.
_FuncGraph overrides ops.Graph's create_op() so that we can keep
track of every inputs into every op created inside the function. If
any input is from other graphs, we keep track of it in self.capture
and substitue the input with a place holder.
Each captured input's correspondi... | 62598f84442bda511e95bf07 |
class IForumWorkspace(IForum, IWorkspace): <NEW_LINE> <INDENT> pass | forum workspace | 62598f84d10714528d69d97c |
class Account(BrowserView): <NEW_LINE> <INDENT> implements(interfaces.IAccountController) <NEW_LINE> context = request = None <NEW_LINE> __parent__ = None <NEW_LINE> __name__ = u'account' <NEW_LINE> viewInterface = interfaces.IAccountView <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> self.context... | Account is view that traverses to other views. | 62598f8430c21e258be982b6 |
class MailboxSource(MailSource) : <NEW_LINE> <INDENT> def __init__(self, filename, type) : <NEW_LINE> <INDENT> logging.info('Initializing mailbox source (file=' + filename + ',type=' + type.__name__ + ')') <NEW_LINE> self.type = type <NEW_LINE> self.filename = filename <NEW_LINE> <DEDENT> def messages(self) : <NEW_LINE... | A class that retrieves messages from a mailbox file.
The type of the mailbox file needs to be specified as a mailbox class. | 62598f8426068e7796d4c408 |
class Background(Sprite): <NEW_LINE> <INDENT> def __init__(self, screen): <NEW_LINE> <INDENT> super(Background, self).__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.image = pygame.image.load('../images/background.png').convert_alpha() <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> self.screen_rect ... | Parent background class for Blast. | 62598f84b5575c28eb712a1d |
class AccuFloat(Node): <NEW_LINE> <INDENT> def __init__(self, inputs, outputs): <NEW_LINE> <INDENT> Node.__init__(self, inputs, outputs) <NEW_LINE> self.pool = DataPool() <NEW_LINE> <DEDENT> def __call__(self, inputs): <NEW_LINE> <INDENT> varname = inputs[1] <NEW_LINE> value = inputs[0] <NEW_LINE> if(not varname): <NEW... | Float Accumulator
Add to a Float (in datapool) the receive value
:param inputs: a list containing the value to append and
the name of the datapool variable | 62598f84711fe17d825e0195 |
class RestClientTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(RestClientTest, self).setUp() <NEW_LINE> self.client = RestClient('https://api.github.com', username=GITHUB_LOGIN, token=GITHUB_TOKEN) <NEW_LINE> <DEDENT> def test_client(self): <NEW_LINE> <INDENT> status, body = self.client.... | small test for The RestClient
This should not be to much, since there is an hourly limit of requests for the github api | 62598f84bde94217f37073bc |
class _NumericalModel: <NEW_LINE> <INDENT> def __init__(self, n_states, parameters, rules, agg_states=None): <NEW_LINE> <INDENT> self.n_states = n_states <NEW_LINE> self.agg_states = agg_states if agg_states is not None else [] <NEW_LINE> parameters = np.asarray(parameters) <NEW_LINE> self._rules = [(origin, destinatio... | Mathematical form of a compartment. | 62598f848e71fb1e983bb567 |
class EventDetail(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> unique_together = ("event", "event_fields",) <NEW_LINE> <DEDENT> event = models.ForeignKey(Event, on_delete=models.CASCADE) <NEW_LINE> event_fields = models.ForeignKey(EventFields, on_delete=models.CASCADE) <NEW_LINE> value = models.Ch... | EventDetail
Detail Fields of a Event parsed with the Parsing Template and linked to the matching Event Fields | 62598f8430c21e258be982b7 |
class S3Error(TryAgain): <NEW_LINE> <INDENT> pass | There was an error accessing the s3 external service. | 62598f847b25080760ed6f53 |
class Parameter: <NEW_LINE> <INDENT> def __init__(self, name, fallback=_UNSET): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fallback = fallback <NEW_LINE> <DEDENT> def parse(self, text: str) -> Tuple[Any, str]: <NEW_LINE> <INDENT> raise NotImplemented() <NEW_LINE> <DEDENT> def __call__(self, text): <NEW_LINE> ... | A parameter parses arguments from a user supplied string.
To create a new type of parameter, simply subclass this class:
.. code-block: python
class MyParameter(Parameter):
def parse(self, text: str) -> Tuple[str, str]:
return "value", text
Attributes
----------
name : str
The name of th... | 62598f841d351010ab8f35ea |
class RegistrationProfile(models.Model): <NEW_LINE> <INDENT> ACTIVATED = u"ALREADY_ACTIVATED" <NEW_LINE> emailuser_id = models.IntegerField() <NEW_LINE> activation_key = models.CharField(_('activation key'), max_length=40) <NEW_LINE> objects = RegistrationManager() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_nam... | A simple profile which stores an activation key for use during
user account registration.
Generally, you will not want to interact directly with instances
of this model; the provided manager includes methods
for creating and activating new accounts, as well as for cleaning
out accounts which have never been activated.... | 62598f84d7e4931a7ef3bb48 |
class VigraRfPixelwiseClassifierFactory(LazyflowPixelwiseClassifierFactoryABC): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._args = args <NEW_LINE> self._kwargs = kwargs <NEW_LINE> <DEDENT> def create_and_train_pixelwise(self, feature_images, label_images, ax... | An implementation of LazyflowPixelwiseClassifierFactoryABC using a vigra RandomForest.
This exists for testing purposes only. (it is normally better to use the vector-wise
classifier so lazyflow can cache the feature matrices).
This implementation is simple and un-optimized. | 62598f8421bff66bcd722718 |
class AccessLog(AbstractBaseModel): <NEW_LINE> <INDENT> user = models.ForeignKey(settings.AUTH_USER_MODEL) <NEW_LINE> content_type = models.ForeignKey(ContentType) <NEW_LINE> object_id = models.PositiveIntegerField() <NEW_LINE> content_object = GenericForeignKey('content_type', 'object_id') <NEW_LINE> objects = AccessL... | Model to log access to restricted objects. | 62598f84f8510a7c17d7dece |
class DrawState: <NEW_LINE> <INDENT> def __init__(self, view): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> ( zoom, rotation, self.hflip, self.vflip, self.minify_filter, self.magnify_filter, self.round_full_pixel_offset, self.round_sub_pixel_offset ) = view.get_properties( "magnification", "rotation", "horizontal-fl... | Caches a bunch of properties | 62598f84a05bb46b3848a328 |
class purchase_stage_line_esc(osv.Model): <NEW_LINE> <INDENT> _name = 'purchase.stage.line' <NEW_LINE> _description = 'Campos para validar en sub-flujo pedidos de compra' <NEW_LINE> _columns = { 'campos_id': fields.many2one('purchase.stage', 'Campos'), 'name': fields.char('Nombre de campo', size=250), 'field_descriptio... | 03/03/2015 (felix)
Esta tabla es para guardar de manera visual en el programa
campos adicionales para cada etapa del sub-flujo en pedidos de compra | 62598f84442bda511e95bf09 |
@EntityField(name='socialmedia.fieldN', propname='fieldN', displayname='Field N', matchingrule=MatchingRule.Loose) <NEW_LINE> @EntityField(name='socialmedia.field1', propname='field1', displayname='Field 1', type=EntityFieldType.Integer) <NEW_LINE> class MySocialmediaEntity(SocialmediaEntity): <NEW_LINE> <INDENT> pass | Uncomment the line below and comment out the pass if you wish to define a ridiculous entity type name like
'my.fancy.EntityType' | 62598f84b7558d58954630e1 |
class SrcSamplerPt(SamplerPt): <NEW_LINE> <INDENT> def __init__(self, scene, engine, source, stype="source", **kwargs): <NEW_LINE> <INDENT> super().__init__(scene, engine, stype=stype, **kwargs) <NEW_LINE> self.accuracy = self.accuracy * (1 - np.cos(.533*np.pi/360)) <NEW_LINE> self.sunpos = np.asarray(sun).flatten()[0:... | sample contributions from direct suns.
Parameters
----------
scene: raytraverse.scene.Scene
scene class containing geometry, location and analysis plane
engine: raytraverse.renderer.Rtrace
initialized renderer instance (with scene loaded, no sources)
sun: np.array
shape 3, sun position
sunbin: int
sun ... | 62598f84cad5886f8bdc4dd4 |
class ASQ(BaseModel): <NEW_LINE> <INDENT> asq_id = models.AutoField( 'asq_id', primary_key=True ) <NEW_LINE> ref_assessment_interval = models.ForeignKey( 'RefASQInterval', verbose_name='ref_assessment_interval_id' ) <NEW_LINE> assessment_date = models.DateField('assessment_date', auto_now=False, auto_now_add=False) <NE... | Describes the ASQ 3 assessment scores (no questions) | 62598f84d53ae8145f917f3d |
class TestUrlList: <NEW_LINE> <INDENT> TESTS = { 'http://qutebrowser.org/': [QUrl('http://qutebrowser.org/')], 'http://qutebrowser.org/,http://heise.de/': [QUrl('http://qutebrowser.org/'), QUrl('http://heise.de/')], '': None, } <NEW_LINE> @pytest.fixture <NEW_LINE> def klass(self): <NEW_LINE> <INDENT> return configtype... | Test UrlList. | 62598f84596a897236127721 |
class SESBackend(BaseEmailBackend): <NEW_LINE> <INDENT> def __init__(self, fail_silently=False, *args, **kwargs): <NEW_LINE> <INDENT> super(SESBackend, self).__init__(fail_silently=fail_silently, *args, **kwargs) <NEW_LINE> self._access_key_id = getattr(settings, 'AWS_ACCESS_KEY_ID', None) <NEW_LINE> self._access_key =... | A Django Email backend that uses Amazon's Simple Email Service.
| 62598f84baa26c4b54d4ed60 |
class SmppClientIsNotConnected(Exception): <NEW_LINE> <INDENT> pass | An exception that is raised when a trying to use smpp object when
it is still None (before callbacking bind()) | 62598f84bde94217f37073bd |
class MismatchedNotSetException(MismatchedSetException): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return "MismatchedNotSetException(%r!=%r)" % ( self.getUnexpectedType(), self.expecting ) <NEW_LINE> <DEDENT> __repr__ = __str__ | @brief Used for remote debugger deserialization | 62598f848e05c05ec3f6eb9f |
class ListTaxonomyReportsResponse(_messages.Message): <NEW_LINE> <INDENT> reports = _messages.MessageField('TaxonomyReport', 1, repeated=True) | Response message for "TaxonomyReports.ListTaxonomyReports".
Fields:
reports: Taxonomy reports that the taxonomy store contains. | 62598f841d351010ab8f35ec |
class User(Chat): <NEW_LINE> <INDENT> def __init__(self, raw, bot): <NEW_LINE> <INDENT> super(User, self).__init__(raw, bot) <NEW_LINE> <DEDENT> @property <NEW_LINE> def remark_name(self): <NEW_LINE> <INDENT> return self.raw.get('RemarkName') <NEW_LINE> <DEDENT> @property <NEW_LINE> def sex(self): <NEW_LINE> <INDENT> r... | 好友(:class:`Friend`)、群聊成员(:class:`Member`),和公众号(:class:`MP`) 的基础类 | 62598f84009cb60464d00fdb |
class UWUMProfileSettingsViewTest(TestCase): <NEW_LINE> <INDENT> url = settings.SOCIALACCOUNT_PROVIDERS['uwum']['REGULAR_URL'] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.view = views.UWUMProfileSettingsView.as_view() <NEW_LINE> self.request = HttpRequest() <NEW_LINE> self.request.method = 'GET' <NEW_LINE> set... | Tests for UWUMProfileSettingsView. | 62598f84b830903b9686e1c9 |
class GiveInsn(SingleCommandInsn): <NEW_LINE> <INDENT> args = [EntitySelection, ItemType, int] <NEW_LINE> argnames = 'targets item count' <NEW_LINE> argdocs = ["Entities to give the item to", "The item to give", "Item count"] <NEW_LINE> insn_name = 'give' <NEW_LINE> def get_cmd(self, func): <NEW_LINE> <INDENT> return c... | Gives targetted entities an item. | 62598f84d7e4931a7ef3bb4a |
class ConditionalGetMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if request.method != 'GET': <NEW_LINE> <INDENT> return response <NEW_LINE> <DEDENT> if self.needs_etag(response) and not response.has_header('ETag'): <NEW_LINE> <INDENT> set_response_e... | Handle conditional GET operations. If the response has an ETag or
Last-Modified header and the request has If-None-Match or If-Modified-Since,
replace the response with HttpNotModified. Add an ETag header if needed. | 62598f848da39b475be02c95 |
class P2SVpnGateway(Resource): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'type': {'readonly': True}, 'vpn_client_connection_health': {'readonly': True}, 'etag': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {... | P2SVpnGateway Resource.
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
:param tags: Resourc... | 62598f84b57a9660fecd152c |
class LoginRequiredMixin(object): <NEW_LINE> <INDENT> @method_decorator(login_required(redirect_field_name=reverse_lazy('index'), login_url=reverse_lazy('login'))) <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(LoginRequiredMixin, self).dispatch(*args, **kwargs) | Ensures that user must be authenticated in order to access view. | 62598f843eb6a72ae038a0e5 |
class ScheduleCreateVolumeTask(flow_utils.CinderTask): <NEW_LINE> <INDENT> FAILURE_TOPIC = "scheduler.create_volume" <NEW_LINE> def __init__(self, db_api, driver_api, **kwargs): <NEW_LINE> <INDENT> super(ScheduleCreateVolumeTask, self).__init__(addons=[ACTION], **kwargs) <NEW_LINE> self.db_api = db_api <NEW_LINE> self.... | Activates a scheduler driver and handles any subsequent failures.
Notification strategy: on failure the scheduler rpc notifier will be
activated and a notification will be emitted indicating what errored,
the reason, and the request (and misc. other data) that caused the error
to be triggered.
Reversion strategy: N/A | 62598f84287bf620b6271663 |
class LocalFS(FileSystem): <NEW_LINE> <INDENT> def create_temporary_dir(self, dir=None): <NEW_LINE> <INDENT> return tempfile.mkdtemp(dir=dir) <NEW_LINE> <DEDENT> def delete_dir(self, path): <NEW_LINE> <INDENT> shutil.rmtree(path) <NEW_LINE> <DEDENT> def create_dir(self, path): <NEW_LINE> <INDENT> os.makedirs(path) <NEW... | Local file system | 62598f84dc8b845886d53065 |
class BaseQuestionModel(TimeStampedModel, SafeDeleteMixin): <NEW_LINE> <INDENT> _safedelete_policy = SOFT_DELETE <NEW_LINE> quiz = CharField(max_length=500, blank=False, default="0") <NEW_LINE> position = CharField(max_length=500, blank=False, default="0") <NEW_LINE> objects = InheritanceManager() <NEW_LINE> def check_... | A base model for a Question that stores quiz id and position in the quiz for each question. | 62598f8445492302aabfbf8d |
class TestArgumentParsing(TestCase): <NEW_LINE> <INDENT> @parameterized.expand([ ([], Namespace(domain='lobby.wildfiregames.com', login='EcheLOn', log_level=30, xserver=None, xdisabletls=False, nickname='RatingsBot', password='XXXXXX', room='arena', database_url='sqlite:///lobby_rankings.sqlite3')), (['--debug'], Names... | Test handling of parsing command line parameters. | 62598f8482261d6c5272fc2c |
class DataFileTypeError(Error): <NEW_LINE> <INDENT> pass | Exception raised for unknown data file types. | 62598f8423e79379d538bfaa |
class ExtractedSourceFile(models.Model): <NEW_LINE> <INDENT> source_package = models.ForeignKey( SourcePackage, related_name='extracted_source_files', on_delete=models.CASCADE) <NEW_LINE> extracted_file = models.FileField( upload_to=_extracted_source_file_upload_path) <NEW_LINE> name = models.CharField(max_length=100) ... | Model representing a single file extracted from a source package archive. | 62598f84d53ae8145f917f3f |
class TimeOutError(RuntimeError): <NEW_LINE> <INDENT> pass | This error is raised when an operation is taking longer than expected. | 62598f84097d151d1a2c0ad5 |
class AddFavView(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> fav_id = request.POST.get('fav_id', 0) <NEW_LINE> fav_type = request.POST.get('fav_type', 0) <NEW_LINE> if not request.user.is_authenticated(): <NEW_LINE> <INDENT> return HttpResponse('{"status":"fail", "msg":"用户未登录"}', content_typ... | 用户收藏, 以及用户取消收藏 | 62598f8423e79379d538bfab |
class CreateQuotePostResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((xml) The response from Tumblr in XML format.) | 62598f84d99f1b3c44d0515f |
class EvalCount: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ids = dict() <NEW_LINE> self.ids_exclude = set() <NEW_LINE> self.summary_count = 0 <NEW_LINE> self.num_terminal = 0 <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def _on_terminal(self, id, record): <NEW... | Eval Count. Run games and record required stats. | 62598f84009cb60464d00fdd |
class ITabbedviewUploadable(Interface, IQuickUploadCapable): <NEW_LINE> <INDENT> pass | Marker interfaces | 62598f8494891a1f408b9447 |
class SubExceptions(Exception): <NEW_LINE> <INDENT> def __init__(self, expression, message): <NEW_LINE> <INDENT> self.expression = expression <NEW_LINE> self.message = message | Deal with exceptions emerging from login attempts and empty search results | 62598f8421a7993f00c65a24 |
class WarmPool(AWSObject): <NEW_LINE> <INDENT> resource_type = "AWS::AutoScaling::WarmPool" <NEW_LINE> props: PropsDictType = { "AutoScalingGroupName": (str, True), "InstanceReusePolicy": (InstanceReusePolicy, False), "MaxGroupPreparedCapacity": (integer, False), "MinSize": (integer, False), "PoolState": (str, False), ... | `WarmPool <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-autoscaling-warmpool.html>`__ | 62598f84d4950a0f3b110b8e |
class SecretUpdateView(mixins.LoginRequiredMixin, UpdateView): <NEW_LINE> <INDENT> form_class = forms.UpdateSecretForm <NEW_LINE> model = models.Secret <NEW_LINE> http_method_names = ['post'] <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> return reverse_lazy('secret:detail', args=[self.object.pk]) <NEW_LINE>... | Updates a secret | 62598f84bde94217f37073bf |
class Element(object): <NEW_LINE> <INDENT> def __init__(self, ID, nodes): <NEW_LINE> <INDENT> self.ID = ID <NEW_LINE> self.nodes = nodes <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> txt = "element "+self.ID+"\n" <NEW_LINE> for nd in self.nodes: <NEW_LINE> <INDENT> txt += " node "+nd['ID']+": "+nd['pos']+... | classdocs | 62598f8415baa72349461a30 |
class IndicatorDocumentAdapter(object): <NEW_LINE> <INDENT> def transform_to_indicator(self, indicator_document): <NEW_LINE> <INDENT> return create_indicator(id=indicator_document['_id'], index=indicator_document['index'], indicator=indicator_document['indicator'], name=indicator_document['name'], parent=indicator_docu... | Adapter class to transform indicators from PyMongo format to Domain indicator objects | 62598f848e05c05ec3f6eba1 |
class SymbolTable: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._table = { 'SP': 0, 'LCL': 1, 'ARG': 2, 'THIS': 3, 'THAT': 4, 'R0': 0, 'R1': 1, 'R2': 2, 'R3': 3, 'R4': 4, 'R5': 5, 'R6': 6, 'R7': 7, 'R8': 8, 'R9': 9, 'R10': 10, 'R11': 11, 'R12': 12, 'R13': 13, 'R14': 14, 'R15': 15, 'SCREEN': 16384, '... | Creates and maintains correspondence between symbols and their meaning (RAM and ROM addresses). | 62598f84a17c0f6771d5bcf5 |
class BadgeForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Badge <NEW_LINE> exclude = ['event', 'helper', 'barcode'] <NEW_LINE> widgets = { 'photo': ImageFileInput, } <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(BadgeForm, self).__init__(*args, **... | Edit a badge:
* of a helper
or
* a special badge | 62598f84b830903b9686e1cb |
class UserCreationForm(forms.ModelForm): <NEW_LINE> <INDENT> error_messages = { 'password_mismatch': _("The two password fields didn't match."), } <NEW_LINE> password1 = forms.CharField(label=_("Password"), widget=forms.PasswordInput) <NEW_LINE> password2 = forms.CharField(label=_("Password confirmation"), widget=forms... | A form that creates a user, with no privileges, from the given username and
password. | 62598f8416aa5153ce3fffb4 |
class AttrDict(dict): <NEW_LINE> <INDENT> def __init__(self, init={}): <NEW_LINE> <INDENT> dict.__init__(self, init) <NEW_LINE> <DEDENT> def __getstate__(self): <NEW_LINE> <INDENT> return self.__dict__.items() <NEW_LINE> <DEDENT> def __setstate__(self, items): <NEW_LINE> <INDENT> for key, val in items: <NEW_LINE> <INDE... | A dictionary with attribute-style access. It maps attribute access to
the real dictionary.
# from: http://code.activestate.com/recipes/473786-dictionary-with-attribute-style-access/ | 62598f84e76e3b2f99fd84e9 |
class ApeComponent(object): <NEW_LINE> <INDENT> def __init__(self, component_id, agent, configuration): <NEW_LINE> <INDENT> self.component_id = component_id <NEW_LINE> self.agent = agent <NEW_LINE> self.configuration = configuration <NEW_LINE> self.was_started = False <NEW_LINE> self.was_stopped = False <NEW_LINE> <DED... | base component type | 62598f84b57a9660fecd1530 |
class FindWindowUI(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{212A710D-4C00-11D2-A079-0000F8775BF9}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{40499F24-596F-45D2-ACE1-A251E2990017}', 10, 2) | Window to display Find dialog in. Deprecated. Please consider using the IFind interface in the Carto library instead. | 62598f848da39b475be02c99 |
class UrbanNode(DemandNode): <NEW_LINE> <INDENT> type = "urban" | An urban demand node. Has attributs cost, demand and
consumption coefficient and inflow by virtue
of being a subclass of DemandNode | 62598f84c432627299fa2a82 |
class FirstAuthtication(BaseAuthentication): <NEW_LINE> <INDENT> def authenticate(self,request): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def authenticate_header(self,request): <NEW_LINE> <INDENT> pass | 用户认证,返回None的情况,默认是匿名用户 | 62598f84c432627299fa2a83 |
class IterForDMatrixTest(xgb.core.DataIter): <NEW_LINE> <INDENT> ROWS_PER_BATCH = 100 <NEW_LINE> BATCHES = 16 <NEW_LINE> def __init__(self, categorical): <NEW_LINE> <INDENT> import cudf <NEW_LINE> self.rows = self.ROWS_PER_BATCH <NEW_LINE> if categorical: <NEW_LINE> <INDENT> self._data = [] <NEW_LINE> self._labels = []... | A data iterator for XGBoost DMatrix.
`reset` and `next` are required for any data iterator, other functions here
are utilites for demonstration's purpose. | 62598f8430c21e258be982be |
@Message.register(Byte(SSH_MSG_IGNORE)) <NEW_LINE> class Ignore(Message): <NEW_LINE> <INDENT> SPEC = [('data', String)] <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> super(Ignore, self).__init__(self.HEADER) <NEW_LINE> self.data = data | Ignore: Section 11.2 | 62598f84d10714528d69d984 |
class MyThread(Thread): <NEW_LINE> <INDENT> def __init__(self,target,tid,lock,url): <NEW_LINE> <INDENT> super(MyThread,self).__init__() <NEW_LINE> self.setDaemon(True) <NEW_LINE> self.target = target <NEW_LINE> self.tid = tid <NEW_LINE> self.lock = lock <NEW_LINE> self.url = url <NEW_LINE> self.result = None <NEW_LINE>... | 可传递参数、指定运行函数的线程类 | 62598f841f5feb6acb1626e6 |
class FirstNameToken(Token): <NEW_LINE> <INDENT> name = "firstname" <NEW_LINE> def getValue(self, data): <NEW_LINE> <INDENT> return data.get("user.HumanUser.firstname", "") | The <code>firstname</code> Token will return the "firstname" value of the Artist for the Version. | 62598f84b7558d58954630e7 |
class ClusterUpdate(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'host_name': {'readonly': True}, 'provisioning_state': {'readonly': True}, 'resource_state': {'readonly': True}, 'redis_version': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, } <NEW_LINE> _attribute_map = { '... | A partial update to the RedisEnterprise cluster.
Variables are only populated by the server, and will be ignored when sending a request.
:param sku: The SKU to create, which affects price, performance, and features.
:type sku: ~azure.mgmt.redisenterprise.models.Sku
:param tags: A set of tags. Resource tags.
:type tag... | 62598f8426068e7796d4c410 |
class DocumentPage(models.Model): <NEW_LINE> <INDENT> document_version = models.ForeignKey(DocumentVersion, verbose_name=_('Document version'), related_name='pages') <NEW_LINE> content = models.TextField(blank=True, null=True, verbose_name=_('Content')) <NEW_LINE> page_label = models.CharField(max_length=40, blank=True... | Model that describes a document version page including it's content | 62598f84596a897236127727 |
class RequestErrorException(ConanException): <NEW_LINE> <INDENT> pass | Generic 400 error | 62598f84baa26c4b54d4ed66 |
class RemoteServiceAdminListener(object): <NEW_LINE> <INDENT> def remote_admin_event(self, rsa_event): <NEW_LINE> <INDENT> pass | Remote service admin listener service interface. Services
registered with this as service specification will have this method
called synchronously by the RSA implementation for notification
of RSA events. The event parameter will be of type
RemoteServiceAdminEvent (see below). | 62598f8415baa72349461a32 |
class VMOpsTestCase(test.NoDBTestCase): <NEW_LINE> <INDENT> def __init__(self, test_case_name): <NEW_LINE> <INDENT> super(VMOpsTestCase, self).__init__(test_case_name) <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> super(VMOpsTestCase, self).setUp() <NEW_LINE> self.context = 'fake-context' <NEW_LINE> patched_... | Unit tests for the Hyper-V VMOps class. | 62598f8496565a6dacd2ccd2 |
class AppState: <NEW_LINE> <INDENT> def __init__(self, bkr_dir, config): <NEW_LINE> <INDENT> self._bkr_dir = bkr_dir <NEW_LINE> self._config = config <NEW_LINE> <DEDENT> @property <NEW_LINE> def bkr_dir(self): <NEW_LINE> <INDENT> return self._bkr_dir <NEW_LINE> <DEDENT> @property <NEW_LINE> def config(self): <NEW_LINE>... | Class for holding all application state. | 62598f848a349b6b43685cf9 |
class PasswordResetConfirmSerializer(serializers.Serializer): <NEW_LINE> <INDENT> new_password1 = serializers.CharField(max_length=128) <NEW_LINE> new_password2 = serializers.CharField(max_length=128) <NEW_LINE> uid = serializers.CharField(required=True) <NEW_LINE> token = serializers.CharField(required=True) <NEW_LINE... | Serializer for requesting a password reset e-mail. | 62598f848e05c05ec3f6eba2 |
class ParsingUtilsTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_parse_fqan(self): <NEW_LINE> <INDENT> self.assertEqual((None, None, 'role=2'), parse_fqan('role=2')) <NEW_LINE> self.assertEqual(('role=some', '/Test', 'Test'), parse_fqan('/Test/role=some/test')) <NEW_LINE> wrong_fqan1 = "hello." <NEW_LINE> wrong_... | Test case for test_parse_fqan method | 62598f8416aa5153ce3fffb6 |
class Milkman(Occupation): <NEW_LINE> <INDENT> def __init__(self, person, company, shift): <NEW_LINE> <INDENT> super(Milkman, self).__init__(person=person, company=company, shift=shift) | A milkman at a business. | 62598f841d351010ab8f35f2 |
class Clock(object): <NEW_LINE> <INDENT> def __init__(self, minutes, seconds, periods, period_seconds): <NEW_LINE> <INDENT> self.has_fixed_time = True if (minutes > 0 or seconds > 0) else False <NEW_LINE> self.has_periods = True if (periods > 0) else False <NEW_LINE> self._seconds = (minutes * 60) + seconds <NEW_LINE> ... | A game clock for the Game of the Amazons. Includes regular fixed time,
and 'byo-yomi': a number of periods of a set number of seconds whose
seconds are reset if a move is completed during the period.
There is one game clock for each player. | 62598f8415baa72349461a33 |
class AlarmCondition(IntEnum): <NEW_LINE> <INDENT> No = NO_ALARM <NEW_LINE> Read = READ_ALARM <NEW_LINE> Write = WRITE_ALARM <NEW_LINE> HiHi = HIHI_ALARM <NEW_LINE> High = HIGH_ALARM <NEW_LINE> LoLo = LOLO_ALARM <NEW_LINE> Low = LOW_ALARM <NEW_LINE> State = STATE_ALARM <... | Enum redefined from C enum type epicsAlarmCondition.
Due to the enum difference between C and Python,
the enum item name has been greatly simplified::
epicsAlarmNone -> AlarmCondition.No
epicsAlarmRead -> AlarmCondition.Read
...
.. note:: *No* is used in place of *None*, which is Python keyword. | 62598f84379a373c97d98ac7 |
class AnsibleDocTest(SanityMultipleVersion): <NEW_LINE> <INDENT> def test(self, args, targets, python_version): <NEW_LINE> <INDENT> with open('test/sanity/ansible-doc/skip.txt', 'r') as skip_fd: <NEW_LINE> <INDENT> skip_modules = set(skip_fd.read().splitlines()) <NEW_LINE> <DEDENT> modules = sorted(set(m for i in targe... | Sanity test for ansible-doc. | 62598f84be383301e02532af |
class Event(object): <NEW_LINE> <INDENT> def __init__(self, event_type, args): <NEW_LINE> <INDENT> self._type = event_type <NEW_LINE> self._args = args <NEW_LINE> <DEDENT> @property <NEW_LINE> def type(self): <NEW_LINE> <INDENT> return self._type <NEW_LINE> <DEDENT> @property <NEW_LINE> def args(self): <NEW_LINE> <INDE... | An event generated by the Assistant.
Attributes:
type(EventType): The type of event that was generated.
args(dict): Argument key/value pairs associated with this event. | 62598f8450485f2cf55daa28 |
class ApeMountPoint: <NEW_LINE> <INDENT> def __init__(self, smbfs_path, mount_point): <NEW_LINE> <INDENT> self._mount_point = mount_point <NEW_LINE> self._smbfs_path = smbfs_path <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> if self._smbfs_path is not None: <NEW_LINE> <INDENT> log.debug("Mounting %s to %... | Implements mount/umount for Python's with statement. | 62598f8426238365f5fac623 |
class CodeWriter: <NEW_LINE> <INDENT> def __init__(self, in_path, write_to_File_flag=True, counter=0): <NEW_LINE> <INDENT> self.all_commands = Parser(in_path).get_commands() <NEW_LINE> self.all_asm_commands = [] <NEW_LINE> self.file_name = os.path.basename(in_path).split(".")[0] <NEW_LINE> self.out_path = in_path.repla... | this class performs the translation of the vm file into a asm file | 62598f8471ff763f4b5e7223 |
class SecurityRuleListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[SecurityRule]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(SecurityRuleListResult, self).__init__(**kwargs) <... | Response for ListSecurityRule API service call. Retrieves all security rules that belongs to a network security group.
:param value: The security rules in a network security group.
:type value: list[~azure.mgmt.network.v2016_12_01.models.SecurityRule]
:param next_link: The URL to get the next set of results.
:type nex... | 62598f8429b78933be269e35 |
class Users(models.Model): <NEW_LINE> <INDENT> id = fields.IntField(pk=True) <NEW_LINE> username = fields.CharField(max_length=20, unique=True) <NEW_LINE> name = fields.CharField(max_length=50, null=True) <NEW_LINE> family_name = fields.CharField(max_length=50, null=True) <NEW_LINE> category = fields.CharField(max_leng... | The User model | 62598f840a366e3fb87dc483 |
class InferenceServiceCondition(object): <NEW_LINE> <INDENT> openapi_types = { 'last_transition_time': 'str', 'status': 'str', 'type': 'str' } <NEW_LINE> attribute_map = { 'last_transition_time': 'lastTransitionTime', 'status': 'status', 'type': 'type' } <NEW_LINE> def __init__(self, last_transition_time=None, status=N... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f84fb3f5b602db47f0b |
class Tcpdump(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://www.tcpdump.org/" <NEW_LINE> url = "https://www.tcpdump.org/release/tcpdump-4.9.3.tar.gz" <NEW_LINE> version('4.99.0', sha256='8cf2f17a9528774a7b41060323be8b73f76024f7778f59c34efa65d49d80b842') <NEW_LINE> version('4.9.3', sha256='2cd47cb3d46... | Tcpdump prints out a description of the contents of packets
on a network interface that match the Boolean expression;
the description is preceded by a time stamp, printed, by
default, as hours, minutes, seconds, and fractions of a
second since midnight. | 62598f8430c21e258be982c0 |
class GetApprovalStatusResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((xml) The response from Google AdSense.) | 62598f84cad5886f8bdc4ddc |
class ExpectedValidationTaskReducerTest(BaseCourseEnrollmentValidationTaskReducerTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(ExpectedValidationTaskReducerTest, self).setUp() <NEW_LINE> self.create_validation_task(expected_validation="2014-10-01T11") <NEW_LINE> <DEDENT> def test_no_events(self)... | Tests to verify that events before first validation event are properly skipped. | 62598f84097d151d1a2c0adb |
class PythonModulesComboBox(PathComboBox): <NEW_LINE> <INDENT> def __init__(self, parent, adjust_to_contents=False): <NEW_LINE> <INDENT> PathComboBox.__init__(self, parent, adjust_to_contents) <NEW_LINE> <DEDENT> def is_valid(self, qstr=None): <NEW_LINE> <INDENT> if qstr is None: <NEW_LINE> <INDENT> qstr = self.current... | QComboBox handling Python modules or packages path
(i.e. .py, .pyw files *and* directories containing __init__.py) | 62598f84d53ae8145f917f45 |
class IllegalTranslationFormatError( Error ): <NEW_LINE> <INDENT> pass | Exception for illegal translation formats. | 62598f84d4950a0f3b110b90 |
class Message(models.Model): <NEW_LINE> <INDENT> objects = MessageQuerySet.as_manager() <NEW_LINE> username = models.CharField(max_length=32) <NEW_LINE> message = models.CharField(max_length=512) <NEW_LINE> timestamp = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return ... | A model of a chat message, with a username, timestamp and a message. | 62598f84bde94217f37073c1 |
class GridMatrix(object): <NEW_LINE> <INDENT> def __init__(self, n_width:int, n_height:int, default_type:int = 0, default_reward:float = 0.0, default_value:float = 0.0 ): <NEW_LINE> <INDENT> self.grids = None <NEW_LINE> self.n_height = n_height <NEW_LINE> self.n_width = n_width <NEW_LINE> self.len = n_width * n_height ... | 格子矩阵,通过不同的设置,模拟不同的格子世界环境
| 62598f841d351010ab8f35f3 |
class CustomTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> shutil.rmtree(STAGE_PATH, ignore_errors=True) <NEW_LINE> shutil.copytree(PROJECT_PATH, STAGE_PATH, ignore=lambda folder, files: [folder] + list(filter(lambda name: '.ioc' not in name, files))) <NEW_LINE> <DEDENT> def tearD... | These pre- and post-tasks are common for all test cases | 62598f8496565a6dacd2ccd3 |
class GetWheelModeResponse(HiResWheel): <NEW_LINE> <INDENT> MSG_TYPE = TYPE.RESPONSE <NEW_LINE> REQUEST_LIST = (GetWheelMode) <NEW_LINE> FUNCTION_INDEX = 1 <NEW_LINE> VERSION = 0 <NEW_LINE> class FID(HiResWheel.FID): <NEW_LINE> <INDENT> WHEEL_MODE = 0xFA <NEW_LINE> PADDING = 0xF9 <NEW_LINE> <DEDENT> class LEN(Hi... | HiResWheel GetWheelMode response implementation class
Returns the current wheel mode about the device.
Format:
|| @b Name || @b Bit count ||
|| ReportID || 8 ||
|| DeviceIndex || 8 ||
|| FeatureIndex || 8 ||
|| FunctionID || 4 ... | 62598f8438b623060ffa8b4d |
class TensorBoardVersionSelector(object): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> use_v2 = should_use_v2() <NEW_LINE> start_cls = cls <NEW_LINE> cls = swap_class(start_cls, callbacks.TensorBoard, callbacks_v1.TensorBoard, use_v2) <NEW_LINE> if start_cls == callbacks_v1.TensorBoard and... | Chooses between Keras v1 and v2 TensorBoard callback class. | 62598f8430c21e258be982c1 |
class EdefIOTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.framework = pelix.framework.create_framework(['pelix.ipopo.core']) <NEW_LINE> self.framework.start() <NEW_LINE> context = self.framework.get_bundle_context() <NEW_LINE> svc_reg = context.register_service( "sample.spec", o... | Tests for the Remote Services EDEF I/O operations | 62598f84fbf16365ca793b60 |
@rfm.simple_test <NEW_LINE> class RRTMGPTest(rfm.RegressionTest): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.valid_systems = ['dom:gpu', 'daint:gpu'] <NEW_LINE> self.valid_prog_environs = ['PrgEnv-pgi'] <NEW_LINE> self.sourcesdir = os.path.join(self.current_system.resourcesdir, 'RRTMGP') <NEW_LINE... | This is an outdated PoC test for ICON-RRTMGP. | 62598f8407d97122c421675b |
class Statical(Population): <NEW_LINE> <INDENT> def initial_allocation(self,sim,app_name): <NEW_LINE> <INDENT> for ctrl in self.sink_control: <NEW_LINE> <INDENT> if "id" in ctrl.keys(): <NEW_LINE> <INDENT> module = ctrl["module"] <NEW_LINE> for idx in ctrl["id"]: <NEW_LINE> <INDENT> sim.deploy_sink(app_name, node=idx, ... | This implementation of a population algorithm statically assigns the generation of a source in a node of the topology. It is only invoked in the initialization.
Extends: :mod: Population | 62598f84d7e4931a7ef3bb52 |
class HighElvenSurname(Elven): <NEW_LINE> <INDENT> syllable_template = ('v', 'C', 'v') <NEW_LINE> syllable_weights = [1, 2, 2] <NEW_LINE> minimum_length = 2 <NEW_LINE> def word(self): <NEW_LINE> <INDENT> prefix = str(WordFactory(self)) <NEW_LINE> suffix = '' <NEW_LINE> while not self.validate_sequence(suffix): <NEW_LIN... | High Elven names follow the same naming conventions as more modern names, but ancient place names were longer, and
suffixes always followed a pattern of vowel, consonant, two vowels, and a final consonant, but the rules for
each are much more restrictive. In practice just a few suffixes are permitted: ieth, ies, ier, i... | 62598f844e696a045264db5d |
class Z_Dna_Atomistic_Generator(Z_Dna_Generator): <NEW_LINE> <INDENT> model = "PAM5" <NEW_LINE> def _strandAinfo(self, baseLetter, index): <NEW_LINE> <INDENT> thetaOffset = 0.0 <NEW_LINE> basename = basesDict[baseLetter]['Name'] <NEW_LINE> if (index & 1) != 0: <NEW_LINE> <INDENT> basename += "-outer" <NEW_LINE> z... | Provides an atomistic model of the Z form of DNA.
@attention: This class will never be implemented. | 62598f84b830903b9686e1cd |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.