code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
@benchmark.Disabled('xp') <NEW_LINE> class DromaeoDomCoreModify(_DromaeoBenchmark): <NEW_LINE> <INDENT> tag = 'domcoremodify' <NEW_LINE> query_param = 'dom-modify' <NEW_LINE> @classmethod <NEW_LINE> def Name(cls): <NEW_LINE> <INDENT> return 'dromaeo.domcoremodify'
Dromaeo DOMCore modify JavaScript benchmark. Tests creating and injecting DOM nodes.
62598f9cbaa26c4b54d4f058
class Team(models.Model): <NEW_LINE> <INDENT> name = models.TextField(max_length=200) <NEW_LINE> invitation_code = models.UUIDField( default=uuid.uuid4, editable=False, unique=True, null=True )
Class representing the team table in the database. Objects of this class will be used to interact with the team table in the database.
62598f9c4428ac0f6e6582d1
class TablePrinter(ResourcePrinter): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(TablePrinter, self).__init__(*args, **kwargs) <NEW_LINE> self._rows = [] <NEW_LINE> <DEDENT> def AddRow(self, row): <NEW_LINE> <INDENT> self._rows.append(row) <NEW_LINE> <DEDENT> def Print(self): <NEW...
A printer for printing human-readable tables.
62598f9c4e4d5625663721c9
class UserForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ['username','email', 'password'] <NEW_LINE> exclude = ['first_name, last_name'] <NEW_LINE> widgets = { 'username':forms.TextInput(attrs={ 'class': 'form-control', 'id': 'name', 'type': 'text', 'placehol...
form for creating dashboard user
62598f9cd6c5a102081e1eea
class Strategy(Queue): <NEW_LINE> <INDENT> def __init__(self, f, order = min, sm = "u"): <NEW_LINE> <INDENT> self.A = [] <NEW_LINE> self.E = [] <NEW_LINE> self.order = order <NEW_LINE> self.f = f <NEW_LINE> self.search = sm <NEW_LINE> <DEDENT> def append(self, item, ok = False): <NEW_LINE> <INDENT> inThere = False <NE...
Returns element based on its cost - evaluated by some function f. Order parameter determines if we return element with max/min cost value.
62598f9ce5267d203ee6b6b4
class NoMatchedServers(SpeedtestException): <NEW_LINE> <INDENT> pass
No servers matched when filtering
62598f9cf7d966606f747d8e
class Courses(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'courses' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(60), unique=True) <NEW_LINE> description = db.Column(db.String(200)) <NEW_LINE> lesson_course_id = db.Column(db.Integer, db.ForeignKey('lessons.id')) <NEW_...
Create a Courses table
62598f9c32920d7e50bc5dfc
class TestIntegrationAuto(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._root = os.path.dirname(__main__.__file__) <NEW_LINE> self._name = 'vsgen-auto' <NEW_LINE> self._solution = os.path.normpath(os.path.join(self._root, self._name + '.sln')) <NEW_LINE> self.assertFalse(os.path.exis...
Tests the Solution and Project Generation from a directory.
62598f9c10dbd63aa1c7095b
class FImporter(object): <NEW_LINE> <INDENT> def __init__(self, extensions=(F_EXT, F90_EXT), fbuild_dir=None): <NEW_LINE> <INDENT> self.extensions = extensions <NEW_LINE> self.fbuild_dir = fbuild_dir <NEW_LINE> <DEDENT> def find_module(self, fullname, package_path=None): <NEW_LINE> <INDENT> if fullname in sys.modules ...
A meta-path importer for .f files.
62598f9c8da39b475be02f8b
class DeserializeException(Exception): <NEW_LINE> <INDENT> pass
Represents an error deserializing a value.
62598f9c3539df3088ecc05c
class LimitOffsetPagination(LimitPagination): <NEW_LINE> <INDENT> offset_arg = "offset" <NEW_LINE> def get_page(self, query, view): <NEW_LINE> <INDENT> offset = self.get_offset() <NEW_LINE> query = query.offset(offset) <NEW_LINE> return super().get_page(query, view) <NEW_LINE> <DEDENT> def get_offset(self): <NEW_LINE> ...
A pagination scheme that takes a user-specified limit and offset. This pagination scheme takes a user-specified limit and offset. It will retrieve up to the specified number of items, beginning at the specified offset.
62598f9cbe383301e025359e
class LabelConverter: <NEW_LINE> <INDENT> def __init__(self, label, name): <NEW_LINE> <INDENT> self.label = label <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def convertToXLS(self): <NEW_LINE> <INDENT> if self.label: <NEW_LINE> <INDENT> return self._convertLabel() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> retur...
Holds variable label from redcap file.
62598f9c8a43f66fc4bf1f22
class EmployeeDisplaySettingsForm(forms.ModelForm): <NEW_LINE> <INDENT> override_list_view = forms.BooleanField(label="", required=False, widget=forms.CheckboxInput()) <NEW_LINE> see_all_departments = forms.BooleanField(label="", required=False, widget=forms.CheckboxInput()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> m...
Form for setting employee display settings
62598f9cd486a94d0ba2bd7c
class TestIoK8sApiCoreV1ServiceProxyOptions(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 testIoK8sApiCoreV1ServiceProxyOptions(self): <NEW_LINE> <INDENT> pass
IoK8sApiCoreV1ServiceProxyOptions unit test stubs
62598f9c0c0af96317c56129
class Plugin(BasePlugin): <NEW_LINE> <INDENT> def __call__(self): <NEW_LINE> <INDENT> params = self.ctx.params <NEW_LINE> size = self.ctx.tod_vx.shape <NEW_LINE> if params.load_noise_template: <NEW_LINE> <INDENT> mod = importlib.import_module(self.ctx.params.instrument) <NEW_LINE> freq = self.ctx.frequencies <NEW_LINE>...
Adds background noise to the time ordered data
62598f9c63d6d428bbee2558
class SOS1Content(Content): <NEW_LINE> <INDENT> def __init__(self, subject, operator, content_list): <NEW_LINE> <INDENT> super().__init__(subject=subject, operator=operator, children=content_list) <NEW_LINE> <DEDENT> def _get_text(self): <NEW_LINE> <INDENT> return '%s ' % self.operator + " ".join(['(%s)' % c.get_text()...
Content class in the form [subject] [operator] [sentence] NOT
62598f9c3c8af77a43b67e11
class AccountTypeRepository(metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def search_account_type_by(self, ctx, limit=DEFAULT_LIMIT, offset=DEFAULT_OFFSET, account_type_id: int = None, terms: str = None) -> (List[AccountType], int): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abc.abstract...
Abstract interface to handle accounts.
62598f9c99cbb53fe6830c78
class iterating_colors: <NEW_LINE> <INDENT> def __init__(self, palette="matlab"): <NEW_LINE> <INDENT> if palette == "matlab": <NEW_LINE> <INDENT> self.colors = [ [0.0000, 0.4470, 0.7410], [0.8500, 0.3250, 0.0980], [0.9290, 0.6940, 0.1250], [0.4940, 0.1840, 0.5560], [0.4660, 0.6740, 0.1880]...
This class is made to mimic matlab-like color plotting behavior. Calling get_next() method returns new color in list, without hazzle. By default colorset is same as in matlab
62598f9ca17c0f6771d5bfe2
class TestIssue85(common.FunctionalTestCase): <NEW_LINE> <INDENT> def test_disabling_tenant_disables_token(self): <NEW_LINE> <INDENT> tenant = self.create_tenant().json['tenant'] <NEW_LINE> password = common.unique_str() <NEW_LINE> user = self.create_user(user_password=password, tenant_id=tenant['id']).json['user'] <NE...
Illustrates github issue #85
62598f9c3539df3088ecc05d
class Taxcode(Serializable, Base): <NEW_LINE> <INDENT> __tablename__ = "taxcodes" <NEW_LINE> __serializable__ = ["id", "title", "effective_at", "expired_at", "shared", "body", "created_at", "updated_at"] <NEW_LINE> id = Column(CHAR(16), primary_key=True) <NEW_LINE> title = Column(String, nullable=False) <NEW_LINE> effe...
Taxcode to be executed per product purchased
62598f9c15baa72349461d2b
class ValidationError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, code=None, params=None): <NEW_LINE> <INDENT> import operator <NEW_LINE> from django.utils.encoding import force_text <NEW_LINE> if isinstance(message, dict): <NEW_LINE> <INDENT> self.message_dict = message <NEW_LINE> message = reduce(oper...
An error while validating data.
62598f9c5f7d997b871f92b2
class PageSearchForm(forms.Form): <NEW_LINE> <INDENT> title = forms.CharField(required=False, label="Title")
Search form to filter pages by *title.
62598f9c6e29344779b00403
class CSRFProtectedSchema(colander.MappingSchema): <NEW_LINE> <INDENT> csrf_token = colander.SchemaNode( colander.String(), name="csrf_token", validator=validate_csrf_token, )
A mixin class to validate csrf tokens.
62598f9cbaa26c4b54d4f05a
class MakoTemplate(TemplateBase): <NEW_LINE> <INDENT> _template = None <NEW_LINE> def __init__(self, template): <NEW_LINE> <INDENT> super(MakoTemplate, self).__init__() <NEW_LINE> self._template = template <NEW_LINE> <DEDENT> def render(self, bindings): <NEW_LINE> <INDENT> buf = StringIO() <NEW_LINE> _binding_dict = di...
Wrapper for mako templates Members: _template -- Mako template
62598f9c498bea3a75a578c8
class TestGetDevicesPE(APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.response = self.client.get('/getDevicesPE/') <NEW_LINE> <DEDENT> def test_GetPE_received_200_status_code(self): <NEW_LINE> <INDENT> self.assertEqual(self.response.status_code, status.HTTP_200_OK) <NEW_LINE> <DEDENT> def t...
Verify GET PE DEVICES LODED ON NSO via Microservices API
62598f9cd268445f26639a57
class InterpreterInterface(BaseInterpreterInterface): <NEW_LINE> <INDENT> def __init__(self, host, client_port): <NEW_LINE> <INDENT> self.client_port = client_port <NEW_LINE> self.host = host <NEW_LINE> self.interpreter = PyDevFrontEnd() <NEW_LINE> self._input_error_printed = False <NEW_LINE> <DEDENT> def doAddExec(sel...
The methods in this class should be registered in the xml-rpc server.
62598f9c004d5f362081eed1
class TiledElement(object): <NEW_LINE> <INDENT> allow_duplicate_names = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.properties = dict() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def from_xml_string(cls, xml_string): <NEW_LINE> <INDENT> return cls().parse_xml(ElementTree.fromstring(xml_string)) <NEW_...
Base class for all pytmx types
62598f9c8e7ae83300ee8e47
class CommonParserOptions(object): <NEW_LINE> <INDENT> def addOptions(self): <NEW_LINE> <INDENT> parser=OptionGroup(self.parser, "Parser Options", "Options that control the behaviour of the parser for the dictionary files") <NEW_LINE> self.parser.add_option_group(parser) <NEW_LINE> parser.add_option("--debug-parser", a...
The class that defines the options for the parser
62598f9c851cf427c66b8070
class FlagAction(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, option_strings, dest, nargs=None, **kwargs): <NEW_LINE> <INDENT> options = [opt.strip("-") for opt in option_strings] <NEW_LINE> yes_options = [opt for opt in options if not opt.startswith("no-")] <NEW_LINE> no_options = [opt[3:] for opt in optio...
Facilitates --flag, --no-flag arguments Usage:: parser.add_argument( '--flag', '--no-flag', action=FlagAction, default=True, help='whether to enable flag' ) Which allows you to do:: $ command $ command --flag $ command --no-flag And the help works nicely, too:: $ command ...
62598f9c925a0f43d25e7de5
class MongoTrackerStore(TrackerStore): <NEW_LINE> <INDENT> def __init__( self, domain: Domain, host: Optional[Text] = "mongodb://localhost:27017", db: Optional[Text] = "rasa", username: Optional[Text] = None, password: Optional[Text] = None, auth_source: Optional[Text] = "admin", collection: Optional[Text] = "conversat...
Stores conversation history in Mongo Property methods: conversations: returns the current conversation
62598f9cac7a0e7691f722b4
class MediaRef(SecondaryObject, PrivacyBase, CitationBase, NoteBase, RefBase, AttributeBase): <NEW_LINE> <INDENT> def __init__(self, source=None): <NEW_LINE> <INDENT> PrivacyBase.__init__(self, source) <NEW_LINE> CitationBase.__init__(self, source) <NEW_LINE> NoteBase.__init__(self, source) <NEW_LINE> RefBase.__init__(...
Media reference class.
62598f9c9c8ee82313040044
class MessageInputCommandTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def testRun(self): <NEW_LINE> <INDENT> c = MessageInputCommand() <NEW_LINE> c.params.partner = PartnerAuthInfo(None) <NEW_LINE> c.params.message = TransitMessage(serialized={ 'text' : u'Is this SPAM?'}) <NEW_LINE> return c.run().addCallback(lambd...
Тест на L{spamfighter.api.message.input.MessageInputCommand}.
62598f9c3539df3088ecc05e
class VertexDefinedObjectFromValues(VertexDefinedObject): <NEW_LINE> <INDENT> def __init__(self,x,y,isClosed,samples_vertices_dict): <NEW_LINE> <INDENT> dummyvert=[] <NEW_LINE> for i in range(np.size(x)): <NEW_LINE> <INDENT> dummyvert.append(fzy.TrapezoidalFuzzyNumber()) <NEW_LINE> <DEDENT> VertexDefinedObject.__init__...
A vertex-defined object, constructed from previously generated values. - *x*: A numpy array of x coordinates, length N - *y*: A numpy array of y coordinates, length N - *isClosed*: whether the object will be treated as having a closed boundary. - *samples_vertices_dict*: a dictionary holding samples of the fuzzy verti...
62598f9ca79ad16197769e0c
class VMSizeProperties(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'v_cpus_available': {'key': 'vCPUsAvailable', 'type': 'int'}, 'v_cpus_per_core': {'key': 'vCPUsPerCore', 'type': 'int'}, } <NEW_LINE> def __init__( self, *, v_cpus_available: Optional[int] = None, v_cpus_per_core: Optional[int] =...
Specifies VM Size Property settings on the virtual machine. :ivar v_cpus_available: Specifies the number of vCPUs available for the VM. :code:`<br>`:code:`<br>` When this property is not specified in the request body the default behavior is to set it to the value of vCPUs available for that VM size exposed in api re...
62598f9c30dc7b766599f5f5
class VolumeSnapshotToolbar(View): <NEW_LINE> <INDENT> policy = Dropdown('Policy') <NEW_LINE> download = Dropdown('Download') <NEW_LINE> view_selector = View.nested(ItemsToolBarViewSelector)
The toolbar on the Volume Snapshot page
62598f9c090684286d5935ae
class Proposal(db.Model): <NEW_LINE> <INDENT> device = db.ReferenceProperty(Device) <NEW_LINE> created = db.DateTimeProperty(auto_now_add=True)
A temporary proposal to connect forever
62598f9c0c0af96317c5612c
class BaseImage(object): <NEW_LINE> <INDENT> def __init__(self, docker_client, image_opts): <NEW_LINE> <INDENT> self._docker_client = docker_client <NEW_LINE> self._image_opts = image_opts <NEW_LINE> self._id = None <NEW_LINE> <DEDENT> def Build(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> d...
Abstract base class for Docker images.
62598f9c656771135c48942b
class User: <NEW_LINE> <INDENT> user_list = [] <NEW_LINE> def __init__(self, username, password): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.password = password <NEW_LINE> <DEDENT> def save_user(self): <NEW_LINE> <INDENT> User.user_list.append(self) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def disp...
Create User class that generates new instances of a user
62598f9c56ac1b37e6301f93
class Vis(models.Model): <NEW_LINE> <INDENT> project = models.ForeignKey(Project) <NEW_LINE> user = models.ForeignKey(User) <NEW_LINE> name = models.CharField(max_length=50) <NEW_LINE> personIn = models.BooleanField(default = 0) <NEW_LINE> locationIn = models.BooleanField(default = 0) <NEW_LINE> phoneIn = models.Boolea...
A Visualzaiton model
62598f9c0a50d4780f705182
class Attention(nn.Module): <NEW_LINE> <INDENT> def forward(self, query, key, value, mask=None, dropout=None): <NEW_LINE> <INDENT> scores = torch.exp(torch.matmul(query, key.transpose(-2, -1))) / math.sqrt(query.size(-1)) <NEW_LINE> if mask is not None: <NEW_LINE> <INDENT> scores = scores.masked_fill(ma...
Compute 'Scaled Dot Product Attention
62598f9c6aa9bd52df0d4c77
class MockKey(object): <NEW_LINE> <INDENT> def __init__(self, bucket=None, name=None): <NEW_LINE> <INDENT> self.bucket = bucket <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def set_contents_from_file(self, f): <NEW_LINE> <INDENT> mock_s3_fs = self.bucket.connection.mock_s3_fs <NEW_LINE> f.seek(0) <NEW_LINE> contents...
Mock out boto.s3.Key
62598f9c32920d7e50bc5e00
class Configurator(object): <NEW_LINE> <INDENT> _instance = None <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> if not self._instance: <NEW_LINE> <INDENT> self._instance = self() <NEW_LINE> <DEDENT> return self._instance <NEW_LINE> <DEDENT> def __init__(self): <NEW_LINE> <INDENT> self.__dict__['_config'] = {} <NEW_...
Has only one instance all the time, and provides access to twisted usage.Options @ivar _instance: Configurator instance, will be retruned that one instead of creating
62598f9c3eb6a72ae038a3ea
class FileHandler(): <NEW_LINE> <INDENT> def __init__(self, file_name): <NEW_LINE> <INDENT> self.file_name = file_name <NEW_LINE> <DEDENT> def read_file_bytes(self): <NEW_LINE> <INDENT> with open(self.file_name, "rb") as data_file: <NEW_LINE> <INDENT> data = data_file.read() <NEW_LINE> <DEDENT> return data <NEW_LINE> <...
Handles io operations for a file
62598f9cd268445f26639a58
class Solution: <NEW_LINE> <INDENT> def kDistinctCharacters(self, s, k): <NEW_LINE> <INDENT> lens = len(s) <NEW_LINE> count = 0 <NEW_LINE> sipre=-1 <NEW_LINE> si=0 <NEW_LINE> ei=0 <NEW_LINE> cache={} <NEW_LINE> while si <= ei: <NEW_LINE> <INDENT> if len(cache.keys()) < k and ei < lens: <NEW_LINE> <INDENT> if s[ei] not ...
@param s: a string @param k: an integer @return: the number of substrings there are that contain at least k distinct characters
62598f9c8da39b475be02f8f
class LatticeGenotypePhenotypeMap(GenotypePhenotypeMap): <NEW_LINE> <INDENT> def __init__(self, wildtype, mutations, conformations=None, target=None, temp=1.0, phenotype_type="stability", **kwargs): <NEW_LINE> <INDENT> genotypes = mutations_to_genotypes(wildtype, mutations) <NEW_LINE> self.latticeproteins = LatticeProt...
Construct a genotype-phenotype map from 2d protein lattice models. Genotypes are represented by Parameters ---------- wildtype : str Wildtype sequence mutant : str Mutant sequence target_conf : str (optional) String that describes the target conformation to fold each sequence to. temperature : float ...
62598f9c1f5feb6acb1629cc
class HTMLClusterViewModel(BaseClusterViewModel, HTMLViewModel): <NEW_LINE> <INDENT> def get_css(self, **kwargs): <NEW_LINE> <INDENT> return _css_cluster_colors() <NEW_LINE> <DEDENT> def on_select(self, cluster_ids, **kwargs): <NEW_LINE> <INDENT> self.update(cluster_ids=cluster_ids) <NEW_LINE> <DEDENT> def on_cluster(s...
HTML view model that displays per-cluster information.
62598f9cf8510a7c17d7e04d
class ParseCommas(argparse.Action): <NEW_LINE> <INDENT> def __init__(self, option_strings, dest, nargs=None, **kwargs): <NEW_LINE> <INDENT> if nargs is not None: <NEW_LINE> <INDENT> raise ValueError('nargs not allowed for ParseCommas') <NEW_LINE> <DEDENT> super(ParseCommas, self).__init__(option_strings, dest, **kwargs...
Argparse Action that parses arguments by commas Attributes: option_strings (list): list of str giving command line flags that call this action dest (str): Namespace reference to value nargs (bool): True if multiple arguments specified ...
62598f9c63d6d428bbee255c
class BasicInfo(base.BaseUnivInfo): <NEW_LINE> <INDENT> data_filename = BASIC_DATA_FILENAME <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.data['name'] <NEW_LINE> <DEDENT> @property <NEW_LINE> def aliases(self): <NEW_LINE> <INDENT> return self.data['aliases'] <NEW_LINE> <DEDENT> @proper...
宿舍信息对象.
62598f9c55399d3f056262cd
class ThermoCentralDatabaseInterface(object): <NEW_LINE> <INDENT> def __init__(self, host, port, username, password): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.username = username <NEW_LINE> self.password = password <NEW_LINE> self.client = self.connect() <NEW_LINE> <DEDENT> def c...
A class for interfacing with thermo central database.
62598f9c596a897236127a2b
@python_2_unicode_compatible <NEW_LINE> class BaseProduct(models.Model): <NEW_LINE> <INDENT> title = models.CharField(_('title'), max_length=255) <NEW_LINE> slug = AutoSlugField(_('slug'), max_length=255, populate_from=['title', 'id'], unique=True, db_index=True) <NEW_LINE> creation_date = models.DateTimeField(_('creat...
Abstract base product model class providing the base fields and methods
62598f9c507cdc57c63a4b40
class DateRange: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.start_date = parse_date(data['startDate']) <NEW_LINE> self.end_date = parse_date(data['endDate']) <NEW_LINE> self.frequencies = data['frequencies']
The class contains information about dataset's data range
62598f9c097d151d1a2c0dd1
class TagCppFlags(TagVector): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> TagVector.__init__(self)
tag CppFlags
62598f9c442bda511e95c20a
class MashapeProcessing(BaseWebService): <NEW_LINE> <INDENT> stage = stages.POST <NEW_LINE> baseurl = "http://text-processing.com/api/" <NEW_LINE> parameters = [ dict(name="extract", value="phrases", choices=["phrases", "sentiment"]), ] <NEW_LINE> def process(self, input): <NEW_LINE> <INDENT> http = httplib2.Http() <NE...
Mashape entity extraction.
62598f9c3c8af77a43b67e13
class TestQuantityLinAlgFuncs: <NEW_LINE> <INDENT> @pytest.mark.xfail <NEW_LINE> def test_outer(self): <NEW_LINE> <INDENT> q1 = np.array([1, 2, 3]) * u.m <NEW_LINE> q2 = np.array([1, 2]) / u.s <NEW_LINE> o = np.outer(q1, q2) <NEW_LINE> assert np.all(o == np.array([[1, 2], [2, 4], [3, 6]]) * u.m / u.s) <NEW_LINE> <DEDEN...
Test linear algebra functions
62598f9cb7558d58954633da
class AppAssertionCredentials(AssertionCredentials): <NEW_LINE> <INDENT> def __init__(self, email=None, *args, **kwargs): <NEW_LINE> <INDENT> if 'scopes' in kwargs: <NEW_LINE> <INDENT> warnings.warn(_SCOPES_WARNING) <NEW_LINE> kwargs['scopes'] = None <NEW_LINE> <DEDENT> super(AppAssertionCredentials, self).__init__(Non...
Credentials object for Compute Engine Assertion Grants This object will allow a Compute Engine instance to identify itself to Google and other OAuth 2.0 servers that can verify assertions. It can be used for the purpose of accessing data stored under an account assigned to the Compute Engine instance itself. This cre...
62598f9c5f7d997b871f92b4
class Type: <NEW_LINE> <INDENT> __tags = set() <NEW_LINE> def __init__(self, expr, tag = None): <NEW_LINE> <INDENT> self.expr = expr <NEW_LINE> if tag is None: <NEW_LINE> <INDENT> tag = ''.join([c for c in expr if c.isalnum() or c in '_']) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for c in tag: <NEW_LINE> <INDENT> ...
Base class for all types.
62598f9c21bff66bcd722a10
class InotifyEmitter(EventEmitter): <NEW_LINE> <INDENT> def __init__(self, event_queue, watch, timeout=DEFAULT_EMITTER_TIMEOUT): <NEW_LINE> <INDENT> EventEmitter.__init__(self, event_queue, watch, timeout) <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> self._inotify = Inotify(watch.path, watch.is_recursive) <NEW_L...
inotify(7)-based event emitter. :param event_queue: The event queue to fill with events. :param watch: A watch object representing the directory to monitor. :type watch: :class:`watchdog.observers.api.ObservedWatch` :param timeout: Read events blocking timeout (in seconds). :type timeout: ``float``
62598f9ca8370b77170f018f
class PrismRegular: <NEW_LINE> <INDENT> def __init__(self, param1, param2): <NEW_LINE> <INDENT> self.name = 'prism_regular' <NEW_LINE> if (isinstance(param1, PolygonRegular) and isinstance(param2, PolygonRegular)): <NEW_LINE> <INDENT> top_facet = param1 <NEW_LINE> bottom_facet = param2 <NEW_LINE> self.__init_primitive(...
Prism with a regular polygon as base. top_facet is parallel to bottom_facet and height is perpendicular to both of them.
62598f9c1b99ca400228f403
class TestOmer(object): <NEW_LINE> <INDENT> OMER_STRINGS = [ (1, u"היום יום אחד לעומר"), (2, u"היום שני ימים לעומר"), (3, u"היום שלושה ימים לעומר"), (7, u"היום שבעה ימים שהם שבוע אחד לעומר"), (8, u"היום שמונה ימים שהם שבוע אחד ויום אחד לעומר"), (10, u"היום עשרה ימים שהם שבוע אחד ושלושה ימים לעומר"), (13, u"היום שלושה ע...
Test get_omer_string
62598f9cdd821e528d6d8ce0
class AssociateSecurityGroupsRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.SecurityGroupIds = None <NEW_LINE> self.InstanceIds = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.SecurityGroupIds = params.get("SecurityGroupIds") <NEW_LINE> self....
AssociateSecurityGroups请求参数结构体
62598f9cdd821e528d6d8ce1
class CONTAINS(object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self.values = args <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return all(value in other for value in self.values) <NEW_LINE> <DEDENT> def __ne__(self, other): <NEW_LINE> <INDENT> return any(value not in othe...
Helper object that checks for equalness by checking if the compared object contains elements passed in the constructor.
62598f9ca17c0f6771d5bfe7
class TestCity(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.my_object = City() <NEW_LINE> <DEDENT> def test_docstring(self): <NEW_LINE> <INDENT> msj = "Módulo does not has docstring" <NEW_LINE> self.assertIsNotNone(models.city.__doc__, msj) <NEW_LINE> msj = "Clase does not has docst...
start tests
62598f9c6fb2d068a7693d0a
class RebootRequiredTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_returns_true(self): <NEW_LINE> <INDENT> out = "You really need to restart here" <NEW_LINE> self.assertTrue(requires_reboot(out)) <NEW_LINE> <DEDENT> def test_returns_false(self): <NEW_LINE> <INDENT> out = "You really need to renppt here" <NEW...
Tests for `powerful_python.py`'s `requires_reboot`.
62598f9cfff4ab517ebcd59a
class StaleObjectError(PersistenceError): <NEW_LINE> <INDENT> __xmlrpc_error__ = 8 <NEW_LINE> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.message)
Thrown when an object the object being persisted has already been updated.
62598f9c2ae34c7f260aae8d
class CommentSerializer(ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Comment <NEW_LINE> exclude = ('review',) <NEW_LINE> read_only_fields = ('pub_date',) <NEW_LINE> <DEDENT> author = serializers.SlugRelatedField(slug_field='username', read_only=True)
Сериалайзер Комментарий.
62598f9c090684286d5935b0
class OffspringGenerator(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 __init__(self, ops: 'opList', numOffspring: 'floatListFunc'=1, sexMode: 'floatListFunc'=RANDOM_SEX): <NEW_LINE> <I...
Details: An offspring generator generates offspring from parents chosen by a parent chooser. It is responsible for creating a certain number of offspring, determinning their sex, and transmitting genotypes from parents to offspring.
62598f9c656771135c48942f
class Location(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'locations' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String, nullable=False) <NEW_LINE> latitude = db.Column(db.Float) <NEW_LINE> longitude = db.Column(db.Float) <NEW_LINE> user_id = db.Column(db.Integer, db.Fore...
Location model class
62598f9cd7e4931a7ef3be45
class Quantizer: <NEW_LINE> <INDENT> def __init__(self, start, end, bins): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> self.bins = bins <NEW_LINE> self.moved_start = 0.0 <NEW_LINE> self.moved_end = abs(end - start) <NEW_LINE> self.step = abs(end - start) / bins <NEW_LINE> <DEDENT> def in...
quantize value range. if we want to quantize -2 to 2 into 4 bins, -2 to -1 | -1 to 0 | 0 to 1 | 1 to 2 each bin range should be 1. also index of 0.5 should return 2. Examples Note: some value may return incorrect result because of float imprecision >>> q = Quantizer(-2, 2, 4) >>> q.index(-1.9) 0 >>> q.round(-1.9) -2.0...
62598f9cd53ae8145f91823b
class Like(TimeStampedModel): <NEW_LINE> <INDENT> creator = models.ForeignKey(user_models.User, on_delete=models.CASCADE, null=True) <NEW_LINE> image = models.ForeignKey(Image, on_delete=models.CASCADE, null=True, related_name='likes') <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return 'User : {} - Image Cpation:...
Like Model
62598f9ca79ad16197769e11
class HuntCronAction(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> protobuf = flows_pb2.HuntCronAction <NEW_LINE> rdf_deps = [ rdf_hunts.HuntRunnerArgs, ] <NEW_LINE> def GetFlowArgsClass(self): <NEW_LINE> <INDENT> if self.flow_name: <NEW_LINE> <INDENT> flow_cls = registry.AFF4FlowRegistry.FlowClassByName(self.flow_n...
Cron Action that starts a hunt.
62598f9c38b623060ffa8e3e
class TimezoneConfigError(Exception): <NEW_LINE> <INDENT> pass
Exception class for timezone configuration related problems
62598f9c097d151d1a2c0dd4
class ExampleObject(HasStrictTraits): <NEW_LINE> <INDENT> spam = Event <NEW_LINE> eggs = Event
Test class; target for test_event_loop_until_traits_change.
62598f9c0a50d4780f705187
class TimeDependentStateSpaceModel(state_space_model.StateSpaceModel): <NEW_LINE> <INDENT> def __init__(self, static_unrolling_window_size_threshold=None): <NEW_LINE> <INDENT> super(TimeDependentStateSpaceModel, self).__init__( configuration=state_space_model.StateSpaceModelConfiguration( use_observation_noise=False, t...
A mostly trivial model which predicts values = times + 1.
62598f9c851cf427c66b8076
class NullType(TypeEngine): <NEW_LINE> <INDENT> __visit_name__ = 'null' <NEW_LINE> def _adapt_expression(self, op, othertype): <NEW_LINE> <INDENT> if othertype is NullType or not operators.is_commutative(op): <NEW_LINE> <INDENT> return op, self <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return othertype._adapt_expre...
An unknown type. NullTypes will stand in if :class:`~sqlalchemy.Table` reflection encounters a column data type unknown to SQLAlchemy. The resulting columns are nearly fully usable: the DB-API adapter will handle all translation to and from the database data type. NullType does not have sufficient information to par...
62598f9c4e4d5625663721d2
class aadict(dict): <NEW_LINE> <INDENT> def __getattr__(self, key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self.__getitem__(key) <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> return object.__getattribute__(self, key) <NEW_LINE> <DEDENT> <DEDENT> def __delattr__(self, key): <NEW_LINE> <INDENT> if...
A dict subclass that allows attribute access to be synonymous with item access, e.g. ``mydict.attribute == mydict['attribute']``. It also provides several other useful helper methods, such as :meth:`pick` and :meth:`omit`.
62598f9c6fb2d068a7693d0b
class Solution: <NEW_LINE> <INDENT> def minimumTotal(self, triangle): <NEW_LINE> <INDENT> for r in range(1, len(triangle)): <NEW_LINE> <INDENT> row = triangle[r] <NEW_LINE> prev = triangle[r - 1] <NEW_LINE> for i in range(len(row)): <NEW_LINE> <INDENT> add = prev[i - 1] if i else sys.maxint <NEW_LINE> if i != len(row) ...
@param: triangle: a list of lists of integers @return: An integer, minimum path sum
62598f9c8a43f66fc4bf1f2a
class Base1DMapper(AbstractMapper): <NEW_LINE> <INDENT> range = Instance(DataRange1D) <NEW_LINE> low_pos = Float(0.0) <NEW_LINE> high_pos = Float(1.0) <NEW_LINE> screen_bounds = Property <NEW_LINE> stretch_data = Bool(True) <NEW_LINE> _cache_valid = Bool(False) <NEW_LINE> _bounds_initialized = Bool(False) <NEW_LINE> d...
Defines an abstract mapping from a 1-D region in input space to a 1-D region in output space.
62598f9c24f1403a92685789
@StreamAlertOutput <NEW_LINE> class S3Output(AWSOutput): <NEW_LINE> <INDENT> __service__ = 'aws-s3' <NEW_LINE> @classmethod <NEW_LINE> def get_user_defined_properties(cls): <NEW_LINE> <INDENT> return OrderedDict([ ('descriptor', OutputProperty( description='a short and unique descriptor for this S3 bucket (ie: bucket n...
S3Output handles all alert dispatching for AWS S3
62598f9c596a897236127a2f
class WireframeObject: <NEW_LINE> <INDENT> def __init__(self, sla_object=False): <NEW_LINE> <INDENT> self.box = False <NEW_LINE> self.bleed = False <NEW_LINE> self.is_page = False <NEW_LINE> self.type = "undefined" <NEW_LINE> self.group_objects = [] <NEW_LINE> self.layer = -1 <NEW_LINE> self.draw_settings = { "fill": "...
Wireframe object : something to draw on the wireframe, like pages, page objects. :type sla_object: pyscribus.pages.Page, pyscribus.pageobjects.PageObject :param sla_object: PyScribus instance of drawnable object
62598f9c7047854f4633f191
class Dnstop(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "https://github.com/measurement-factory/dnstop" <NEW_LINE> git = "https://github.com/measurement-factory/dnstop.git" <NEW_LINE> version('master', branch='master') <NEW_LINE> depends_on('libpcap') <NEW_LINE> def install(self, spec, prefix): <NEW_LINE> <...
Stay on top of your DNS traffic.
62598f9c7d43ff24874272d9
class WAR_Dealer(WAR_Hand): <NEW_LINE> <INDENT> def flip_first_card(self): <NEW_LINE> <INDENT> first_card = self.cards[0] <NEW_LINE> first_card.flip()
A WAR Dealer.
62598f9c3d592f4c4edbac7e
class SyncMapInstance(InstanceResource): <NEW_LINE> <INDENT> def __init__(self, version, payload, service_sid, sid=None): <NEW_LINE> <INDENT> super(SyncMapInstance, self).__init__(version) <NEW_LINE> self._properties = { 'sid': payload.get('sid'), 'unique_name': payload.get('unique_name'), 'account_sid': payload.get('a...
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
62598f9cb7558d58954633de
class RedirectDataViewSet(mixins.ListModelMixin, mixins.CreateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = RedirectData.objects.all().order_by('created_at') <NEW_LINE> permission_classes = (AllowAny,) <NEW_LINE> serializer_class = RedirectUrlSerializer <NEW_LINE> filter_backends = (DjangoFilterB...
ViewSet to registering new redirects and getting redirects via lists for statistical analysis permission_classes - AllowAny
62598f9c4f6381625f199394
class Task(): <NEW_LINE> <INDENT> def __init__(self, function, scheduled_time, args=[], kwargs={}, id=None): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.func = function <NEW_LINE> self.args = args <NEW_LINE> self.kwargs = kwargs <NEW_LINE> self.time = scheduled_time <NEW_LINE> self.created = datetime.now() <NEW_LI...
Data structure representing scheduled tasks with underlying functions,
62598f9c56b00c62f0fb2660
class QuasiStaticGraspQualityConfig(GraspQualityConfig): <NEW_LINE> <INDENT> REQUIRED_KEYS = ['quality_method', 'friction_coef', 'num_cone_faces', 'soft_fingers', 'quality_type', 'check_approach', 'all_contacts_required'] <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> GraspQualityConfig.__init__(self, confi...
Parameters for quasi-static grasp quality computation. Attributes ---------- config : :obj:`dict` dictionary mapping parameter names to parameter values Notes ----- Required configuration key-value pairs in Other Parameters. Other Parameters ---------------- quality_method : :obj:`str` string name of quasi-stat...
62598f9cd53ae8145f91823d
class DT(Enum): <NEW_LINE> <INDENT> DT_NULL = 0 <NEW_LINE> DT_NEEDED = 1 <NEW_LINE> DT_PLTRELSZ = 2 <NEW_LINE> DT_PLTGOT = 3 <NEW_LINE> DT_HASH = 4 <NEW_LINE> DT_STRTAB = 5 <NEW_LINE> DT_SYMTAB = 6 <NEW_LINE> DT_RELA = 7 <NEW_LINE> DT_RELASZ = 8 <NEW_LINE> DT_RELAENT = 9 <NEW_LINE> DT_STRSZ = 10 <NEW_LINE> DT_SYMENT = ...
d_tag enumeration
62598f9c56ac1b37e6301f99
class NotFound(HTTPException): <NEW_LINE> <INDENT> code = 404 <NEW_LINE> description = ( 'The requested URL was not found on the server. ' 'If you entered the URL manually please check your spelling and ' 'try again.' )
*404* `Not Found` Raise if a resource does not exist and never existed.
62598f9c76e4537e8c3ef365
class Rfid: <NEW_LINE> <INDENT> _s = serial.Serial() <NEW_LINE> _s.port = None <NEW_LINE> _s.baudrate = 9600 <NEW_LINE> _s.bytesize = 8 <NEW_LINE> _s.parity = 'N' <NEW_LINE> _s.stopbits = 1 <NEW_LINE> _s.timeout = 10 <NEW_LINE> crc = 0 <NEW_LINE> def CRC_calcCrc8(self, data): <NEW_LINE> <INDENT> dcdBitMask = 0x80 <NEW_...
The basic class definition
62598f9c38b623060ffa8e40
class DerivedUpnpSensor(UpnpSensor): <NEW_LINE> <INDENT> def __init__(self, coordinator, device, sensor_type) -> None: <NEW_LINE> <INDENT> super().__init__(coordinator, device, sensor_type) <NEW_LINE> self._last_value = None <NEW_LINE> self._last_timestamp = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) ...
Representation of a UNIT Sent/Received per second sensor.
62598f9c3617ad0b5ee05eff
class Teleport(CustomAction): <NEW_LINE> <INDENT> def __init__(self, state_clone, action, steps, reward): <NEW_LINE> <INDENT> self.state_clone = state_clone <NEW_LINE> self.action = action <NEW_LINE> self.steps = steps <NEW_LINE> self.reward = reward <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Te...
Step reloads the provided ALEState
62598f9cadb09d7d5dc0a339
class Experiment(object): <NEW_LINE> <INDENT> pass
Experiment Handler
62598f9c85dfad0860cbf94c
class Session(BaseModel): <NEW_LINE> <INDENT> STATUS = ( ('L', 'link_sent'), ('LNS', 'link_not_sent'), ('C', 'completed'), ('P', 'in_process'), ('F', 'failure'), ) <NEW_LINE> MEDIUM = ( ('facebook', 'Facebook'), ('webchat', 'WebChat'), ('skype', 'Skype') ) <NEW_LINE> recipient_id = models.CharField(max_length=1000, bla...
A Session represents a single person's current status traversing through a Tree. It is a way to persist information about what state they are in, how many retries they have had, etc. so that we aren't storing all of that in-memory.
62598f9c097d151d1a2c0dd6
@register_op(doc_str="") <NEW_LINE> class reverse(Operation): <NEW_LINE> <INDENT> input_spec = InputSpec( x=TensorInputType(), axes=IntTensorInputType(const=True, optional=True), ) <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(reverse, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def type_inference...
Reverses the order of the input tensor ``x`` along specified ``axes``(dimensions). Parameters ---------- x: tensor<*?, T> (Required) * Input tensor. axes: const<D, i32> Optional * Dimension(s) to reverse. Each axis must be in the range ``[-rank(x), rank(x)]``. * Defaults to None (reverse on all dimensions)...
62598f9c7d847024c075c182
class DailyCache(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._dict = {} <NEW_LINE> self._daemon_start() <NEW_LINE> <DEDENT> def _daemon_start(self): <NEW_LINE> <INDENT> t = threading.Thread(target=self._daemon_run) <NEW_LINE> t.setName('DailyCache') <NEW_LINE> t.setDaemon(True) <NEW_LINE> ...
每日零点自动重置的缓存器
62598f9c32920d7e50bc5e06
class Fragment(object): <NEW_LINE> <INDENT> __slots__ = ('children',) <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> self.children = [] <NEW_LINE> for arg in args: <NEW_LINE> <INDENT> self.append(arg) <NEW_LINE> <DEDENT> <DEDENT> def __html__(self): <NEW_LINE> <INDENT> return Markup(str(self)) <NEW_LINE> <DE...
A fragment represents a sequence of strings or elements.
62598f9c8e71fb1e983bb865
class UndefinedGeographicCoordinateReferenceSystem(SpatialReferenceSystem): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(UndefinedGeographicCoordinateReferenceSystem, self).__init__() <NEW_LINE> <DEDENT> spatial_ref_sys_name = "undefined geographic coordinate reference system" <NEW_LINE> srs_identi...
undefined geographic coordinate reference systems projection class. see: http://www.geopackage.org/spec121/#r11
62598f9c0a50d4780f705189
class ExtensionMixin(object): <NEW_LINE> <INDENT> input_exts = None <NEW_LINE> output_ext = None <NEW_LINE> def __init__(self, input_ext=None, input_exts=None, output_ext=None, *args, **kwargs): <NEW_LINE> <INDENT> super(ExtensionMixin, self).__init__(*args, **kwargs) <NEW_LINE> if input_ext: <NEW_LINE> <INDENT> self.i...
A mixin for filters that take a file with a certain file extension and output another. For example, SassFilter generally takes files with the exentions ".scss" and ".sass" and output CSS files (".css"). Attributes: input_exts: A tuple of extensions (without the prefixed ".") output_ext: A single output extens...
62598f9c3eb6a72ae038a3f0
class DateEncoder(json.JSONEncoder): <NEW_LINE> <INDENT> def default(self, o): <NEW_LINE> <INDENT> if isinstance(o, datetime): <NEW_LINE> <INDENT> return [o.year, o.month, o.day, o.minute, o.second, o.microsecond] <NEW_LINE> <DEDENT> elif isinstance(o, date): <NEW_LINE> <INDENT> return [o.year, o.month, o.day] <NEW_LIN...
Encode dates and datetimes as lists.
62598f9c8da39b475be02f95
class ExportSingleText(G2IO.ExportBaseclass): <NEW_LINE> <INDENT> def __init__(self,G2frame): <NEW_LINE> <INDENT> super(self.__class__,self).__init__( G2frame=G2frame, formatName = 'Text file', extension='.txt', longFormatName = 'Export reflection list as a text file' ) <NEW_LINE> self.exporttype = ['single'] <NEW_LINE...
Used to create a text file with single crystal reflection data skips user rejected & space group extinct reflections :param wx.Frame G2frame: reference to main GSAS-II frame
62598f9c6aa9bd52df0d4c7d
class DocumentClass(Macro): <NEW_LINE> <INDENT> def __init__(self, flap): <NEW_LINE> <INDENT> super().__init__(flap, "documentclass", None, None) <NEW_LINE> <DEDENT> def _capture_arguments(self, parser, invocation): <NEW_LINE> <INDENT> invocation.append_argument("options", parser.read.options()) <NEW_LINE> invocation.a...
Extract some specific document class, e.g., subfile
62598f9ca219f33f346c65ca