code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class UserAdmin(LeafletGeoAdmin): <NEW_LINE> <INDENT> list_display = ('name', 'email', 'role', 'website', 'email_updates', 'last_login', 'is_confirmed', 'is_admin') <NEW_LINE> list_filter = ['role', 'is_confirmed', 'is_admin'] <NEW_LINE> search_fields = ['name', 'email'] <NEW_LINE> fieldsets = [ ('Basic Information', {...
Admin Class for User Model.
62598f8591af0d3eaad398c0
class PowerBar(QtWidgets.QWidget): <NEW_LINE> <INDENT> colorChanged = QtCore.pyqtSignal() <NEW_LINE> def __init__(self, steps=5, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> layout = QtWidgets.QVBoxLayout() <NEW_LINE> self._bar = _Bar(steps) <NEW_LINE> layout.addWidget(self._bar) <...
Custom Qt Widget to show a power bar and dial. Demonstrating compound and custom-drawn widget. Left-clicking the button shows the color-chooser, while right-clicking resets the color to None (no-color).
62598f857b25080760ed6f6b
class Transaction(Resource): <NEW_LINE> <INDENT> @jwt_required() <NEW_LINE> def post(self): <NEW_LINE> <INDENT> data = transaction_parser.parse_args() <NEW_LINE> from_user_id = data["from_user_id"] <NEW_LINE> to_user_id = data["to_user_id"] <NEW_LINE> amount = data["amount"] <NEW_LINE> if (current_user.id != from_user_...
Move currency from one account to another
62598f857c178a314d78cf70
class RandomHorizontalFlip(object): <NEW_LINE> <INDENT> def __init__(self, prob=0.5): <NEW_LINE> <INDENT> self.prob = prob <NEW_LINE> <DEDENT> def __call__(self, image, label): <NEW_LINE> <INDENT> if random.random() < self.prob: <NEW_LINE> <INDENT> image = image[:, ::-1].copy() <NEW_LINE> label = label[:, ::-1].copy() ...
Applies random flip augmentation. Arguments: prob: Probability of flip.
62598f85656771135c48913f
class SketchIntersectionCommand(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{B1C602D6-0DB3-453C-B516-7BCEBF7A82AD}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{4C896230-7F1A-11D2-8509-0000F875B9C6}', 10, 2)
Initializes a new IntersectionConstructor on the Editor.
62598f85d99f1b3c44d05173
class UserFavoriteAdmin(object): <NEW_LINE> <INDENT> list_display = ['user', 'fac_id', 'fav_type', 'add_time'] <NEW_LINE> search_fields = ['user', 'fac_id', 'fav_type'] <NEW_LINE> list_filter = ['user', 'fac_id', 'fav_type', 'add_time']
用户收藏管理
62598f858e71fb1e983bb580
class BuiltinFunction(SystemFunction): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwargs): <NEW_LINE> <INDENT> cls.__name__ = 'BUILTIN-FUNCTION' <NEW_LINE> return object.__new__(cls) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "#<BUILTIN-FUNCTION {0} {{{1:X}}}>".format(self.__class__.__name__,...
The Python interpreter has a number of functions and types built into it that are always available. They are listed here in alphabetical order. # abs delattr hash memoryview set # all dict help min setattr # any dir hex next slice # ascii...
62598f85a79ad16197769b26
class MoveMapblockJsFromLegacyToItsOwnBundle(UpgradeStep): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> if IS_PLONE_5: <NEW_LINE> <INDENT> self.install_upgrade_profile() <NEW_LINE> record = 'plone.bundles/plone-legacy.resources' <NEW_LINE> resources = api.portal.get_registry_record(record) <NEW_LINE> nam...
Move mapblock js from legacy to its own bundle.
62598f858e05c05ec3f6ebaa
class WinkLight(WinkDevice, Light): <NEW_LINE> <INDENT> @asyncio.coroutine <NEW_LINE> def async_added_to_hass(self): <NEW_LINE> <INDENT> self.hass.data[DOMAIN]['entities']['light'].append(self) <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_on(self): <NEW_LINE> <INDENT> return self.wink.state() <NEW_LINE> <DEDENT> @pr...
Representation of a Wink light.
62598f858a43f66fc4bf1c47
class CheckJunOSExamples(unittest.TestCase): <NEW_LINE> <INDENT> def testJunOSExamples(self): <NEW_LINE> <INDENT> examples = file(EXAMPLES_FILE).read().expandtabs().split('\n\n') <NEW_LINE> for i in range(0, 14, 2): <NEW_LINE> <INDENT> if examples[i+1].find('policer'): <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> x...
Test parsing of Junos ACLs
62598f8521bff66bcd722730
class IMemoryUsageThresholdExceeded(Interface): <NEW_LINE> <INDENT> mem_usage = Attribute("The current process memory usage, in bytes.") <NEW_LINE> max_allowed = Attribute("The maximum allowed memory usage, in bytes.") <NEW_LINE> memory_info = Attribute("The tuple of memory usage stats return by psutil.")
The event emitted when the memory usage threshold is exceeded. This event is emitted only while memory continues to grow above the threshold. Only if the condition or stabilized is corrected (memory usage drops) will the event be emitted in the future. This event is emitted in the monitor thread.
62598f85596a897236127738
class Observer(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def update(self, message: str) -> None: <NEW_LINE> <INDENT> pass
Абстрактный наблюдатель
62598f8566656f66f7d59ebb
class SW_evap_from_layer(flux_connection): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> _cmf_core.SW_evap_from_layer_swiginit(self, _cmf_cor...
Connection for Shuttleworth-Wallace ground evaporation. C++ includes: ShuttleworthWallace.h
62598f85cad5886f8bdc4dec
class Scraper(basic.BasicScraper): <NEW_LINE> <INDENT> SCRAPER_ID = __name__ <NEW_LINE> BASE_URL = "http://www.adultswim.com" <NEW_LINE> def scrape(self): <NEW_LINE> <INDENT> r = requests.get(self.BASE_URL + "/videos/") <NEW_LINE> bs = BeautifulSoup(r.text, "html.parser") <NEW_LINE> shows_raw = bs.find("script", text=r...
Basic Scraper for adultswim.com (USA).
62598f85925a0f43d25e7afa
class listDecks_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING,None), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProt...
Attributes: - success
62598f85097d151d1a2c0aeb
class DiagnosisHandler(object): <NEW_LINE> <INDENT> def query_omim(self, query=None, limit=None): <NEW_LINE> <INDENT> query_dict = {} <NEW_LINE> search_term = None <NEW_LINE> if query: <NEW_LINE> <INDENT> query_dict = { "$or": [ {"disease_nr": {"$regex": query, "$options": "i"}}, {"description": {"$regex": query, "$opt...
Class for handling OMIM and disease-related database objects
62598f8523e79379d538bfc1
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> model = get_user_model() <NEW_LINE> fields = ('email', 'password', 'name') <NEW_LINE> extra_kwargs = { 'password': {'write_only': True, 'min_length': 5} } <NEW_LINE> <DEDENT> def create(self, validated_data): ...
serializer for the user object
62598f85d99f1b3c44d05174
class Report_Seasonal(models.Model): <NEW_LINE> <INDENT> wban = models.ForeignKey(WBAN) <NEW_LINE> season = models.CharField(max_length=6) <NEW_LINE> temp_dry = models.IntegerField(null=True) <NEW_LINE> temp_dry_high = models.IntegerField(null=True) <NEW_LINE> temp_dry_low = models.IntegerField(null=True) <NEW_LINE> hu...
Report_Seasonal is an aggregation table containing seasonal report data for all WBANs.
62598f8576d4e153a661c6da
class omedian(): <NEW_LINE> <INDENT> def __init__(self, nLast=10): <NEW_LINE> <INDENT> self.values = collections.deque() <NEW_LINE> self.nLast = nLast <NEW_LINE> <DEDENT> def update(self, value): <NEW_LINE> <INDENT> self.values.append(value) <NEW_LINE> if len(self.values) > self.nLast: <NEW_LINE> <INDENT> self.values.p...
Returns the median of the last `nLast` values that were added ("online median"). >>> m = omedian(nLast=3) >>> m.update(3) 3 >>> m.update(7) 5.0 >>> m.update(4) 4 >>> m.update(45) 7 >>> m.update(2) 4 >>> m.update(3) 3
62598f85d99f1b3c44d05175
class _nbondxx(Keyword): <NEW_LINE> <INDENT> name = "nbondxx" <NEW_LINE> ptype = list <NEW_LINE> atype = "numbers"
nearest neighbor bond lengths (`optional`). Units: `&Aring;`. Returns: list: Nearest neighbors bond lengths of the relaxed structure per ordered set of species Ai,Aj greater than or equal to i.
62598f85e76e3b2f99fd84fd
class RegisterValidationView(TemplateView): <NEW_LINE> <INDENT> template_name = 'pages/register_validation_success.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> user = get_object_or_404(User, register_token=kwargs.get('token'), is_active=False) <NEW_LINE> user.is_active = True <NEW_LINE>...
View to valid the registration.
62598f8573bcbd0ca4bc9d18
class TestApiResponseOptionsUnusualActivity(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 testApiResponseOptionsUnusualActivity(self): <NEW_LINE> <INDENT> pass
ApiResponseOptionsUnusualActivity unit test stubs
62598f853eb6a72ae038a0fd
@provides(IRemoteShell) <NEW_LINE> class RemoteShellController(Client): <NEW_LINE> <INDENT> self_type = "python_editor" <NEW_LINE> other_type = "python_shell" <NEW_LINE> def run_file(self, path): <NEW_LINE> <INDENT> self.send_command('run_file', path) <NEW_LINE> <DEDENT> def run_text(self, text): <NEW_LINE> <INDENT> se...
A Client used to control a remote shell.
62598f8563b5f9789fe84c38
class DescribeAccountsResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TotalCount = None <NEW_LINE> self.AccountInfoSet = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TotalCount = params.get("TotalCount") <NEW...
DescribeAccounts返回参数结构体
62598f8571ff763f4b5e7235
class Jogo: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pygame.init() <NEW_LINE> self.tela = pygame.display.set_mode((800, 600), FULLSCREEN) <NEW_LINE> self.fim_jogo = False <NEW_LINE> self.som_tiro = pygame.mixer.Sound("dados/sons/laser.wav") <NEW_LINE> self.musica = pygame.mixer.Sound("dados/sons/cami...
Classe Jogo
62598f85d53ae8145f917f56
@gin.constants_from_enum <NEW_LINE> class TerminationReason(enum.IntEnum): <NEW_LINE> <INDENT> UNKNOWN = 0 <NEW_LINE> STEP_LIMIT = 1 <NEW_LINE> WALL_COLLISION = 2 <NEW_LINE> BAD_LOCATION = 3 <NEW_LINE> AGENT_COLLISION = 4 <NEW_LINE> GOAL_REACHED = 5 <NEW_LINE> INVALID_STEP_REVERT_AND_CONTINUE = 6 <NEW_LINE> INVALID_EPI...
Enum that identifies termination reasons of an episode. For any new termination reason added here, please update the corresponding termination reward files to make sure it is used properly.
62598f85cad5886f8bdc4ded
class TestOversleepThreadPlugin(PerDeviceTestPlugin): <NEW_LINE> <INDENT> offset = (SINE_LENGTH / 11) * 4 <NEW_LINE> @defer.inlineCallbacks <NEW_LINE> def collect(self, config): <NEW_LINE> <INDENT> def inner(): <NEW_LINE> <INDENT> time.sleep(self.cycletime * 2) <NEW_LINE> return self.get_data() <NEW_LINE> <DEDENT> r = ...
Plugin that sleeps for double cycletime in a thread.
62598f8582261d6c5272fc38
class Argument(ufl.Argument): <NEW_LINE> <INDENT> def __init__(self, V, index=None): <NEW_LINE> <INDENT> if not isinstance(V, FunctionSpaceBase): <NEW_LINE> <INDENT> if isinstance(V, ufl.FiniteElementBase): <NEW_LINE> <INDENT> raise TypeError(_ufl_dolfin_difference_message) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>...
UFL value: Representation of an argument to a form. This is the overloaded PyDOLFIN variant.
62598f85442bda511e95bf23
class Page(models.Model): <NEW_LINE> <INDENT> codex = models.ForeignKey( Codex, related_name="pages", unique_for_date="date", on_delete=models.CASCADE, null=False, editable=False, help_text=gettext("Codex of the page"), ) <NEW_LINE> date = models.DateField( "date", editable=False, null=False, help_text=gettext("Date of...
A page regroup all the information of a given day in a codex.
62598f85b7558d58954630fc
class CourseItem(Item): <NEW_LINE> <INDENT> code = Field() <NEW_LINE> language = Field() <NEW_LINE> title_en = Field() <NEW_LINE> title_da = Field() <NEW_LINE> evaluation_type = Field() <NEW_LINE> ects_credits = Field() <NEW_LINE> course_type = Field() <NEW_LINE> department = Field() <NEW_LINE> course_runs = Field() <N...
TODO
62598f85d53ae8145f917f57
class TestOrganizationHook(helper.UnitHelper): <NEW_LINE> <INDENT> described_class = OrganizationHook <NEW_LINE> example_data = hook_example_data <NEW_LINE> def test_str(self): <NEW_LINE> <INDENT> assert str(self.instance) == "<OrganizationHook [{0}]>".format( self.instance.name ) <NEW_LINE> <DEDENT> def test_delete(se...
Test methods on OrganizationHook class.
62598f85498bea3a75a575ec
@index.register(8) <NEW_LINE> class RcReferences(OptionHeader): <NEW_LINE> <INDENT> _attrname = 'rc_references' <NEW_LINE> rc_ref_pitch = int32_t <NEW_LINE> rc_ref_roll = int32_t <NEW_LINE> rc_ref_yaw = int32_t <NEW_LINE> rc_ref_gaz = int32_t <NEW_LINE> rc_ref_ag = int32_t
Corresponds to C struct ``navdata_rc_references_t``.
62598f8507d97122c421676d
class IntFieldDesc(typing.NamedTuple): <NEW_LINE> <INDENT> offset: int <NEW_LINE> width: int = 8 <NEW_LINE> endian: Endian = Endian.Native <NEW_LINE> bit: typing.Union[None, int, typing.Tuple[int, int]] = None <NEW_LINE> doc: typing.Optional[str] = None
Descriptor of integer field property
62598f85a4f1c619b294e0b6
class PostCacheViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = PostCache.objects.all() <NEW_LINE> serializer_class = PostCacheSerializer <NEW_LINE> filter_backends = (DjangoFilterBackend, filters.OrderingFilter) <NEW_LINE> filter_fields = ('author', 'permlink') <NEW_LINE> pagination_class = Tower...
retrieve: Return the post_cache object by id. list: Return a list of all blocks in the blockchain.
62598f854e696a045264db66
class Snphylo(Package): <NEW_LINE> <INDENT> homepage = "http://chibba.pgml.uga.edu/snphylo/" <NEW_LINE> url = "http://chibba.pgml.uga.edu/snphylo/snphylo.tar.gz" <NEW_LINE> version('2016-02-04', '467660814965bc9bed6c020c05c0d3a6') <NEW_LINE> depends_on('python', type=('build', 'run')) <NEW_LINE> depends_on('r', ty...
A pipeline to generate a phylogenetic tree from huge SNP data
62598f8573bcbd0ca4bc9d1a
class ReadGraphInputSet(InputSet): <NEW_LINE> <INDENT> def set_APIKey(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'APIKey', value) <NEW_LINE> <DEDENT> def set_Color(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Color', value) <NEW_LINE> <DEDENT> def set_DatastreamID(self, value): <NEW_LIN...
An InputSet with methods appropriate for specifying the inputs to the ReadGraph Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
62598f858e05c05ec3f6ebac
class SpecialPriceAdminForm(forms.ModelForm): <NEW_LINE> <INDENT> def clean(self): <NEW_LINE> <INDENT> return self.cleaned_data
Special price checks for admin form.
62598f8507f4c71912baef0c
class InferenceContext: <NEW_LINE> <INDENT> def __init__( self, vocab: List[str], sequence: List[int] = None, token_type: str = TokenType.PHONE, phone_dictionary_path: str = None, seed: int = 0, use_blank: bool = False, ): <NEW_LINE> <INDENT> self.seed = seed <NEW_LINE> self.sequence = sequence <NEW_LINE> if self.seque...
Basic configuration for the whole system
62598f85379a373c97d98adb
class MAVLink_set_home_position_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_SET_HOME_POSITION <NEW_LINE> name = 'SET_HOME_POSITION' <NEW_LINE> fieldnames = ['target_system', 'latitude', 'longitude', 'altitude', 'x', 'y', 'z', 'q', 'approach_x', 'approach_y', 'approach_z', 'time_usec'] <NEW_LINE> o...
The position the system will return to and land on. The position is set automatically by the system during the takeoff in case it was not explicitely set by the operator before or after. The global and local positions encode the position in the respective coordinate frames, while the q parameter encodes the orientation...
62598f8550485f2cf55daa3c
class AxisValueLocationStatement(Statement): <NEW_LINE> <INDENT> def __init__(self, tag, values, location=None): <NEW_LINE> <INDENT> Statement.__init__(self, location) <NEW_LINE> self.tag = tag <NEW_LINE> self.values = values <NEW_LINE> <DEDENT> def asFea(self, res=""): <NEW_LINE> <INDENT> res += f"location {self.tag} ...
A STAT table Axis Value Location Args: tag (str): a 4 letter axis tag values (list): a list of ints and/or floats
62598f85d6c5a102081e1c13
@dataclass <NEW_LINE> class TextArtifactValueType(EmbeddedArtifactValueType): <NEW_LINE> <INDENT> data: Optional[str] = field( default=None, metadata={ "type": "Element", "namespace": OCIL_2_NAMESPACE, "required": True, } )
The data model that holds text-based artifacts. :ivar data: The data element contains the text of an artifact that was provided as a text file or a block of text.
62598f8523e79379d538bfc4
class DnsPoliciesUpdateRequest(_messages.Message): <NEW_LINE> <INDENT> clientOperationId = _messages.StringField(1) <NEW_LINE> policy = _messages.StringField(2, required=True) <NEW_LINE> policyResource = _messages.MessageField('Policy', 3) <NEW_LINE> project = _messages.StringField(4, required=True)
A DnsPoliciesUpdateRequest object. Fields: clientOperationId: For mutating operation requests only. An optional identifier specified by the client. Must be unique for operation resources in the Operations collection. policy: User given friendly name of the policy addressed by this request. policyResource...
62598f851f5feb6acb1626fc
class Solution: <NEW_LINE> <INDENT> def reverse(self, head): <NEW_LINE> <INDENT> if head == None or head.next == None: <NEW_LINE> <INDENT> return head <NEW_LINE> <DEDENT> pointTo = None <NEW_LINE> while head != None and head.next != None: <NEW_LINE> <INDENT> Sec = head.next <NEW_LINE> nextHead = Sec.next <NEW_LINE> Sec...
@param head: n @return: The new head of reversed linked list.
62598f85b57a9660fecd1546
class Command(BaseCommand): <NEW_LINE> <INDENT> args = "<XLS file>" <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> if not args: <NEW_LINE> <INDENT> raise CommandError("No XLS file given.") <NEW_LINE> <DEDENT> validator = validators.Repository() <NEW_LINE> validator.validate(args[0]) <NEW_LINE> if va...
Import repositories from ICA Atom.
62598f8563d6d428bbee2282
@skip_if_typeguard <NEW_LINE> class TestCachingOverloadObjmode(TestCase): <NEW_LINE> <INDENT> _numba_parallel_test_ = False <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> warnings.simplefilter("error", errors.NumbaWarning) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> warnings.resetwarnings() <NEW_LINE> ...
Test caching of the use of overload implementations that use `with objmode`
62598f85f8510a7c17d7dedc
class FullTextNotAvailable(Exception): <NEW_LINE> <INDENT> pass
Raised when we cannot access the document text
62598f85d4950a0f3b110b9a
class CantileverBoundaryConditions(BoundaryConditions): <NEW_LINE> <INDENT> @property <NEW_LINE> def fixed_nodes(self): <NEW_LINE> <INDENT> ys = numpy.arange(self.nely + 1) <NEW_LINE> lefty_to_id = numpy.vectorize( lambda y: xy_to_id(0, y, self.nelx, self.nely)) <NEW_LINE> ids = lefty_to_id(ys) <NEW_LINE> fixed = numpy...
Boundary conditions for a cantilever.
62598f85bde94217f37073cb
class WorkerInvalidResults(Exception): <NEW_LINE> <INDENT> def __init__(self, p2pfunction, p2parguments, msg): <NEW_LINE> <INDENT> self.p2pfunction=p2pfunction <NEW_LINE> self.p2parguments=p2parguments <NEW_LINE> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"Function {self.p2pfuncti...
Exception raised when the results of executing a function do not respect the convention of this p2p framework. Which is to respect the declared keys as strings and their value datatypes
62598f85baa26c4b54d4ed7c
class getRecipeListByDeviceID_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRUCT, (RecipeInfo, RecipeInfo.thrift_spec), False), None, ), (1, TType.STRUCT, 'ex', (XKCommon.ttypes.HealthServiceException, XKCommon.ttypes.HealthServiceException.thrift_spec), None, ), ) <NEW_LINE> d...
Attributes: - success - ex
62598f8507d97122c421676e
@skip_on_cudasim('not supported on CUDASIM') <NEW_LINE> class TestDel(SerialMixin, unittest.TestCase): <NEW_LINE> <INDENT> @contextmanager <NEW_LINE> def check_ignored_exception(self, ctx): <NEW_LINE> <INDENT> with captured_stderr() as cap: <NEW_LINE> <INDENT> yield <NEW_LINE> ctx.deallocations.clear() <NEW_LINE> <DEDE...
Ensure resources are deleted properly without ignored exception.
62598f85d99f1b3c44d05179
class TimeZoneRule(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{1897B0EF-94DA-4037-8156-145D63CD480D}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{5E1F7BC3-67C5-4AEE-8EC6-C4B73AAC42ED}', 10, 2)
An object that represents a time zone dynamic adjustments rule.
62598f8573bcbd0ca4bc9d1c
class StatusViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Status.objects.all() <NEW_LINE> serializer_class = StatusSerializer
A simple ViewSet for viewing and editing accounts.
62598f85e64d504609df9116
class TestTrapezoid(): <NEW_LINE> <INDENT> def test_trapezoid(self): <NEW_LINE> <INDENT> y = np.arange(17) <NEW_LINE> assert_equal(trapezoid(y), 128) <NEW_LINE> assert_equal(trapezoid(y, dx=0.5), 64) <NEW_LINE> assert_equal(trapezoid(y, x=np.linspace(0, 4, 17)), 32) <NEW_LINE> y = np.arange(4) <NEW_LINE> x = 2**y <NEW_...
This function is tested in NumPy more extensive, just do some basic due diligence here.
62598f85462c4b4f79dbb4ce
class RowObject: <NEW_LINE> <INDENT> def __init__(self, section, ID, chara, rowtype, tag="", linetxt="", optxt="", cond=[], trig1=[], trig2=[], next=[], score="", setname=""): <NEW_LINE> <INDENT> self.rowID = ID <NEW_LINE> self.section = section <NEW_LINE> self.chara = chara <NEW_LINE> self.rowtype = rowtype <NEW_LINE>...
A row of dialogue
62598f8530dc7b766599f323
class SNMPv3Target(VapiStruct): <NEW_LINE> <INDENT> def __init__(self, type=None, sec_level=None, ip=None, port=None, user=None, ): <NEW_LINE> <INDENT> self.type = type <NEW_LINE> self.sec_level = sec_level <NEW_LINE> self.ip = ip <NEW_LINE> self.port = port <NEW_LINE> self.user = user <NEW_LINE> VapiStruct.__init__(se...
``Snmp.SNMPv3Target`` class Structure that defines an SNMP v3 inform or trap target. .. tip:: The arguments are used to initialize data attributes with the same names.
62598f85f7d966606f747ab3
class CreateQuoteView(CreateView): <NEW_LINE> <INDENT> model = Quote <NEW_LINE> form_class = CreateQuoteForm <NEW_LINE> template_name = "quotes/create_quote_form.html"
Create a new Quote object and store it in the database
62598f856fb2d068a7693b94
class ParameterPair(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> this = _engine_internal.new_ParameterPair(*args) <NEW_LINE> try: self.this.a...
Proxy of C++ std::pair<(std::string,nta::ParameterSpec)> class
62598f8550485f2cf55daa3e
class HSplit(Group): <NEW_LINE> <INDENT> layout = "split" <NEW_LINE> orientation = "horizontal"
A horizontal group with splitter bars to separate it from other groups.
62598f8566656f66f7d59ec1
class TestAsyncio(OpenTracingTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tracer = MockTracer(AsyncioScopeManager()) <NEW_LINE> self.loop = asyncio.get_event_loop() <NEW_LINE> self.client = Client(RequestHandler(self.tracer), self.loop) <NEW_LINE> <DEDENT> def test_two_callbacks(self): <NEW_...
There is only one instance of 'RequestHandler' per 'Client'. Methods of 'RequestHandler' are executed in different Tasks, and no Span propagation among them is done automatically. Therefore we cannot use current active span and activate span. So one issue here is setting correct parent span.
62598f850a366e3fb87dc499
class TestAddSubmissionTwoSourcesOneLanguage( TestAddSubmissionMixin, unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.task = self.add_task( submission_format=["source1.%l", "source2"], contest=self.contest) <NEW_LINE> self.session.commit() <NEW_LINE> <DEDENT>...
Tests for AddSubmission with one source with language and one not.
62598f85925a0f43d25e7b00
class ToDoList(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=150, blank=False) <NEW_LINE> description = models.TextField() <NEW_LINE> deadline = models.DateField() <NEW_LINE> created_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> updated_at = models.DateTimeField(auto_now=True) <NEW_LIN...
Class to represent the ToDoList Model
62598f858da39b475be02cb2
@test(groups=[GROUP, GROUP_START, GROUP_START_SIMPLE, 'dbaas.setup'], depends_on_groups=["services.initialize"]) <NEW_LINE> class InstanceSetup(object): <NEW_LINE> <INDENT> @before_class <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> reqs = Requirements(is_admin=True) <NEW_LINE> instance_info.admin_user = CONFIG.users...
Makes sure the client can hit the ReST service. This test also uses the API to find the flavor to use.
62598f85b7558d5895463100
class SizeRequiredError(FilesException): <NEW_LINE> <INDENT> code = 400 <NEW_LINE> description = 'Size of file must be provided.'
Error thrown if no size is provided.
62598f850383005118f6d1c7
class titleType(GeneratedsSuper): <NEW_LINE> <INDENT> subclass = None <NEW_LINE> superclass = None <NEW_LINE> def __init__(self, type_=None): <NEW_LINE> <INDENT> self.original_tagname_ = None <NEW_LINE> self.type_ = _cast(None, type_) <NEW_LINE> <DEDENT> def factory(*args_, **kwargs_): <NEW_LINE> <INDENT> if titleType....
Type for the abstract title element - used as a title element template.
62598f8507d97122c4216770
class GetUcdnDomainHttpCodeV2RequestSchema(schema.RequestSchema): <NEW_LINE> <INDENT> fields = { "Areacode": fields.Str(required=False, dump_to="Areacode"), "BeginTime": fields.Int(required=False, dump_to="BeginTime"), "DomainId": fields.List(fields.Str()), "EndTime": fields.Int(required=False, dump_to="EndTime"), "Lay...
GetUcdnDomainHttpCodeV2 - 获取域名状态码信息
62598f85a4f1c619b294e0b9
@api_rest.route('/simdata/list') <NEW_LINE> class SimData(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> req = Simulation.objects() <NEW_LINE> sims = [{'label':s.label, 'id':str(s.id)} for s in req] <NEW_LINE> return jsonify(sims)
Unsecure Resource Class: Inherit from Resource
62598f85a4f1c619b294e0ba
class _AIPSTable(object): <NEW_LINE> <INDENT> def __init__(self, data, name, version): <NEW_LINE> <INDENT> self._data = data <NEW_LINE> self._name = name <NEW_LINE> self._version = version <NEW_LINE> return <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return _AIPSTableMethod(self, name) <NEW_LIN...
This class describes a generic AIPS extension table.
62598f856e29344779b00131
class SingleOccurrenceForm(forms.ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kws): <NEW_LINE> <INDENT> if 'date' in kws: <NEW_LINE> <INDENT> date = kws.pop('date') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> date = None <NEW_LINE> <DEDENT> super(SingleOccurrenceForm,self).__init__(*args, **kws) <NEW_L...
A simple form for adding and updating single Occurrence attributes
62598f85e76e3b2f99fd8503
class RandomSubsetSampler(Sampler): <NEW_LINE> <INDENT> def __init__(self, data_source, subset_size): <NEW_LINE> <INDENT> self.data_source = data_source <NEW_LINE> self.subset_size = subset_size <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> shuffled_indices = torch.randperm(len(self.data_source)) <NEW_LIN...
Samples a random subset from the data of the given size Arguments: data_source (Dataset): dataset to sample from
62598f85a8ecb03325870ccd
class RFutileOptions(RPackage): <NEW_LINE> <INDENT> homepage = "https://cloud.r-project.org/package=futile.options" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/futile.options_1.0.0.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/futile.options" <NEW_LINE> version('1.0.1...
A scoped options management framework
62598f85a17c0f6771d5bd0f
class Client(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, identity): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.identity = identity <NEW_LINE> self.zmq_context = zmq.Context() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> num1, num2 = self.generate_numbers() <NEW_LINE> pri...
Represents an example client.
62598f8530dc7b766599f325
class ComparableArrayWrapper(object): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.unwrapped = value <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<katdal.%s { %r } at 0x%x>" % (self.__class__.__name__, self.unwrapped, id(self)) <NEW_LINE> <DEDENT> def __st...
Wrapper that improves comparison of array objects. This wrapper class has two main benefits: - It prevents sensor values that are NumPy ndarrays themselves (or array-like objects such as tuples and lists) from dissolving and losing their identity when they are assembled into an array. - It ensures that a...
62598f85b57a9660fecd1549
class QueueyException(Exception): <NEW_LINE> <INDENT> pass
Exception raised if queuey does not respond with a 200.
62598f85d10714528d69d99d
class IName(interfaces.IRMLDirectiveSignature): <NEW_LINE> <INDENT> id = attr.Text( title='Id', description='The id under which the value will be known.', required=True) <NEW_LINE> value = attr.Text( title='Value', description='The text that is displayed if the id is called.', required=True)
Defines a name for a string.
62598f85596a897236127740
class ItemDetailView(ListView): <NEW_LINE> <INDENT> model = SubItem <NEW_LINE> template_name = "items/item_detail.html" <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return SubItem.objects.filter(item__slug=self.kwargs["slug"]) <NEW_LINE> <DEDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> conte...
Galería de un item
62598f8523849d37ff850b8b
class CandidateAnswer: <NEW_LINE> <INDENT> def __init__(self, qid, answer_id, ground_truth, rank_score=None, confidence_score=None): <NEW_LINE> <INDENT> self.qid = qid <NEW_LINE> self.answer_id = answer_id <NEW_LINE> self.ground_truth = int(ground_truth) <NEW_LINE> self.rank_score = float(rank_score) <NEW_LINE> self.co...
Class defines a data structure to hold question id, ground truth, rank score, and confidence score for an answer. Implements a natural ordering based on answer id
62598f8582261d6c5272fc3b
class OpaqueKeyField(CreatorMixin, models.CharField): <NEW_LINE> <INDENT> description = "An OpaqueKey object, saved to the DB in the form of a string." <NEW_LINE> Empty = object() <NEW_LINE> KEY_CLASS = None <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if self.KEY_CLASS is None: <NEW_LINE> <INDEN...
A django field for storing OpaqueKeys. The baseclass will return the value from the database as a string, rather than an instance of an OpaqueKey, leaving the application to determine which key subtype to parse the string as. Subclasses must specify a KEY_CLASS attribute, in which case the field will use :meth:`from_...
62598f85fb3f5b602db47f17
class BlogUser(models.Model): <NEW_LINE> <INDENT> username = models.CharField(max_length=40) <NEW_LINE> full_name = models.CharField(max_length=50, null=True, blank=True) <NEW_LINE> site = models.URLField(null="True", blank=True) <NEW_LINE> password = models.CharField(max_length=20) <NEW_LINE> avatar = models.ImageFiel...
Account won't be necessarily for any more reason than giving comments on site
62598f85442bda511e95bf29
class askForCards_result(object): <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.STRUCT, 'success', (Poker, Poker.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not N...
Attributes: - success
62598f85f8510a7c17d7dede
class MutationVisitor(Visitor): <NEW_LINE> <INDENT> def __init__(self, occurrence, operator): <NEW_LINE> <INDENT> self.operator = operator <NEW_LINE> self._occurrence = occurrence <NEW_LINE> self._count = 0 <NEW_LINE> self._mutation_applied = False <NEW_LINE> <DEDENT> @property <NEW_LINE> def mutation_applied(self): <N...
Visitor that mutates a module with the specific occurrence of an operator. This will perform at most one mutation in a walk of an AST. If this performs a mutation as part of the walk, it will store the mutated node in the `mutant` attribute. If the walk does not result in any mutation, `mutant` will be `None`. Note t...
62598f85baa26c4b54d4ed80
class Checker(arcade.Sprite): <NEW_LINE> <INDENT> def __init__(self, color, scale): <NEW_LINE> <INDENT> if color == 1: <NEW_LINE> <INDENT> super().__init__(RED_CHECKER, scale=scale) <NEW_LINE> <DEDENT> if color == 0: <NEW_LINE> <INDENT> super().__init__(WHITE_CHECKER, scale=scale) <NEW_LINE> <DEDENT> self.is_selectable...
Checker is a sprite that represents the pieces used to play with ... Attributes ---------- place_back_to_origin() Methods ---------- place_back_to_origin() Puts checker back if user moves it to an invalid destination
62598f85b7558d5895463102
class RectangularRoom(object): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.clean = [] <NEW_LINE> <DEDENT> def cleanTileAtPosition(self, pos): <NEW_LINE> <INDENT> point = (int(pos.getX()), int(pos.getY())) <NEW_LINE> if poi...
A RectangularRoom represents a rectangular region containing clean or dirty tiles. A room has a width and a height and contains (width * height) tiles. At any particular time, each of these tiles is either clean or dirty.
62598f85d53ae8145f917f5d
class Pip( namedtuple( 'Pip', ('name', 'net_to', 'net_from', 'can_invert', 'is_directional', 'is_pseudo', 'is_pass_transistor', 'timing', 'backward_timing'))): <NEW_LINE> <INDENT> pass
Pip information. Attributes ---------- name : str Name of pip net_to : str Name of output tile wire when pip is unidirectional. net_from: str Name of input tile wire when pip is unidirectional. can_invert : bool Can this pip invert the signal. is_directional : bool True if this pip is unidirection...
62598f85bde94217f37073cd
class Hardware(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> GPIO.setmode(GPIO.BCM) <NEW_LINE> GPIO.setup(24, GPIO.OUT, initial=GPIO.HIGH) <NEW_LINE> GPIO.setup(25, GPIO.OUT, initial=GPIO.HIGH) <NEW_LINE> <DEDENT> def turn_lamp_off(self): <NEW_LINE> <INDENT> GPIO.output(24, True); <NEW_LINE> GPIO...
classdocs
62598f8507d97122c4216773
class EdgeNodeInstallerOnline(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ScriptName = None <NEW_LINE> self.ScriptDownloadUrl = None <NEW_LINE> self.Guide = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ScriptName = params.get("ScriptName") <NEW_L...
节点在线安装信息
62598f8530c21e258be982d9
class Direction(object): <NEW_LINE> <INDENT> DIRECTION_UNSPECIFIED = 0 <NEW_LINE> ASCENDING = 1 <NEW_LINE> DESCENDING = 2
A sort direction. Attributes: DIRECTION_UNSPECIFIED (int): Unspecified. ASCENDING (int): Ascending. DESCENDING (int): Descending.
62598f854e696a045264db69
class PullRequestContributionsByRepository(sgqlc.types.Type): <NEW_LINE> <INDENT> __schema__ = github_schema <NEW_LINE> __field_names__ = ('contributions', 'repository') <NEW_LINE> contributions = sgqlc.types.Field(sgqlc.types.non_null(CreatedPullRequestContributionConnection), graphql_name='contributions', args=sgqlc....
This aggregates pull requests opened by a user within one repository.
62598f85d99f1b3c44d0517d
class AuthRegisterUserTest(APITestCase): <NEW_LINE> <INDENT> def test_register_a_user_with_valid_data(self): <NEW_LINE> <INDENT> url = reverse( "auth-register", kwargs={"version": "v1"} ) <NEW_LINE> response = self.client.post( url, data=json.dumps({ "username": "new_user", "password": "new_pass", "email": "new_user@ma...
Tests for auth/register/ endpoint
62598f85d7e4931a7ef3bb6a
class CmdDeleteRouteTarget(Command): <NEW_LINE> <INDENT> def take_action(self, parsed_args): <NEW_LINE> <INDENT> self.app.stdout.write('MX Provisioner to del route target\n') <NEW_LINE> args_str = ' '.join(parsed_args[1:]) <NEW_LINE> sys.argv = parsed_args <NEW_LINE> sp = MxProvisionerDel(args_str)
Option to del route target to the MX router
62598f85a8ecb03325870ccf
class AllContentLanguageVocabulary(object): <NEW_LINE> <INDENT> implements(IVocabularyFactory) <NEW_LINE> def __call__(self, context): <NEW_LINE> <INDENT> context = getattr(context, 'context', context) <NEW_LINE> ltool = getToolByName(context, 'portal_languages') <NEW_LINE> gsm = getGlobalSiteManager() <NEW_LINE> util ...
Vocabulary factory for all content languages in the portal.
62598f85be383301e02532c9
class Motor(object): <NEW_LINE> <INDENT> def __init__(self, path, serialnum = None, check_fwver = True): <NEW_LINE> <INDENT> self.serialnum = serialnum <NEW_LINE> self.serial = serial.Serial(path, SERIAL_BAUD, timeout=0.1) <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> with self.lock: <NEW_LINE> <INDENT> self.seria...
A motor
62598f8507f4c71912baef12
class Style(object): <NEW_LINE> <INDENT> name_path = XPath('./w:name[@w:val]') <NEW_LINE> based_on_path = XPath('./w:basedOn[@w:val]') <NEW_LINE> def __init__(self, elem): <NEW_LINE> <INDENT> self.resolved = False <NEW_LINE> self.style_id = get(elem, 'w:styleId') <NEW_LINE> self.style_type = get(elem, 'w:type') <NEW_LI...
Class representing a <w:style> element. Can contain block, character, etc. styles.
62598f851d351010ab8f360b
class NoData(Exception): <NEW_LINE> <INDENT> pass
Erro para quando o request com bs4 ainda não tiver sido efetuado
62598f8530dc7b766599f327
class InputValueWrapper( ToolParameterValueWrapper ): <NEW_LINE> <INDENT> def __init__( self, input, value, other_values={} ): <NEW_LINE> <INDENT> self.input = input <NEW_LINE> self.value = value <NEW_LINE> self._other_values = other_values <NEW_LINE> <DEDENT> def __str__( self ): <NEW_LINE> <INDENT> return self.input....
Wraps an input so that __str__ gives the "param_dict" representation.
62598f8573bcbd0ca4bc9d21
class GradientCustomGui(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def GetGradient(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def SetGradient(self, *args, **kwargs): <NEW_LINE> <INDENT> pass
Gradient gadget - Dialog element.
62598f85c432627299fa2a9f
class ConvolutionalLayer(Sequence, Initializable): <NEW_LINE> <INDENT> @lazy <NEW_LINE> def __init__(self, activation, filter_size, num_filters, pooling_size, num_channels, conv_step=(1, 1), pooling_step=None, batch_size=None, image_size=None, border_mode='valid', **kwargs): <NEW_LINE> <INDENT> self.convolution = Convo...
A complete convolutional layer: Convolution, nonlinearity, pooling. .. todo:: Mean pooling. Parameters ---------- activation : :class:`.BoundApplication` The application method to apply in the detector stage (i.e. the nonlinearity before pooling. Needed for ``__init__``. See :class:`Convolutional` and :c...
62598f8563b5f9789fe84c40
class FleetCommanderClientDbusClient: <NEW_LINE> <INDENT> DEFAULT_BUS = dbus.SessionBus <NEW_LINE> CONNECTION_TIMEOUT = 2 <NEW_LINE> def __init__(self, bus=None): <NEW_LINE> <INDENT> if bus is None: <NEW_LINE> <INDENT> bus = self.DEFAULT_BUS() <NEW_LINE> <DEDENT> self.bus = bus <NEW_LINE> t = time.time() <NEW_LINE> whi...
Fleet commander client dbus client
62598f85b5575c28eb712a2f
class HomePageRedirectHandler(base.BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> if self.user_id and user_services.has_fully_registered(self.user_id): <NEW_LINE> <INDENT> self.redirect(feconf.DASHBOARD_URL) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.redirect(feconf.SPLASH_URL)
When a request is made to '/', check the user's login status, and redirect them appropriately.
62598f8582261d6c5272fc3c
class Deployer: <NEW_LINE> <INDENT> def __init__(self, provider, account): <NEW_LINE> <INDENT> self.__provider = provider <NEW_LINE> self.__w3 = Web3(provider) <NEW_LINE> self.__w3.eth.defaultAccount = account.address <NEW_LINE> self.__acct = account <NEW_LINE> <DEDENT> def deploy(self, network_addr): <NEW_LINE> <INDEN...
Deployer is used for deploying new KyberNetwork reserve contracts.
62598f856aa9bd52df0d49ac
class Resource(AttrMap): <NEW_LINE> <INDENT> def __init__(self, name=None, **fields): <NEW_LINE> <INDENT> global NEXT_RESOURCE_NUM <NEW_LINE> if name is not None: <NEW_LINE> <INDENT> fields["name"] = name <NEW_LINE> <DEDENT> if "name" not in fields: <NEW_LINE> <INDENT> fields["name"] = "resource-%d" % NEXT_RESOURCE_NUM...
A Resource gives information on how to access some dataset under analysis (such as a file), along with any optional metadata meaningful to the user. The only required attribute for a resource is `name`. If `name` is not specified when the Resource is defined, one is automatically generated. The `tags` attribute, if i...
62598f85d99f1b3c44d0517e