code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Cleverbot: <NEW_LINE> <INDENT> def __init__(self, api_key: str, session: aiohttp.ClientSession = None, context: DictContext = None): <NEW_LINE> <INDENT> self.context = context or None <NEW_LINE> self.session = session or None <NEW_LINE> self.api_key = api_key <NEW_LINE> self.api_url = "https://public-api.travitia...
The client to use for API interactions.
62599044711fe17d825e1622
class Property: <NEW_LINE> <INDENT> def __init__(self, square_feet='', beds='',baths='',**kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.square_feet = square_feet <NEW_LINE> self.num_bedrooms = beds <NEW_LINE> self.num_baths = baths <NEW_LINE> <DEDENT> def display(self): <NEW_LINE> <INDENT> pri...
Class which show property.
62599044d99f1b3c44d069a9
class MaterialFile(models.Model): <NEW_LINE> <INDENT> def _get_file_path(self, filename): <NEW_LINE> <INDENT> request = get_request() <NEW_LINE> if not request: <NEW_LINE> <INDENT> user = User.objects.get(pk=1) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> user = request.user <NEW_LINE> <DEDENT> path = os.path.join(MAT...
A Model for material raw file.
62599044287bf620b6272ef1
class UploadImage(BaseModel): <NEW_LINE> <INDENT> def __init__(self, user_id, new_url): <NEW_LINE> <INDENT> super().__init__('User', 'users') <NEW_LINE> self.user_id = user_id <NEW_LINE> self.new_url = new_url <NEW_LINE> <DEDENT> def updateimage(self): <NEW_LINE> <INDENT> return super().edit('passport_url', self.new_ur...
contains methods for uploading an image
6259904476d4e153a661dbfa
class Schedule(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, primary_key=True) <NEW_LINE> start = models.DateField() <NEW_LINE> end = models.DateField() <NEW_LINE> next_run = models.DateTimeField() <NEW_LINE> repeat = models.CharField(max_length=20, choices=REPEAT_CHOICES) <NEW_LINE...
model to store user email delivery schedule Fields descriptions: next_run -- the next time scheduled events should be executed repeat -- when to repeat sending (start + repeat = next_run) periods -- what periods should be included in report
6259904421a7993f00c67273
class SMArtConnectDataStore(SessionDataStore): <NEW_LINE> <INDENT> def _get_chrome_app(self, consumer_key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return models.MachineApp.objects.get(consumer_key=consumer_key, app_type='chrome') <NEW_LINE> <DEDENT> except models.MachineApp.DoesNotExist: <NEW_LINE> <INDENT> retur...
Hybrid datastore that looks for * a chrome app consumer * a smart connect access token.
6259904491af0d3eaad3b12f
class ExponentialBackoff: <NEW_LINE> <INDENT> def __init__(self, base=1, *, integral=False): <NEW_LINE> <INDENT> self._base = base <NEW_LINE> self._exp = 0 <NEW_LINE> self._max = 10 <NEW_LINE> self._reset_time = base * 2**11 <NEW_LINE> self._last_invocation = time.monotonic() <NEW_LINE> rand = random.Random() <NEW_LINE...
An implementation of the exponential backoff algorithm Provides a convenient interface to implement an exponential backoff for reconnecting or retrying transmissions in a distributed network. Once instantiated, the delay method will return the next interval to wait for when retrying a connection or transmission. The...
625990446e29344779b0195d
class SanscriptTestCase(TestCase): <NEW_LINE> <INDENT> roman = {S.HK, S.IAST, S.SLP1} <NEW_LINE> brahmic = {x for x in S.SCHEMES} - roman <NEW_LINE> def compare_all(self, _from, _to): <NEW_LINE> <INDENT> for group in DATA[_from]: <NEW_LINE> <INDENT> if _to in DATA and group in DATA[_to]: <NEW_LINE> <INDENT> self.compar...
Ordinary :class:`~unittest.TestCase` with some helper data.
6259904450485f2cf55dc291
class ProxyWithoutSlashTestCase(JSONRPCTestCase): <NEW_LINE> <INDENT> def proxy(self): <NEW_LINE> <INDENT> return jsonrpc.Proxy("http://127.0.0.1:%d" % self.port)
Test with proxy that doesn't add a slash.
625990443c8af77a43b688c2
class DeleteReadingOnlySanction(MemberSanctionState): <NEW_LINE> <INDENT> def get_type(self): <NEW_LINE> <INDENT> return _(u"Autorisation d'écrire") <NEW_LINE> <DEDENT> def get_text(self): <NEW_LINE> <INDENT> return self.array_infos.get('unls-text', '') <NEW_LINE> <DEDENT> def get_detail(self): <NEW_LINE> <INDENT> retu...
State of the un-sanction reading only.
62599044cad5886f8bdc5a03
class RxPktPerPort(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> logging.info("Running RxPktPerPort test") <NEW_LINE> of_ports = config["port_map"].keys() <NEW_LINE> of_ports.sort() <NEW_LINE> self.assertTrue(len(of_ports) > 1, "Not enough ports for test") <NEW_LINE> delete_all...
Verify that rx_packets counter in the Port_Stats reply increments when packets are received on a port
62599044b57a9660fecd2d88
class LutAsShiftReg(Unit): <NEW_LINE> <INDENT> def _config(self) -> None: <NEW_LINE> <INDENT> self.DATA_WIDTH = Param(1) <NEW_LINE> self.ITEMS = Param(16) <NEW_LINE> self.INIT = Param(None) <NEW_LINE> <DEDENT> def _declr(self) -> None: <NEW_LINE> <INDENT> self.clk = Clk() <NEW_LINE> self.d_in = VldSynced() <NEW_LINE> s...
This components generates SRL16E and other shift registers. In order to allow Xilinx Vivado 2020.2 (and possibly any other version) to map this component into SRL16E and equivalents we need to satisfy several conditions: 1. the memory must not have reset 2. the shift expressions must be performed on a single signal 3....
6259904466673b3332c31705
class HelloApiView(APIView): <NEW_LINE> <INDENT> serializer_class = serializers.HelloSerializer <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> an_apiview = [ 'Uses HTTP methods as function (get, post, patch, put, delete)', 'It is similar to traditional django view', 'Gives you the most control over...
Test API View
625990440fa83653e46f61e6
class Record: <NEW_LINE> <INDENT> def __init__(self, filepath, creation_time, duration): <NEW_LINE> <INDENT> self.filepath = filepath <NEW_LINE> self.creation_time = creation_time <NEW_LINE> self.duration = duration <NEW_LINE> self.finish_time = creation_time + duration <NEW_LINE> <DEDENT> def overlap_with(self, record...
Util struct for working with record data.
62599044d53ae8145f91976a
class Npc(object): <NEW_LINE> <INDENT> def __init__(self, image_name, x, y, message_1, message_2, name): <NEW_LINE> <INDENT> super(Npc, self).__init__() <NEW_LINE> self.image_name = image_name <NEW_LINE> self.image = pygame.image.load(image_name).convert_alpha() <NEW_LINE> self.image = pygame.transform.scale(self.image...
docstring for Npc
625990446fece00bbaccccbf
class OAuthCodeExchangeHandler(OAuthBaseRequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> code = self.request.get('code') <NEW_LINE> if not code: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> oauth_flow = self.create_oauth_flow() <NEW_LINE> try: <NEW_LINE> <INDENT> creds = oauth_flow.step2_e...
Request handler for OAuth 2.0 code exchange.
62599044d99f1b3c44d069aa
class Tag( DictSchema ): <NEW_LINE> <INDENT> id = Int64Schema <NEW_LINE> name = StrSchema <NEW_LINE> def __new__( cls, *args: typing.Union[dict, frozendict, ], id: typing.Union[id, Unset] = unset, name: typing.Union[name, Unset] = unset, _configuration: typing.Optional[Configuration] = None, **kwargs: typing.Type[Schem...
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
6259904415baa7234946329e
class WinShiftLoseStay(MemoryOnePlayer): <NEW_LINE> <INDENT> name = 'Win-Shift Lose-Stay' <NEW_LINE> classifier = { 'memory_depth': 1, 'stochastic': False, 'makes_use_of': set(), 'long_run_time': False, 'inspects_source': False, 'manipulates_source': False, 'manipulates_state': False } <NEW_LINE> @init_args <NEW_LINE> ...
Win-Shift Lose-Stay, also called Reverse Pavlov. For reference see: "Engineering Design of Strategies for Winning Iterated Prisoner's Dilemma Competitions" by Jiawei Li, Philip Hingston, and Graham Kendall. IEEE TRANSACTIONS ON COMPUTATIONAL INTELLIGENCE AND AI IN GAMES, VOL. 3, NO. 4, DECEMBER 2011
6259904473bcbd0ca4bcb598
class RunTable(OrgObjPermsMixin, SmartReadView): <NEW_LINE> <INDENT> paginate_by = 100 <NEW_LINE> def get_context_data(self, *args, **kwargs): <NEW_LINE> <INDENT> context = super(FlowCRUDL.RunTable, self).get_context_data(*args, **kwargs) <NEW_LINE> flow = self.get_object() <NEW_LINE> org = self.derive_org() <NEW_LINE>...
Intercooler helper which renders rows of runs to be embedded in an existing table with infinite scrolling
6259904415baa7234946329f
class RegSet(set): <NEW_LINE> <INDENT> def add(self, reg): <NEW_LINE> <INDENT> set.add(self, Register(reg.reg))
Discards swizzle, negate and absolute value modifiers to considder register uniqueness
62599044d7e4931a7ef3d383
class VolumeQuotasClientJSON(BaseVolumeQuotasClientJSON): <NEW_LINE> <INDENT> pass
Client class to send CRUD Volume Type API V1 requests to a Cinder endpoint
625990443eb6a72ae038b96e
class StudyDeviceSettingsCollection( DatabaseCollection ): <NEW_LINE> <INDENT> OBJTYPE = StudyDeviceSettings
The per-study device settings.
62599044e64d504609df9d57
class GroupsError(Exception): <NEW_LINE> <INDENT> pass
Generic exception wrapped around any response from the Groups server.
625990444e696a045264e7a7
class Solution: <NEW_LINE> <INDENT> def sortColors(self, nums): <NEW_LINE> <INDENT> start = i = 0 <NEW_LINE> end = len(nums) - 1 <NEW_LINE> while i <= end: <NEW_LINE> <INDENT> if nums[i] == 0: <NEW_LINE> <INDENT> nums[i], nums[start] = nums[start], nums[i] <NEW_LINE> i += 1 <NEW_LINE> start += 1 <NEW_LINE> <DEDENT> eli...
@param nums: A list of integer which is 0, 1 or 2 @return: nothing
625990441f5feb6acb163f01
class HistStack(object): <NEW_LINE> <INDENT> def __init__(self, hists=None, title=None, xlabel=None, ylabel=None): <NEW_LINE> <INDENT> self.hists = [] <NEW_LINE> self.kwargs = [] <NEW_LINE> self.title = title <NEW_LINE> self.xlabel = xlabel <NEW_LINE> self.ylabel = ylabel <NEW_LINE> if hists: <NEW_LINE> <INDENT> for ...
A container to hold Hist objects for plotting together. When plotting, the title and the x and y labels of the last Hist added will be used unless specified otherwise in the constructor.
62599044cad5886f8bdc5a04
class AbstractMelonOrder(object): <NEW_LINE> <INDENT> def __init__(self, species, qty, melon_type, country_code=None): <NEW_LINE> <INDENT> self.species = species <NEW_LINE> self.qty = qty <NEW_LINE> self.shipped = False <NEW_LINE> self.type = melon_type <NEW_LINE> self.country_code = country_code <NEW_LINE> <DEDENT> de...
Super class for all melon types
62599044498bea3a75a58e2a
class TableBreadcrumb(ViewBreadcrumb): <NEW_LINE> <INDENT> grok.adapts( icemac.addressbook.browser.table.Table, icemac.addressbook.browser.interfaces.IAddressBookLayer)
View for views based on the `Table` class and its subclasses.
625990448e71fb1e983bcddc
class NodeAttribute(NameParsed): <NEW_LINE> <INDENT> _parser = AttributeNameParser <NEW_LINE> _accepts = ('MayaNodePath', 'AttrSep', 'AttributePath') <NEW_LINE> @property <NEW_LINE> def parts(self): <NEW_LINE> <INDENT> return self.sub <NEW_LINE> <DEDENT> @property <NEW_LINE> def separator(self): <NEW_LINE> <INDENT> ret...
The name of a Maya node and attribute (plug): a MayaNodePath followed by a AttrSep and a AttributePath Rule : NodeAttribute = `MayaNodePath` `AttrSep` `AttributePath` Composed Of: `MayaNodePath`, `AttrSep`, `AttributePath` Component Of: `MayaObjectName` >>> nodeAttr = NodeAttribute( 'persp|perspSha...
625990440fa83653e46f61e8
class res_partner_loan(orm.Model): <NEW_LINE> <INDENT> _name = 'res.partner' <NEW_LINE> _inherit = 'res.partner' <NEW_LINE> _columns = { 'followup_ids': fields.one2many('res.partner.followup', 'partner_id', 'Followup'), }
Add extra relation to partner obj
62599044711fe17d825e1624
class CellsConsoleauthTestCase(ConsoleauthTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(CellsConsoleauthTestCase, self).setUp() <NEW_LINE> self.flags(enable=True, group='cells') <NEW_LINE> self.is_cells = True <NEW_LINE> <DEDENT> def _stub_validate_console_port(self, result): <NEW_LINE> <IND...
Test Case for consoleauth w/ cells enabled.
625990440a366e3fb87ddcf3
class BadCounterName(ActionError): <NEW_LINE> <INDENT> pass
Raised when a counter name is invalid.
6259904410dbd63aa1c71ee7
class Opaque(Compound): <NEW_LINE> <INDENT> fields=('data','otype') <NEW_LINE> __metaclass__=MetaClass <NEW_LINE> def getImage(self): <NEW_LINE> <INDENT> import Image <NEW_LINE> from StringIO import StringIO <NEW_LINE> return Image.open(StringIO(makeData(self.getData()).data().data)) <NEW_LINE> <DEDENT> def fromFile(fi...
An Opaque object containing a binary uint8 array and a string identifying the type.
6259904476d4e153a661dbfc
class ScriptExecutionParameter(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } <NEW_LINE> _subtype_map = { 'type': {'Credential': 'PS...
The arguments passed in to the execution. You probably want to use the sub-classes and not this class directly. Known sub-classes are: PSCredentialExecutionParameter, ScriptSecureStringExecutionParameter, ScriptStringExecutionParameter. All required parameters must be populated in order to send to Azure. :param name...
625990441d351010ab8f4e2d
class SimplePostsCache(object): <NEW_LINE> <INDENT> def __init__(self, refresh_rate=_1_MINUTE): <NEW_LINE> <INDENT> self.cache = {cat_id : list() for cat_name, cat_id in categories.items()} <NEW_LINE> self.refresh_rate = refresh_rate <NEW_LINE> self.last_refresh = {cat_id : datetime.now() for cat_name, cat_id in catego...
Seconds
6259904423849d37ff8523c9
@expand_message_class <NEW_LINE> class CredGetList(AdminHolderMessage): <NEW_LINE> <INDENT> message_type = "credentials-get-list" <NEW_LINE> class Fields: <NEW_LINE> <INDENT> paginate = fields.Nested( Paginate.Schema, required=False, data_key="~paginate", missing=Paginate(limit=10, offset=0), description="Pagination de...
Credential list retrieval message.
62599044507cdc57c63a60ab
class SearchDocument(PolyModel): <NEW_LINE> <INDENT> def deleteDocument(self, doc_id): <NEW_LINE> <INDENT> index = search.Index(name=self.index_name) <NEW_LINE> index.delete(doc_id) <NEW_LINE> <DEDENT> def processDocuments(self, documents): <NEW_LINE> <INDENT> entities = [doc.fields for doc in documents] <NEW_LINE> doc...
Search's model.
62599044a8ecb0332587251f
class Authentications(BaseResource): <NEW_LINE> <INDENT> RESOURCE_NAME = 'authentications' <NEW_LINE> def create(self, data): <NEW_LINE> <INDENT> return self._request('POST', self.uri(), data)
The authentications resource. This resource is used to authenticate actions taken by users, such as displaying an authenticated light box.
6259904473bcbd0ca4bcb59b
class TestAddStock(unittest.TestCase): <NEW_LINE> <INDENT> def test_default(self): <NEW_LINE> <INDENT> stocks = [TEA, ] <NEW_LINE> result = add_stock(stocks, POP) <NEW_LINE> self.assertEqual(2, len(result)) <NEW_LINE> self.assertEqual(1, len(stocks)) <NEW_LINE> <DEDENT> def test_args(self): <NEW_LINE> <INDENT> self.ass...
Tests for the `add_stock` function.
62599044d7e4931a7ef3d385
class V1ClientIPConfig(object): <NEW_LINE> <INDENT> swagger_types = { 'timeout_seconds': 'int' } <NEW_LINE> attribute_map = { 'timeout_seconds': 'timeoutSeconds' } <NEW_LINE> def __init__(self, timeout_seconds=None): <NEW_LINE> <INDENT> self._timeout_seconds = None <NEW_LINE> self.discriminator = None <NEW_LINE> if tim...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
625990444e696a045264e7a8
class ZombieApp(): <NEW_LINE> <INDENT> WEAPONS_PATH = "../resources/weapons.json" <NEW_LINE> IN_ENCOUNTERS_PATH = "../resources/in_encounters.json" <NEW_LINE> OUT_ENCOUNTERS_PATH = "../resources/out_encounters.json" <NEW_LINE> FOOD_PATH = "../resources/food.json" <NEW_LINE> GAS_PATH = "../resources/gas.json" <NEW_LINE>...
An object to perform the application logic when requested.
6259904407d97122c4217faf
class LevelAdminForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Level <NEW_LINE> <DEDENT> def clean_unlock_condition(self): <NEW_LINE> <INDENT> data = self.cleaned_data["unlock_condition"] <NEW_LINE> utils.validate_form_predicates(data) <NEW_LINE> return data
admin form
62599044a4f1c619b294f80f
class LvMama(object): <NEW_LINE> <INDENT> def __init__(self, hot_base_url, new_base_url): <NEW_LINE> <INDENT> self.hot_base_url = hot_base_url <NEW_LINE> self.new_base_url = new_base_url <NEW_LINE> self.base_urls = [self.hot_base_url, self.new_base_url] <NEW_LINE> self.file = open("/Users/zhangjintao/Desktop/lvmama.txt...
获得驴妈妈问答的所有问题及分类 parse:解析数据 response:请求数据返回的对象 save:储存信息 run:启动程序
625990448e71fb1e983bcdde
class ContactList(list): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ContactList, self).__init__(*args, **kwargs) <NEW_LINE> self.__setstate__(None) <NEW_LINE> <DEDENT> @property <NEW_LINE> def core(self): <NEW_LINE> <INDENT> return getattr(self, '_core', lambda: fakeItchat)() or ...
when a dict is append, init function will be called to format that dict
625990448e05c05ec3f6f7e2
@dataclass <NEW_LINE> class Size(): <NEW_LINE> <INDENT> width: int <NEW_LINE> height: int <NEW_LINE> aspect_ratio: float = field(init=False, repr=False) <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> self.aspect_ratio = float(self.width) / float(self.height)
Holds a size
625990448a43f66fc4bf34a2
class Wings(object): <NEW_LINE> <INDENT> def __init__(self,color,win): <NEW_LINE> <INDENT> self.color = color <NEW_LINE> self.buildWings(win) <NEW_LINE> <DEDENT> def buildWings(self,win): <NEW_LINE> <INDENT> wingP1 = Rectangle(Point(400, 325), Point(50, 350)) <NEW_LINE> wingTip = Arc(Point(75,325),Point(25,350), 90, 17...
Allows the plane to fly.
62599044711fe17d825e1625
class CollectionDetail(APIView): <NEW_LINE> <INDENT> queryset = Collection.objects.all() <NEW_LINE> permission_classes = (permissions.IsAuthenticated, IsOwner,) <NEW_LINE> def get(self, request, slug): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user_collection = self.queryset.get( owner=request.user, slug=slug ) <NEW...
View details of one Collection, update or delete it.
6259904463b5f9789fe8647c
class SelectHostVersion(pyblish.api.ContextPlugin): <NEW_LINE> <INDENT> order = pyblish.api.CollectorOrder <NEW_LINE> hosts = ["nuke"] <NEW_LINE> def process(self, context): <NEW_LINE> <INDENT> import pyblish.api <NEW_LINE> context.data["host"] = pyblish.api.current_host()
Inject the host into context
6259904471ff763f4b5e8ab1
class WindowsInfoCollector(InfoCollector): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(WindowsInfoCollector, self).__init__() <NEW_LINE> self._config = infection_monkey.config.WormConfiguration <NEW_LINE> <DEDENT> def get_info(self): <NEW_LINE> <INDENT> logger.debug("Running Windows collector") <N...
System information collecting module for Windows operating systems
6259904494891a1f408ba07e
class Fixture(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def populate(): <NEW_LINE> <INDENT> pass
Class contains populate method as static method Is used by django-swagger-utils as a management command
6259904496565a6dacd2d912
class Cdf(_Distribution): <NEW_LINE> <INDENT> def __init__(self, spec, randomstream=None): <NEW_LINE> <INDENT> self._x = [] <NEW_LINE> self._cum = [] <NEW_LINE> if randomstream is None: <NEW_LINE> <INDENT> self.randomstream = random <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> assert isinstance(randomstream, random.Ra...
Cumulative distribution function Cdf(spec,seed) Parameters ---------- spec : list or tuple list with x-values and corresponding cumulative density (x1,c1,x2,c2, ...xn,cn) |n| Requirements: x1<=x2<= ...<=xn |n| c1<=c2<=cn |n| c1=0 |n| cn>0 |n| all cumulative densiti...
62599044b5575c28eb713651
class CreateMonitoredItemsResponse(FrozenClass): <NEW_LINE> <INDENT> ua_types = [ ('TypeId', 'NodeId'), ('ResponseHeader', 'ResponseHeader'), ('Results', 'ListOfMonitoredItemCreateResult'), ('DiagnosticInfos', 'ListOfDiagnosticInfo'), ] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.TypeId = FourByteNodeId(Obj...
:ivar TypeId: :vartype TypeId: NodeId :ivar ResponseHeader: :vartype ResponseHeader: ResponseHeader :ivar Results: :vartype Results: MonitoredItemCreateResult :ivar DiagnosticInfos: :vartype DiagnosticInfos: DiagnosticInfo
625990441d351010ab8f4e2f
class TNRMv3ManifestParser(TNRMv3RequestParser): <NEW_LINE> <INDENT> def __init__(self, from_file=None, from_string=None): <NEW_LINE> <INDENT> super(TNRMv3ManifestParser, self).__init__(from_file, from_string) <NEW_LINE> <DEDENT> def get_links(self, rspec): <NEW_LINE> <INDENT> tn_links = [] <NEW_LINE> for l in rspec.fi...
Manifest parser inherits from request parser as they use basically the same structure
625990443eb6a72ae038b971
class Coinhsl(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://www.hsl.rl.ac.uk/ipopt/" <NEW_LINE> url = "file://{0}/coinhsl-archive-2014.01.17.tar.gz".format(os.getcwd()) <NEW_LINE> version('2015.06.23', sha256='3e955a2072f669b8f357ae746531b37aea921552e415dc219a5dd13577575fb3') <NEW_LINE> version('2014.01.17'...
CoinHSL is a collection of linear algebra libraries (KB22, MA27, MA28, MA54, MA57, MA64, MA77, MA86, MA97, MC19, MC34, MC64, MC68, MC69, MC78, MC80, OF01, ZB01, ZB11) bundled for use with IPOPT and other applications that use these HSL routines. Note: CoinHSL is licensed software. You will need to request a license fr...
6259904407f4c71912bb0742
class VirtualHatButton(AbstractVirtualButton): <NEW_LINE> <INDENT> direction_to_name = { ( 0, 0): "center", ( 0, 1): "north", ( 1, 1): "north-east", ( 1, 0): "east", ( 1, -1): "south-east", ( 0, -1): "south", (-1, -1): "south-west", (-1, 0): "west", (-1, 1): "north-west" } <NEW_LINE> name_to_direction = { "center...
Virtual button which combines hat directions into a button.
6259904473bcbd0ca4bcb59c
class TransformerDecoder(Module): <NEW_LINE> <INDENT> def __init__(self, decoder_layer, num_layers, norm=None): <NEW_LINE> <INDENT> super(TransformerDecoder, self).__init__() <NEW_LINE> self.layers = _get_clones(decoder_layer, num_layers) <NEW_LINE> self.num_layers = num_layers <NEW_LINE> self.norm = norm <NEW_LINE> <D...
TransformerDecoder is a stack of N decoder layers Args: decoder_layer: an instance of the TransformerDecoderLayer() class (required). num_layers: the number of sub-decoder-layers in the decoder (required). norm: the layer normalization component (optional). Examples:: >>> decoder_layer = nn.Transforme...
62599044004d5f362081f96e
class SiteRisque(ModelSQL): <NEW_LINE> <INDENT> __name__ = 'site.site-site.risque' <NEW_LINE> _table = 'site_risque_rel' <NEW_LINE> site = fields.Many2One('site.site', 'site', ondelete='CASCADE', required=True) <NEW_LINE> code = fields.Many2One('site.code', 'code', ondelete='CASCADE', required=True)
Site - Risque
625990441f5feb6acb163f05
class MocneAI(AI): <NEW_LINE> <INDENT> def __init__(self, plansza_wlasna, plansza_gracza): <NEW_LINE> <INDENT> super().__init__(plansza_wlasna) <NEW_LINE> self.druga_plansza = deepcopy(plansza_gracza) <NEW_LINE> <DEDENT> def wybierz_konfiguracje_pol(self, cel): <NEW_LINE> <INDENT> pass
AI wykorzystujące do polowania i celowania symulację statystycznego występowania statków na planszy.
625990448e71fb1e983bcde0
class ClusterWithoutCPException(Exception): <NEW_LINE> <INDENT> pass
Exception to be thrown when creating a cluster without specifying a custom Control plane code
62599044dc8b845886d548ca
class ODE_Capsule(ODE_Object): <NEW_LINE> <INDENT> def __init__(self, geom, ident=None): <NEW_LINE> <INDENT> self.src = vtkContourFilter() <NEW_LINE> ODE_Object.__init__(self, geom, ident) <NEW_LINE> (radius, height) = geom.getParams() <NEW_LINE> cylinder = vtkCylinder() <NEW_LINE> cylinder.SetRadius(radius) <NEW_LINE>...
VTK visualization of class ode.GeomCapsule
625990448da39b475be04501
class TestComponent(unittest2.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.lambda_, self.mu = symbols('l, m', constant=True, positive=True, null=False ) <NEW_LINE> self.t = symbols('t', positive=True) <NEW_LINE> self.component = Component('C', self.lambda_, self.mu) <NEW_LINE> <DEDENT> def t...
Test the Component class.
6259904407f4c71912bb0743
class Meta: <NEW_LINE> <INDENT> verbose_name = _(u"Condición de Ingreso") <NEW_LINE> verbose_name_plural = _(u"Condiciones de Ingreso") <NEW_LINE> ordering = ["descripcion"]
@note: Superclase que configura los parámetros de la clase Condicion_Ingreso @licence: GPLv2 @author: T.S.U. Roldan D. Vargas G. @contact: roldandvg at gmail.com
62599044462c4b4f79dbcd0f
class G_LogChildNode(G_SessionChildNode): <NEW_LINE> <INDENT> def GetLogNode(self): <NEW_LINE> <INDENT> return self.GetParentNode(G_Project.NodeID_Log) <NEW_LINE> <DEDENT> def GetLogfile(self): <NEW_LINE> <INDENT> return self.GetLogNode().GetLogfile() <NEW_LINE> <DEDENT> def GetLogNodeChildNode(self, factory_id): <NEW_...
Mixin class to extend child nodes of a logfile node with common behaviour
62599044e76e3b2f99fd9d1d
class CommitteeFeedbackDetailPermission(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> if user.is_superuser: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> method = request.method <NEW_LINE> committee_id = request.data.ge...
Accept POST for only the delegate of the committee Accept GET request from chair of committee
6259904426238365f5fade6c
class _TestDataObject(object): <NEW_LINE> <INDENT> def __init__(self, property_1, property_2, property_3): <NEW_LINE> <INDENT> self._property_1 = property_1 <NEW_LINE> self._property_2 = property_2 <NEW_LINE> self._property_3 = property_3 <NEW_LINE> <DEDENT> @property <NEW_LINE> def property_1(self): <NEW_LINE> <INDENT...
Class used for generating test data objects.
6259904471ff763f4b5e8ab3
class Ingesta(models.Model, Turno): <NEW_LINE> <INDENT> admision = models.ForeignKey(Admision, related_name='ingestas') <NEW_LINE> fecha_y_hora = models.DateTimeField(default=timezone.now) <NEW_LINE> ingerido = models.CharField(max_length=200, blank=True) <NEW_LINE> cantidad = models.IntegerField() <NEW_LINE> liquido =...
Registra las ingestas que una :class:`Persona`
6259904450485f2cf55dc298
class Computing(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User', null=True, on_delete=models.DO_NOTHING) <NEW_LINE> edited_by = models.CharField(max_length=200, null=True) <NEW_LINE> name = models.CharField(max_length=200, blank=True, help_text="Name of the computer.") <NEW_LINE> type_object =...
Computing model docstring. This model stores the computers.
62599044d99f1b3c44d069b0
class IBeforeRender(IDict): <NEW_LINE> <INDENT> rendering_val = Attribute('The value returned by a view or passed to a ' '``render`` method for this rendering. ' 'This feature is new in Pyramid 1.2.')
Subscribers to this event may introspect the and modify the set of :term:`renderer globals` before they are passed to a :term:`renderer`. The event object itself provides a dictionary-like interface for adding and removing :term:`renderer globals`. The keys and values of the dictionary are those globals. For example:...
6259904430c21e258be99b19
class Telefone(BaseModel): <NEW_LINE> <INDENT> numero = models.CharField(max_length=50) <NEW_LINE> ddd = models.CharField(max_length=5, choices=DDD_BRASIL) <NEW_LINE> tipo = models.CharField(max_length=35, choices=TIPO_TELEFONE) <NEW_LINE> operadora = models.CharField(max_length=50, choices=OPERADORAS) <NEW_LINE> whats...
Dados telefonicos do cliente
62599044d99f1b3c44d069b1
class PostsRSS(Feed): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.tag = kwargs.pop("tag", None) <NEW_LINE> self.category = kwargs.pop("category", None) <NEW_LINE> self.username = kwargs.pop("username", None) <NEW_LINE> super(PostsRSS, self).__init__(*args, **kwargs) <NEW_LINE> self...
RSS feed for all blog posts.
62599044baa26c4b54d505bb
class BlacklistToken(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'blacklist_tokens' <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> token = db.Column(db.String(500), unique=True, nullable=False) <NEW_LINE> blacklisted_on = db.Column(db.DateTime, nullable=False) <NEW_LINE> def _...
Token Model for storing JWT tokens
6259904496565a6dacd2d913
class Error(RpcResponse): <NEW_LINE> <INDENT> def __init__(self, text, **kwargs): <NEW_LINE> <INDENT> super(Error, self).__init__(error=text, **kwargs)
Simple responses. Just for pretty code and some kind of "protocol". Example:: return Error('Something happened', code=error_code, traceback=traceback)
62599044d4950a0f3b1117ca
class StorageDiskTask(CliTask): <NEW_LINE> <INDENT> def process(self): <NEW_LINE> <INDENT> self.manual = Help() <NEW_LINE> if self.__help(): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.load_config() <NEW_LINE> self.account = AzureAccount(self.config) <NEW_LINE> container_name = self.account.storage_container() ...
Process disk commands
6259904476d4e153a661dbfe
class AdminAuthenticationForm(AuthenticationForm): <NEW_LINE> <INDENT> this_is_the_login_form = forms.BooleanField( widget=forms.HiddenInput, initial=1, error_messages={'required': ugettext_lazy("Please log in again, because your session has expired.")}) <NEW_LINE> def clean(self): <NEW_LINE> <INDENT> from xadmin.util ...
A custom authentication form used in the admin app.
6259904426068e7796d4dc58
class LTSD(): <NEW_LINE> <INDENT> def __init__(self,winsize,window,order): <NEW_LINE> <INDENT> self.winsize = int(winsize) <NEW_LINE> self.window = window <NEW_LINE> self.order = order <NEW_LINE> self.amplitude = {} <NEW_LINE> <DEDENT> def get_amplitude(self,signal,l): <NEW_LINE> <INDENT> if l in self.amplitude: <NEW_L...
LTSD VAD code from jfsantos
6259904423849d37ff8523cd
class V1beta1PodDisruptionBudgetSpec(object): <NEW_LINE> <INDENT> def __init__(self, min_available=None, selector=None): <NEW_LINE> <INDENT> self.swagger_types = { 'min_available': 'IntstrIntOrString', 'selector': 'V1LabelSelector' } <NEW_LINE> self.attribute_map = { 'min_available': 'minAvailable', 'selector': 'select...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62599044a79ad1619776b392
class JoinToProjectingJoin(Rule): <NEW_LINE> <INDENT> def fire(self, expr): <NEW_LINE> <INDENT> if not isinstance(expr, algebra.Join) or isinstance(expr, algebra.ProjectingJoin): <NEW_LINE> <INDENT> return expr <NEW_LINE> <DEDENT> return algebra.ProjectingJoin(expr.condition, expr.left, expr.right, expr....
A rewrite rule for turning every Join into a ProjectingJoin
6259904491af0d3eaad3b137
class S3MainMenu(default.S3MainMenu): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def menu_modules(cls): <NEW_LINE> <INDENT> if not current.auth.is_logged_in(): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> settings = current.deployment_settings <NEW_LINE> if settings.get_event_label(): <NEW_LINE> <INDENT> EVENTS...
Custom Application Main Menu
6259904450485f2cf55dc299
class LogCaptureFixture: <NEW_LINE> <INDENT> def __init__(self, item: nodes.Node) -> None: <NEW_LINE> <INDENT> self._item = item <NEW_LINE> self._initial_handler_level = None <NEW_LINE> self._initial_logger_levels = {} <NEW_LINE> <DEDENT> def _finalize(self) -> None: <NEW_LINE> <INDENT> if self._initial_handler_level i...
Provides access and control of log capturing.
625990443eb6a72ae038b974
class DeleteDocument(DeleteView): <NEW_LINE> <INDENT> def get_object(self): <NEW_LINE> <INDENT> return get_object_or_404(Document, pk = self.kwargs['doc_id']) <NEW_LINE> <DEDENT> def get_success_url(self): <NEW_LINE> <INDENT> current_space = self.kwargs['space_name'] <NEW_LINE> return '/spaces/{0}'.format(current_space...
Returns a confirmation page before deleting the current document. :rtype: Confirmation :context: get_place
625990441f5feb6acb163f07
@attr.s <NEW_LINE> class HashSumValidator(FileValidator): <NEW_LINE> <INDENT> hash_sum: Union[str, bytes, bytearray] = attr.ib( validator=attr.validators.instance_of((str, bytes, bytearray)), converter=lambda x: bytes.fromhex(x) if isinstance(x, str) else x, default=None ) <NEW_LINE> hash_type: HashType = attr.ib( vali...
Validator of hash-sum for the provided file and expected hash-sum for this file. Attributes ---------- hash_sum: Union[str, bytes, bytearray] Hexadecimal string or byte-array object with expected hash-sum value of validated file. hash_type: HashType Type of hash sum. See `Hashtype` for more information
6259904407f4c71912bb0745
class Host(object): <NEW_LINE> <INDENT> def __init__(self, session): <NEW_LINE> <INDENT> self._session = session <NEW_LINE> <DEDENT> def host_power_action(self, host, action): <NEW_LINE> <INDENT> host_mor = vm_util.get_host_ref(self._session) <NEW_LINE> LOG.debug(_("%(action)s %(host)s"), {'action': action, 'host': hos...
Implements host related operations.
62599044d53ae8145f919772
class Fluorescence(Instruction): <NEW_LINE> <INDENT> def __init__(self, ref, wells, excitation, emission, dataref, flashes=25): <NEW_LINE> <INDENT> super(Fluorescence, self).__init__({ "op": "fluorescence", "object": ref, "wells": wells, "excitation": excitation, "emission": emission, "num_flashes": flashes, "dataref":...
Read the fluoresence for the indicated wavelength for the indicated wells. Append a Fluorescence instruction to the list of instructions for this Protocol object. Parameters ---------- ref : str, Container wells : list, WellGroup WellGroup of wells to be measured or a list of well references in the form of ["...
6259904426238365f5fade6e
class Option(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.update(*args, **kwargs) <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> if isinstance(value, dict): <NEW_LINE> <INDENT> value = Option(value) <NEW_LINE> <DEDENT> return super(Option, self).__...
Optionurations
6259904407d97122c4217fb4
class CelerySignalProcessor(RealTimeSignalProcessor): <NEW_LINE> <INDENT> def handle_save(self, sender, instance, **kwargs): <NEW_LINE> <INDENT> app_label = instance._meta.app_label <NEW_LINE> model_name = instance._meta.model_name <NEW_LINE> transaction.on_commit(lambda: handle_save.delay(instance.pk, app_label, model...
Celery signal processor. Allows automatic updates on the index as delayed background tasks using Celery. NB: We cannot process deletes as background tasks. By the time the Celery worker would pick up the delete job, the model instance would already deleted. We can get around this by setting Celery to use `pickle` and s...
62599044d99f1b3c44d069b3
class Client(User): <NEW_LINE> <INDENT> pass
Client Model.
6259904494891a1f408ba080
class TagInfoUnit(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TagKey = None <NEW_LINE> self.TagValue = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TagKey = params.get("TagKey") <NEW_LINE> self.TagValue = params.get("TagValue")
tag信息单元
62599044b830903b9686ee04
class _NoBlockType(Base_Block): <NEW_LINE> <INDENT> def __new__(cls): <NEW_LINE> <INDENT> return NoBlock <NEW_LINE> <DEDENT> def __reduce__(self): <NEW_LINE> <INDENT> return (_NoBlockType, ()) <NEW_LINE> <DEDENT> def __copy__(self): <NEW_LINE> <INDENT> return NoBlock <NEW_LINE> <DEDENT> def __deepcopy__(self, memo): <N...
Default value for input block, meaning "there are no input block defined yet" Consequently, when a block has NoBlock as an input, you cannot compute it
62599044379a373c97d9a33e
class ExtendVerifier(Step): <NEW_LINE> <INDENT> COMMAND = "verify add-verifier-ext --source %(source)s" <NEW_LINE> DEPENDS_ON = CreateVerifier <NEW_LINE> CALL_ARGS = {"source": "https://git.openstack.org/openstack/" "keystone-tempest-plugin"}
Extend verifier with keystone integration tests.
62599044507cdc57c63a60b1
class SourceConfiguration(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "AuthenticationConfiguration": (AuthenticationConfiguration, False), "AutoDeploymentsEnabled": (boolean, False), "CodeRepository": (CodeRepository, False), "ImageRepository": (ImageRepository, False), }
`SourceConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-apprunner-service-sourceconfiguration.html>`__
62599044d10714528d69f017
class DeprecationStatus(messages.Message): <NEW_LINE> <INDENT> deleted = messages.StringField(1) <NEW_LINE> deprecated = messages.StringField(2) <NEW_LINE> obsolete = messages.StringField(3) <NEW_LINE> replacement = messages.StringField(4) <NEW_LINE> state = messages.StringField(5)
A DeprecationStatus object. Fields: deleted: A string attribute. deprecated: A string attribute. obsolete: A string attribute. replacement: A string attribute. state: A string attribute.
62599044e64d504609df9d5b
class DefaultProperties(Virtual, PropertySheet, View): <NEW_LINE> <INDENT> id = 'default' <NEW_LINE> _md = {'xmlns': 'http://www.zope.org/propsets/default'}
The default property set mimics the behavior of old-style Zope properties -- it stores its property values in the instance of its owner.
6259904407d97122c4217fb5
class SpellingTest(AbstractRuleTest): <NEW_LINE> <INDENT> ERROR_CUTOFF=0.05 <NEW_LINE> def __init__(self, case_sensitive=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.case_sensitive = case_sensitive <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.spelling_map = dict() <NEW_LINE> self.tota...
Detect spelling outliers in a column HXL schema: #valid_value+spelling Will treat numbers and dates as strings, so use this only in columns where you expect text, and frequently-repeated values (e.g. #status, #org+name, #sector+name). Will skip validation if the coefficient of variation > 1.0 Collects all of the spel...
62599044a4f1c619b294f812
class MetaCubic(Sprite): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> super(MetaCubic, self).__init__() <NEW_LINE> self.image = pygame.image.load(path) <NEW_LINE> self.rect = self.image.get_rect() <NEW_LINE> <DEDENT> def update(self, game_settings, event_key): <NEW_LINE> <INDENT> if event_key == py...
创建元方块
6259904424f1403a92686257
class RangeNormalize(object): <NEW_LINE> <INDENT> def __init__(self, min_val, max_val): <NEW_LINE> <INDENT> self.min_val = min_val <NEW_LINE> self.max_val = max_val <NEW_LINE> <DEDENT> def __call__(self, *inputs): <NEW_LINE> <INDENT> outputs = [] <NEW_LINE> for idx, _input in enumerate(inputs): <NEW_LINE> <INDENT> _min...
Given min_val: (R, G, B) and max_val: (R,G,B), will normalize each channel of the th.*Tensor to the provided min and max values. Works by calculating : a = (max'-min')/(max-min) b = max' - a * max new_value = a * value + b where min' & max' are given values, and min & max are observed min/max for each chan...
625990448a43f66fc4bf34a8
class GSMetadata(BaseModule): <NEW_LINE> <INDENT> PROFILE_RE = re.compile(r'profile-(?P<dotted_name>[\w.]+):[\w\W]+') <NEW_LINE> @classmethod <NEW_LINE> def create_from_files(cls, top_dir): <NEW_LINE> <INDENT> if top_dir.endswith('.py'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> for path, folders, filenames in os....
Extract imports from Generic Setup metadata.xml files These files are in common use in Zope/Plone to define Generic Setup profile dependencies between projects.
62599044507cdc57c63a60b3
class FileService(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> db_table = 'file_server' <NEW_LINE> <DEDENT> name = models.CharField('文件名称', max_length=64, null=True) <NEW_LINE> path = models.CharField('文件链接', max_length=128) <NEW_LINE> type = models.CharField('文件类型', max_length=8, null=True) <NEW_...
文件服务
6259904415baa723494632a8
class _MetaData(dict): <NEW_LINE> <INDENT> blankrecord = None <NEW_LINE> dfd = None <NEW_LINE> fields = None <NEW_LINE> field_count = 0 <NEW_LINE> field_types = None <NEW_LINE> filename = None <NEW_LINE> ignorememos = False <NEW_LINE> memoname = None <NEW_LINE> mfd = None <NEW_LINE> memo = None <NEW_LINE> memofields = ...
Container class for storing per table metadata
6259904426068e7796d4dc5c
class ArmAmplifier(Amplifier): <NEW_LINE> <INDENT> def __init__(self, logger=None): <NEW_LINE> <INDENT> super(ArmAmplifier, self).__init__(logger) <NEW_LINE> self.cnv = [{'sep':-0.6, 'step':-100, 'speed':10,}, {'sep':-0.2, 'step':-50, 'speed':10,}, {'sep':0.3, 'step':0, 'speed':0,}, {'sep':0.7, 'step':50, 'speed':10,},...
for beam input to armservo Input value is -1.0 to 1.0. 0.0 is center.
62599044a8ecb03325872527
class RunPort(Base): <NEW_LINE> <INDENT> __tablename__ = 'run_ports' <NEW_LINE> port_number = Column(Integer, primary_key=True) <NEW_LINE> run_id = Column(Integer, ForeignKey('runs.id', ondelete='CASCADE'), primary_key=True) <NEW_LINE> run = relationship('Run', uselist=False, back_populates='ports') <NEW_LINE> type = C...
A network port to be exposed from the experiment container.
6259904473bcbd0ca4bcb5a2
class TestPrepareDocsS3(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls._connection = PrepareDocsS3.PrepareDocsS3( 'fixtures/national-archives-and-records-administration/' ) <NEW_LINE> cls._connection.custom_parser = parse_foiaonline_metadata <NEW_LINE> <DEDENT> @moto...
Test that PrepareDocsS3 works generates manifest entirely on S3
6259904423e79379d538d814