code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class EqualityExpr(BinaryOperatorExpr): <NEW_LINE> <INDENT> operators = { '=' : operator.eq, '!=' : operator.ne, '<=' : operator.le, '<' : operator.lt, '>=' : operator.ge, '>' : operator.gt, } <NEW_LINE> def operate(self, a, b): <NEW_LINE> <INDENT> if nodesetp(a): <NEW_LINE> <INDENT> for node in a: <NEW_LINE> <INDEN...
<x> = <y>, <x> != <y>, etc.
625990538e71fb1e983bcfbc
class Permission(Entity): <NEW_LINE> <INDENT> using_options(tablename="tg_permission", auto_primarykey="permission_id") <NEW_LINE> permission_name = Field(Unicode(16), unique=True) <NEW_LINE> description = Field(Unicode(255)) <NEW_LINE> groups = ManyToMany("Group")
A relationship that determines what each Group can do
62599053435de62698e9d2f4
class ProdConf(BaseConf): <NEW_LINE> <INDENT> DEBUG = False <NEW_LINE> SQLALCHEMY_ECHO = False
Production configuration
62599053462c4b4f79dbcef7
class CredentialStore(object): <NEW_LINE> <INDENT> def __init__(self, credentials): <NEW_LINE> <INDENT> self._credentials = credentials <NEW_LINE> <DEDENT> def get_auth_for(self, url, credential_id=None): <NEW_LINE> <INDENT> for credential in self._credentials: <NEW_LINE> <INDENT> if re.search(credential["url"], url): ...
Credential store, manages your credentials.
625990536e29344779b01b3b
class CertificateIssuerSetParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'provider': {'required': True}, } <NEW_LINE> _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'credentials': {'key': 'credentials', 'type': 'IssuerCredentials'}, 'organization_details': {'key': 'org_d...
The certificate issuer set parameters. All required parameters must be populated in order to send to Azure. :param provider: Required. The issuer provider. :type provider: str :param credentials: The credentials to be used for the issuer. :type credentials: ~azure.keyvault.v7_0.models.IssuerCredentials :param organiz...
6259905376d4e153a661dcf4
class DecoratingQuerySet(QuerySet): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DecoratingQuerySet, self).__init__(*args, **kwargs) <NEW_LINE> self._decorate_funcs = [] <NEW_LINE> <DEDENT> def _clone(self, klass=None, setup=False, **kw): <NEW_LINE> <INDENT> c = super(DecoratingQue...
An enhancement of the QuerySet which allows objects to be decorated with extra properties before they are returned. When using this method with *django-polymorphic* or *django-hvad*, make sure this class is first in the chain of inherited classes.
625990537cff6e4e811b6f34
class RedgifsImageExtractor(RedgifsExtractor): <NEW_LINE> <INDENT> subcategory = "image" <NEW_LINE> pattern = (r"(?:https?://)?(?:" r"(?:www\.)?redgifs\.com/(?:watch|ifr)|" r"(?:www\.)?gifdeliverynetwork\.com|" r"i\.redgifs\.com/i)/([A-Za-z]+)") <NEW_LINE> test = ( ("https://redgifs.com/watch/foolishforkedabyssiniancat...
Extractor for individual gifs from redgifs.com
6259905382261d6c52730943
class UpdateCourseAPIView(generics.UpdateAPIView): <NEW_LINE> <INDENT> lookup_url_kwarg = "unique_id" <NEW_LINE> lookup_field = COUR_UNIQUE_ID <NEW_LINE> queryset = Course.objects.all() <NEW_LINE> serializer_class = CourseSerializer
This API endpoint is for updating a Course object.
6259905307f4c71912bb092c
class Sequence(object): <NEW_LINE> <INDENT> def __init__(self, sequence, state, logprob): <NEW_LINE> <INDENT> self.sequence = sequence <NEW_LINE> self.state = state <NEW_LINE> self.logprob = logprob <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<Sequence: {}, logprob: {:.3f}>'.format(self.sequence...
Represents a potential sequence.
62599053b5575c28eb713745
class BakeAction(Operator): <NEW_LINE> <INDENT> bl_idname = "nla.bake" <NEW_LINE> bl_label = "Bake Action" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> frame_start = IntProperty( name="Start Frame", description="Start frame for baking", min=0, max=300000, default=1, ) <NEW_LINE> frame_end = IntProperty( name...
Bake object/pose loc/scale/rotation animation to a new action
625990534428ac0f6e659a2c
class jsonable: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self = self <NEW_LINE> <DEDENT> def to_JSON(self): <NEW_LINE> <INDENT> return json.dumps(self, default=lambda o: o.__dict__, sort_keys=True, indent=4)
This is a parent class for all classes that I want to serialize in json
62599053ac7a0e7691f739d4
class WuaTestCase(object): <NEW_LINE> <INDENT> __shared_session__ = True <NEW_LINE> desired_capabilities = config.DESIRED_CAPABILITIES <NEW_LINE> @staticmethod <NEW_LINE> def _create_session(o): <NEW_LINE> <INDENT> o.driver = Remote(command_executor="http://localhost:9999", desired_capabilities=o.desired_capabilities) ...
If True, then new session is created when test class is being setup, i.e. one session is used for all test methods in class. If False, then new session is created when test method is being setup, i.e. each test method will run in new session.
62599053b830903b9686eef7
class GraphAPI(object): <NEW_LINE> <INDENT> def __init__(self, access_token=None): <NEW_LINE> <INDENT> self.access_token = access_token <NEW_LINE> <DEDENT> def batch_request(self,requests): <NEW_LINE> <INDENT> assert self.access_token, "Batch operations require an access token" <NEW_LINE> return self.request("/", { 'ba...
A client for the Facebook Graph API. See http://developers.facebook.com/docs/api for complete documentation for the API. The Graph API is made up of the objects in Facebook (e.g., people, pages, events, photos) and the connections between them (e.g., friends, photo tags, and event RSVPs). This client provides access ...
625990532ae34c7f260ac5da
class Args(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.path = 'Data/' <NEW_LINE> self.dataset = 'ml-100k' <NEW_LINE> self.epochs = 50 <NEW_LINE> self.batch_size = 256 <NEW_LINE> self.num_tasks = 18 <NEW_LINE> self.e_dim = 8 <NEW_LINE> self.f_dim = 8 <NEW_LINE> self.reg = 0 <NEW_LINE> self....
Used to generate different sets of arguments
6259905355399d3f05627a12
class AAR_estimator_LDA(BaseEstimator, ClassifierMixin): <NEW_LINE> <INDENT> def __init__(self,in_chan,classes,maxlag=3,fs=250,feature_idx='all'): <NEW_LINE> <INDENT> self.in_chan = in_chan <NEW_LINE> self.classes = classes <NEW_LINE> self.fs = fs <NEW_LINE> self.maxlag = maxlag <NEW_LINE> self.clf = LinearDiscriminant...
feature:AAR clf:LDA
6259905363d6d428bbee3cc6
class RiemannProtocol(Int32StringReceiver, RiemannProtobufMixin): <NEW_LINE> <INDENT> implements(ITensorProtocol) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.pressure = 0 <NEW_LINE> <DEDENT> def stringReceived(self, string): <NEW_LINE> <INDENT> self.pressure -= 1
Riemann protobuf protocol
6259905394891a1f408ba170
class Application(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Command = None <NEW_LINE> self.DeliveryForm = None <NEW_LINE> self.PackagePath = None <NEW_LINE> self.Docker = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Command = params.get("Comman...
应用程序信息
625990537b25080760ed8759
class CallableNameTests(TestCase): <NEW_LINE> <INDENT> def test_method(self): <NEW_LINE> <INDENT> self.assertThat( [callable_name(partial(self.test_method)), callable_name(self.test_method)], AllMatch(Equals(self.test_method.func_name))) <NEW_LINE> <DEDENT> def test_function(self): <NEW_LINE> <INDENT> def _function(): ...
Tests for `callable_name`.
625990536e29344779b01b3d
class DTClassifier(Classifier): <NEW_LINE> <INDENT> def __init__(self, X, y, num, classifier_name): <NEW_LINE> <INDENT> super().__init__(X, y, num, classifier_name) <NEW_LINE> self.classifier = DecisionTreeClassifier()
决策树分类器
62599053498bea3a75a5901a
class AvailableServiceSkuSku(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'family': {'key': 'family', 'type': 'str'}, 'size': {'key': 'size', 'type': 'str'}, 'tier': {'key': 'tier', 'type': 'str'}, } <NEW_LINE> def __init__(self, *, name: str=None, family: str=None, size: str=N...
SKU name, tier, etc. :param name: The name of the SKU :type name: str :param family: SKU family :type family: str :param size: SKU size :type size: str :param tier: The tier of the SKU, such as "Free", "Basic", "Standard", or "Premium" :type tier: str
6259905345492302aabfd9cc
class SillyClass(object): <NEW_LINE> <INDENT> pass
docstring for SillyClass
625990538da39b475be046df
class VmdProc(object): <NEW_LINE> <INDENT> def __init__(self, experiment, directory=None): <NEW_LINE> <INDENT> self.experiment = experiment <NEW_LINE> self.directory = directory <NEW_LINE> self.has_run = False <NEW_LINE> <DEDENT> def make_command(self, output=True): <NEW_LINE> <INDENT> command = [standards.VmdCommand, ...
This class is the base class for managing all VMD procedures.
6259905338b623060ffaa2c9
class Decoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, dim_neck, dim_emb, dim_pre): <NEW_LINE> <INDENT> super(Decoder, self).__init__() <NEW_LINE> self.lstm1 = nn.LSTM(dim_neck * 2 + dim_emb, dim_pre, 1, batch_first=True) <NEW_LINE> layers = [] <NEW_LINE> for _ in range(3): <NEW_LINE> <INDENT> layers += [Conv...
Decoder module
62599053507cdc57c63a6299
class TrafficAnalyticsProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'network_watcher_flow_analytics_configuration': {'required': True}, } <NEW_LINE> _attribute_map = { 'network_watcher_flow_analytics_configuration': {'key': 'networkWatcherFlowAnalyticsConfiguration', 'type': 'TrafficAnalyt...
Parameters that define the configuration of traffic analytics. All required parameters must be populated in order to send to Azure. :param network_watcher_flow_analytics_configuration: Required. Parameters that define the configuration of traffic analytics. :type network_watcher_flow_analytics_configuration: ~azure...
62599053435de62698e9d2f7
class CPPImplementationsProcessor(object): <NEW_LINE> <INDENT> def do_process(self, block_holder, processor_changes, biiout): <NEW_LINE> <INDENT> assert biiout is not None <NEW_LINE> assert processor_changes is not None <NEW_LINE> simple_resources = [r for r in block_holder.simple_resources if r.cell.type == CPP] <NEW_...
processor to detect implementations in C++, a very difficult task, so this processor is not perfect.
6259905363b5f9789fe86666
class Level_SynthSeq(LevelGen): <NEW_LINE> <INDENT> def __init__(self, seed=None): <NEW_LINE> <INDENT> super().__init__( seed=seed, locations=True, unblocking=True, implicit_unlock=False )
Like SynthLoc, but now with multiple commands, combined just like in GoToSeq. No implicit unlocking. Competencies: Maze, Unblock, Unlock, GoTo, PickUp, PutNext, Open, Loc, Seq
625990534e4d5625663738fb
class DBConfig(object): <NEW_LINE> <INDENT> def __init__(self, db_path): <NEW_LINE> <INDENT> self.db_kvp_helper = DBKVPHelper('sqlite') <NEW_LINE> self.connect(db_path) <NEW_LINE> <DEDENT> def connect(self, db_path): <NEW_LINE> <INDENT> self.db_kvp_helper.connect(db_path) <NEW_LINE> self.db_kvp_helper.use_table('config...
A configuration class using database to persist.
625990538e71fb1e983bcfbe
class BedrockRouter(object): <NEW_LINE> <INDENT> db_for_read = db_for_write = lambda *a, **kw: 'bedrock' <NEW_LINE> allow_relation = allow_migrate = lambda *a, **kw: True
A database router to use a single non-default db
6259905371ff763f4b5e8ca3
class Cursor(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, Cursor, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, Cursor, name) <NEW_LINE> def __init__(self, *args, **kwargs)...
Proxy of C++ FIFE::Cursor class
6259905310dbd63aa1c720d6
class ServiceState(object): <NEW_LINE> <INDENT> DISABLED = "DISABLED" <NEW_LINE> STARTING = "STARTING" <NEW_LINE> UP = "UP" <NEW_LINE> DEGRADED = "DEGRADED" <NEW_LINE> FAILED = "FAILED" <NEW_LINE> STOPPING = "STOPPING" <NEW_LINE> UNKNOWN = "UNKNOWN" <NEW_LINE> FAILURE_STATES ...
Determine the state of a Service.
6259905382261d6c52730944
class TestMonthlySummary(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 testMonthlySummary(self): <NEW_LINE> <INDENT> pass
MonthlySummary unit test stubs
6259905307f4c71912bb092e
class UserSignupForm(forms.ModelForm): <NEW_LINE> <INDENT> username = forms.CharField( required=False, ) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = MyUser <NEW_LINE> fields = [ "email", "first_name", "last_name", "password", ] <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <INDENT> password = self.cle...
A form for creating new users.
625990532ae34c7f260ac5db
class RequestError(Exception): <NEW_LINE> <INDENT> pass
Error in API request
62599053f7d966606f749332
class RegisterForm(FlaskForm): <NEW_LINE> <INDENT> first_name = StringField('First Name', validators=[ InputRequired(message='First name is required.')]) <NEW_LINE> last_name = StringField('Last Name', validators=[ InputRequired(message='Last name is required.')]) <NEW_LINE> email = StringField('Email', validators=[Inp...
Registration form for new user
62599053ac7a0e7691f739d6
class LinearLayout(AndroidLayout): <NEW_LINE> <INDENT> @property <NEW_LINE> def takenWidth(self): <NEW_LINE> <INDENT> return sum([ child.width for child in self.children ]) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def fromSoup(cls, parent, soup, resourcesPaths: [pathlib.Path], *, device=None): <NEW_LINE> <INDENT> ne...
An AndroidLayout which displays its children in-line. The simplest AndroidLayout.
6259905363d6d428bbee3cc8
class RealTimeDataEndpoint: <NEW_LINE> <INDENT> def __init__(self, hass, api): <NEW_LINE> <INDENT> self.hass = hass <NEW_LINE> self.api = api <NEW_LINE> self.ready = asyncio.Event() <NEW_LINE> self.sensors = [] <NEW_LINE> <DEDENT> async def async_refresh(self, now=None): <NEW_LINE> <INDENT> from solax import SolaxReque...
Representation of a Sensor.
62599053e5267d203ee6cde4
class Model: <NEW_LINE> <INDENT> def __init__(self, coeffs, coeffs_normed, terms, algo): <NEW_LINE> <INDENT> self.algodict = {'FoBa': 3., 'STRidge': 7., 'SR3': 18., 'Lasso': 40.} <NEW_LINE> self.name = algo <NEW_LINE> self.coefficients = coeffs <NEW_LINE> self.normed_coeffs = coeffs_normed <NEW_LINE> self.terms = terms...
Data structure to store all necessary data of each model obtained from hyperparameter tuning
62599053596a89723612902a
class Volume(AStorage): <NEW_LINE> <INDENT> def exists(self, key: str) -> bool: <NEW_LINE> <INDENT> return os.path.isfile(key) <NEW_LINE> <DEDENT> def load(self, key: str) -> str: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> fp = open(key, 'r+') <NEW_LINE> content = fp.read(10000) <NEW_LINE> if not content: <NEW_LINE> ...
* Class Volume * Processing info file on disk volume
62599053cb5e8a47e493cc02
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> numAgents = gameState.getNumAgents() <NEW_LINE> def helper(gameState, depth, agent, alpha, beta): <NEW_LINE> <INDENT> def overallValue(gameState, depth, agent, alpha, beta): <NEW_LINE> <INDENT> if gameSt...
Your minimax agent with alpha-beta pruning (question 3)
62599053e64d504609df9e4b
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "Acte"
Le titre du modèle qui d'affiche dans l'interface d'administration
625990536e29344779b01b3f
class GeoMultiPolygon(geo_field.Geom): <NEW_LINE> <INDENT> _type = 'geo_multi_polygon' <NEW_LINE> def __init__(self, string, dim=2, srid=900913, gist_index=True, **args): <NEW_LINE> <INDENT> super(GeoMultiPolygon, self).__init__( string, "MULTIPOLYGON", dim=dim, srid=srid, gist_index=gist_index, **args)
New type of column in the ORM for POSTGIS geometry MultiPolygon type
62599053baa26c4b54d5079a
class TestGitHubMostStarred(object): <NEW_LINE> <INDENT> def setup_method(self, method): <NEW_LINE> <INDENT> assert method <NEW_LINE> <DEDENT> def teardown_method(self, method): <NEW_LINE> <INDENT> assert method
Tests for GitHubMostStarred class.
62599053507cdc57c63a629b
class InvalidDodoFile(Exception): <NEW_LINE> <INDENT> pass
Invalid dodo file
62599053dc8b845886d54abb
class OverrideFeeds(_MWS): <NEW_LINE> <INDENT> ACCOUNT_TYPE = "Merchant" <NEW_LINE> def submit_feed(self, feed, feed_type, marketplaceids=None, content_type="text/xml", purge=False): <NEW_LINE> <INDENT> purge = 'true' if purge else 'false' <NEW_LINE> data = dict(Action='SubmitFeed', FeedType=feed_type, PurgeAndReplace=...
Amazon MWS Feeds API
62599053462c4b4f79dbcefb
class CollabServerFactory(ServerFactory): <NEW_LINE> <INDENT> def __init__(self, protocol_hooks=None): <NEW_LINE> <INDENT> print('Starting collaboration server factory.') <NEW_LINE> self.protocols = {} <NEW_LINE> self.available_docs = {} <NEW_LINE> if protocol_hooks is not None: <NEW_LINE> <INDENT> self.hooks = protoco...
A factory for server protocols Creates and manages connections to collaboration clients
6259905307d97122c42181a0
class ResponseHeadersPolicyConfig(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "Comment": (str, False), "CorsConfig": (CorsConfig, False), "CustomHeadersConfig": (CustomHeadersConfig, False), "Name": (str, True), "SecurityHeadersConfig": (SecurityHeadersConfig, False), }
`ResponseHeadersPolicyConfig <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-responseheaderspolicy-responseheaderspolicyconfig.html>`__
625990538da39b475be046e1
class BaseSchemaItemField(BaseField): <NEW_LINE> <INDENT> _schema_class = None <NEW_LINE> _schema_kwarg_prefix = '' <NEW_LINE> _schema_valid_kwargs = () <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not hasattr(self, '_kwargs_backup'): <NEW_LINE> <INDENT> self._kwargs_backup = kwargs.copy() <NE...
Base class for fields/columns that accept a schema item/constraint on column init. E.g. Column(Integer, ForeignKey('user.id')) It differs from regular columns in that an item/constraint passed to the Column on init has to be passed as a positional argument and should also receive arguments. Thus 3 objects need to be c...
6259905321a7993f00c67464
class MultiHeadSelfAttention(_BaseMultiHeadAttention): <NEW_LINE> <INDENT> def build(self, input_shape): <NEW_LINE> <INDENT> if not isinstance(input_shape, list): <NEW_LINE> <INDENT> raise ValueError('Invalid input') <NEW_LINE> <DEDENT> d_model = input_shape[0][-1] <NEW_LINE> self.validate_model_dimensionality(d_model)...
Multi-head self-attention for both encoders and decoders. Uses only one input and has implementation which is better suited for such use case that more general MultiHeadAttention class.
625990530fa83653e46f63db
class RandomGray: <NEW_LINE> <INDENT> def __init__(self, consistent=True, p=0.5): <NEW_LINE> <INDENT> self.consistent = consistent <NEW_LINE> self.p = p <NEW_LINE> <DEDENT> def __call__(self, imgmap): <NEW_LINE> <INDENT> if self.consistent: <NEW_LINE> <INDENT> if random.random() < self.p: <NEW_LINE> <INDENT> return [se...
Actually it is a channel splitting, not strictly grayscale images
6259905307f4c71912bb0931
@dataclass(frozen=True) <NEW_LINE> class SBool(Value): <NEW_LINE> <INDENT> value: bool <NEW_LINE> def type_name(self) -> SSym: <NEW_LINE> <INDENT> return SSym('bool') <NEW_LINE> <DEDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return str(self.value) <NEW_LINE> <DEDENT> def address(self) -> int: <NEW_LINE> <INDENT...
A lisp boolean
62599053097d151d1a2c256e
class TestIP6Input(VppTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestIP6Input, self).setUp() <NEW_LINE> self.create_pg_interfaces(range(2)) <NEW_LINE> for i in self.pg_interfaces: <NEW_LINE> <INDENT> i.admin_up() <NEW_LINE> i.config_ip6() <NEW_LINE> i.resolve_ndp() <NEW_LINE> <DEDENT> <DE...
IPv6 Input Exceptions
625990533539df3088ecd79e
class TestImageController(BaseTestCase): <NEW_LINE> <INDENT> def test_get_image_by_hostcode_and_product_no(self): <NEW_LINE> <INDENT> response = self.client.open( '//images/hosts/{hostCode}/images/{productNo}'.format(hostCode='hostCode_example', productNo='productNo_example'), method='GET') <NEW_LINE> self.assert200(re...
ImageController integration test stubs
62599053a79ad1619776b539
class FlowLog(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VpcId = None <NEW_LINE> self.FlowLogId = None <NEW_LINE> self.FlowLogName = None <NEW_LINE> self.ResourceType = None <NEW_LINE> self.ResourceId = None <NEW_LINE> self.TrafficType = None <NEW_LINE> self.CloudLogId = None <NEW_...
流日志
6259905316aa5153ce4019dc
class TestModulesJinja(ModuleCase): <NEW_LINE> <INDENT> def _path(self, name, absolute=False): <NEW_LINE> <INDENT> path = os.path.join("modules", "jinja", name) <NEW_LINE> if absolute: <NEW_LINE> <INDENT> return os.path.join(RUNTIME_VARS.BASE_FILES, path) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return path <NEW_L...
Test the jinja map module
625990537b25080760ed875b
class Notification(models.Model): <NEW_LINE> <INDENT> visitor = models.ForeignKey(Visitor) <NEW_LINE> notification_text = models.CharField('Notification Message', max_length=200) <NEW_LINE> date = models.DateTimeField('Notification Date') <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.notification_te...
Notification class represents a notification or message left by the owner for a visitor
625990531f037a2d8b9e52e9
class StopAgentNode(ArmLogicTreeNode): <NEW_LINE> <INDENT> bl_idname = 'LNStopAgentNode' <NEW_LINE> bl_label = 'Stop Agent' <NEW_LINE> arm_version = 1 <NEW_LINE> def arm_init(self, context): <NEW_LINE> <INDENT> self.add_input('ArmNodeSocketAction', 'In') <NEW_LINE> self.add_input('ArmNodeSocketObject', 'Object') <NEW_L...
Stops the given NavMesh agent.
625990534a966d76dd5f03e7
class GetDetectInfoEnhancedResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Text = None <NEW_LINE> self.IdCardData = None <NEW_LINE> self.BestFrame = None <NEW_LINE> self.VideoData = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_L...
GetDetectInfoEnhanced返回参数结构体
625990537d847024c075d8d3
class NoChallengeCredentialsPlugin(object): <NEW_LINE> <INDENT> implements(interfaces.ICredentialsPlugin) <NEW_LINE> def extractCredentials(self, request): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def challenge(self, request): <NEW_LINE> <INDENT> if not IUnauthenticatedPrincipal.providedBy(request.principal)...
A plugin that doesn't challenge if the principal is authenticated. There are two reasonable ways to handle an unauthorized error for an authenticated principal: - Inform the user of the unauthorized error - Let the user login with a different set of credentials Since either approach is reasonable, we need to gi...
62599053baa26c4b54d5079c
class ConsumerGroupListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ConsumerGroup]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ConsumerGroupListResult, self).__init__(**kwargs...
The result to the List Consumer Group operation. :param value: Result of the List Consumer Group operation. :type value: list[~azure.mgmt.eventhub.v2021_11_01.models.ConsumerGroup] :param next_link: Link to the next set of results. Not empty if Value contains incomplete list of Consumer Group. :type next_link: str
62599053d99f1b3c44d06b98
class SetPartitions_set(SetPartitions): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def __classcall_private__(cls, s): <NEW_LINE> <INDENT> return super(SetPartitions_set, cls).__classcall__(cls, frozenset(s)) <NEW_LINE> <DEDENT> def __init__(self, s): <NEW_LINE> <INDENT> self._set = s <NEW_LINE> SetPartitions.__init__...
Set partitions of a fixed set `S`.
62599053462c4b4f79dbcefd
class HillmanGrasslTableaux(Tableaux): <NEW_LINE> <INDENT> Element = HillmanGrasslTableau <NEW_LINE> @staticmethod <NEW_LINE> def __classcall_private__(cls, shape, size=None): <NEW_LINE> <INDENT> if shape not in Partitions(): <NEW_LINE> <INDENT> raise ValueError("Shape must be a partition") <NEW_LINE> <DEDENT> shape_pa...
A factory class for the various classes of Hillman-Grassl tableaux. INPUT: - ``shape`` -- the shape of the tableaux - ``size`` -- the size of the tableaux OUTPUT: - The appropriate class, after checking basic consistency tests. A Hillman-Grassl tableau is a tableau whose entries are non-negative integers and whose...
6259905371ff763f4b5e8ca7
class TagsTopping(Topping): <NEW_LINE> <INDENT> PROVIDES = [ "tags" ] <NEW_LINE> DEPENDS = [] <NEW_LINE> @staticmethod <NEW_LINE> def act(aggregate, classloader, verbose=False): <NEW_LINE> <INDENT> tags = aggregate.setdefault("tags", {}) <NEW_LINE> prefix = "data/minecraft/tags/" <NEW_LINE> suffix = ".json" <NEW_LINE> ...
Provides a list of all block and item tags
6259905321a7993f00c67466
class ShellPlugin(AbsPlugin): <NEW_LINE> <INDENT> def open(self, args): <NEW_LINE> <INDENT> return EXIT_OPEN_SHELL
Interactive shell plugin
625990530c0af96317c577dc
class itkImageDuplicatorICF2(ITKCommonBasePython.itkObject): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig_repr <NEW_LI...
Proxy of C++ itkImageDuplicatorICF2 class
6259905373bcbd0ca4bcb789
class BaseBackend(object): <NEW_LINE> <INDENT> def get(self, key): <NEW_LINE> <INDENT> raise NotImplementedError("Subclasses should implement this method") <NEW_LINE> <DEDENT> def set(self, key, value, timeout=None): <NEW_LINE> <INDENT> raise NotImplementedError("Subclasses should implement this method") <NEW_LINE> <DE...
Abstract class that acts like every Cache Backend Interface. Extend it to implement your own Cache Backend.
625990530a50d4780f70683b
class Jiggling( SteeringBehaviour ): <NEW_LINE> <INDENT> def __init__( self, robot ): <NEW_LINE> <INDENT> SteeringBehaviour.__init__( self, robot ) <NEW_LINE> self.numMovesRemaining = 0 <NEW_LINE> self.numMoveTicksRemaining = 0 <NEW_LINE> self.moveSteeringResult = ( 0.0, 0.0 ) <NEW_LINE> <DEDENT> def startJiggling( sel...
A steering behaviour that attempts to recover from stalls by jiggling around...
62599053f7d966606f749334
class NeighborhoodEncoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, features, features_global): <NEW_LINE> <INDENT> super(NeighborhoodEncoder, self).__init__() <NEW_LINE> assert(len(features) == 3) <NEW_LINE> assert(len(features_global) == 3) <NEW_LINE> self.fc1 = nn.Linear(3, features[0]) <NEW_LINE> self.fc2 ...
This encoder takes in relative points and the cluster to which they belong and outputs a single feature vector for each cluster.
6259905324f1403a9268634c
class UnsupportedImageTypeError(Exception): <NEW_LINE> <INDENT> pass
This image is formatted in a way pikepdf does not supported.
6259905326068e7796d4de41
class TrainConfigModel(ConfigModel): <NEW_LINE> <INDENT> def __init__(self, config={}): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.optType = "" <NEW_LINE> confkeys = list(self.config.keys()) <NEW_LINE> if ('train_config' not in confkeys and 'trainConfig' not in confkeys): <NEW_LINE> <INDENT> self.config['...
Handles model specific train config
62599053be8e80087fbc057b
class Movie(): <NEW_LINE> <INDENT> def __init__(self, title, poster_image_url, trailer_youtube_url): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.poster_image_url = poster_image_url <NEW_LINE> self.trailer_youtube_url = trailer_youtube_url
A Movie class with vairables title, poster_image_url and trailer_youtube_url.
6259905316aa5153ce4019df
class KNearestNeighbors: <NEW_LINE> <INDENT> def __init__(self, X_train: NPArray, y_train: NPIntArray, k: int = 3) -> None: <NEW_LINE> <INDENT> self.k = k <NEW_LINE> self.X_train = X_train <NEW_LINE> self.y_train = y_train <NEW_LINE> <DEDENT> def predict(self, X: NPArray) -> NPArray: <NEW_LINE> <INDENT> dists = self.co...
A k-NN classifier with L2 distance
6259905323849d37ff8525bd
class PublicTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(TAGS_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicy available tags API
625990536e29344779b01b43
class StudentSpikeSlabPrior(RegressionSpikeSlabPrior): <NEW_LINE> <INDENT> def __init__( self, x, y=None, expected_r2=.5, prior_df=.01, expected_model_size=1, prior_information_weight=.01, diagonal_shrinkage=.5, optional_coefficient_estimate=None, max_flips=-1, mean_y=None, sdy=None, prior_inclusion_probabilities=None,...
A SpikeSlabPrior appropriate for regression models with Student T errors.
62599053d6c5a102081e3618
class HmacAuthV2Handler(AuthHandler, HmacKeys): <NEW_LINE> <INDENT> capability = ['hmac-v2', 'cloudfront'] <NEW_LINE> def __init__(self, host, config, provider): <NEW_LINE> <INDENT> AuthHandler.__init__(self, host, config, provider) <NEW_LINE> HmacKeys.__init__(self, host, config, provider) <NEW_LINE> self._hmac_256 = ...
Implements the simplified HMAC authorization used by CloudFront.
62599053498bea3a75a59020
class AWSElasticBlockStoreVolumeSource(_kuber_definitions.Definition): <NEW_LINE> <INDENT> def __init__( self, fs_type: str = None, partition: int = None, read_only: bool = None, volume_id: str = None, ): <NEW_LINE> <INDENT> super(AWSElasticBlockStoreVolumeSource, self).__init__( api_version="core/v1", kind="AWSElastic...
Represents a Persistent Disk resource in AWS. An AWS EBS disk must exist before mounting to a container. The disk must also be in the same AWS zone as the kubelet. An AWS EBS disk can only be mounted as read/write once. AWS EBS volumes support ownership management and SELinux relabeling.
62599053435de62698e9d2fc
class TargetMap(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_group_by_key(cls, key): <NEW_LINE> <INDENT> for group, keys in dimensions.hierarchy.iteritems(): <NEW_LINE> <INDENT> if key in keys: <NEW_LINE> <INDENT> return group <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def unpack(cls,...
Defined interface of a object which contains data about targeting, possible keys, etc.
62599053d99f1b3c44d06b9a
class MatrixButtons(QtWidgets.QWidget): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.layout = QtWidgets.QGridLayout(self) <NEW_LINE> self.matrix00 = QtWidgets.QLineEdit() <NEW_LINE> self.matrix10 = QtWidgets.QLineEdit() <NEW_LINE> self.matrix20 = QtWidgets.QLineEdit() <...
Widget for PyQt5 with the Matrix input and the buttons ... Attributes ---------- layout: QtWidgets.QGridLayout
62599053462c4b4f79dbceff
class SXDAnalysis(systemtesting.MantidSystemTest): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> ws = Load(Filename='SXD23767.raw', LoadMonitors='Exclude') <NEW_LINE> from time import clock <NEW_LINE> start = clock() <NEW_LINE> QLab = ConvertToDiffractionMDWorkspace(InputWorkspace=ws, OutputDimensions='Q (...
Start of a system test for SXD data analyiss
62599053d53ae8145f91995d
class Asteroid(Wrapper): <NEW_LINE> <INDENT> SMALL = 1 <NEW_LINE> MEDIUM = 2 <NEW_LINE> LARGE = 3 <NEW_LINE> images = {SMALL : games.load_image("asteroid_small.bmp"), MEDIUM : games.load_image("asteroid_med.bmp"), LARGE : games.load_image("asteroid_big.bmp") } <NEW_LINE> SPEED = 2 <NEW_LINE> POINTS = 30 <NEW_LINE> to...
An asteroid which floats across the screen.
6259905307f4c71912bb0935
class Solution: <NEW_LINE> <INDENT> def removeDuplicates(self, A): <NEW_LINE> <INDENT> length = 0 <NEW_LINE> for i in range(len(A)): <NEW_LINE> <INDENT> if i == 0 or A[i] != A[i - 1]: <NEW_LINE> <INDENT> A[length] = A[i] <NEW_LINE> length += 1 <NEW_LINE> <DEDENT> <DEDENT> return length
@param A: a list of integers @return an integer
62599053a79ad1619776b53b
class FormattedExpansion(SageObject): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, tensor): <NEW_LINE> <INDENT> self.tensor = tensor <NEW_LINE> self.txt = None <NEW_LINE> self.latex = None <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> return self.txt <NEW_LINE> <DEDENT> def _latex_(self): <NEW_LINE>...
Helper class for displaying tensor expansions.
62599053379a373c97d9a520
@encoding_stage.tf_style_encoding_stage <NEW_LINE> class PlusOneEncodingStage(encoding_stage.EncodingStageInterface): <NEW_LINE> <INDENT> ENCODED_VALUES_KEY = 'p1_values' <NEW_LINE> ADD_PARAM_KEY = 'p1_add' <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return 'plus_one' <NEW_LINE> <DEDENT> @proper...
[Example] encoding stage, adding 1. This is the simplest example implementation of an `EncodingStageInterface` - no state, no constructor arguments, no shape information needed for decoding, no commutativity with sum.
62599053be8e80087fbc057c
class InfoboxException(Exception): <NEW_LINE> <INDENT> pass
Wird geworfen, falls in einer Infobox Staat wichtige Daten fehlen
625990537b25080760ed875d
class LookupResultSet(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 Twitter in XML format)
62599053e64d504609df9e4e
class TestAttributesApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = AttributesApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_add_attribute(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_add_attributes(self): <...
AttributesApi unit test stubs
62599053507cdc57c63a62a1
class UseFlag(models.Model): <NEW_LINE> <INDENT> name = models.CharField( primary_key = True , max_length = 63 , validators = [use_flag_validator] ) <NEW_LINE> added_on = models.DateTimeField(auto_now_add=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> @models.permalin...
A USE flag.
62599053435de62698e9d2fe
class Crawl_Baidu_Hotkey(Base): <NEW_LINE> <INDENT> __tablename__ = 'crawl_baidu_hotkey' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> time = Column(DateTime, nullable=True) <NEW_LINE> keyword = Column(String(64), nullable=True) <NEW_LINE> order = Column(SmallInteger) <NEW_LINE> state = Column(SmallInteg...
微信新闻类
62599053b7558d58954649a8
class Token(namedtuple('Token', ('value', 'type', 'loc'))): <NEW_LINE> <INDENT> def __new__(cls, value=None, type=None, loc=None): <NEW_LINE> <INDENT> return super(Token, cls).__new__(cls, value, type, loc)
Override __new__ method to create default (None) values for namedtuple >>> Token(value="foobar") Token(value='foobar', type=None, loc=None) >>> Token("foo", "bar") Token(value='foo', type='bar', loc=None)
625990533cc13d1c6d466c3a
class Client(sleekxmpp.ClientXMPP): <NEW_LINE> <INDENT> def __init__(self, lp, jid, password): <NEW_LINE> <INDENT> self.lp = lp <NEW_LINE> sleekxmpp.ClientXMPP.__init__(self, jid, password) <NEW_LINE> self.add_event_handler("session_start", self.session_start) <NEW_LINE> self.add_event_handler("message", self.message) ...
A layer of abstraction over SleekXMPP
6259905382261d6c52730948
class SqlOrder(WorkOrderBase): <NEW_LINE> <INDENT> ordertype = models.ForeignKey(SqlOrderType,blank=True,null=True,on_delete=models.SET_NULL,related_name="sqlorder_type") <NEW_LINE> approver_group = models.ForeignKey(ApprovalGroup,blank=True,null=True,on_delete=models.SET_NULL,related_name="sqlorder_approvergroup") <NE...
SQL工单表
625990538e71fb1e983bcfc7
class ScholarArticleParser120201(ScholarArticleParser): <NEW_LINE> <INDENT> def _parse_article(self, div): <NEW_LINE> <INDENT> self.article = ScholarArticle() <NEW_LINE> for tag in div: <NEW_LINE> <INDENT> if not hasattr(tag, 'name'): <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> if tag.name == 'h3' and self._tag_ha...
This class reflects update to the Scholar results page layout that Google recently.
62599053097d151d1a2c2574
class LdbResultPrinter(StringPrinter): <NEW_LINE> <INDENT> def as_string(self, indent=0): <NEW_LINE> <INDENT> ret = "count = %(count)s, extended = %(extended)s, " "controls = %(controls)s, refs = %(refs)s" % self.val <NEW_LINE> try: <NEW_LINE> <INDENT> count = int(self.val['count']) <NEW_LINE> <DEDENT> e...
print a ldb message element
6259905376e4537e8c3f0a88
class SamplesForm(forms.Form): <NEW_LINE> <INDENT> sample_list = utils.MultipleSamplesField(label=capfirst(_("samples"))) <NEW_LINE> def __init__(self, user, preset_sample, task, data=None, **kwargs): <NEW_LINE> <INDENT> samples = user.my_samples.all() <NEW_LINE> important_samples = set() <NEW_LINE> if task: <NEW_LINE>...
Form for the list selection of samples.
6259905326068e7796d4de45
class DispatchViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Dispatch.objects.all() <NEW_LINE> serializer_class = DispatchSerializer
API endpoint that allows users to be viewed or edited.
6259905316aa5153ce4019e2
class KVStorageMixin(object): <NEW_LINE> <INDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def __delitem__(self, key): <NEW_LINE> <INDENT> raise NotImplementedErr...
A very simple key/value interface to be implemented by storage controllers
625990532ae34c7f260ac5e4
class UserEditForm(FlaskForm): <NEW_LINE> <INDENT> username = StringField('Username', validators=[DataRequired(), Unique(User, User.username, message = 'This username already exsits, please use a different name')]) <NEW_LINE> email = StringField('E-mail', validators=[DataRequired(), Unique(User, User.email, message = '...
Form for editing users.
62599053dc8b845886d54ac3
class ApplicationMetaclass(ABCMeta): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, attrs): <NEW_LINE> <INDENT> definitions = {} <NEW_LINE> for base in bases: <NEW_LINE> <INDENT> if hasattr(base, "definitions") and base.definitions: <NEW_LINE> <INDENT> definitions.update(base.definitions) <NEW_LINE> <DEDENT> <DEDENT...
Inherit definitions from base classes, and let the subclass override any definitions from the base classes.
62599053435de62698e9d301
class IntManipulator(object): <NEW_LINE> <INDENT> def __init__(self, description): <NEW_LINE> <INDENT> self.__description = description <NEW_LINE> <DEDENT> def description(self): <NEW_LINE> <INDENT> return self.__description <NEW_LINE> <DEDENT> def to_string(self, int_value): <NEW_LINE> <INDENT> return str(int_value) <...
Manipulator for simple integers. Since integers are so simple this does almost nothing but it has the same API as other manipulators thus making it easy to blindly do the same thing (e.g. convert to string) all values in a record.
625990533617ad0b5ee07645
class BaseTestWithDB(TestCase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.language = None <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> super(BaseTestWithDB, cls).setUpTestData() <NEW_LINE> cls...
Base test class with methods implemented for Django testing.
625990533cc13d1c6d466c3c
class V1beta1IngressList(object): <NEW_LINE> <INDENT> def __init__(self, kind=None, apiVersion=None, metadata=None, items=None): <NEW_LINE> <INDENT> self.swagger_types = { 'kind': 'str', 'apiVersion': 'str', 'metadata': 'UnversionedListMeta', 'items': 'list[V1beta1Ingress]' } <NEW_LINE> self.attribute_map = { 'kind': '...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
6259905382261d6c52730949