code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Float(Field): <NEW_LINE> <INDENT> type = 'float' <NEW_LINE> _slots = { '_digits': None, 'group_operator': 'sum', } <NEW_LINE> def __init__(self, string=Default, digits=Default, **kwargs): <NEW_LINE> <INDENT> super(Float, self).__init__(string=string, _digits=digits, **kwargs) <NEW_LINE> <DEDENT> @property <NEW_LI... | The precision digits are given by the attribute
:param digits: a pair (total, decimal), or a function taking a database
cursor and returning a pair (total, decimal) | 62598fa3a17c0f6771d5c0da |
class TestItemVariationLocationOverrides(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 testItemVariationLocationOverrides(self): <NEW_LINE> <INDENT> model = squareconnect.models.item_variation_lo... | ItemVariationLocationOverrides unit test stubs | 62598fa3d268445f26639ad4 |
class OsramLightifyLight(Light): <NEW_LINE> <INDENT> def __init__(self, light_id, light, update_lights): <NEW_LINE> <INDENT> self._light = light <NEW_LINE> self._light_id = light_id <NEW_LINE> self.update_lights = update_lights <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self._li... | Defines an Osram Lightify Light. | 62598fa3a8370b77170f027c |
class Squad(tfds.core.GeneratorBasedBuilder): <NEW_LINE> <INDENT> _URL = "https://rajpurkar.github.io/SQuAD-explorer/dataset/" <NEW_LINE> _DEV_FILE = "dev-v1.1.json" <NEW_LINE> _TRAINING_FILE = "train-v1.1.json" <NEW_LINE> BUILDER_CONFIGS = [ SquadConfig( name="plain_text", version=tfds.core.Version( "1.0.0", "New spli... | SQUAD: The Stanford Question Answering Dataset. Version 1.1. | 62598fa3cb5e8a47e493c0c8 |
class Do(Token): <NEW_LINE> <INDENT> __slots__ = ('body', 'counter', 'first', 'last', 'step', 'concurrent') <NEW_LINE> defaults = {'step': Integer(1), 'concurrent': false} <NEW_LINE> _construct_body = staticmethod(lambda body: CodeBlock(*body)) <NEW_LINE> _construct_counter = staticmethod(sympify) <NEW_LINE> _construct... | Represents a Do loop in in Fortran.
Examples
========
>>> from sympy import fcode, symbols
>>> from sympy.codegen.ast import aug_assign, Print
>>> from sympy.codegen.fnodes import Do
>>> i, n = symbols('i n', integer=True)
>>> r = symbols('r', real=True)
>>> body = [aug_assign(r, '+', 1/i), Print([i, r])]
>>> do1 = D... | 62598fa301c39578d7f12c22 |
class TestAddToQueue: <NEW_LINE> <INDENT> def test_add_to_queue(self, soco): <NEW_LINE> <INDENT> old_queue = soco.get_queue(0, 1000) <NEW_LINE> assert (soco.add_to_queue(old_queue[-1])) == len(old_queue) + 1 <NEW_LINE> wait() <NEW_LINE> new_queue = soco.get_queue() <NEW_LINE> assert (len(new_queue) - 1) == len(old_queu... | Integration test for the add_to_queue method. | 62598fa32ae34c7f260aaf84 |
class kvget_args: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'key', None, None, ), ) <NEW_LINE> def __init__(self, key=None,): <NEW_LINE> <INDENT> self.key = key <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstanc... | Attributes:
- key | 62598fa30c0af96317c56225 |
class ModelForm(BaseModelForm): <NEW_LINE> <INDENT> __metaclass__ = ModelFormMetaclass | All model forms must inherit from this class | 62598fa37b25080760ed734d |
class Pais(models.Model): <NEW_LINE> <INDENT> cod_iso = models.CharField(max_length=3, blank=True, null=True) <NEW_LINE> nombre = models.CharField(max_length=255, blank=True, null=True) <NEW_LINE> nombre_iso = models.CharField(max_length=255, blank=True, null=True) <NEW_LINE> alfa2 = models.CharField(max_length=2, blan... | Gestión de paises
| 62598fa367a9b606de545e6e |
class SimpleFCN(BaseModel): <NEW_LINE> <INDENT> def __init__(self, prefix, data_description, modality, output_dir=None, **config): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> self.modality = modality <NEW_LINE> standard_config = { 'train_encoder': True, 'dropout_rate': 0 } <NEW_LINE> standard_config.update(conf... | Model Implementation of FCN.
Args:
output_dir: if set, will output diagnostics and weights here
learning_rate: learning rate of the trainer
modality: name of the data modality, which has to be a valid key for the input
dataset batch
train_encoder (bool): If False, will keep the weights of the e... | 62598fa3b7558d58954634d2 |
class HomeHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.render("home/index.html") | Renders the website index page - nothing more. | 62598fa38da39b475be03084 |
class SparseFeatureVector(SparseVector): <NEW_LINE> <INDENT> def __init__( self, save_to_cache=False, load_from_cache=False, cached_features_file=None, ): <NEW_LINE> <INDENT> SparseVector.__init__(self) <NEW_LINE> self.cached_features_file = cached_features_file <NEW_LINE> self.save_to_cache = save_to_cache <NEW_LINE> ... | A generic class for a sparse feature vector. | 62598fa366656f66f7d5a293 |
class StructuralAssetClass(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,*... | Represents the type of material described by a structural asset. This enum value is returned by Autodesk::Revit::DB::StructuralAsset::StructuralAssetClass.
enum StructuralAssetClass,values: Basic (1),Concrete (4),Gas (7),Generic (2),Liquid (6),Metal (3),Plastic (8),Undefined (0),Wood (5) | 62598fa330bbd722464698c9 |
class AddAPTReconstructionForm(APTReconstructionForm): <NEW_LINE> <INDENT> name = StringField('Name', description='Name of reconstruction', render_kw=dict(pattern='\\w+', title='Only word characters allowed: A-Z, a-z, 0-9, and _'), validators=[Regexp('\\w+', message='Reconstruction name can only contain word ' 'charact... | Form to add reconstruction metadata to a sample | 62598fa3d53ae8145f918330 |
class DataTimeSensor(TimeSensor): <NEW_LINE> <INDENT> Points_type = DataTimePoint <NEW_LINE> Slots_type = DataTimeSlot <NEW_LINE> @property <NEW_LINE> def Points_data_labels(self): <NEW_LINE> <INDENT> raise NotImplementedError('{}: Points_data_labels not implemented'.format(self.__class__.__name__)) <NEW_LINE> <DEDENT... | A time-based data sensor is a sensor that produces time-based data. | 62598fa326068e7796d4c7fc |
class SymbolTableEntry(object): <NEW_LINE> <INDENT> def __init__(self, symbol, visited=False): <NEW_LINE> <INDENT> self.symbol = symbol <NEW_LINE> self.visited = visited <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '%s<rva=0x%08X, tag=%s, kind=%s, name=%r, undecorated=%r>' % ( self.__class__.__nam... | Denotes a code symbol and whether or not it was reached in a trace.
Attributes:
symbol: A DiaSymbol object.
visited: Whether or not the symbol was dynamically visited. | 62598fa36e29344779b00500 |
class JSONFormatterPlugin: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def format_json(unformatted: str, _info_str: str) -> str: <NEW_LINE> <INDENT> parsed = json.loads(unformatted) <NEW_LINE> return json.dumps(parsed, indent=2) + "\n" | A code formatter plugin that formats JSON. | 62598fa38e7ae83300ee8f45 |
class ConsultRss(TemplateView): <NEW_LINE> <INDENT> template_name = "base/update.html" <NEW_LINE> feeds = RSSFeeds.objects.all() <NEW_LINE> entries = RSSEntries.objects.all() <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super().get_context_data(**kwargs) <NEW_LINE> context['feeds'] = s... | Web page for rss entries viewing | 62598fa33c8af77a43b67e93 |
class buildings_SSS_units(gridcell_buildings_SSS_units): <NEW_LINE> <INDENT> def dependencies(self): <NEW_LINE> <INDENT> return [attribute_label("building", self.is_type_variable), attribute_label("building", "residential_units" ), attribute_label("building", "zone_id")] | Sum of residential units from buildings of given type across zones. | 62598fa45f7d997b871f9332 |
class JogoDoTesouroInca: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.templo = "Você está diante de um templo Inca." <NEW_LINE> self.baralho = Baralho() <NEW_LINE> <DEDENT> def vai(self): <NEW_LINE> <INDENT> continua = " Você vai entrar? (s/N)" <NEW_LINE> if input(self.templo+continua) == "s": <NEW_... | O jogo do tesouro inca.
O jogo começa quando se invoca o método vai | 62598fa4656771135c489525 |
class ScrollBar(ClickableWidget): <NEW_LINE> <INDENT> pass | A ScrollBar Widget().
* Supports mouse-wheels.
TODO: Implement! | 62598fa492d797404e388ab7 |
class SendConfigurationValidityReportOperation(model._SendConfigurationValidityReportOperation): <NEW_LINE> <INDENT> def activate(self, request: model.SendConfigurationValidityReportRequest): <NEW_LINE> <INDENT> return self._activate(request) <NEW_LINE> <DEDENT> def get_response(self): <NEW_LINE> <INDENT> return self._... | SendConfigurationValidityReportOperation
Create with GreengrassCoreIPCClient.new_send_configuration_validity_report() | 62598fa4462c4b4f79dbb8b0 |
class DefenderStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> PROTECTED = "Protected" <NEW_LINE> UNPROTECTED = "Unprotected" <NEW_LINE> UNKNOWN = "Unknown" | Status of Azure Defender.
| 62598fa445492302aabfc374 |
class ProcessQueue(object): <NEW_LINE> <INDENT> KEY_NAME = 'app:img:queue' <NEW_LINE> WAIT_NAME = 'app:img:wait_ack' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.r = redis_db.get_connect() <NEW_LINE> self.log = logger.get_log(ProcessQueue) <NEW_LINE> <DEDENT> def r(self): <NEW_LINE> <INDENT> return self.r <N... | 利用redis实现消息队列 | 62598fa47d847024c075c26a |
class _CFunctionDeclaration(object): <NEW_LINE> <INDENT> def as_dict(self): <NEW_LINE> <INDENT> keys = ["ret", "fname", "choset", "args", "fnget"] <NEW_LINE> return dict((k, getattr(self, k)) for k in keys if hasattr(self, k)) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_string(cls, cfstr): <NEW_LINE> <INDENT> ... | A class to sotre parsed information of C-function declaration
Attributes
----------
ret : str or None
returned value
fname : str
name of function
choset : list of {'choices': [str], 'key': str}
choice set
args : list of {'aname': [str], 'default': obj, 'cdt': str}
arguments
fnget : (str, str, ...) -> s... | 62598fa4cb5e8a47e493c0c9 |
class SODARAPIPermissionTestMixin(SODARAPIViewTestMixin): <NEW_LINE> <INDENT> def assert_response_api( self, url, users, status_code, method='GET', format='json', data=None, media_type=None, version=None, knox=False, cleanup_method=None, req_kwargs=None, ): <NEW_LINE> <INDENT> if cleanup_method and not callable(cleanup... | Mixin for permission testing with knox auth | 62598fa4379a373c97d98eb6 |
class SlottyAPI(BaseNamespace, BroadcastMixin): <NEW_LINE> <INDENT> def process_packet(self, packet): <NEW_LINE> <INDENT> from pprint import pformat <NEW_LINE> app.logger.info("Received Packet: %s", pformat(packet)) <NEW_LINE> packet_type = packet['type'] <NEW_LINE> if packet_type == 'connect': <NEW_LINE> <INDENT> cont... | Endpoint for the socket.io connection.
Broadcasts all incoming zmq.green data to the connected
clients | 62598fa4be8e80087fbbef06 |
class TestStudentWithSituation(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.student = StudentWithSituation('1', 'Test', 10) <NEW_LINE> <DEDENT> def test_getters(self): <NEW_LINE> <INDENT> self.assertEqual(self.student.get_id(), '1') <NEW_LINE> self.assertEqual(self.student.get_name(... | Class for testing the StudentWithSituation class | 62598fa432920d7e50bc5efb |
class SimpleMessageSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Message <NEW_LINE> fields = ('id', 'body', 'sender', 'thread', 'sent_at') | Returns the messages without complementary information. | 62598fa4b7558d58954634d4 |
class Package(BASE, ModificationsTrackedObject): <NEW_LINE> <INDENT> __tablename__ = 'package' <NEW_LINE> id = sa.Column(sa.String(36), primary_key=True, default=uuidutils.generate_uuid) <NEW_LINE> archive = sa.Column(st.LargeBinary()) <NEW_LINE> fully_qualified_name = sa.Column(sa.String(128), nullable=False, index=Tr... | Represents a meta information about application package. | 62598fa432920d7e50bc5efc |
class PlantDataset(dataset.Dataset): <NEW_LINE> <INDENT> def __init__(self, root, transform=None, target_transform=None, image_size=32, train=True): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.transform = transform <NEW_LINE> self.target_transform = target_transform <NEW_LINE> self.total_data_size = 0 <NEW_L... | We extend the PyTorch dataset class, zie: http://pytorch.org/docs/data.html | 62598fa47b25080760ed734f |
class TestJobScheduleDate(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 testJobScheduleDate(self): <NEW_LINE> <INDENT> pass | JobScheduleDate unit test stubs | 62598fa4ac7a0e7691f723b0 |
class card40(unittest.TestCase): <NEW_LINE> <INDENT> def testPlayable(self): <NEW_LINE> <INDENT> app = Labyrinth(1, 1, testBlankScenarioSetup) <NEW_LINE> self.assertFalse(app.deck["40"].playable("US", app)) <NEW_LINE> app.map["Libya"].governance = 3 <NEW_LINE> app.map["Libya"].alignment = "Adversary" <NEW_LINE> self.as... | Mass Turnout | 62598fa43317a56b869be49c |
class VersionInteger(Integer): <NEW_LINE> <INDENT> def from_json(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> value = int(value) <NEW_LINE> if value not in VERSION_TUPLES: <NEW_LINE> <INDENT> version_error_string = "Could not find version {0}, using version {1} instead" <NEW_LINE> log.error(version_error_... | A model type that converts from strings to integers when reading from json.
Also does error checking to see if version is correct or not. | 62598fa41b99ca400228f482 |
class FilterByHost(HierarchicalBucketFilter): <NEW_LINE> <INDENT> sweepInterval = 60 * 20 <NEW_LINE> def getBucketKey(self, transport): <NEW_LINE> <INDENT> return transport.getPeer()[1] | A bucket filter with a bucket for each host.
| 62598fa46e29344779b00502 |
class dom_weekend_holiday(dom_holiday): <NEW_LINE> <INDENT> fg = (0,0,0) <NEW_LINE> bg = (0.95,0.95,0.95) | day of month (weekend & holiday) | 62598fa407f4c71912baf2e9 |
class BfdIpv6(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "local_ipv6","nexthop_ipv6"] <NEW_LINE> self.b_key = "bfd-ipv6" <NEW_LINE> self.a10_url="/axapi/v3/ipv6/route/static/bfd/bfd-ipv6/{local_ipv6}+{nexthop_ipv6}" <NEW_LINE> se... | Class Description::
Bidirectional Forwarding Detection.
Class bfd-ipv6 supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param local_ipv6: {"optional": false, "type": "string", "description": "Local IPv6 address", "format": "ipv6-address"}
:param u... | 62598fa41f037a2d8b9e3f90 |
class ZeroFloat(float): <NEW_LINE> <INDENT> def __sub__(self, other): <NEW_LINE> <INDENT> return float(self) - float(other) if other != 0 else 0 | Special float type which returns zero if the amount to be subtracted is zero | 62598fa45f7d997b871f9333 |
class _NamespaceMerger: <NEW_LINE> <INDENT> def __init__(self, namespace: Any = None) -> None: <NEW_LINE> <INDENT> self.__namespace = namespace or Namespace() <NEW_LINE> <DEDENT> def merge(self, values: Dict[str, Any]) -> Any: <NEW_LINE> <INDENT> target = self.__namespace <NEW_LINE> if values is not None: <NEW_LINE> <I... | Simple instance used to merge dictionary objects into an existing
object. | 62598fa456ac1b37e6302092 |
class PhysicalSignal(models.Model): <NEW_LINE> <INDENT> signal_name = models.CharField(max_length=25, default="None") <NEW_LINE> signal_description = models.CharField(max_length=30, blank=True) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.signal_name | Description of the physical phenomenon being measured, such as air temperature, pressure, etc. | 62598fa43539df3088ecc15a |
class DocumentViewNotFound(Exception): <NEW_LINE> <INDENT> pass | Exception returned when a view cannot be found. | 62598fa4009cb60464d013ca |
class Task(models.Model): <NEW_LINE> <INDENT> task_name = models.CharField(max_length=200) <NEW_LINE> task_points = models.IntegerField(default=5,validators=[MinValueValidator(0), MaxValueValidator(100)]) <NEW_LINE> task_description = models.CharField(default='default task_description', max_length=600) <NEW_LINE> task_... | Table of the different tasks that have to be done, such as 'clean table', 'hover carpet'.... | 62598fa4d486a94d0ba2be77 |
class Shot(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> show_id = db.Column(db.Integer, db.ForeignKey('show.id')) <NEW_LINE> show = db.relationship('Show', backref=db.backref('shots', lazy='dynamic')) <NEW_LINE> frame_start = db.Column(db.Integer()) <NEW_LINE> frame_end = db.Co... | A Shot is one of the basic units of brender
The creation of a shot can happen in different ways:
* within brender (using a shot creation form)
* via a query from an external software (e.g. Attract) | 62598fa463d6d428bbee2658 |
class TestContainsAllDigits(unittest.TestCase): <NEW_LINE> <INDENT> def test_1(self): <NEW_LINE> <INDENT> self.assertEqual(True, solution.contains_digits(402123, [0, 3, 4])) <NEW_LINE> <DEDENT> def test_2(self): <NEW_LINE> <INDENT> self.assertEqual(False, solution.contains_digits(666, [6,4])) <NEW_LINE> <DEDENT> def te... | docstring for TestContainsAllDigits | 62598fa423849d37ff850f5b |
class WorkflowBase(object): <NEW_LINE> <INDENT> def get_workflow(self): <NEW_LINE> <INDENT> return utils.get_workflow(self) <NEW_LINE> <DEDENT> def remove_workflow(self): <NEW_LINE> <INDENT> return utils.remove_workflow_from_object(self) <NEW_LINE> <DEDENT> def set_workflow(self, workflow): <NEW_LINE> <INDENT> return u... | Mixin class to make objects workflow-aware. | 62598fa4be383301e025369e |
class BlogEngine(TextEngine): <NEW_LINE> <INDENT> DEFAULTS = Config( URL = '/blog', PERMALINK = '{time:%Y/%m/%d}/{slug}', DATETIME_FORMAT = '%Y/%m/%d %H:%M', DEFAULT_FIELDS = {}, CONTENT_DIR = 'blog', UNIT_FNAME_PATTERN = '*', UNIT_TEMPLATE = 'blog_unit.html', PAGINATION_TEMPLATE = 'blog_pagination.html', SORT_KEY = '-... | Engine for processing text files into a blog.
This engine uses the TextUnit class to represent its resource. Prior to
writing the output, the TextUnit objects are sorted according to the
configuration. They are then chained together by adding to each unit
permalinks that link to the previous and/or next units.
It als... | 62598fa410dbd63aa1c70a56 |
class NavigationUnit: <NEW_LINE> <INDENT> def __init__(self, perception_unit, drive_controller, vehicle_constants): <NEW_LINE> <INDENT> self._perception_unit = perception_unit <NEW_LINE> self._drive_controller = drive_controller <NEW_LINE> self._vehicle_constants = vehicle_constants <NEW_LINE> self._drive_ctrl = BasicP... | Coordinator between internal perception model, outer high level command software (UI or AI), path planning through to drive control and course maintainence. | 62598fa48c0ade5d55dc35e3 |
class Metadata(ZeroArgAction): <NEW_LINE> <INDENT> def __call__(self, parser, ns, values, option_string=None): <NEW_LINE> <INDENT> md = discover_metadata_in_cyclus_path() <NEW_LINE> writer = CustomWriter("{", "}", "[", "]", ": ", ", ", " ", 80) <NEW_LINE> s = writer.write(md) <NEW_LINE> print(s.rstrip()) | Displays all known cyclus agents | 62598fa43d592f4c4edbad74 |
class PlaceholderTestItem(Item): <NEW_LINE> <INDENT> attr = integer() <NEW_LINE> other = integer() <NEW_LINE> characters = text() | Type used by the placeholder support test cases. | 62598fa44e4d5625663722ca |
@python_2_unicode_compatible <NEW_LINE> class Username(models.Model): <NEW_LINE> <INDENT> value = models.CharField( max_length=255, verbose_name=_(u"username"), help_text=_(u"username allowed to connect to the service") ) <NEW_LINE> service_pattern = models.ForeignKey( ServicePattern, related_name="usernames", on_delet... | Bases: :class:`django.db.models.Model`
A list of allowed usernames on a :class:`ServicePattern` | 62598fa455399d3f056263c9 |
class ConnectionMonitorHttpConfiguration(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'port': {'key': 'port', 'type': 'int'}, 'method': {'key': 'method', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'request_headers': {'key': 'requestHeaders', 'type': '[HTTPHeader]'}, 'valid_status_cod... | Describes the HTTP configuration.
:param port: The port to connect to.
:type port: int
:param method: The HTTP method to use. Possible values include: "Get", "Post".
:type method: str or ~azure.mgmt.network.v2020_03_01.models.HTTPConfigurationMethod
:param path: The path component of the URI. For instance, "/dir1/dir2... | 62598fa47047854f4633f27f |
class LanguageRange(object): <NEW_LINE> <INDENT> def __init__(self, language, quality=1.0): <NEW_LINE> <INDENT> if language == "*": <NEW_LINE> <INDENT> language = "*-*" <NEW_LINE> <DEDENT> if "-" in language: <NEW_LINE> <INDENT> self.type, self.subtype = language.split("-") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | Represents one language range in an RFC 2616 Accept field | 62598fa401c39578d7f12c25 |
class TwistedEvent(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._waiters = [] <NEW_LINE> self._result = None <NEW_LINE> <DEDENT> def fire(self): <NEW_LINE> <INDENT> self._fire(('callback', True)) <NEW_LINE> <DEDENT> def fail(self, reason): <NEW_LINE> <INDENT> self._fire(('errback', reason))... | An asynchronous event that is in one of three states:
1. Not fired
2. Fired succesfully
3. Failed
Clients wishing to be notified when the event has
either occurred or failed can call wait() to receive
a deferred that will be fired with callback(True) for
state 2 and with errback(reason) for state 3.
Each waite... | 62598fa444b2445a339b68c1 |
class Feature(models.Model): <NEW_LINE> <INDENT> title = models.TextField() <NEW_LINE> name = models.CharField(max_length=256) <NEW_LINE> description = models.TextField() <NEW_LINE> due_date = models.DateField() <NEW_LINE> class FeatureStatus(models.IntegerChoices): <NEW_LINE> <INDENT> TO_DO = 0 <NEW_LINE> IN_PROGRESS ... | Model describing a Feature
For a Feature has a foreign key
to the Project - each Feature has one project it is under.
For a Feature has a foreign key
to the User - each Feature has one assigned user. | 62598fa42ae34c7f260aaf88 |
class TestStorage(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> os.environ["testing"] = "1" <NEW_LINE> dotenv.load_dotenv('.env.testing') <NEW_LINE> conn = sqlite3.connect('data/' + os.environ['DB_NAME']) <NEW_LINE> install.createSchema(conn) <NEW_LINE> conn.close() <NEW_LINE> df = pd.rea... | Testing reading and writing network to db | 62598fa45fdd1c0f98e5de3f |
class LogStream(pulumi.CustomResource): <NEW_LINE> <INDENT> def __init__(__self__, __name__, __opts__=None, log_group_name=None, name=None): <NEW_LINE> <INDENT> if not __name__: <NEW_LINE> <INDENT> raise TypeError('Missing resource name argument (for URN creation)') <NEW_LINE> <DEDENT> if not isinstance(__name__, bases... | Provides a CloudWatch Log Stream resource. | 62598fa4236d856c2adc938e |
class IPrincipalsAddedToGroupEvent(IPrincipalsGroupEvent): <NEW_LINE> <INDENT> pass | Interface of event fired when principals were added to group | 62598fa46aa9bd52df0d4d71 |
class ResultCallback(CallbackBase): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ResultCallback, self).__init__(*args, **kwargs) <NEW_LINE> self.host_ok = {} <NEW_LINE> self.host_unreachable = {} <NEW_LINE> self.host_failed = {} <NEW_LINE> <DEDENT> def v2_runner_on_unreachable(self... | A sample callback plugin used for performing an action as results come in
If you want to collect all results into a single object for processing at
the end of the execution, look into utilizing the ``json`` callback plugin
or writing your own custom callback plugin | 62598fa499cbb53fe6830d7b |
class RunFlowFlags(object): <NEW_LINE> <INDENT> def __init__(self, browser_auth): <NEW_LINE> <INDENT> self.auth_host_port = [8080, 8090] <NEW_LINE> self.auth_host_name = "localhost" <NEW_LINE> self.logging_level = "ERROR" <NEW_LINE> self.noauth_local_webserver = not browser_auth | Flags for oauth2client.tools.run_flow. | 62598fa491f36d47f2230df6 |
class StateCache(object): <NEW_LINE> <INDENT> def __init__(self, initial_state): <NEW_LINE> <INDENT> self.states = [None] * STATE_CACHE_SIZE <NEW_LINE> self.current_state_index = 0 <NEW_LINE> self.num_prev_states = 0 <NEW_LINE> self.num_next_states = 0 <NEW_LINE> self.states[0] = initial_state <NEW_LINE> self.update_ac... | The state cache is an interface to a list to record data/states and to revert to previous states.
States are recorded into the list in a circular fassion by using an index for the current state,
and counters for the range where states are stored. | 62598fa4e64d504609df930d |
class MetamodelBuilder: <NEW_LINE> <INDENT> def add_module_attribute(self, module, spec): <NEW_LINE> <INDENT> if not spec: <NEW_LINE> <INDENT> return module <NEW_LINE> <DEDENT> attribute_name = spec['name'] <NEW_LINE> attribute_value = spec['arguments'] <NEW_LINE> if attribute_name in module.attributes_to_ignore: <NEW_... | This class generates a Module and all its Models and Fields from a spec | 62598fa48e7ae83300ee8f49 |
class Fractal: <NEW_LINE> <INDENT> def __init__(self, size, scale, computation): <NEW_LINE> <INDENT> self.scale = scale <NEW_LINE> self.size = size <NEW_LINE> self.computation = computation <NEW_LINE> self.coordinate_step_for_x = abs(self.scale[0][0] - self.scale[1][0]) / self.size[0] <NEW_LINE> self.coordinate_step_fo... | Class for drawing fractal. | 62598fa4cc0a2c111447aeb7 |
class TestTradeApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = swagger_client.apis.trade_api.TradeApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_trade_get(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_trade_g... | TradeApi unit test stubs | 62598fa4097d151d1a2c0ece |
class LayerNorm(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_features, eps=1e-6): <NEW_LINE> <INDENT> super(LayerNorm, self).__init__() <NEW_LINE> self.a = nn.Parameter(torch.ones(num_features)) <NEW_LINE> self.b = nn.Parameter(torch.zeros(num_features)) <NEW_LINE> self.eps = eps <NEW_LINE> <DEDENT> def forwa... | Applies Layer Normalization over a mini-batch of inputs as described in
the paper `Layer Normalization`_ .
.. math::
y = rac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x]} + \epsilon} * \gamma + eta
This is provided in pytorch's master, and can be replaced in the near future.
For the time, being, this code is adapt... | 62598fa4baa26c4b54d4f158 |
class Encoder: <NEW_LINE> <INDENT> def __init__(self, classes): <NEW_LINE> <INDENT> self.class_to_ix = {} <NEW_LINE> self.ix_to_class = {} <NEW_LINE> for cl in classes: <NEW_LINE> <INDENT> if cl not in self.class_to_ix: <NEW_LINE> <INDENT> ix = len(self.class_to_ix) <NEW_LINE> self.class_to_ix[cl] = ix <NEW_LINE> self.... | Mapping between classes and the corresponding indices.
>>> classes = ["English", "German", "French"]
>>> enc = Encoder(classes)
>>> assert "English" == enc.decode(enc.encode("English"))
>>> assert "German" == enc.decode(enc.encode("German"))
>>> assert "French" == enc.decode(enc.encode("French"))
>>> set(range(3)) == ... | 62598fa463d6d428bbee2659 |
class Checker(object): <NEW_LINE> <INDENT> @property <NEW_LINE> def checks(self): <NEW_LINE> <INDENT> condition = lambda a: a.startswith('check_') <NEW_LINE> return (getattr(self, a) for a in dir(self) if condition(a)) <NEW_LINE> <DEDENT> def __call__(self, *args, **kwargs): <NEW_LINE> <INDENT> err_messages = [] <NEW_L... | An abstract class that allow for defining checks as methods.
Each check should have the same signature, so that `check_all` can iterate
over them. Checks follow an unix-like convention of returning a value that
evaluate to False if the for no error conditions, and a value evaluating
to True (namely a list of error me... | 62598fa4d7e4931a7ef3bf43 |
class Config(object): <NEW_LINE> <INDENT> yaml = CFTBaseYAML() <NEW_LINE> def __init__(self, item, project=None): <NEW_LINE> <INDENT> self.source = item <NEW_LINE> if project: <NEW_LINE> <INDENT> self._project = project <NEW_LINE> <DEDENT> if os.path.exists(item): <NEW_LINE> <INDENT> with io.open(item) as _fd: <NEW_LIN... | Class representing a CFT config.
Attributes:
as_file (io.StringIO): A file-like interface to the
jinja-rendered config.
as_string (string): the jinja-rendered config.
id (string): A base64-encoded id representing the path or raw
content of the config. Could be used as a dict key.
source... | 62598fa424f1403a92685807 |
class SupermarketRecruit(BasePage, ElementRecruit): <NEW_LINE> <INDENT> u <NEW_LINE> def add_recruit(self, position_name='random',recruit_number='10',contact_way='0371-7981225', experience='3-5年',work_property=u'全职',salary=u'面议',education=u'高中', province=u'河南省',city=u'许昌市',country=u'鄢陵县',email='test@test.com', describe... | 超市招聘信息 | 62598fa4090684286d59362f |
class IntBinLengthTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_0(self): <NEW_LINE> <INDENT> self.assertEqual(1, ga._int_bin_length(0)) <NEW_LINE> <DEDENT> def test_1(self): <NEW_LINE> <INDENT> self.assertEqual(1, ga._int_bin_length(1)) <NEW_LINE> <DEDENT> def test_2(self): <NEW_LINE> <INDENT> self.assertEq... | Test _int_bin_length | 62598fa4d6c5a102081e1fee |
class JoinLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, drop_p, is_global, global_path, **kwargs): <NEW_LINE> <INDENT> self.p = 1. - drop_p <NEW_LINE> self.is_global = is_global <NEW_LINE> self.global_path = global_path <NEW_LINE> self.uses_learning_phase = True <NEW_LINE> super(JoinLayer, self).__init__(**kwarg... | This layer will behave as Merge(mode='ave') during testing but
during training it will randomly select between using local or
global droppath and apply the average of the paths alive after
aplying the drops.
- Global: use the random shared tensor to select the paths.
- Local: sample a random tensor to select the paths. | 62598fa463d6d428bbee265a |
class DownNbrReasonNaIdentity(DownNbrReasonIdentity): <NEW_LINE> <INDENT> _prefix = 'mpls-ldp-ios-xe-oper' <NEW_LINE> _revision = '2017-02-07' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> DownNbrReasonIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from y... | Not applicable, the neighbor is up.. | 62598fa4be383301e02536a0 |
class BaseReporter(object): <NEW_LINE> <INDENT> only_full_id = False <NEW_LINE> header = ["********************** Slide Deck {path}"] <NEW_LINE> footer = [""] <NEW_LINE> formatter = None <NEW_LINE> def __init__(self, show_id, mute_ids, path): <NEW_LINE> <INDENT> self.show_id = self.only_full_id or show_id <NEW_LINE> se... | Basic class for creating reports from raw checks results | 62598fa4dd821e528d6d8ddc |
class ProximityPlacementGroup(Resource): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, 'location': {'required': True}, 'virtual_machines': {'readonly': True}, 'virtual_machine_scale_sets': {'readonly': True}, 'availability_sets': {'readonly': True}... | Specifies information about the proximity placement group.
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 id: Resource Id.
:vartype id: str
:ivar name: Resource name.
:vartype name: str
:ivar type: Res... | 62598fa45166f23b2e24327f |
class Function(DeclNode): <NEW_LINE> <INDENT> def __init__(self, args, child): <NEW_LINE> <INDENT> self.args = args <NEW_LINE> self.child = child <NEW_LINE> super().__init__() | Represents an function with given arguments and returning given type.
args (List(Node)) - arguments of the functions. | 62598fa4e1aae11d1e7ce777 |
class AoiView(aoi.AoiView): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(methods=["-DRAW", "-POINTS"], **kwargs) <NEW_LINE> self.elevation = False <NEW_LINE> self.btn.color = "secondary" <NEW_LINE> <DEDENT> @su.loading_button(debug=False) <NEW_LINE> def _update_aoi(self, widget... | Extend the aoi_view component from sepal_ui.mapping to add
the extra coloring parameter used in this application. To do so we were
forced to copy/paste the _update_aoi | 62598fa4a8ecb033258710b7 |
class Deposit(Asset): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError | Short term cash deposit paying simple (not compounded) interest | 62598fa438b623060ffa8f3d |
class Run_attribute(Base): <NEW_LINE> <INDENT> __tablename__ = 'run_attribute' <NEW_LINE> __table_args__ = ( UniqueConstraint('run_id', 'attribute_name', 'attribute_value'), { 'mysql_engine':'InnoDB', 'mysql_charset':'utf8' }) <NEW_LINE> run_attribute_id = Column(INTEGER(unsigned=True), primary_key=True, nullable=Fals... | A table for loading run attributes
:param run_attribute_id: An integer id for run_attribute table
:param attribute_name: An optional string attribute name, allowed length 30
:param attribute_value: An optional string attribute value, allowed length 50
:param run_id: An integer id from run table (foreign key) | 62598fa44428ac0f6e6583d4 |
class AwsProvisioningChecker(AbstractProvisioningChecker): <NEW_LINE> <INDENT> def get_state_file_path(self): <NEW_LINE> <INDENT> return "/var/lib/jenkins/workspace/dt_aws/provisioning/terraform/aws/terraform.tfstate" <NEW_LINE> <DEDENT> def get_grep_term(self): <NEW_LINE> <INDENT> return "public_dns = " | checks aws provisioning | 62598fa4a17c0f6771d5c0dd |
class DataPoint(Base): <NEW_LINE> <INDENT> __tablename__= "data_point" <NEW_LINE> id = Column(Integer(), primary_key=True) <NEW_LINE> name = Column(String(80), default="Anonymous") <NEW_LINE> N = Column(Float(), nullable=False) <NEW_LINE> Rstar = Column(Float(), nullable=False) <NEW_LINE> fp = Column(Float(), nullable=... | A datapoint that the user has determined. | 62598fa45fdd1c0f98e5de41 |
class LatencyMetric(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'readonly': True}, 'end_date_time_utc': {'readonly': True}, 'a_value': {'readonly': True}, 'b_value': {'readonly': True}, 'delta': {'readonly': True}, 'delta_percent': {'readonly': True}, 'a_c_lower95_ci': {'readonly': True}, ... | Defines the properties of a latency metric used in the latency scorecard.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar name: The name of the Latency Metric.
:vartype name: str
:ivar end_date_time_utc: The end time of the Latency Scorecard in UTC.
:vartype end_date_time... | 62598fa4435de62698e9bc9d |
class Cuboid: <NEW_LINE> <INDENT> def __init__(self, x_range, y_range, z_range): <NEW_LINE> <INDENT> if x_range[0] >= x_range[1]: raise RuntimeError("bad x") <NEW_LINE> if y_range[0] >= y_range[1]: raise RuntimeError("bad y") <NEW_LINE> if z_range[0] >= z_range[1]: raise RuntimeError("bad z") <NEW_LINE> self.x_range = ... | A cuboid represents a 3-dimensional rectangular area
The constructor takes ranges along the x, y, and z axis,
where each range is a tuple(min, max) of world coordinates.
Ranges are integers and are used like the Python built-in range
function where the second number is one past the end. Specifically,
to get a single ... | 62598fa432920d7e50bc5eff |
class VideoTagListResponse(messages.Message): <NEW_LINE> <INDENT> items = messages.MessageField( VideoTagResponseMessage, 1, repeated=True) <NEW_LINE> is_list = messages.BooleanField(2) | ProtoRPC message definition to represent a list of stored
video tags returned in a suitable format. | 62598fa4fbf16365ca793f65 |
class DeleteAMQPQueueResponse(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") | DeleteAMQPQueue返回参数结构体
| 62598fa43539df3088ecc15d |
class ProductionConfig(BaseConfig): <NEW_LINE> <INDENT> pass | 生产环境配置 | 62598fa430bbd722464698cc |
class itkSize1(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> __swig_destroy__ = _itkSizePython.delete_itkSize1 <NEW_LINE> def GetSizeDimension(): <NEW_LINE> <INDENT> return _itkSizePython.itkSize1_GetSizeDimension() <NEW_L... | Proxy of C++ itkSize1 class | 62598fa476e4537e8c3ef456 |
class TestContacts(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> copyfile('example_contacts.json', 'test_contacts.json') <NEW_LINE> self.json_file = 'test_contacts.json' <NEW_LINE> self.data = contacts.ContactData(self.json_file) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> os.remov... | Test contact management utilities | 62598fa48e7ae83300ee8f4a |
class ModelSelector(object): <NEW_LINE> <INDENT> def __init__(self, all_word_sequences: dict, all_word_Xlengths: dict, this_word: str, n_constant=3, min_n_components=2, max_n_components=10, random_state=14, verbose=False): <NEW_LINE> <INDENT> self.words = all_word_sequences <NEW_LINE> self.hwords = all_word_Xlengths <N... | Base class for model selection (strategy design pattern).
| 62598fa48e7ae83300ee8f4b |
class Cell: <NEW_LINE> <INDENT> def __init__(self, x, y, data, state): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.data = data <NEW_LINE> self.state = state <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> print("x: " + str(self.x) + ", y: " + str(self.y) + ", data: " + str(self.data)... | Initialises a new cell. | 62598fa476e4537e8c3ef457 |
class TPTextureRenderer(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "uv.tp_texture_renderer" <NEW_LINE> bl_label = "Texture renderer" <NEW_LINE> __handle = None <NEW_LINE> __timer = None <NEW_LINE> @staticmethod <NEW_LINE> def handle_add(self, context): <NEW_LINE> <INDENT> TPTextureRenderer.__handle = bpy.type... | Rendering texture | 62598fa421bff66bcd722b10 |
class Top_Endzone(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self,screen,colour,y_position): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = pygame.Surface(((screen.get_width()-50),40)) <NEW_LINE> self.image = self.image.convert() <NEW_LINE> self.image.fill (colour) <NEW_LIN... | This class defines the sprite for the top endzones | 62598fa48c0ade5d55dc35e5 |
class Gaussian(_Prior): <NEW_LINE> <INDENT> density = "gaussian" <NEW_LINE> def __init__(self, mean, standard_deviation, lower=float("-inf"), upper=float("inf"), eta=None, name=None): <NEW_LINE> <INDENT> super().__init__(name=name) <NEW_LINE> _validate_bounds(lower, mean, upper) <NEW_LINE> _validate_standard_deviation(... | A Gaussian is
.. math::
f(x) = \frac{1}{2\pi \sigma^2} e^{-(x-\mu)^2/(2\sigma^2)}
where :math:`\sigma` is the variance and :math:`\mu` the mean.
Args:
mean (float): This is :math:`\mu`.
standard_deviation (float): This is :math:`\sigma`.
lower (float): lower limit.
upper (float): upper limit.
... | 62598fa4d486a94d0ba2be79 |
class CanSubmitToAgency(permissions.BasePermission): <NEW_LINE> <INDENT> def has_permission(self, request, view): <NEW_LINE> <INDENT> deqar_profile = DEQARProfile.objects.get(user=request.user) <NEW_LINE> try: <NEW_LINE> <INDENT> report_file = ReportFile.objects.get(pk=view.kwargs['pk']) <NEW_LINE> return deqar_profile... | Object-level permission to only allow users who are allowed to submit for a particular agency. | 62598fa4796e427e5384e63e |
class Game: <NEW_LINE> <INDENT> def __init__(self, player1, player2): <NEW_LINE> <INDENT> self.p1 = player1 <NEW_LINE> self.p2 = player2 <NEW_LINE> self.turn = 0 <NEW_LINE> <DEDENT> def play(self): <NEW_LINE> <INDENT> while not self.game_over: <NEW_LINE> <INDENT> if self.turn % 2 == 0: <NEW_LINE> <INDENT> self.p1.choos... | >>> p1, p2 = Player('Hill'), Player('Don')
>>> g = Game(p1, p2)
>>> winner = g.play()
>>> p1 is winner
True | 62598fa401c39578d7f12c2a |
class ValidationPolicy(object): <NEW_LINE> <INDENT> proxy_ip: ProxyIP = None <NEW_LINE> def __init__(self, proxy_ip: ProxyIP): <NEW_LINE> <INDENT> self.proxy_ip = proxy_ip <NEW_LINE> <DEDENT> def should_validate(self) -> bool: <NEW_LINE> <INDENT> if self.proxy_ip.attempts == 0: <NEW_LINE> <INDENT> return True <NEW_LINE... | ValidationPolicy will make decision about validating a proxy IP from the following aspects:
1. Whether or not to validate the proxy
2. Use http or https to validate the proxy
After 3 attempts, the validator should try no more attempts in 24 hours after its creation. | 62598fa432920d7e50bc5f01 |
class ProjectPictureUpload(GalleryAccessMixin, View): <NEW_LINE> <INDENT> template_name = 'projects/picture_form.html' <NEW_LINE> form_class = ProjectPictureForm <NEW_LINE> gallery = None <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> self.object = self.get_object() <NEW_LINE> self.gallery = get_ga... | Upload new picture to selected gallery.
| 62598fa46aa9bd52df0d4d75 |
class DeleteComponent(ControlSurfaceComponent, Messenger): <NEW_LINE> <INDENT> def __init__(self, *a, **k): <NEW_LINE> <INDENT> super(DeleteComponent, self).__init__(*a, **k) <NEW_LINE> self._delete_button = None <NEW_LINE> return <NEW_LINE> <DEDENT> def set_delete_button(self, button): <NEW_LINE> <INDENT> self._delete... | Component for handling deletion of parameters | 62598fa467a9b606de545e76 |
class Bullet(Sprite): <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, ship): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.screen = screen <NEW_LINE> self.rect = pygame.Rect(0, 0, ai_settings.bullet_width, ai_settings.bullet_height) <NEW_LINE> self.rect.centerx = ship.rect.centerx <NEW_LINE> self.r... | A class to manage bullets fired from the ship. | 62598fa4435de62698e9bca0 |
class TweetListener(tw.streaming.StreamListener): <NEW_LINE> <INDENT> def __init__(self, pref = None): <NEW_LINE> <INDENT> super(TweetListener, self).__init__() <NEW_LINE> self.pref = pref <NEW_LINE> <DEDENT> def on_data(self, data): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> tweet = Tweet.parse(api, json.loads(data)... | StreamListener that channels tweets to a JSON file. | 62598fa48e7ae83300ee8f4c |
class Abort401(Abort): <NEW_LINE> <INDENT> pass | Error 401 class for aborting execution. | 62598fa457b8e32f52508071 |
class QuadeMock: <NEW_LINE> <INDENT> def __init__(self, mdle, funcs=Default): <NEW_LINE> <INDENT> self.module = mdle <NEW_LINE> if funcs == Default: <NEW_LINE> <INDENT> funcs = [customer, staff_user] <NEW_LINE> <DEDENT> self.funcs = funcs <NEW_LINE> <DEDENT> def __call__(self, fn): <NEW_LINE> <INDENT> @wraps(fn) <NEW_L... | Monkey patch the FixtureManager's registry, and automatically unapply the patch afterwards. | 62598fa463d6d428bbee265d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.