code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class FiliereAdmission(models.Model): <NEW_LINE> <INDENT> nom = models.CharField(max_length=50, unique=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return u'%s' % self.nom <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = u"Filière d'origine" <NEW_LINE> verbose_name_plural = u"Fil... | This model lists all possible 'filières' that a student
could have studied in before BS | 62598ef27d847024c075abfd |
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.__width = width <NEW_LINE> self.__height = height <NEW_LINE> type(self).number_of_instances += 1 <NEW_LINE> <DEDENT> @property <NEW_LINE> def width(self): <NEW_LINE> <INDENT> return(se... | This is a class Rectangle defined by private attr width and height.
Attributes:
number_of_instances: incremented during new instance and decremented
during deletion
__height: int
__weight: int | 62598ef2851cf427c66b6af2 |
@implementer(IStep) <NEW_LINE> @attributes(['server_id']) <NEW_LINE> class DeleteServer(object): <NEW_LINE> <INDENT> def as_effect(self): <NEW_LINE> <INDENT> eff = service_request( ServiceType.CLOUD_SERVERS, 'DELETE', append_segments('servers', self.server_id), success_pred=has_code(204, 404)) <NEW_LINE> def report_suc... | A server must be deleted.
:ivar str server_id: a Nova server ID. | 62598ef2379a373c97d97825 |
class Meta: <NEW_LINE> <INDENT> model = Leave <NEW_LINE> fields = ( "id", "date", "description", "staff_member", ) | Meta. | 62598ef210dbd63aa1c6f3a6 |
class FakeInput(six.StringIO): <NEW_LINE> <INDENT> def __init__(self, buff=None): <NEW_LINE> <INDENT> six.StringIO.__init__(self, buff or '') <NEW_LINE> <DEDENT> def fileno(self): <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> def isatty(self): <NEW_LINE> <INDENT> return True | Fake input object | 62598ef27b25080760ed5cc9 |
class OverSamplingCallback(LearnerCallback): <NEW_LINE> <INDENT> def __init__(self,learn:Learner,weights:torch.Tensor=None): <NEW_LINE> <INDENT> super().__init__(learn) <NEW_LINE> self.weights = weights <NEW_LINE> <DEDENT> def on_train_begin(self, **kwargs): <NEW_LINE> <INDENT> ds,dl = self.data.train_ds,self.data.trai... | The OverSamplingCallback support handles unbalanced dataset (dataset with rare classes). It is used to oversample data during training. | 62598ef25fdd1c0f98e5c7d0 |
class ConfigMissingApiurl(ConfigError): <NEW_LINE> <INDENT> def __init__(self, msg, fname, url): <NEW_LINE> <INDENT> ConfigError.__init__(self, msg, fname) <NEW_LINE> self.url = url | Exception raised when a apiurl does not exist in the config file | 62598ef230bbd72246468463 |
class EmptySet(Set): <NEW_LINE> <INDENT> __metaclass__ = Singleton <NEW_LINE> def _intersect(self, other): <NEW_LINE> <INDENT> return S.EmptySet <NEW_LINE> <DEDENT> @property <NEW_LINE> def _complement(self): <NEW_LINE> <INDENT> return Interval(S.NegativeInfinity, S.Infinity) <NEW_LINE> <DEDENT> @property <NEW_LINE> de... | Represents the empty set. The empty set is available as a singleton
as S.EmptySet.
Examples:
>>> from sympy import S, Interval
>>> S.EmptySet
EmptySet()
>>> Interval(1, 2).intersect(S.EmptySet)
EmptySet() | 62598ef2aad79263cf42d03c |
class Unit: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.left = self.right = self.up = self.down = self <NEW_LINE> <DEDENT> def remove_h(self): <NEW_LINE> <INDENT> self.left.right, self.right.left = self.right, self.left <NEW_LINE> <DEDENT> def remove_v(self): <NEW_LINE> <INDENT> self.up.down, self.... | Data unit of DLX algorithm. | 62598ef2009cb60464cffd7e |
@dataclass <NEW_LINE> class PlotUnit: <NEW_LINE> <INDENT> mse_data: list = field(default_factory=list) <NEW_LINE> obj: object = None | A MSE Value | 62598ef2bd1bec0571e144e2 |
class Task(object): <NEW_LINE> <INDENT> def __init__(self, body, aliases=(), positional=None, default=False, auto_shortflags=True, help=None, pre=None): <NEW_LINE> <INDENT> self.body = body <NEW_LINE> self.__doc__ = getattr(body, '__doc__', '') <NEW_LINE> self.__name__ = getattr(body, '__name__', '') <NEW_LINE> self.al... | Core object representing an executable task & its argument specification. | 62598ef22ae34c7f260a990f |
class CcxFieldOverride(models.Model): <NEW_LINE> <INDENT> ccx = models.ForeignKey(CustomCourseForEdX, db_index=True) <NEW_LINE> location = LocationKeyField(max_length=255, db_index=True) <NEW_LINE> field = models.CharField(max_length=255) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> unique_together = (('ccx', 'location',... | Field overrides for custom courses. | 62598ef2091ae35668703447 |
class AbsFollower(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _on_notify(self, f): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self._dt = datetime.now() <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash(self._dt) <NEW_LINE> <DEDENT> def notify(... | Abstract follower --> oberver in observer pattern for a folowable object. | 62598ef2f548e778e5969dbb |
class SporeFormat(SporeMiddleware): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> SporeMiddleware.__init__(self, *args, **kwargs) <NEW_LINE> self.decode = decode <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> return self.decode(*args, **kwargs) | Serialization middleware | 62598ef263d6d428bbee0ffe |
class PasswordProfile(models.Model): <NEW_LINE> <INDENT> created = models.DateTimeField( verbose_name=_("created"), db_index=True, help_text=_("The date the entry was " "created."), auto_now_add=True, ) <NEW_LINE> last_changed = models.DateTimeField( verbose_name=_("last changed"), db_index=True, help_text=_("The date ... | Stores a single password history entry, related to :model:`auth.User`.
Has the following fields: | 62598ef28da39b475be019dc |
class ForwardExtendMover(EngineMover): <NEW_LINE> <INDENT> _direction = "forward" <NEW_LINE> def __init__(self, ensemble, target_ensemble, engine=None): <NEW_LINE> <INDENT> super(ForwardExtendMover, self).__init__( ensemble=ensemble, target_ensemble=target_ensemble, selector=paths.FinalFrameSelector(), engine=engine ) ... | A Sample Mover implementing Forward Extension | 62598ef24e4d562566370c44 |
class _Relational(Field): <NEW_LINE> <INDENT> relational = True <NEW_LINE> _slots = { 'domain': [], 'context': {}, } <NEW_LINE> def _setup_regular_base(self, model): <NEW_LINE> <INDENT> super(_Relational, self)._setup_regular_base(model) <NEW_LINE> if self.comodel_name not in model.pool: <NEW_LINE> <INDENT> _logger.war... | Abstract class for relational fields. | 62598ef255399d3f05624d55 |
class Point: <NEW_LINE> <INDENT> pass | contains coordinates of center | 62598ef23346ee7daa336a7f |
class OpKeyOptimizer(NavigatorOptimizer): <NEW_LINE> <INDENT> def __init__(self, local_opt, ignore_newtrees=False, failure_callback=None): <NEW_LINE> <INDENT> if not hasattr(local_opt, 'op_key'): <NEW_LINE> <INDENT> raise TypeError("LocalOptimizer for OpKeyOptimizer must have " "an 'op_key' method.") <NEW_LINE> <DEDENT... | WRITEME | 62598ef2be7bc26dc925127a |
class LUInstanceQuery(NoHooksLU): <NEW_LINE> <INDENT> REQ_BGL = False <NEW_LINE> def CheckArguments(self): <NEW_LINE> <INDENT> self.iq = InstanceQuery(qlang.MakeSimpleFilter("name", self.op.names), self.op.output_fields, self.op.use_locking) <NEW_LINE> <DEDENT> def ExpandNames(self): <NEW_LINE> <INDENT> self.iq.ExpandN... | Logical unit for querying instances.
| 62598ef292d797404e387f93 |
class ADO_record(object): <NEW_LINE> <INDENT> def __init__(self, record): <NEW_LINE> <INDENT> self.record = record <NEW_LINE> self.fields = {} <NEW_LINE> for i in range(record.Fields.Count): <NEW_LINE> <INDENT> field = record.Fields.Item(i) <NEW_LINE> self.fields[field.Name] = field <NEW_LINE> <DEDENT> <DEDENT> def __g... | Simple wrapper around an ADO result set | 62598ef24527f215b58e872e |
class GameDynamicDataHandler(DynamicDataHandler): <NEW_LINE> <INDENT> def prepare(self): <NEW_LINE> <INDENT> super().prepare() <NEW_LINE> if GAMES.get(self.token): <NEW_LINE> <INDENT> self.game = GAMES[self.token] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.set_status(410) <NEW_LINE> raise GameVanishedException(... | To be used for any handlers that handle the active game.
If the game no longer exists (e.g. because the opponent hung up) a GameVanishedException is raised, | 62598ef27c178a314d78bcc7 |
class WeChatAppChat(BaseWeChatAPI): <NEW_LINE> <INDENT> def create(self, chat_id=None, name=None, owner=None, user_list=None): <NEW_LINE> <INDENT> data = optionaldict( chatid=chat_id, name=name, owner=owner, userlist=user_list, ) <NEW_LINE> return self._post("appchat/create", data=data) <NEW_LINE> <DEDENT> def get(self... | 发送消息到群聊会话
https://work.weixin.qq.com/api/doc#90000/90135/90244 | 62598ef276e4537e8c3edde6 |
class InternalError(YacaError): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> YacaError.__init__(self, message) <NEW_LINE> self.message = message | Internal exception | 62598ef260cbc95b06362b65 |
class OngoingProject(TimeStampedModel): <NEW_LINE> <INDENT> pass | On going Project Model | 62598ef2f9cc0f698b1c46e7 |
class HungryAnt(Ant): <NEW_LINE> <INDENT> name = 'Hungry' <NEW_LINE> "*** REPLACE THIS LINE ***" <NEW_LINE> time_to_digest = 3 <NEW_LINE> food_cost = 4 <NEW_LINE> implemented = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.digesting = 0 <NEW_LINE> Ant.__init__(self, 1) <NEW_LINE> <DEDENT> def eat_bee(se... | HungryAnt will take three turns to digest a Bee in its place.
While digesting, the HungryAnt can't eat another Bee. | 62598ef2851cf427c66b6af4 |
class Settings: <NEW_LINE> <INDENT> def __init__(self, path="../ir_settings.json"): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> self.properties = None <NEW_LINE> self.load() <NEW_LINE> <DEDENT> def restore_default(self): <NEW_LINE> <INDENT> self.properties = { "game_props": { "sound_volume": 100, } } <NEW_LINE> <DE... | Cette classe permet de charger, manipuler les propriétés variables du jeu | 62598ef37047854f4633dbff |
class InvalidAttributeValueError(Exception): <NEW_LINE> <INDENT> pass | To handle invalid attribute values.
| 62598ef3fff4ab517ebcc008 |
class EntityTestCase(object): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.assertNotEqual(self.klass, None) <NEW_LINE> self.assertNotEqual(self._full_dict, None) <NEW_LINE> <DEDENT> @silence_warnings <NEW_LINE> def test_round_trip_full_dict(self): <NEW_LINE> <INDENT> if type(self) is EntityTestCase: <N... | A base class for testing STIX Entities | 62598ef35fdd1c0f98e5c7d2 |
class oysterpopulation: <NEW_LINE> <INDENT> def __init__(self, site, startSize, saltol, temptol): <NEW_LINE> <INDENT> self.saltol = saltol <NEW_LINE> self.temptol = temptol <NEW_LINE> self.startSize = startSize <NEW_LINE> self.site = site <NEW_LINE> <DEDENT> def pulldata(self, fileName, columIndex): <NEW_LINE> <INDENT>... | This class defines population tolerances for salinity and temperature and population size. | 62598ef330bbd72246468465 |
class ServiceUnavailableError(ViewfinderError): <NEW_LINE> <INDENT> pass | The service is temporarily unavailable. | 62598ef332920d7e50bc485c |
class ConnectionMonitorListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ConnectionMonitorResult]'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(ConnectionMonitorListResult, self).__init__(**kwargs) <NEW_LINE> self.value = kwarg... | List of connection monitors.
:param value: Information about connection monitors.
:type value: list[~azure.mgmt.network.v2018_02_01.models.ConnectionMonitorResult] | 62598ef3f548e778e5969dbc |
class Departamento: <NEW_LINE> <INDENT> def __init__(self, nombre_depto, id_depto): <NEW_LINE> <INDENT> self.nombre_depto = nombre_depto <NEW_LINE> self.id_depto = id_depto <NEW_LINE> self.lista_emp = [] <NEW_LINE> <DEDENT> def aniadir_emp(self, Empleado): <NEW_LINE> <INDENT> self.lista_emp.append(Empleado) <NEW_LINE> ... | Modela un departamento
:author: Francisco Lopez Baena
:version: 1 | 62598ef3aad79263cf42d03e |
class data_mat_read(object): <NEW_LINE> <INDENT> def __init__(self, img_type=".jpeg",img_json_path="D:\\Practice\\Origin_picture_json\\", fusion_path = "D:\\Practice\\fusion_json\\", imgPath ="D:\\Practice\\Origin_picture\\",img_json_type=".json"): <NEW_LINE> <INDENT> self.img_json = glob.glob(img_json_path + "/*" + im... | 读取MATLAB提取的坐标数据MAT文件,结合图像生成的json数据,
生成一个模仿labelme软件标记object后生成的.json文件 | 62598ef32ae34c7f260a9911 |
class CloudVisionAnnotateImageOperator(BaseOperator): <NEW_LINE> <INDENT> template_fields = ('request', 'gcp_conn_id') <NEW_LINE> @apply_defaults <NEW_LINE> def __init__( self, request, retry=None, timeout=None, gcp_conn_id='google_cloud_default', *args, **kwargs ): <NEW_LINE> <INDENT> super(CloudVisionAnnotateImageOpe... | Run image detection and annotation for an image or a batch of images.
.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:CloudVisionAnnotateImageOperator`
:param request: (Required) Annotation request for image or a batch.
If a dict is provided, i... | 62598ef316aa5153ce3fed32 |
class Source: <NEW_LINE> <INDENT> repo_source: Optional[RepoSourceClass] <NEW_LINE> storage_source: Optional[StorageSourceClass] <NEW_LINE> def __init__(self, repo_source: Optional[RepoSourceClass], storage_source: Optional[StorageSourceClass]) -> None: <NEW_LINE> <INDENT> self.repo_source = repo_source <NEW_LINE> self... | The location of the source files to build. | 62598ef371ff763f4b5e5f90 |
class ScreenName(StrEnum): <NEW_LINE> <INDENT> here = "here" <NEW_LINE> settings = "settings" | Enum for root screen names. | 62598ef3be383301e025200c |
class ETandemCommandline(_EmbossCommandLine): <NEW_LINE> <INDENT> def __init__(self, cmd="etandem", **kwargs): <NEW_LINE> <INDENT> self.parameters = [ _Option( ["-sequence", "sequence"], "Sequence", filename=True, is_required=True ), _Option( ["-minrepeat", "minrepeat"], "Minimum repeat size", is_required=True ), _Opti... | Commandline object for the etandem program from EMBOSS. | 62598ef39c8ee8231303f573 |
class InvoiceTest(ClientBaseCase): <NEW_LINE> <INDENT> def test_get_invoice(self): <NEW_LINE> <INDENT> invoice = Invoice(self.client, 123456) <NEW_LINE> self.assertEqual(invoice._populated, False) <NEW_LINE> self.assertEqual(invoice.label, 'Invoice #123456') <NEW_LINE> self.assertEqual(invoice._populated, True) <NEW_LI... | Tests methods of the Invoice | 62598ef355399d3f05624d57 |
class CiscoEnvMonTemperatureSensorMap(SnmpPlugin): <NEW_LINE> <INDENT> maptype = "CiscoEnvMonTemperatureSensorMap" <NEW_LINE> modname = "ZenPacks.community.CiscoEnvMonE.CiscoEnvMonTemperatureSensor" <NEW_LINE> relname = "ciscoenvtempsensors" <NEW_LINE> compname = "hw" <NEW_LINE> deviceProperties = SnmpPlugin.deviceProp... | Map Cisco Environment Temperature Sensors table to model. | 62598ef367a9b606de5447ff |
class CustomArgumentParser(argparse.ArgumentParser): <NEW_LINE> <INDENT> def convert_arg_line_to_args(self, arg_line): <NEW_LINE> <INDENT> arg_line = arg_line.strip() <NEW_LINE> if (len(arg_line) > 0 and arg_line[0] == '#') or len(arg_line) == 0: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> kv_pair = arg_line.spli... | Adds support for parsing arguments from a config file. | 62598ef34527f215b58e8730 |
class HNN(lland_parameters.MultiParameter): <NEW_LINE> <INDENT> NDIM, TYPE, TIME, SPAN = 1, float, None, (None, None) | Höhe über Normal-Null (height above sea level) [m]. | 62598ef3dd821e528d6d776f |
class Picture: <NEW_LINE> <INDENT> def __init__(self, xSize=50, ySize=50, style='#'): <NEW_LINE> <INDENT> if xSize < 2: <NEW_LINE> <INDENT> self.xSize = 2 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.xSize = xSize <NEW_LINE> <DEDENT> if ySize < 2: <NEW_LINE> <INDENT> self.ySize = 2 <NEW_LINE> <DEDENT> else: <NEW_... | A simple class for making text user interfaces | 62598ef376e4537e8c3edde8 |
class JobsHistoryManager(models.Manager): <NEW_LINE> <INDENT> def delete_old_history(self, max_age: int) -> None: <NEW_LINE> <INDENT> self.filter(timestamp__lte=timezone.now() - timedelta(seconds=max_age)).delete() | Job history manager | 62598ef360cbc95b06362b67 |
class InputPersist(object): <NEW_LINE> <INDENT> hasrun = False <NEW_LINE> @cached('test_input', persist='5 minutes') <NEW_LINE> def on_task_input(self, task, config): <NEW_LINE> <INDENT> if self.hasrun: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> self.hasrun = True <NEW_LINE> return [Entry(title='Test', url='http... | Fake input plugin to test db cache. Only emits an entry the first time it is run. | 62598ef3d486a94d0ba2a7f9 |
class Profile(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = u'Профиль' <NEW_LINE> verbose_name_plural = u'Профили' <NEW_LINE> <DEDENT> user = models.OneToOneField(User, on_delete=models.CASCADE) <NEW_LINE> name = models.CharField(verbose_name='Имя', max_length=64) <NEW_LINE> last_nam... | User profile | 62598ef360cbc95b06362b68 |
@inherit_doc <NEW_LINE> class StandardScaler(JavaEstimator, HasInputCol, HasOutputCol): <NEW_LINE> <INDENT> withMean = Param(Params._dummy(), "withMean", "Center data with mean") <NEW_LINE> withStd = Param(Params._dummy(), "withStd", "Scale to unit standard deviation") <NEW_LINE> @keyword_only <NEW_LINE> def __init__(s... | .. note:: Experimental
Standardizes features by removing the mean and scaling to unit variance using column summary
statistics on the samples in the training set.
>>> from pyspark.mllib.linalg import Vectors
>>> df = sqlContext.createDataFrame([(Vectors.dense([0.0]),), (Vectors.dense([2.0]),)], ["a"])
>>> standardSca... | 62598ef3dc8b845886d51df7 |
class FJR_Image_Frist(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "image.fjr_firstimage" <NEW_LINE> bl_label = "first_image" <NEW_LINE> @classmethod <NEW_LINE> def poll(self, context): <NEW_LINE> <INDENT> return context.area.type == 'IMAGE_EDITOR' <NEW_LINE> <DEDENT> def execute(self, context): <NEW_LINE> <IND... | First image in image editor | 62598ef3ff9c53063f518e92 |
class Dream(Model): <NEW_LINE> <INDENT> name = CharField() <NEW_LINE> count = IntegerField(default=0) <NEW_LINE> picURL = CharField(null=True) <NEW_LINE> picURLthn = CharField(null=True) <NEW_LINE> definition = CharField(null=True) <NEW_LINE> created_on = DateTimeField(default=datetime.datetime.now) <NEW_LINE> modified... | " Dream model. | 62598ef32ae34c7f260a9913 |
class Subplots(object): <NEW_LINE> <INDENT> def __init__(self, nplots, nx=None, ny=None, figsize=(8,6)): <NEW_LINE> <INDENT> sizex, sizey = figsize <NEW_LINE> if nx is None and ny is None: <NEW_LINE> <INDENT> nx = 2 <NEW_LINE> <DEDENT> if ny is None: <NEW_LINE> <INDENT> ny = self._calc_second_dim(nx, nplots) <NEW_LINE>... | Helper class to create subplots given the number of plots needed
This class is intended to simplify the case where you know how many
subplots you need total and want to be able to create axes as needed.
Attributes
----------
axes : numpy.ndarray
An array of the axes created. The value for a given index will
... | 62598ef35fdd1c0f98e5c7d5 |
class BaseV2ComputeAdminTest(BaseV2ComputeTest): <NEW_LINE> <INDENT> credentials = ['primary', 'admin'] <NEW_LINE> @classmethod <NEW_LINE> def setup_clients(cls): <NEW_LINE> <INDENT> super(BaseV2ComputeAdminTest, cls).setup_clients() <NEW_LINE> cls.availability_zone_admin_client = ( cls.os_admin.availability_zone_clien... | Base test case class for Compute Admin API tests. | 62598ef3cc0a2c1114479833 |
class LogoutPage(BasePage): <NEW_LINE> <INDENT> @property <NEW_LINE> def logout_button(self): <NEW_LINE> <INDENT> return self.driver.find_element(by.By.LINK_TEXT, 'Log out') <NEW_LINE> <DEDENT> def verify_login_page(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.driver.find_element(by.By.XPATH, "//*[@id='logi... | This class is to perform all operations on Profile
view of site | 62598ef34428ac0f6e656d80 |
class ListAction(argparse.Action): <NEW_LINE> <INDENT> def __call__(self, parser, namespace, values, option_string=None): <NEW_LINE> <INDENT> values = values if values[0] not in ("(", "[") or values[-1] not in ( ")", "]") else values[1:-1] <NEW_LINE> res = [] <NEW_LINE> for value in values.split(","): <NEW_LINE> <INDEN... | Define how to convert command line list strings to Python objects.
| 62598ef3d7e4931a7ef3a8ce |
class AddressAdmin(utils.ModelAdmin): <NEW_LINE> <INDENT> list_display = ( 'id', 'human', 'town', 'address', 'municipality', ) <NEW_LINE> search_fields = ( 'town', 'address', 'human__first_name', 'human__last_name', 'human__old_last_name', ) <NEW_LINE> sheet_mapping = ( (_(u'ID'), ('id',)), (_(u'First name'), ('human',... | Administration for addresses.
| 62598ef31b99ca400228e928 |
class SYNAttacker: <NEW_LINE> <INDENT> def attack(self, victim_ip, victim_port): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> a, b, c, d, port = random.randint(100, 255), random.randint(100, 255), random.randint(100, 255), random.randint(100, 255), random.randint(1024, 60000) <NEW_L... | TCP SYN Flooding Attack | 62598ef3be7bc26dc925127c |
class playersonline: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> <DEDENT> @commands.command() <NEW_LINE> async def whosonline(self): <NEW_LINE> <INDENT> server = discord.utils.find(lambda m: m.id == '174382936877957120', self.bot.servers) <NEW_LINE> memberList = server.mem... | Cog for showing players online and what they are playing | 62598ef3cc40096d616195f2 |
class Offline(TemplateView): <NEW_LINE> <INDENT> template_name = 'core/offline.html' | Offline page for the PWA | 62598ef3442bda511e95ac96 |
class TestArrowArea(unittest.TestCase): <NEW_LINE> <INDENT> def test_arrow_area(self): <NEW_LINE> <INDENT> self.assertEqual(arrow_area(4, 2), 2) <NEW_LINE> self.assertEqual(arrow_area(7, 6), 10.5) <NEW_LINE> self.assertEqual(arrow_area(25, 25), 156.25) | Class to test 'arrow_area' function | 62598ef344b2445a339b5d86 |
class DgmTypeAttribute(EveBase): <NEW_LINE> <INDENT> __tablename__ = 'dgmtypeattribs' <NEW_LINE> type_id = Column('typeID', Integer, ForeignKey('evetypes.typeID'), primary_key=True) <NEW_LINE> type_ = relationship('EveType', backref=backref( '_dgmtypeattribs', collection_class=attribute_mapped_collection('attribute'), ... | Association object between type and attribute metadata, which also stores
attribute value. Not directly accessible by pyfa. | 62598ef3379a373c97d9782b |
class PostProcessorSignals(QtCore.QObject): <NEW_LINE> <INDENT> statusBar_Signal = QtCore.pyqtSignal(str) <NEW_LINE> list_Signal = QtCore.pyqtSignal([list]) <NEW_LINE> row_Signal = QtCore.pyqtSignal() <NEW_LINE> finished = QtCore.pyqtSignal() | Define the signals available from a running postprocessor thread | 62598ef34a966d76dd5ed70f |
class KrazyGridWorldEnv(Env, utils.EzPickle): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> screen_height = kwargs['screen_height'] <NEW_LINE> del kwargs['screen_height'] <NEW_LINE> self.env = game = KrazyGridWorld(screen_height=screen_height, **kwargs) <NEW_LINE> self.action_space = spaces.Disc... | Half cheetah environment with a randomly generated goal path.
todo: test seeding | 62598ef3fff4ab517ebcc00c |
class Task(): <NEW_LINE> <INDENT> def __init__(self, init_pose=None, init_velocities=None, init_angle_velocities=None, runtime=10., target_pos=None): <NEW_LINE> <INDENT> self.sim = PhysicsSim(init_pose, init_velocities, init_angle_velocities, runtime) <NEW_LINE> self.action_repeat = 3 <NEW_LINE> self.state_size = self.... | Task (environment) that defines the goal and provides feedback to the agent. | 62598ef3f548e778e5969dc0 |
class H5PYTargetFieldView(filewriter.FTTargetFieldView): <NEW_LINE> <INDENT> def __init__(self, h5object, shape): <NEW_LINE> <INDENT> filewriter.FTTargetFieldView.__init__(self, h5object) <NEW_LINE> self.shape = shape | target field view for VDS | 62598ef35fdd1c0f98e5c7d7 |
class SpeechServicer(object): <NEW_LINE> <INDENT> def Recognize(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 LongRunningRecogn... | Service that implements Google Cloud Speech API.
| 62598ef37b180e01f3e48460 |
class TestRegression(TestCase): <NEW_LINE> <INDENT> @property <NEW_LINE> def app(self): <NEW_LINE> <INDENT> return apps.get_containing_app_config(type(self).__module__).name <NEW_LINE> <DEDENT> def test_next_sync_setting_retroactive(self): <NEW_LINE> <INDENT> now = timezone.now().replace(microsecond=0) <NEW_LINE> Tempe... | Regression for: NoReverseMatch at / Reverse for 'docs' #175.
Thanks to: https://www.caktusgroup.com/blog/2016/02/02/writing-unit-tests-django-migrations/ | 62598ef3d58c6744b42db6d0 |
class EventObjectFilterTest(test_lib.FilterTestCase): <NEW_LINE> <INDENT> def testCompilerFilter(self): <NEW_LINE> <INDENT> test_filter = event_filter.EventObjectFilter() <NEW_LINE> test_filter.CompileFilter( 'some_stuff is "random" and other_stuff is not "random"') <NEW_LINE> test_filter.CompileFilter('timestamp is "2... | Tests for the event object filter. | 62598ef3a05bb46b384890a7 |
class Solution(object): <NEW_LINE> <INDENT> def maxCoins(self, nums): <NEW_LINE> <INDENT> n = len(nums) <NEW_LINE> if n == 0: return 0 <NEW_LINE> nums.insert(0, 1) <NEW_LINE> nums.append(1) <NEW_LINE> dp = [[0 for i in range(n+2)] for j in range(n+2)] <NEW_LINE> for j in range(1, n+1): <NEW_LINE> <INDENT> for i in rang... | @param {int[]} nums a list of integer
@return {int} an integer, maximum coins | 62598ef3bf627c535bcafca5 |
class CreateOnlyDefault(object): <NEW_LINE> <INDENT> def __init__(self, default): <NEW_LINE> <INDENT> self.default = default <NEW_LINE> <DEDENT> def _can_set_context(self): <NEW_LINE> <INDENT> return hasattr(self.default, 'set_context') and not self.is_update <NEW_LINE> <DEDENT> def set_context(self, serializer_field):... | This class may be used to provide default values that are only used
for create operations, but that do not return any value for update
operations. | 62598ef3236d856c2adc8831 |
class Interactor(DecisionModule): <NEW_LINE> <INDENT> def __init__(self, active=False): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._active = active <NEW_LINE> self._valid_detector = LearnedValidDetector() <NEW_LINE> self._affordance_extractor = LmAffordanceExtractor() <NEW_LINE> self.best_action = None <NEW... | The Interactor creates actions designed to interact with objects
at the current location. | 62598ef39c8ee8231303f575 |
class InvalidSnapshotIdentifier(SnapshotError): <NEW_LINE> <INDENT> def __init__( self, identifier: str, logger: typing.Optional['libioc.Logger.Logger']=None ) -> None: <NEW_LINE> <INDENT> msg = ( f"Invalid snapshot identifier syntax: {identifier}" "(should be <jail>@<snapshot>)" ) <NEW_LINE> super().__init__(message=m... | Raised when a snapshot identifier is invalid. | 62598ef33346ee7daa336a82 |
class Notification(models.Model): <NEW_LINE> <INDENT> description = models.CharField(max_length=255) <NEW_LINE> person_notifying = models.ForeignKey(User, on_delete=True, related_name="notifications") <NEW_LINE> time_of_notification = models.DateField(auto_now_add=True) <NEW_LINE> already_seen = models.BooleanField(def... | Model for creating notifications for a user. | 62598ef3a8370b77170eec1a |
class Dbufrd(DUGen): <NEW_LINE> <INDENT> _ordered_input_names = collections.OrderedDict( [("buffer_id", 0), ("phase", 0), ("loop", 1)] ) <NEW_LINE> _valid_calculation_rates = (CalculationRate.DEMAND,) | A buffer-reading demand-rate UGen.
::
>>> dbufrd = supriya.ugens.Dbufrd(
... buffer_id=0,
... loop=1,
... phase=0,
... )
>>> dbufrd
Dbufrd() | 62598ef392d797404e387f96 |
class FloatKrigingSurrogate(KrigingSurrogate): <NEW_LINE> <INDENT> def predict(self, new_x): <NEW_LINE> <INDENT> dist = super(FloatKrigingSurrogate, self).predict(new_x) <NEW_LINE> return dist.mu <NEW_LINE> <DEDENT> def get_uncertain_value(self, value): <NEW_LINE> <INDENT> return float(value) | Surrogate model based on the simple Kriging interpolation. Predictions are returned as floats,
which are the mean of the NormalDistribution predicted by the model. | 62598ef356ac1b37e6300a21 |
class ComposeSyncDoneV1(BodhiMessage): <NEW_LINE> <INDENT> body_schema = { 'id': f'{SCHEMA_URL}/v1/bodhi.compose.sync.done#', '$schema': 'http://json-schema.org/draft-04/schema#', 'description': ('Schema for message sent when the composer is done waiting to sync to ' 'mirrors'), 'type': 'object', 'properties': { 'agent... | Sent when a compose task sync is done. | 62598ef34527f215b58e8735 |
class CircleList: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._campuses = ['mito', 'hitachi', 'ami'] <NEW_LINE> self._url = 'http://www.ibaraki.ac.jp/collegelife/activity/circle/' <NEW_LINE> self._circle_list = {'circle': dict(), 'campus': dict()} <NEW_LINE> <DEDENT> def get(self): <NEW_LINE> <INDE... | List of official circles in Ibaraki University | 62598ef34f6381625f1988d6 |
class AbsFunc(TransformFunction): <NEW_LINE> <INDENT> def func(self, x): <NEW_LINE> <INDENT> return np.abs(x) <NEW_LINE> <DEDENT> def inverseplus(self, x): <NEW_LINE> <INDENT> return x <NEW_LINE> <DEDENT> def inverseminus(self, x): <NEW_LINE> <INDENT> return 0.0 - x <NEW_LINE> <DEDENT> def derivplus(self, x): <NEW_LINE... | class for absolute value transformation
| 62598ef38e7ae83300ee78c5 |
class EditPortProfileForm(FormRevMixin, ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = PortProfile <NEW_LINE> fields = "__all__" <NEW_LINE> widgets = { "vlan_tagged": AutocompleteMultipleModelWidget( url="/machines/vlan-autocomplete" ), "vlan_untagged": AutocompleteModelWidget(url="/machines/vl... | Form used to edit port profiles. | 62598ef31f5feb6acb161489 |
class SurfaceGrid(Mesh): <NEW_LINE> <INDENT> _view_name = Unicode('SurfaceGridView', sync=True) <NEW_LINE> geometry = Instance(SurfaceGeometry, sync=True, **widget_serialization) <NEW_LINE> material = Instance(_LineMaterial, sync=True, **widget_serialization) | A grid covering a surface.
This will draw a line mesh overlaying the SurfaceGeometry. | 62598ef32c8b7c6e89bd1ff9 |
class TestAssociationSendNDelete(unittest.TestCase): <NEW_LINE> <INDENT> def test_must_be_associated(self): <NEW_LINE> <INDENT> scp = DummyVerificationSCP() <NEW_LINE> scp.start() <NEW_LINE> ae = AE(scu_sop_class=[VerificationSOPClass]) <NEW_LINE> assoc = ae.associate('localhost', 11112) <NEW_LINE> assoc.release() <NEW... | Run tests on Assocation send_n_delete. | 62598ef37d847024c075ac05 |
class itkBinomialBlurImageFilterIUL3IUL3(itkImageToImageFilterAPython.itkImageToImageFilterIUL3IUL3): <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")... | Proxy of C++ itkBinomialBlurImageFilterIUL3IUL3 class | 62598ef310dbd63aa1c6f3ae |
class DescriptorNamingMeta(type): <NEW_LINE> <INDENT> def __new__(mcs, name, bases, namespace): <NEW_LINE> <INDENT> for name, attr in namespace.items(): <NEW_LINE> <INDENT> if isinstance(attr, Named): <NEW_LINE> <INDENT> attr.name = name <NEW_LINE> <DEDENT> <DEDENT> return super().__new__(mcs, name, bases, namespace) | A metaclass which detects the presence of descriptors which are named,
and assign the class atrribute names to them. | 62598ef363d6d428bbee1004 |
class ReceivablePaymentReport(_BasePaymentReport): <NEW_LINE> <INDENT> pass | This report shows a list of receivable payments. For each payment it shows:
payment number, description, drawee, due date, paid date, status and value. | 62598ef3d268445f26638faa |
class ContactForm(forms.Form): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> for field in self.fields.values(): <NEW_LINE> <INDENT> field.widget.attrs['class'] = 'form-control' <NEW_LINE> <DEDENT> <DEDENT> name = forms.CharField(label='お名前', re... | 問い合わせフォーム | 62598ef3aad79263cf42d043 |
class UserViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return User.objects.all() <NEW_LINE> <DEDENT> def create(self, request, *args, **kwargs): <N... | Read-only User endpoint | 62598ef3a219f33f346c5069 |
class Selection(QObject): <NEW_LINE> <INDENT> def __init__(self, start=0, end=0, active=True, color=QColor('#ef5350')): <NEW_LINE> <INDENT> super(Selection, self).__init__() <NEW_LINE> self._start = int(min(start, end)) <NEW_LINE> self._end = int(max(start, end)) <NEW_LINE> self.active = active <NEW_LINE> self.color = ... | Selection
| 62598ef330bbd7224646846b |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> user_id = Column(Integer, primary_key=True) <NEW_LINE> username = Column(Unicode(20), unique=True) <NEW_LINE> name = Column(Unicode(50)) <NEW_LINE> email = Column(Unicode(50)) <NEW_LINE> _password = Column('password', Unicode(60)) <NEW_LINE> def _... | Application's user model. | 62598ef37b25080760ed5cd1 |
class AlbumForm(ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Album <NEW_LINE> fields = [ 'title', 'number', 'band', 'genre', 'tracks_numbers', 'date', 'comment', 'image', ] <NEW_LINE> widgets = { 'date': forms.widgets.DateInput(format="%d/%m/%Y", attrs={'placeholder': '20/07/2014'}), } | Usamos widgets para editar el formato de la fecha ya que por
defecto viene Año-Mes-Día. Le agregamos el atributo
placeholder para que el usuario tenga una referencia de la
forma correcta en que se debe ingresar tal campo. | 62598ef33317a56b869bd981 |
class Car(object): <NEW_LINE> <INDENT> def __init__(self, world, chassis, sensors, orientation): <NEW_LINE> <INDENT> self.world = world <NEW_LINE> self.chassis = chassis <NEW_LINE> self.orientation = orientation <NEW_LINE> self.sensors = sensors <NEW_LINE> <DEDENT> def get_brake_status(self): <NEW_LINE> <INDENT> return... | Car. Has sensors and has a maze reference.
Interacts with maze through sensors and moves within maze. | 62598ef34c34283577618b1d |
class StatsDelta(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.stats, self.ntypes = None, None <NEW_LINE> <DEDENT> def collect(self, file=sys.stderr): <NEW_LINE> <INDENT> cur = gcstats() <NEW_LINE> Ncur = len(cur) <NEW_LIN... | GC statistics tracking.
Monitors the number of instances of each type/class (cf. gcstats())
and prints a report of any changes (ie. new types/count changes).
Intended to assist in detecting reference leaks. | 62598ef37b180e01f3e48461 |
class TiAPacket(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.signals = [] <NEW_LINE> self.blocksizes = [] <NEW_LINE> self.channels = [] <NEW_LINE> self.packet_number = -1 <NEW_LINE> self.timestamp = -1 <NEW_LINE> self.packet_id = -1 <NEW_LINE> <DEDENT> def get_channel(self, sindex, cindex=-... | Instances of this class are used by the TiAClient class to represent the
incoming data packet from a TiAServer. | 62598ef316aa5153ce3fed38 |
class ResampleQuadEdgeMesh(SEMLikeCommandLine): <NEW_LINE> <INDENT> input_spec = ResampleQuadEdgeMeshInputSpec <NEW_LINE> output_spec = ResampleQuadEdgeMeshOutputSpec <NEW_LINE> _cmd = " ResampleQuadEdgeMesh " <NEW_LINE> _outputs_filenames = {'outputMeshFile':'outputMeshFile'} | title:
BRAINS Resample Quad Edge Mesh
category:
BRAINS.Surface
description:
This program resamples the scalar values on the input mesh using points on the reference mesh. The interpolation type is either "Linear" or "Nearest".
version: 1.0
documentation-url: http://www.nitrc.org/plugins/mw... | 62598ef3627d3e7fe0e056c2 |
class Ingredient(object): <NEW_LINE> <INDENT> def __init__(self, name : str, command : str, price : float): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.command = command <NEW_LINE> self.price = price <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.__name <NEW_LINE> <DED... | Clase utilizada para representar los ingredientes disponibles
...
Attributes
----------
name : str
Nombre del ingrediente
command : str
Comando esperado para seleccionar ingrediente
price : int
Precio asociado al ingrediente
Methods
-------
name(), name(value=str)
Getter y setter del atributo name
co... | 62598ef356ac1b37e6300a24 |
class NEXUS2FASTA(ConvBase): <NEW_LINE> <INDENT> _default_method = 'biopython' <NEW_LINE> def __init__(self, infile, outfile=None, alphabet=None, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(infile, outfile) <NEW_LINE> self.alphabet = alphabet <NEW_LINE> <DEDENT> @requires("go") <NEW_LINE> @compressor <NEW_LI... | Converts a sequence alignment from :term:`NEXUS` format to :term:`FASTA` format. | 62598ef301c39578d7f115db |
class Wires(object): <NEW_LINE> <INDENT> def __init__(self, min_wirings=None, max_wirings=None, returns=False, ignore_exceptions=True): <NEW_LINE> <INDENT> if min_wirings is not None and min_wirings <= 0: <NEW_LINE> <INDENT> raise ValueError('min_wirings must be positive or None') <NEW_LINE> <DEDENT> if max_wirings is ... | :class:`Wires` Class. | 62598ef3442bda511e95ac9a |
class ReservationList(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ReservationResponse]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[List["ReservationResponse"]] = None, next_link: Optional[str] = None,... | ReservationList.
:param value:
:type value: list[~azure.mgmt.reservations.models.ReservationResponse]
:param next_link: Url to get the next page of reservations.
:type next_link: str | 62598ef38e7ae83300ee78c6 |
class GoldSubscriptionForm(StripeResourceMixin, StripeModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = GoldUser <NEW_LINE> fields = ['last_4_digits', 'level'] <NEW_LINE> <DEDENT> last_4_digits = forms.CharField( required=True, min_length=4, max_length=4, widget=forms.HiddenInput(attrs={ 'data-bin... | Gold subscription payment form
This extends the common base form for handling Stripe subscriptions. Credit
card fields for card number, expiry, and CVV are extended from
:py:cls:`StripeModelForm`, with additional methods from
:py:cls:`StripeResourceMixin` for common operations against the Stripe API. | 62598ef32c8b7c6e89bd1ffb |
class GiveUpOnPage(pywikibot.Error): <NEW_LINE> <INDENT> pass | User chose not to work on this page and its linked pages any more. | 62598ef37d43ff2487426817 |
class LdapConnMApper(object): <NEW_LINE> <INDENT> def __init__(self, cursor, uid, osv_obj, context=None): <NEW_LINE> <INDENT> logger.notifyChannel("MY TOPIC", netsvc.LOG_DEBUG, _('Initalize LDAP CONN')) <NEW_LINE> self.USER_DN = '' <NEW_LINE> self.CONTACT_DN = '' <NEW_LINE> self.LDAP_SERVER = '' <NEW_LINE> self.PASS = ... | LdapConnMApper: push specific fields from the Terp
Partner_contacts to the LDAP schema inetOrgPerson. Ldap bind options
are stored in company. | 62598ef3851cf427c66b6afc |
class CholeskyMLP(AbstractCholeskyForecaster): <NEW_LINE> <INDENT> def __init__(self, dsf, x_col, y_col, states0_line_col, hidden_layers_dim=[10, 10], gaussian_posterior=False, empirical_prior=True, init_scale=1e-2, learning_rate=1e-4, beta_1=0.1): <NEW_LINE> <INDENT> x, y, states0_line = dsf.select([x_col, y_col, stat... | Represent a Cholesky forecaster with an MLP network | 62598ef37d847024c075ac07 |
class MixedInstancesPolicy(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "InstancesDistribution": (InstancesDistribution, False), "LaunchTemplate": (LaunchTemplate, True), } | `MixedInstancesPolicy <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cfn-as-group-mixedinstancespolicy.html>`__ | 62598ef360cbc95b06362b6e |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.