code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class PlayMediaCommand(Command): <NEW_LINE> <INDENT> deserialized_types = { 'object_type': 'str', 'delay': 'int', 'description': 'str', 'when': 'bool', 'audio_track': 'ask_sdk_model.interfaces.alexa.presentation.apl.audio_track.AudioTrack', 'component_id': 'str', 'source': 'list[ask_sdk_model.interfaces.alexa.presentat... | Plays media on a media player (currently only a Video player; audio may be added in the future). The media may be on the background audio track or may be sequenced with speak directives).
:param delay: The delay in milliseconds before this command starts executing; must be non-negative. Defaults to 0.
:type delay: (o... | 625990149b70327d1c57fa8f |
class SearchAndOrganizeUsers(object): <NEW_LINE> <INDENT> def __init__(self, client_id, client_secret, domain): <NEW_LINE> <INDENT> self.client_id = client_id <NEW_LINE> self.client_secret = client_secret <NEW_LINE> self.domain = domain <NEW_LINE> <DEDENT> def AuthorizeClient(self): <NEW_LINE> <INDENT> self.token = gda... | Search users with a pattern and move them to organization. | 625990146fece00bbaccc6c5 |
class thin_film: <NEW_LINE> <INDENT> def __init__ (self, n1, n2, n3, thickness_nm): <NEW_LINE> <INDENT> pass <NEW_LINE> self.n1 = n1 <NEW_LINE> self.n2 = n2 <NEW_LINE> self.n3 = n3 <NEW_LINE> self.thickness_nm = thickness_nm <NEW_LINE> self.too_thick = False <NEW_LINE> def field_reflection_coefficient (n1, n2): <NEW_LI... | A thin film of dielectric material. | 625990158c3a8732951f7273 |
class PinDeleteTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> create_test_users(self) <NEW_LINE> create_test_resources(self) <NEW_LINE> create_test_boards(self) <NEW_LINE> create_test_pins(self) <NEW_LINE> self.client = Client() <NEW_LINE> <DEDENT> def test_urls(self): <NEW_LINE> <INDENT> urls... | Pin deletion test class. | 62599015be8e80087fbbfd83 |
class ApiItem(ApiModel): <NEW_LINE> <INDENT> API_LIST_API_NAME = None <NEW_LINE> API_LIST_CLS = None <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> for attr in self.api_attrs(): <NEW_LINE> <INDENT> setattr(self, attr, kwargs.pop(attr, None)) <NEW_LINE> <DEDENT> for attr, value in kwargs.items(): <NEW_LINE... | Model for a complex item in the API. | 62599015d164cc6175821c90 |
class Animal(ABC): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def eat(self): <NEW_LINE> <INDENT> return NotImplementedError('the eat() should be overridden.') <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def run(self): <NEW_LINE> <INDENT> return Not... | ABC class: Animal | 62599015d18da76e235b77d7 |
@pytest.helpers.register <NEW_LINE> class StubbedGCloudContext: <NEW_LINE> <INDENT> def __init__(self, tmp_path): <NEW_LINE> <INDENT> self._saved_db_path = None <NEW_LINE> self._saved_path = None <NEW_LINE> self.tmp_path = tmp_path <NEW_LINE> self._db_path = tmp_path.joinpath("db") <NEW_LINE> <DEDENT> def __enter__(sel... | Context-manager used to setup the various stub files for our stubbed gcloud
implementation.
Its main goal is conciseness of use above of all else - notably, above clarity or
expressiveness.
Prefer the stubbed_gcloud_ctx fixture to using this as is. | 625990150a366e3fb87dd708 |
class NormalExponentialADF(AbstractADF) : <NEW_LINE> <INDENT> def __init__(self, gammas, bounds=(1.0e-10, np.inf)) : <NEW_LINE> <INDENT> self.n_dims = len(gammas) <NEW_LINE> self.parameters = gammas <NEW_LINE> self.bounds = { "lower" : [bounds[0] for i in range(self.n_dims)], "upper" : [bounds[1] for i in range... | The class for normalized simple exponential ADF. | 62599015bf627c535bcb21c5 |
class AuthenticateError(IOError): <NEW_LINE> <INDENT> pass | An Login error occurred. | 625990155166f23b2e2440e8 |
class NetworkAccess(BBFetchException): <NEW_LINE> <INDENT> def __init__(self, url, cmd): <NEW_LINE> <INDENT> msg = "Network access disabled through BB_NO_NETWORK (or set indirectly due to use of BB_FETCH_PREMIRRORONLY) but access requested with command %s (for url %s)" % (cmd, url) <NEW_LINE> self.url = url <NEW_LINE> ... | Exception raised when network access is disabled but it is required. | 62599015a8ecb03325871f36 |
class GitHubStatus(GitHubCore): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(GitHubStatus, self).__init__({}) <NEW_LINE> self._github_url = 'https://status.github.com/' <NEW_LINE> <DEDENT> def _recipe(self, *args): <NEW_LINE> <INDENT> url = self._build_url(*args) <NEW_LINE> resp = self._get(url) <N... | A sleek interface to the GitHub System Status API. This will only ever
return the JSON objects returned by the API. | 62599015a8ecb03325871f38 |
class RightServiceStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.List = channel.unary_unary( '/wgtwo.auth.v0.RightService/List', request_serializer=wgtwo_dot_auth_dot_v0_dot_rights__pb2.ListRightsRequest.SerializeToString, response_deserializer=wgtwo_dot_auth_dot_v0_dot_rights__... | Missing associated documentation comment in .proto file. | 62599015462c4b4f79dbc723 |
class ImproperRequest (MyExceptions): <NEW_LINE> <INDENT> pass | improper post data | 6259901521a7993f00c66c97 |
class Common(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def handle_error(msg): <NEW_LINE> <INDENT> Logger.log(APP_LOG_DIR, 'ERROR', __name__, msg) <NEW_LINE> with open(SYS_CORE_DIR + 'sys_templates/sys_error.html', 'r') as f: <NEW_LINE> <INDENT> template_content = f.read() <NEW_LINE> <DEDENT> template_vars =... | Common shared functions | 62599015a8ecb03325871f3c |
class figure4Topo(Topo): <NEW_LINE> <INDENT> def __init__(self, sw_path, json_path, thrift_port, pcap_dump, sender_count, senders_sub_name,switch_name,receiver_name, **opts): <NEW_LINE> <INDENT> Topo.__init__(self, **opts) <NEW_LINE> switch = self.addSwitch(switch_name, sw_path=sw_path, json_path=json_path, thrift_port... | figure4Toto with 10 host on the left connected to a simpe_switch(p4) | 62599015462c4b4f79dbc725 |
@utils.use_signature(core.TopLevelFacetSpec) <NEW_LINE> class FacetChart(TopLevelMixin, core.TopLevelFacetSpec): <NEW_LINE> <INDENT> def __init__(self, spec, facet=Undefined, **kwargs): <NEW_LINE> <INDENT> _check_if_valid_subspec(spec, 'FacetChart') <NEW_LINE> super(FacetChart, self).__init__(spec=spec, facet=facet, **... | A Chart with layers within a single panel | 62599015796e427e5384f4a1 |
class savedcmd(object): <NEW_LINE> <INDENT> def __init__(self, path, cmdline): <NEW_LINE> <INDENT> docpath = util.escapestr(path) <NEW_LINE> self.__doc__ = self.__doc__ % {"path": util.uirepr(docpath)} <NEW_LINE> self._cmdline = cmdline <NEW_LINE> <DEDENT> def __call__(self, ui, repo, *pats, **opts): <NEW_LINE> <INDENT... | use external program to diff repository (or selected files)
Show differences between revisions for the specified files, using
the following program::
%(path)s
When two revision arguments are given, then changes are shown
between those revisions. If only one revision is specified then
that revision is compared to... | 6259901556b00c62f0fb35df |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = "%s%s" % (TablePrefix, 'User') <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> name = Column(String(127), nullable=False) <NEW_LINE> email = Column(String(127), nullable=False) <NEW_LINE> picture = Column(String) <NEW_LINE> categories = relationship( 'C... | Table of users and user information | 62599015a8ecb03325871f42 |
class DropObjectFunction(GraphFunction): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__( function_name='drop', possible_arg_nums=[2], arg_split_words=[], arg_find_type=[ {}, {'type': 'carrying', 'from': 0}, {'type': 'all+here', 'from': 0}, ], arg_constraints=[[], is_held_item(1), []], func... | [Actor, object actor is carrying] | 62599015bf627c535bcb21d3 |
class Test (unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dbg = False <NEW_LINE> self.env = {} <NEW_LINE> self.env["CONFIG_FILE"] = "config.json" <NEW_LINE> self.config = utils.read_config(self.env) <NEW_LINE> <DEDENT> def test_get_par_flags(self): <NEW_LINE> <INDENT> config = self.c... | Unit test for the verilog pre-processor module | 625990156fece00bbaccc6d9 |
class Menu(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length=1024) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get_menu(cls, id=None): <NEW_LINE> <INDENT> cls_obj = cls.ob... | Model to store Menu - Breakfast/Dinner/Drinks | 625990150a366e3fb87dd718 |
class TestModuletemplate(unittest.TestCase): <NEW_LINE> <INDENT> default_options = { '_debug': False, '__logging': True, '__outputfilter': None, '_useragent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0', '_dnsserver': '', '_fetchtimeout': 5, '_internettlds': 'https://publicsuffix.or... | Test modules.sfp_template | 62599015796e427e5384f4a5 |
class Text(Field): <NEW_LINE> <INDENT> pass | This field class matches the SQLite field type "TEXT" | 625990155166f23b2e2440f6 |
class Config(object): <NEW_LINE> <INDENT> def __init__(self, name, mapping): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.mapping = mapping <NEW_LINE> self.result = None <NEW_LINE> self.start_time = None <NEW_LINE> self.end_time = None <NEW_LINE> self.naarad_id = None <NEW_LINE> self.message = "" | Structure used to stores information about a configuration during runtime | 62599015507cdc57c63a5ac6 |
class PrimitiveProcedure(Procedure): <NEW_LINE> <INDENT> def __init__(self, fn, use_env=False, name='primitive'): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fn = fn <NEW_LINE> self.use_env = use_env <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '#[{0}]'.format(self.name) <NEW_LINE> <DEDENT... | A Scheme procedure defined as a Python function. | 62599015a8ecb03325871f44 |
class CharmCinder(CharmBase): <NEW_LINE> <INDENT> charm_name = 'cinder' <NEW_LINE> charm_rev = 12 <NEW_LINE> display_name = 'Cinder' <NEW_LINE> menuable = True <NEW_LINE> related = [('cinder:image-service', 'glance:image-service'), ('cinder:storage-backend', 'cinder-ceph:storage-backend'), ('rabbitmq-server:amqp', 'cin... | Cinder directives | 62599015507cdc57c63a5ac8 |
class FlickrAccount(AbstractServiceAccount): <NEW_LINE> <INDENT> persona = models.ForeignKey(OnlinePersona, related_name="flickr_accounts") <NEW_LINE> userid = models.CharField(blank=True, max_length=20, editable=False) <NEW_LINE> api_key = models.CharField(blank=False, max_length=32) <NEW_LINE> api_secret = models.Cha... | Describes all of the authentication credentials required for accesing
photos from a specific Flickr user. | 6259901521a7993f00c66ca3 |
class _BottleneckResidualInner(tf.keras.Model): <NEW_LINE> <INDENT> def __init__(self, filters, strides, input_shape, batch_norm_first=True, data_format="channels_first", fused=True, dtype=tf.float32): <NEW_LINE> <INDENT> super(_BottleneckResidualInner, self).__init__() <NEW_LINE> axis = 1 if data_format == "channels_f... | Single bottleneck residual inner function contained in _Resdual.
Corresponds to the `F`/`G` functions in the paper.
Suitable for training on ImageNet dataset. | 6259901556b00c62f0fb35e7 |
class FlickConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL <NEW_LINE> async def _validate_input(self, user_input): <NEW_LINE> <INDENT> auth = SimpleFlickAuth( username=user_input[CONF_USERNAME], password=user_input[... | Flick config flow. | 62599015d18da76e235b77e3 |
class FullSegmentBinding(Binding, ReferencedToObjects): <NEW_LINE> <INDENT> _n_objects = 1 <NEW_LINE> @contract(margin='number, >0', segment='$Segment') <NEW_LINE> def __init__(self, margin, segment): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._margin = margin <NEW_LINE> if not isinstance(segment, Segment):... | Binding to all segment (not to point).
Parameters
----------
margin: int or float
Margin of zone to bind (distance from segment to binding zone border).
segment: Segment
Segment for binding. | 62599015925a0f43d25e8d6e |
class TestMaxSizeCalc(base.MaxSizeTestCase): <NEW_LINE> <INDENT> def afterSetUp(self): <NEW_LINE> <INDENT> self.registry = queryUtility(IRegistry) <NEW_LINE> self.settings = self.registry.forInterface(ILimitFileSizePanel, check=False) <NEW_LINE> <DEDENT> def test_size_from_registry(self): <NEW_LINE> <INDENT> validator ... | This test cover the file/image size validation monkeypatch.
File/Image at validates using zconf.ATFile.max_file_size, so we
check only this case | 6259901556b00c62f0fb35eb |
class TestAndorCam2(unittest.TestCase, VirtualTestAndorCam): <NEW_LINE> <INDENT> camera_type = andorcam2.AndorCam2 <NEW_LINE> camera_args = (0,) <NEW_LINE> def test_binning(self): <NEW_LINE> <INDENT> camera = self.camera_type(*self.camera_args) <NEW_LINE> self.size = camera.getSensorResolution() <NEW_LINE> exposure = 0... | Test directly the AndorCam2 class. | 625990156fece00bbaccc6e3 |
class TCA6408(object): <NEW_LINE> <INDENT> pins = ( 'PWR-GOOD-3.6V', 'PWR-GOOD-1.1V', 'PWR-GOOD-2.0V', 'PWR-GOOD-5.4V', 'PWR-GOOD-5.5V', ) <NEW_LINE> def __init__(self, i2c_dev): <NEW_LINE> <INDENT> assert i2c_dev is not None <NEW_LINE> self._gpios = SysFSGPIO({'device/name': 'tca6408'}, 0x3F, 0x00, 0x00, i2c_dev) <NEW... | Abstraction layer for the port/gpio expander | 62599015507cdc57c63a5ad0 |
class QGyroscope(QSensor): <NEW_LINE> <INDENT> def childEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def connectNotify(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def customEvent(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def disconnectNot... | QGyroscope(parent: QObject = None) | 62599015d164cc6175821cae |
class PublishDrop3Test(BaseTest): <NEW_LINE> <INDENT> fixtureDB = True <NEW_LINE> fixturePool = True <NEW_LINE> fixtureCmds = [ "aptly snapshot create snap1 from mirror gnuplot-maverick", "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=sq1 snap1", "aptly publish snap... | publish drop: drop one distribution | 625990165166f23b2e244102 |
class PublishedManager(models.Manager): <NEW_LINE> <INDENT> use_for_related_fields = True <NEW_LINE> def active(self): <NEW_LINE> <INDENT> return self.filter(status='published') | Custom manager for showing published stuff. | 62599016925a0f43d25e8d72 |
class GeolocationError(Exception): <NEW_LINE> <INDENT> pass | Exception raised when a postal code / city
doesn't exist or is misformed | 6259901656b00c62f0fb35ef |
class TestXmlNs0FindIssuesRequest(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 testXmlNs0FindIssuesRequest(self): <NEW_LINE> <INDENT> pass | XmlNs0FindIssuesRequest unit test stubs | 62599016bf627c535bcb21e1 |
class LogWriter(ReportWriter): <NEW_LINE> <INDENT> type_name = 'log' <NEW_LINE> def __init__(self, logger_name: str = 'wrktoolbox'): <NEW_LINE> <INDENT> self.logger = logging.getLogger(logger_name) <NEW_LINE> <DEDENT> def write(self, report: SuiteReport): <NEW_LINE> <INDENT> self.logger.info(str(report.suite)) <NEW_LIN... | A writer that outputs to a logger. | 6259901621a7993f00c66cad |
class CodeSystemFilter(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "CodeSystemFilter" <NEW_LINE> def __init__(self, jsondict=None, strict=True): <NEW_LINE> <INDENT> self.code = None <NEW_LINE> self.description = None <NEW_LINE> self.operator = None <NEW_LINE> self.value = None <NEW_LINE> super... | Filter that can be used in a value set.
A filter that can be used in a value set compose statement when selecting
concepts using a filter. | 625990166fece00bbaccc6e9 |
class _TrueMatcher(AbstractMatcher): <NEW_LINE> <INDENT> def match(self, message: Message) -> bool: <NEW_LINE> <INDENT> return True | Always true | 625990169b70327d1c57fab5 |
class S3MavenIndex(AmazonS3): <NEW_LINE> <INDENT> _INDEX_DIRNAME = 'central-index' <NEW_LINE> _INDEX_ARCHIVE = _INDEX_DIRNAME + '.zip' <NEW_LINE> _LAST_OFFSET_OBJECT_KEY = 'last_offset.json' <NEW_LINE> _DEFAULT_LAST_OFFSET = 0 <NEW_LINE> def store_index(self, target_dir): <NEW_LINE> <INDENT> with TemporaryDirectory() a... | S3 storage for maven index. | 62599016bf627c535bcb21e7 |
class TestCallTimeout(TestService): <NEW_LINE> <INDENT> __test__ = False <NEW_LINE> class PeriodicLogScrape: <NEW_LINE> <INDENT> def __init__(self, service): <NEW_LINE> <INDENT> self.service = service <NEW_LINE> <DEDENT> def on_timer_task(self, event): <NEW_LINE> <INDENT> log = self.service.qm.get_log() <NEW_LINE> for ... | test that the timeout is handled properly | 625990165e10d32532ce3fa3 |
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> related_name =... | Database model for users in the system | 625990165166f23b2e24410a |
class RateDisabledError(Exception): <NEW_LINE> <INDENT> pass | Rate disabled error | 62599016be8e80087fbbfdab |
class MetaMonitor(type): <NEW_LINE> <INDENT> @property <NEW_LINE> def etl_id(cls): <NEW_LINE> <INDENT> if cls._trace_key is None: <NEW_LINE> <INDENT> cls._trace_key = trace_key() <NEW_LINE> <DEDENT> return cls._trace_key <NEW_LINE> <DEDENT> @property <NEW_LINE> def environment(cls): <NEW_LINE> <INDENT> if cls._environm... | Metaclass to implement read-only attributes of our ETL's Monitor.
If you need to find out the current trace key, call Monitor.etl_id.
If you want to know the "environment" (selected by using --prefix or the user's login),
then use Monitor.environment.
If you want to know the runtime environment (EMR, instance, step), ... | 62599016507cdc57c63a5ada |
class SynnefoFilterProcessor(Processor): <NEW_LINE> <INDENT> def is_active(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def filter_extra(self, data): <NEW_LINE> <INDENT> if not self.is_active(): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> request = data.get('request', None) <NEW_LINE> if request is not... | Filter out Synnefo sensitive values | 62599016be8e80087fbbfdad |
class PBKDF2PasswordHasher(BasePasswordHasher): <NEW_LINE> <INDENT> algorithm = "pbkdf2_sha256" <NEW_LINE> iterations = 15000 <NEW_LINE> digest = hashlib.sha256 <NEW_LINE> def encode(self, password, salt, iterations=None): <NEW_LINE> <INDENT> assert password is not None <NEW_LINE> assert salt and '$' not in salt <NEW_L... | Secure password hashing using the PBKDF2 algorithm (recommended)
Configured to use PBKDF2 + HMAC + SHA256 with 15000 iterations.
The result is a 64 byte binary string. Iterations may be changed
safely but you must rename the algorithm if you change SHA256. | 6259901656b00c62f0fb35f9 |
class AbsoluteSpec(Specification): <NEW_LINE> <INDENT> def __init__(self, amount): <NEW_LINE> <INDENT> self.amount = amount | AbsoluteSpec class. | 62599016a8ecb03325871f5a |
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, user_name=None, password=None): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError('Users must have an email address') <NEW_LINE> <DEDENT> user = self.model( email=self.normalize_email(email), user_name=user_name) <... | manager for creating user and super user. | 62599016d164cc6175821cba |
class ClassControllerServicer(object): <NEW_LINE> <INDENT> def List(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def GetCommonClas... | Missing associated documentation comment in .proto file. | 625990166fece00bbaccc6f1 |
class Reco_face(object): <NEW_LINE> <INDENT> def __init__(self, source="Images/cap_default.jpg"): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> <DEDENT> def find_face(self): <NEW_LINE> <INDENT> image = face_recognition.load_image_file(self.source) <NEW_LINE> face_locations = face_recognition.face_locations(image)... | Reconnaissance faciale.
| 62599016d18da76e235b77ec |
class ConnectDB(object): <NEW_LINE> <INDENT> def __init__(self, path, name): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.name = name <NEW_LINE> self.connection = None <NEW_LINE> self.cursor = None <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> self.connection = dataBase.sqlite3.connect(self.path + ... | Class connect db est une classe abstraite qui permet de se connecter a une base de donnée sqlite3 | 625990160a366e3fb87dd732 |
class Greatsword(Weapon): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__( name="Greatsword", multiplier=2, damage_die=6, ) | Class handling the Greatsword weapon type.
The greatsword deals 2d6 damage. | 625990160a366e3fb87dd734 |
class InvalidProtoError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "InvalidProtoError error: %s" % self.msg | Exception class raised in the event of an invalid protocol passed
through a protocol message.
This error is from supplying a protocol function call with an invalid
protocol argument to specify an action the caller is to take. | 625990165e10d32532ce3fa8 |
class UserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, nick: str, password: str=None, **kwargs): <NEW_LINE> <INDENT> user = self.model(nick=nick, **kwargs) <NEW_LINE> user.set_password(password) <NEW_LINE> user.save() <NEW_LINE> return user <NEW_LINE> <DEDENT> def create_superuser(self, nick: str... | The user manager class | 625990160a366e3fb87dd736 |
class puError(Exception): <NEW_LINE> <INDENT> def __init__( self, dW, sender, engLogMessage, czeStatusBarMessage=None, czeMessageBarMessage=None, duration=20): <NEW_LINE> <INDENT> super(Exception, self).__init__(dW) <NEW_LINE> dW.display_error_messages( sender, engLogMessage, czeStatusBarMessage, czeMessageBarMessage, ... | A custom exception. | 62599016d164cc6175821cc0 |
class TenantServiceVolume(BaseModel): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> db_table = 'tenant_service_volume' <NEW_LINE> <DEDENT> SHARE = 'share-file' <NEW_LINE> LOCAL = 'local' <NEW_LINE> TMPFS = 'memoryfs' <NEW_LINE> service_id = models.CharField(max_length=32, help_text=u"组件id") <NEW_LINE> category = ... | 数据持久化表格 | 625990165166f23b2e244114 |
class LargeRock(Asteroid): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("images/meteorGrey_big1.png") <NEW_LINE> self.center.x = random.randint(1, 50) <NEW_LINE> self.center.y = random.randint(1, 150) <NEW_LINE> self.direction = random.randint(1, 50) <NEW_LINE> self.speed = BIG_ROCK_SPEE... | Represents a large asteroid | 62599016507cdc57c63a5ae4 |
class Combine(): <NEW_LINE> <INDENT> def __init__(self, operations, combine_op=torch.sum): <NEW_LINE> <INDENT> self.operations = operations <NEW_LINE> self.combine_op = combine_op <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> if len(self.operations) == 0: <NEW_LINE> <INDENT> return <NEW_L... | Applies different operations to an input and combines its output.
Arguments:
operations (list): List of operations
combine_op (function): Function used to combine the results of all the operations. | 62599016bf627c535bcb21f3 |
class SPEFile(BaseFileWriter): <NEW_LINE> <INDENT> def __init__(self, **kwds): <NEW_LINE> <INDENT> super().__init__(**kwds) <NEW_LINE> self.fp = open(self.filename, "wb") <NEW_LINE> header = chr(0) * 4100 <NEW_LINE> self.fp.write(header) <NEW_LINE> self.fp.seek(34) <NEW_LINE> self.fp.write(struct.pack("h", -1)) <NEW_LI... | SPE file writing class.
FIXME: This has not been tested, could be broken.. | 625990169b70327d1c57fac4 |
class EmptyFeature(Feature): <NEW_LINE> <INDENT> icon = '.' <NEW_LINE> blocks_light = False <NEW_LINE> blocks_movement = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__(self.blocks_light, self.blocks_movement, self.icon) <NEW_LINE> <DEDENT> def inspect(self): <NEW_LINE> <INDENT> return "empty ... | An empty feature that omits both light and movement.
| 625990166fece00bbaccc6f9 |
class BaseModel(Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> database = db | Base model class for Habito. | 625990169b70327d1c57fac6 |
class TestSite(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestSite, self).setUp() <NEW_LINE> self.username = "test_user" <NEW_LINE> self.url = reverse("create_account") <NEW_LINE> self.params = { "username": self.username, "email": "test@example.org", "password": "testpass", "name": "Test... | Test for Account Creation from white labeled Sites | 62599016925a0f43d25e8d86 |
class Renew(Service): <NEW_LINE> <INDENT> def reply(self): <NEW_LINE> <INDENT> plugin = None <NEW_LINE> acl_users = getToolByName(self, "acl_users") <NEW_LINE> plugins = acl_users._getOb('plugins') <NEW_LINE> authenticators = plugins.listPlugins(IAuthenticationPlugin) <NEW_LINE> for id_, authenticator in authenticators... | Renew authentication token
| 62599016507cdc57c63a5aea |
class App(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.next_window = 'main_menu' <NEW_LINE> self.config = parse_settings.Settings_Parser() <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> program_finished = False <NEW_LINE> while not program_finished: <NEW_LINE> <INDENT> if self.next_window... | Manages controls the program | 62599016bf627c535bcb21f9 |
class Licence(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Licence' <NEW_LINE> verbose_name_plural = 'Licences' <NEW_LINE> <DEDENT> code = models.CharField('Code', max_length=20) <NEW_LINE> title = models.CharField('Titre', max_length=80) <NEW_LINE> description = models.TextField('... | Publication licence. | 6259901621a7993f00c66cc5 |
class FileCacher(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.out = [] <NEW_LINE> <DEDENT> def write(self, line): <NEW_LINE> <INDENT> self.out.append(line) <NEW_LINE> <DEDENT> def flush(self): <NEW_LINE> <INDENT> if '\n' ... | Class for caching the stdout text. | 625990166fece00bbaccc6ff |
class DescribeClusterKubeconfigResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Kubeconfig = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Kubeconfig = params.get("Kubeconfig") <NEW_LINE> self.RequestId = param... | DescribeClusterKubeconfig response structure.
| 62599016796e427e5384f4cb |
class Example: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.swaggerTypes = { 'id': 'int', 'exampleId': 'int', 'title': 'str', 'text': 'str', 'score': 'ScoredWord', 'sentence': 'Sentence', 'word': 'str', 'provider': 'ContentProvider', 'year': 'int', 'rating': 'float', 'documentId': 'int', 'url': 'str... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259901656b00c62f0fb3608 |
class Spindle(Package): <NEW_LINE> <INDENT> homepage = "https://computation-rnd.llnl.gov/spindle" <NEW_LINE> url = "https://github.com/hpc/Spindle/archive/v0.8.1.tar.gz" <NEW_LINE> list_url = "https://github.com/hpc/Spindle/releases" <NEW_LINE> version('0.8.1', 'f11793a6b9d8df2cd231fccb2857d912') <NEW_LINE> depend... | Spindle improves the library-loading performance of dynamically
linked HPC applications. Without Spindle large MPI jobs can
overload on a shared file system when loading dynamically
linked libraries, causing site-wide performance problems. | 625990168c3a8732951f72b0 |
class ModStatusOutputNative(ModInput): <NEW_LINE> <INDENT> def __init__(self, physical_source_addr: LcnAddr, output_id: int, value: int): <NEW_LINE> <INDENT> super().__init__(physical_source_addr) <NEW_LINE> self.output_id = output_id <NEW_LINE> self.value = value <NEW_LINE> <DEDENT> def get_output_id(self) -> int: <NE... | Status of an output-port in native units received from an LCN module. | 6259901621a7993f00c66ccb |
class Position(Vector3): <NEW_LINE> <INDENT> __slots__ = () | Represents the position of an object in the world.
A position consists of its x, y and z values in millimeters.
Args:
x (float): X position in millimeters
y (float): Y position in millimeters
z (float): Z position in millimeters | 625990166fece00bbaccc705 |
class DeleteLaunchConfigurationRequest(object): <NEW_LINE> <INDENT> swagger_types = { 'region_code': 'str', 'launch_configuration_no': 'str' } <NEW_LINE> attribute_map = { 'region_code': 'regionCode', 'launch_configuration_no': 'launchConfigurationNo' } <NEW_LINE> def __init__(self, region_code=None, launch_configurati... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62599016507cdc57c63a5af2 |
class MainWindow(QtWidgets.QMainWindow): <NEW_LINE> <INDENT> def __init__(self, ps, parent: QtWidgets.QWidget=None): <NEW_LINE> <INDENT> super().__init__(parent) <NEW_LINE> self.setWindowTitle("Univerzitet Singidunum") <NEW_LINE> self.resize(1400, 700) <NEW_LINE> self.setWindowIcon(QtGui.QIcon("resources/icons/abacus.p... | Klasa koja predstavlja glavni prozor aplikacije. | 62599016d164cc6175821cce |
@implementer(interfaces.IAction) <NEW_LINE> class Action(Component): <NEW_LINE> <INDENT> prefix = 'action' <NEW_LINE> mode = 'input' <NEW_LINE> description = None <NEW_LINE> accesskey = None <NEW_LINE> postOnly = markers.DEFAULT <NEW_LINE> html5Validation = True <NEW_LINE> htmlAttributes = {} <NEW_LINE> def __init__(se... | A form action.
| 625990168c3a8732951f72b2 |
class SpeciesDefinition(object): <NEW_LINE> <INDENT> def __init__(self, lhs, rhs): <NEW_LINE> <INDENT> self.lhs = lhs <NEW_LINE> self.rhs = rhs <NEW_LINE> <DEDENT> behaviours = pyparsing.delimitedList(Behaviour.grammar, delim="+") <NEW_LINE> grammar = identifier + "=" + pyparsing.Group(behaviours) + ";" <NEW_LINE> list... | Class that represents a ProPPA species definition. We store the name
and the right hand side of the definition which is a list of behaviours
the species is involved in. | 62599016be8e80087fbbfdc2 |
class HeatEquationDescriptor(BVPDescriptor): <NEW_LINE> <INDENT> def __init__(self, diffusivity=1, boundary_conditions=BOUNDARY_CONDITION_HOMOGENEOUS_NEUMANN, source_function=lambda t, x: 0): <NEW_LINE> <INDENT> super().__init__(boundary_conditions, source_function) <NEW_LINE> self.diffusivity = diffusivity <NEW_LINE> ... | A BVPDescriptor for the heat Equation,
dy/dt = a d^2y/dx^2 + source_function.
Defaults to homogeneous Neumann boundary conditions (zero derivative at the edges. Physically this corresponds to
perfect insulators at both ends), a diffusivity of 1 and no source function.
This implementation is currently extremely uns... | 625990178c3a8732951f72b4 |
class MnemonicReader(nn.Module): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super(MnemonicReader, self).__init__() <NEW_LINE> self.args = args <NEW_LINE> self.w_embedding = nn.Embedding(args.w_vocab_size, args.w_embedding_dim, padding_idx=0) <NEW_LINE> self.c_embedding = nn.Embedding(args.c_vocab... | TODO: Documentation | 62599017d18da76e235b77f7 |
class Solution(object): <NEW_LINE> <INDENT> def longestPalindrome(self, s): <NEW_LINE> <INDENT> l = len(s) <NEW_LINE> isPalindrome = [[False]*l for _ in range(l)] <NEW_LINE> maxl = 0 <NEW_LINE> res = "" <NEW_LINE> for length in range(l): <NEW_LINE> <INDENT> for i in range(l): <NEW_LINE> <INDENT> j = i + length <NEW_LIN... | dynamic programming:
isPalindrome[i][j] = isPalindrome[i+1][j-1] && s[i] == s[j]
time: O(n**2)
space: O(n**2) | 62599017796e427e5384f4d3 |
class RechargeSettingsView(mixins.CreateModelMixin, mixins.UpdateModelMixin, mixins.RetrieveModelMixin, mixins.ListModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = RechargeSettings.objects.all() <NEW_LINE> serializer_class = serializers.RechargeSettingsSerializer <NEW_LINE> permission_classes = (Per... | create:
创建充值配置
update:
更新充值配置
retrieve:
充值配置详情
list:
所有充值配置 | 62599017a8ecb03325871f72 |
class Minimax(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Minimax, self).__init__() <NEW_LINE> <DEDENT> def minimaxDecision(self, state): <NEW_LINE> <INDENT> v = self.maxValue(state) <NEW_LINE> return [action for action, successorState in self.successors(state) if self.utility(action) == ... | docstring for TronMiniMax | 625990175166f23b2e244127 |
class FirstHeaderLineIsContinuationDefect(MessageDefect): <NEW_LINE> <INDENT> pass | A message had a continuation line as its first header line. | 625990179b70327d1c57fad8 |
class Register(UserMixin, TemplateView): <NEW_LINE> <INDENT> template_name = INVITER_FORM_TEMPLATE <NEW_LINE> form = import_attribute(FORM) <NEW_LINE> @property <NEW_LINE> def redirect_url(self): <NEW_LINE> <INDENT> return getattr(settings, 'INVITER_REDIRECT', 'inviter2:done') <NEW_LINE> <DEDENT> def get(self, request,... | A registration view for invited users. The user model already exists - this
view just takes care of setting a password and username, and maybe update
the email address. Anywho - one can customize the form that is used. | 62599017d18da76e235b77f9 |
class BlueNoise(ColoredNoise): <NEW_LINE> <INDENT> def __init__(self, t=1, rng=None): <NEW_LINE> <INDENT> super().__init__(beta=-1, t=t, rng=rng) | Blue noise.
.. image:: _static/blue_noise.png
:scale: 50%
Colored noise, or power law noise with spectral density exponent
:math:`\beta = -1`.
:param float t: the right hand endpoint of the time interval :math:`[0,t]`
for the process
:param numpy.random.Generator rng: a custom random number generator | 6259901721a7993f00c66cd3 |
class PointerBehaviour(RaycastBehaviour): <NEW_LINE> <INDENT> def __init__(self, canvas: "EditCanvas"): <NEW_LINE> <INDENT> super().__init__(canvas) <NEW_LINE> self._pointer_moved = True <NEW_LINE> self._pointer_distance = 10 <NEW_LINE> self._pointer = RenderSelection( self.canvas.context_identifier, self.canvas.render... | Adds the behaviour of the selection pointer. | 62599017925a0f43d25e8d98 |
class Jacobian(object): <NEW_LINE> <INDENT> def __init__(self, solver, delta=1e-6): <NEW_LINE> <INDENT> self.jacobian = np.zeros((solver.size(), solver.size()), dtype=float) <NEW_LINE> self.solver = solver <NEW_LINE> self.delta = delta <NEW_LINE> <DEDENT> @property <NEW_LINE> def dxdt(self): <NEW_LINE> <INDENT> return ... | Approximates the jacobian for a cmf solver
J[i,j] = (dxdt(S_i,t)[j]-dxdt(S,t)[j])/delta
S is the state vector
S_i equals S, except for S_i[i]=S[i]+delta
delta is the finite difference to approximate the Jacobian.
delta should be a small number, but big enough to avoid floating point errors.
1e-6 to 1e-9 should... | 625990175166f23b2e244129 |
class Created(Response): <NEW_LINE> <INDENT> status = 201 | 201 Created
Must be used to indicate successful resource creation.
A REST API responds with the 201 status code whenever a collection creates,
or a store adds, a new resource at the client's request. There may also be
times when a new resource is created as a result of some controller action,
in which case 201 would a... | 625990178c3a8732951f72ba |
class XMLSerializer: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.generator = None <NEW_LINE> <DEDENT> def serialize(self, data): <NEW_LINE> <INDENT> if not isinstance(data, dict): <NEW_LINE> <INDENT> raise SerializationException("Can't serialize data, must be a dictionary.") <NEW_LINE> <DEDENT> str... | Serializes data to XML | 625990170a366e3fb87dd74e |
class SetupError(Error): <NEW_LINE> <INDENT> pass | Jurt not properly installed not the system | 62599017be8e80087fbbfdcc |
@transformations.coordinate_alias('fk5') <NEW_LINE> class FK5Coordinates(SphericalCoordinatesBase): <NEW_LINE> <INDENT> __doc__ = __doc__.format(params=SphericalCoordinatesBase._init_docstring_param_templ.format(lonnm='ra', latnm='dec')) <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(FK5Coord... | A coordinate in the FK5 system.
Parameters
----------
{params}
equinox : `~astropy.time.Time`, optional
The equinox for these coordinates. Defaults to J2000.
obstime : `~astropy.time.Time` or None
The time of observation for this coordinate. If None, it will be taken
to be the same as the `equinox`.
Alt... | 625990175e10d32532ce3fb6 |
class Card: <NEW_LINE> <INDENT> def __init__(self, number, suit, location=None): <NEW_LINE> <INDENT> assert Card.__is_valid(number), "Invalid number of card" <NEW_LINE> self._number = number <NEW_LINE> self._suit = suit <NEW_LINE> self._color = suit.get_color_name() <NEW_LINE> self._location = location <NEW_LINE> <DEDE... | This is the Card Class
Color will have two types : red and black, red will be using a 0 value and black will using 1 as a constant.
The Color will be using Enum Type of color inside cardcolor.
Inside a card, a number will be assigned for each card from 1 (Ace) to 13 (King).
shape will have four types : diamonds, hearts... | 625990170a366e3fb87dd754 |
class AttachmentColumn(tables.WrappingColumn): <NEW_LINE> <INDENT> instance_detail_url = "horizon:project:instances:detail" <NEW_LINE> def get_raw_data(self, volume): <NEW_LINE> <INDENT> request = self.table.request <NEW_LINE> link = _('%(dev)s on %(instance)s') <NEW_LINE> attachments = [] <NEW_LINE> for attachment in ... | Customized column class.
So it that does complex processing on the attachments
for a volume instance. | 625990175e10d32532ce3fb7 |
class TestLoyaltyStatistics(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return LoyaltyStatis... | LoyaltyStatistics unit test stubs | 62599017507cdc57c63a5b01 |
class TestInRangeQuirks(TestInRange): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.purge() <NEW_LINE> self.quirks = True | Test in range selectors with quirks. | 625990178c3a8732951f72c2 |
class overlayStaves(PluginFunction): <NEW_LINE> <INDENT> category = "Stable Paths Toolkit" <NEW_LINE> return_type = ImageType([RGB]) <NEW_LINE> self_type = ImageType([RGB]) <NEW_LINE> args = Args([ImageType(ONEBIT, 'Primary Image')]) | Overlays the found staves from one image onto another image | 625990179b70327d1c57fae2 |
class Code(object): <NEW_LINE> <INDENT> def __init__(self, rawcode): <NEW_LINE> <INDENT> if not hasattr(rawcode, "co_filename"): <NEW_LINE> <INDENT> rawcode = py.code.getrawcode(rawcode) <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> self.filename = rawcode.co_filename <NEW_LINE> self.firstlineno = rawcode.co_firstlineno... | wrapper around Python code objects | 625990176fece00bbaccc718 |
class _Client(_http_client.JsonHttpClient): <NEW_LINE> <INDENT> def __init__(self, credential, base_url, timeout, params=None): <NEW_LINE> <INDENT> super().__init__( credential=credential, base_url=base_url, timeout=timeout, headers={'User-Agent': _USER_AGENT}) <NEW_LINE> self.credential = credential <NEW_LINE> self.pa... | HTTP client used to make REST calls.
_Client maintains an HTTP session, and handles authenticating HTTP requests along with
marshalling and unmarshalling of JSON data. | 6259901756b00c62f0fb3621 |
class _DictValues(object): <NEW_LINE> <INDENT> def __init__(self, dct): <NEW_LINE> <INDENT> self._dict = dct <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self._dict[key]['value'] <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> self._dict[key]['value'] = value <NE... | A dict-like wrapper for a dict of metadata, where getitem returns 'value' from metadata. | 625990175166f23b2e244135 |
class Din(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> d_id = db.Column(db.Integer) <NEW_LINE> index = db.Column(db.Integer) <NEW_LINE> type = db.Column(db.Integer) <NEW_LINE> confirm_time = db.Column(db.Integer) <NEW_LINE> hr24 = db.Column(db.Integer) <NEW_LINE> start_value = ... | 数字量输入 Digit IN | 625990170a366e3fb87dd758 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.