code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class RGBAColorMapper(object): <NEW_LINE> <INDENT> def __init__(self, low, high, palette): <NEW_LINE> <INDENT> self.range = np.linspace(low, high, len(palette)) <NEW_LINE> self.r, self.g, self.b = list(zip(*[hex_to_rgb(i) for i in palette])) <NEW_LINE> <DEDENT> def color(self, data, alpha=255): <NEW_LINE> <INDENT> red ...
Maps floating point values to rgb values over a palette @author: Christine Doig
6259908166673b3332c31ee3
@attrs <NEW_LINE> class Filename: <NEW_LINE> <INDENT> name = attrib() <NEW_LINE> read_flags = attrib(default=Factory(lambda: 'r')) <NEW_LINE> write_flags = attrib(default=Factory(lambda: 'w')) <NEW_LINE> file_like = attrib(default=Factory(bool)) <NEW_LINE> def read(self): <NEW_LINE> <INDENT> if self.file_like: <NEW_LIN...
A filename instance. name The name of the file (or a file-like object). read_flags The flags to use when opening the file for reading. write_flags The flags used when opening the file for writing. file_like A boolean value specifying whether or not name is a file-like object.
62599081d486a94d0ba2da9b
class WallAnt(Ant): <NEW_LINE> <INDENT> name = "Wall" <NEW_LINE> food_cost = 4 <NEW_LINE> armor = 4 <NEW_LINE> implemented = True <NEW_LINE> def __init__(self, armor = 4): <NEW_LINE> <INDENT> Insect.__init__(self, armor)
WallAnt that does nothing to damage but has a high armor
62599081656771135c48ada2
class BadFilename(ReportableException): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> super(BadFilename, self).__init__("Invalid filename: %s" % (filename))
Reports invalid filename
6259908176e4537e8c3f1063
class GDepTotalStatistic(NestingStatisticGraphWise): <NEW_LINE> <INDENT> def _compute(self, g): <NEW_LINE> <INDENT> if g not in self: <NEW_LINE> <INDENT> self[g] = self._compute_nocache(g, set()) <NEW_LINE> <DEDENT> return self[g] <NEW_LINE> <DEDENT> def _compute_nocache(self, g, path): <NEW_LINE> <INDENT> if g in path...
Implements `GraphManager.graph_dependencies_total`.
62599081ad47b63b2c5a9335
@ns_measurement.route('/historical/<string:unique_id>/<string:unit>/<int:channel>/<int:epoch_start>/<int:epoch_end>') <NEW_LINE> @ns_measurement.doc( security='apikey', responses=default_responses, params={ 'unique_id': 'The unique ID of the measurement', 'unit': 'The unit of the measurement', 'channel': 'The channel o...
Interacts with Measurement settings in the SQL database.
62599081bf627c535bcb2fb6
class _Convertible(object): <NEW_LINE> <INDENT> def __init__(self, enclosing_graph): <NEW_LINE> <INDENT> self._enclosing_graph = enclosing_graph <NEW_LINE> self._outgoing_edges = [] <NEW_LINE> self._converted_self = None <NEW_LINE> <DEDENT> def converted_self(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LI...
An entity that can have variables converted to constants.
62599081f9cc0f698b1c603e
class WrongModeError(Exception): <NEW_LINE> <INDENT> pass
Exception in the full url generation process
625990815fdd1c0f98e5fa64
class DevelopmentConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = 'mysql+mysqldb://jobplus:jobplus@localhost:3306/jobplus?charset=utf8'
开发环境配置
6259908144b2445a339b76cf
class ProjectMapLocationResource(MapLocationResource): <NEW_LINE> <INDENT> class Meta(MapLocationResource.Meta): <NEW_LINE> <INDENT> queryset = ProjectLocation.objects.all() <NEW_LINE> resource_name = 'project_map_location'
A Location resource optimized for use by many-pin maps
62599081aad79263cf43029f
class ParameterMapper(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, default_values, mapping_func): <NEW_LINE> <INDENT> self._default_values = default_values <NEW_LINE> self._mapping_func = mapping_func <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def map(self, value): <NEW_LINE> <...
defines an interface for mapping data parameter to sonic parameter
625990817d847024c075dec2
class KWSSigner: <NEW_LINE> <INDENT> def __init__(self, secret_key): <NEW_LINE> <INDENT> self.secret_key = ascii_to_hashable(secret_key) <NEW_LINE> <DEDENT> def sign_with_content_md5(self, method, content_md5, content_type, date, request_path): <NEW_LINE> <INDENT> toSign = ascii_to_hashable(self.secret_key)+EOL+EOL <NE...
Class generating KWS request signatures.
625990815fcc89381b266ecf
class NinjaAnt(Ant): <NEW_LINE> <INDENT> name = 'Ninja' <NEW_LINE> damage = 1 <NEW_LINE> food_cost = 5 <NEW_LINE> armor = 1 <NEW_LINE> blocks_path = False <NEW_LINE> implemented = True <NEW_LINE> def action(self, colony): <NEW_LINE> <INDENT> bee_list = [b for b in self.place.bees] <NEW_LINE> for i in bee_list: <NEW_LIN...
NinjaAnt does not block the path and damages all bees in its place.
6259908126068e7796d4e426
class test_gettempdir(TC): <NEW_LINE> <INDENT> def test_directory_exists(self) -> None: <NEW_LINE> <INDENT> dir = tempfile.gettempdir() <NEW_LINE> self.assertTrue(os.path.isabs(dir) or dir == os.curdir, "%s is not an absolute path" % dir) <NEW_LINE> self.assertTrue(os.path.isdir(dir), "%s is not a directory" % dir) <NE...
Test gettempdir().
625990812c8b7c6e89bd52cb
class OperatingHours(models.Model): <NEW_LINE> <INDENT> day = models.IntegerField(choices = DAYS, db_index = True) <NEW_LINE> opens = models.TimeField() <NEW_LINE> closes = models.TimeField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True
Abstract class for a place's operating hours
625990815166f23b2e244ebe
class SilentZEOServer(ZEOServer): <NEW_LINE> <INDENT> def setup_default_logging(self): <NEW_LINE> <INDENT> pass
A ZEO Server that doesn't write on the console
62599081a8370b77170f1eb7
class TagViewSet(BaseRacipeAttrViewSet): <NEW_LINE> <INDENT> queryset = Tag.objects.all() <NEW_LINE> serializer_class = serializers.TagSerializer
Manage tags in the database
6259908166673b3332c31ee5
class VTGateClient(object): <NEW_LINE> <INDENT> def __init__(self, addr, timeout, *pargs, **kwargs): <NEW_LINE> <INDENT> super(VTGateClient, self).__init__(*pargs, **kwargs) <NEW_LINE> self.addr = addr <NEW_LINE> self.timeout = timeout <NEW_LINE> self.session = None <NEW_LINE> <DEDENT> def dial(self): <NEW_LINE> <INDEN...
VTGateClient is the interface for the vtgate client implementations. All implementations must implement all these methods. If something goes wrong with the connection, this object will be thrown out. FIXME(alainjobart) transactional state (the Session object) is currently maintained by this object. It should be maint...
6259908123849d37ff852b9f
class Key(object): <NEW_LINE> <INDENT> def __init__(self, key_type, pub=None, priv=None, key=None): <NEW_LINE> <INDENT> self.key_type = key_type <NEW_LINE> if pub or priv: <NEW_LINE> <INDENT> if pub is not None and len(pub) != key_type.pubkey_len: <NEW_LINE> <INDENT> raise ValueError('pub key material is wrong length: ...
Base class for keys.
62599081bf627c535bcb2fb8
class TwitchIRC(object): <NEW_LINE> <INDENT> def __init__(self, channels=[]): <NEW_LINE> <INDENT> self.channels = channels <NEW_LINE> self._con = None <NEW_LINE> self._data = "" <NEW_LINE> <DEDENT> def login(self): <NEW_LINE> <INDENT> self._connect_socket() <NEW_LINE> self._con.send(bytes('PASS %s\r\n' % PASS, 'UTF-8')...
Client for reading messages from twitch.tv chat. Connects to the chat server, joins some number of channels, and returns the next message from all the channels each time get_message is called.
625990827047854f46340e9b
class PlaylistView(PlaylistMixin, generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> serializer_class = serializers.PlaylistDetailSerializer <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> obj = super().get_object() <NEW_LINE> obj.media = obj.ordered_media_item_queryset.viewable_by_user(self.request.user)...
Endpoint to retrieve an individual playlists.
625990828a349b6b43687d44
class TestDefaults(object): <NEW_LINE> <INDENT> def test_staticfiles_dirs(self): <NEW_LINE> <INDENT> self.assertFileContains('test.txt', 'Can we find') <NEW_LINE> self.assertFileContains(os.path.join('prefix', 'test.txt'), 'Prefix') <NEW_LINE> <DEDENT> def test_staticfiles_dirs_subdir(self): <NEW_LINE> <INDENT> self.as...
A few standard test cases.
62599082283ffb24f3cf5388
class DevelopmentConfig(BaseConfig): <NEW_LINE> <INDENT> DEBUG = True <NEW_LINE> BCRYPT_LOG_ROUNDS = 4 <NEW_LINE> SQLALCHEMY_DATABASE_URI = sqlite_local_base + database_name
Development configuration.
62599082a8370b77170f1eb8
class ModulesToInstallTests(TestCase): <NEW_LINE> <INDENT> def test_notexist(self): <NEW_LINE> <INDENT> root = os.path.dirname(os.path.dirname(twisted.__file__)) <NEW_LINE> for module in notPortedModules: <NEW_LINE> <INDENT> segments = module.split(".") <NEW_LINE> segments[-1] += ".py" <NEW_LINE> path = os.path.join(ro...
Tests for L{notPortedModules}.
62599082091ae35668706727
class NewsCrawl(object): <NEW_LINE> <INDENT> URL_BASE = 'https://www.google.com/search' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.payload = { 'tbm': 'nws', } <NEW_LINE> self.url = self.URL_BASE <NEW_LINE> <DEDENT> def crawl_term(self, q): <NEW_LINE> <INDENT> if not q: <NEW_LINE> <INDENT> return json.dumps...
Class used for making news requests.
625990827cff6e4e811b7529
class MyCar: <NEW_LINE> <INDENT> def __init__(self, x, y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def move(self, roads_amount, direction): <NEW_LINE> <INDENT> if direction == 0 and self.x > common.MARGIN + constants.ROAD_WIDTH / 2: <NEW_LINE> <INDENT> self.x -= constants.ROAD_WIDTH <NE...
Instance of this class becomes player's car on the game start
6259908266673b3332c31ee7
class _m_Home: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.dt_now = str(datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S")) <NEW_LINE> self.to_return = { "_time": self.dt_now, "_msg": "Welcome to PROJECTNAMEFSKLTN !" } <NEW_LINE> <DEDENT> def get_home(self): <NEW_LINE> <INDENT> self.to_return["_...
Create index
625990823346ee7daa3383d6
class ThreadedFTPServer(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, server): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.server = server <NEW_LINE> self.server.handler._auth_failed_timeout = 0.1 <NEW_LINE> self.host, self.port = self.server.socket.getsockname()[:2] <NEW_LINE> self....
Threaded FTP server for running unit tests.
62599082fff4ab517ebcf2fe
class ProfileNotFound(Exception): <NEW_LINE> <INDENT> pass
The profile you named does not exist in $HOME/.getawscreds
62599082656771135c48ada4
class OrderCancelTransaction(BaseEntity): <NEW_LINE> <INDENT> _summary_format = "Cancel Order {orderID}" <NEW_LINE> _name_format = "Transaction {id}" <NEW_LINE> _properties = spec_properties.transaction_OrderCancelTransaction <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(OrderCancelTransaction, sel...
An OrderCancelTransaction represents the cancellation of an Order in the client's Account.
6259908276e4537e8c3f1067
class Handicaps: <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> handicaps = kwargs.get("handicaps", [0, 0]) or [0, 0] <NEW_LINE> self.home = handicaps[0] <NEW_LINE> self.away = handicaps[1] <NEW_LINE> self.home_score_float = float(self.away) if float(self.away) >= 0 else 0 <NEW_LINE> self.away_sc...
Defines a few variables to be used in conjuctions with {handicaps.X}
625990823617ad0b5ee07c38
class aIMAGE_SECTION_HEADER: <NEW_LINE> <INDENT> def __init__(self, section_num, r, ptr): <NEW_LINE> <INDENT> self.array = (IMAGE_SECTION_HEADER * section_num)() <NEW_LINE> self.section_num = section_num <NEW_LINE> self.section_table = ptr <NEW_LINE> for i in range(section_num): <NEW_LINE> <INDENT> self.array[i].sinit(...
aIMAGE_SECTION_HEADER: This Class is wrapper of array of IMAGE_SECTION_HEADER. e.g. array_ish = aIMAGE_SECTION_HEADER(image_file_header.NumberOfSections, data, section_table_ptr)
625990824c3428357761bda3
class setUnion_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.LIST, 'success', (TType.STRING,None), None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProto...
Attributes: - success
6259908244b2445a339b76d1
class Sensors(SortedNameList[Sensor._Type]): <NEW_LINE> <INDENT> _T = TypeVar("_T", bound="Sensors") <NEW_LINE> def _loads(self, contents: List[Dict[str, Any]]) -> None: <NEW_LINE> <INDENT> self._data = [] <NEW_LINE> self._names = [] <NEW_LINE> for sensor_info in contents: <NEW_LINE> <INDENT> self.add(Sensor.loads(sens...
This class represents all sensors in a :class:`~tensorbay.dataset.segment.FusionSegment`.
625990824527f215b58eb714
class IconScoreContextFactory(object): <NEW_LINE> <INDENT> def __init__(self, max_size: int) -> None: <NEW_LINE> <INDENT> self._lock = threading.Lock() <NEW_LINE> self._queue = [] <NEW_LINE> self._max_size = max_size <NEW_LINE> <DEDENT> def create(self, context_type: 'IconScoreContextType') -> 'IconScoreContext': <NEW_...
IconScoreContextFactory
62599082796e427e53850263
class COCOSeg(BaseDataset): <NEW_LINE> <INDENT> def __init__(self, base_dir, split, transforms=None, to_tensor=None): <NEW_LINE> <INDENT> super(COCOSeg).__init__(base_dir) <NEW_LINE> self.split = split + '2014' <NEW_LINE> annFile = '{}/annotations/instances_{}.json'.format(base_dir, self.split) <NEW_LINE> self.coco = C...
Modified Class for COCO Dataset Args: base_dir: COCO dataset directory split: which split to use (default is 2014 version) choose from ('train', 'val') transform: transformations to be performed on images/masks to_tensor: transformation to convert PIL Image to te...
62599082aad79263cf4302a4
class GraphNetwork(_base.AbstractModule): <NEW_LINE> <INDENT> def __init__(self, edge_model_fn, node_model_fn, global_model_fn, reducer=tf.math.unsorted_segment_sum, edge_block_opt=None, node_block_opt=None, global_block_opt=None, name="graph_network"): <NEW_LINE> <INDENT> super(GraphNetwork, self).__init__(name=name) ...
Implementation of a Graph Network. See https://arxiv.org/abs/1806.01261 for more details.
62599082d8ef3951e32c8bd4
class MatplotlibWidget(Canvas): <NEW_LINE> <INDENT> def __init__(self, parent=None, title='',suptitle='', xlabel='', ylabel='', xlim=None, ylim=None, xscale='linear', yscale='linear', width=6.5, height= 5.5, dpi=40): <NEW_LINE> <INDENT> self.figure = Figure(figsize=(width, height), dpi=dpi) <NEW_LINE> self.ax = self.fi...
MatplotlibWidget inherits PyQt4.QWidget and matplotlib.backend_bases.FigureCanvasBase
625990827d847024c075dec6
class Status(dbmodels.Model): <NEW_LINE> <INDENT> status_idx = dbmodels.AutoField(primary_key=True) <NEW_LINE> word = dbmodels.CharField(max_length=30) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> db_table = 'tko_status'
The possible results of a test These objects are populated automatically from a :ref:`fixture file <django:initial-data-via-fixtures>`
62599082283ffb24f3cf538a
class Reader(object): <NEW_LINE> <INDENT> def __init__(self, istream): <NEW_LINE> <INDENT> self.istream = istream
Base class for all readers.
62599082f548e778e596d07c
class PelicanArticle(PelicanContentFile): <NEW_LINE> <INDENT> encoding = 'utf-8' <NEW_LINE> extension = NotImplemented <NEW_LINE> re_metadata = NotImplemented <NEW_LINE> def _load(self, file_path): <NEW_LINE> <INDENT> content = super(PelicanArticle, self)._load(file_path) <NEW_LINE> if content[0] == codecs.BOM_UTF8.dec...
Base class for article formats. The content should always be a unicode str.
62599082adb09d7d5dc0c043
class TestValidatePortNumber(unittest.TestCase): <NEW_LINE> <INDENT> def testPortNumberInt(self): <NEW_LINE> <INDENT> self.assertRaises(ValueError, lambda: netutils.ValidatePortNumber(500000)) <NEW_LINE> self.assertEqual(netutils.ValidatePortNumber(5000), 5000) <NEW_LINE> <DEDENT> def testPortNumberStr(self): <NEW...
Test netutils.ValidatePortNumber
625990824c3428357761bda5
class CompilationUnit: <NEW_LINE> <INDENT> def __init__(self, source): <NEW_LINE> <INDENT> self.source = source <NEW_LINE> self.tree = NoTree <NEW_LINE> self.newNames = newNames.NewName() <NEW_LINE> self.liveRanges = None <NEW_LINE> self.mCode = None
Would usually represent one source file, or similar. Wraps the source file with the resulting tree. As the tree is transformed, maintains the connection with source data and error reporting.
6259908299fddb7c1ca63b4f
class TransformerInfo(IdentifiedObject): <NEW_LINE> <INDENT> pass <NEW_LINE> pass
Set of transformer data, from an equipment library.
625990827d847024c075dec8
class Staff(Person): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> initializer(self, Staff, name)
Staff Class This is one of the Child Classes that inherits from the Person Super Class. It passes information to the Parent Constructor so as to dictate how the Person is created. It also handles other responsibilities related to a Staff.
62599082be7bc26dc9252bcb
class City(db.Model): <NEW_LINE> <INDENT> __tablename__ = "city_info" <NEW_LINE> citycode = db.Column(db.Integer,primary_key=True) <NEW_LINE> provincecode = db.Column(db.Integer,nullable=False) <NEW_LINE> namecn = db.Column(db.String(20),nullable=False)
城市
625990825fcc89381b266ed2
class MenuAction: <NEW_LINE> <INDENT> def __init__(self, name, callback, data=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.data = data <NEW_LINE> self.callback = callback <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return self.name <NEW_LINE> <DEDENT> def execute(self): <NEW_LINE> <INDENT...
Action composant un menu textuel, définie par un nom, une callback (éxécutée si action sélectionnée) et une donnée perso (ex: id d'une table)
625990822c8b7c6e89bd52d1
class PayLine(Wizard): <NEW_LINE> <INDENT> __name__ = 'account.move.line.pay' <NEW_LINE> start = StateView('account.move.line.pay.start', 'account_payment.move_line_pay_start_view_form', [ Button('Cancel', 'end', 'tryton-cancel'), Button('Pay', 'pay', 'tryton-ok', default=True), ]) <NEW_LINE> pay = StateAction('account...
Pay Line
62599082e1aae11d1e7cf588
class ListUsers(ListAPIView): <NEW_LINE> <INDENT> serializer_class = UserSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> queryset = User.objects.all() <NEW_LINE> search = self.request.query_params.get('search') <NEW_LINE> if search: <NEW_LINE> <INDENT> return queryset.filter(first_name__icontains=sear...
get: List all users (authentication required)
625990823d592f4c4edbc8d5
class PolyakTarget(TargetNetwork): <NEW_LINE> <INDENT> def __init__(self, rate): <NEW_LINE> <INDENT> self._source = None <NEW_LINE> self._target = None <NEW_LINE> self._rate = rate <NEW_LINE> <DEDENT> def __call__(self, *inputs): <NEW_LINE> <INDENT> with torch.no_grad(): <NEW_LINE> <INDENT> return self._target(*inputs)...
TargetNetwork that updates using polyak averaging
62599082167d2b6e312b830b
class videoThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, parent,autoStart=True): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.parent = parent <NEW_LINE> self.setDaemon(1) <NEW_LINE> self.start_orig = self.start <NEW_LINE> self.start = self.start_local <NEW_LINE> self.frame = No...
Run the MainLoop as a thread. Access the frame with self.frame.
6259908223849d37ff852ba5
class ReadOnlyStorageMixin: <NEW_LINE> <INDENT> def save(self, name, content_type, filename, fileobj): <NEW_LINE> <INDENT> raise StorageReadOnlyError('Cannot write to read-only storage') <NEW_LINE> <DEDENT> def delete(self, file_id): <NEW_LINE> <INDENT> raise StorageReadOnlyError('Cannot delete from read-only storage')
Mixin that makes write operations fail with an error.
625990827c178a314d78e960
class FrozenDict(Mapping): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._d = dict(*args, **kwargs) <NEW_LINE> self._hash = None <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return iter(self._d) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self...
An immutable hashable dict Taken from http://stackoverflow.com/a/2704866/81121
62599082656771135c48ada6
class Controller(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.console_api = console_api.API() <NEW_LINE> <DEDENT> @wsgi.serializers(xml=ConsolesTemplate) <NEW_LINE> def index(self, req, server_id): <NEW_LINE> <INDENT> consoles = self.console_api.get_consoles( req.environ['nova.context'], se...
The Consoles controller for the OpenStack API.
625990825fc7496912d48fe1
class FunctionElement(Executable, ColumnElement, FromClause): <NEW_LINE> <INDENT> packagenames = () <NEW_LINE> def __init__(self, *clauses, **kwargs): <NEW_LINE> <INDENT> args = [_literal_as_binds(c, self.name) for c in clauses] <NEW_LINE> self.clause_expr = ClauseList( operator=operators.comma_op, group_contents=True,...
Base for SQL function-oriented constructs. .. seealso:: :class:`.Function` - named SQL function. :data:`.func` - namespace which produces registered or ad-hoc :class:`.Function` instances. :class:`.GenericFunction` - allows creation of registered function types.
6259908297e22403b383c9ec
class AResourceRecordSet(ResourceRecordSet): <NEW_LINE> <INDENT> rrset_type = 'A' <NEW_LINE> def __init__(self, alias_hosted_zone_id=None, alias_dns_name=None, *args, **kwargs): <NEW_LINE> <INDENT> super(AResourceRecordSet, self).__init__(*args, **kwargs) <NEW_LINE> self.alias_hosted_zone_id = alias_hosted_zone_id <NEW...
Specific A record class. There are two kinds of A records: * Regular A records. * Alias A records. These point at an ELB instance instead of an IP. Create these via :py:meth:`HostedZone.create_a_record <route53.hosted_zone.HostedZone.create_a_record>`. Retrieve them via :py:meth:`HostedZone.record_sets <route53.hosted_...
62599082aad79263cf4302a8
class SpecCanvas(FigCanvas): <NEW_LINE> <INDENT> def __init__(self, parent=None, width=5, height=4, dpi=100): <NEW_LINE> <INDENT> self.fig = Figure(figsize=(width, height), dpi=dpi) <NEW_LINE> self.ax = self.fig.add_subplot(111) <NEW_LINE> FigCanvas.__init__(self, self.fig) <NEW_LINE> self.setParent(parent) <NEW_LINE> ...
Ultimately, this is a QWidget (as well as a FigCanvasAgg, etc.).
625990822c8b7c6e89bd52d3
class Book(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=200) <NEW_LINE> author = models.ForeignKey('Author', on_delete=models.SET_NULL, null=True) <NEW_LINE> description = models.TextField(max_length=1500, help_text='Краткое описание книги') <NEW_LINE> isbn = models.CharField('ISBN', max_lengt...
Model representing a book.
62599082a8370b77170f1ebf
class FilesDict(dict): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> dict.__init__(self) <NEW_LINE> <DEDENT> def __setitem__(self, key, val): <NEW_LINE> <INDENT> if key not in self: <NEW_LINE> <INDENT> dict.__setitem__(self, key, val) <NEW_LINE> <DEDENT> elif self[key] != val: <NEW_LINE> <INDENT> raise Va...
Dictionary to store experiment files. We don't want adding two different values for the same key, so __setitem__ is overriden to check that
62599082ad47b63b2c5a933f
class TeachingKitView(RetrieveAPIView): <NEW_LINE> <INDENT> queryset = TeachingKit.objects.all() <NEW_LINE> serializer_class = TeachingKitSerializer <NEW_LINE> pagination_class = None
A view that allow listing of a single activity by providing their `id` as a parameter
62599082f9cc0f698b1c6043
class AddToGroup(gui_base.GuiCommandNeedsSelection): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(AddToGroup, self).__init__(name=translate("draft","Add to group")) <NEW_LINE> self.ungroup = QT_TRANSLATE_NOOP("Draft_AddToGroup","Ungroup") <NEW_LINE> <DEDENT> def GetResources(self): <NEW_LINE> <INDE...
GuiCommand for the Draft_AddToGroup tool. It adds selected objects to a group, or removes them from any group. It inherits `GuiCommandNeedsSelection` to only be available when there is a document and a selection. See this class for more information.
625990824a966d76dd5f09d4
class bundleFiles(LOFARrecipe): <NEW_LINE> <INDENT> inputs = { 'obsid' : ingredient.StringField( '--obsid', dest="obsid", help="Observation identifier" ), 'pulsar' : ingredient.StringField( '--pulsar', dest="pulsar", help="Pulsar name" ), 'filefactor' : ingredient.IntField( '--filefactor', dest="filefactor", help="fact...
Pipeline-based mechanism for creagting a tar archive of output data products from this pipeline. Parser processes all arguments passed by the framework through cli arguments and any arguments specified in tasks configuration files. Command line arguments override defaults set in the task.cfg. This recipe will creat...
625990825fdd1c0f98e5fa6e
class DayTimeInForce(TimeInForce, ITimeInForceHandler): <NEW_LINE> <INDENT> def IsFillValid(self, security, order, fill): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def IsOrderExpired(self, security, order): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, *args): <NEW_LINE> <INDENT> pass
Day Time In Force - order expires at market close DayTimeInForce()
62599082bf627c535bcb2fc2
class Subnet(BaseAPI): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> id = Field() <NEW_LINE> cidr = Field() <NEW_LINE> gateway = Field() <NEW_LINE> start_ip = Field() <NEW_LINE> end_ip = Field() <NEW_LINE> enable_dhcp = Field()
Args: id (str): Идентификатор cidr (str): CIDR gateway (str): Адрес шлюза start_ip (str): Начальный адрес для DHCP end_ip (str): Конечный адрес для DHCP enable_dhcp (bool): Включить или выключить DHCP
62599082adb09d7d5dc0c049
class Fasta: <NEW_LINE> <INDENT> def __init__(self, header, seq): <NEW_LINE> <INDENT> self.header = header <NEW_LINE> self.seq = seq <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.seq
Simple class to store fasta-formatted sequences
6259908250812a4eaa62193d
class Header(CPPFile): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> super(Header, self).__init__(name) <NEW_LINE> self.included = set() <NEW_LINE> <DEDENT> def add(self, header): <NEW_LINE> <INDENT> super(Header, self).add(header) <NEW_LINE> header.included.add(self) <NEW_LINE> <DEDENT> def __repr_...
Represents a header file, that can be included itself
625990824c3428357761bdab
class Client: <NEW_LINE> <INDENT> def __init__(self, session): <NEW_LINE> <INDENT> self.__session = session <NEW_LINE> self.__target_nodes = {} <NEW_LINE> self.listen_to_client() <NEW_LINE> <DEDENT> def listen_to_client(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> request = self.__session.receive().get_da...
The client that requests the connection
625990823617ad0b5ee07c40
class Locality: <NEW_LINE> <INDENT> def __init__(self, zip=0, short_name=None, long_name=None, canton=None, _zip_type_number=None, _onrp=None): <NEW_LINE> <INDENT> self.zip = zip <NEW_LINE> self.short_name = short_name <NEW_LINE> self.long_name = long_name <NEW_LINE> self.canton = canton <NEW_LINE> if _zip_type_number:...
A locality is the name of a town, village or any "string" that goes after the ZIP code in the address.
625990825fcc89381b266ed5
class FittingTabWidget(object): <NEW_LINE> <INDENT> def __init__(self, context, parent): <NEW_LINE> <INDENT> is_frequency_domain = isinstance(context, FrequencyDomainAnalysisContext) <NEW_LINE> if is_frequency_domain: <NEW_LINE> <INDENT> self.fitting_tab_view = BasicFittingView(parent) <NEW_LINE> self.fitting_tab_view....
The FittingTabWidget creates the tab used for fitting. Muon Analysis uses the TF Asymmetry fitting widget, and Frequency Domain Analysis uses the Basic fitting widget.
6259908226068e7796d4e432
class TestUserListTestCase(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.url = reverse("user-list") <NEW_LINE> self.user_data = factory.build(dict, FACTORY_CLASS=UserFactory) <NEW_LINE> <DEDENT> def test_post_request_with_no_data_fails(self): <NEW_LINE> <INDENT> response = self.client.post...
Tests /users list operations.
62599082ec188e330fdfa39c
class U_UCB(UCB_discrete): <NEW_LINE> <INDENT> def __init__(self, env, summary_stats, num_rounds, **kwargs): <NEW_LINE> <INDENT> super().__init__(env, summary_stats, num_rounds) <NEW_LINE> self.hyperpara = kwargs.get('hyperpara', None) <NEW_LINE> self.alpha = self.hyperpara[0] <NEW_LINE> <DEDENT> def argmax_ucb(self, t...
U-UCB policy from Cassel et al. 2018.
625990823d592f4c4edbc8d8
class UserSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('id', 'name', 'object_type')
Serializer class for User model
6259908266673b3332c31ef1
class Gaussian(): <NEW_LINE> <INDENT> def __init__(self, mu = 0, sigma = 1): <NEW_LINE> <INDENT> self.mean = mu <NEW_LINE> self.stdev = sigma <NEW_LINE> self.data = [] <NEW_LINE> <DEDENT> def calculate_mean(self): <NEW_LINE> <INDENT> total = 0 <NEW_LINE> if(len(self.data) == 0): <NEW_LINE> <INDENT> self.mean = 0 <NEW_L...
Gaussian distribution class for calculating and visualizing a Gaussian distribution. Attributes: mean (float) representing the mean value of the distribution stdev (float) representing the standard deviation of the distribution data_list (list of floats) a list of floats extracted from the data file ...
62599082bf627c535bcb2fc4
class ClusterPolicy(object): <NEW_LINE> <INDENT> def __init__(self, cluster_id, policy_id, **kwargs): <NEW_LINE> <INDENT> self.id = kwargs.get('id', None) <NEW_LINE> self.cluster_id = cluster_id <NEW_LINE> self.policy_id = policy_id <NEW_LINE> self.enabled = kwargs.get('enabled') <NEW_LINE> self.data = kwargs.get('data...
Object representing a binding between a cluster and a policy. This object also records the runtime data of a policy, if any.
62599082adb09d7d5dc0c04b
class Manager: <NEW_LINE> <INDENT> def __init__(self, conf): <NEW_LINE> <INDENT> logging.info('Started %s', self.__class__) <NEW_LINE> self.conf = conf <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def rules(rule_list): <NEW_LINE> <INDENT> for rule in rule_list: <NEW_LINE> <INDENT> yield MailRule(rule) <NEW_LINE> <DEDEN...
mail.Manager objects are handed mail messages. Based on the mail2alert configuration and mail content, they determine what to do with the mail message.
6259908250812a4eaa62193e
class DisableWhiteBoxKeyRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.KeyId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.KeyId = params.get("KeyId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(self).item...
DisableWhiteBoxKey请求参数结构体
6259908263b5f9789fe86c5b
class AdminHandler(BaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.render("admin.html")
Displays the admin page with all the admin options
625990823346ee7daa3383db
@public <NEW_LINE> class Task(object): <NEW_LINE> <INDENT> def __init__(self, target, args=(), kwargs={}, success=lambda x: x, failure=lambda x: x, infinite=False): <NEW_LINE> <INDENT> self._id = random.getrandbits(128) <NEW_LINE> self._kill_ev = threading.Event() <NEW_LINE> self._infinite = infinite <NEW_LINE> self.ta...
A class to describe a task to be used by the thread pool. An infinite or a blocking task will have to take a kill :class:`threading.Event` as the first argument to the function to be able to end operations gracefully in case a stop event was triggered. This class takes two callbacks as keyword arguments to handle the...
62599082283ffb24f3cf5393
class ParallelEvaluation(object): <NEW_LINE> <INDENT> __slots__ = ['evaluator', '__initialized__', 'job'] <NEW_LINE> def __init__(self, evaluator): <NEW_LINE> <INDENT> self.evaluator = evaluator <NEW_LINE> self.__initialized__ = 0 <NEW_LINE> <DEDENT> def initialize(self, X, y=None, dir=None): <NEW_LINE> <INDENT> self.j...
Parallel cross-validation engine. Parameters ---------- evaluator : :class:`Evaluator` The ``Evaluator`` that instantiated the processor.
6259908297e22403b383c9f2
class CodeBlockParser: <NEW_LINE> <INDENT> language: str <NEW_LINE> def __init__(self, language: str = None, evaluator: Evaluator = None): <NEW_LINE> <INDENT> if language is not None: <NEW_LINE> <INDENT> self.language = language <NEW_LINE> <DEDENT> assert self.language, 'language must be specified!' <NEW_LINE> if evalu...
A class to instantiate and include when your documentation makes use of :ref:`codeblock-parser` examples. :param language: The language that this parser should look for. :param evaluator: The evaluator to use for evaluating code blocks in the specified language. You can also override the :meth:`evaluate` ...
62599082aad79263cf4302ae
class With(Container): <NEW_LINE> <INDENT> _command = "\\with" <NEW_LINE> _inline = True
With container. Usage:: With(content) Parameters ========== content: list, setting overrides Content of the container Returns ======= None Raises ====== InvalidArgument: if any arguments are supplied InvalidContent: UNIMPLEMENTED if the content conatains anything but lilyflower objects Notes =====...
6259908226068e7796d4e434
class SentCodeTypeFlashCall(TLObject): <NEW_LINE> <INDENT> __slots__: List[str] = ["pattern"] <NEW_LINE> ID = 0xab03c6d9 <NEW_LINE> QUALNAME = "types.auth.SentCodeTypeFlashCall" <NEW_LINE> def __init__(self, *, pattern: str) -> None: <NEW_LINE> <INDENT> self.pattern = pattern <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE...
This object is a constructor of the base type :obj:`~pyrogram.raw.base.auth.SentCodeType`. Details: - Layer: ``122`` - ID: ``0xab03c6d9`` Parameters: pattern: ``str``
6259908266673b3332c31ef3
class DummyRoute(APIView): <NEW_LINE> <INDENT> permission_classes = (AllowAny,) <NEW_LINE> def get(self, request, route_id): <NEW_LINE> <INDENT> return Response(DUMMY_ROUTE_DATA)
A mock used for testing. Returns the dummy data in the format expected by the front end.
6259908297e22403b383c9f3
class SpamDetector(object): <NEW_LINE> <INDENT> def clean(self, s): <NEW_LINE> <INDENT> translator = str.maketrans("", "", string.punctuation) <NEW_LINE> return s.translate(translator) <NEW_LINE> <DEDENT> def tokenize(self, text): <NEW_LINE> <INDENT> text = self.clean(text).lower() <NEW_LINE> return re.split("\W+", tex...
Implementation of Naive Bayes for binary classification
6259908260cbc95b06365ae6
class MqttDiscoveryUpdate(Entity): <NEW_LINE> <INDENT> def __init__(self, discovery_data, discovery_update=None) -> None: <NEW_LINE> <INDENT> self._discovery_data = discovery_data <NEW_LINE> self._discovery_update = discovery_update <NEW_LINE> self._remove_signal = None <NEW_LINE> self._removed_from_hass = False <NEW_L...
Mixin used to handle updated discovery message.
625990823617ad0b5ee07c44
class Poll(models.Model): <NEW_LINE> <INDENT> objects = PollManager() <NEW_LINE> title = models.CharField(max_length=100) <NEW_LINE> description = models.CharField(max_length=500) <NEW_LINE> start_time = models.DateTimeField() <NEW_LINE> end_time = models.DateTimeField() <NEW_LINE> visible = models.BooleanField(default...
A Poll, for the TJ community. Attributes: title A title for the poll, that will be displayed to identify it uniquely. description A longer description, possibly explaining how to complete the poll. start_time A time that the poll should open. end_time A time that the pol...
625990823317a56b869bf2be
class BaseTaskSet(TaskSet): <NEW_LINE> <INDENT> headers = { 'Content-Type': 'application/json' } <NEW_LINE> token = None <NEW_LINE> token_url = None <NEW_LINE> token_title = 'JWT' <NEW_LINE> def unpack_values(self, payload_data): <NEW_LINE> <INDENT> if isinstance(payload_data, dict) is True: <NEW_LINE> <INDENT> for key...
- Getting token - Unpack data - compile resource url
625990825fdd1c0f98e5fa74
class ConnectionDetail(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'private_ip_address': {'readonly': True}, 'link_identifier': {'readonly': True}, 'group_id': {'readonly': True}, 'member_name': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type'...
ConnectionDetail. Variables are only populated by the server, and will be ignored when sending a request. :ivar id: Azure resource Id. :vartype id: str :ivar private_ip_address: The private endpoint connection private ip address. :vartype private_ip_address: str :ivar link_identifier: The private endpoint connection ...
6259908297e22403b383c9f4
class ClaseTest(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tests = [] <NEW_LINE> <DEDENT> def completar(self): <NEW_LINE> <INDENT> self.exitosos = len(filter(lambda t: t.exitoso, self.tests)) <NEW_LINE> self.exitoso = len(self.tests) == self.exitosos <NEW_LINE> self.duracion = 0 <NEW_LINE> if l...
Modelo de la clase de test
62599082aad79263cf4302b0
class FacebookGraphMixin(OAuth2Mixin): <NEW_LINE> <INDENT> _OAUTH_ACCESS_TOKEN_URL = "https://graph.facebook.com/oauth/access_token?" <NEW_LINE> _OAUTH_AUTHORIZE_URL = "https://graph.facebook.com/oauth/authorize?" <NEW_LINE> _OAUTH_NO_CALLBACKS = False <NEW_LINE> @_auth_return_future <NEW_LINE> def get_authenticated_us...
Facebook authentication using the new Graph API and OAuth2.
625990822c8b7c6e89bd52db
class TestCliInstall(Base.TestNewMonorepoGitInit): <NEW_LINE> <INDENT> basic_cmd = ["scream", "install", "com_packagea"] <NEW_LINE> test_cmd = ["scream", "install", "com_packagea", "--test"] <NEW_LINE> test_cmd_short = ["scream", "install", "com_packagea", "-t"] <NEW_LINE> install_cmds = [basic_cmd, test_cmd, test_cmd_...
Make sure all `scream install` commands run, with or without any packages existing.
6259908292d797404e3898d7
class SessionForm(messages.Message): <NEW_LINE> <INDENT> name = messages.StringField(1) <NEW_LINE> highlight = messages.StringField(2) <NEW_LINE> speakerKey = messages.StringField(3) <NEW_LINE> duration = messages.IntegerField(4) <NEW_LINE> sessionType = messages.StringField(5) <NEW_LINE> date = messages.StringField(6)...
SessionForm -- Single session input form
62599082656771135c48adab
class Neo4jKarmabotDatabaseService(KarmabotDatabaseService): <NEW_LINE> <INDENT> pass
Does connections to neo4j
625990827cff6e4e811b7537
class MscaleV3Plus(MscaleBase): <NEW_LINE> <INDENT> def __init__(self, num_classes, trunk='wrn38', criterion=None): <NEW_LINE> <INDENT> super(MscaleV3Plus, self).__init__() <NEW_LINE> self.criterion = criterion <NEW_LINE> self.backbone, s2_ch, _s4_ch, high_level_ch = get_trunk(trunk) <NEW_LINE> self.aspp, aspp_out_ch =...
DeepLabV3Plus-based mscale segmentation model
625990824f6381625f19a22a
class TestIoK8sApiCoreV1LoadBalancerIngress(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 testIoK8sApiCoreV1LoadBalancerIngress(self): <NEW_LINE> <INDENT> pass
IoK8sApiCoreV1LoadBalancerIngress unit test stubs
62599082f9cc0f698b1c6047
class SourceMeta(type): <NEW_LINE> <INDENT> def __new__(self, name, bases, dct): <NEW_LINE> <INDENT> if all([not '_read' in dct, name != 'Source', not name.endswith('Mixin')]): <NEW_LINE> <INDENT> msg = '%s is missing the required "_read" method' % name <NEW_LINE> raise NotImplementedError(msg) <NEW_LINE> <DEDENT> dct[...
Initialize subclasses and source base class
6259908260cbc95b06365ae7
class DummyModule(AbstractModule): <NEW_LINE> <INDENT> def update(self, data): <NEW_LINE> <INDENT> pass
Dies Klasse wartet auf button 1 und spielt dann die Animation walkready
625990827047854f46340eab
class TestApiFactory(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self) -> None: <NEW_LINE> <INDENT> print("testing ApiFactory Class...") <NEW_LINE> self.api_data_1 = ApiFactory.create_api_client(ApiEnum.api_data_il) <NEW_LINE> self.api_data_2 = ApiFactory.create_api_client(ApiEnum.api_data_il) <NEW_LINE> self.api...
API Factory for creating Types of API Clients. Methods: def setUp(self): announce of starting the class's tests and initialize api's instances def tearDown(self): announce of finishing the class's tests def test_create_api_client(self): test api's class instance creation and lru_cache's behaviour as "singl...
625990824c3428357761bdb1
class dlgDatabaseConfig( QDialog ): <NEW_LINE> <INDENT> u <NEW_LINE> def __init__( self, parent = None ): <NEW_LINE> <INDENT> super( dlgDatabaseConfig, self ).__init__( parent ) <NEW_LINE> self.setupUi() <NEW_LINE> self.buttonBox.accepted.connect( self.accept ) <NEW_LINE> self.buttonBox.rejected.connect( self.reject ) ...
Dialogo usado para pedir al usuario nuevos valores de configuración
6259908299fddb7c1ca63b55
class RemoteTorrent(EventEmitter, BareRemoteTorrent): <NEW_LINE> <INDENT> pass
A proxy to the Torrent object in WebTorrent server.
62599082be7bc26dc9252bd1