code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ContentCleanUpPlugin(BasePlugin): <NEW_LINE> <INDENT> def html_before_write(self, book, chapter): <NEW_LINE> <INDENT> if chapter.get_type() != ebooklib.ITEM_DOCUMENT or isinstance(chapter, ebooklib.epub.EpubNav): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> tags_allowed_to_be_empty = config.get_configurati... | Simple writer plugin that cleans up content. The intention is to remove not necessary
tags, styles attributes perhaps and some other small things | 62598f82379a373c97d98a6c |
class RequestBodySizeLimiter(base.Middleware): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(RequestBodySizeLimiter, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> @webob.dec.wsgify(RequestClass=wsgi.Request) <NEW_LINE> def __call__(self, req): <NEW_LINE> <INDENT> if req.conten... | Limit the size of incoming requests. | 62598f828c3a8732951f5fa2 |
class StlMalformedLineException(Exception): <NEW_LINE> <INDENT> pass | Exception class for malformed lines in the STL file being read. | 62598f8238b623060ffa8af1 |
class DeleteContextOperator(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "mesh.delete_context" <NEW_LINE> bl_label = "Delete Context Operator" <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> isCorrect= context.active_object is not None <NEW_LINE> return isCorrect <NEW_LINE> <DEDE... | Tooltip | 62598f821d351010ab8f3598 |
class IImioMediaLayer(IDefaultPloneLayer): <NEW_LINE> <INDENT> pass | Marker interface that defines a Zope 3 browser layer. | 62598f82c432627299fa2a29 |
class FeatureFunc: <NEW_LINE> <INDENT> def __init__(self, expression, args, extra_env=None): <NEW_LINE> <INDENT> self.expression = expression <NEW_LINE> self.args = args <NEW_LINE> self.extra_env = dict(extra_env or {}) <NEW_LINE> self.func = make_lambda(ast.parse(expression, mode="eval"), [name for name, _ in args], s... | Parameters
----------
expression : str
An expression string
args : List[Tuple[str, Orange.data.Variable]]
A list of (`name`, `variable`) tuples where `name` is the name of
a variable as used in `expression`, and `variable` is the variable
instance used to extract the corresponding column/value from a
... | 62598f828da39b475be02c40 |
class APIError(Error): <NEW_LINE> <INDENT> pass | Problem with interfacing with rules of the API | 62598f82009cb60464d00f88 |
class ProcessError(Error): <NEW_LINE> <INDENT> pass | Error in an external process. | 62598f823c8af77a43b67c61 |
@objective_doc_templater() <NEW_LINE> class sparse_group_lasso_dual(sparse_group_lasso): <NEW_LINE> <INDENT> r <NEW_LINE> objective_template = r"""{\cal D}^{group sparse}(%(var)s)""" <NEW_LINE> objective_vars = seminorm.objective_vars.copy() <NEW_LINE> @property <NEW_LINE> def base_conjugate(self): <NEW_LINE> <INDENT> ... | The dual of the slope penalty:math:`\ell_{\infty}` norm | 62598f823eb6a72ae038a092 |
class GithubClient: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.api_token = os.environ[GITHUB_API_TOKEN_ENV_VAR] <NEW_LINE> <DEDENT> def _call_api(self, verb, url, check=True, **request_kwargs): <NEW_LINE> <INDENT> api = 'https://api.github.com{}'.format(url) <NEW_LINE> auth_headers = {'Authorizati... | Utility client for accessing Github API | 62598f82d99f1b3c44d05109 |
class Meta(Command): <NEW_LINE> <INDENT> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> super().__init__(*args, **kw) <NEW_LINE> self.scanner = images.ImageScanner(DisabledCache()) <NEW_LINE> <DEDENT> def edit(self, fname: str) -> subprocess.CompletedProcess: <NEW_LINE> <INDENT> settings_dict = self.settings.as_d... | Edit metadata for a file | 62598f8276d4e153a661c66f |
class FlattenSingletonVecEnv(VecEnvWrapper): <NEW_LINE> <INDENT> def __init__(self, venv): <NEW_LINE> <INDENT> assert venv.num_agents == 1 <NEW_LINE> super().__init__(venv) <NEW_LINE> self.observation_space = venv.observation_space.spaces[0] <NEW_LINE> self.action_space = venv.action_space.spaces[0] <NEW_LINE> <DEDENT>... | Adapts a single-agent VecMultiEnv into a standard Baselines VecEnv.
This is typically used after first applying CurryVecEnv until there is only one agent left. | 62598f82097d151d1a2c0a80 |
class TimeAggregation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> COUNT = "Count" <NEW_LINE> AVERAGE = "Average" <NEW_LINE> MINIMUM = "Minimum" <NEW_LINE> MAXIMUM = "Maximum" <NEW_LINE> TOTAL = "Total" | Aggregation type
| 62598f823eb6a72ae038a093 |
class XZPlane(Plane): <NEW_LINE> <INDENT> plane_type = 'xz-plane' | The xz plane in Cartesian space.
See :class:`GeometricObject` for a description of the parameters. | 62598f82596a8972361276cd |
class S3OrgAuthModel(S3Model): <NEW_LINE> <INDENT> names = ["pr_delegation"] <NEW_LINE> def model(self): <NEW_LINE> <INDENT> gtable = current.auth.settings.table_group <NEW_LINE> tablename = "pr_delegation" <NEW_LINE> self.define_table(tablename, self.pr_role_id(), Field("group_id", gtable, ondelete="CASCADE"), *s3_met... | Organisation-based Authorization Model | 62598f82be383301e0253256 |
class Depends(object): <NEW_LINE> <INDENT> dependency_dict = defaultdict(lambda: defaultdict(set)) <NEW_LINE> def __init__(self, *dependencies, **kwargs): <NEW_LINE> <INDENT> log.trace( 'Depends decorator instantiated with dep list of {0}'.format( dependencies ) ) <NEW_LINE> self.dependencies = dependencies <NEW_LINE> ... | This decorator will check the module when it is loaded and check that the
dependencies passed in are in the globals of the module. If not, it will
cause the function to be unloaded (or replaced) | 62598f8273bcbd0ca4bc9cad |
class WechatRobotMpsChatDB(Base): <NEW_LINE> <INDENT> def insert(self, obj = {}): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def update(self, id, obj = {}): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def delete(self, id): <NEW_LINE> <INDENT> raise NotImplementedError | wechat_robot_mps_chat data object | 62598f824e696a045264db2f |
class TestMixin(LeetcodeTest, _Mixin): <NEW_LINE> <INDENT> def not_active_test_format_listnode(self): <NEW_LINE> <INDENT> n2 = ListNode(2) <NEW_LINE> n4 = ListNode(4) <NEW_LINE> n3 = ListNode(3) <NEW_LINE> n2.next = n4 <NEW_LINE> n4.next = n3 <NEW_LINE> ListNode.print_list_node(n2) | Test the mixin utilities used in the tests | 62598f8230c21e258be98265 |
class TestStatus: <NEW_LINE> <INDENT> def __init__(self, test_manager, returncode, stdout, stderr, directory, inputs, input_filenames): <NEW_LINE> <INDENT> self.test_manager = test_manager <NEW_LINE> self.returncode = returncode <NEW_LINE> if type(stdout) is not str: <NEW_LINE> <INDENT> if sys.version_info[0] == 2: <NE... | A struct for holding run status of a test case. | 62598f82d6c5a102081e1ba5 |
@thermal_json_object('switch.power_cycling') <NEW_LINE> class SwitchPolicyAction(ThermalPolicyActionBase): <NEW_LINE> <INDENT> def execute(self, thermal_info_dict): <NEW_LINE> <INDENT> thermal_overload_position_path = '/tmp/thermal_overload_position' <NEW_LINE> thermal_overload_position = APIHelper().read_one_line_file... | Base class for thermal action. Once all thermal conditions in a thermal policy are matched,
all predefined thermal action will be executed. | 62598f8207d97122c42166ff |
class Shapes: <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> self.placeholder_map: Dict[str, Union[Placeholder, Tuple[int, ...]]] = {} <NEW_LINE> self.__initialized = True <NEW_LINE> <DEDENT> def __getattr__( self, name: str ) -> Union[ Placeholder, Tuple[int, ...], str, dict, NoneType, ModuleType,... | An instance of this object acts as a proxy for this module. | 62598f8296565a6dacd2cca6 |
class VRF_Base: <NEW_LINE> <INDENT> def __init__(self, running_config): <NEW_LINE> <INDENT> self.config = running_config <NEW_LINE> if 'vrfs' in self.config['System'].keys(): <NEW_LINE> <INDENT> self.vrfs = self.config['System']['vrfs'] <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.vrfs = {} <NEW_LINE> <DEDENT> <D... | VRF implementation for fimrware earlier than 10.04.1000 | 62598f8282261d6c5272fc02 |
class MqttServiceClient: <NEW_LINE> <INDENT> def __init__(self, mqtt_connection: mqtt.Connection): <NEW_LINE> <INDENT> self._mqtt_connection = mqtt_connection <NEW_LINE> <DEDENT> @property <NEW_LINE> def mqtt_connection(self) -> mqtt.Connection: <NEW_LINE> <INDENT> return self._mqtt_connection <NEW_LINE> <DEDENT> def u... | Base class for an AWS MQTT Service Client
Args:
mqtt_connection: MQTT connection to use | 62598f828c3a8732951f5fa4 |
class HelloSerializer(serializers.Serializer): <NEW_LINE> <INDENT> name = serializers.CharField(max_length=25) <NEW_LINE> last_name = serializers.CharField(max_length=20) | Serializes a name field for testing our APIView | 62598f820fa83653e46f494c |
class CrawlerProcess(CrawlerRunner): <NEW_LINE> <INDENT> def __init__(self, settings): <NEW_LINE> <INDENT> super(CrawlerProcess, self).__init__(settings) <NEW_LINE> install_shutdown_handlers(self._signal_shutdown) <NEW_LINE> self.stopping = False <NEW_LINE> <DEDENT> def _signal_shutdown(self, signum, _): <NEW_LINE> <IN... | A class to run multiple scrapy crawlers in a process simultaneously | 62598f823eb6a72ae038a094 |
class MovingAverageCrossStrategy(Strategy): <NEW_LINE> <INDENT> def __init__(self, short_window=100, long_window=400, bars=None, events=None): <NEW_LINE> <INDENT> self.bars = bars <NEW_LINE> self.symbol_list = bars.symbol_list <NEW_LINE> self.events = events <NEW_LINE> self.short_window = short_window <NEW_LINE> self.l... | Carries out a basic Moving Average Crossover strategy with a
short/long simple weighted moving average. Default short/long
windows are 100/400 periods respectively. | 62598f8245492302aabfbf3b |
class CrawlerRunner(object): <NEW_LINE> <INDENT> crawlers = property( lambda self: self._crawlers, doc="Set of :class:`crawlers <scrapy.crawler.Crawler>` started by " ":meth:`crawl` and managed by this class." ) <NEW_LINE> def __init__(self, settings=None): <NEW_LINE> <INDENT> if isinstance(settings, dict) or settings ... | This is a convenient helper class that keeps track of, manages and runs
crawlers inside an already setup Twisted `reactor`_.
The CrawlerRunner object must be instantiated with a
:class:`~scrapy.settings.Settings` object.
This class shouldn't be needed (since Scrapy is responsible of using it
accordingly) unless writi... | 62598f821f5feb6acb162691 |
class _BasePredictor(object): <NEW_LINE> <INDENT> def __init__(self, prediction_model, preprocessor): <NEW_LINE> <INDENT> self._is_trained = False <NEW_LINE> self._prediction_model = prediction_model <NEW_LINE> self._preprocessor = preprocessor <NEW_LINE> self._pipeline = Pipeline([('preprocess', preprocesso... | Provides shared functionally used by OutcomePredictor and ActualTreatmentPredictor | 62598f828e05c05ec3f6eb76 |
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE... | a kNN classifier with L2 distance | 62598f8276d4e153a661c671 |
class TraitsUIView(WorkbenchView): <NEW_LINE> <INDENT> name = '' <NEW_LINE> obj = Instance(HasTraits) <NEW_LINE> view = Any <NEW_LINE> def create_control(self, parent): <NEW_LINE> <INDENT> ui = self.obj.edit_traits(parent=parent, kind='subpanel', view=self.view) <NEW_LINE> return ui.control | Workbench view of an object using traits UI.
| 62598f82cad5886f8bdc4d83 |
class CharmSwiftProxy(CharmBase): <NEW_LINE> <INDENT> charm_name = 'swift-proxy' <NEW_LINE> charm_rev = 25 <NEW_LINE> display_name = 'Swift Proxy' <NEW_LINE> display_priority = DisplayPriorities.Storage <NEW_LINE> related = [ ('keystone:identity-service', 'swift-proxy:identity-service'), ('glance:object-store', 'swift-... | swift directives | 62598f8226238365f5fac5cc |
class DiskDetail(mixins.RetrieveModelMixin, mixins.UpdateModelMixin, mixins.DestroyModelMixin, generics.GenericAPIView): <NEW_LINE> <INDENT> queryset = Disk.objects.all() <NEW_LINE> serializer_class = DiskSerializer <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> return self.retrieve(request, *a... | Retrieve, update or delete a code snippet. | 62598f82498bea3a75a57581 |
class RequestedTokenCancelledType_(SamlBase): <NEW_LINE> <INDENT> c_tag = 'RequestedTokenCancelledType' <NEW_LINE> c_namespace = NAMESPACE <NEW_LINE> c_children = SamlBase.c_children.copy() <NEW_LINE> c_attributes = SamlBase.c_attributes.copy() <NEW_LINE> c_child_order = SamlBase.c_child_order[:] <NEW_LINE> c_cardinali... | The http://docs.oasis-open.org/ws-sx/ws-trust/200512/:RequestedTokenCancelledType element | 62598f8273bcbd0ca4bc9caf |
class TestDataRestoredOnTearDownIfSerializedRollback(TestSerializedContentMockMixin, TransactionTestCase): <NEW_LINE> <INDENT> available_apps = ['test_utils'] <NEW_LINE> _next_serialized_rollback = True <NEW_LINE> initial_data_migration = '[{"model": "test_utils.car", "pk": 666, "fields": {"name": "K 2000"}}]' <NEW_LIN... | Initial data is recreated in TransactionTestCase._fixture_teardown()
after the database is flushed so it's available in next test. | 62598f82507cdc57c63a47ea |
class Weapon(object): <NEW_LINE> <INDENT> def __init__(self, name="sword", weaponType="sword", numDice=1, diceSides=3, modifier=0): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> self.__weaponType = weaponType <NEW_LINE> self.__numDice = numDice <NEW_LINE> self.__diceSides = diceSides <NEW_LINE> self.__modifier = mo... | Object Class Weapon | 62598f8230c21e258be98267 |
class Callback(Registrable): <NEW_LINE> <INDENT> def __init__(self, config: DictConfig): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.config = config <NEW_LINE> <DEDENT> @handle_event(Events.INITIALIZE) <NEW_LINE> def on_initialize(self, trainer: Trainer) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> ... | Base class for callbacks that want to record values, dynamically change learner params, etc.
It is the programer's responsibility to handler distributed setup here.
Attributes:
trainer.__master: bool (default = True) It is used in distributed training to identify the master | 62598f8271ff763f4b5e71cb |
class AnswersFromTextResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { "answers": {"key": "answers", "type": "[TextAnswer]"}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(AnswersFromTextResult, self).__init__(**kwargs) <NEW_LINE> self.answers = kwargs.get("answers", None... | Represents the answer results.
:ivar answers: Represents the answer results.
:vartype answers: list[~azure.ai.language.questionanswering.models.TextAnswer] | 62598f82a4f1c619b294e04b |
class MPMenuGeneric(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def find_selected(self, event): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> def _append(self, menu): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "MPMen... | a MP menu separator | 62598f82bde94217f3707395 |
class ContainerNetworkInterface(SubResource): <NEW_LINE> <INDENT> _validation = { 'type': {'readonly': True}, 'etag': {'readonly': True}, 'container_network_interface_configuration': {'readonly': True}, 'ip_configurations': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'i... | Container network interface child resource.
Variables are only populated by the server, and will be ignored when sending a request.
:param id: Resource ID.
:type id: str
:param name: The name of the resource. This name can be used to access the resource.
:type name: str
:ivar type: Sub Resource type.
:vartype type: s... | 62598f826e29344779b000c2 |
class DataAugmentation(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.input = None <NEW_LINE> self.label = None <NEW_LINE> <DEDENT> def set_dataset_nodes(self, input_node: str, label_node: str = None): <NEW_LINE> <INDENT> self.input = input_node <NEW_LINE> self.label = label_node | Represents a general data augmentation for supervised learning. | 62598f828c3a8732951f5fa6 |
class AccountLocked(AuthenticationError): <NEW_LINE> <INDENT> pass | Exception raised when account is locked
| 62598f82004d5f362081ed2a |
class TorDatabase(Database): <NEW_LINE> <INDENT> UPDATE_URL = 'https://ipdb-d6756.firebaseio.com/database/tor.json' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.UPDATE_DELAY = 60*60 <NEW_LINE> <DEDENT> async def start(self): <NEW_LINE> <INDENT> self.logger.info("Initalizing tor ... | class to manage the tor node database
usage:
tordb = TorDatabase()
tordb.auto_update() | 62598f82b57a9660fecd14dc |
class TestParseResultsAsserts: <NEW_LINE> <INDENT> def assertParseResultsEquals( self, result, expected_list=None, expected_dict=None, msg=None ): <NEW_LINE> <INDENT> if expected_list is not None: <NEW_LINE> <INDENT> self.assertEqual(expected_list, result.asList(), msg=msg) <NEW_LINE> <DEDENT> if expected_dict is not N... | A mixin class to add parse results assertion methods to normal unittest.TestCase classes. | 62598f828e71fb1e983bb519 |
class _Convertable(object): <NEW_LINE> <INDENT> def format(self, fmt): <NEW_LINE> <INDENT> if fmt == 'txt': <NEW_LINE> <INDENT> if hasattr(self, 'text'): <NEW_LINE> <INDENT> return self.text() <NEW_LINE> <DEDENT> raise NotImplementedError('no text method found!') <NEW_LINE> <DEDENT> return str(self) | Mixin adding a shortcut to clld.lib.bibutils.convert as method. | 62598f8215fb5d323ce7e78a |
class Update(View): <NEW_LINE> <INDENT> def post(self,request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> if not user.is_authenticated: <NEW_LINE> <INDENT> return JsonResponse({'status':0,'msg':'请先登陆'}) <NEW_LINE> <DEDENT> sku_id = request.POST.get('sku_id') <NEW_LINE> num = request.POST.get('num') <NEW_LINE> ... | 修改购物车中的数据 | 62598f8215baa723494619dd |
class TestGetDocxTablesRequest(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 testGetDocxTablesRequest(self): <NEW_LINE> <INDENT> pass | GetDocxTablesRequest unit test stubs | 62598f828da39b475be02c45 |
class User(object): <NEW_LINE> <INDENT> def __init__(self,name,username,password,user_type="user",points=0,accuracy=0.0): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.username = username <NEW_LINE> self.user_type = user_type <NEW_LINE> self.password = password <NEW_LINE> self.points = points <NEW_LINE> self.acc... | Implements user account class | 62598f82d10714528d69d92f |
class ExtractDiag(Op): <NEW_LINE> <INDENT> __props__ = ("view",) <NEW_LINE> def __init__(self, view=False): <NEW_LINE> <INDENT> self.view = view <NEW_LINE> if self.view: <NEW_LINE> <INDENT> self.view_map = {0: [0]} <NEW_LINE> <DEDENT> <DEDENT> def make_node(self, _x): <NEW_LINE> <INDENT> if not isinstance(_x, theano.Va... | Return the diagonal of a matrix.
:note: work on the GPU. | 62598f823eb6a72ae038a097 |
class HeaderAnalizer(object): <NEW_LINE> <INDENT> from_emails = [] <NEW_LINE> def __init__(self, message_string): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.message = m_string(message_string) <NEW_LINE> <DEDENT> except: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.orig_date = date(... | Receive a Mail message and analyze the Trace headers | 62598f82b57a9660fecd14dd |
class SpotCheapestItem(): <NEW_LINE> <INDENT> def __init__(self, instance_type, product_description, region, zone, price ): <NEW_LINE> <INDENT> self.instance_type = instance_type <NEW_LINE> self.product_description = product_description <NEW_LINE> self.region = region <NEW_LINE> self.zone = zone <NEW_LINE> self.price =... | Contains all attributes to describe a cheapest spot price | 62598f829b70327d1c57e7ff |
class FacetGrid(sns.FacetGrid): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> my_axes = kwargs.pop('axes', None) <NEW_LINE> self._tight_layout = kwargs.pop('tight_layout', True) <NEW_LINE> super(self.__class__, self).__init__(*args, **kwargs) <NEW_LINE> if my_axes is not None: <NEW_LINE> ... | interface to seaborn FacetGrid with
user defined axes | 62598f8216aa5153ce3fff61 |
class NormalNaturalThroughTheta(NormalTheta): <NEW_LINE> <INDENT> _instances = [] <NEW_LINE> def __new__(cls, mu_indices=None, var_indices=None): <NEW_LINE> <INDENT> if cls._instances: <NEW_LINE> <INDENT> cls._instances[:] = [instance for instance in cls._instances if instance()] <NEW_LINE> for instance in cls._instanc... | Do not use, not officially supported! | 62598f8210dbd63aa1c70612 |
class RegionNotFoundException(OsservaPrezziException): <NEW_LINE> <INDENT> pass | RegionNotFoundException. | 62598f82711fe17d825e0149 |
class SimpleTest(TestCase): <NEW_LINE> <INDENT> def test_basic_addition(self): <NEW_LINE> <INDENT> self.failUnlessEqual(1 + 1, 2) | A simple test for demonstration purposes. | 62598f8296565a6dacd2cca8 |
class Bird(Benchmark): <NEW_LINE> <INDENT> def __init__(self, dimensions=2): <NEW_LINE> <INDENT> Benchmark.__init__(self, dimensions) <NEW_LINE> self.bounds = zip([-2.0*pi] * self.dimensions, [2.0*pi] * self.dimensions) <NEW_LINE> self.global_optimum = ([4.701055751981055 , 3.152946019601391], [-1.582142172055011, -3.1... | Bird test objective function.
This class defines the Bird global optimization problem. This
is a multimodal minimization problem defined as follows:
.. math::
f_{\text{Bird}}(\mathbf{x}) = \left(x_1 - x_2\right)^{2} + e^{\left[1 - \sin\left(x_1\right) \right]^{2}} \cos\left(x_2\right) + e^{\left[1 - \cos\left(x... | 62598f82bde94217f3707396 |
class SubscriptionGraphDockWidget(cuegui.AbstractDockWidget.AbstractDockWidget): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> cuegui.AbstractDockWidget.AbstractDockWidget.__init__(self, parent, PLUGIN_NAME) <NEW_LINE> self.__splitter = QtWidgets.QSplitter(QtCore.Qt.Horizontal) <NEW_LINE> self.lay... | Containing widget for this plugin. | 62598f828e71fb1e983bb51b |
class Singleton(object): <NEW_LINE> <INDENT> def __new__(cls, *args, **kwds): <NEW_LINE> <INDENT> it = cls.__dict__.get("__it__") <NEW_LINE> if it is not None: <NEW_LINE> <INDENT> return it <NEW_LINE> <DEDENT> cls.__it__ = it = object.__new__(cls) <NEW_LINE> it.init(*args, **kwds) <NEW_LINE> return it <NEW_LINE> <DEDEN... | Base class for singleton classes.
Taken from <http://www.python.org/2.2.3/descrintro.html>. I added the
definition of __init__. | 62598f82442bda511e95bebc |
class MockNetworkManager: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.request_url = None <NEW_LINE> <DEDENT> def get(self, request: QNetworkRequest): <NEW_LINE> <INDENT> self.request_url = request.url().url() | A mock of the Qt NetworkManager. Does not actually make any requests, but allows the
inspection of what those requests would have been. | 62598f821f5feb6acb162695 |
class WavFileWrite: <NEW_LINE> <INDENT> def __init__(self, fileName, sampleRate, sampleWidth, channels, blocksize): <NEW_LINE> <INDENT> self.fileName = fileName <NEW_LINE> self.sampleRate = sampleRate <NEW_LINE> self.sampleWidth = sampleWidth <NEW_LINE> self.channels = channels <NEW_LINE> self.blocksize = blocksize <NE... | This class is used to write RIFF-WAVE-files when recording with SNARE. It supports 16bit or 24bit but only one
channel. It opens (and if necessary overwrites) a wav file, writes a header (initially with a filesize of zero)
and then is ready to receive blockwise updates of recorded samples to append to the file. On clos... | 62598f82a17c0f6771d5bca5 |
class SQLPhotoViews(PSQL): <NEW_LINE> <INDENT> pass | PhotoViews related SQL attributes | 62598f82b830903b9686e1a2 |
class vartank(watertank): <NEW_LINE> <INDENT> def __init__(self, name, hvfxn, maxvol, initvol, area = None): <NEW_LINE> <INDENT> self.maxvol = maxvol <NEW_LINE> self.hvfxn = hvfxn <NEW_LINE> watertank.__init__(self, name, area, hvfxn(self.maxvol).item(), hvfxn(initvol).item()) <NEW_LINE> self.volume = [initvol] <NEW_LI... | Child class of WATERTANK that allows for variable tank area. Representation primarily in volume
rather than the tank height.
INPUTS
name : tank identifier, string
hvfxn : lambda function for the tank height in terms of volume
maxvol : maximum volume of tank [m^3]
initvol : initial tank volume [m^3] | 62598f82d99f1b3c44d0510f |
class ScheduleCreateVolumeTask(flow_utils.CinderTask): <NEW_LINE> <INDENT> FAILURE_TOPIC = "scheduler.create_volume" <NEW_LINE> def __init__(self, db_api, driver_api, **kwargs): <NEW_LINE> <INDENT> super(ScheduleCreateVolumeTask, self).__init__(addons=[ACTION], **kwargs) <NEW_LINE> self.db_api = db_api <NEW_LINE> self.... | Activates a scheduler driver and handles any subsequent failures.
Notification strategy: on failure the scheduler rpc notifier will be
activated and a notification will be emitted indicating what errored,
the reason, and the request (and misc. other data) that caused the error
to be triggered.
Reversion strategy: N/A | 62598f826aa9bd52df0d493d |
class INavigation(IViewletManager): <NEW_LINE> <INDENT> pass | A viewlet manager for navigation dropdowns
| 62598f82f7d966606f747a49 |
class NoProjectFilesFoundError(SublpException): <NEW_LINE> <INDENT> pass | Raised by sublp functions when attempting to open a projects file
(based on a directory which should contain one or more projects files)
but no projects files were found. | 62598f82c432627299fa2a30 |
class PostAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = [ "external_id", "facebook", "created_at", "post_type", "likes", "comments", "shares", "impressions_unique", ] <NEW_LINE> list_display_links = ["external_id"] <NEW_LINE> list_filter = ["facebook", "post_type"] <NEW_LINE> date_hierarchy = "created_at" | List for choosing existing post data to edit. | 62598f82507cdc57c63a47ef |
class Raw(str): <NEW_LINE> <INDENT> def __init__(self, string): <NEW_LINE> <INDENT> str.__init__(string) | This class should be used to pass names of JavaScript functions,
variables or even functions declarations to BootstrapTable.
Using this container for string allows you to pass information,
that this string should be treated slightly different than others
- it should be integrated into response without quotes. | 62598f8221a7993f00c659d4 |
class OneSensorCollectedDataUserAPIView(generics.ListAPIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, ) <NEW_LINE> serializer_class = serializers.SensorCollectedDataModelSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> user = self.request.user <NEW_LINE> try: <NEW_LINE> <INDENT> cur... | Class Based View for RETRIEVE serialized SensorCollectedData objects for one related Sensor by current user | 62598f829b70327d1c57e801 |
class RingEntityMixin: <NEW_LINE> <INDENT> def __init__(self, config_entry_id, device): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._config_entry_id = config_entry_id <NEW_LINE> self._device = device <NEW_LINE> <DEDENT> async def async_added_to_hass(self): <NEW_LINE> <INDENT> self.ring_objects["device_data"]... | Base implementation for Ring device. | 62598f8223e79379d538bf5c |
class PriorityQueue: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._queue = [] <NEW_LINE> self._index = 0 <NEW_LINE> <DEDENT> def insert(self, item, priority): <NEW_LINE> <INDENT> heapq.heappush(self._queue, (priority, self._index, item)) <NEW_LINE> self._index += 1 <NEW_LINE> <DEDENT> def pop(self):... | class implementation of priority queue using heapq module | 62598f8296565a6dacd2cca9 |
class AssignTeamView(UpdateView): <NEW_LINE> <INDENT> form_class = AssignTeamForm <NEW_LINE> template_name = "team/team_detail.html" <NEW_LINE> def get_object(self, queryset=None): <NEW_LINE> <INDENT> obj = super(AssignTeamView, self).get_object(queryset=queryset) <NEW_LINE> if not can_manage_object(obj, self.request):... | Subclass this view to set a team for your object | 62598f82b5575c28eb7129f8 |
class Player: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.score = 0 <NEW_LINE> self.boat = None <NEW_LINE> self.fishes_density = {} <NEW_LINE> self.fishes_cluster = {} | Abstraction of a player. Can have or not a boat and achieves a score. | 62598f8230c21e258be9826c |
class Waiter(object): <NEW_LINE> <INDENT> def _wait( self, item_id, wait_status, get_status, delay=1, max_wait=100, wait_cb=None, wait_until_status=False): <NEW_LINE> <INDENT> status, progress = get_status(self, item_id) <NEW_LINE> if wait_cb: <NEW_LINE> <INDENT> wait_gen = wait_cb(max_wait // delay) <NEW_LINE> wait_ge... | Use this class to provide blocking API methods - DEPRECATED FROM 0.16 | 62598f82baa26c4b54d4ed15 |
class gl_item_factory(object): <NEW_LINE> <INDENT> def create_function(self, element, context): <NEW_LINE> <INDENT> return gl_function(element, context) <NEW_LINE> <DEDENT> def create_type(self, element, context, category): <NEW_LINE> <INDENT> return gl_type(element, context, category) <NEW_LINE> <DEDENT> def create_en... | Factory to create objects derived from gl_item. | 62598f828a43f66fc4bf1be4 |
class ImageCodeView(View): <NEW_LINE> <INDENT> def get(self,request,uuid): <NEW_LINE> <INDENT> hs,text,image=captcha.generate_captcha() <NEW_LINE> redis_conn=get_redis_connection("verify_code") <NEW_LINE> redis_conn.setex('img_%s'%uuid,300,text) <NEW_LINE> return HttpResponse(image,content_type='img/jpg') | 图像验证码 | 62598f82d99f1b3c44d05110 |
@add_slots <NEW_LINE> @dataclass(frozen=True) <NEW_LINE> class NotEqual(BaseCompOp, _BaseOneTokenOp): <NEW_LINE> <INDENT> value: str = "!=" <NEW_LINE> whitespace_before: BaseParenthesizableWhitespace = SimpleWhitespace.field(" ") <NEW_LINE> whitespace_after: BaseParenthesizableWhitespace = SimpleWhitespace.field(" ") <... | A comparison operator that can be used in a :class:`Comparison` expression.
This node defines a static value for convenience, but in reality due to
PEP 401 it can be one of two values, both of which should be a
:class:`NotEqual` :class:`Comparison` operator. | 62598f821d351010ab8f35a0 |
class ActiveToken(models.Model): <NEW_LINE> <INDENT> timeStamp = models.DateTimeField('Time Stamp', null=False, blank=False) <NEW_LINE> token = models.OneToOneField(Token, verbose_name='Token') | This are the tokens that are currently being in use to upload positions. | 62598f8245492302aabfbf41 |
class CYXXYPowGate(cirq.EigenGate, cirq.ThreeQubitGate): <NEW_LINE> <INDENT> def _apply_unitary_(self, args: cirq.ApplyUnitaryArgs ) -> Optional[np.ndarray]: <NEW_LINE> <INDENT> return cirq.apply_unitary( cirq.ControlledGate(common_gates.YXXY**self.exponent), args, default=None) <NEW_LINE> <DEDENT> def _eigen_component... | Controlled YX - XY interaction. | 62598f826fece00bbaccb3eb |
class OpenNebula_3_2_Tests(unittest.TestCase, OpenNebulaCaseMixin): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> OpenNebulaNodeDriver.connectionCls.conn_classes = ( OpenNebula_3_2_MockHttp, OpenNebula_3_2_MockHttp) <NEW_LINE> self.driver = OpenNebulaNodeDriver(*OPENNEBULA_PARAMS + ('3.2',)) <NEW_LINE> <DEDE... | OpenNebula.org test suite for OpenNebula v3.2. | 62598f8230dc7b766599f2bc |
class FeedbackReplyPermission(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return obj.parent.author == request.user or request.user.is_secretary ... | Custom permission to only allow a secretary or the club representative
or author to read the details of a feedbackReply. | 62598f82b830903b9686e1a3 |
class JobType(proto.Enum): <NEW_LINE> <INDENT> JOB_TYPE_UNSPECIFIED = 0 <NEW_LINE> PIPELINE = 1 <NEW_LINE> QUERY = 2 <NEW_LINE> ML_EXTERNAL = 3 | Types of job, which could be specified when using the
reservation. | 62598f82fb3f5b602db47ee2 |
class MethodPropertyMeta(object): <NEW_LINE> <INDENT> def __init__(self, name, xml_attribute, field_type, version, inp_out, is_complex_type): <NEW_LINE> <INDENT> self.__name = name <NEW_LINE> self.__xml_attribute = xml_attribute <NEW_LINE> self.__field_type = field_type <NEW_LINE> self.__version = version <NEW_LINE> se... | This class handles the meta information of the properties of
external method Object. | 62598f826aa9bd52df0d493f |
class NDArrayBackedExtensionBlock(libinternals.NDArrayBackedBlock, EABackedBlock): <NEW_LINE> <INDENT> values: NDArrayBackedExtensionArray <NEW_LINE> @property <NEW_LINE> def is_view(self) -> bool: <NEW_LINE> <INDENT> return self.values._ndarray.base is not None <NEW_LINE> <DEDENT> def setitem(self, indexer, value): <N... | Block backed by an NDArrayBackedExtensionArray | 62598f823eb6a72ae038a09b |
class Sector(): <NEW_LINE> <INDENT> cList = [] <NEW_LINE> params = () <NEW_LINE> def __init__(self, x, y, step, cList, params, finish): <NEW_LINE> <INDENT> self.passed = False <NEW_LINE> self.cList = cList <NEW_LINE> self.params = params <NEW_LINE> self.speed = 1 <NEW_LINE> self.step = step <NEW_LINE> self.xy = (x*step... | Одна клетка сетки | 62598f8263d6d428bbee221c |
class Link(object): <NEW_LINE> <INDENT> SINGLE_VALUED_ATTRS = [ 'rel', 'anchor', 'rev', 'media', 'title', 'type', 'href' ] <NEW_LINE> MULTI_VALUED_ATTRS = [ 'hreflang', 'title*' ] <NEW_LINE> STANDARD_ATTRS = SINGLE_VALUED_ATTRS + MULTI_VALUED_ATTRS <NEW_LINE> def __init__(self, href=None, rel=None, **data): <NEW_LINE>... | Represents a single link | 62598f8273bcbd0ca4bc9cb5 |
class AbstractEdge(object): <NEW_LINE> <INDENT> def __init__(self, node1_id, node2_id, relationship_id, node_pair=None): <NEW_LINE> <INDENT> self.node_pair_id = (node1_id, node2_id) <NEW_LINE> self.node_pair = node_pair <NEW_LINE> self.relationship_id = relationship_id <NEW_LINE> self.relationship = None <NEW_LINE> <DE... | An OBO edge which links two ontology term nodes and contains a relationship type describing now the two nodes are
related. | 62598f82c432627299fa2a32 |
class ServiceHourRidership(Base): <NEW_LINE> <INDENT> __tablename__ = 'service_hour_ridership' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> calendar_year = Column(Integer) <NEW_LINE> created_on = Column(DateTime(timezone=True)) <NEW_LINE> day_of_week = Column(String) <NEW_LINE> is_current = Column(Boole... | Estimated service hour productivity for a type of day (weekday, Saturday, Sunday)
and season. | 62598f82b57a9660fecd14e1 |
class ReCheck(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.result = None <NEW_LINE> <DEDENT> def check(self, pattern, text): <NEW_LINE> <INDENT> self.result = pattern.search(text) <NEW_LINE> return self.result | Helper class. | 62598f82d53ae8145f917ef2 |
class DNaseSample(ATACseqSample): <NEW_LINE> <INDENT> __library__ = "DNase-seq" <NEW_LINE> def __init__(self, series): <NEW_LINE> <INDENT> if not isinstance(series, pd.Series): <NEW_LINE> <INDENT> raise TypeError("Provided object is not a pandas Series.") <NEW_LINE> <DEDENT> super(DNaseSample, self).__init__(series) <N... | Class to model DNase-seq samples based on the ChIPseqSample class.
:param series: Pandas `Series` object.
:type series: pandas.Series | 62598f8221bff66bcd7226cd |
class Primer3Commandline(Application.AbstractCommandline): <NEW_LINE> <INDENT> def __init__(self, cmd = "eprimer3"): <NEW_LINE> <INDENT> Application.AbstractCommandline.__init__(self) <NEW_LINE> self.program_name = cmd <NEW_LINE> self.parameters = [_Option(["-sequence"], ["input"], None, 1, "Sequence to choose... | Commandline object for the Primer3 interface from EMBOSS.
| 62598f82711fe17d825e014d |
class Cosh(UnaryScalarOp): <NEW_LINE> <INDENT> def impl(self, x): <NEW_LINE> <INDENT> x_dtype = str(getattr(x, 'dtype', '')) <NEW_LINE> if x_dtype in ('int8', 'uint8'): <NEW_LINE> <INDENT> return numpy.cosh(x, sig='f') <NEW_LINE> <DEDENT> return numpy.cosh(x) <NEW_LINE> <DEDENT> def grad(self, inputs, gout): <NEW_LINE>... | cosh(x) = (exp(x) + exp(-x)) / 2 | 62598f82d6c5a102081e1bad |
class Output(object): <NEW_LINE> <INDENT> def __init__(self, continuous=False): <NEW_LINE> <INDENT> self._out = '' <NEW_LINE> self._continuous = continuous <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self._out <NEW_LINE> <DEDENT> def output(self, string): <NEW_LINE> <INDENT> self._out += '\n' + st... | Holds the output. | 62598f8215fb5d323ce7e790 |
class OpenStorageClusterPairServicer(object): <NEW_LINE> <INDENT> def Create(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def Insp... | OpenStorageClusterPair service provides the methods to manage a cluster pair
| 62598f82a79ad16197769ac6 |
class Host(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.address='localhost' <NEW_LINE> self.servers=[] <NEW_LINE> <DEDENT> def collect_queues(self,mode): <NEW_LINE> <INDENT> import re <NEW_LINE> from server import Server <NEW_LINE> if isinstance(mode, str)==True: <NEW_LINE> <INDENT> if 'ser... | Computer to run the simulations | 62598f82009cb60464d00f92 |
class AnySymbolRegex(Regex): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> def derive(self, sym): <NEW_LINE> <INDENT> return Epsilon <NEW_LINE> <DEDENT> accepts_empty_string = False <NEW_LINE> alphabet = None <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return "Any" <NEW_LINE> <DEDENT> def __hash__(self): <NEW_LI... | A regular expression that matches ANY symbol (but not the lack of one).
Equivalent to ``.`` in Python's regex notation.
:param sym: The symbol to match. | 62598f8276d4e153a661c678 |
class OffensiveReflexAgent(ReflexCaptureAgent): <NEW_LINE> <INDENT> def getFeatures(self, gameState, action): <NEW_LINE> <INDENT> features = util.Counter() <NEW_LINE> successor = self.getSuccessor(gameState, action) <NEW_LINE> foodList = self.getFood(successor).asList() <NEW_LINE> features['successorScore'] = -len(food... | A reflex agent that seeks food. This is an agent
we give you to get an idea of what an offensive agent might look like,
but it is by no means the best or only way to build an offensive agent. | 62598f82d164cc61758209dd |
class Testinit(unittest.TestCase): <NEW_LINE> <INDENT> def test_init_with_correct_data(self): <NEW_LINE> <INDENT> test_property = Property(12, "Name", correct_data(self)) <NEW_LINE> self.assertEqual(test_property.name, "Name") <NEW_LINE> self.assertEqual(test_property.color, "Color") <NEW_LINE> self.assertEqual(test_pr... | Testing for initalization of Property Class | 62598f821d351010ab8f35a3 |
class GetCharactersCharacterIdMailLabelsForbidden(object): <NEW_LINE> <INDENT> def __init__(self, error=None): <NEW_LINE> <INDENT> self.swagger_types = { 'error': 'str' } <NEW_LINE> self.attribute_map = { 'error': 'error' } <NEW_LINE> self._error = error <NEW_LINE> <DEDENT> @property <NEW_LINE> def error(self): <NEW_LI... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f8263b5f9789fe84bd7 |
class HariKatha(Model): <NEW_LINE> <INDENT> link = TextField(unique=True) <NEW_LINE> title = TextField(unique=True) <NEW_LINE> hits = IntegerField(default=0) <NEW_LINE> indexed = BooleanField(default=0) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> database = DATABASE <NEW_LINE> order_by = ('title',) <NEW_LINE> <DEDENT> @... | HariKatha class for database
Attributes:
link TextField unique
title TextField unique
hits IntegerField default 0
indexed BooleanField default 0
Methods:
create_entry | 62598f82c432627299fa2a34 |
class Skr(American, chinese): <NEW_LINE> <INDENT> def __init__(self, name, sex, age): <NEW_LINE> <INDENT> super(Skr, self).__init__(name, sex, age) | docstring for Skr | 62598f8229b78933be269e0d |
class OpusError(DiscordException): <NEW_LINE> <INDENT> def __init__(self, code): <NEW_LINE> <INDENT> self.code = code <NEW_LINE> msg = _lib.opus_strerror(self.code).decode('utf-8') <NEW_LINE> log.info('"%s" has happened', msg) <NEW_LINE> super().__init__(msg) | An exception that is thrown for libopus related errors.
Attributes
----------
code: :class:`int`
The error code returned. | 62598f824e696a045264db34 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.