code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class CalcK6C(CalcRecip): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__("K6C", **kwargs)
Geometry: K6C
62599095be7bc26dc9252d11
class PaymentRequired(CanonicalHTTPError): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(402, 'Payment Required', kwargs)
When the user hasn't coughed it up.
62599095283ffb24f3cf5612
class QgisLogHandler(logging.StreamHandler): <NEW_LINE> <INDENT> def __init__(self, topic): <NEW_LINE> <INDENT> logging.StreamHandler.__init__(self) <NEW_LINE> self.topic = topic <NEW_LINE> <DEDENT> def emit(self, record): <NEW_LINE> <INDENT> msg = self.format(record) <NEW_LINE> from qgis.core import QgsMessageLog <NEW...
Some magic to make it possible to use code like: import logging from . import LOGGER_NAME log = logging.getLogger(LOGGER_NAME) in all this plugin code, and it will show up in the QgsMessageLog
62599096283ffb24f3cf5614
class MinimaxPlayer(IsolationPlayer): <NEW_LINE> <INDENT> def get_move(self, game, time_left): <NEW_LINE> <INDENT> self.time_left = time_left <NEW_LINE> try: <NEW_LINE> <INDENT> return self.minimax(game, self.search_depth) <NEW_LINE> <DEDENT> except SearchTimeout: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> return [-1...
Game-playing agent that chooses a move using depth-limited minimax search. You must finish and test this player to make sure it properly uses minimax to return a good move before the search time limit expires.
625990965fdd1c0f98e5fcef
class RestrictedCommandHandler(CommandHandler): <NEW_LINE> <INDENT> def parse_body(self, body): <NEW_LINE> <INDENT> response = None <NEW_LINE> if body: <NEW_LINE> <INDENT> for (command, args, hlp) in configuration.commands.restricted_set(): <NEW_LINE> <INDENT> if re.match("^help((\s+" + command + "\s*)|(\s*))$", body):...
This type implements a restricted command feature. Any command parsed by this type is tested for existence in the list returned by the restricted_set function in the commands module, and if the command exists within that set, it is executed as a system command.
62599096ad47b63b2c5a95a1
class Node(object): <NEW_LINE> <INDENT> def __init__(self, name=None, labels=None, props=None): <NEW_LINE> <INDENT> self.name = name or '' <NEW_LINE> self.labels = labels or [] <NEW_LINE> self.props = props or {} <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '({})'.format(self.name)
An object to represent a single graph node.
62599096be7bc26dc9252d13
class SonosEntity(Entity): <NEW_LINE> <INDENT> def __init__(self, speaker: SonosSpeaker) -> None: <NEW_LINE> <INDENT> self.speaker = speaker <NEW_LINE> <DEDENT> async def async_added_to_hass(self) -> None: <NEW_LINE> <INDENT> await self.speaker.async_seen() <NEW_LINE> self.async_on_remove( async_dispatcher_connect( sel...
Representation of a Sonos entity.
625990968a349b6b43687fdc
class OpenldapAccount(BaseAccount): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_fields(cls) -> Dict[str, tldap.fields.Field]: <NEW_LINE> <INDENT> fields = { **BaseAccount.get_fields(), **helpers.get_fields_pwdpolicy(), } <NEW_LINE> return fields <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def on_load(cls, pytho...
An OpenLDAP specific account with the pwdpolicy schema.
62599096f9cc0f698b1c618a
class DeploymentmanagerDeploymentsDeleteRequest(messages.Message): <NEW_LINE> <INDENT> deployment = messages.StringField(1, required=True) <NEW_LINE> project = messages.StringField(2, required=True)
A DeploymentmanagerDeploymentsDeleteRequest object. Fields: deployment: ! The name of the deployment for this request. project: ! The project ID for this request.
62599096d8ef3951e32c8d1b
class OrderGoods(models.Model): <NEW_LINE> <INDENT> order = models.ForeignKey(OrderInfo, verbose_name='订单信息',on_delete=models.CASCADE) <NEW_LINE> goods = models.ForeignKey(Goods, verbose_name='商品',on_delete=models.CASCADE) <NEW_LINE> goods_num = models.IntegerField(default=0, verbose_name='商品数量') <NEW_LINE> add_time = ...
订单商品详情
625990967cff6e4e811b77c0
class Action(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.rules = [] <NEW_LINE> self.headers = [] <NEW_LINE> self.response_code = None <NEW_LINE> self.response_body = "" <NEW_LINE> <DEDENT> def add_rule(self, rule): <NEW_LINE> <INDENT> self.rules.append(rule) <NEW_LINE> <DEDENT> def add_hea...
Represent a whole action block
62599096f9cc0f698b1c618b
class Rectangle: <NEW_LINE> <INDENT> number_of_instances = 0 <NEW_LINE> print_symbol = '#' <NEW_LINE> def __init__(self, width=0, height=0): <NEW_LINE> <INDENT> self.__check_width(width) <NEW_LINE> self.__check_height(height) <NEW_LINE> self.__width = width <NEW_LINE> self.__height = height <NEW_LINE> Rectangle.number_...
a `Rectangle` class
62599096be7bc26dc9252d15
class ViewOne(ViewBase): <NEW_LINE> <INDENT> http_method_names = ["get", "put", "delete"] <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> self.set_view_kwargs(**kwargs) <NEW_LINE> object = self.get_object(kwargs["pk"]) <NEW_LINE> response_data = self.serialized_data(object, self.get_template) <N...
Base View for single object
62599096091ae356687069b2
class DataplaneLatency(base_tests.SimpleDataPlane): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> in_port, out_port = openflow_ports(2) <NEW_LINE> delete_all_flows(self.controller) <NEW_LINE> pkt = str(simple_tcp_packet()) <NEW_LINE> request = ofp.message.flow_add( match=ofp.match(wildcards=ofp.OFPFW_ALL),...
Measure and assert dataplane latency All packets must arrive within the default timeout, and 90% must arrive within the default negative timeout.
6259909650812a4eaa621a87
class StringResponse(MockResponse): <NEW_LINE> <INDENT> def __init__(self, headers, content): <NEW_LINE> <INDENT> super(StringResponse, self).__init__(headers, unicode(content))
A response with stringified content. >>> from restorm.clients.mockclient import StringResponse >>> response = StringResponse({'Status': 200}, '{}') >>> response.content '{}'
62599096dc8b845886d5533a
class CtrlSpace(Object3D): <NEW_LINE> <INDENT> def __init__(self, name, parent=None): <NEW_LINE> <INDENT> super(CtrlSpace, self).__init__(name, parent=parent) <NEW_LINE> self.setShapeVisibility(False)
CtrlSpace object.
62599096dc8b845886d5533c
class AddError(Exception): <NEW_LINE> <INDENT> pass
Add Error
625990968a349b6b43687fe4
class CustomIndexDashboard(Dashboard): <NEW_LINE> <INDENT> def init_with_context(self, context): <NEW_LINE> <INDENT> site_name = get_admin_site_name(context) <NEW_LINE> self.children.append(modules.ModelList( _('Metadata Configuration & Registration'), column=1, collapsible=False, models=('geosk.mdtools.*','geosk.skreg...
Custom index dashboard for www.
62599096adb09d7d5dc0c2de
class Movie(): <NEW_LINE> <INDENT> VALID_RATINGS = ["G", "PG", "PG-13","R"] <NEW_LINE> def __init__(self, title, storyline, img, trailer): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.storyline = storyline <NEW_LINE> self.poster_image_url = img <NEW_LINE> self.trailer_youtube_url = ...
This is the file media.py it's the Movie class
62599096dc8b845886d5533e
class WordText: <NEW_LINE> <INDENT> def __init__(self, font='', size=0, color=(0, 0, 0)): <NEW_LINE> <INDENT> self._font = font <NEW_LINE> self._size = size <NEW_LINE> self._color = color <NEW_LINE> self._setting = pygame.font.Font(self._font, self._size) <NEW_LINE> <DEDENT> def setWord(self, word=''): <NEW_LINE> <INDE...
用于在Pygame中进行文字生成
625990965fdd1c0f98e5fcfb
class FiveZlotyPriceHandler(PricingHandler): <NEW_LINE> <INDENT> def get_variant_price(self, *args, **kwargs): <NEW_LINE> <INDENT> return Price(net=5, gross=5, currency=u'PLN') <NEW_LINE> <DEDENT> def get_product_price_range(self, *args, **kwargs): <NEW_LINE> <INDENT> return PriceRange(min_price=Price(net=5, gross=5, c...
Dummy base price handler - everything has 5PLN price
6259909650812a4eaa621a8a
class BidsUserSetting(models.Model): <NEW_LINE> <INDENT> mid = models.ForeignKey(CustomerInformation,null=True, on_delete=models.CASCADE, verbose_name="用户") <NEW_LINE> areas_id = models.CharField(max_length=60, verbose_name="关注省范围") <NEW_LINE> keywords_array = models.CharField(max_length=60,null=True,blank=True, verbos...
用户订阅表
62599096091ae356687069ba
class ParseError(Exception): <NEW_LINE> <INDENT> pass
Used to indicate a XML parsing error.
62599096ad47b63b2c5a95a8
class Vehicle(object): <NEW_LINE> <INDENT> def __init__(self, ID=0, direct_flag = 1, lane_ID = 0, position = np.array([0.0,0.0]), speed = np.array([0.0,0.0]), acceleration = np.array([0.0,0.0])): <NEW_LINE> <INDENT> self.ID = ID <NEW_LINE> self.direct_flag = direct_flag <NEW_LINE> self.lane_ID = lane_ID <NEW_LINE> self...
Vehicle class: the attributes consists of ID, direct_flag, lane_ID, position array([x, y]), and some kinematics parameters including speed array([vx, vy]) and acceleration array([ax, ay]).
6259909660cbc95b06365c2c
class UpdateData(QThread): <NEW_LINE> <INDENT> update_date = pyqtSignal(str) <NEW_LINE> def run(self): <NEW_LINE> <INDENT> cnt = 0 <NEW_LINE> while True: <NEW_LINE> <INDENT> cnt += 1 <NEW_LINE> self.update_date.emit(str(cnt)) <NEW_LINE> time.sleep(1)
更新数据类
625990965fdd1c0f98e5fcff
class StrictQueryFilter(DjangoFilterBackend): <NEW_LINE> <INDENT> def get_filter_class(self, view, queryset=None): <NEW_LINE> <INDENT> klass = (super(StrictQueryFilter, self) .get_filter_class(view, queryset=queryset)) <NEW_LINE> try: <NEW_LINE> <INDENT> klass._meta.order_by = klass.Meta.model.Meta.ordering <NEW_LINE> ...
Don't allow people to typo request params and return all the objects. Instead limit it down to the parameters allowed in filter_fields.
62599096091ae356687069be
class TelldusLiveClient(object): <NEW_LINE> <INDENT> def __init__(self, hass, config): <NEW_LINE> <INDENT> from tellduslive import Client <NEW_LINE> public_key = config[DOMAIN].get(CONF_PUBLIC_KEY) <NEW_LINE> private_key = config[DOMAIN].get(CONF_PRIVATE_KEY) <NEW_LINE> token = config[DOMAIN].get(CONF_TOKEN) <NEW_LINE>...
Get the latest data and update the states.
6259909650812a4eaa621a8d
class JdbcSchema(BaseSchema): <NEW_LINE> <INDENT> def __init__(self, jdbc_resource, json_object=None, url=None): <NEW_LINE> <INDENT> super().__init__(jdbc_resource, json_object, url) <NEW_LINE> self.jdbc_resource = jdbc_resource <NEW_LINE> <DEDENT> def resource(self): <NEW_LINE> <INDENT> return self.jdbc_resource <NEW_...
classdocs
62599096656771135c48aef7
class Calculator(commands.Cog): <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.transformations = standard_transformations + (implicit_multiplication, implicit_application, function_exponentiation, convert_xor) <NEW_LINE> <DEDENT> @commands.command() <NEW_LINE> @checks.ha...
It's not working btw!!
625990963617ad0b5ee07edf
class LogLikelihood(ModelQuantity): <NEW_LINE> <INDENT> def __init__(self, identifier: sp.Symbol, name: str, value: sp.Expr): <NEW_LINE> <INDENT> super(LogLikelihood, self).__init__(identifier, name, value)
A LogLikelihood defines the distance between measurements and experiments for a particular observable. The final LogLikelihood value in the simulation will be the sum of all specified LogLikelihood instances evaluated at all timepoints, abbreviated by ``Jy``.
625990967cff6e4e811b77d1
class NestedFormat(VisFormat): <NEW_LINE> <INDENT> def __init__(self, imap): <NEW_LINE> <INDENT> self._imap = imap <NEW_LINE> <DEDENT> def interval_blocks(self): <NEW_LINE> <INDENT> return [ IntervalBlock( video_id=video_key, interval_sets=[ NamedIntervalSet(name='default', interval_set=interval.payload) ]) for video_k...
Format where each interval block contains the interval set in the payload of each top-level interval.
625990965fdd1c0f98e5fd03
class CircRestriThreeBodyProb(body_prob_dyn.RestriThreeBodyProb): <NEW_LINE> <INDENT> def __init__(self, mu, period, sma, Li): <NEW_LINE> <INDENT> body_prob_dyn.RestriThreeBodyProb.__init__(self, mu, 0., period, sma, Li) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def Earth_Moon(cls, Li): <NEW_LINE> <INDENT> sma = conf...
Class implementing the restricted three body problem with a circular reference orbit.
62599096dc8b845886d55348
class StatusConversationProvider(object): <NEW_LINE> <INDENT> implements(IStatusConversationProvider) <NEW_LINE> adapts(IStatusUpdate, IPlonesocialActivitystreamLayer, Interface) <NEW_LINE> index = ViewPageTemplateFile("templates/statusconversation_provider.pt") <NEW_LINE> def __init__(self, context, request, view): <N...
Render a thread of IStatusUpdates
6259909650812a4eaa621a8f
class Prior(Link): <NEW_LINE> <INDENT> inputs = ('parameters',) <NEW_LINE> outputs = ('logprior',) <NEW_LINE> def calculate(self, parameters): <NEW_LINE> <INDENT> for p,v in parameters.items(): <NEW_LINE> <INDENT> if np.isnan(v): <NEW_LINE> <INDENT> return INVALID <NEW_LINE> <DEDENT> <DEDENT> try: <NEW_LINE> <INDENT> o...
A very basic prior with the ability to break execution of a subchain.
62599096d8ef3951e32c8d25
class Button(WidgetFactory): <NEW_LINE> <INDENT> def __init__(self, text): <NEW_LINE> <INDENT> super().__init__(ttk.Button) <NEW_LINE> self.kwargs['text'] = text
Wrapper for the tkinter.ttk.Button class.
62599096be7bc26dc9252d1e
class LogListHandler(logging.Handler): <NEW_LINE> <INDENT> def emit(self, record): <NEW_LINE> <INDENT> message = self.format(record) <NEW_LINE> message = message.replace("\n", "<br />") <NEW_LINE> mylar.LOG_LIST.insert(0, (helpers.now(), message, record.levelname, record.threadName))
Log handler for Web UI.
62599096283ffb24f3cf562c
class BuyableItemBase(BaseModel): <NEW_LINE> <INDENT> price_max: Optional[float] <NEW_LINE> price_min: Optional[float] <NEW_LINE> reviewable: Optional[bool] <NEW_LINE> reviews_count: Optional[int] <NEW_LINE> reviewscore: Optional[float] <NEW_LINE> shop_count: Optional[int]
Item Buy base model. Attributes: price_min: price_max: shop_count: reviewscore: reviews_count: reviewable:
62599096ad47b63b2c5a95ad
class OktaSignOnPolicyConditions( PolicyRuleConditions ): <NEW_LINE> <INDENT> def __init__(self, config=None): <NEW_LINE> <INDENT> super().__init__(config) <NEW_LINE> if config: <NEW_LINE> <INDENT> if "people" in config: <NEW_LINE> <INDENT> if isinstance(config["people"], policy_people_condition.PolicyPeopleCondition):...
A class for OktaSignOnPolicyConditions objects.
62599096d8ef3951e32c8d26
@jitclass([]) <NEW_LINE> class NumbaHeatIndexCalculator(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def calculate_heat_index(self, temp: np.ndarray, rh: np.ndarray) -> np.ndarray: <NEW_LINE> <INDENT> hi = np.zeros_like(temp) <NEW_LINE> for i in range(temp.shape[0]): <NE...
This class uses the jitclass operator to automatically jit all of the functions inside. Otherwise it's identical to the base implementation
62599096be7bc26dc9252d1f
class MQTTRPCResponseManager(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def handle(cls, request_str, service_id, method_id, dispatcher): <NEW_LINE> <INDENT> if isinstance(request_str, bytes): <NEW_LINE> <INDENT> request_str = request_str.decode("utf-8") <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> json.loads(...
MQTT-RPC response manager. Method brings syntactic sugar into library. Given dispatcher it handles request (both single and batch) and handles errors. Request could be handled in parallel, it is server responsibility. :param str request_str: json string. Will be converted into MQTTRPC10Request :param dict dispat...
62599096ad47b63b2c5a95ae
class Card(metaclass=ObjectSameForGivenParameters): <NEW_LINE> <INDENT> def __init__(self, r, s): <NEW_LINE> <INDENT> if r in ranks and s in suits: <NEW_LINE> <INDENT> self.__rank = r <NEW_LINE> self.__suit = s <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> raise LookupError('Rank {} or suit {} does not exist.'.format(r...
Card(rank, suite) is a single card
625990968a349b6b43687ff6
class PublicTagsApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.client = APIClient() <NEW_LINE> <DEDENT> def test_login_required(self): <NEW_LINE> <INDENT> res = self.client.get(TAGS_URL) <NEW_LINE> self.assertEqual(res.status_code, status.HTTP_401_UNAUTHORIZED)
Test the publicly available tags api
625990967cff6e4e811b77d9
class DistributionMirrorBreadcrumb(TitleBreadcrumb): <NEW_LINE> <INDENT> pass
Breadcrumb for distribution mirrors.
62599096adb09d7d5dc0c2f0
class VIEW3D_PT_catt_export(View3DCattPanel, Panel): <NEW_LINE> <INDENT> bl_label = "Export" <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_LINE> catt_export = context.scene.catt_export <NEW_LINE> col = layout.column(align=True) <NEW_LINE> rowsub = col.row(align=True) <NEW_LINE> rowsu...
panel export
625990963617ad0b5ee07eea
class Laser: <NEW_LINE> <INDENT> def __init__(self, x, y, img): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.img = img <NEW_LINE> self.mask = pygame.mask.from_surface(self.img) <NEW_LINE> <DEDENT> def draw(self, window): <NEW_LINE> <INDENT> window.blit(self.img, (self.x, self.y)) <NEW_LINE> <DED...
A class for laser
62599096283ffb24f3cf5632
class MsgObsDepC(SBP): <NEW_LINE> <INDENT> _parser = construct.Struct( 'header' / ObservationHeaderDep._parser, 'obs' / construct.GreedyRange(PackedObsContentDepC._parser),) <NEW_LINE> __slots__ = [ 'header', 'obs', ] <NEW_LINE> def __init__(self, sbp=None, **kwargs): <NEW_LINE> <INDENT> if sbp: <NEW_LINE> <INDENT> sup...
SBP class for message MSG_OBS_DEP_C (0x0049). You can have MSG_OBS_DEP_C inherit its fields directly from an inherited SBP object, or construct it inline using a dict of its fields. The GPS observations message reports all the raw pseudorange and carrier phase observations for the satellites being tracked by the dev...
62599096adb09d7d5dc0c2f4
class Square(Rectangle): <NEW_LINE> <INDENT> def __init__(self, size=None, x=0, y=0, id=None): <NEW_LINE> <INDENT> super().__init__(size, size, x, y, id) <NEW_LINE> <DEDENT> @property <NEW_LINE> def size(self): <NEW_LINE> <INDENT> return self.width <NEW_LINE> <DEDENT> @size.setter <NEW_LINE> def size(self, size): <NEW_...
square class that inherits from rectangle
62599096091ae356687069cc
class SimpleTictactoe(QDialog): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.title = "Simple Tictactoe" <NEW_LINE> self.left , self.top , self.width , self.height = 10, 10, -1, -1 <NEW_LINE> self.initGUI() <NEW_LINE> <DEDENT> def initGUI(self): <NEW_LINE> <INDENT> self....
With this class simple tictactoe game-app is created.
62599096283ffb24f3cf5634
class tomcat(sos.plugintools.PluginBase): <NEW_LINE> <INDENT> def checkenabled(self): <NEW_LINE> <INDENT> return self.isInstalled("tomcat5") <NEW_LINE> <DEDENT> def setup(self): <NEW_LINE> <INDENT> self.addCopySpecs(["/etc/tomcat5", "/var/log/tomcat5"])
Tomcat related information
62599097656771135c48aefe
class TopicAndPartition(object): <NEW_LINE> <INDENT> def __init__(self, topic, partition): <NEW_LINE> <INDENT> self._topic = topic <NEW_LINE> self._partition = partition <NEW_LINE> <DEDENT> def _jTopicAndPartition(self, helper): <NEW_LINE> <INDENT> return helper.createTopicAndPartition(self._topic, self._partition) <NE...
Represents a specific top and partition for Kafka.
62599097dc8b845886d55354
class Fam(FileMonitor): <NEW_LINE> <INDENT> __priority__ = 10 <NEW_LINE> def __init__(self, ignore=None, debug=False): <NEW_LINE> <INDENT> FileMonitor.__init__(self, ignore=ignore, debug=debug) <NEW_LINE> self.filemonitor = _fam.open() <NEW_LINE> self.users = {} <NEW_LINE> LOGGER.warning("The Fam file monitor backend i...
**Deprecated** file monitor backend with support for the `File Alteration Monitor <http://oss.sgi.com/projects/fam/>`_ (also abbreviated "FAM").
62599097283ffb24f3cf5636
class MaskFracBinner(FieldBinner): <NEW_LINE> <INDENT> def __init__(self, xmin, xmax, nbin, other_selection, field_base='mask_frac', **kw): <NEW_LINE> <INDENT> super(MaskFracBinner,self).__init__( field_base, xmin, xmax, nbin, selection=other_selection, **kw ) <NEW_LINE> <DEDENT> def doplot(self, d, **kw): <NEW_LINE> <...
Bin by psf shape. We use the psf shape without metacal, since we often symmetrize the metacal psf
62599097656771135c48aeff
class DecisionTreeParams(Params): <NEW_LINE> <INDENT> maxDepth = Param(Params._dummy(), "maxDepth", "Maximum depth of the tree. (>= 0) E.g., depth 0 means 1 leaf node; depth 1 means 1 internal node + 2 leaf nodes.", typeConverter=TypeConverters.toInt) <NEW_LINE> maxBins = Param(Params._dummy(), "maxBins", "Max number o...
Mixin for Decision Tree parameters.
62599097d8ef3951e32c8d2b
class AppleseedOSLOutSocket(NodeSocket, AppleseedSocket): <NEW_LINE> <INDENT> bl_idname = "AppleseedOSLOutSocket" <NEW_LINE> bl_label = "OSL Socket" <NEW_LINE> socket_osl_id = '' <NEW_LINE> def draw(self, context, layout, node, text): <NEW_LINE> <INDENT> layout.label(text) <NEW_LINE> <DEDENT> def draw_color(self, conte...
appleseed OSL base socket
625990978a349b6b43687ffe
class SimpleMarkdown(Generator): <NEW_LINE> <INDENT> extensions = ['.md'] <NEW_LINE> def process(self, src_dir, dest_dir, filename, processor): <NEW_LINE> <INDENT> basename, ext = os.path.splitext(filename) <NEW_LINE> processor.context.push( **get_yaml(os.path.join(src_dir, basename + '.yml')) ) <NEW_LINE> content = md...
Generator for processing plain Markdown files Will try to read {filename}.yml for additional context. Processes content as a Template first, allowing variables, etc. Will use context['template'] for the template name.
62599097c4546d3d9def816a
class ProjectPage(ConfigurationPageBase, Ui_ProjectPage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(ProjectPage, self).__init__() <NEW_LINE> self.setupUi(self) <NEW_LINE> self.setObjectName("ProjectPage") <NEW_LINE> self.projectSearchNewFilesRecursiveCheckBox.setChecked( Preferences.getProject("...
Class implementing the Project configuration page.
62599097be7bc26dc9252d25
class WeakGreedySurrogate(BasicObject): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def evaluate(self, mus, return_all_values=False): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def extend(self, mu): <NEW_LINE> <INDENT> pass
Surrogate for the approximation error in :func:`weak_greedy`.
62599097091ae356687069d2
class NewsAgent: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sources = [] <NEW_LINE> self.destinations = [] <NEW_LINE> <DEDENT> def add_source(self, source): <NEW_LINE> <INDENT> self.sources.append(source) <NEW_LINE> <DEDENT> def addDestination(self, dest): <NEW_LINE> <INDENT> self.destinations.app...
可将新闻源中的新闻分发到新闻目的地的对象
62599097656771135c48af01
class Movie(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'movies' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> title = db.Column(db.String(500), nullable=False) <NEW_LINE> release_date = db.Column(db.Date, nullable=False) <NEW_LINE> actors = db.relationship("Actor", secondary=ActorMovie, backref...
Model that defines a movie and its attributes
625990978a349b6b43688002
class PrefixSet(_abc.MutableSet): <NEW_LINE> <INDENT> def __init__(self, iterable=None, factory=Trie, **kwargs): <NEW_LINE> <INDENT> trie = factory(**kwargs) <NEW_LINE> if iterable: <NEW_LINE> <INDENT> trie.update((key, True) for key in iterable) <NEW_LINE> <DEDENT> self._trie = trie <NEW_LINE> <DEDENT> def copy(self):...
A set of prefixes. :class:`pygtrie.PrefixSet` works similar to a normal set except it is said to contain a key if the key or it's prefix is stored in the set. For instance, if "foo" is added to the set, the set contains "foo" as well as "foobar". The set supports addition of elements but does *not* support removal o...
62599097c4546d3d9def816d
class Food(object): <NEW_LINE> <INDENT> def __init__(self, name, cost, kkal): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.cost = cost <NEW_LINE> self.kkal = kkal <NEW_LINE> year = 2019 <NEW_LINE> month = randint(2, 6) <NEW_LINE> day = randint(1, 28) <NEW_LINE> self.time = datetime(year, month, day) <NEW_LINE> ...
Еда в столовой
62599097099cdd3c636762cc
class ConnectionError(RequestException): <NEW_LINE> <INDENT> pass
A Connection error occured.
6259909750812a4eaa621a9a
class FilesAPI(GoogleDrive, SheetsService, DocsService): <NEW_LINE> <INDENT> def create_sheet(self, folder_parent, folder, filename: str): <NEW_LINE> <INDENT> spreadsheet = super().create_spreadsheet(filename) <NEW_LINE> spreadsheet_id = spreadsheet.get('spreadsheetId') <NEW_LINE> super().update_file_parent( file_id=sp...
Composition of google APIs
625990973617ad0b5ee07efa
class HelpTextAccumulator(DiffAccumulator): <NEW_LINE> <INDENT> def __init__(self, restrict=None): <NEW_LINE> <INDENT> super(HelpTextAccumulator, self).__init__() <NEW_LINE> self._changes = [] <NEW_LINE> self._invalid_abbreviations = re.compile( r'\b({0})\b'.format('|'.join(INVALID_BRAND_ABBREVIATIONS))) <NEW_LINE> sel...
Accumulates help text directory differences. Attributes: _changes: The list of DirDiff() (op, path) difference tuples. _invalid_file_count: The number of files that have invalid content. _restrict: The set of file path prefixes that the accumulator should be restricted to.
62599097d8ef3951e32c8d30
class Subscriber(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractclassmethod <NEW_LINE> def update(self): <NEW_LINE> <INDENT> pass
观察者的抽象基类,具体观察者,用来实现观察者接口以保持其状态与主题中的变化一致
625990978a349b6b4368800b
class PasswordResetCompleteView(PasswordResetCompleteView): <NEW_LINE> <INDENT> template_name = 'authentication/password_reset_complete.html' <NEW_LINE> title = 'Password reset complete'
after succeesfully change of password
62599097dc8b845886d55362
class Positive(calculation.Calculation): <NEW_LINE> <INDENT> def __init__(self, subcalc): <NEW_LINE> <INDENT> super(Positive, self).__init__([subcalc.unitses[0]] + subcalc.unitses) <NEW_LINE> self.subcalc = subcalc <NEW_LINE> <DEDENT> def latex(self, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedError() <NE...
Return 0 if subcalc is less than 0
62599097adb09d7d5dc0c306
class ChebyshevPolynomial(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def basis_generation_with_eigenvalue_shifting_and_scaling_single_vec(self, mat, vec, step_val, max_eigenval, min_eigenval): <NEW_LINE> <INDENT> assert step_val>=1, "Need a larger step_val" <NEW_LINE> chebys...
Chebyshev Polynomial class
62599097d8ef3951e32c8d33
class RandDur(PyoObject): <NEW_LINE> <INDENT> def __init__(self, min=0.0, max=1.0, mul=1, add=0): <NEW_LINE> <INDENT> pyoArgsAssert(self, "OOOO", min, max, mul, add) <NEW_LINE> PyoObject.__init__(self, mul, add) <NEW_LINE> self._min = min <NEW_LINE> self._max = max <NEW_LINE> min, max, mul, add, lmax = convertArgsToLis...
Recursive time varying pseudo-random generator. RandDur generates a pseudo-random number between `min` and `max` arguments and uses that number to set the delay time before the next generation. RandDur will hold the generated value until next generation. :Parent: :py:class:`PyoObject` :Args: min: float or PyoOb...
625990977cff6e4e811b77f4
class MonitoringProcessor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.logger = logging.getLogger('monitor.processor.%s' % self.__class__.__name__) <NEW_LINE> <DEDENT> def report_exception(self, msg="Processor has failed with exception:"): <NEW_LINE> <INDENT> if msg: <NEW_LINE> <INDENT> sel...
Interface for a monitoring processor.
62599097656771135c48af09
class Gauge(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self, maxValue, parentPlayer, color=(0,255,0)): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.maxValue = maxValue <NEW_LINE> self.fillColor = color <NEW_LINE> self.parent = parentPlayer <NEW_LINE> self.image = pygame.Surface([maxValue, 10]) <N...
Class for UI gauges such as fuel
6259909750812a4eaa621a9f
class StatusCommand(command.ShowOne): <NEW_LINE> <INDENT> hidden_status_items = {'links'} <NEW_LINE> @classmethod <NEW_LINE> def status_attributes(cls, client_item): <NEW_LINE> <INDENT> return [item for item in client_item.items() if item[0] not in cls.hidden_status_items] <NEW_LINE> <DEDENT> def get_parser(self, prog_...
Get introspection status.
62599097d8ef3951e32c8d35
class ModelId(Enum): <NEW_LINE> <INDENT> AR_AR_BROADBANDMODEL = 'ar-AR_BroadbandModel' <NEW_LINE> DE_DE_BROADBANDMODEL = 'de-DE_BroadbandModel' <NEW_LINE> DE_DE_NARROWBANDMODEL = 'de-DE_NarrowbandModel' <NEW_LINE> EN_GB_BROADBANDMODEL = 'en-GB_BroadbandModel' <NEW_LINE> EN_GB_NARROWBANDMODEL = 'en-GB_NarrowbandModel' <...
The identifier of the model in the form of its name from the output of the **Get a model** method.
62599097dc8b845886d5536b
class IntegerEnumOneValue( _SchemaEnumMaker( enum_value_to_name={ 0: "POSITIVE_0", } ), IntSchema ): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> @property <NEW_LINE> def POSITIVE_0(cls): <NEW_LINE> <INDENT> return cls._enum_by_value[0](0)
NOTE: This class is auto generated by OpenAPI Generator. Ref: https://openapi-generator.tech Do not edit the class manually.
625990977cff6e4e811b77f8
class UpgradeClusterInstancesRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ClusterId = None <NEW_LINE> self.Operation = None <NEW_LINE> self.UpgradeType = None <NEW_LINE> self.InstanceIds = None <NEW_LINE> self.ResetParam = None <NEW_LINE> self.SkipPreCheck = None <NEW_LINE> s...
UpgradeClusterInstances请求参数结构体
6259909750812a4eaa621aa3
class GroupEntityMixin(models.Model): <NEW_LINE> <INDENT> label = models.CharField(_('label'), max_length=255) <NEW_LINE> codename = models.SlugField(_('codename'), unique=True, blank=True, max_length=255) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> abstract = True <NEW_LINE> ordering = ('label', ) <NEW_LINE> <DEDENT> d...
This model represents the entities of a group. One group could have more than one entity. This objects could describe the group's properties (i.e. Administrators, Users, ecc). :Parameters: - `label`: (required) - `codename`: unique codename; if not set, it's autogenerated by slugifying the label (lower case)
62599097d8ef3951e32c8d39
class ProductOperator(LinearOperator): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self._structure = kwargs.get('structure', None) <NEW_LINE> for A in args: <NEW_LINE> <INDENT> if len(A.shape) != 2 or A.shape[0] != A.shape[1]: <NEW_LINE> <INDENT> raise ValueError( 'For now, the ProductO...
For now, this is limited to products of multiple square matrices.
62599097656771135c48af0e
class ScpArgument(object): <NEW_LINE> <INDENT> def __init__(self, arg): <NEW_LINE> <INDENT> self.username, self.hostname, self.path = None, None, None <NEW_LINE> if ':' in arg: <NEW_LINE> <INDENT> hostname, self.path = arg.split(':', 1) <NEW_LINE> if '@' in hostname: <NEW_LINE> <INDENT> self.username, self.hostname = h...
Parse and split SCP argument string Possible formats: '/path/to/file' - local file/folder reference 'remote:/path/to/file' - remote file/folder reference, without username 'username@remote:/path/to/file' - remote file/folder reference with username 'remote:' - remote without path and username, referenc...
62599098be7bc26dc9252d33
class RestClientUtils: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def verify_response_code(response_code): <NEW_LINE> <INDENT> if response_code is hl.OK: <NEW_LINE> <INDENT> LOG.debug("Success operation result code.") <NEW_LINE> return <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> RestClientUtils.check_status(respons...
The utility class for working with rest clients
625990987cff6e4e811b7800
class Registry(): <NEW_LINE> <INDENT> registry_list = None <NEW_LINE> database = None <NEW_LINE> def __init__(self, database): <NEW_LINE> <INDENT> self.database = database <NEW_LINE> <DEDENT> def get_game(self, game_type, game_id): <NEW_LINE> <INDENT> return self.database.get_data(game_type, {"unique_id": game_id}) <NE...
config the object functions according to the game
62599098099cdd3c636762d8
class Solution2: <NEW_LINE> <INDENT> def fourSum(self, nums, target): <NEW_LINE> <INDENT> nums.sort() <NEW_LINE> results = [] <NEW_LINE> self.findNsum(nums, target, 4, [], results) <NEW_LINE> return results <NEW_LINE> <DEDENT> def findNsum(self, nums, target, N, result, results): <NEW_LINE> <INDENT> if len(nums) < N or...
@param numbers: Give an array @param target: An integer @return: Find all unique quadruplets in the array which gives the sum of zero
62599098be7bc26dc9252d34
class MqttConnector: <NEW_LINE> <INDENT> client = None <NEW_LINE> onMessageReceived = None <NEW_LINE> topics = [] <NEW_LINE> def on_connect(self, client, userdata, flags, rc): <NEW_LINE> <INDENT> print("Connected with result code " + str(rc)) <NEW_LINE> self.subscribeToAllTopics() <NEW_LINE> <DEDENT> def subscribeToAll...
Responsible for mqtt pub/sub
62599098c4546d3d9def817a
class Show(URIBase, AsyncIterable): <NEW_LINE> <INDENT> def __init__(self, client, data): <NEW_LINE> <INDENT> self.__client = client <NEW_LINE> self.available_markets = data.pop("available_markets", None) <NEW_LINE> self.copyrights = data.pop("copyrights", None) <NEW_LINE> self.description = data.pop("description", Non...
A Spotify Show Object. Attributes ---------- id : :class:`str` The Spotify ID for the show. copyrights : List[Dict] The copyright statements of the show. description : :class:`str` The show description. languages : :class:`str` The languages that show is available to listen. duration : int The show...
62599098283ffb24f3cf5659
class UserDatabase(ed.Database): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> ed.Database.__init__(self, 'Users', User, **kwargs) <NEW_LINE> <DEDENT> def check_for_ip(self, ip, port): <NEW_LINE> <INDENT> user = self.get_entry(IP=':'.join([ip, port])) <NEW_LINE> return user.UID
The UserDatabase class gives access to the saved information about users in the SQL database
62599098656771135c48af10
class ObnamPlugin(cliapp.Plugin): <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self.app = app <NEW_LINE> <DEDENT> def disable(self): <NEW_LINE> <INDENT> pass
Base class for plugins in Obnam.
62599098c4546d3d9def817b
class RequiredProjectFilter(filters.BaseFilterBackend): <NEW_LINE> <INDENT> def filter_queryset(self, request, queryset, view): <NEW_LINE> <INDENT> r = request.GET or request.POST <NEW_LINE> if not r.get('project_id'): <NEW_LINE> <INDENT> project_ids = [ str(p.id) for p in models.Project.objects.get_objects( request.us...
Filter that only allows users to see their own objects.
625990987cff6e4e811b7804
class CachedStream(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def from_stream(stream): <NEW_LINE> <INDENT> if stream.id not in stream_cache: <NEW_LINE> <INDENT> s = CachedStream() <NEW_LINE> s.id = stream.id <NEW_LINE> s.name = stream.name <NEW_LINE> s.parameters = [] <NEW_LINE> for p in stream.parameters: <...
Object to hold a cached version of the Stream DB object
62599098be7bc26dc9252d36
class BaseBranchOperator(BaseOperator, SkipMixin): <NEW_LINE> <INDENT> def choose_branch(self, context: Dict) -> Union[str, Iterable[str]]: <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def execute(self, context: Dict): <NEW_LINE> <INDENT> branches_to_execute = self.choose_branch(context) <NEW_LINE>...
This is a base class for creating operators with branching functionality, similarly to BranchPythonOperator. Users should subclass this operator and implement the function `choose_branch(self, context)`. This should run whatever business logic is needed to determine the branch, and return either the task_id for a sing...
62599098dc8b845886d5537d
class LoggerPipe(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, logger, level, pipe_out): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.logger = logger <NEW_LINE> self.level = level <NEW_LINE> self.pipe_out = pipe_out <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> self.condition = t...
Monitors an external program's output and sends it to a logger.
62599098c4546d3d9def817e
class b2Sweep(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def Advance(self, alpha): <NEW_LINE> <INDENT> return _Box2D.b2Sweep_Advance(self, alpha) <NEW_LINE> <DEDENT> def Normalize(self):...
This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may no coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.
625990985fdd1c0f98e5fd3b
class KeystoneClient(BaseRelationClient): <NEW_LINE> <INDENT> mandatory_fields = [ "host", "port", "user_domain_name", "project_domain_name", "username", "password", "service", "keystone_db_password", "region_id", "admin_username", "admin_password", "admin_project_name", ] <NEW_LINE> def __init__(self, charm: ops.charm...
Requires side of a Keystone Endpoint
6259909850812a4eaa621aaa
class TestAddOn(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 testAddOn(self): <NEW_LINE> <INDENT> model = pyacp.models.add_on.AddOn()
AddOn unit test stubs
62599098091ae356687069fa
class Attack(GenericUnitCommand): <NEW_LINE> <INDENT> def __init__(self, unit, target): <NEW_LINE> <INDENT> super(Attack, self).__init__(unit, "user_attack", target)
Command class that triggers attack @param unit: Instance of Unit @param target: Instance of Target
6259909850812a4eaa621aab
class Label(Stmt): <NEW_LINE> <INDENT> def __init__(self, value: str): <NEW_LINE> <INDENT> Stmt.__init__(self) <NEW_LINE> self.value = value
Label statement
62599098d8ef3951e32c8d41
class EurostatReader(_BaseReader): <NEW_LINE> <INDENT> _URL = "http://ec.europa.eu/eurostat/SDMX/diss-web/rest" <NEW_LINE> @property <NEW_LINE> def url(self): <NEW_LINE> <INDENT> if not isinstance(self.symbols, string_types): <NEW_LINE> <INDENT> raise ValueError("data name must be string") <NEW_LINE> <DEDENT> q = "{0}/...
Get data for the given name from Eurostat.
62599098adb09d7d5dc0c324
class LeafDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> serializer_class = LeafSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Leaf.objects.filter(owner=self.request.user)
Leaf Detail class
62599098c4546d3d9def8180
class GELLUS(ColumnCorpus): <NEW_LINE> <INDENT> def __init__(self, base_path: Union[str, Path] = None, in_memory: bool = True): <NEW_LINE> <INDENT> if type(base_path) == str: <NEW_LINE> <INDENT> base_path: Path = Path(base_path) <NEW_LINE> <DEDENT> columns = {0: "text", 1: "ner"} <NEW_LINE> dataset_name = self.__class_...
Original Gellus corpus containing cell line annotations. For further information, see Kaewphan et al.: Cell line name recognition in support of the identification of synthetic lethality in cancer from text https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4708107/
62599098283ffb24f3cf5665
class MediaType(APIBase): <NEW_LINE> <INDENT> base = wtypes.text <NEW_LINE> type = wtypes.text <NEW_LINE> def __init__(self, base, type): <NEW_LINE> <INDENT> self.base = base <NEW_LINE> self.type = type
A media type representation.
62599098adb09d7d5dc0c326
class restPlaylist(Resource): <NEW_LINE> <INDENT> def get(self, playlist_id): <NEW_LINE> <INDENT> parser = reqparse.RequestParser() <NEW_LINE> parser.add_argument('rate', type=int, help='Rate to charge for this resource') <NEW_LINE> args = parser.parse_args() <NEW_LINE> pl = Playlist.query.get(playlist_id) <NEW_LINE> d...
Manage playlist
625990983617ad0b5ee07f20
class Test_Function(unittest.TestCase): <NEW_LINE> <INDENT> def test_00_Function(self): <NEW_LINE> <INDENT> tests = ( (1, 1), ('2', 2), ('3', '4'), (10, 11), (100, 1000), ) <NEW_LINE> ahk.start() <NEW_LINE> ahk.ready() <NEW_LINE> add = ahk.Function('add', int, '(x, y)', 'return x + y') <NEW_LINE> for x, y in tests: <NE...
Test ahk function wrapper object.
62599098091ae35668706a00