code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DocumentParser(object): <NEW_LINE> <INDENT> PARSERS = [WMLParser, HTMLParser, JavaScriptParser, PDFParser, SWFParser] <NEW_LINE> def __init__(self, http_resp): <NEW_LINE> <INDENT> if http_resp.is_image(): <NEW_LINE> <INDENT> msg = 'There is no parser for images.' <NEW_LINE> raise BaseFrameworkException(msg) <NEW_... | This class is a document parser.
:author: Andres Riancho (andres.riancho@gmail.com) | 62598eeb23849d37ff84f7fa |
class Model(object): <NEW_LINE> <INDENT> def __init__(self, spec): <NEW_LINE> <INDENT> self.spec = spec <NEW_LINE> <DEDENT> @property <NEW_LINE> def fact_table_name(self): <NEW_LINE> <INDENT> return self.spec.get('fact_table') <NEW_LINE> <DEDENT> @property <NEW_LINE> def dimensions(self): <NEW_LINE> <INDENT> hierarchy_... | The ``Model`` serves as an abstract representation of a cube,
representing its measures, dimensions and attributes. | 62598eeb66673b3332c2eaeb |
class DavizVisualization(object): <NEW_LINE> <INDENT> implements(IVisualizationData) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> @property <NEW_LINE> def data(self): <NEW_LINE> <INDENT> external = self.context.getField('external') <NEW_LINE> url = external.getA... | Data adapter for eea.daviz.content.interfaces.IDavizVisualization
| 62598eeb5166f23b2e241b1b |
class Necromancer(Mage): <NEW_LINE> <INDENT> talisman_charged = models.BooleanField(default=True) | Spellcaster specialized in the arts of the undead. | 62598eebcc40096d61619579 |
class BigBracket(BigSymbol): <NEW_LINE> <INDENT> def __init__(self, size, bracket, alignment='l'): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.original = bracket <NEW_LINE> self.alignment = alignment <NEW_LINE> self.pieces = None <NEW_LINE> if bracket in FormulaConfig.bigbrackets: <NEW_LINE> <INDENT> self.piec... | A big bracket generator. | 62598eebbe383301e0251f1c |
class ModifyMediaConnectFlowResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.RequestId = params.get("RequestId") | ModifyMediaConnectFlow response structure.
| 62598eeb01c39578d7f114ec |
class ListFilteredMixin(object): <NEW_LINE> <INDENT> filter_set = None <NEW_LINE> def get_filter_set(self): <NEW_LINE> <INDENT> if self.filter_set: <NEW_LINE> <INDENT> return self.filter_set <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise ImproperlyConfigured( "ListFilterMixin requires either a definition of " "'fi... | Mixin that adds support for django-filter to a vanilla ListView | 62598eeb4a966d76dd5ed623 |
class IRecentConversationsPortlet(IPortletDataProvider): <NEW_LINE> <INDENT> title = schema.TextLine(title=_(u"title_title", default=u"Portlet title"), required=True, default=u"Recent messages") <NEW_LINE> count = schema.Int(title=_(u"title_count", default=u"Number of items to display"), description=_(u"help_count", de... | A portlet which shows recent Ploneboard conversations.
| 62598eeb627d3e7fe0e055cd |
class DefaultAddressProvider: <NEW_LINE> <INDENT> def __init__(self, addresses): <NEW_LINE> <INDENT> self._addresses = addresses <NEW_LINE> <DEDENT> def load_addresses(self): <NEW_LINE> <INDENT> configured_addresses = self._addresses <NEW_LINE> if not configured_addresses: <NEW_LINE> <INDENT> configured_addresses = ["1... | Provides initial addresses for client to find and connect to a node.
It also provides a no-op translator. | 62598eebf548e778e5969cce |
class BatchApply(base.AbstractModule): <NEW_LINE> <INDENT> def __init__(self, module_or_op, n_dims=2, input_example_index=0, name="batch_apply"): <NEW_LINE> <INDENT> super(BatchApply, self).__init__(name=name) <NEW_LINE> if not isinstance(n_dims, int): <NEW_LINE> <INDENT> raise TypeError("n_dims should be an integer, i... | Merges a number of leading dimensions of an input tensor to manipulate it.
Merges a number of leading dimensions of a tensor into a single dimension,
connects the provided module, then splits the leading dimension of the
result to match the input.
This is useful for applying some module to each timestep of a Time x B... | 62598eeb4428ac0f6e656c95 |
@implementer(IConstraint) <NEW_LINE> class Constraint(object): <NEW_LINE> <INDENT> taster = everythingTaster <NEW_LINE> strictTaster = False <NEW_LINE> opentypes = None <NEW_LINE> name = None <NEW_LINE> def checkToken(self, typebyte, size): <NEW_LINE> <INDENT> limit = self.taster.get(typebyte, "not in list") <NEW_LINE>... | Each __schema__ attribute is turned into an instance of this class, and
is eventually given to the unserializer (the 'Unslicer') to enforce as
the tokens are arriving off the wire. | 62598eebb7558d5895461d89 |
class Tests(IMP.test.TestCase): <NEW_LINE> <INDENT> def read_data(self): <NEW_LINE> <INDENT> model = IMP.kernel.Model() <NEW_LINE> mrw = IMP.em.MRCReaderWriter() <NEW_LINE> scene = IMP.em.read_map(self.get_input_file_name("3points.mrc"), mrw) <NEW_LINE> scene.get_header_writable().set_resolution(8.) <NEW_LINE> mp = IMP... | Class to test hit map generation | 62598eeb1f5feb6acb161395 |
class ElectricCar(Car): <NEW_LINE> <INDENT> def __init__(self, make, model, year): <NEW_LINE> <INDENT> super().__init__(make, model, year) <NEW_LINE> self.battery = Battery() <NEW_LINE> <DEDENT> def fill_gas_tank(self): <NEW_LINE> <INDENT> print("This car doen't need a gas tank!") | Represents aspects of the car that are special for electic vehicles.
It then initializes attributes specific to the elechtic vehicle. | 62598eeb7047854f4633db16 |
class ModelEntity(object): <NEW_LINE> <INDENT> def __init__(self, entity_id, model, history_index=-1, connected=True): <NEW_LINE> <INDENT> self.entity_id = entity_id <NEW_LINE> self.model = model <NEW_LINE> self._history_index = history_index <NEW_LINE> self.connected = connected <NEW_LINE> self.connection = model.conn... | An object in the Model tree | 62598eebd6c5a102081e0874 |
class TestSmartSsdAtaSctErc(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 testSmartSsdAtaSctErc(self): <NEW_LINE> <INDENT> pass | SmartSsdAtaSctErc unit test stubs | 62598eebfff4ab517ebcbf1b |
class City(Base): <NEW_LINE> <INDENT> __tablename__ = 'cities' <NEW_LINE> id = Column(Integer, primary_key=True, autoincrement=True, nullable=False) <NEW_LINE> name = Column(String(128), nullable=False) <NEW_LINE> state_id = Column(Integer, ForeignKey("states.id"), nullable=False) | City class:
inherits from Base
links to the MySQL table states
class attribute id that represents a column of an auto-generated,
unique integer, cant be null and is a primary key
class attribute name that represents a column of a string
with maximum 128 characters and cant be null
class attribute state_id that represen... | 62598eeb5fdd1c0f98e5c6e4 |
class BitOrExpression(BaseExpression): <NEW_LINE> <INDENT> def eval(self): <NEW_LINE> <INDENT> if self.exp1: <NEW_LINE> <INDENT> if self.exp2: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.exp1.eval() or self.exp2.eval() <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> return super().eval() <NEW_LINE> <DEDENT... | bitOrExpression =
| xOrExpression
| bitOrExpression '|' xOrExpression | 62598eebaad79263cf42cf4f |
@parser(Specs.rabbitmq_queues) <NEW_LINE> class RabbitMQQueues(Parser): <NEW_LINE> <INDENT> QueueInfo = namedtuple('QueueInfo', ['name', 'messages', 'consumers', 'auto_delete']) <NEW_LINE> def parse_content(self, content): <NEW_LINE> <INDENT> self.data = [] <NEW_LINE> for line in content: <NEW_LINE> <INDENT> if "Listin... | Parse the output of the `rabbitmqctl list_queues` command.
The actual command is
`rabbitmqctl list_queues name messages consumers auto_delete`.
The four columns that are output are:
1. name - The name of the queue with non-ASCII characters escaped as in C.
2. messages - Sum of ready and unacknowledged messages (queu... | 62598eeb71ff763f4b5e5ea1 |
class AssertOneLinkageByManualCorrectInList(HttpRunner): <NEW_LINE> <INDENT> config = ( Config("调用cloud/v1/app/linkage/getLinkageList 获取联动列表接口,断言联动") ) <NEW_LINE> teststeps = [ Step( RunApiGetLinkageList() .with_variables( expected=[ { "linkageName": "$linkage_name", "linkageId": "$linkage_id", "actionList": [ { "actio... | Call api 'getLinkageList' to assert a added linkage by manual
Config Variables:
- client (Client): required
- account_id (int): required
- token (str): required
- linkage_name (str): required
- linkage_id (int): required
- action_type (str): required
- action_value (str): required
- lin... | 62598eeb2c8b7c6e89bd1f05 |
class Context(ModelView): <NEW_LINE> <INDENT> __name__ = 'sale.reporting.context' <NEW_LINE> company = fields.Many2One('company.company', "Company", required=True) <NEW_LINE> from_date = fields.Date("From Date", domain=[ If(Eval('to_date') & Eval('from_date'), ('from_date', '<=', Eval('to_date')), ()), ], depends=['to_... | Sale Reporting Context | 62598eeb009cb60464cffc92 |
class TestPSF_CHARMM_STANDARD(_TestTopology, RefAdKSmall): <NEW_LINE> <INDENT> pass | Testing CHARMM standard PSF file format | 62598eeb57b8e32f525074a6 |
class Message: <NEW_LINE> <INDENT> my_type = 'message' <NEW_LINE> _type = None <NEW_LINE> _data = None <NEW_LINE> _from = None <NEW_LINE> def __init__(self, id, type, data=None, source=None): <NEW_LINE> <INDENT> self._type = type <NEW_LINE> self._data = data <NEW_LINE> self._from = id <NEW_LINE> self.source = source <N... | This is a simple message class for communications between actionners and
workers | 62598eebe5267d203ee6a04b |
class Schedule: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.parameters = None <NEW_LINE> <DEDENT> def setSchedule(self, parameters): <NEW_LINE> <INDENT> if self.parameters is not None or parameters is None: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> for param in parameters: <NEW_LINE> <INDENT> ... | Identifier schedule
Each schedule may have multiple parameters configuring how the element is scheduled
Used for trigger and result elements | 62598eeb23849d37ff84f7fc |
class Laghos(MakefilePackage): <NEW_LINE> <INDENT> tags = ['proxy-app', 'ecp-proxy-app'] <NEW_LINE> homepage = "https://codesign.llnl.gov/laghos.php" <NEW_LINE> git = "https://github.com/CEED/Laghos" <NEW_LINE> url = "https://github.com/CEED/Laghos/archive/v1.0.tar.gz" <NEW_LINE> version('1.0', '107c2f6939367... | Laghos (LAGrangian High-Order Solver) is a CEED miniapp that solves the
time-dependent Euler equations of compressible gas dynamics in a moving
Lagrangian frame using unstructured high-order finite element spatial
discretization and explicit high-order time-stepping. | 62598eeb5fdd1c0f98e5c6e5 |
class ResourceOperationDisplay(Model): <NEW_LINE> <INDENT> _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, } <NEW_LINE> def __init__(self, provider=N... | Display of the operation.
:param provider: The resource provider name.
:type provider: str
:param resource: The resource name.
:type resource: str
:param operation: The operation.
:type operation: str
:param description: The description of the operation.
:type description: str | 62598eebfff4ab517ebcbf1c |
class AddGender(Form): <NEW_LINE> <INDENT> gender = SelectField('gender', choices=[('Male', 'Male'), ('Female', 'Female'), ('Any', 'Any')]) | Adds a gender to the database. | 62598eeb92d797404e387f1d |
@python_2_unicode_compatible <NEW_LINE> class Task(BaseTask): <NEW_LINE> <INDENT> slug = models.SlugField(primary_key=True, help_text='Must be unique among all tasks, serves as part of URL.<br />' 'By default, task.slug is also used as a name of inputs folder at judge.<br />' 'Must only contain characters "a-zA-Z0-9_-"... | General task data not related to testing are defined here. | 62598eeb435de62698e9a51b |
class RedHatRadius(radius, RedHatPlugin): <NEW_LINE> <INDENT> files = ('/etc/raddb',) <NEW_LINE> def setup(self): <NEW_LINE> <INDENT> super(RedHatRadius, self).setup() <NEW_LINE> self.addCopySpecs(["/etc/raddb", "/etc/pam.d/radiusd", "/var/log/radius"]) <NEW_LINE> <DEDENT> def postproc(self): <NEW_LINE> <INDENT> self.d... | radius related information on Red Hat distributions
| 62598eeb8e7ae83300ee77d5 |
class lambda_max(Atom): <NEW_LINE> <INDENT> def __init__(self, A): <NEW_LINE> <INDENT> super(lambda_max, self).__init__(A) <NEW_LINE> <DEDENT> @Atom.numpy_numeric <NEW_LINE> def numeric(self, values): <NEW_LINE> <INDENT> if not (values[0].T == values[0]).all(): <NEW_LINE> <INDENT> raise Exception("lambda_max called on ... | Maximum eigenvalue; :math:`\lambda_{\max}(A)`.
| 62598eebcad5886f8bdc3a47 |
class LeadTransform(Step): <NEW_LINE> <INDENT> def __init__(self, inputs, outcome_expr, aggregations, outcome_where_expr=None, wic_sample_weight=0, exclude=[], include=[]): <NEW_LINE> <INDENT> Step.__init__(self, inputs=inputs, outcome_expr=outcome_expr, aggregations=aggregations, outcome_where_expr=outcome_where_expr,... | This Step transforms the data for modeling by defining an outcome variable,
performing feature selection and creating sample weights. | 62598eebff9c53063f518da9 |
class pyPopIterator(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def __init__(self, begin: 'vector< simuPOP::Population *,std::allocator< simuPOP::Population * > >::iterator const', end: '... | Details:
This class implements a Python itertor class that can be used to
iterate through populations in a population. | 62598eeb4c34283577618a2a |
class TestFloatScalarIndexDeprecation(object): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> warnings.filterwarnings("error", message="non-integer scalar index", category=DeprecationWarning) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> warnings.filterwarnings("default", message="non-integer sc... | These test that ``DeprecationWarning`` gets raised when you try to use
scalar indices that are not integers e.g. ``a[0.0]``, ``a[1.5, 0]``.
grep "non-integer scalar" numpy/core/src/multiarray/* for all the calls
to ``DEPRECATE()``, except the one inside ``_validate_slice_parameter``
which handles slicing (but see also... | 62598eeb851cf427c66b6a0d |
class GetReturnURLMixin(object): <NEW_LINE> <INDENT> default_return_url = None <NEW_LINE> def get_return_url(self, request, obj): <NEW_LINE> <INDENT> query_param = request.GET.get('return_url') <NEW_LINE> if query_param and is_safe_url(url=query_param, host=request.get_host()): <NEW_LINE> <INDENT> return query_param <N... | Provides logic for determining where a user should be redirected after processing a form. | 62598eebf9cc0f698b1c4671 |
class BookTags(models.Model): <NEW_LINE> <INDENT> _name = 'library.book.tags' <NEW_LINE> _description= 'Library Book Tags' <NEW_LINE> name = fields.Char(string='Tag Name', required=True, translate=True, index=True) <NEW_LINE> color_index = fields.Integer(string='Color Index') | Library Books Model | 62598eebdc8b845886d51d08 |
class Tag(ndb.Model): <NEW_LINE> <INDENT> tag_name = ndb.StringProperty() | Tag Model class
kind['Tag'] - entity | 62598eebe5267d203ee6a04d |
class TestImplementQueueUsingStacks(unittest.TestCase): <NEW_LINE> <INDENT> def test_implement_queue_using_stacks(self): <NEW_LINE> <INDENT> commands = ["MyQueue", "push", "push", "peek", "pop", "empty"] <NEW_LINE> params = [[], [1], [2], [], [], []] <NEW_LINE> res = [None, None, None, 1, 1, False] <NEW_LINE> test_by_r... | Test q232_implement_queue_using_stacks.py | 62598eeb0a50d4780f703aed |
class Ora(Instruction): <NEW_LINE> <INDENT> sets_zero_bit = True <NEW_LINE> sets_negative_bit = True <NEW_LINE> @classmethod <NEW_LINE> def write(cls, cpu, memory_address, value): <NEW_LINE> <INDENT> cpu.a_reg |= value <NEW_LINE> return cpu.a_reg | Pushes data onto stack
N Z C I D V
+ + - - - - | 62598eeb23849d37ff84f7fe |
class BPYPointers(Enum): <NEW_LINE> <INDENT> OBJECT = bpy.types.Object <NEW_LINE> MESH = bpy.types.Mesh <NEW_LINE> NODE_TREE = bpy.types.NodeTree <NEW_LINE> NODE = bpy.types.Node <NEW_LINE> MATERIAL = bpy.types.Material <NEW_LINE> COLLECTION = bpy.types.Collection <NEW_LINE> TEXT = bpy.types.Text <NEW_LINE> LIGHT = bpy... | Pointer types which are used in Sverchok
New properties should be added with updating collection property | 62598eebcc40096d6161957b |
class Cutout(object): <NEW_LINE> <INDENT> def __init__(self, n_holes, length): <NEW_LINE> <INDENT> self.n_holes = n_holes <NEW_LINE> self.length = length <NEW_LINE> <DEDENT> def __call__(self, img): <NEW_LINE> <INDENT> h = img.size(1) <NEW_LINE> w = img.size(2) <NEW_LINE> mask = np.ones((h, w), np.float32) <NEW_LINE> f... | Randomly mask out one or more patches from an image.
Args:
n_holes (int): Number of patches to cut out of each image.
length (int): The length (in pixels) of each square patch. | 62598eebe1aae11d1e7cdbe2 |
class Cylindrical(Projection): <NEW_LINE> <INDENT> pass | Base class for Cylindrical projections. | 62598eebaad79263cf42cf52 |
class FilteredRelation: <NEW_LINE> <INDENT> def __init__(self, relation_name, *, condition=Q()): <NEW_LINE> <INDENT> if not relation_name: <NEW_LINE> <INDENT> raise ValueError('relation_name cannot be empty.') <NEW_LINE> <DEDENT> self.relation_name = relation_name <NEW_LINE> self.alias = None <NEW_LINE> if not isinstan... | Specify custom filtering in the ON clause of SQL joins. | 62598eebf7d966606f746739 |
class BackupController(wsgi.Controller): <NEW_LINE> <INDENT> schemas = apischema.backup <NEW_LINE> def index(self, req, tenant_id): <NEW_LINE> <INDENT> LOG.debug("Listing Backups for tenant '%s'" % tenant_id) <NEW_LINE> context = req.environ[wsgi.CONTEXT_KEY] <NEW_LINE> backups, marker = Backup.list(context) <NEW_LINE>... | Controller for accessing backups in the OpenStack API. | 62598eeb01c39578d7f114f1 |
class ClusterManagementService(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def getCustosServerCertificate(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): <NEW_LINE> <INDENT> return grpc.experimen... | Missing associated documentation comment in .proto file. | 62598eeb7d847024c075ab14 |
class update_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRUCT, 'contact', (Contact, Contact.thrift_spec), None, ), ) <NEW_LINE> def __init__(self, contact=None,): <NEW_LINE> <INDENT> self.contact = contact <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtoc... | Attributes:
- contact | 62598eeb32920d7e50bc4773 |
class Route: <NEW_LINE> <INDENT> def __init__(self, choose, bus_line_route): <NEW_LINE> <INDENT> self.choose = choose <NEW_LINE> self.bus_line_route = bus_line_route <NEW_LINE> <DEDENT> def bus_lines(self): <NEW_LINE> <INDENT> j = 0 <NEW_LINE> first = [] <NEW_LINE> second = [] <NEW_LINE> first.append([self.bus_line_rou... | Searches for all bus stops for given line. | 62598eeba8370b77170eeb2b |
class TestJob(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 testJob(self): <NEW_LINE> <INDENT> model = cvtool_jobs_client.models.job.Job() | Job unit test stubs | 62598eeb2ae34c7f260a982e |
class LinearTest(LogisticTest): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> if not STATSMODELS_AVAILABLE: <NEW_LINE> <INDENT> raise ImportError("LinearTest class requires statsmodels. " "Install the package first (and patsy).") <NEW_LINE> <DEDENT> super(LinearTest, self).__init__(*args,... | Linear regression genetic test. | 62598eeb2ae34c7f260a982f |
class GustOfWind(Spell): <NEW_LINE> <INDENT> name = "Gust Of Wind" <NEW_LINE> level = 2 <NEW_LINE> casting_time = "1 action" <NEW_LINE> casting_range = "Self (60-foot line)" <NEW_LINE> components = ('V', 'S', 'M') <NEW_LINE> materials = """A legume seed""" <NEW_LINE> duration = "Concentration, up to 1 minute" <NEW_LINE... | A line of strong wind 60 feet long and 10 feet wide blasts from you in a
direction you choose for the spell’s duration. Each creature that starts its
turn in the line must succeed on a Strength saving throw or be pushed 15 feet
away from you in a direction following the line.
Any creature in the line must
spend 2 ... | 62598eeb30bbd7224646837b |
class Movie(db.Model): <NEW_LINE> <INDENT> __tablename__ = "movies" <NEW_LINE> movie_id = db.Column(db.Integer, autoincrement=True, primary_key=True) <NEW_LINE> title = db.Column(db.String(150), nullable=False) <NEW_LINE> imdb_url = db.Column(db.String(150), nullable=False) <NEW_LINE> release_at = db.Column(db.DateTime... | Movie title, release date and URL | 62598eeb76e4537e8c3edcfb |
class TestImport(object): <NEW_LINE> <INDENT> def test_version(self): <NEW_LINE> <INDENT> ok_(hasattr(al, '__version__')) <NEW_LINE> <DEDENT> def test_release(self): <NEW_LINE> <INDENT> ok_(hasattr(al, 'release')) <NEW_LINE> ok_(isinstance(al.release, dict)) | Test autolysis import basics | 62598eeba8ecb0332586f931 |
class AdapterTests(TestCase): <NEW_LINE> <INDENT> def test_protocolToConsumer(self): <NEW_LINE> <INDENT> result = [] <NEW_LINE> p = Protocol() <NEW_LINE> p.dataReceived = result.append <NEW_LINE> consumer = IConsumer(p) <NEW_LINE> consumer.write(b"hello") <NEW_LINE> self.assertEqual(result, [b"hello"]) <NEW_LINE> self.... | Tests for L{ProtocolToConsumerAdapter} and L{ConsumerToProtocolAdapter}. | 62598eeb498bea3a75a56279 |
class EventNotifyHandler(BaseHTTPRequestHandler): <NEW_LINE> <INDENT> def do_NOTIFY(self): <NEW_LINE> <INDENT> timestamp = time.time() <NEW_LINE> headers = requests.structures.CaseInsensitiveDict(self.headers) <NEW_LINE> seq = headers['seq'] <NEW_LINE> sid = headers['sid'] <NEW_LINE> content_length = int(headers['conte... | Handles HTTP ``NOTIFY`` Verbs sent to the listener server. | 62598eeb99fddb7c1ca621a8 |
class PreviewTest(LanghostTest): <NEW_LINE> <INDENT> def test_preview(self): <NEW_LINE> <INDENT> self.run_test( program=path.join(self.base_path(), "preview"), expected_resource_count=1) <NEW_LINE> <DEDENT> def register_resource(self, _ctx, dry_run, ty, name, resource, _dependencies, _parent, _custom, _protect, _provid... | Test that tests that pulumi.runtime.is_dry_run actually returns True on previews and False on updates. | 62598eeb236d856c2adc87b9 |
class WxThread(QThread): <NEW_LINE> <INDENT> wxSignal = pyqtSignal(str) <NEW_LINE> def __init__(self,window): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.work = True <NEW_LINE> self.window = window <NEW_LINE> self.is_listening = False <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> self.work = Fal... | 定义微信自动监听线程
监听微信的好友(没有群和公众号)消息 | 62598eeb8da39b475be018f4 |
class KONAnnotationTransform(object): <NEW_LINE> <INDENT> def __init__(self, class_to_ind=None): <NEW_LINE> <INDENT> self.class_to_ind = class_to_ind or dict( zip(KON_CLASSES, range(len(KON_CLASSES)))) <NEW_LINE> <DEDENT> def __call__(self, target, width, height): <NEW_LINE> <INDENT> res = [] <NEW_LINE> for obj in targ... | Transforms a VOC annotation into a Tensor of bbox coords and label index
Initilized with a dictionary lookup of classnames to indexes
Arguments:
class_to_ind (dict, optional): dictionary lookup of classnames -> indexes
(default: alphabetic indexing of VOC's 20 classes)
keep_difficult (bool, optional): ... | 62598eeb442bda511e95abaa |
class Priest(Card): <NEW_LINE> <INDENT> name = _("Priest") <NEW_LINE> value = 2 <NEW_LINE> targeted = True <NEW_LINE> num_in_deck = 2 <NEW_LINE> def play(self, game): <NEW_LINE> <INDENT> markup = types.ReplyKeyboardRemove(selective=False) <NEW_LINE> if game.card_without_action: <NEW_LINE> <INDENT> message = ... | The Priest card
Not very strong card (actually it can beat only Guard)
but it allows you to peek anyone else's card, you just need to play it | 62598eeb23849d37ff84f800 |
@attr.s <NEW_LINE> class BaseEntity(NavigatableMixin): <NEW_LINE> <INDENT> parent = attr.ib(repr=False) <NEW_LINE> __hash__ = object.__hash__ <NEW_LINE> @property <NEW_LINE> def appliance(self): <NEW_LINE> <INDENT> return self.parent.appliance <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_collection(cls, collect... | Class for helping create consistent entitys
The BaseEntity class is responsible for ensuring two things:
1) That the API consistently has the first argument passed to it
2) That that first argument is a collection instance
This class works in tandem with the entrypoint loader which ensures that the correct
argument ... | 62598eebf548e778e5969cd3 |
class Window(): <NEW_LINE> <INDENT> def __init__(self, start, end): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LINE> <INDENT> return hash((self.start, self.end)) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "(" + str(self.start.isof... | A window is a time frame | 62598eeb63d6d428bbee0f16 |
class suppress_stdout_stderr(object): <NEW_LINE> <INDENT> def __init__(self,quiet=True): <NEW_LINE> <INDENT> self.quiet = quiet <NEW_LINE> if quiet: <NEW_LINE> <INDENT> self.null_fds = [os.open(os.devnull,os.O_RDWR) for x in range(2)] <NEW_LINE> self.save_fds = (os.dup(1), os.dup(2)) <NEW_LINE> <DEDENT> <DEDENT> def _... | A context manager for doing a "deep suppression" of stdout and stderr in
Python, i.e. will suppress all print, even if the print originates in a
compiled C/Fortran sub-function.
This will not suppress raised exceptions, since exceptions are printed
to stderr just before a script exits, and after the context manage... | 62598eeb5166f23b2e241b21 |
class DescriptionObject(object): <NEW_LINE> <INDENT> def __init__(self, myFileObj, name): <NEW_LINE> <INDENT> self.myFileObj = myFileObj <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def read_file(self): <NEW_LINE> <INDENT> self.myFileObj.vim() <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return self.n... | Just a name and a fileobj with object's description | 62598eeb627d3e7fe0e055d3 |
class UnaryOperation(Operation): <NEW_LINE> <INDENT> def __init__(self, op, g): <NEW_LINE> <INDENT> if not isinstance(op, UnaryOperator): <NEW_LINE> <INDENT> raise TypeError() <NEW_LINE> <DEDENT> if not isinstance(g, Operation): <NEW_LINE> <INDENT> g = Constant(g) <NEW_LINE> <DEDENT> super().__init__( expr=op.format(g)... | Operation which is defined like f(x) = op(g(x))
Where op is any unary operator and g(x) is other operation.
e.g:
f(x) = negate(g(x)) where negate(x) = -x
if for example g(x) = x, f(x) will be interpreted as
f(x) = -x | 62598eeb66656f66f7d58b2a |
class TestIterPieceIsSet(unittest.TestCase): <NEW_LINE> <INDENT> def test_empty(self) -> None: <NEW_LINE> <INDENT> self.assertSequenceEqual( list(util.iter_piece_is_set(b"\x80", 1024, 1000, 1000)), [] ) <NEW_LINE> <DEDENT> def test_non_edge_cases(self) -> None: <NEW_LINE> <INDENT> self.assertSequenceEqual( list(util.it... | Tests for tvaf.util.iter_piece_is_set(). | 62598eeb796e427e5384cee1 |
class Planet(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=254, unique=True) <NEW_LINE> x = models.IntegerField() <NEW_LINE> y = models.IntegerField() <NEW_LINE> docking_fee = models.IntegerField() <NEW_LINE> bounties = models.IntegerField() <NEW_LINE> expeditions= models.IntegerField() <NEW_LIN... | Regions | 62598eeb460517430c430bd1 |
class TestBullet(TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> with patch.object(Bullet, "__init__", lambda x, y: None): <NEW_LINE> <INDENT> bullet_mock = Bullet(None) <NEW_LINE> bullet_mock.rect = pygame.Rect(330, 200, 6, 25) <NEW_LINE> bullet_mock._area = pygame.Rect(0, 0, 600, 600) <NEW... | class tests bullet | 62598eeba8370b77170eeb2d |
class ProjectAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('project_title', 'slug', 'project_status', 'project_created_on', ) <NEW_LINE> list_filter = ('project_status',) <NEW_LINE> search_fields = ['project_title',] <NEW_LINE> prepopulated_fields = { 'slug': ('project_title',), } | Content displayed about each Project in the admin site. | 62598eeb26068e7796d4b0a5 |
class CategoryPage(Category): <NEW_LINE> <INDENT> pass | 货源网站商品品类页面 | 62598eebdd821e528d6d768e |
class PluginRpcDispatcher(dispatcher.RpcDispatcher): <NEW_LINE> <INDENT> def __init__(self, callbacks): <NEW_LINE> <INDENT> super(PluginRpcDispatcher, self).__init__(callbacks) <NEW_LINE> <DEDENT> def dispatch(self, rpc_ctxt, version, method, **kwargs): <NEW_LINE> <INDENT> rpc_ctxt_dict = rpc_ctxt.to_dict() <NEW_LINE> ... | This class is used to convert RPC common context into
Crd Context. | 62598eeb8e71fb1e983ba1b6 |
class TagsConfig(object): <NEW_LINE> <INDENT> def __init__(self, raw=None, cmp_func=None): <NEW_LINE> <INDENT> self.raw = default_if_none(raw, {"selector": {}}) <NEW_LINE> self._conf = self.raw["selector"] <NEW_LINE> self._conf_copy = copy.deepcopy(self._conf) <NEW_LINE> self._cmp_func = cmp_func <NEW_LINE> <DEDENT> @c... | Represent a test tag configuration file. | 62598eeb63b5f9789fe838a6 |
class Playbulb(Bulb): <NEW_LINE> <INDENT> def __init__(self, devid, device, description, group, subgroup, intensity, server): <NEW_LINE> <INDENT> super().__init__(devid, device, description, group, subgroup, server) <NEW_LINE> self.device_type = "Playbulb" <NEW_LINE> self.state = "00000000" <NEW_LINE> self.intensity = ... | Methods for driving a rainbow BLE lightbulb | 62598eeb44b2445a339b5d0e |
class DatabaseAPI(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _put(self, key, value) -> None: <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def _get(self, key) -> "value": <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> @abstractmethod ... | Abstract metaclass for all database APIs.
Subclasses must implement _put, _get, _del, and __contains__.
Note that the first three shouldn't generally check for key existence, the
user facing methods (store, update, retrieve, remove) do that. | 62598eeb4c34283577618a2e |
class ScanInfo(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CallbackUrl = None <NEW_LINE> self.ScanTypes = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.CallbackUrl = params.get("CallbackUrl") <NEW_LINE> self.ScanTypes = params.get("ScanTypes") | 需要扫描的应用的服务信息
| 62598eeb5fcc89381b2654cb |
class TestIoK8sApiCoreV1TypedLocalObjectReference(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 testIoK8sApiCoreV1TypedLocalObjectReference(self): <NEW_LINE> <INDENT> pass | IoK8sApiCoreV1TypedLocalObjectReference unit test stubs | 62598eebaad79263cf42cf55 |
class DiffHelpers(object): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.json_out = {} <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _cleanup(image_list): <NEW_LINE> <INDENT> for image in image_list: <NEW_LINE> <INDENT> image._remove() <NEW_LINE> <DEDENT> <DEDENT>... | Helper class for the diff function | 62598eeb99fddb7c1ca621a9 |
class Indicator(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def __init__(self, cols): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> pass | Abstract class for an indicator.
Requires cols (of data) to be used for calculations | 62598eeb38b623060ffa77e5 |
class EmbeddedSSDMobileNetV1FeatureExtractor( ssd_mobilenet_v1_feature_extractor.SSDMobileNetV1FeatureExtractor): <NEW_LINE> <INDENT> def __init__(self, is_training, depth_multiplier, min_depth, pad_to_multiple, conv_hyperparams, batch_norm_trainable=True, reuse_weights=None): <NEW_LINE> <INDENT> if pad_to_multiple != ... | Embedded-friendly SSD Feature Extractor using MobilenetV1 features.
This feature extractor is similar to SSD MobileNetV1 feature extractor, and
it fixes input resolution to be 256x256, reduces the number of feature maps
used for box prediction and ensures convolution kernel to be no larger
than input tensor in spatial... | 62598eebd7e4931a7ef3a7e9 |
class AuditConditionSuppressEvent(AuditConditionEvent): <NEW_LINE> <INDENT> def __init__(self, sourcenode=None, message=None, severity=1, emitting_node=ua.ObjectIds.Server): <NEW_LINE> <INDENT> super(AuditConditionSuppressEvent, self).__init__(sourcenode, message, severity, emitting_node=emitting_node) <NEW_LINE> self.... | AuditConditionSuppressEvent: | 62598eebe5267d203ee6a051 |
class FilterAll(FilterHydroBC): <NEW_LINE> <INDENT> def __init__(self,orig): <NEW_LINE> <INDENT> super(FilterAll,self).__init__(orig,selection='all') <NEW_LINE> <DEDENT> def adjust_plan_areas(self): <NEW_LINE> <INDENT> dt=np.median(np.diff(self.t_secs)) <NEW_LINE> npad=int(5*self.lp_secs / dt) <NEW_LINE> pad =np.zeros(... | Minor specialization when you want filter everything - i.e. turn a tidal
run into a subtidal run. | 62598eeb0a50d4780f703af1 |
class GeneratePercept(object): <NEW_LINE> <INDENT> __slots__ = ("lCap","dObj","values") <NEW_LINE> def __init__(self,lCapteurs,dicObjets): <NEW_LINE> <INDENT> if lCapteurs == []: <NEW_LINE> <INDENT> raise ValueError("{} cant work with capteurs: {}" .format(self.__class__.__name__,lCapteurs)) <NEW_LINE> <DEDENT> print("... | lCapteurs: liste dont les éléments sont dans 0..8
dicObjets: dictionnaire dont les clefs sont numériques
- seules les clefs 0..99 sont considérées
- pour les capteurs autre que 8, la clef -1 est rajoutée
ATTENTION: Aucun controle quant au mésusage de cette classe | 62598eebf548e778e5969cd5 |
@require_authenticated_permission('FHLBuilder.collection_builder') <NEW_LINE> class CollectionUpdate(View,CollectionMixins): <NEW_LINE> <INDENT> form_class=forms.BasicCollectionForm <NEW_LINE> model=models.Collection <NEW_LINE> template_name='FHLBuilder/collection_update.html' <NEW_LINE> def get_object(self,slug): <NEW... | handle update, populating database for existing collection | 62598eebe1aae11d1e7cdbe4 |
class PollForm(ApiForm): <NEW_LINE> <INDENT> model = Poll <NEW_LINE> name = StringField("name", [DataRequired(), DataLength(max=255)]) <NEW_LINE> description = TextAreaField("description") <NEW_LINE> room_id = IntegerField("room_id", [DataRequired()]) <NEW_LINE> type = SelectField("type", choices=[(PollType.MANUAL.name... | Defines a form for the creation of a poll. | 62598eeb32920d7e50bc4777 |
class EdgeKey(Key): <NEW_LINE> <INDENT> pass | Key class for ``Edge`` records. | 62598eeb796e427e5384cee3 |
class Runner(RunnerLoop): <NEW_LINE> <INDENT> def __init__(self, name="runner", doready=True): <NEW_LINE> <INDENT> RunnerLoop.__init__(self, name) <NEW_LINE> self.starttime = time.time() <NEW_LINE> self.elapsed = self.starttime <NEW_LINE> self.finished = time.time() <NEW_LINE> self.doready = doready <NEW_LINE> self.lon... | a runner is a thread with a queue on which jobs can be pushed.
jobs scheduled should not take too long since only one job can
be executed in a Runner at the same time. | 62598eeba8370b77170eeb2f |
class TestModelsFrequencyType(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 testModelsFrequencyType(self): <NEW_LINE> <INDENT> pass | ModelsFrequencyType unit test stubs | 62598eebdd821e528d6d768f |
class TestPUTOrderActionTriggerDatesRequestTypeTriggerDates(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 testPUTOrderActionTriggerDatesRequestTypeTriggerDates(self): <NEW_LINE> <INDENT> pass | PUTOrderActionTriggerDatesRequestTypeTriggerDates unit test stubs | 62598eeb2eb69b55b15a0730 |
class CsubaggstatspointtypeEnum(Enum): <NEW_LINE> <INDENT> physical = 1 <NEW_LINE> interface = 2 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xe._meta import _CISCO_SUBSCRIBER_SESSION_MIB as meta <NEW_LINE> return meta._meta_table['CiscoSubscriberSessionMib.Csubagg... | CsubaggstatspointtypeEnum
This object indicates format of the csubAggStatsPoint
for this entry.
The format for the csubAggStatsPoint is as follows\:
csubAggStatsPointType csubAggStatsPoint
\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
'physical' ... | 62598eeb44b2445a339b5d0f |
class MetaGSIM(abc.ABCMeta): <NEW_LINE> <INDENT> def __new__(meta, name, bases, dic): <NEW_LINE> <INDENT> if len(bases) > 1: <NEW_LINE> <INDENT> raise TypeError('Multiple inheritance is forbidden: %s(%s)' % ( name, ', '.join(b.__name__ for b in bases))) <NEW_LINE> <DEDENT> if 'get_mean_and_stddevs' in dic and 'compute'... | A metaclass converting set class attributes into frozensets, to avoid
mutability bugs without having to change already written GSIMs. Moreover
it performs some checks against typos. | 62598eebcad5886f8bdc3a4e |
class IndexTemplate(Template): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> params = dict( tiles_url=self.tiles_url, tiles_bounds=self.tiles_bounds, gl_tiles_size=self.gl_tiles_size, gl_tiles_minzoom=self.gl_tiles_minzoom, gl_tiles_maxzoom=self.gl_tiles_maxzoom, ) <NEW_LINE> self.render("templates/index.html"... | Index template. | 62598eeb85dfad0860cbee0d |
@urls.register <NEW_LINE> class Policies(generic.View): <NEW_LINE> <INDENT> url_regex = r'swift/policies/$' <NEW_LINE> @rest_utils.ajax() <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> capabilities = api.swift.swift_get_capabilities(request) <NEW_LINE> policies = capabilities['swift']['policies'] <NEW_LINE> for... | API for information about available container storage policies | 62598eebd7e4931a7ef3a7ea |
class Only(Directive): <NEW_LINE> <INDENT> has_content = True <NEW_LINE> required_arguments = 1 <NEW_LINE> optional_arguments = 0 <NEW_LINE> final_argument_whitespace = True <NEW_LINE> option_spec = {} <NEW_LINE> def run(self): <NEW_LINE> <INDENT> node = addnodes.only() <NEW_LINE> node.document = self.state.document <N... | Directive to only include text if the given tag(s) are enabled. | 62598eeb7047854f4633db1f |
class ElectraEmbeddings(BertEmbeddings): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super().__init__(config) <NEW_LINE> self.word_embeddings = nn.Embedding(config.vocab_size, config.embedding_size, padding_idx=config.pad_token_id) <NEW_LINE> self.position_embeddings = nn.Embedding(config.max_po... | Construct the embeddings from word, position and token_type embeddings. | 62598eeb4f6381625f198861 |
class ProductTemplate(models.Model): <NEW_LINE> <INDENT> _inherit = 'product.template' <NEW_LINE> is_pack = fields.Boolean(string='Is Product Pack') <NEW_LINE> is_calpack_price = fields.Boolean(string='Calculate Pack Price') <NEW_LINE> product_pack_ids = fields.One2many('product.pack', 'product_tmpl_id', string='Produc... | Inherit Product Template | 62598eeb3539df3088eca9fd |
class ModelFeaturesAssembly(NeuroidAssembly): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ModelFeaturesAssembly, self).__init__(**kwargs) | A ModelFeaturesAssembly is a NeuroidAssembly containing data captured from nodes in
a machine learning model. | 62598eeb2c8b7c6e89bd1f0d |
class AzureFileShareRecoveryPoint(RecoveryPoint): <NEW_LINE> <INDENT> _validation = { 'object_type': {'required': True}, 'recovery_point_type': {'readonly': True}, 'recovery_point_time': {'readonly': True}, 'file_share_snapshot_uri': {'readonly': True}, 'recovery_point_size_in_gb': {'readonly': True}, } <NEW_LINE> _att... | Azure File Share workload specific backup copy.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:ivar object_type: Required. This property will be used as the discriminator for deciding the
specific types in... | 62598eeb851cf427c66b6a14 |
class GitChangeProjectTest(GitNoChangeProjectTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.change_unit("Ahoj světe!\n") | Testing of project git manipulations with not committed change. | 62598eeb57b8e32f525074aa |
class CreateAssistantCidrRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.VpcId = None <NEW_LINE> self.CidrBlocks = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.VpcId = params.get("VpcId") <NEW_LINE> self.CidrBlocks = params.get("CidrBlocks") | CreateAssistantCidr request structure.
| 62598eeb435de62698e9a522 |
class PortEventHandler(ogl.ShapeEvtHandler): <NEW_LINE> <INDENT> def __init__(self, port, canvas): <NEW_LINE> <INDENT> ogl.ShapeEvtHandler.__init__(self) <NEW_LINE> self.canvas = canvas <NEW_LINE> self.port = port <NEW_LINE> self.ID_HULL = wx.NewId() <NEW_LINE> self.ID_SHOW_PROPERTIES = wx.NewId() <NEW_LINE> <DEDENT>... | classdocs | 62598eeb7b25080760ed5be7 |
class Review(models.Model): <NEW_LINE> <INDENT> RATING_CHOISES = ( (1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), ) <NEW_LINE> company = models.ForeignKey(Company, on_delete=models.CASCADE) <NEW_LINE> date_published = models.DateField('date published') <NEW_LINE> user_name = models.CharField(max_length=100) <NEW_LIN... | Creates a Review class | 62598eeb66656f66f7d58b2e |
class ListingDetail(generics.RetrieveUpdateAPIView): <NEW_LINE> <INDENT> queryset = Listing.objects.all() <NEW_LINE> serializer_class = ListingSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly, IsCompanyOrReadOnly) | retrieve or update existing job | 62598eeb4e4d562566370b66 |
class XdrSnapshotVersionTwo(BaseSnapshot, XdrVoxelFormatOneSnapshot): <NEW_LINE> <INDENT> _headerLengthBytes = 80 <NEW_LINE> VersionNumber = 2 <NEW_LINE> @classmethod <NEW_LINE> def _readHeader(cls, filename): <NEW_LINE> <INDENT> reader = xdrlib.Unpacker(file(filename).read(cls._headerLengthBytes)) <NEW_LINE> header = ... | Read snapshots for the updated format as for August 2011.
| 62598eebb7558d5895461d93 |
class Tournament(object): <NEW_LINE> <INDENT> def __init__(self, players, game=None, turns=200, repetitions=10): <NEW_LINE> <INDENT> self.players = players <NEW_LINE> self.nplayers = len(players) <NEW_LINE> self.plist = list(range(self.nplayers)) <NEW_LINE> if game is None: <NEW_LINE> <INDENT> self.game = Game() <NEW_L... | Reproduce Prof. Axelrod's tournament | 62598eebdd821e528d6d7691 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.