code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TweetinteractRule(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.spider = kwargs.get("spider") <NEW_LINE> self.es_client = self.spider.es_client <NEW_LINE> self.weibo_detail_url = kwargs['_source']['url'] <NEW_LINE> self.doc_id = kwargs["_id"] <NEW_LINE> <DEDENT> def err_repor...
微博互动量更新爬虫
62598edc63b5f9789fe836bf
class Client(LoggingClass): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> super(Client, self).__init__() <NEW_LINE> self.config = config <NEW_LINE> self.events = Emitter(spawn_each=True) <NEW_LINE> self.packets = Emitter(spawn_each=True) <NEW_LINE> self.api = APIClient(self.config.token, self) <NE...
Class representing the base entry point that should be used in almost all implementation cases. This class wraps the functionality of both the REST API (`disco.api.client.APIClient`) and the realtime gateway API (`disco.gateway.client.GatewayClient`). Parameters ---------- config : `ClientConfig` Configuration for...
62598edc30bbd72246468187
class WKT(Geometry): <NEW_LINE> <INDENT> value = EAttribute(eType=EString, unique=True, derived=False, changeable=True) <NEW_LINE> def __init__(self, *, value=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> if value is not None: <NEW_LINE> <INDENT> self.value = value
Well-Known Text (see https://en.wikipedia.org/wiki/Well-known_text)
62598edc44b2445a339b5c0c
class MyInstallLib(install_lib.install_lib): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> install_lib.install_lib.run(self) <NEW_LINE> if include_dirs: <NEW_LINE> <INDENT> base = modname <NEW_LINE> for directory in include_dirs: <NEW_LINE> <INDENT> dest = join(self.install_dir, base, directory) <NEW_LINE> exp...
extend install_lib command to handle package __init__.py and include_dirs variable if necessary
62598edc07f4c71912bad9ac
class _BaseModel(object): <NEW_LINE> <INDENT> __abstract__ = True <NEW_LINE> id = Column(Integer, primary_key = True)
Base abstrat model, that add default primary key id field
62598edcac7a0e7691f70a60
class TestSummaryListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'next_link': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'value': {'key': 'value', 'type': '[TestSummaryResource]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, value: Optional[L...
A list of Test Summaries. Variables are only populated by the server, and will be ignored when sending a request. :param value: The list of Test Summaries. :type value: list[~test_base.models.TestSummaryResource] :ivar next_link: Link to the next set of results. Not empty if value contains incomplete list of results...
62598edca05bb46b38488dcb
class WindowFactory: <NEW_LINE> <INDENT> def __init__(self, func, *args): <NEW_LINE> <INDENT> self._func = func <NEW_LINE> self._args = args <NEW_LINE> <DEDENT> def _jwindow(self, sc): <NEW_LINE> <INDENT> return java.Packages(sc).Windows.__getattr__(self._func)(*self._args) <NEW_LINE> <DEDENT> def __str__(self): <NEW_L...
WindowFactory represents an intended window that will be instantiated later when we have access to a SparkContext. Typical usage is that a user constructs one of these (using the functions in this module), then passes it to one of the window-related methods of :class:`TimeSeriesDataFrame`, where we have a SparkContext...
62598edc63d6d428bbee0d20
@gin.configurable <NEW_LINE> class AverageEpisodeLengthMetric(StreamingMetric): <NEW_LINE> <INDENT> def __init__(self, name: Text = 'AverageEpisodeLength', buffer_size: types.Int = 10, batch_size: Optional[types.Int] = None): <NEW_LINE> <INDENT> self._np_state = numpy_storage.NumpyState() <NEW_LINE> self._np_state.epis...
Computes the average episode length.
62598edccc0a2c1114479550
class EdgeTypes(AttributeValues): <NEW_LINE> <INDENT> SLAVE = Slave <NEW_LINE> PARTITION = Partition <NEW_LINE> SPINDLE = Spindle <NEW_LINE> CONGRUENCE = Congruence <NEW_LINE> ENCLOSUREBAY = EnclosureBay <NEW_LINE> @classmethod <NEW_LINE> def values(cls): <NEW_LINE> <INDENT> return [ cls.CONGRUENCE, cls.ENCLOSUREBAY, c...
Enumeration of edge types.
62598edcb7558d5895461b9a
class DFPRint(SCPINode, SCPIQuery, SCPISet): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "DFPRint" <NEW_LINE> args = ["'string'"] <NEW_LINE> class HISTory(SCPINode): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _cmd = "HISTory" <NEW_LINE> args = [] <NEW_LINE> class COUNt(SCPINode, SCPIQuery): <NEW_LINE> <INDE...
SYSTem:DFPRint Arguments: 'string'
62598edcf7d966606f74653f
@implementer(IHTTPRequest) <NEW_LINE> @attrs(frozen=True) <NEW_LINE> class FrozenHTTPRequest(object): <NEW_LINE> <INDENT> method = attrib(validator=instance_of(Text)) <NEW_LINE> uri = attrib(validator=instance_of(URL)) <NEW_LINE> headers = attrib(validator=provides(IHTTPHeaders)) <NEW_LINE> _body = attrib(validato...
Immutable HTTP request.
62598edc4e4d562566370968
class Access: <NEW_LINE> <INDENT> _features = None <NEW_LINE> entities = {} <NEW_LINE> def load(self, permissions, container): <NEW_LINE> <INDENT> self._features = permissions['features'] <NEW_LINE> permissions_data = permissions['entities'] <NEW_LINE> permissions_data.sort(key=lambda data: len(data['path_c'])) <NEW_LI...
Class for checking user models_managers
62598edc94891a1f408b8120
class PersonView(compy.Adapter): <NEW_LINE> <INDENT> __implements__ = inevow.IRenderer <NEW_LINE> def rend(self, data): <NEW_LINE> <INDENT> attrs = ['firstName', 'lastName', 'nickname'] <NEW_LINE> return T.div(_class="View person")[ T.p['Person'], T.dl[ [(T.dt[attr], T.dd[getattr(self.original, attr)]) for attr in attr...
Render a full view of a Person.
62598edca17c0f6771d5a7aa
class FakeMessageFactory(object): <NEW_LINE> <INDENT> def fromStr(self, *args, **kwargs): <NEW_LINE> <INDENT> raise RaisedArgs(args, kwargs)
Fake message factory.
62598edc56ac1b37e630073d
class DownlinkPort(RadioPortProp): <NEW_LINE> <INDENT> MAX_PORTS = 1 <NEW_LINE> SET_MASK = True
Downlink PortProp class.
62598edce5267d203ee69e52
class Blog(PolymorphicModel): <NEW_LINE> <INDENT> author = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> topic = models.CharField(max_length=100) <NEW_LINE> pub_date = models.DateTimeField(default=timezone.now()) <NEW_LINE> id_code = models.CharField(max_length=6, default='') <NEW_LINE> tags = models.Man...
Blog contains all posts, polls, questions and job oppotunities.
62598edc236d856c2adc86bb
class AlienFXController17R1(alienfx_controller.AlienFXController): <NEW_LINE> <INDENT> DEFAULT_SPEED = 200 <NEW_LINE> MIN_SPEED = 50 <NEW_LINE> LEFT_KEYBOARD = 0x0001 <NEW_LINE> MIDDLE_LEFT_KEYBOARD = 0x0002 <NEW_LINE> MIDDLE_RIGHT_KEYBOARD = 0x0004 <NEW_LINE> RIGHT_KEYBOARD = 0x0008 <NEW_LINE> RIGHT_SPEAKER = 0x0040 <...
Specialization of the AlienFxController class for the 17R1 controller.
62598edc8e7ae83300ee75df
class Am(UnnamedResource): <NEW_LINE> <INDENT> def __init__(self, provision): <NEW_LINE> <INDENT> super(Am, self).__init__(provision) <NEW_LINE> self._meta_data['required_load_parameters'] = set() <NEW_LINE> self._meta_data['required_json_kind'] = 'tm:sys:provision:provisionstate'
BIG-IP® system provision afm resource The am object only supports load and update because it is an unnamed resource. .. note:: This is an unnamed resource so it has not ~Partition~Name pattern at the end of its URI.
62598edc656771135c487bdf
class BaseStrip(ABC): <NEW_LINE> <INDENT> def __init__(self, led_count: int, auto_write: bool = True): <NEW_LINE> <INDENT> self.led_count = led_count <NEW_LINE> self.auto_write = auto_write <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def get_pixel(self, index: Union[int, slice]) -> ColorTuple: <NEW_LINE> <INDENT> ra...
Abstract LED strip control interface Parameters ___________ led_count: int The number of leds in the strip auto_write: bool Whether or not leds should be auto-updated
62598edca79ad1619776856a
class StreamBuilder(object): <NEW_LINE> <INDENT> message_type = None <NEW_LINE> streamClass = None <NEW_LINE> def __init__(self, fd, config={}): <NEW_LINE> <INDENT> self.fd = fd <NEW_LINE> self.config = config <NEW_LINE> if fd: <NEW_LINE> <INDENT> if fd.mode == 'r': <NEW_LINE> <INDENT> self.setStream('input') <NEW_LINE...
Constructor for Stream object.
62598edc009cb60464cffaa4
class ConnectedComponent(object): <NEW_LINE> <INDENT> def __init__(self, graph): <NEW_LINE> <INDENT> self._marked = defaultdict(bool) <NEW_LINE> self._id = defaultdict(int) <NEW_LINE> self._count = 0 <NEW_LINE> for s in graph.vertices(): <NEW_LINE> <INDENT> if not self._marked[s]: <NEW_LINE> <INDENT> self.dfs(graph, s)...
Construct connected components using Depth-First-Search algorithm. Using this algorithm we need to construct all the connected components from the beginning which the cost of running time and space are both proportional to O(V + E). But it takes only constant time for querying if two vertices are connected. >>> g = G...
62598edcd7e4931a7ef3a5ec
@python_2_unicode_compatible <NEW_LINE> class BoundColumn(object): <NEW_LINE> <INDENT> def __init__(self, table, column, declared_name): <NEW_LINE> <INDENT> self.table = table <NEW_LINE> self.column = column <NEW_LINE> self.declared_name = declared_name <NEW_LINE> self.visible = False <NEW_LINE> if column: <NEW_LINE> <...
'Runtime' version of ``Column`` that is bound to a table instance, and thus knows about the table's data.
62598edc38b623060ffa75e2
class DNSFailedQueryError(DNSError): <NEW_LINE> <INDENT> pass
Unable to perform DNS query
62598edc1b99ca400228e7b4
class TestUserModule(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.user = User("dennis@me.com", "dennot8", "why-me-tell-you?") <NEW_LINE> <DEDENT> def test_register_user_method_1(self): <NEW_LINE> <INDENT> self.user.register_user() <NEW_LINE> self.assertIn("dennot8", list(registered_...
Defines a class which once initialized allows testing to be done on app's Create Module
62598edca17c0f6771d5a7ab
class WallAnt(Ant): <NEW_LINE> <INDENT> name = 'Wall' <NEW_LINE> food_cost = 4 <NEW_LINE> implemented = True <NEW_LINE> def __init__(self, armor=4): <NEW_LINE> <INDENT> Ant.__init__(self,armor)
A WallAnt class that does nothing each turn and is very useful because it has a large armor
62598edc8c0ade5d55dc292b
class SameCheck(TargetCheck): <NEW_LINE> <INDENT> check_id = 'same' <NEW_LINE> name = _('Not translated') <NEW_LINE> description = _('Source and translated strings are same') <NEW_LINE> def is_format_only(self, msg, flags): <NEW_LINE> <INDENT> if 'python-format' in flags: <NEW_LINE> <INDENT> regex = PYTHON_PRINTF_MATCH...
Check for not translated entries.
62598edc379a373c97d9754b
class WhoWroteQuestion(QuestionTemplate): <NEW_LINE> <INDENT> regex = ((Lemmas("who write") + Book()) | (Question(Lemmas("who be") + Pos("DT")) + Lemma("author") + Pos("IN") + Book())) + Question(Pos(".")) <NEW_LINE> def interpret(self, match): <NEW_LINE> <INDENT> author = NameOf(IsPerson() + AuthorOf(match....
Ex: "who wrote The Little Prince?" "who is the author of A Game Of Thrones?"
62598edcfbf16365ca7925f2
class Copyable(builtins.object): <NEW_LINE> <INDENT> @JointPoint <NEW_LINE> def __copy__(self): <NEW_LINE> <INDENT> return self._copy(self.__dict__) <NEW_LINE> <DEDENT> @JointPoint <NEW_LINE> def __deepcopy__(self, memory): <NEW_LINE> <INDENT> return self._copy(deepcopy(self.__dict__, memory)) <NEW_LINE> <DEDENT> @Join...
Represents copyable and deep copyable objects. Provides generic copy and recursive deep copy methods.
62598edc44b2445a339b5c0d
class handlers(object): <NEW_LINE> <INDENT> PUBLISH_HANDLER = PUBHandler <NEW_LINE> STREAM_HANDLER = logging.StreamHandler <NEW_LINE> FILE_HANDLER = logging.FileHandler
log handlers PUBLISH_HANDLER - blast logs through a pub mechanism STREAM_LOGGER - logs to stdout/stderr
62598edc8a43f66fc4bf06c2
class SvgContent(object): <NEW_LINE> <INDENT> def __init__(self, content_name = "noname", dir_name = "/tmp"): <NEW_LINE> <INDENT> self.__NAME = content_name <NEW_LINE> if(dir_name == '/tmp'): <NEW_LINE> <INDENT> self.__DIR = dir_name <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.__DIR = os.path.abspath(os.path.joi...
TODO
62598edc07f4c71912bad9ae
class OrderType(Enum): <NEW_LINE> <INDENT> market = 1 <NEW_LINE> limit = 2 <NEW_LINE> fok = 3 <NEW_LINE> ioc = 4 <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> conversions = {1: 'market', 2: 'limit', 3: 'fill-or-kill', 4: 'immediate-or-cancel'} <NEW_LINE> return conversions[self.value]
Enum for expressing OrderType. Will convert to str when printing or communicating with Stockfighter.
62598edc16aa5153ce3fea4b
class IndexView(ListView): <NEW_LINE> <INDENT> template_name = 'polls/index.html' <NEW_LINE> context_object_name = 'latest_question_list' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Question.objects.filter( pub_date__lte=timezone.now()).order_by('-pub_date')[:5]
Main index view.
62598edc4e4d562566370969
class ContainerDescriptorFactory(LeafDescriptorFactory): <NEW_LINE> <INDENT> runtime = SubFactory(ContainerDescriptorRuntimeFactory) <NEW_LINE> children = list(range(3))
Factory to generate XModuleDescriptors that are containers.
62598edc85dfad0860cbed13
class DAGCircuitError(QISKitError): <NEW_LINE> <INDENT> def __init__(self, *msg): <NEW_LINE> <INDENT> self.msg = ' '.join(msg) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.msg)
Base class for errors raised by the DAGCircuit object.
62598edc82261d6c5272f15f
class FilterMissesTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_letters_missing(self): <NEW_LINE> <INDENT> matches = filter_misses([None] * 5, 'AERTW') <NEW_LINE> self.assertFalse(matches('WATER')) <NEW_LINE> <DEDENT> def test_letters_positional(self): <NEW_LINE> <INDENT> matches = filter_misses(['', '', 'U', '...
Tests for the filter_misses() function.
62598edc57b8e32f525073b0
class Temperature(models.Model): <NEW_LINE> <INDENT> temp_value = models.CharField(max_length=70) <NEW_LINE> created_time = models.TimeField(_(u"created Time"), blank=True, default=datetime.now())
model to store temperature value
62598edcb7558d5895461b9c
class RemoteControl(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def up(self): <NEW_LINE> <INDENT> raise exceptions.NotSupportedError <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def down(self): <NEW_LINE> <INDENT> raise exceptions.NotSupportedError <NEW_LINE> <DEDENT> @a...
Base class for API used to control an Apple TV.
62598edc0c0af96317c548ee
class CitiesGenerator(CitiesGeneratorBase, UniformGenerator): <NEW_LINE> <INDENT> def generate(self, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return super().generate(*args, **kwargs) <NEW_LINE> <DEDENT> except InvalidSizeRequestError: <NEW_LINE> <INDENT> country_name = country_code_to_english(self...
Generate random cities uniformly
62598edc4428ac0f6e656aac
class Groups(object): <NEW_LINE> <INDENT> jheader = {'Content-Type': 'application/json'} <NEW_LINE> def __init__(self, client): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> <DEDENT> def search(self, **kwargs): <NEW_LINE> <INDENT> response = self._get(path='/groups/search', params=kwargs) <NEW_LINE> return respon...
A class to manage all core functionalities for AirWatch Organization Groups.
62598edca219f33f346c4d89
class InvalidCondition(Exception): <NEW_LINE> <INDENT> pass
Raised when the input cond
62598edccc0a2c1114479553
class InternalIPS(Container): <NEW_LINE> <INDENT> __slots__ = ["_cidrs"] <NEW_LINE> def __init__(self, iterable, sort_by_size=False): <NEW_LINE> <INDENT> self._cidrs = [] <NEW_LINE> for address in iterable: <NEW_LINE> <INDENT> self._cidrs.append(ipaddress.ip_network(address)) <NEW_LINE> <DEDENT> if sort_by_size: <NEW_L...
InternalIPS allows to specify CIDRs for INTERNAL_IPS. It takes an iterable of ip addresses or ranges. Inspiration taken from netaddr.IPSet, please use it if you can since it support more advanced features like optimizing ranges and lookups.
62598edc6aa9bd52df0d33fe
class FeedbackDetail(generics.RetrieveUpdateAPIView): <NEW_LINE> <INDENT> permission_classes = [IsOwnerOnly] <NEW_LINE> queryset = Feedback.objects.all() <NEW_LINE> serializer_class = FeedbackSerializer
Permission: authenticated user, assignee. Update and view feedback
62598edc3539df3088eca803
class DocumentEditFormView(MongonautViewMixin, FormView, MongonautFormViewMixin): <NEW_LINE> <INDENT> template_name = "mongonaut/document_edit_form.html" <NEW_LINE> form_class = Form <NEW_LINE> success_url = '/' <NEW_LINE> permission = 'has_edit_permission' <NEW_LINE> def get_success_url(self): <NEW_LINE> <INDENT> self...
:args: <app_label> <document_name> <id>
62598edc21bff66bcd7211a4
class terminal_type(defs.option): <NEW_LINE> <INDENT> default = 'Vte' <NEW_LINE> rtype = types.stringlist('Vte', 'Moo') <NEW_LINE> label = 'Terminal Type'
The default terminal type used
62598edc7d43ff24874266a4
class TestPart: <NEW_LINE> <INDENT> def setup_method(self, method): <NEW_LINE> <INDENT> self.client = BlankClient() <NEW_LINE> self.client.connection = mock.MagicMock(spec=Connection) <NEW_LINE> <DEDENT> def test_singular(self): <NEW_LINE> <INDENT> self.client.part('#framewirc') <NEW_LINE> self.client.connection.send.a...
Test the Client.part() method.
62598edc7d847024c075a922
class ILCode: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.commands = {} <NEW_LINE> self.cur_func = None <NEW_LINE> self.label_num = 0 <NEW_LINE> self.static_inits = {} <NEW_LINE> self.literals = {} <NEW_LINE> self.string_literals = {} <NEW_LINE> <DEDENT> def copy(self): <NEW_LINE> <INDENT> new = IL...
Stores the IL code generated from the AST. commands - Dictionary mapping function name to list of IL commands for that function. cur_func (str) - Name of the function current commands are for label_num (int) - Unique identifier returned by get_label
62598edcbd1bec0571e14374
class ODEMatchError(NotImplementedError): <NEW_LINE> <INDENT> pass
Raised if a SingleODESolver is asked to solve an ODE it does not match
62598edc8e71fb1e983b9fc3
class ImcDriver(object): <NEW_LINE> <INDENT> def __init__(self, proxy=None): <NEW_LINE> <INDENT> self.__redirect_uri = None <NEW_LINE> self.__proxy = proxy <NEW_LINE> self.__headers = {} <NEW_LINE> self.__handlers = self.__get_handlers() <NEW_LINE> <DEDENT> def __get_handlers(self): <NEW_LINE> <INDENT> handlers = [Smar...
This class is responsible to create http and https connection using urllib library. Args: proxy (str): The proxy object to be used to connect Example: driver = ImcDriver(proxy="192.168.1.1:80")
62598edc0c0af96317c548ef
class PhonebookSerializer(serializers.HyperlinkedModelSerializer): <NEW_LINE> <INDENT> user = serializers.Field(source='user') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Phonebook
**Create**: CURL Usage:: curl -u username:password --dump-header - -H "Content-Type:application/json" -X POST --data '{"name": "myphonebook"}' http://localhost:8000/rest-api/phonebook/ Response:: HTTP/1.0 201 CREATED Date: Fri, 14 Jun 2013 09:52:27 GMT Server: WSGIServer/0.1 ...
62598edc6e29344779afeb7d
class FilerGuiFileSelectForm(forms.Form): <NEW_LINE> <INDENT> filer_file = forms.ModelChoiceField( queryset=File.objects.all() )
Simple form to check if file exists
62598edc10dbd63aa1c6f0c2
class CartoException(Exception): <NEW_LINE> <INDENT> pass
Any Exception produced by carto-python should be wrapped around this class
62598edc23849d37ff84f60c
class FetchThread(BaseThread): <NEW_LINE> <INDENT> def __init__(self, name, worker, pool, max_count=500): <NEW_LINE> <INDENT> BaseThread.__init__(self, name, worker, pool) <NEW_LINE> self._max_count = max_count <NEW_LINE> self._proxies = None <NEW_LINE> return <NEW_LINE> <DEDENT> def working(self): <NEW_LINE> <INDENT> ...
class of FetchThread, as the subclass of BaseThread
62598edc23849d37ff84f60d
class CustomInstall(install): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> super(CustomInstall, self).run() <NEW_LINE> <DEDENT> except TypeError: <NEW_LINE> <INDENT> install.run(self) <NEW_LINE> <DEDENT> subprocess.check_call("make", cwd=".", shell=True) <NEW_LINE> os.symlink(os.path....
Custom handler for the 'install' command.
62598edc91f36d47f223014d
class label(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s:' % (self.name)
Represents a label in the asm.
62598edcd268445f26638e37
@bacpypes_debugging <NEW_LINE> class WriteSingleRegisterRequest(ReadWriteValueBase): <NEW_LINE> <INDENT> functionCode = MPCI.writeSingleRegister <NEW_LINE> def __init__(self, address=None, value=None, **kwargs): <NEW_LINE> <INDENT> if _debug: WriteSingleRegisterRequest._debug("__init__ %r %r %r", address, value, kwargs...
Write Single Register Request
62598edc2ae34c7f260a9639
class ExitCommand(command.Command): <NEW_LINE> <INDENT> obj = None <NEW_LINE> def func(self): <NEW_LINE> <INDENT> if self.obj.access(self.caller, 'traverse'): <NEW_LINE> <INDENT> self.obj.at_traverse(self.caller, self.obj.destination) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> if self.obj.db.err_traverse: <NEW_LINE>...
This is a command that simply cause the caller to traverse the object it is attached to.
62598edc004d5f362081e2a8
class EmailClient(object): <NEW_LINE> <INDENT> def __init__(self, smpt_server, smtp_port, imap_server, user_email, user_password): <NEW_LINE> <INDENT> self.email_address = user_email <NEW_LINE> self.inbox_size = 0 <NEW_LINE> <DEDENT> def send_email(self, receipients, subject, body): <NEW_LINE> <INDENT> message = ...
Email client for IMAP and SMTP
62598edc1f037a2d8b9e2657
class Manager(RedfishJsonValidator): <NEW_LINE> <INDENT> SCHEMA_NAME = 'Manager' <NEW_LINE> def __init__(self, oneview_appliance_info, oneview_appliance_state, oneview_appliance_health_status): <NEW_LINE> <INDENT> super().__init__(self.SCHEMA_NAME) <NEW_LINE> self.redfish["@odata.type"] = self.get_odata_type() <NEW_LIN...
Creates a Manager Redfish dict Populates self.redfish with some hardcoded Manager values and with the response from OneView.
62598edc3c8af77a43b671da
class Ftp(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required=[] <NEW_LINE> self.b_key = "ftp" <NEW_LINE> self.a10_url="/axapi/v3/cgnv6/ds-lite/alg/ftp" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.ftp_enable = "" <NEW_LINE> for keys, val...
Class Description:: DS-Lite FTP ALG (default: enabled). Class ftp supports CRUD Operations and inherits from `common/A10BaseClass`. This class is the `"PARENT"` class for this module.` :param ftp_enable: {"optional": true, "enum": ["disable"], "type": "string", "description": "'disable': Disable ALG; ", "format": "en...
62598edce64d504609df8669
class Config(object): <NEW_LINE> <INDENT> SECRET_KEY = os.environ.get('{{cookiecutter.app_name | upper}}_SECRET', 'secret-key') <NEW_LINE> APP_NAME = '{{cookiecutter.app_name}}' <NEW_LINE> APP_DIR = os.path.abspath(os.path.dirname(__file__)) <NEW_LINE> PROJECT_ROOT = os.path.abspath(os.path.join(APP_DIR, os.pardir)) <N...
Base configuration.
62598edc63b5f9789fe836c3
class FeatureError(PYHPError): <NEW_LINE> <INDENT> pass
Base class for all errors related to features.
62598edcac7a0e7691f70a64
class TablesMissingIndexes(_IndexHealthInspection): <NEW_LINE> <INDENT> title: str = 'Tables lacking indexes' <NEW_LINE> alias: str = 'tbl_noindex' <NEW_LINE> sql_name: str = 'tables_with_missing_indexes' <NEW_LINE> params: dict = { 'schema': 'public', } <NEW_LINE> params_aliases: Dict[str, str] = { 'schema': 'schema_n...
Reveals tables with missing indexes.
62598edc55399d3f05624a80
class CreateModelMixin(object): <NEW_LINE> <INDENT> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> serializer = self.get_serializer(data=request.data) <NEW_LINE> serializer.is_valid(raise_exception=True) <NEW_LINE> status_code = self.perform_create(serializer) <NEW_LINE> if status_code is None: <NEW_LI...
Create a model instance.
62598edc82261d6c5272f160
class DeleteWhiteListGroupRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(DeleteWhiteListGroupRequest, self).__init__( '/regions/{regionId}/instances/{instanceId}/whiteList', 'DELETE', header, version) <NEW_LINE> self.parameters = paramet...
删除白名单分组。
62598edccc0a2c1114479554
class KickBall(AbstractActionModule): <NEW_LINE> <INDENT> def __init__(self, args): <NEW_LINE> <INDENT> super(KickBall, self).__init__() <NEW_LINE> self.side = args <NEW_LINE> self.begin = time.time() <NEW_LINE> self.rk = config["animations"]["kicks"]["rk"] <NEW_LINE> self.lk = config["animations"]["kicks"]["lk"] <NEW_...
Kickt nach dem Ball, bekommt im init_data die Information ob links oder rechts gekickt werden soll Kicks the ball, gets in init_data the information about the side.
62598edc07f4c71912bad9b1
class SubstanceSourceMaterialOrganismOrganismGeneral(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_type = Field("SubstanceSourceMaterialOrganismOrganismGeneral", const=True) <NEW_LINE> class_fhir: fhirtypes.CodeableConceptType = Field( None, alias="class", title="The class of an organism shall be speci...
Disclaimer: Any field name ends with ``__ext`` doesn't part of Resource StructureDefinition, instead used to enable Extensibility feature for FHIR Primitive Data Types. 4.9.13.7.1 Kingdom (Conditional).
62598edc442bda511e95a9ba
class DatabaseRouter(object): <NEW_LINE> <INDENT> def db_for_read(self, model, **hints): <NEW_LINE> <INDENT> if model._meta.app_label == 'django_mongodb_cache': <NEW_LINE> <INDENT> return 'other' <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def db_for_write(self, model, **hints): <NEW_LINE> <INDENT> if model._me...
A router to control all database operations on models in the myapp application
62598edca219f33f346c4d8b
class BofhdUiTExtension(bofhd_core.BofhdCommonMethods): <NEW_LINE> <INDENT> all_commands = {} <NEW_LINE> parent_commands = False <NEW_LINE> authz = bofhd_auth.UitAuth <NEW_LINE> @classmethod <NEW_LINE> def get_help_strings(cls): <NEW_LINE> <INDENT> cmds = { 'misc': { 'misc_list_legacy_user': 'List reserved usernames', ...
Custom UiT commands for bofhd.
62598edc21bff66bcd7211a6
class DirectoryLayout(object): <NEW_LINE> <INDENT> def __init__(self, root): <NEW_LINE> <INDENT> self.root = root <NEW_LINE> self.check_upstream = True <NEW_LINE> <DEDENT> @property <NEW_LINE> def hidden_file_paths(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def all_specs(self): <NEW_LINE...
A directory layout is used to associate unique paths with specs. Different installations are going to want differnet layouts for their install, and they can use this to customize the nesting structure of spack installs.
62598edc56b00c62f0fb0e22
class IsMember(BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> return obj.members.filter(initiative=request.user).exists(),
Участник ли
62598edca17c0f6771d5a7ae
class AquaSerializer1013Fw1030(AquaSerializer1013): <NEW_LINE> <INDENT> status_scheme = Group(scheme={ 'time': Time(at=0x0001), 'structure_version': UnsignedWord(at=0x0005), 'serial_major': UnsignedWord(at=0x0007), 'serial_minor': UnsignedWord(at=0x0009), 'firmware_version': Unsig...
An AquaSerializer for structure version 1013 and firmware up to 1030.
62598edc8e71fb1e983b9fc4
class IMC2PacketAuthPlaintext(object): <NEW_LINE> <INDENT> def assemble(self, mudname=None, client_pwd=None, server_pwd=None): <NEW_LINE> <INDENT> return 'PW %s %s version=2 autosetup %s\n' %(mudname, client_pwd, server_pwd)
IMC2 plain-text authentication packet. Auth packets are strangely formatted, so this does not sub-class IMC2Packet. The SHA and plain text auth packets are the two only non-conformers. CLIENT Sends: PW <mudname> <clientpw> version=<version#> autosetup <serverpw> (SHA256) Optional Arguments( required if using the spec...
62598edc7d847024c075a924
class IPCServer(object): <NEW_LINE> <INDENT> def __init__(self, socket_path, io_loop=None, payload_handler=None): <NEW_LINE> <INDENT> self.socket_path = socket_path <NEW_LINE> self._started = False <NEW_LINE> self.payload_handler = payload_handler <NEW_LINE> self.sock = None <NEW_LINE> self.io_loop = io_loop or IOLoop....
A Tornado IPC server very similar to Tornado's TCPServer class but using either UNIX domain sockets or TCP sockets
62598edcbd1bec0571e14375
class ConcatenatedSequence(WrappedSequence): <NEW_LINE> <INDENT> def __init__(self, *alternatives): <NEW_LINE> <INDENT> self.list_lengths = [(a, a.__len__()) for a in alternatives] <NEW_LINE> self.length = sum(a_len for _, a_len in self.list_lengths) <NEW_LINE> <DEDENT> def get_item(self, i, d=None): <NEW_LINE> <INDENT...
This is equivalent to using extend() but without unpacking the lists.
62598edc99fddb7c1ca620b0
class Theme(object): <NEW_LINE> <INDENT> implements(ITheme) <NEW_LINE> def __init__(self, name, rules, title=None, description=None, absolutePrefix=None, parameterExpressions=None, doctype=None, preview=None, ): <NEW_LINE> <INDENT> self.__name__ = name <NEW_LINE> self.rules = rules <NEW_LINE> self.title = title <NEW_LI...
A theme, loaded from a resource directory
62598edc8e7ae83300ee75e3
class TestIris(QiskitMachineLearningTestCase): <NEW_LINE> <INDENT> def test_iris(self): <NEW_LINE> <INDENT> with warnings.catch_warnings(record=True) as c_m: <NEW_LINE> <INDENT> warnings.simplefilter("always") <NEW_LINE> input_file = self.get_resource_path("iris_ref.json", "datasets") <NEW_LINE> with open(input_file, e...
Iris tests.
62598edc925a0f43d25e6581
class NDBRefreshTokenModel(koalacore.NDBResource): <NEW_LINE> <INDENT> guid = ndb.StringProperty('rtguid', indexed=False) <NEW_LINE> token = ndb.StringProperty('rtt', indexed=True) <NEW_LINE> client_id = ndb.StringProperty('rtcid', indexed=False) <NEW_LINE> access_token = ndb.StringProperty('rtat', indexed=False)
A RefreshToken instance represents a token that can be swapped for a new access token when it expires. Fields: * :attr:`guid` ref to a user/unique entity (implementation of user/entity is not relevant here) * :attr:`token` Token value * :attr:`application` Application instance * :attr:`access_token` AccessToken this re...
62598edcd7e4931a7ef3a5ef
class TableFactory(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def createTable(cls, table): <NEW_LINE> <INDENT> if not table.table_exists(): <NEW_LINE> <INDENT> table.create_table() <NEW_LINE> print('Table創建成功') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> print('Table創建失敗') <NEW_LINE> <DEDENT> <DEDENT> @clas...
peewee table factory
62598edc29b78933be269378
class TypesObj(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def factory(mime_type): <NEW_LINE> <INDENT> if mime_type == 'application/json': <NEW_LINE> <INDENT> return JsonObj() <NEW_LINE> <DEDENT> if mime_type == 'application/yaml': <NEW_LINE> <INDENT> return YamlObj() <NEW_LINE> <DEDENT> return None
Factory class for mime types
62598edc24f1403a92684b4d
class Motif(BaseMotif, dict): <NEW_LINE> <INDENT> multiple_value_keys = set(['BF', 'OV', 'HP', 'BS', 'HC', 'DT', 'DR']) <NEW_LINE> reference_keys = set(['RX', 'RA', 'RT', 'RL'])
A Bio.Motif.TRANSFAC.Motif stores the information in one TRANSFAC motif. This class inherits from the Bio.Motif.Motif base class, as well as from a Python dictionary. All motif information found by the parser is stored as attributes of the base class when possible; see the Bio.Motif.Motif base class for a description o...
62598edc8c0ade5d55dc292d
class TestCSVFileReaderWithTerminators(object): <NEW_LINE> <INDENT> def test_csv_file_with_cr_fast(self, csv_file_with_cr): <NEW_LINE> <INDENT> with open(csv_file_with_cr, "rU") as handle: <NEW_LINE> <INDENT> reader = FastReader(handle, 'utf-8', ui=Mock()) <NEW_LINE> data = list(reader) <NEW_LINE> assert len(data) == 3...
Class of tests to handle files with terninators In large measure, this is a test that open("rU") does a suitable translation to text flowing through.
62598edcdd821e528d6d749a
class PassportElementErrorTranslationFile(PassportElementError): <NEW_LINE> <INDENT> def __init__(self, type, file_hash, message): <NEW_LINE> <INDENT> super(PassportElementErrorTranslationFile, self).__init__() <NEW_LINE> self.source = 'translation_file' <NEW_LINE> assert_type_or_raise(type, unicode_type, parameter_nam...
Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes. https://core.telegram.org/bots/api#passportelementerrortranslationfile Parameters: :param type: Type of element of the user's Telegram Passport which has the issue, one of...
62598edc004d5f362081e2a9
class Molecule: <NEW_LINE> <INDENT> def __init__(self, x, y, index): <NEW_LINE> <INDENT> self.node_features = x[0] <NEW_LINE> self.adjacency_matrix = x[1] <NEW_LINE> self.distance_matrix = x[2] <NEW_LINE> self.y = y <NEW_LINE> self.index = index
Class that represents a train/validation/test datum - self.label: 0 neg, 1 pos -1 missing for different target.
62598edcbe8e80087fbbd5a0
class FollowListViewTest(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> cls.user1 = User.objects.create_user(username='test1', password='12345') <NEW_LINE> cls.user2 = User.objects.create_user(username='test2', password='12345') <NEW_LINE> cls.user3 = User.objects.cre...
Tests FollowListView from users.views
62598edc379a373c97d9754f
class TestWorkerService(base.BaseTestCase): <NEW_LINE> <INDENT> @mock.patch('neutron.db.api') <NEW_LINE> def test_start_withoutdb_call(self, apimock): <NEW_LINE> <INDENT> _service = mock.Mock() <NEW_LINE> _service.pool = mock.Mock() <NEW_LINE> _service.pool.spawn = mock.Mock() <NEW_LINE> _service.pool.spawn.return_valu...
WorkerService tests.
62598edcc432627299fa1509
class Useless(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, nsamples=2): <NEW_LINE> <INDENT> self.nsamples = nsamples <NEW_LINE> <DEDENT> def fit(self, X, y=None): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def transform(self, X): <NEW_LINE> <INDENT> out = [] <NEW_LINE> for x in X: <...
Remove dropped packet.
62598edc56ac1b37e6300742
class RootNode(USDNode): <NEW_LINE> <INDENT> bl_idname = 'usd.RootNode' <NEW_LINE> bl_label = "Root" <NEW_LINE> bl_icon = "COLLECTION_NEW" <NEW_LINE> def update_data(self, context): <NEW_LINE> <INDENT> self.reset() <NEW_LINE> <DEDENT> name: bpy.props.StringProperty( name="Name", description="Name for USD root primitive...
Create root primitive and make it parent for USD primitives
62598edc3539df3088eca806
class WindowsPrefetchVolumesStringFormatterHelper( interface.CustomEventFormatterHelper): <NEW_LINE> <INDENT> IDENTIFIER = 'windows_prefetch_volumes_string' <NEW_LINE> def FormatEventValues(self, event_values): <NEW_LINE> <INDENT> number_of_volumes = event_values.get('number_of_volumes', 0) <NEW_LINE> volume_serial_num...
Windows Prefetch volumes string formatter helper.
62598edcfbf16365ca7925f6
class StrBool(Trafaret): <NEW_LINE> <INDENT> convertable = ('t', 'true', 'false', 'y', 'n', 'yes', 'no', 'on', '1', '0', 'none') <NEW_LINE> def _check(self, value): <NEW_LINE> <INDENT> _value = str(value).strip().lower() <NEW_LINE> if _value not in self.convertable: <NEW_LINE> <INDENT> self._failure("value %s can't be ...
>>> extract_error(StrBool(), 'aloha') "value aloha can't be converted to Bool" >>> StrBool().check(1) True >>> StrBool().check(0) False >>> StrBool().check('y') True >>> StrBool().check('n') False >>> StrBool().check(None) False >>> StrBool().check('1') True >>> StrBool().check('0') False >>> StrBool().check('YeS') Tru...
62598edc4527f215b58e8458
class NumericDigits(ModelSQL): <NEW_LINE> <INDENT> _name = 'test.numeric_digits' <NEW_LINE> _description = __doc__ <NEW_LINE> digits = fields.Integer('Digits') <NEW_LINE> numeric = fields.Numeric(string='Numeric', help='Test numeric', required=False, digits=(16, Eval('digits', 2)), depends=['digits'])
Numeric Digits
62598edc009cb60464cffaa9
class TestCfgSchemaVersion(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._config = config_parser() <NEW_LINE> self._config.add_section('section1') <NEW_LINE> self._config.set('section1', 'keword', 'value') <NEW_LINE> self._config.add_section(DESCRIPTION_SECTION) <NEW_LINE> <DEDENT> d...
Test that schema identification for the externals description returns the correct results.
62598edc07f4c71912bad9b2
class CartesianHyperboloid(HyperboloidEncoder): <NEW_LINE> <INDENT> def __init__(self, encoder, max_norm=1e8, dec=None): <NEW_LINE> <INDENT> super(CartesianHyperboloid, self).__init__() <NEW_LINE> self.enc = encoder <NEW_LINE> self.max_norm = max_norm <NEW_LINE> self.dec = dec <NEW_LINE> <DEDENT> def init_weights(self,...
Interprets points as the pre-image of the global chart onto the hyperboloid.
62598edc21a7993f00c644c0
class TimeUnit(Enum): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> @property <NEW_LINE> def value(self): <NEW_LINE> <INDENT> return self._name_.lower() <NEW_LINE> <DEDENT> SECONDS, MINUTES, HOURS, DAYS, WEEKS = range(5)
Accepted values to perform time operations
62598edc3eb6a72ae0388b94
class Config(Command): <NEW_LINE> <INDENT> def configure(self, parser): <NEW_LINE> <INDENT> subparsers = parser.get_subprocess({'help': "(help='config)", 'dest': 'command'}) <NEW_LINE> subprocess_parser = subparsers.add_parser('config', help='Config the environment') <NEW_LINE> subprocess_parser.add_argument('-a', '--a...
Config the ec2 instance.
62598edcb7558d5895461ba0
class TipoItem (models.Model): <NEW_LINE> <INDENT> nombre = models.CharField(max_length=30, null=True) <NEW_LINE> descripcion = models.TextField(max_length=300) <NEW_LINE> id_proyecto = models.IntegerField() <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> listaAtributo = models.ManyToManyField(Lista...
El modelo TipoItem describe la estructura de cada instancia de un Tipo de Item, los campos que contiene el modelo son: nombre: campo de tipo texto que contendra el nombre del Tipo de Item. descripcion: campo de tipo texto que contendra una breve descripcion del Tipo de Item. id_proyecto: campo que contendra el id del ...
62598edc851cf427c66b6826
class GpEiView(GpPrettyView): <NEW_LINE> <INDENT> _route_name = GP_EI_ROUTE_NAME <NEW_LINE> _pretty_route_name = GP_EI_PRETTY_ROUTE_NAME <NEW_LINE> request_schema = GpEiRequest() <NEW_LINE> response_schema = GpEiResponse() <NEW_LINE> _pretty_default_request = { "points_to_evaluate": [ [0.1], [0.5], [0.9], ], "gp_histor...
Views for gp_ei endpoints.
62598edccc0a2c1114479557
class BaseExecutor(with_metaclass(abc.ABCMeta, object)): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def Do(self, input_dict, output_dict, exec_properties): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, beam_pipeline_args = None): <NEW_LINE> <INDENT> self._beam_pipeline_args = beam_pipeline_arg...
Abstract TFX executor class.
62598edcd53ae8145f9169df
class InstanceGroupManager(_messages.Message): <NEW_LINE> <INDENT> autoHealingPolicies = _messages.MessageField('InstanceGroupManagerAutoHealingPolicy', 1, repeated=True) <NEW_LINE> baseInstanceName = _messages.StringField(2) <NEW_LINE> creationTimestamp = _messages.StringField(3) <NEW_LINE> currentActions = _messages....
InstanceGroupManagers Next available tag: 17 Fields: autoHealingPolicies: The autohealing policy for this managed instance group. You can specify only one value. baseInstanceName: The base instance name to use for instances in this group. The value must be 1-58 characters long. Instances are named by ...
62598edc3539df3088eca807
@inherit_doc <NEW_LINE> class IsotonicRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, HasWeightCol, JavaMLWritable, JavaMLReadable): <NEW_LINE> <INDENT> isotonic = Param(Params._dummy(), "isotonic", "whether the output sequence should be isotonic/increasing (true) or" + "antitonic/decrea...
Currently implemented using parallelized pool adjacent violators algorithm. Only univariate (single feature) algorithm supported. >>> from pyspark.ml.linalg import Vectors >>> df = spark.createDataFrame([ ... (1.0, Vectors.dense(1.0)), ... (0.0, Vectors.sparse(1, [], []))], ["label", "features"]) >>> ir = Isot...
62598edc91af0d3eaad3836e
class BaseConfig(AppConfig): <NEW_LINE> <INDENT> name = 'resolwe_server.base' <NEW_LINE> def ready(self): <NEW_LINE> <INDENT> from rest_framework_reactive.decorators import observable <NEW_LINE> from resolwe.flow import views as flow_views <NEW_LINE> flow_views.DataViewSet = observable(flow_views.DataViewSet) <NEW_LINE...
Application configuration.
62598edc7d43ff24874266a6