code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class IdNamesPJContainer(PJContainer): <NEW_LINE> <INDENT> _pj_mapping_key = None <NEW_LINE> def __init__(self, table=None, parent_key=None): <NEW_LINE> <INDENT> super(IdNamesPJContainer, self).__init__(table, parent_key) <NEW_LINE> <DEDENT> @property <NEW_LINE> def _pj_remove_documents(self): <NEW_LINE> <INDENT> retur... | A container that uses the PostGreSQL table UID as the name/key. | 6259903707d97122c4217e06 |
class ChangedSingleDateNotification(TimeBasedInfoMixin, TransitionMessage): <NEW_LINE> <INDENT> subject = pgettext('email', 'The details of activity "{title}" have changed') <NEW_LINE> template = 'messages/changed_single_date' <NEW_LINE> context = { 'title': 'activity.title', } <NEW_LINE> @property <NEW_LINE> def actio... | Notification when slot details (date, time or location) changed for a single date activity | 62599037a4f1c619b294f73c |
class DeferredDrawCallbackProperty(CallbackProperty): <NEW_LINE> <INDENT> @defer_draw <NEW_LINE> def notify(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DeferredDrawCallbackProperty, self).notify(*args, **kwargs) | A callback property where drawing is deferred until
after notify has called all callback functions. | 62599037d53ae8145f9195ce |
@benchmark.Enabled('android') <NEW_LINE> class RendererMemoryBlinkMemoryMobile(_MemoryInfra): <NEW_LINE> <INDENT> page_set = page_sets.BlinkMemoryMobilePageSet <NEW_LINE> def SetExtraBrowserOptions(self, options): <NEW_LINE> <INDENT> super(RendererMemoryBlinkMemoryMobile, self).SetExtraBrowserOptions( options) <NEW_LIN... | Timeline based benchmark for measuring memory consumption on mobile
sites on which blink's memory consumption is relatively high. | 625990378a349b6b436873ab |
class CephBrokerRsp(object): <NEW_LINE> <INDENT> def __init__(self, encoded_rsp): <NEW_LINE> <INDENT> self.api_version = None <NEW_LINE> self.rsp = json.loads(encoded_rsp) <NEW_LINE> <DEDENT> @property <NEW_LINE> def exit_code(self): <NEW_LINE> <INDENT> return self.rsp.get('exit-code') <NEW_LINE> <DEDENT> @property <NE... | Ceph broker response.
Response is json-decoded and contents provided as methods/properties.
The API is versioned and defaults to version 1. | 6259903716aa5153ce401657 |
@cbpi.step <NEW_LINE> class BoilStep(StepBase): <NEW_LINE> <INDENT> temp = Property.Number("Temperature", configurable=True, default_value=100, description="Target temperature for boiling") <NEW_LINE> kettle = StepProperty.Kettle("Kettle", description="Kettle in which the boiling step takes place") <NEW_LINE> timer = P... | Just put the decorator @cbpi.step on top of a method | 6259903730c21e258be99978 |
class LoanEvents(Base): <NEW_LINE> <INDENT> __tablename__ = 'loan_events' <NEW_LINE> event_types = ('fee', 'interest', 'payment') <NEW_LINE> event_type_enum = Enum(*event_types, name="event_type") <NEW_LINE> tx_id = Column(Integer, primary_key=True, autoincrement=True) <NEW_LINE> loan_id = Column(Integer, primary_key=F... | Loan events model | 62599037b830903b9686ed2e |
@patch.dict('os.environ', {'GENIE_BYPASS_HOME_CONFIG': '1'}) <NEW_LINE> class TestingHiveJob(unittest.TestCase): <NEW_LINE> <INDENT> def test_default_command_tag(self): <NEW_LINE> <INDENT> job = pygenie.jobs.HiveJob() <NEW_LINE> assert_equals( job.get('default_command_tags'), [u'type:hive'] ) <NEW_LINE> <DEDENT> def te... | Test HiveJob. | 62599037d10714528d69ef40 |
class OutboundNatRule(SubResource): <NEW_LINE> <INDENT> _validation = { 'backend_address_pool': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'allocated_outbound_ports': {'key': 'properties.allocatedOutboundPorts', 'type': 'int'}, 'frontend_ip_configurations': {'key': 'properti... | Outbound NAT pool of the load balancer.
:param id: Resource ID.
:type id: str
:param allocated_outbound_ports: The number of outbound ports to be used
for NAT.
:type allocated_outbound_ports: int
:param frontend_ip_configurations: The Frontend IP addresses of the load
balancer.
:type frontend_ip_configurations:
lis... | 62599037507cdc57c63a5f04 |
class ImageDownloadViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Image.objects.all() <NEW_LINE> serializer_class = ImageSerializer <NEW_LINE> def list(self, request, **kwargs): <NEW_LINE> <INDENT> images = request.query_params.getlist('images', []) <NEW_LINE> import sys <NEW_LINE> from json import dump... | API endpoint that allows users to be viewed or edited. | 625990379b70327d1c57fef0 |
class Solution: <NEW_LINE> <INDENT> def levelOrder(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return [] <NEW_LINE> <DEDENT> res, q_lvl = [], [root] <NEW_LINE> while q_lvl != []: <NEW_LINE> <INDENT> pre, tmp = [], [] <NEW_LINE> for node in q_lvl: <NEW_LINE> <INDENT> pre.append(node.val) <NEW_L... | @param root: The root of binary tree.
@return: Level order in a list of lists of integers | 62599037711fe17d825e1551 |
class TracDataset(Dataset): <NEW_LINE> <INDENT> def __init__( self, data_df: pd.DataFrame, tokenizer: Callable, max_seq_length:int = None, ): <NEW_LINE> <INDENT> self.data_df = data_df <NEW_LINE> self.tokenizer = tokenizer <NEW_LINE> if max_seq_length is None: <NEW_LINE> <INDENT> self._max_seq_length = self._get_max_le... | PyTorch dataset class | 62599037796e427e5384f8e7 |
class XMLReader(object): <NEW_LINE> <INDENT> def __init__(self, xml_path): <NEW_LINE> <INDENT> self.logger = get_logger(self.__class__.__module__) <NEW_LINE> self.xml_path = xml_path <NEW_LINE> <DEDENT> def read_metadata(self): <NEW_LINE> <INDENT> self.logger.debug("Starting to parse XML file " + self.xml_path) <NEW_LI... | Reader for XML with meta-data on generic entities (e.g. Project, Operation). | 6259903773bcbd0ca4bcb3f3 |
class DeviceTypeCategory(db.Model): <NEW_LINE> <INDENT> friendly_name = "Device Type Category" <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(50), unique=True) <NEW_LINE> devicetypes = db.relationship('DeviceType', backref='devicetypecategory', lazy='dynamic') <NEW_LINE> d... | Represents the Category of a DeviceType
Example : Firewall, Router, etc... | 62599037b5575c28eb71357f |
class User(base.Base, a.ColRepr, a.Updatable): <NEW_LINE> <INDENT> __tablename__ = "users" <NEW_LINE> id = s.Column("id", s.Integer, primary_key=True) <NEW_LINE> sub = s.Column("sub", s.String, nullable=False) <NEW_LINE> name = s.Column("name", s.String, nullable=False) <NEW_LINE> nickname = s.Column("nickname", s.Stri... | An user, as returned by OAuth2. | 62599037a8ecb0332587238a |
class VirtualNodeGroup(model_base.BASEV2, models_v2.HasId): <NEW_LINE> <INDENT> __tablename__ = 'virtual_node_group' <NEW_LINE> VirtualNodeGroupType = sa.Enum(cst.VSWITCH_GROUP, cst.VROUTER_GROUP, cst.BRIDGE_GROUP, name='virtual_node_group_type') <NEW_LINE> description = sa.Column(sa.String(255), nullable=True) <NEW_LI... | Is a group of virtual nodes that belongs to the same physical node.
The association between the Virtual Node Group and Physical Node is
necessary for the mapping between virtual and physical networks. | 62599037c432627299fa4163 |
class State(BaseModel, Base): <NEW_LINE> <INDENT> __tablename__ = "states" <NEW_LINE> name = Column(String(128), nullable=False) <NEW_LINE> cities = relationship("City", backref="state", cascade="delete") <NEW_LINE> if getenv("HBNB_TYPE_STORAGE") != "db": <NEW_LINE> <INDENT> @property <NEW_LINE> def cities(self): <NEW... | Represents a state for a MySQL database.
Inherits from SQLAlchemy Base and links to the MySQL table states.
Attributes:
__tablename__ (str): The name of the MySQL table to store States.
name (sqlalchemy String): The name of the State.
cities (sqlalchemy relationship): The State-City relationship. | 625990371d351010ab8f4c86 |
class AddWatcher(Command): <NEW_LINE> <INDENT> name = "add" <NEW_LINE> options = [('', 'start', False, "start immediately the watcher")] <NEW_LINE> properties = ['name', 'cmd'] <NEW_LINE> def message(self, *args, **opts): <NEW_LINE> <INDENT> if len(args) < 2: <NEW_LINE> <INDENT> raise ArgumentError("Invalid number of a... | Add a watcher
=============
This command add a watcher dynamically to a arbiter.
ZMQ Message
-----------
::
{
"command": "add",
"properties": {
"cmd": "/path/to/commandline --option"
"name": "nameofwatcher"
"args": [],
"options": {},
"s... | 62599037be8e80087fbc01eb |
class ValueMetadata: <NEW_LINE> <INDENT> def __init__(self, data: MetaDataType) -> None: <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> @property <NEW_LINE> def type(self) -> str: <NEW_LINE> <INDENT> return self.data["type"] <NEW_LINE> <DEDENT> @property <NEW_LINE> def readable(self) -> Optional[bool]: <NEW_L... | Represent metadata on a value instance. | 6259903726238365f5fadcc1 |
class ExpressionTree: <NEW_LINE> <INDENT> def __init__(self, exp_str): <NEW_LINE> <INDENT> self._exp_tree = None <NEW_LINE> self._buildTree(exp_str) <NEW_LINE> <DEDENT> def evaluate(self, var_dict): <NEW_LINE> <INDENT> return self._evalTree(self._exp_tree, var_dict) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <IN... | 表达式树
操作符存储在内节点操作数存储在叶子节点的二叉树
*
/ + -
/ \ / 9 3 8 4
(9 + 3) * (8 - 4)
Expression Tree Abstract Data Type, 可以实现二元操作符
ExpressionTree(exp_str): user string as constructor param
evaluate(var_dict): evaluates the expression and returns the numeric result
toString(): constructs... | 62599037a4f1c619b294f73d |
class SelectWithDisable(object): <NEW_LINE> <INDENT> def __init__(self, multiple=False): <NEW_LINE> <INDENT> self.multiple = multiple <NEW_LINE> <DEDENT> def __call__(self, field, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('id', field.id) <NEW_LINE> if self.multiple: <NEW_LINE> <INDENT> kwargs['multiple'] = 'mult... | Renders a select field.
If `multiple` is True, then the `size` property should be specified on
rendering to make the field useful.
The field must provide an `iter_choices()` method which the widget will
call on rendering; this method must yield tuples of
`(value, label, selected, disabled)`. | 6259903721bff66bcd723dd4 |
class ContiguousConstraint(BaseConstraint): <NEW_LINE> <INDENT> required = True <NEW_LINE> def check_schedule(self, schedule): <NEW_LINE> <INDENT> for section in schedule.class_sections.itervalues(): <NEW_LINE> <INDENT> if len(section.assigned_roomslots) > 1: <NEW_LINE> <INDENT> section_room = section.assigned_roomslot... | Multi-hour sections may only be scheduled across
contiguous timeblocks in the same room. | 625990371f5feb6acb163d5f |
class RFSarsaStockTrader(StockTrader): <NEW_LINE> <INDENT> def __init__(self, name: str, utility: float, exchange: StockExchange, actions: tuple, epsilon: float, learning_rate: float, discount_factor: float): <NEW_LINE> <INDENT> super().__init__(name, utility, exchange) <NEW_LINE> self.learner = RandomForestSarsaMatrix... | A stock trader whose internal learner is random forest sarsa matrix
| 62599037d53ae8145f9195d0 |
class Item(models.Model): <NEW_LINE> <INDENT> sample_2 = models.TextField( verbose_name='サンプル項目2 メモ', blank=True, null=True, ) <NEW_LINE> sample_3 = models.IntegerField( verbose_name='サンプル項目3 整数', blank=True, null=True, ) <NEW_LINE> sample_4 = models.FloatField( verbose_name='サンプル項目4 浮動小数点', blank=True, null=True, ) <N... | データ定義クラス
各フィールドを定義する
参考:
・公式 モデルフィールドリファレンス
https://docs.djangoproject.com/ja/2.1/ref/models/fields/ | 62599037d164cc61758220df |
class MMUCache(Cache): <NEW_LINE> <INDENT> def __init__( self, size: str, assoc: Optional[int] = 4, tag_latency: Optional[int] = 1, data_latency: Optional[int] = 1, response_latency: Optional[int] = 1, mshrs: Optional[int] = 20, tgts_per_mshr: Optional[int] = 12, writeback_clean: Optional[bool] = True, prefetcher: Base... | A simple Memory Management Unit (MMU) cache with default values. | 625990376e29344779b017be |
class GetInlineGameHighScores(Object): <NEW_LINE> <INDENT> ID = "getInlineGameHighScores" <NEW_LINE> def __init__(self, inline_message_id, user_id, extra=None, **kwargs): <NEW_LINE> <INDENT> self.extra = extra <NEW_LINE> self.inline_message_id = inline_message_id <NEW_LINE> self.user_id = user_id <NEW_LINE> <DEDENT> @s... | Returns game high scores and some part of the high score table in the range of the specified user; for bots only
Attributes:
ID (:obj:`str`): ``GetInlineGameHighScores``
Args:
inline_message_id (:obj:`str`):
Inline message identifier
user_id (:obj:`int`):
User identifier
Returns:
Ga... | 6259903776d4e153a661db28 |
class Pool(OnnxOpConverter): <NEW_LINE> <INDENT> name = "" <NEW_LINE> @classmethod <NEW_LINE> def _impl_v1(cls, inputs, attr, params): <NEW_LINE> <INDENT> attr_cvt, data = cls._run_calculation(inputs, attr, params) <NEW_LINE> return attr_cvt([data], attr, params) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def _run_cal... | A helper class for pool op converters. | 625990375e10d32532ce41b9 |
class Deposit(BalanceManager): <NEW_LINE> <INDENT> def __init__(self, client, denomination, transfer_all, amount, testing=0): <NEW_LINE> <INDENT> super().__init__(client, denomination, transfer_all, amount, testing=testing, chains={'home'}) | Deposit only version of Balance Manager | 62599037287bf620b6272d56 |
class ConnectedComponents(object): <NEW_LINE> <INDENT> def __init__(self, G, order=None): <NEW_LINE> <INDENT> self.id = np.zeros([G.get_v()], dtype=int) <NEW_LINE> self.order = order <NEW_LINE> if order is None: <NEW_LINE> <INDENT> self.order = range(G.get_v()) <NEW_LINE> <DEDENT> search_obj = DFS(G, self.order, self.i... | Gives the connected components of an undirected graph.
Use DFS to find connected components. | 62599037be383301e0254983 |
class HiveTableWrapper(object): <NEW_LINE> <INDENT> def __init__(self, hive, table_name, table_spec): <NEW_LINE> <INDENT> self.hive = hive <NEW_LINE> self.table_name = table_name <NEW_LINE> self.table_spec = table_spec <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.hive.run_stmt_in_hive( 'create tabl... | A wrapper class for using `with` guards with tables created through Hive
ensuring deletion even if an exception occurs. | 62599037507cdc57c63a5f06 |
class AgentNotifierApi(sg_rpc.SecurityGroupAgentRpcApiMixin): <NEW_LINE> <INDENT> def __init__(self, topic): <NEW_LINE> <INDENT> self.topic = topic <NEW_LINE> target = messaging.Target(topic=topic, version='1.0') <NEW_LINE> self.client = n_rpc.get_client(target) <NEW_LINE> self.topic_network_delete = topics.get_topic_n... | Agent side of the linux bridge rpc API.
API version history:
1.0 - Initial version.
1.1 - Added get_active_networks_info, create_dhcp_port,
and update_dhcp_port methods. | 6259903726068e7796d4dab5 |
class One(KeyCode): <NEW_LINE> <INDENT> pass | 1
Shift+1 is ! on american keyboards | 62599037d6c5a102081e3292 |
class GWCSTypeMeta(ExtensionTypeMeta): <NEW_LINE> <INDENT> def __new__(mcls, name, bases, attrs): <NEW_LINE> <INDENT> cls = super(GWCSTypeMeta, mcls).__new__(mcls, name, bases, attrs) <NEW_LINE> if cls.organization == 'stsci.edu' and cls.standard == 'gwcs': <NEW_LINE> <INDENT> _gwcs_types.add(cls) <NEW_LINE> <DEDENT> r... | Keeps track of `GWCSType` subclasses that are created so that they can
be stored automatically by astropy extensions for ASDF. | 62599037ec188e330fdf9a04 |
class EditPetForm(FlaskForm): <NEW_LINE> <INDENT> photo_url = StringField('Pet photo URL', validators=[InputRequired()]) <NEW_LINE> notes = TextAreaField("Notes about the pet:") <NEW_LINE> available = BooleanField("Available?") | Form to edit pet | 62599037b57a9660fecd2be9 |
class PARity(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "PARity" <NEW_LINE> args = ["EVEN", "NONE", "ODD", "ONE", "ZERO"] | `SYSTem:COMMunicate:SERial:PARity
<http://www.rohde-schwarz.com/webhelp/smb100a_webhelp/Content/007a87c5bc084b7e.htm#ID_ed84c7fa71cc127d0a00206a0162bb19-92f11b0771cc127d0a00206a012bc823-en-US>`_
Arguments: EVEN, NONE, ODD, ONE, ZERO | 62599037baa26c4b54d50416 |
class XMLGenerator(object): <NEW_LINE> <INDENT> def __init__(self, f, pretty = False, skip_stringify = False): <NEW_LINE> <INDENT> self.__f = f <NEW_LINE> self.__pretty = pretty <NEW_LINE> self.__skip_stringify = skip_stringify <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.__context = xmlfile(self._... | A XML Generator based on lxml.etree.
Args:
f (file-like object): the output stream
pretty (:obj:`bool`): if the output XML should be nicely broken into multiple lines and indented
skip_stringify (:obj:`bool`): assumes the dict passed into `element` and `element_leaf` are already converted
to string... | 62599037596a897236128e0d |
class TriggerSingleton(QObject): <NEW_LINE> <INDENT> TRIGGER_FAST = 1 <NEW_LINE> TRIGGER_MED = 4 <NEW_LINE> TRIGGER_SLOW = 8 <NEW_LINE> ALL_TRIGGERS = ( TRIGGER_FAST, TRIGGER_MED, TRIGGER_SLOW ) <NEW_LINE> triggered = pyqtSignal(int) <NEW_LINE> instance = None <NEW_LINE> def __init__(self, parent=None): <NEW_LINE> <IN... | A timer to sync updates of sensors | 6259903750485f2cf55dc0ed |
class ConverterProxy(Converter): <NEW_LINE> <INDENT> def __init__(self, delegate, extension): <NEW_LINE> <INDENT> if not isinstance(delegate, Converter): <NEW_LINE> <INDENT> raise TypeError("Converter must implement the asdf.extension.Converter interface") <NEW_LINE> <DEDENT> self._delegate = delegate <NEW_LINE> self._... | Proxy that wraps a `Converter` and provides default
implementations of optional methods. | 625990373eb6a72ae038b7d7 |
class OutputChart(Chart): <NEW_LINE> <INDENT> def __init__(self, workload_info, zipped_size=1000, title="", description="", label="", axis_label=""): <NEW_LINE> <INDENT> super(OutputChart, self).__init__(workload_info, zipped_size) <NEW_LINE> self.title = title <NEW_LINE> self.description = description <NEW_LINE> self.... | Base class for charts related to scenario output. | 6259903750485f2cf55dc0ee |
class RateLimitException(TraktException): <NEW_LINE> <INDENT> http_code = 429 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.message = 'Rate Limit Exceeded' | TraktException type to be raised when a 429 return code is recieved | 62599037dc8b845886d54721 |
class UserData(object): <NEW_LINE> <INDENT> def __init__(self, data, parent): <NEW_LINE> <INDENT> self.parent = parent <NEW_LINE> self.rating = None <NEW_LINE> self.wantto = None <NEW_LINE> if 'rating' in data.keys(): <NEW_LINE> <INDENT> self.addRating(data['rating']) <NEW_LINE> <DEDENT> if 'wannto' in data.keys(): <NE... | Encapsulates user information associated with each Item instance.
Works by holding a reference to the owning Item and modifying its attributes. | 625990374e696a045264e6d9 |
class UnexpectedSituationWarning(PathWarning): <NEW_LINE> <INDENT> pass | Raised to alert the user/developer of a situation that should theoretically not be possible | 62599037be383301e0254985 |
class File(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "file" <NEW_LINE> self.a10_url="/axapi/v3/file" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.ssl_cert_key = {} <NEW_LINE> self.bw_list = {} <NEW_LIN... | :param DeviceProxy: The device proxy for REST operations and session handling. Refer to `common/device_proxy.py`
Class Description::
Local file Mangement.
Class file supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
URL for th... | 6259903726068e7796d4dab7 |
class ImgSlide(tornado.web.UIModule): <NEW_LINE> <INDENT> def render(self, *args, **kwargs): <NEW_LINE> <INDENT> info = kwargs.get('info', args[0]) <NEW_LINE> return self.render_string('modules/info/img_slide.html', post_info=info) | Module for Image slide.
fun(info) | 6259903723e79379d538d679 |
class TestCSApiResponseForPaginatedListExtendedGeofence(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 testCSApiResponseForPaginatedListExtendedGeofence(self): <NEW_LINE> <INDENT> pass | CSApiResponseForPaginatedListExtendedGeofence unit test stubs | 6259903794891a1f408b9faf |
class SMTPFactory(protocol.ServerFactory): <NEW_LINE> <INDENT> protocol = LocalSMTPServer <NEW_LINE> domain = LOCAL_FQDN <NEW_LINE> timeout = 600 <NEW_LINE> encrypted_only = False <NEW_LINE> def __init__(self, soledad_sessions, keymanager_sessions, sendmail_opts, deferred=None, retries=3): <NEW_LINE> <INDENT> self._sol... | Factory for an SMTP server with encrypted gatewaying capabilities. | 62599037baa26c4b54d50418 |
class BookListItem(ThreeLineAvatarListItem): <NEW_LINE> <INDENT> def __init__(self, book, **kwargs): <NEW_LINE> <INDENT> super().__init__(text=book.title, secondary_text=book.subtitle, tertiary_text=f"Price: {book.price}", **kwargs) <NEW_LINE> self.book = book <NEW_LINE> image = AsyncImageLeftWidget(source=self.book.im... | List item with the cover and short information about the book. | 6259903773bcbd0ca4bcb3f8 |
class Listener(tweepy.StreamListener): <NEW_LINE> <INDENT> def on_status(self, tweet): <NEW_LINE> <INDENT> tweet = utf8mb4.sub(u'', tweet.json) <NEW_LINE> tweet = json.loads(tweet) <NEW_LINE> tweet['created_at'] = qactweet.util.isoformat(tweet['created_at']) <NEW_LINE> tweet['text'] = htmlparser.unescape(tweet['text'])... | Consumes Tweets from the Twitter Streaming API.
This class overrides the default methods of the tweepy.StreamListener
class in order to clean Tweets and write them to MySQL. | 6259903750485f2cf55dc0ef |
class PriorityQueue(object): <NEW_LINE> <INDENT> def __init__(self, key, items=[]): <NEW_LINE> <INDENT> self.keys = dict((item, item) for item in items) <NEW_LINE> self.heap = list((key(item), item) for item in items) <NEW_LINE> self.key = key <NEW_LINE> heapq.heapify(self.heap) <NEW_LINE> <DEDENT> def contains(self, i... | A priority queue based on heapq and hashmap.
This is a overly complicated solution for something that shouldn't be that
hard. My input to the program was.
* be able to choose key to sort after.
* be unique and uniqueness aka __eq__() should not have something to
do with key.
* be able to pop from both e... | 62599037ac7a0e7691f73658 |
class Compare(Expression): <NEW_LINE> <INDENT> def __init__(self, lhs, op, rhs): <NEW_LINE> <INDENT> super(Compare, self).__init__(lhs, op, rhs) <NEW_LINE> <DEDENT> def compute(self, memory): <NEW_LINE> <INDENT> if memory.is_variable(self.lhs): <NEW_LINE> <INDENT> lhs_val = memory.get_value(self.lhs) <NEW_LINE> <DEDENT... | description of class | 62599037d4950a0f3b1116f7 |
class PostForm(FlaskForm): <NEW_LINE> <INDENT> post = TextAreaField('Say something', validators=[ DataRequired(), Length(min=1, max=140)]) <NEW_LINE> submit = SubmitField('Submit') | Blog submission form | 6259903766673b3332c31565 |
class GameObject(EventPublisher): <NEW_LINE> <INDENT> def __init__(self, **options): <NEW_LINE> <INDENT> EventPublisher.__init__(self) <NEW_LINE> if options["name"] in ["level", "game"]: <NEW_LINE> <INDENT> raise Exception("Invalid object name: `%s`" % options["name"]) <NEW_LINE> <DEDENT> self.__name = options["name"] ... | Base class of all game objects. | 62599037507cdc57c63a5f0a |
class Deck(Hand): <NEW_LINE> <INDENT> def populate(self): <NEW_LINE> <INDENT> for s in Card.SUITS: <NEW_LINE> <INDENT> for r in Card.RANKS: <NEW_LINE> <INDENT> self.add(Card(r, s, False)) <NEW_LINE> <DEDENT> <DEDENT> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> random.shuffle(self.cards) <NEW_LINE> <DEDENT> def deal... | A Deck of playing cards
uses all of the hand functions from above
use populate after creating the deck as deck.populate()
this will fill out the deck with all 52 cards
use deck.shuffle(to shuffle the deck randomly
deck.deal(hands,per_hand) will take a list of player hands,
and how many cards for each hand
if the deck ... | 6259903715baa7234946310b |
class WikipediaApi: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.wiki_api_url: str = "https://fr.wikipedia.org/w/api.php" <NEW_LINE> <DEDENT> def _search_page_by_title(self, title: str) -> Dict[str, Any]: <NEW_LINE> <INDENT> params: Dict = { "action": "query", "format": "json", "list": "sear... | Wikipedia API interaction class.
| 6259903726068e7796d4dab9 |
class GraphqlWsTransport: <NEW_LINE> <INDENT> TIMEOUT: float = 60.0 <NEW_LINE> async def connect(self, timeout: Optional[float] = None) -> None: <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> async def send(self, message: dict) -> None: <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DE... | Transport interface for the `GraphqlWsClient`. | 6259903773bcbd0ca4bcb3f9 |
class TestClientMoveMultipleUDFs(TestUDFServerBase): <NEW_LINE> <INDENT> @defer.inlineCallbacks <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> yield super(TestClientMoveMultipleUDFs, self).setUp() <NEW_LINE> yield self.wait_for_nirvana(.2) <NEW_LINE> self.other_udf = yield self.create_udf('TestUDF2') <NEW_LINE> self.o... | Moves on the client (between UDFs), e.g:
1) jack has two UDFs
2) jack moves (on the filesystem) a file from udf1 to udf2
3) jack moves (on the filesystem) a dir from udf1 to udf2 | 62599037d6c5a102081e3296 |
class Scene(object): <NEW_LINE> <INDENT> def __init__(self, folder='', duration=0): <NEW_LINE> <INDENT> self.actor_register = [] <NEW_LINE> self.folder = folder <NEW_LINE> self.duration = duration <NEW_LINE> <DEDENT> def tick(self,dt): <NEW_LINE> <INDENT> for actor in self.actor_register: <NEW_LINE> <INDENT> actor.tick... | Collects all actors in scene folder | 625990370a366e3fb87ddb56 |
class MecabTokenizer(object): <NEW_LINE> <INDENT> def __init__(self, do_lower_case=False, never_split=None, normalize_text=True, mecab_option=None): <NEW_LINE> <INDENT> self.do_lower_case = do_lower_case <NEW_LINE> self.never_split = never_split if never_split is not None else [] <NEW_LINE> self.normalize_text = normal... | Runs basic tokenization with MeCab morphological parser. | 625990378e05c05ec3f6f713 |
class SingleFilePrinter(ProgressPrinter): <NEW_LINE> <INDENT> def __init__(self, output, outputRDFobjects=None): <NEW_LINE> <INDENT> self.outputRDFobjects = outputRDFobjects <NEW_LINE> self.myout = output <NEW_LINE> <DEDENT> def printProgress(self, count, path, leaves, note): <NEW_LINE> <INDENT> self.myout.count = coun... | Print the final solution to a output file. output is a pynt.output.BaseOutput class. | 6259903771ff763f4b5e890a |
@ddt.ddt <NEW_LINE> class TeamMembershipTest(SharedModuleStoreTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TeamMembershipTest, self).setUp() <NEW_LINE> self.user1 = UserFactory.create(username='user1') <NEW_LINE> self.user2 = UserFactory.create(username='user2') <NEW_LINE> self.team1 = Cour... | Tests for the TeamMembership model. | 62599037a4f1c619b294f73f |
class Validator(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def semver(version=None): <NEW_LINE> <INDENT> from re import match <NEW_LINE> try: <NEW_LINE> <INDENT> return bool(match(r'^%s$' % SEMVER_MATCH, version)) <NEW_LINE> <DEDENT> except TypeError: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> <DED... | Class wrapper for validation logics. | 62599037c432627299fa4169 |
class Solution: <NEW_LINE> <INDENT> def twoSum2(self, nums, target): <NEW_LINE> <INDENT> if not nums or len(nums) < 2: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> nums.sort() <NEW_LINE> count = 0 <NEW_LINE> left, right = 0, len(nums) - 1 <NEW_LINE> while left < right: <NEW_LINE> <INDENT> if nums[left] + nums[right... | @param nums: an array of integer
@param target: An integer
@return: an integer | 6259903730c21e258be9997f |
class HandlerService(DefaultHandlerService): <NEW_LINE> <INDENT> class DefaultXGBoostAlgoModeInferenceHandler(default_inference_handler.DefaultInferenceHandler): <NEW_LINE> <INDENT> def default_model_fn(self, model_dir): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> booster, format = serve_utils.get_loaded_booster(model... | Handler service that is executed by the model server.
Determines specific default inference handlers to use based on the type MXNet model being used.
This class extends ``DefaultHandlerService``, which define the following:
- The ``handle`` method is invoked for all incoming inference requests to the model server.
... | 62599037d164cc61758220e5 |
class ResourceOptions: <NEW_LINE> <INDENT> parent: Optional['Resource'] <NEW_LINE> depends_on: Optional[List['Resource']] <NEW_LINE> protect: Optional[bool] <NEW_LINE> provider: Optional['ProviderResource'] <NEW_LINE> providers: Mapping[str, 'ProviderResource'] <NEW_LINE> def __init__(self, parent: Optional['Resource']... | ResourceOptions is a bag of optional settings that control a resource's behavior. | 625990371f5feb6acb163d64 |
class ApeTagger(MutagenTagger): <NEW_LINE> <INDENT> opener = {"ape": MonkeysAudio, "mpc": Musepack} <NEW_LINE> def save_tag(self): <NEW_LINE> <INDENT> tag = self.tag <NEW_LINE> for key, values in tag.items(): <NEW_LINE> <INDENT> if isinstance(values, APETextValue): <NEW_LINE> <INDENT> del tag[key] <NEW_LINE> <DEDENT> <... | APEv2 tagging with Mutagen. | 6259903721bff66bcd723dda |
@register <NEW_LINE> class AssertHandler(WithScopeHandler): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> def Assert(condition, message, span): <NEW_LINE> <INDENT> return tvm.tir.AssertStmt(condition, tvm.runtime.convert(message), self.body, span=span) <NEW_LINE> <DEDENT> super().__init__(Assert, concise_... | With scope handler tir.Assert(condition, message) | 625990379b70327d1c57fef8 |
class QuasiNewton(OptimizationMethod): <NEW_LINE> <INDENT> def __init__(self, problem, method = "GB", condition = "goldstein",rho = 0.1, sigma = 0.7, tau = 0.1, xi = 9): <NEW_LINE> <INDENT> super().__init__(problem, condition, rho, sigma, tau, xi) <NEW_LINE> acceptedMethods=['DFP','GB','BFGS','BB'] <NEW_LINE> if not me... | Subclass to OptimizationMethod. Uses quasi-newton solver.
Args:
problem: OptimizationProblem object.
method: {Optional} {Default = "GB"} String containing name of
method to be uesd for updating hessian.
condition: {Optional} {Default = "goldstein"} String containing
type of condition for inex... | 62599037507cdc57c63a5f0c |
class BucketList(object): <NEW_LINE> <INDENT> def __init__(self, title, activities={}): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.activities = activities <NEW_LINE> <DEDENT> def add_activity(self, activity): <NEW_LINE> <INDENT> self.activities[activity.name] = activity <NEW_LINE> return self.activities <NE... | This class describes the structure of the BucketList object | 62599037e76e3b2f99fd9b7f |
class State(object): <NEW_LINE> <INDENT> def __init__(self, activity, zone, todo): <NEW_LINE> <INDENT> self.zone, self.activity, self.todo = zone, activity, todo <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s-%s-%s" % (self.zone, self.activity, sorted(self.todo)) <NEW_LINE> <DEDENT> def __hash__... | The state contains the position of the traveler (zone), the activity participated
and --lagged variable (autoregressive process)--, excluding timeslice. | 6259903796565a6dacd2d845 |
class CallbackModule(object): <NEW_LINE> <INDENT> CALLBACK_VERSION = 2.0 <NEW_LINE> CALLBACK_TYPE = 'notification' <NEW_LINE> CALLBACK_NAME = 'collector' <NEW_LINE> CALLBACK_NEEDS_WHITELIST = False <NEW_LINE> def v2_runner_on_ok(self, result): <NEW_LINE> <INDENT> data = result._result <NEW_LINE> try: <NEW_LINE> <INDENT... | Ansible callback plugin for collect result into a common repository for the platform | 6259903782261d6c5273077e |
class LookupTable(ParameterLayer): <NEW_LINE> <INDENT> def __init__(self, vocab_size, embedding_dim, init, update=True, pad_idx=None, name=None): <NEW_LINE> <INDENT> super(LookupTable, self).__init__(init, name) <NEW_LINE> self.embedding_dim = embedding_dim <NEW_LINE> self.vocab_size = vocab_size <NEW_LINE> self.update... | A lookup table layer or a word embedding layer.
The layer converts a word into a dense representation. When given a sentence,
which is a vector of words (as integers), a matrix of vectors/embeddings for
each word in the sentence is returned.
LookupTable of dimensions embedding_dim by vocab_size is learnt.
input shap... | 6259903721bff66bcd723ddc |
class proxy(ExploitResult, CommonAttackMethods): <NEW_LINE> <INDENT> def __init__(self, proxyDaemonObject): <NEW_LINE> <INDENT> ExploitResult.__init__(self) <NEW_LINE> self._proxyDaemon = proxyDaemonObject <NEW_LINE> <DEDENT> def end(self): <NEW_LINE> <INDENT> raise BaseFrameworkException('You should implement the end ... | This class represents the output of an attack plugin that gives a proxy to the w3af user.
:author: Andres Riancho (andres.riancho@gmail.com) | 625990373eb6a72ae038b7dd |
class YMDHMService(SAServiceBase): <NEW_LINE> <INDENT> ID = 0x18 <NEW_LINE> def read_value(self): <NEW_LINE> <INDENT> raise NotImplementedError | todo | 625990370a366e3fb87ddb5a |
class FileselWidget(QtGui.QWidget): <NEW_LINE> <INDENT> def __init__(self, type='openfile', title=None, parent=None): <NEW_LINE> <INDENT> super(FileselWidget, self).__init__(parent) <NEW_LINE> self.type = type <NEW_LINE> self.value = '' <NEW_LINE> mainlayout = QtGui.QGridLayout(self) <NEW_LINE> if isinstance(title, str... | Custom widget for file selection | 6259903726068e7796d4dabc |
class Window: <NEW_LINE> <INDENT> def __init__(self, handle=None): <NEW_LINE> <INDENT> self.window_handle = handle <NEW_LINE> <DEDENT> def is_active(self) -> bool: <NEW_LINE> <INDENT> if self.window_handle: <NEW_LINE> <INDENT> return self.window_handle == user32.GetForegroundWindow() <NEW_LINE> <DEDENT> else: <NEW_LINE... | Base class for all classes in wizSDK. Keeps track of the wizard101 app window. | 625990374e696a045264e6dc |
class ThrottlingProtocol(ProtocolWrapper): <NEW_LINE> <INDENT> def write(self, data): <NEW_LINE> <INDENT> self.factory.registerWritten(len(data)) <NEW_LINE> ProtocolWrapper.write(self, data) <NEW_LINE> <DEDENT> def writeSequence(self, seq): <NEW_LINE> <INDENT> self.factory.registerWritten(reduce(operator.add, map(len, ... | Protocol for ThrottlingFactory. | 6259903730dc7b76659a09a7 |
class RmBugIsOpenTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.rm_backup = decorators._get_redmine_bug_status_id <NEW_LINE> self.stat_backup = decorators._redmine_closed_issue_statuses <NEW_LINE> decorators._redmine_closed_issue_statuses = lambda: [1, 2] <NEW_LINE> self.bug_id = gen_... | Tests for :func:`robottelo.decorators.rm_bug_is_open`. | 625990378c3a8732951f76cc |
class ColdDeadWater(Story): <NEW_LINE> <INDENT> __name__ = 'Cold Dead Water' <NEW_LINE> __version__ = '0.0.1' <NEW_LINE> options = { 'excel_file': './stories/colddeadwater/data/map.xlsx', 'map_file': './stories/colddeadwater/data/map.csv', 'node_file': './stories/colddeadwater/data/node... | You suddenly discover that you are conscious. Darkness envelops you. You struggle to
remember anything, even your own name.
Slowly, you begin to remember. | 6259903707d97122c4217e12 |
class check_crc(gr.basic_block): <NEW_LINE> <INDENT> def __init__(self, include_header, verbose, force=False): <NEW_LINE> <INDENT> gr.basic_block.__init__( self, name='check_crc', in_sig=[], out_sig=[]) <NEW_LINE> self.include_header = include_header <NEW_LINE> self.verbose = verbose <NEW_LINE> self.force = force <NEW_... | docstring for block check_crc | 62599037baa26c4b54d5041e |
class ExportEnvironmentForm(forms.ModelForm): <NEW_LINE> <INDENT> sdios_environment_uuid = forms.CharField(widget=forms.HiddenInput) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = EnvironmentMap <NEW_LINE> fields = ["name", "lti_environment_key", "sdios_environment_uuid"] | Form for exporting SDIs to LTI with fields populated
in the front-end. | 6259903721bff66bcd723dde |
class ChunkBySlice(unittest.TestCase): <NEW_LINE> <INDENT> def generate_tests(self, num, disabled=None): <NEW_LINE> <INDENT> disabled = disabled or [] <NEW_LINE> tests = [] <NEW_LINE> for i in range(num): <NEW_LINE> <INDENT> test = {'name': 'test%i' % i} <NEW_LINE> if i in disabled: <NEW_LINE> <INDENT> test['disabled']... | Test chunking related filters | 6259903750485f2cf55dc0f5 |
class PluginActivationError(PluginError): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._errorMessage = QApplication.translate("PluginError", "Error activating plugin module: %1") .arg(name) | Class defining an error raised, when there was an error during plugin activation. | 6259903730c21e258be99983 |
class HardTimeoutException(OTSException): <NEW_LINE> <INDENT> errno = 6001 | Exception that is raised when hard timeout occurs. | 62599037dc8b845886d54729 |
class Constraint(helpers.RateObject): <NEW_LINE> <INDENT> def __init__(self, expression): <NEW_LINE> <INDENT> self._expression = expression <NEW_LINE> <DEDENT> @property <NEW_LINE> def expression(self): <NEW_LINE> <INDENT> return self._expression | Represents an inequality constraint.
This class is nothing but a thin wrapper around an `Expression`, and
represents the constraint that the wrapped expression is non-positive. | 6259903716aa5153ce401662 |
class Point: <NEW_LINE> <INDENT> def __init__(self, x=0, y=0): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f"A point with coordinates x:{self.x}, y:{self.y}" <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f"Point({self.x},{se... | Class representing a point | 62599037ac7a0e7691f7365e |
class CANErrorFrame(object): <NEW_LINE> <INDENT> def __init__(self, flag_bits=6, ifs_bits=0): <NEW_LINE> <INDENT> self.flag_bits = min(max(6, flag_bits), 12) <NEW_LINE> self.ifs_bits = max(0, ifs_bits) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'CANErrorFrame({}, {})'.format(self.flag_bits, self... | CAN Error frame | 6259903723e79379d538d67e |
class Type(object): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> FACE_DETECTION = 1 <NEW_LINE> LANDMARK_DETECTION = 2 <NEW_LINE> LOGO_DETECTION = 3 <NEW_LINE> LABEL_DETECTION = 4 <NEW_LINE> TEXT_DETECTION = 5 <NEW_LINE> DOCUMENT_TEXT_DETECTION = 11 <NEW_LINE> SAFE_SEARCH_DETECTION = 6 <NEW_LINE> IMAGE_PROPERTIES... | Type of image feature.
Attributes:
TYPE_UNSPECIFIED (int): Unspecified feature type.
FACE_DETECTION (int): Run face detection.
LANDMARK_DETECTION (int): Run landmark detection.
LOGO_DETECTION (int): Run logo detection.
LABEL_DETECTION (int): Run label detection.
TEXT_DETECTION (int): Run OCR.
DOCUMENT_TE... | 62599037287bf620b6272d60 |
class ReportView(APIView): <NEW_LINE> <INDENT> def get(self, request, report_slug=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> if report_slug is None: <NEW_LINE> <INDENT> reports = Report.objects.order_by('slug') <NEW_LINE> return HttpResponseRedirect(reverse('report-view', args=[reports[0].slug])) <NEW_LINE> <D... | Main handler for /report/{id}
| 62599037c432627299fa416f |
class SourceCatalogHGPS(SourceCatalog): <NEW_LINE> <INDENT> name = 'hgps' <NEW_LINE> description = 'H.E.S.S. Galactic plane survey (HGPS) source catalog' <NEW_LINE> source_object_class = SourceCatalogObjectHGPS <NEW_LINE> def __init__(self, filename=None, hdu='HGPS_SOURCES'): <NEW_LINE> <INDENT> if not filename: <NEW_L... | HESS Galactic plane survey (HGPS) source catalog.
Note: this catalog isn't publicly available yet.
For now you need to be a H.E.S.S. member with an account
at MPIK to fetch it. | 62599037b57a9660fecd2bf3 |
class IllegalArgument(Exception): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.STRING, 'message', None, None, ), ) <NEW_LINE> def __init__(self, message=None,): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryP... | An IllegalArgument exception indicates an illegal or invalid
argument was passed into a procedure.
Attributes:
- message | 625990378a349b6b436873b9 |
class start_share(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> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def make(): <NEW_LINE> <INDENT... | <+description of block+> | 6259903750485f2cf55dc0f7 |
class Solution: <NEW_LINE> <INDENT> def Clone(self, pHead): <NEW_LINE> <INDENT> if not pHead: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> cur = pHead <NEW_LINE> while cur: <NEW_LINE> <INDENT> copyNode = RandomListNode(cur.label) <NEW_LINE> copyNode.next = cur.next <NEW_LINE> cur.next = copyNode <NEW_LINE> cur =... | 题目描述
输入一个复杂链表(每个节点中有节点值,以及两个指针,一个指向下一个节点,另一个特殊指针指向任意一个节点),
返回结果为复制后复杂链表的head。(注意,输出结果中请不要返回参数中的节点引用,否则判题程序会直接返回空) | 6259903730c21e258be99985 |
class CcTextDelegate(QStyledItemDelegate, UpdateEditorGeometry): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> QStyledItemDelegate.__init__(self, parent) <NEW_LINE> self.table_widget = parent <NEW_LINE> <DEDENT> def createEditor(self, parent, option, index): <NEW_LINE> <INDENT> m = index.model() <... | Delegate for text data. | 625990379b70327d1c57fefe |
class Sqrt(UnaryNode): <NEW_LINE> <INDENT> def __init__(self, child): <NEW_LINE> <INDENT> super(Sqrt, self).__init__(child) <NEW_LINE> self.in_vars = child.in_vars <NEW_LINE> self.out_vars = child.out_vars <NEW_LINE> self.name = 'sqrt(' + child.name + ')' | A class for storing STL Sqrt nodes
Inherits Node | 6259903730c21e258be99986 |
class GetTopTagsResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((xml) The response from Last.fm.) | 6259903707d97122c4217e15 |
@PIPELINES.register_module <NEW_LINE> class RandomRotate(object): <NEW_LINE> <INDENT> def __init__(self, angles=None): <NEW_LINE> <INDENT> self.angles = angles <NEW_LINE> <DEDENT> def _rotate_img(self, results): <NEW_LINE> <INDENT> angle = self.angle <NEW_LINE> height, width = results['img_shape'][:2] <NEW_LINE> height... | Description:
randomly rotate images and corresponding annotations
angles: contains single value or multiple values
if angles contains single value, this value represents `rotating fixed angle`;
if angles contains two values, angles represents `rotating random angle in the interval r... | 62599037d6c5a102081e329f |
class BlockStorageAnalyst(interface.Analyst): <NEW_LINE> <INDENT> image = interface.Parameter("analyst.block-storage.image") <NEW_LINE> partition = interface.Parameter("analyst.block-storage.partition") <NEW_LINE> block_size = interface.Parameter("analyst.block-storage.block-size") <NEW_LINE> output = interface.Paramet... | Block storage digital forensic analyst.
Parameters:
analyst.block-storage.image -- the name of the image file.
analyst.block-storage.partition -- the index of the partition.
analyst.block-storage.block-size -- the block size of the partition.
analyst.block-storage.output -- the name of the output file. | 625990371d351010ab8f4c93 |
class Rest(object): <NEW_LINE> <INDENT> def make_command(self, fn): <NEW_LINE> <INDENT> argspec = inspect.getargspec(fn) <NEW_LINE> def self_fn(*args): <NEW_LINE> <INDENT> argcount = fn.func_code.co_argcount <NEW_LINE> if argcount > len(args)+1 and fn.__doc__: <NEW_LINE> <INDENT> return fn.__doc__ <NEW_LINE> <DEDENT> i... | classdocs | 62599037d99f1b3c44d0681e |
class KnowledgeGraph(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._rels = {} <NEW_LINE> <DEDENT> def add(self, subject=None, rel=None, target=None, certainty=1): <NEW_LINE> <INDENT> previous = self.get(subject, rel, target) <NEW_LINE> if previous: <NEW_LINE> <INDENT> for p in previous: <NEW_LINE>... | The graph stores relationships by key, with a tuple of the subject, the
target, and the certainty of each relationship.
Hamlet is located in Elsinore:
{'located':('hamlet', 'elsinore', 1)}
Elsinore is the location of Hamlet:
{'location':('elsinore', 'hamlet', 1)} | 62599037baa26c4b54d50422 |
class LoginUserView(APIView): <NEW_LINE> <INDENT> def post(self, request, *args): <NEW_LINE> <INDENT> data = request.data <NEW_LINE> username = data.get('username') <NEW_LINE> password = data.get('password') <NEW_LINE> user = authenticate(username=username, password=password) <NEW_LINE> if user: <NEW_LINE> <INDENT> pay... | Log in user API view. | 6259903707d97122c4217e16 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.