code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class TestTaskInstanceCollection(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return TaskInst... | TaskInstanceCollection unit test stubs | 62598f90a8ecb03325870e31 |
class SponsorshipPeriodDetailView(SponsorshipPeriodMixin, DetailView): <NEW_LINE> <INDENT> context_object_name = 'sponsorshipperiod' <NEW_LINE> template_name = 'sponsorship_period/detail.html' <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> qs = SponsorshipPeriod.approved_objects.all() <NEW_LINE> return qs <NEW_... | Detail view for Sponsorship Period. | 62598f90cb5e8a47e493bf87 |
class Movie(): <NEW_LINE> <INDENT> def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube): <NEW_LINE> <INDENT> self.title = movie_title <NEW_LINE> self.storyline = movie_storyline <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = trailer_youtube <NEW_LINE> <D... | Movie information for movie trailer website | 62598f90851cf427c66b7eef |
class OpenMpiOversubscribe(OpenMPI): <NEW_LINE> <INDENT> _mpirun_version = staticmethod(lambda ver: version_in_range(ver, '1.7.0', '3')) <NEW_LINE> def set_mpiexec_options(self): <NEW_LINE> <INDENT> super(OpenMpiOversubscribe, self).set_mpiexec_options() <NEW_LINE> if self.is_oversubscribed(): <NEW_LINE> <INDENT> self.... | An implementation of the MPI class for OpenMPI. Starting from version 1.7, --oversubscribe has to be used
when requesting more processes than available processors. | 62598f9073bcbd0ca4bc9e80 |
@attr.s <NEW_LINE> class LimitError(Exception): <NEW_LINE> <INDENT> nova_message = attr.ib() | Error to be raised when a limit has been exceeded. | 62598f90b5575c28eb712ae2 |
class AttributeListeningChannel(ZigbeeChannel): <NEW_LINE> <INDENT> REPORT_CONFIG = [{"attr": 0, "config": REPORT_CONFIG_DEFAULT}] <NEW_LINE> def __init__(self, cluster, device): <NEW_LINE> <INDENT> super().__init__(cluster, device) <NEW_LINE> attr = self._report_config[0].get("attr") <NEW_LINE> if isinstance(attr, str... | Channel for attribute reports from the cluster. | 62598f904428ac0f6e658154 |
class TestBpSpNz(OVBase): <NEW_LINE> <INDENT> def setup_class(self): <NEW_LINE> <INDENT> self.sprange = (5000, 6000) <NEW_LINE> self.spnonzero = self.sprange <NEW_LINE> self.bprange = (1000, 10000) <NEW_LINE> self.bpnonzero = (5500, 5700) <NEW_LINE> super(TestBpSpNz, self).defarrays(self) <NEW_LINE> self.cref = 'full' ... | Passes per current defn that looks at bp.nonzero, sp.def. | 62598f904e4d56256637204b |
class BaseCommand(Command): <NEW_LINE> <INDENT> auto_setup_app = True <NEW_LINE> def run(self, parsed_args): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> super().run(parsed_args) <NEW_LINE> <DEDENT> except CommandAbortedError as exc: <NEW_LINE> <INDENT> if parsed_args.raise_error: <NEW_LINE> <INDENT> raise <NEW_LINE> <... | Setup ap at take_action call | 62598f904e4d56256637204c |
@register('squad_dataset_reader') <NEW_LINE> class SquadDatasetReader(DatasetReader): <NEW_LINE> <INDENT> url_squad = 'http://lnsigo.mipt.ru/export/datasets/squad-v1.1.tar.gz' <NEW_LINE> url_sber_squad = 'http://lnsigo.mipt.ru/export/datasets/sber_squad-v1.1.tar.gz' <NEW_LINE> def read(self, dir_path: str, dataset='SQu... | Stanford Question Answering Dataset
https://rajpurkar.github.io/SQuAD-explorer/
and
Russian dataset from SDSJ
https://www.sdsj.ru/ru/contest.html | 62598f90baa26c4b54d4eee4 |
class NodeUnassignmentHandler(BaseHandler): <NEW_LINE> <INDENT> validator = NodeUnassignmentValidator <NEW_LINE> @content_json <NEW_LINE> def POST(self, cluster_id): <NEW_LINE> <INDENT> nodes = self.checked_data(self.validator.validate_collection_update) <NEW_LINE> for node in nodes: <NEW_LINE> <INDENT> if node.status ... | Node assignment handler
| 62598f901f037a2d8b9e3d0b |
class LayerArtistContainer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.artists = [] <NEW_LINE> self.empty_callbacks = CallbackContainer() <NEW_LINE> self.change_callbacks = CallbackContainer() <NEW_LINE> self._ignore_empty_callbacks = False <NEW_LINE> self._ignore_change_callbacks = False ... | A collection of LayerArtists | 62598f9029b78933be269ef3 |
class Node(object): <NEW_LINE> <INDENT> pass | Abstract class representing a node. | 62598f9030dc7b766599f488 |
class Query( coresetup.schema.contact_schema.Query, coresetup.schema.spent_schema.Query, coresetup.schema.owe_schema.Query, graphene.ObjectType): <NEW_LINE> <INDENT> pass | docstring here
:param coresetup.schema.Query:
:param graphene.ObjectType: | 62598f9055399d3f0562614a |
class AddEmailToListResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. (The response from SendGrid. The format corresponds to the ResponseFormat input. Default is json.) | 62598f908c0ade5d55dc34a3 |
class TestDockerCreateOptions(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 testDockerCreateOptions(self): <NEW_LINE> <INDENT> pass | DockerCreateOptions unit test stubs | 62598f9023e79379d538c130 |
class Falseexp(BooleanConst): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Falseexp, self).__init__("FALSE", *args, **kwargs) <NEW_LINE> <DEDENT> def __deepcopy__(self, memo): <NEW_LINE> <INDENT> return Falseexp() | The FALSE constant. | 62598f90d7e4931a7ef3bcce |
class Layout(object): <NEW_LINE> <INDENT> def __init__(self, *fields): <NEW_LINE> <INDENT> self.fields = list(fields) <NEW_LINE> <DEDENT> def render(self, form, form_style, context): <NEW_LINE> <INDENT> html = "" <NEW_LINE> for field in self.fields: <NEW_LINE> <INDENT> html += render_field(field, form, form_style, cont... | Form Layout. It is conformed by Layout objects: `Fieldset`, `Row`, `Column`, `MultiField`,
`HTML`, `ButtonHolder`, `Button`, `Hidden`, `Reset`, `Submit` and fields. Form fields
have to be strings.
Layout objects `Fieldset`, `Row`, `Column`, `MultiField` and `ButtonHolder` can hold other
Layout objects within. Though `B... | 62598f90dc8b845886d531ea |
class Solution: <NEW_LINE> <INDENT> def validTree(self, n, edges): <NEW_LINE> <INDENT> if n - 1 != len(edges): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> neighbors, visited, queue = {}, {0: True}, collections.deque([0]) <NEW_LINE> for i, j in edges: <NEW_LINE> <INDENT> if i not in neighbors: <NEW_LINE> <INDEN... | @param n: An integer
@param edges: a list of undirected edges
@return: true if it's a valid tree, or false | 62598f90b7558d589546325a |
class CheckpointDecoder: <NEW_LINE> <INDENT> def __init__(self, context: mx.context.Context, inputs: str, references: str, model: str, max_input_len: int, beam_size=C.DEFAULT_BEAM_SIZE, limit: int = -1) -> None: <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.max_input_len = max_input_len <NEW_LINE> self.bea... | Decodes a (random sample of a) dataset using parameters at given checkpoint and computes BLEU against references.
:param context: MXNet context to bind the model to.
:param inputs: Path to file containing input sentences.
:param references: Path to file containing references.
:param model: Model to load.
:param max_in... | 62598f90f7d966606f747c0f |
class _MemoryWatcher: <NEW_LINE> <INDENT> def __init__(self, space_limit): <NEW_LINE> <INDENT> self.limit = space_limit <NEW_LINE> self._status = "" <NEW_LINE> <DEDENT> def _set_status(self, status): <NEW_LINE> <INDENT> self._status = status <NEW_LINE> <DEDENT> def status(self): <NEW_LINE> <INDENT> return self._status ... | Context manager for clearing memory before and measuring memory usage
after using a specific section of code.
* works by parsing procfs; only available on linux.
* unless the limit is set to 0, throws an exception upon exiting the
context if the memory limit has been breached | 62598f9091af0d3eaad39a31 |
class Car(): <NEW_LINE> <INDENT> def __init__(self) -> None: <NEW_LINE> <INDENT> mh = Adafruit_MotorHAT(addr=0x60) <NEW_LINE> driveMotor = mh.getMotor(1) <NEW_LINE> steerMotor = mh.getMotor(2) <NEW_LINE> atexit.register(turnOffMotors) <NEW_LINE> <DEDENT> def turnOffMotors(self) -> None: <NEW_LINE> <INDENT> mh.getMotor(... | Initialize car and control functions | 62598f9001c39578d7f129b4 |
class PackerBNF(Packer, PackerBNFMixin): <NEW_LINE> <INDENT> pass | BNF (Bin Next Fit)
Only one open bin, if cuboid doesn't fit
go to next bin and close current one. | 62598f9023849d37ff850cf1 |
class Board(Win): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Win.__init__(self, title='BOARD', opad=5) <NEW_LINE> coltext, rowtext, font = 'ABCDEFGH', '12345678', 'Arial 12 bold' <NEW_LINE> self.colors = ('#F00','#0F0') <NEW_LINE> self.button=Button(self, height=1, text="ok", command=self.cb_ok) <NEW_L... | a clickable 8x8 board | 62598f90eab8aa0e5d30b9ad |
class BuiltinType(FieldType): <NEW_LINE> <INDENT> def __init__(self, builtin): <NEW_LINE> <INDENT> if isinstance(builtin, type) and issubclass(builtin, six.string_types): <NEW_LINE> <INDENT> builtin = six.text_type <NEW_LINE> <DEDENT> self.builtin = builtin <NEW_LINE> <DEDENT> def encode(self, cls, name, value): <NEW_L... | Used for built-in Python types which can be called with a single argument. | 62598f90442bda511e95c090 |
class AutoTableNameMeta(declarative.DeclarativeMeta): <NEW_LINE> <INDENT> def __init__(cls, name, bases, dict_): <NEW_LINE> <INDENT> if '_decl_class_registry' not in cls.__dict__: <NEW_LINE> <INDENT> if '__tablename__' not in cls.__dict__ and not cls.__dict__.get('__abstract__', False): <NEW_LINE> <I... | Declarative metaclass automatically giving the same name to table as
mapped class. Example:
Base = declarative_base(name='Base', metaclass=AutoTableNameMeta)
class MyClass(Base):
…
is equivalent to
Base = declarative_base(name='Base')
class MyClass(Base):
__tablename__ = 'MyClass'
... | 62598f90379a373c97d98c48 |
class Module(BaseModule): <NEW_LINE> <INDENT> def __init__(self, importeur): <NEW_LINE> <INDENT> BaseModule.__init__(self, importeur, "email", "primaire") <NEW_LINE> self.logger = type(self.importeur).man_logs.creer_logger("email", "emails", "envoyes.log") <NEW_LINE> self.serveur_mail = False <NEW_LINE> ... | Classe représentant le module 'email'.
Ce module permet, comme son nom l'indique, d'envoyer des e-mails aux
clients.
NOTE IMPORTANTE: il est préférable de faire tourner, sur le serveur
hébergeant le projet, un serveur mail afin de pouvoir envoyer ces e-mails.
Ils peuvent être de diférentes natures, pour avertir le dé... | 62598f9038b623060ffa8cb7 |
class DataSource(object): <NEW_LINE> <INDENT> def __init__(self, name, client): <NEW_LINE> <INDENT> self.data_source_name = name <NEW_LINE> self.path = "/admin/data_sources/{}".format(name) <NEW_LINE> self.client = client <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> return self.data_sour... | Initializes a DataSource
See Also:
https://docs.stardog.com/virtual-graphs/virtual-sources | 62598f907cff6e4e811b5647 |
class Sequence: <NEW_LINE> <INDENT> _CODES = {} <NEW_LINE> _type = "unknown" <NEW_LINE> def __init__(self, string): <NEW_LINE> <INDENT> self._string = string.upper() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<{} (length: {})>".format( self.__class__.__name__, len(self._string) ) <NEW_LINE> <DE... | A string sequence of some kind.
:param str string: the raw string. | 62598f903cc13d1c6d465399 |
class TextOutput(object): <NEW_LINE> <INDENT> def __init__(self, handle): <NEW_LINE> <INDENT> self.handle = handle <NEW_LINE> <DEDENT> def write(self, line): <NEW_LINE> <INDENT> self.re_eol.sub("\n", line) <NEW_LINE> self.handle.write(line) | Iterator class for processing text output. | 62598f9030dc7b766599f48a |
class ShellBatch(BatchBase): <NEW_LINE> <INDENT> def _write_split(self, isplit, fof_split): <NEW_LINE> <INDENT> self._write_script(isplit, fof_split) | just write out the scripts, no submit files | 62598f905f7d997b871f91f2 |
class RMapplots(RPackage): <NEW_LINE> <INDENT> homepage = "https://cloud.r-project.org/package=mapplots" <NEW_LINE> url = "https://cloud.r-project.org/src/contrib/mapplots_1.5.1.tar.gz" <NEW_LINE> list_url = "https://cloud.r-project.org/src/contrib/Archive/mapplots" <NEW_LINE> version('1.5.1', sha256='37e96d34f379... | mapplots: Data Visualisation on Maps | 62598f9015baa72349461bac |
class QStatusTipEvent(__PyQt4_QtCore.QEvent): <NEW_LINE> <INDENT> def tip(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __init__(self, *__args): <NEW_LINE> <INDENT> pass | QStatusTipEvent(QString)
QStatusTipEvent(QStatusTipEvent) | 62598f9082261d6c5272fced |
class Trie(object): <NEW_LINE> <INDENT> def __init__(self, words): <NEW_LINE> <INDENT> self.tree = self._build_tree(words) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self.tree) <NEW_LINE> <DEDENT> def _build_tree(self, words): <NEW_LINE> <INDENT> head = {} <NEW_LINE> for word in words: <NEW_L... | Trie class to match one or many strings.
Properties:
tree {dict} -- Multi-level dict. Set the common prefix as key,
end with "|". e.g. words → tree
words: ["hi", "how", "high"]
tree: {"h": {"i": {"|": None, "g": {"h": {"|": None}}},
"o": {"w": {"|": None}}}} | 62598f9015fb5d323ce7e960 |
@implementer(ITemplateLoader) <NEW_LINE> class XMLFile: <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> if not isinstance(path, FilePath): <NEW_LINE> <INDENT> warnings.warn( "Passing filenames or file objects to XMLFile is deprecated " "since Twisted 12.1. Pass a FilePath instead.", category=Deprecat... | An L{ITemplateLoader} that loads and parses XML from a file.
@ivar _loadedTemplate: The loaded document, or L{None}, if not loaded.
@type _loadedTemplate: a C{list} of Stan objects, or L{None}.
@ivar _path: The L{FilePath}, file object, or filename that is being
loaded from. | 62598f907b25080760ed70de |
class DigitLetterSplitter(BaseReplacer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.pattern_replace_pair_list = [ (r"(\d+)[\.\-]*([a-zA-Z]+)", r"\1 \2"), (r"([a-zA-Z]+)[\.\-]*(\d+)", r"\1 \2"), ] | x:
1x1x1x1x1 -> 1 x 1 x 1 x 1 x 1
19.875x31.5x1 -> 19.875 x 31.5 x 1
-:
1-Gang -> 1 Gang
48-Light -> 48 Light
.:
includes a tile flange to further simplify installation.60 in. L x 36 in. W x 20 in. ->
includes a tile flange to further simplify installation. 60 in. L x 36 in. W x 20 in. | 62598f9023e79379d538c133 |
class Author(ndb.Model): <NEW_LINE> <INDENT> identity = ndb.StringProperty() <NEW_LINE> email = ndb.StringProperty() | Author model storing credentials | 62598f9021a7993f00c65baa |
class TrackPositionTimer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._state = PlaybackState.STOPPED <NEW_LINE> self._accumulated = 0 <NEW_LINE> self._started = 0 <NEW_LINE> <DEDENT> def play(self): <NEW_LINE> <INDENT> self._state = PlaybackState.PLAYING <NEW_LINE> self._accumulated = 0 <NE... | Keeps track of time position in a track using the wall clock and playback
events.
To not introduce a reverse dependency on the playback controller, this
class keeps track of playback state itself. | 62598f900c0af96317c55fb3 |
class LinodeBinarySensor(BinarySensorEntity): <NEW_LINE> <INDENT> _attr_device_class = DEVICE_CLASS_MOVING <NEW_LINE> def __init__(self, li, node_id): <NEW_LINE> <INDENT> self._linode = li <NEW_LINE> self._node_id = node_id <NEW_LINE> self._state = None <NEW_LINE> self.data = None <NEW_LINE> self._attrs = {} <NEW_LINE>... | Representation of a Linode droplet sensor. | 62598f9023849d37ff850cf3 |
class UnpackTarArchive(Command): <NEW_LINE> <INDENT> def __init__(self, archive, dir, filters=[], compression=None): <NEW_LINE> <INDENT> self.archive = archive <NEW_LINE> self.dir = dir <NEW_LINE> exclude = [("--exclude=%s" % _filter) for _filter in filters] <NEW_LINE> if not compression: <NEW_LINE> <INDENT> compressio... | Wrap tar to unpack a compressed tar archive | 62598f90b57a9660fecd16b0 |
class Enrollment(models.Model): <NEW_LINE> <INDENT> account = models.ForeignKey('Account') <NEW_LINE> class_list = models.ForeignKey('ClassList') <NEW_LINE> date = models.DateTimeField(auto_now_add=True) | 已报名班级 | 62598f90a17c0f6771d5be6b |
class GraphProblem(Problem): <NEW_LINE> <INDENT> def __init__(self, initial, goal, graph): <NEW_LINE> <INDENT> Problem.__init__(self, initial, goal) <NEW_LINE> self.graph = graph <NEW_LINE> <DEDENT> def actions(self, A): <NEW_LINE> <INDENT> return list(self.graph.get(A).keys()) <NEW_LINE> <DEDENT> def result(self, stat... | The problem of searching a graph from one node to another. | 62598f900c0af96317c55fb4 |
class Document(): <NEW_LINE> <INDENT> def __init__(self, post_text, stopwords, clean_length): <NEW_LINE> <INDENT> self.text = post_text.lower() <NEW_LINE> self.word_list(clean_length, stopwords) <NEW_LINE> self.tokens = np.array(wordpunct_tokenize(self.text)) <NEW_LINE> <DEDENT> def word_list(self, clean_length, stopwo... | The Doc class rpresents a class of individul documents
| 62598f9045492302aabfc107 |
class IRichtextField(IBaseField): <NEW_LINE> <INDENT> height = TextLine(title=u'Height', description=u'Height in pixels', required=False) | Text field schema | 62598f9024f1403a926856c8 |
class TestRuleArray(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 testRuleArray(self): <NEW_LINE> <INDENT> pass | RuleArray unit test stubs | 62598f906e29344779b00288 |
class NodeCMD(object): <NEW_LINE> <INDENT> def __init__(self, req, callback): <NEW_LINE> <INDENT> self.req = req.replace(r'\r', r'\\r').replace(r'\n', r'\\n') <NEW_LINE> self.callback = callback <NEW_LINE> <DEDENT> def read(self, data): <NEW_LINE> <INDENT> if self.callback is not None: <NEW_LINE> <INDENT> self.callback... | docstring for NodeCMD_Base | 62598f9063d6d428bbee23ed |
class Suppress(TokenConverter): <NEW_LINE> <INDENT> def __init__(self, expr: Union[ParserElement, str], savelist: bool = False): <NEW_LINE> <INDENT> if expr is ...: <NEW_LINE> <INDENT> expr = _PendingSkip(NoMatch()) <NEW_LINE> <DEDENT> super().__init__(expr) <NEW_LINE> <DEDENT> def __add__(self, other): <NEW_LINE> <IND... | Converter for ignoring the results of a parsed expression.
Example::
source = "a, b, c,d"
wd = Word(alphas)
wd_list1 = wd + ZeroOrMore(',' + wd)
print(wd_list1.parse_string(source))
# often, delimiters that are useful during parsing are just in the
# way afterward - use Suppress to keep them ... | 62598f90a219f33f346c644b |
class _CartEntry(object): <NEW_LINE> <INDENT> def __set_name__(self, cls, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> <DEDENT> def __get__(self, instance, _): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return instance.cart_alg.stats[instance._cur_box][self.name] <NEW_LINE> <DEDENT> except KeyError: <NEW_LI... | a descriptor for the current leaf | 62598f909b70327d1c57e9d1 |
class ActivateAnonymousConnectionTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.program = program_utils.seedProgram() <NEW_LINE> <DEDENT> def testInvalidToken(self): <NEW_LINE> <INDENT> profile = profile_utils.seedNDBProfile(self.program.key()) <NEW_LINE> with self.assertRaises(V... | Unit test for actions related to the activateAnonymousConnection
function. | 62598f90fbf16365ca793ce3 |
class GenericPackageRenamingDecl(GenericRenamingDecl): <NEW_LINE> <INDENT> name = Field(type=T.DefiningName) <NEW_LINE> renames = Field(type=T.Name) <NEW_LINE> aspects = Field(type=T.AspectSpec) <NEW_LINE> defining_names = Property(Entity.name.singleton) <NEW_LINE> defining_env = Property(Entity.resolve.defining_env) <... | Declaration for a generic package renaming. | 62598f90dc8b845886d531ee |
class RecordSet(metaclass=ABCMeta): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def _next(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def __next__(self): <NEW_LINE> <INDENT> return tuple(self._next()) <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> while True: <NEW_LINE> <I... | A RecordSet is returned whenever a query is executed. It provides an interface to the selected
data. Each row is yielded as a tuple. | 62598f90a17c0f6771d5be6c |
class LambertAzimuthalEqualArea(Projection): <NEW_LINE> <INDENT> def __init__(self, central_longitude=0.0, central_latitude=0.0, false_easting=0.0, false_northing=0.0, globe=None): <NEW_LINE> <INDENT> proj4_params = [('proj', 'laea'), ('lon_0', central_longitude), ('lat_0', central_latitude), ('x_0', false_easting), ('... | A Lambert Azimuthal Equal-Area projection. | 62598f903c8af77a43b67d52 |
class ColorOrganist: <NEW_LINE> <INDENT> def __init__(self, ctrl_channel, note_trig, col_gen): <NEW_LINE> <INDENT> self.ctrl_channel = ctrl_channel <NEW_LINE> self.note_trig = note_trig <NEW_LINE> self.col_gen = col_gen <NEW_LINE> <DEDENT> def play(self, midi_port): <NEW_LINE> <INDENT> if not self.note_trig.trigger(): ... | Takes a stream of colors and sends them to a LD50 color organ. | 62598f90009cb60464d01160 |
class SEOThumbnailBackend(ThumbnailBackend): <NEW_LINE> <INDENT> def _get_thumbnail_filename(self, source, geometry_string, options): <NEW_LINE> <INDENT> key = tokey(source.key, geometry_string, serialize(options)) <NEW_LINE> path = '%s/%s/%s' % (key[:2], key[2:4], key) <NEW_LINE> return '%s%s/%s' % ( settings.THUMBNAI... | SEO friendly thumbnail file names | 62598f900a50d4780f705006 |
class FlowOperationMetadata(_messages.Message): <NEW_LINE> <INDENT> class CancelStateValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> RUNNING = 0 <NEW_LINE> UNCANCELLABLE = 1 <NEW_LINE> CANCELLED = 2 <NEW_LINE> <DEDENT> class SurfaceValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> UNSPECIFIED_OP_SERVICE = 0 <NE... | The metadata associated with a long running operation resource.
Enums:
CancelStateValueValuesEnum: The state of the operation with respect to
cancellation.
SurfaceValueValuesEnum:
Fields:
cancelState: The state of the operation with respect to cancellation.
deadline: Deadline for the flow to complete, to ... | 62598f90287bf620b62717ee |
class Token: <NEW_LINE> <INDENT> def __init__(self, ref, word, pos, upos, baseform, ne, dephead_ref, deprel, start, end): <NEW_LINE> <INDENT> self.ref = ref <NEW_LINE> self.word = word <NEW_LINE> self.pos = pos <NEW_LINE> self.upos = upos <NEW_LINE> self.baseform = baseform <NEW_LINE> self.ne = ne <NEW_LINE> self.dephe... | Object to store annotation information for a token. | 62598f90a17c0f6771d5be6d |
class GenTaskOptions(NamedTuple): <NEW_LINE> <INDENT> create_misc_suite: bool <NEW_LINE> is_patch: bool <NEW_LINE> generated_config_dir: str <NEW_LINE> use_default_timeouts: bool <NEW_LINE> def suite_location(self, suite_name: str) -> str: <NEW_LINE> <INDENT> return self.generated_file_location(os.path.basename(suite_n... | Options for how Evergreen tasks should be generated.
large_distro_name: Name of distro "large" tasks should be run on.
create_misc_suite: Should "misc" suites be generated.
is_patch: This generation is part of a patch build.
generated_config_dir: Path to directory that configuration files should be written.
use_defaul... | 62598f9071ff763f4b5e73a7 |
class VFSDirectory(aff4.AFF4Volume): <NEW_LINE> <INDENT> default_container = "VFSDirectory" <NEW_LINE> _behaviours = frozenset(["Container"]) <NEW_LINE> def Update(self, attribute=None, priority=None): <NEW_LINE> <INDENT> client_id = self.urn.Split()[0] <NEW_LINE> if attribute == "CONTAINS": <NEW_LINE> <INDENT> flow_id... | This represents a directory from the client. | 62598f90656771135c4892b2 |
class FeedbackController(object): <NEW_LINE> <INDENT> def __init__(self, fbpath=None, port=None, protocol='bcixml'): <NEW_LINE> <INDENT> self.logger = logging.getLogger("FeedbackController") <NEW_LINE> self.ipcchannel = ipc.IPCConnectionHandler(self) <NEW_LINE> self.udpconnectionhandler = UDPDispatcher(self, protocol) ... | Feedback Controller.
Controlls the loading, unloading, starting, pausing and stopping of the
Feedbacks. Can query the Feedback for it's variables and can as well set
them. | 62598f907b25080760ed70e2 |
class AllAcceptingAuthenticationPlugin(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def authenticate(self, environ, identity): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> login = identity['login'] <NEW_LINE> password = identity['password'] <NEW_LINE> if... | When challenged, the client can specify whatever
user name she likes, and this authenticator will
believe her. | 62598f900383005118f6d32e |
class TestTunnelling: <NEW_LINE> <INDENT> async def test_tunnelling(self): <NEW_LINE> <INDENT> xknx = XKNX() <NEW_LINE> communication_channel_id = 23 <NEW_LINE> data_endpoint = ("192.168.1.2", 4567) <NEW_LINE> udp_transport = UDPTransport(xknx, ("192.168.1.1", 0), ("192.168.1.2", 1234)) <NEW_LINE> telegram = Telegram( ... | Test class for xknx/io/Tunnelling objects. | 62598f9026068e7796d4c593 |
class NordicParsingError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value | Internal general error for IO operations in obspy.core.io.nordic. | 62598f906e29344779b0028a |
class AddForm(base.AddForm): <NEW_LINE> <INDENT> form_fields = form.Fields(IProgressPortlet) <NEW_LINE> label = _(u"Add Workflow Percentage Bar portlet") <NEW_LINE> description = _(u"This portlet shows workflow progress information (%)") <NEW_LINE> def create(self, data): <NEW_LINE> <INDENT> return Assignment(label=dat... | Add portlet
| 62598f9094891a1f408b9509 |
class AutoCheckLog(Plugin): <NEW_LINE> <INDENT> name = 'autochecklog' <NEW_LINE> def options(self, parser, env=os.environ): <NEW_LINE> <INDENT> super(AutoCheckLog, self).options(parser, env=env) <NEW_LINE> <DEDENT> def configure(self, options, conf): <NEW_LINE> <INDENT> super(AutoCheckLog, self).configure(options, conf... | This plugin log helper for test_steps module in nose.
Usage examples:
> nosetests --with-autochecklog | 62598f90fbf16365ca793ce5 |
class XlExtract: <NEW_LINE> <INDENT> def __init__(self, dir_path): <NEW_LINE> <INDENT> hide_excel(True) <NEW_LINE> self.path = dir_path <NEW_LINE> self.name = os.path.split(dir_path)[1] <NEW_LINE> self.date = mod_date(dir_path) <NEW_LINE> self.wb = xw.Book(self.path) <NEW_LINE> self.sheets = self.wb.sheets <NEW_LINE> <... | Class Dependency: XlArray (for XlEdit.extract())
Extract data from an existing Excel documents using
the xlwings module. | 62598f90a4f1c619b294e21e |
class fzf_cd_from_here(Command): <NEW_LINE> <INDENT> def execute(self): <NEW_LINE> <INDENT> cwd = curdir <NEW_LINE> command = 'eval ${FZF_ALT_C_COMMAND} 2> /dev/null | FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS $FZF_ALT_C_OPTS" fzf +m' <NEW_LINE> fzf = self.fm.execute_command(command, stdout=PIPE) <NEW_LINE> stdout, stderr = ... | :fzf_select
Find a file using fzf and fd.
With a prefix argument select only directories.
See:
https://github.com/junegunn/fzf
https://github.com/sharkdp/fd.git | 62598f908c0ade5d55dc34a6 |
class Critic(nn.Module): <NEW_LINE> <INDENT> def __init__(self, state_size, action_size, seed, fcs1_units=400, fc2_units=300): <NEW_LINE> <INDENT> super(Critic, self).__init__() <NEW_LINE> self.seed = torch.manual_seed(seed) <NEW_LINE> self.fcs1 = nn.Linear(state_size, fcs1_units) <NEW_LINE> self.fc2 = nn.Linear(fcs1_u... | Critic (Value) Model. | 62598f900c0af96317c55fb7 |
class AdminTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(AdminTests, self).setUp() <NEW_LINE> self.user = UserFactory(is_staff=True, is_superuser=True) <NEW_LINE> self.client.login(username=self.user.username, password=USER_PASSWORD) <NEW_LINE> self.site = Site.objects.get(pk=settings.... | Tests Admin page and customize form. | 62598f9096565a6dacd2cd93 |
class ImpressumView(generic.TemplateView): <NEW_LINE> <INDENT> template_name = 'tasks/impressum.html' | This view shows the imprint.
| 62598f906fb2d068a7693c4b |
@register_command <NEW_LINE> class GlibcHeapUnsortedBinsCommand(GenericCommand): <NEW_LINE> <INDENT> _cmdline_ = "heap bins unsorted" <NEW_LINE> _syntax_ = "{:s} [ARENA_ADDRESS]".format(_cmdline_) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(GlibcHeapUnsortedBinsCommand, self).__init__(complete=gdb.COMPLET... | Display information on the Unsorted Bins of an arena (default: main_arena).
See: https://github.com/sploitfun/lsploits/blob/master/glibc/malloc/malloc.c#L1689 | 62598f9091af0d3eaad39a37 |
class UpdateForm(FlaskForm): <NEW_LINE> <INDENT> nome = StringField('nome_label') <NEW_LINE> cpf = StringField('cpf_label') <NEW_LINE> cep = StringField('cep_label') <NEW_LINE> telefone = StringField('cep_label') <NEW_LINE> email = StringField('email_label') <NEW_LINE> username = StringField('username_label') <NEW_LINE... | Formulario de Update | 62598f9023849d37ff850cf7 |
class ComputeHttpsHealthChecksListRequest(_messages.Message): <NEW_LINE> <INDENT> filter = _messages.StringField(1) <NEW_LINE> maxResults = _messages.IntegerField(2, variant=_messages.Variant.UINT32, default=500) <NEW_LINE> pageToken = _messages.StringField(3) <NEW_LINE> project = _messages.StringField(4, required=True... | A ComputeHttpsHealthChecksListRequest object.
Fields:
filter: Sets a filter expression for filtering listed resources, in the
form filter={expression}. Your {expression} must be in the format:
FIELD_NAME COMPARISON_STRING LITERAL_STRING. The FIELD_NAME is the name
of the field you want to compare. Only ... | 62598f90379a373c97d98c4e |
class confirm_intent(_Response): <NEW_LINE> <INDENT> def __init__(self, speech, updated_intent=None): <NEW_LINE> <INDENT> super().__init__(speech) <NEW_LINE> self._response = { "shouldEndSession": False, "directives": [ { "type": "Dialog.ConfirmIntent", } ], "outputSpeech": _output_speech(speech), } <NEW_LINE> if updat... | Sends a ConfirmIntent directive. | 62598f9076d4e153a661c84f |
class TestArrayOfProgramsDataPrograms(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return Arr... | ArrayOfProgramsDataPrograms unit test stubs | 62598f90851cf427c66b7ef7 |
class DatabaseEvents(ObjectEvents): <NEW_LINE> <INDENT> database_available = EventSource(DatabaseAvailableEvent) <NEW_LINE> database_unavailable = EventSource(DatabaseUnavailableEvent) | Slurmdbd database events. | 62598f90b5575c28eb712ae6 |
class VideoStream: <NEW_LINE> <INDENT> def _init_(self,resolution=(640,480),framerate=30): <NEW_LINE> <INDENT> self.stream = cv2.VideoCapture(0) <NEW_LINE> ret = self.stream.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter_fourcc(*'MJPG')) <NEW_LINE> ret = self.stream.set(3,resolution[0]) <NEW_LINE> ret = self.stream.set(4,res... | Camera object that controls video streaming from the Picamera | 62598f90d99f1b3c44d052e1 |
class DisplayMode: <NEW_LINE> <INDENT> def __init__(self, mode_info): <NEW_LINE> <INDENT> self.mode_info = mode_info <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%sx%s@%s" % (self.width, self.height, self.frequency) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<DisplayMode: ... | Representation of a screen mode (resolution, refresh rate) | 62598f900c0af96317c55fb8 |
@steps <NEW_LINE> class LoginUserChangePassword: <NEW_LINE> <INDENT> def change_password(self, step): <NEW_LINE> <INDENT> from django.shortcuts import reverse <NEW_LINE> change_password_link = step.context.base_url + reverse('account_change_password') <NEW_LINE> browser = step.context.browser <NEW_LINE> brow... | A login user change password | 62598f900a50d4780f705008 |
class Markov(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.suffix_map = {} <NEW_LINE> self.prefix = () <NEW_LINE> <DEDENT> def process_file(self, filename, order=2): <NEW_LINE> <INDENT> fp = open(filename) <NEW_LINE> skip_gutenberg_header(fp) <NEW_LINE> for line in fp: <NEW_LINE> <INDENT> fo... | Encapsulates the statistical summary of a text. | 62598f9045492302aabfc10b |
class NBR(TypeKeyword): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__("NBR", (int,), comment="No. of radial bins") <NEW_LINE> <DEDENT> def set(self, nbr): <NEW_LINE> <INDENT> super().set(nbr) | Number of bins for the radial variable, R=SQRT(X*X+Y*Y); .LE. 200.
DEFAULT: NBR=100 | 62598f90ac7a0e7691f72140 |
class IsTopicAuthor(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 True <NEW_LINE> <DEDENT> elif request.user and request.user.is_superuser: <NEW_LINE> <INDENT> return Tru... | Custom permission to only allow a topic author to edit its own topic | 62598f9071ff763f4b5e73a9 |
class RoleInviteList(ResourceList): <NEW_LINE> <INDENT> def query(self, view_kwargs): <NEW_LINE> <INDENT> query_ = self.session.query(RoleInvite) <NEW_LINE> query_ = event_query(self, query_, view_kwargs) <NEW_LINE> return query_ <NEW_LINE> <DEDENT> view_kwargs = True <NEW_LINE> methods = ['GET'] <NEW_LINE> decorators ... | List role invites based on event_id | 62598f9029b78933be269ef7 |
class LinksDecoder(json.JSONDecoder): <NEW_LINE> <INDENT> pass | Decodes a Terms object from JSON. | 62598f90435de62698e9ba26 |
class RequiredArgument(GvmError): <NEW_LINE> <INDENT> pass | Raised if a required argument/parameter is missing
Derives from :py:class:`GvmError` | 62598f909b70327d1c57e9d5 |
class OAuthPropertyMissingException(Exception): <NEW_LINE> <INDENT> pass | Not interesting. Thrown if something OAuth related is attemped,
but there is not enough information to start the request. | 62598f906e29344779b0028c |
class Walker(object): <NEW_LINE> <INDENT> def __call__(self,node): <NEW_LINE> <INDENT> notimplemented <NEW_LINE> <DEDENT> pass | A class that can visit the node hierarchy
Like a visitor, this callable should return a tuple of
(value,bail). non-None to abort the descent and return that value.
If bail is True, then drop the current node and move to its next
sister. | 62598f9063d6d428bbee23f1 |
class WordList(_BasicList): <NEW_LINE> <INDENT> pass | List of single words. | 62598f90a79ad16197769c93 |
class EpicsDevice(Device): <NEW_LINE> <INDENT> def __init__(self, name, cs, enabled=True, rb_pv=None, sp_pv=None): <NEW_LINE> <INDENT> if rb_pv is None and sp_pv is None: <NEW_LINE> <INDENT> raise DataSourceException( f"At least one PV ({pytac.RB} or {pytac.SP}) is " "required when creating an EpicsDevice." ) <NEW_LINE... | An EPICS-aware device.
Contains a control system, readback and setpoint PVs. A readback or
setpoint PV is required when creating an epics device otherwise a
DataSourceException is raised. The device is enabled by default.
**Attributes:**
Attributes:
name (str): The prefix of EPICS PVs for this device.
rb_pv ... | 62598f901f037a2d8b9e3d14 |
class CatalogInterface( CatalogFile, CatalogReplica, CatalogDirectory, CatalogLink ): <NEW_LINE> <INDENT> pass | .. class:: CatalogInterface
Dummy class to expose all the methods of the CatalogInterface | 62598f90a219f33f346c6450 |
class Feature(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.name = "" <NEW_LINE> self.value = "" <NEW_LINE> self.unit = "" <NEW_LINE> self.fref = "" | Class for product features | 62598f902ae34c7f260aad1e |
class SpeedFigure(LaggedRegressionFigure): <NEW_LINE> <INDENT> def plot(self, speeds, speedRates): <NEW_LINE> <INDENT> self.add(speeds, 'v', 'Speed') <NEW_LINE> self.add(speedRates, r'\Delta v', 'Speed rate of change (Acceleration)') <NEW_LINE> super(SpeedFigure, self).plot() | Plot TC speed data. | 62598f904e696a045264dc22 |
class GladeWrapper: <NEW_LINE> <INDENT> def __init__(self, Filename, WindowName): <NEW_LINE> <INDENT> self.widgets = gtk.glade.XML(Filename, WindowName, gettext.textdomain()) <NEW_LINE> self.GtkWindow = getattr(self, WindowName) <NEW_LINE> instance_attributes = {} <NEW_LINE> for attribute in dir(self.__class__): <NEW_L... | Superclass for glade based applications. Just derive from this
and your subclass should create methods whose names correspond to
the signal handlers defined in the glade file. Any other attributes
in your class will be safely ignored.
This class will give you the ability to do:
subclass_instance.GtkWindow.method(.... | 62598f908c0ade5d55dc34a7 |
class DiagSocket(NetlinkSocket): <NEW_LINE> <INDENT> def __init__(self, fileno=None): <NEW_LINE> <INDENT> super(DiagSocket, self).__init__(NETLINK_SOCK_DIAG) <NEW_LINE> self.marshal = MarshalDiag() <NEW_LINE> <DEDENT> def get_sock_stats( self, family=AF_UNIX, states=SS_ALL, protocol=IPPROTO_TCP, extensions=0, show=( UD... | Usage::
from pyroute2 import DiagSocket
with DiagSocket() as ds:
ds.bind()
sstats = ds.get_sock_stats() | 62598f9099cbb53fe6830b0b |
class GetValueWindow(TemplateUserInputWindow): <NEW_LINE> <INDENT> xaml_source = 'GetValueWindow.xaml' <NEW_LINE> def _setup(self, **kwargs): <NEW_LINE> <INDENT> self.Width = 400 <NEW_LINE> self.value_type = kwargs.get('value_type', 'string') <NEW_LINE> value_prompt = kwargs.get('prompt', None) <NEW_LINE> value_default... | Standard form to get simple values from user.
Args:
Example:
>>> from pyrevit import forms
>>> items = ['item1', 'item2', 'item3']
>>> forms.SelectFromList.show(items, button_name='Select Item')
>>> ['item1'] | 62598f9073bcbd0ca4bc9e8b |
class nexmo_sms(incoming_sms): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> incoming_sms.__init__(self) <NEW_LINE> <DEDENT> def GET(self): <NEW_LINE> <INDENT> data = web.input() <NEW_LINE> needed_fields = ["text", "to", "msisdn"] <NEW_LINE> if all(i in data for i in needed_fields): <NEW_LINE> <INDENT> to... | Class for handling incoming messages from Nexmo. | 62598f9060cbc95b06363f7a |
class StockItem(object): <NEW_LINE> <INDENT> def __init__(self, name, barcode, quantity): <NEW_LINE> <INDENT> self.name = name; <NEW_LINE> self.barcode = barcode; <NEW_LINE> self.quantity = quantity; <NEW_LINE> <DEDENT> def toString(self): <NEW_LINE> <INDENT> stock_item = "Name:"+ self.name + " Barcode:"+ str(self.barc... | Provides the basic stock item class for the stock control system | 62598f9007d97122c42168e3 |
class BackupType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> MANUAL = "Manual" <NEW_LINE> SCHEDULED = "Scheduled" | Type of backup Manual or Scheduled
| 62598f90379a373c97d98c50 |
class TestUserGetMe(TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpTestData(cls): <NEW_LINE> <INDENT> cls.user = UserFactory() <NEW_LINE> cls.http_req = make_http_request(user=cls.user) <NEW_LINE> <DEDENT> def test_get_me(self): <NEW_LINE> <INDENT> test_user = self.http_req.user <NEW_LINE> data = XUser... | Test User.get_me | 62598f907d847024c075c007 |
class Elapse_time(object): <NEW_LINE> <INDENT> def __init__(self, prompt=''): <NEW_LINE> <INDENT> self.prompt = prompt <NEW_LINE> self.start = time.time() <NEW_LINE> <DEDENT> def __del__(self): <NEW_LINE> <INDENT> print('%s耗时: %.3f' % (self.prompt, time.time() - self.start)) | 耗时统计工具 | 62598f908e7ae83300ee8cda |
class hd_inflate_flag(enum.IntFlag): <NEW_LINE> <INDENT> NONE = 0 <NEW_LINE> FINAL = 0x01 <NEW_LINE> EMIT = 0x02 | The flags for header inflation. | 62598f900c0af96317c55fba |
class GoogleMaps(object): <NEW_LINE> <INDENT> log = logging.getLogger('google_maps') <NEW_LINE> def __init__(self, api_key): <NEW_LINE> <INDENT> self.geocode = Geocode(api_key) <NEW_LINE> self.distance_matrix = DistanceMatrix(api_key) <NEW_LINE> <DEDENT> def search(self, location=None, lat=None, lng=None): <NEW_LINE> <... | To find address use: GoogleMaps.search(location=full_address). | 62598f9045492302aabfc10d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.