code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class ContactActionsLinks(flourish.page.RefineLinksViewlet): <NEW_LINE> <INDENT> pass | Contact actions links viewlet. | 62599033d53ae8145f919555 |
class Meta(Generic): <NEW_LINE> <INDENT> def debug(self, node): <NEW_LINE> <INDENT> nodename = node.__class__.__name__ <NEW_LINE> visitorname = self.__class__.__name__ <NEW_LINE> nodefields = list(ast.iter_fields(node)) <NEW_LINE> node_ = list(ast.iter_child_nodes(node)) <NEW_LINE> print('[warn]', nodename, nodefields,... | Meta visitor, ugly variant of Generic, but uses the official
generic_visit from the API. | 62599033796e427e5384f86d |
@plugin_pool.register_plugin <NEW_LINE> class CMSPeoplePlugin(CMSAllinkBaseAppContentPlugin): <NEW_LINE> <INDENT> model = PeopleAppContentPlugin <NEW_LINE> name = model.data_model.get_verbose_name_plural() <NEW_LINE> data_model = PeopleAppContentPlugin.data_model | Is only defined here because this Model is only for plugin instnances
There should be no need to extend this Plugin with any logic. It is only registered here.
model:
- where to store plugin instances
name:
- name of the plugin
data_model:
- Where to get the data from
(can also be a parent model, so automatically a... | 6259903394891a1f408b9f72 |
class DataArrayIntIterator(_object): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, DataArrayIntIterator, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> __getattr__ = lambda self, name: _swig_getattr(self, DataArrayIntIterator, name) <NEW... | 1 | 6259903391af0d3eaad3af20 |
class StreamSources(object): <NEW_LINE> <INDENT> def __init__(self, base_url=WOWZA_BASE_URL + 'stream_sources/', api_key=WOWZA_API_KEY, access_key=WOWZA_ACCESS_KEY): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.base_url = base_url <NEW_LINE> self.headers = { 'wsc-api-key': WOWZA_API_KEY, 'wsc-access-key': WOWZA_ACC... | Class to interface with the following Wowza endpoints:
/api/v1/stream_sources/ | 62599033cad5886f8bdc58f4 |
class StateCandReceived(JingleFileTransferStates): <NEW_LINE> <INDENT> def _recv_candidate(self, args): <NEW_LINE> <INDENT> if 'candError' in args: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> content = args['content'] <NEW_LINE> streamhost_cid = content.getTag('transport').getTag('candidate-used'). getAtt... | This state happens when we receive a candidate.
It takes the arguments: canError if we receive a candidate-error | 6259903315baa7234946308c |
class Error(Exception): <NEW_LINE> <INDENT> pass | Base Exception class. | 62599033ac7a0e7691f735da |
class IPPSensor(IPPEntity, SensorEntity): <NEW_LINE> <INDENT> def __init__( self, *, coordinator: IPPDataUpdateCoordinator, enabled_default: bool = True, entry_id: str, unique_id: str, icon: str, key: str, name: str, unit_of_measurement: str | None = None, ) -> None: <NEW_LINE> <INDENT> self._unit_of_measurement = unit... | Defines an IPP sensor. | 625990336e29344779b01743 |
class SessionWizardView(WizardView): <NEW_LINE> <INDENT> storage_name = 'my_django.contrib.formtools.wizard.storage.session.SessionStorage' | A WizardView with pre-configured SessionStorage backend. | 6259903373bcbd0ca4bcb37a |
class Struct: <NEW_LINE> <INDENT> def __init__(self, register_address, struct_format): <NEW_LINE> <INDENT> self.format = struct_format <NEW_LINE> self.buffer = bytearray(1+struct.calcsize(self.format)) <NEW_LINE> self.buffer[0] = register_address <NEW_LINE> <DEDENT> def __get__(self, obj, objtype=None): <NEW_LINE> <IND... | Arbitrary structure register that is readable and writeable.
Values are tuples that map to the values in the defined struct. See struct
module documentation for struct format string and its possible value types.
:param int register_address: The register address to read the bit from
:param type struct_format: The str... | 62599033be8e80087fbc0170 |
class PeopleCollectionView(BaseCollectionView): <NEW_LINE> <INDENT> collection_name = 'people' <NEW_LINE> field_names: ClassVar[Tuple[str, ...]] = ( 'url', 'name', 'height', 'mass', 'hair_color', 'skin_color', 'eye_color', 'birth_year', 'gender', 'homeworld', 'edited', ) | Star Wars API people collection view/iterator. | 62599033d99f1b3c44d06796 |
class LifecycleConfig(_messages.Message): <NEW_LINE> <INDENT> autoDeleteTime = _messages.StringField(1) <NEW_LINE> autoDeleteTtl = _messages.StringField(2) <NEW_LINE> idleDeleteTtl = _messages.StringField(3) <NEW_LINE> idleStartTime = _messages.StringField(4) | Specifies the cluster auto delete related schedule configuration.
Fields:
autoDeleteTime: Optional. The time when cluster will be auto-deleted.
autoDeleteTtl: Optional. The life duration of cluster, the cluster will be
auto-deleted at the end of this duration.
idleDeleteTtl: Optional. The longest duration th... | 6259903350485f2cf55dc070 |
class Translations(gettext.GNUTranslations, object): <NEW_LINE> <INDENT> DEFAULT_DOMAIN = 'messages' <NEW_LINE> def __init__(self, fileobj=None, domain=DEFAULT_DOMAIN): <NEW_LINE> <INDENT> self.plural = lambda n: int(n != 1) <NEW_LINE> gettext.GNUTranslations.__init__(self, fp=fileobj) <NEW_LINE> self.files = list(filt... | An extended translation catalog class (ripped off from Babel) | 625990331f5feb6acb163ce4 |
class EventServiceGrpcTransport(object): <NEW_LINE> <INDENT> _OAUTH_SCOPES = ( "https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/jobs", ) <NEW_LINE> def __init__( self, channel=None, credentials=None, address="jobs.googleapis.com:443" ): <NEW_LINE> <INDENT> if channel is not None and cr... | gRPC transport class providing stubs for
google.cloud.talent.v4beta1 EventService API.
The transport provides access to the raw gRPC stubs,
which can be used to take advantage of advanced
features of gRPC. | 625990338c3a8732951f764c |
class Video(): <NEW_LINE> <INDENT> def __init__(self, title, release_year, rating, runtime, genre, rt_score, review, poster_image_url, trailer_youtube_url): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.year = release_year <NEW_LINE> self.rating = rating <NEW_LINE> self.runtime = runtime <NEW_LINE> self.genre ... | Highest level class, contains all universal attributes
for any current or future class movies, tv shows, etc.
Dot operator allows future classes to instantiate categories. | 625990333eb6a72ae038b75b |
class Signed_Transaction(GrapheneSigned_Transaction): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Signed_Transaction, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def sign(self, wifkeys, chain="UTT"): <NEW_LINE> <INDENT> return super(Signed_Transaction, self).sign(wifkeys, ... | Create a signed transaction and offer method to create the
signature
:param num refNum: parameter ref_block_num (see ``getBlockParams``)
:param num refPrefix: parameter ref_block_prefix (see ``getBlockParams``)
:param str expiration: expiration date
:param Array operations: array of operations | 6259903326238365f5fadc47 |
class Td(Elem): <NEW_LINE> <INDENT> def __init__(self, content=None, attr=dict(), tag='td', tag_type='double'): <NEW_LINE> <INDENT> super().__init__(tag, attr, content, tag_type) | __init__() method. | 62599033d4950a0f3b1116b8 |
class TableHead(Element): <NEW_LINE> <INDENT> def __init__(self, head, parent=None): <NEW_LINE> <INDENT> super(TableHead, self).__init__(head, parent=parent) <NEW_LINE> self.rows = [TableRow(tr, parent=self) for tr in head.findall('tr')] | This class maps to the `<th>` element of the html table. | 62599033cad5886f8bdc58f5 |
@ddt <NEW_LINE> class Test(unittest.TestCase): <NEW_LINE> <INDENT> @data( ([1, 1, 1], [1, 1, 1]), ([3, 3, 3], [1, 1, 1]), ([1, 0, 0], [1, 0, 0]), ([0, 1, 0], [0, 1, 0]), ([0, 0, 1], [0, 0, 1]), ([5, 0, 0], [1, 0, 0]), ([0, 5, 0], [0, 1, 0]), ([0, 0, 5], [0, 0, 1]), ([5, 4, 4], [1, 0, 0]), ([4, 5, 4], [0, 1, 0]), ([4, 4... | A list of move counts
evaluates to a deterministic result
([ROCKS, PAPERS, SCISSORS], [ROCK_WIN, PAPER_WIN, SCISSORS_WIN]), | 6259903323e79379d538d5fe |
class Path(): <NEW_LINE> <INDENT> def __init__(self, path=[]): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def append(self, coordinate): <NEW_LINE> <INDENT> self.path.append(coordinate) <NEW_LINE> <DEDENT> def clone(self): <NEW_LINE> <INDENT> return Path(list(self.path)) <NEW_LINE> <DEDENT> def last(self):... | An object wrapper for an array of Coordinate objects. | 625990335e10d32532ce417d |
class LumiDataPoint(object): <NEW_LINE> <INDENT> def __init__(self, line, json_file_name=None): <NEW_LINE> <INDENT> line_split = line.split(",") <NEW_LINE> tmp = line_split[0].split(":") <NEW_LINE> self.run_number = int(tmp[0]) <NEW_LINE> self.fill_number = int(tmp[1]) <NEW_LINE> tmp = line_split[1].split(":") <NEW_LIN... | Holds info from one line of lumiCalc lumibyls output. | 625990338a43f66fc4bf327d |
class DataSaveCommand(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(DataSaveCommand, self).get_parser(prog_name) <NEW_LINE> parser.add_argument("--file", metavar="<filename>", help="downloaded introspection data filename " "(default: stdout)") <NEW_LINE> parse... | Save or display raw introspection data. | 6259903350485f2cf55dc072 |
class Exercise1(object): <NEW_LINE> <INDENT> def __init__(self, filename): <NEW_LINE> <INDENT> self.filename = filename <NEW_LINE> if not os.path.exists(filename): <NEW_LINE> <INDENT> print >> sys.stderr, "%s doesn't exist" % filename <NEW_LINE> sys.exit(1) <NEW_LINE> <DEDENT> <DEDENT> def run(self): <NEW_LINE> <INDENT... | Read in a video, and perform some real-time video processing on it. | 6259903321bff66bcd723d5b |
class Interval(tuple): <NEW_LINE> <INDENT> security = ClassSecurityInfo() <NEW_LINE> def __new__(cls, start_date=None, end_date=None, all_day=False): <NEW_LINE> <INDENT> if start_date is not None and start_date > end_date: <NEW_LINE> <INDENT> raise ValueError('End time can not precede start time') <NEW_LINE> <DEDENT> i... | Immutable type representing two datetime intervals and all_day option
| 62599033287bf620b6272cde |
class ManholeConnectionThread(_ORIGINAL_THREAD): <NEW_LINE> <INDENT> def __init__(self, client, locals, daemon=False): <NEW_LINE> <INDENT> super(ManholeConnectionThread, self).__init__() <NEW_LINE> self.daemon = daemon <NEW_LINE> self.client = client <NEW_LINE> self.name = "ManholeConnectionThread" <NEW_LINE> self.loca... | Manhole thread that handles the connection. This thread is a normal thread (non-daemon) - it won't exit if the
main thread exits. | 625990333eb6a72ae038b75d |
class ServicerContext(six.with_metaclass(abc.ABCMeta, RpcContext)): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def invocation_metadata(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def peer(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LI... | A context object passed to method implementations. | 62599033d4950a0f3b1116b9 |
class _ElementNode(_Node): <NEW_LINE> <INDENT> def __init__(self, parent, tag, attributes): <NEW_LINE> <INDENT> _Node.__init__(self, attributes) <NEW_LINE> self.parent = parent <NEW_LINE> self.tag = tag <NEW_LINE> <DEDENT> def clone(self, parent=None): <NEW_LINE> <INDENT> newNode = _ElementNode(parent, self.tag, self.a... | A node representing an element in a document, with a `parent`, a `tag`,
a dictionary of `attributes` and a list of `children`. | 62599033be383301e025490a |
@override_settings(SITEURL='http://localhost:8001/') <NEW_LINE> class GeoNodeGeoServerSync(GeoNodeLiveTestSupport): <NEW_LINE> <INDENT> port = 8001 <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(GeoNodeLiveTestSupport, self).setUp() <NEW_LINE> settings.OGC_SERVER['default']['GEOFENCE_SECURITY_ENABLED'] = True <N... | Tests GeoNode/GeoServer syncronization | 625990339b70327d1c57fe7b |
class CCPasswordField(CCField): <NEW_LINE> <INDENT> TYPE = 8 <NEW_LINE> password = "" <NEW_LINE> def __init__(self, password): <NEW_LINE> <INDENT> if __debug__: <NEW_LINE> <INDENT> if len(password) > 9 or len(password) < 4: <NEW_LINE> <INDENT> raise AssertionError("Password must be from 4 to 9 characters in length. Pas... | A class defining an unencoded password
Member vars:
type_val (int): the type identifier of this class (set to 8)
password (string): the password string, length from 4 to 9 characters | 625990336e29344779b01747 |
class CP2K_Result(Result): <NEW_LINE> <INDENT> def __init__(self, settings, molecule, job_name, plams_dir, work_dir=None, properties=package_properties['cp2k'], status='successful', warnings=None): <NEW_LINE> <INDENT> super().__init__(settings, molecule, job_name, plams_dir, work_dir=work_dir, properties=properties, st... | Class providing access to CP2K result. | 62599033ec188e330fdf998b |
class HuaweiHVSFCDriver(driver.FibreChannelDriver): <NEW_LINE> <INDENT> VERSION = '1.0.0' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(HuaweiHVSFCDriver, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def do_setup(self, context): <NEW_LINE> <INDENT> self.common = HVSCommon(configuratio... | FC driver for Huawei OceanStor HVS storage arrays. | 625990338c3a8732951f764f |
class Affiliations(models.Model): <NEW_LINE> <INDENT> contact = models.ForeignKey(Contact, on_delete=models.CASCADE) <NEW_LINE> organization = models.CharField(max_length=50) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.organization | this model defines the affiliations to a contact that a user owns | 625990336fece00bbacccaa5 |
class Settings(object): <NEW_LINE> <INDENT> def __init__(self, screen_width=1200, screen_height=800, bg_color=(230, 230, 230), ship_speed_factor=2.5, bullet_width=3, bullet_height=15, bullet_color=(60, 60, 60), bullet_speed_factor=3, bullet_num_limit=5): <NEW_LINE> <INDENT> self.screen_width = screen_width <NEW_LINE> s... | Class to store all settings for the game | 62599033be8e80087fbc0174 |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> username = db.Column(db.String(64), index=True) <NEW_LINE> password_hash = db.Column(db.String(128)) <NEW_LINE> LoggedIn = db.Column(db.Boolean, default=True) <NEW_LINE> bucket = db.relationship('BucketList', backref='owner', lazy='dynamic') <NEW_... | User table defined for user authenticatin. | 625990338a349b6b43687336 |
class Stage(models.Model): <NEW_LINE> <INDENT> name = models.CharField( 128, verbose_name=_('Stage Name'), null=False, translate=True ) <NEW_LINE> sequence = models.IntegerField( verbose_name=_('Sequence'), default=1, help_text="Used to order stages. Lower is better." ) <NEW_LINE> probability = models.FloatField( verbo... | Model for case stages. This models the main stages of a document
management flow. Main CRM objects (leads, opportunities, project
issues, ...) will now use only stages, instead of state and stages.
Stages are for example used to display the kanban view of records. | 62599033c432627299fa40ee |
class cached_property(lazy_property): <NEW_LINE> <INDENT> resettable = True | A computed property whose value is computed once and cached, but can be reset.
This is a variant of :class:`lazy_property` that
has the :attr:`~custom_property.resettable`
option enabled by default. | 62599033796e427e5384f874 |
class ModifyClusterAttributeResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ProjectId = None <NEW_LINE> self.ClusterName = None <NEW_LINE> self.ClusterDesc = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Proje... | ModifyClusterAttribute返回参数结构体
| 62599033d6c5a102081e321d |
class JoinedRoomsError(ErrorResponse): <NEW_LINE> <INDENT> pass | A response representing an unsuccessful joined rooms query. | 6259903366673b3332c314ea |
class FieldsOnCorrectTypeRule(ValidationRule): <NEW_LINE> <INDENT> def enter_field(self, node: FieldNode, *_args: Any) -> None: <NEW_LINE> <INDENT> type_ = self.context.get_parent_type() <NEW_LINE> if not type_: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> field_def = self.context.get_field_def() <NEW_LINE> if field_... | Fields on correct type
A GraphQL document is only valid if all fields selected are defined by the parent
type, or are an allowed meta field such as ``__typename``.
See https://spec.graphql.org/draft/#sec-Field-Selections | 6259903376d4e153a661daed |
class Addition(BinaryNode): <NEW_LINE> <INDENT> def __init__(self, child1, child2): <NEW_LINE> <INDENT> super(Addition, self).__init__(child1, child2) <NEW_LINE> self.add_child(child1) <NEW_LINE> self.add_child(child2) <NEW_LINE> self.in_vars = child1.in_vars + child2.in_vars <NEW_LINE> self.out_vars = child1.out_vars ... | A class for storing STL Conjunction nodes
Inherits TemporalNode | 625990336e29344779b01749 |
class Flower: <NEW_LINE> <INDENT> def __init__(self, name, petals, price): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._petals = petals <NEW_LINE> self._price = price <NEW_LINE> <DEDENT> def get_name(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> def set_name(self, name): <NEW_LINE> <INDENT>... | Represents a flower in a flower shop | 6259903373bcbd0ca4bcb37f |
@with_input_types(T) <NEW_LINE> @with_output_types(List[T]) <NEW_LINE> class SampleCombineFn(core.CombineFn): <NEW_LINE> <INDENT> def __init__(self, n): <NEW_LINE> <INDENT> super(SampleCombineFn, self).__init__() <NEW_LINE> self._top_combiner = TopCombineFn(n) <NEW_LINE> <DEDENT> def create_accumulator(self): <NEW_LINE... | CombineFn for all Sample transforms. | 625990335e10d32532ce417f |
class BillDetailView(DetailView): <NEW_LINE> <INDENT> model = Bill <NEW_LINE> context_object_name = "bill" <NEW_LINE> template_name = 'legislative/bill_detail.html' <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> if self.kwargs['id']: <NEW_LINE> <INDENT> return Bill.objects.get(id=self.kwargs['id']) <NEW_LINE> <DE... | View showing detail information about an individual bill. | 62599033ec188e330fdf998d |
class SpaceTimePointwiseStateObservation(Misfit): <NEW_LINE> <INDENT> def __init__(self, Vh, observation_times, targets, data=None, noise_variance=None): <NEW_LINE> <INDENT> self.Vh = Vh <NEW_LINE> self.observation_times = observation_times <NEW_LINE> self.B = assemblePointwiseObservation(self.Vh, targets) <NEW_LINE> s... | Creates a class that represents observations in time and space.
More information regarding the base class:
https://hippylib.readthedocs.io/en/2.0.0/_modules/hippylib/modeling/misfit.html
Inputs:
observation_times - Array of times to make observations at
targets - Array of spatial coordinates representing ... | 62599033d99f1b3c44d0679c |
class p4_field_list_calculation (p4_object): <NEW_LINE> <INDENT> required_attributes = ["name", "input", "algorithm", "output_width"] <NEW_LINE> allowed_attributes = required_attributes + ["doc"] <NEW_LINE> def __init__ (self, hlir, name, **kwargs): <NEW_LINE> <INDENT> p4_object.__init__(self, hlir, name, **kwargs) <NE... | TODO | 6259903391af0d3eaad3af28 |
class Driver(object, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> def __init__(self, conf, topics, transport): <NEW_LINE> <INDENT> self.conf = conf <NEW_LINE> self.topics = topics <NEW_LINE> self.transport = transport <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def notify(self, ctxt, msg, priority, retry): <NEW_L... | Base driver for Notifications | 62599033796e427e5384f876 |
class BinaryAttributeTestCase(TestCase): <NEW_LINE> <INDENT> def test_binary_attribute(self): <NEW_LINE> <INDENT> attr = BinaryAttribute() <NEW_LINE> self.assertIsNotNone(attr) <NEW_LINE> self.assertEqual(attr.attr_type, BINARY) <NEW_LINE> attr = BinaryAttribute(default=b'foo') <NEW_LINE> self.assertEqual(attr.default,... | Tests binary attributes | 62599033d4950a0f3b1116bb |
class NORDIC_BLE(Packet): <NEW_LINE> <INDENT> name = "BTLE Nordic info header" <NEW_LINE> fields_desc = [ ByteField("board", 0), LEShortField("payload_len", None), ByteField("protocol", 0), LEShortField("packet_counter", 0), ByteField("packet_id", 0), ByteField("packet_len", 10), ByteField("flags", 0), ByteField("chann... | Cooked Nordic BTLE link-layer pseudoheader.
| 6259903315baa72349463094 |
class CoviseMsgLoopAction: <NEW_LINE> <INDENT> runType_=None <NEW_LINE> def __init__(self, name, type, desc=''): <NEW_LINE> <INDENT> self.__desc = desc <NEW_LINE> if not isinstance(type,tuple): <NEW_LINE> <INDENT> self.__type = (type,) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.__type = type <NEW_LINE> <DEDENT>... | Base of actions triggered after receiving a covise-msg.
You can register a CoviseMsgLoopAction in the
CoviseMsgLoop(). The run-method of the action is
then called whenever a covise-message of type type
occurs.
Central is the type of the covise-message. Find
type-numbers for covise-messages in file
$COVISEDIR/src/ke... | 6259903376d4e153a661daee |
class UserInfoView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> address = Address.objects.get_default_address(user) <NEW_LINE> from django_redis import get_redis_connection <NEW_LINE> conn = get_redis_connection('default') <NEW_LINE> history_k... | 用户中心-信息页 | 625990336e29344779b0174b |
class YamlLoader(Loader): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(YamlLoader, self).__init__() <NEW_LINE> <DEDENT> def parse_file(self, file_content): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return yaml.load(file_content) <NEW_LINE> <DEDENT> except yaml.scanner.ScannerError as e: <NEW_LIN... | class to load yaml files | 625990335e10d32532ce4180 |
class AbstractDrone(MSONable, metaclass=abc.ABCMeta): <NEW_LINE> <INDENT> @abc.abstractmethod <NEW_LINE> def assimilate(self, path): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> @abc.abstractmethod <NEW_LINE> def get_valid_paths(self, path): <NEW_LINE> <INDENT> return | Abstract drone class that defines the various methods that must be
implemented by drones. Because of the quirky nature of Python"s
multiprocessing, the intermediate data representations has to be in the
form of python primitives. So all objects that drones work with must be
MSONable. All drones must also implement the ... | 6259903330c21e258be99908 |
class Solution: <NEW_LINE> <INDENT> def isValidBST(self, root): <NEW_LINE> <INDENT> minNode, maxNode, isValid = self.divideConquer(root) <NEW_LINE> return isValid <NEW_LINE> <DEDENT> def divideConquer(self, root): <NEW_LINE> <INDENT> if root == None: <NEW_LINE> <INDENT> return None, None, True <NEW_LINE> <DEDENT> leftM... | @param root: The root of binary tree.
@return: True if the binary tree is BST, or false | 62599033c432627299fa40f2 |
class NaturalOrderGroup(click.Group): <NEW_LINE> <INDENT> def list_commands(self, ctx): <NEW_LINE> <INDENT> return self.commands.keys() | Command group trying to list subcommands in the order they were added.
Make sure you initialize the `self.commands` with OrderedDict instance.
With decorator, use::
@click.group(cls=NaturalOrderGroup, commands=OrderedDict()) | 6259903391af0d3eaad3af2a |
class MainViewHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> test_run = self.request.get('test_run') <NEW_LINE> bucket = gs_bucket.GoogleCloudStorageBucket(constants.BUCKET) <NEW_LINE> ispy = ispy_utils.ISpyUtils(bucket) <NEW_LINE> if test_run: <NEW_LINE> <INDENT> self._GetForTe... | Request handler to serve the main_view page. | 62599033d18da76e235b79cc |
class PortCheck(Check): <NEW_LINE> <INDENT> def __init__(self, host, port, timeout=7, **kwargs): <NEW_LINE> <INDENT> logger.debug('Initialising with %s:%d, timeout %ds.', host, port, timeout) <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.timeout = timeout <NEW_LINE> super().__init__(**kwargs) ... | Checks if TCP ports are open. | 6259903323e79379d538d606 |
class Sphere3: <NEW_LINE> <INDENT> def __init__(self, p = None, r = 1.): <NEW_LINE> <INDENT> if (not p is None): <NEW_LINE> <INDENT> self.p = p <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.p = [0., 0., 0.] <NEW_LINE> <DEDENT> self.r = r <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return ("Sphere3["... | Sphere (3D).
A Sphere in 3D space.
p -- Position vector.
r -- Radius. | 625990336e29344779b0174d |
class Command(BaseCommand): <NEW_LINE> <INDENT> option_list = BaseCommand.option_list + ( make_option('-s', '--set', action='store', nargs=2, dest='set', help='set value for key'), ) <NEW_LINE> usage = "Usage: manage <torrent-id> [<key1> [<key2> ...]]\n" " manage <torrent-id> --set <key> <value>" <NEW_... | Show and manage per-torrent options | 6259903307d97122c4217da4 |
class HumanNaturalLanguage(HumanLanguage): <NEW_LINE> <INDENT> def __init__(self, hasCode=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self._namespace = ONTOLOGY_NS <NEW_LINE> self._project_id = PROJECT_ID <NEW_LINE> self._name = "HumanNaturalLanguage" <NEW_LINE> self.hasCode = HasCode(has... | Language naturally evolved in humans.
Labels: menschliche naturliche Sprache (de) / human natural language (en) | 625990338a43f66fc4bf3285 |
class EESwedBankProvider(IPizzaProviderBase): <NEW_LINE> <INDENT> extra_fields = (('VK_CHARSET', 'UTF-8'),) | | SWEDBANK AS
| https://www.swedbank.ee
Protocol
IPizza
KeyChain
:class:`~.IPizzaProviderBase.KeyChain`
Supported return urls:
* ``return``
Supported protocol version:
* ``008`` | 6259903330c21e258be9990a |
class MyRPC1Servicer(object): <NEW_LINE> <INDENT> def Test1(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') | package my_rpc_service;
| 62599033b830903b9686ecf9 |
class Vertex(object): <NEW_LINE> <INDENT> def __init__(self, id, x, y, z): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.x = float(x) <NEW_LINE> self.y = float(y) <NEW_LINE> self.z = float(z) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str([self.x, self.y, self.z]) <NEW_LINE> <DEDENT> def __eq... | The three dimensional coordinates of a vertex | 6259903394891a1f408b9f78 |
class MatchmakersViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, mixins.UpdateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> queryset = UserModel.objects.filter(is_matchmaker=True) <NEW_LINE> serializer_class = UserSerializer <NEW_LINE> permission_classes = [IsSuperAdmin] <NEW_LINE> def get(self, r... | API endpoint that allows matchmakers to be viewed or edited(groups and permissions).
Viewset provides `list`, `create`, `retrieve`,
`update` and `destroy` actions. | 62599033d10714528d69ef0a |
class ChoiceTextField(models.TextField): <NEW_LINE> <INDENT> def formfield(self, **kwargs): <NEW_LINE> <INDENT> if self.choices: <NEW_LINE> <INDENT> kwargs['widget'] = None <NEW_LINE> <DEDENT> return super(ChoiceTextField, self).formfield(**kwargs) | Textfield which uses a Select widget if it has choices specified. | 6259903323e79379d538d608 |
class ResourceExhaustedError(OpError): <NEW_LINE> <INDENT> def __init__(self, node_def, op, message): <NEW_LINE> <INDENT> super(ResourceExhaustedError, self).__init__(node_def, op, message, RESOURCE_EXHAUSTED) | Some resource has been exhausted.
For example, this error might be raised if a per-user quota is
exhausted, or perhaps the entire file system is out of space.
@@__init__ | 62599033be8e80087fbc017c |
class Simulator(Startable, Hookable, Stateful, ExceptionRouter, FDEController): <NEW_LINE> <INDENT> __hookAlias__ = dict( NewSimulation = None , SimulationDone = None , PluginsActivated = None , NewInput = None , InputDone = None , SteadyStateDone = None , NewTimeStep = None , Pr... | Convenience class preparing use of FDEController and mixin types useful for simulator codes.
| 625990338a349b6b4368733d |
class CodeImportMachineView(LaunchpadView): <NEW_LINE> <INDENT> label = "Import machines for Launchpad" <NEW_LINE> @property <NEW_LINE> def machines(self): <NEW_LINE> <INDENT> return getUtility(ICodeImportMachineSet).getAll() | The view for the page that shows all the import machines. | 6259903391af0d3eaad3af2e |
@attr.s(auto_attribs=True, frozen=True) <NEW_LINE> class AlleleCount: <NEW_LINE> <INDENT> count: int = attr.ib( validator=[attr.validators.instance_of(int), _greater_than_zero] ) | Specify a *number* of copies of a mutation.
:param count: Initial number of copies of a mutation.
This value must be `> 0`.
:type count: int | 625990338c3a8732951f7658 |
class HitBox: <NEW_LINE> <INDENT> def __init__(self, x1, y1, x2, y2): <NEW_LINE> <INDENT> self.x1 = x1 <NEW_LINE> self.y1 = y1 <NEW_LINE> self.x2 = x2 <NEW_LINE> self.y2 = y2 | Class used to draw hitboxes around objects | 6259903326238365f5fadc53 |
class titleWindow(object): <NEW_LINE> <INDENT> def __init__(self, mh, mw, h, w, y=None, x=None): <NEW_LINE> <INDENT> height = 2 <NEW_LINE> width = 46 <NEW_LINE> y = 0 <NEW_LINE> x = mw // 2 - 23 <NEW_LINE> self.window_data = (height, width, y, x) <NEW_LINE> <DEDENT> def getWinSizePos(self): <NEW_LINE> <INDENT> return s... | Title element | 6259903363f4b57ef00865f3 |
class Function(Field): <NEW_LINE> <INDENT> def __init__(self, field, getter, setter=None, searcher=None, loading='lazy'): <NEW_LINE> <INDENT> assert isinstance(field, Field) <NEW_LINE> self._field = field <NEW_LINE> self._type = field._type <NEW_LINE> self.getter = getter <NEW_LINE> self.setter = setter <NEW_LINE> if n... | Define function field (any). | 625990336e29344779b01751 |
class Solution: <NEW_LINE> <INDENT> def numIslands(slef,grid): <NEW_LINE> <INDENT> if not grid or not grid[0]: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> result =[] <NEW_LINE> for i in range(len(grid)): <NEW_LINE> <INDENT> for j in range(len(grid[0])): <NEW_LINE> <INDENT> if grid[i][j] == 0: <NEW_LINE> <INDENT... | @param grid: a boolean 2D matrix
@return: an integer
0/1组成的数组,找到0的矩阵 ,一定是tectangle | 625990338e05c05ec3f6f6db |
@test(groups=["test_bdd"]) <NEW_LINE> class TestBlockDevice(TestBasic): <NEW_LINE> <INDENT> @test(depends_on=[SetupEnvironment.prepare_slaves_3], groups=["deploy_bdd"]) <NEW_LINE> @log_snapshot_after_test <NEW_LINE> def bdd_ha_one_controller_compact(self): <NEW_LINE> <INDENT> self.env.revert_snapshot("ready_with_3_slav... | Tests for verification deployment with Cinder block Device. | 6259903307d97122c4217da8 |
class TagsStatsTool(TagsTRTool): <NEW_LINE> <INDENT> coalesce = list <NEW_LINE> filter_methods = ("tag", "projects", "locales", "path") <NEW_LINE> _default_annotations = ( ("total_strings", Coalesce(Sum("resource__total_strings"), Value(0))), ("fuzzy_strings", Coalesce(Sum("fuzzy_strings"), Value(0))), ("strings_with_w... | Creates aggregated stat data for tags according to
filters | 625990335e10d32532ce4183 |
class Dict(dict): <NEW_LINE> <INDENT> def __init__(self,names=(),values=(),**kw): <NEW_LINE> <INDENT> super(Dict,self).__init__(**kw) <NEW_LINE> for k,v in zip(names,values): <NEW_LINE> <INDENT> self[k]=v <NEW_LINE> <DEDENT> <DEDENT> def __getattr__(self,key): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return self[ke... | simple dict but support x.y style | 625990338a43f66fc4bf3289 |
class GPEnvelope(CoClass): <NEW_LINE> <INDENT> _reg_clsid_ = GUID('{01A9676B-E251-4A40-8544-5E5B65E2983C}') <NEW_LINE> _idlflags_ = [] <NEW_LINE> _typelib_path_ = typelib_path <NEW_LINE> _reg_typelib_ = ('{C031A050-82C6-4F8F-8836-5692631CFFE6}', 10, 2) | Geoprocessing value object containing an envelope value. | 6259903330c21e258be9990e |
class engine(Engine): <NEW_LINE> <INDENT> name = "PostgreSQL" <NEW_LINE> abbreviation = "postgres" <NEW_LINE> max_int = 2147483647 <NEW_LINE> placeholder = "%s" <NEW_LINE> required_opts = [ ("user", "Enter your PostgreSQL username", "postgres"), ("password", "Enter your password", ""), ("host", "Enter your PostgreSQL h... | Engine instance for PostgreSQL. | 62599033be8e80087fbc017e |
class Post(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User') <NEW_LINE> title = models.CharField(max_length=200) <NEW_LINE> text = models.TextField() <NEW_LINE> created_date = models.DateTimeField( default=timezone.now) <NEW_LINE> published_date = models.DateTimeField( blank=True, null=True) <N... | docstring for post | 62599033e76e3b2f99fd9b0d |
class TestInitCommand(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> if not os.path.exists('test_workspace'): <NEW_LINE> <INDENT> os.makedirs('test_workspace') <NEW_LINE> <DEDENT> with open(os.path.join(os.getcwd(), 'test_workspace/main.cpp'), 'wt') as f: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT... | test init command | 6259903371ff763f4b5e8899 |
class Die(): <NEW_LINE> <INDENT> def __init__(self, num_sides=6): <NEW_LINE> <INDENT> self.num_sides = num_sides <NEW_LINE> <DEDENT> def roll(self): <NEW_LINE> <INDENT> return randint(1, self.num_sides) | Klasa przedstawiająca pojedynczą kość do gry. | 625990331d351010ab8f4c1a |
class LinearRegressionTester(RegressionTester): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(LinearRegressionTester, self).__init__(*args, **kwargs) <NEW_LINE> self.regression_model = LinearRegression <NEW_LINE> self.score_fcn = r2_score | used for linear regression testing | 62599033b830903b9686ecfb |
class WebhookAdapter: <NEW_LINE> <INDENT> BASE = 'https://discord.com/api/v7' <NEW_LINE> def _prepare(self, webhook): <NEW_LINE> <INDENT> self._webhook_id = webhook.id <NEW_LINE> self._webhook_token = webhook.token <NEW_LINE> self._request_url = '{0.BASE}/webhooks/{1}/{2}'.format(self, webhook.id, webhook.token) <NEW_L... | Base class for all webhook adapters.
Attributes
------------
webhook: :class:`Webhook`
The webhook that owns this adapter. | 6259903394891a1f408b9f7a |
class Delter(AccessorBase): <NEW_LINE> <INDENT> __slots__ = add_to_slots('parent_xpath', 'marshal_to') <NEW_LINE> def __call__(self): <NEW_LINE> <INDENT> parent = self.xmltreefile().find(self.parent_xpath) <NEW_LINE> if parent is None: <NEW_LINE> <INDENT> raise xcepts.LibvirtXMLNotFoundError("Parent element %s not " "f... | Remove ALL child elements for which marshal_to does NOT return None | 6259903373bcbd0ca4bcb389 |
@as_function <NEW_LINE> class nfr(IterOnInfs, Bin): <NEW_LINE> <INDENT> exec_name = "NFR" <NEW_LINE> names = "MNaseSeq", <NEW_LINE> def fun(self, f, genome_dir, out_dir): <NEW_LINE> <INDENT> _, base = PathHelpers.base_name(f["file_path"]) <NEW_LINE> input = PathHelpers.build_path(base, out_dir, "gff", "NR") <NEW_LINE> ... | Look for nucleosome-free regions | 62599033d53ae8145f919566 |
class RegistroC321(Registro): <NEW_LINE> <INDENT> campos = [ CampoFixo(1, 'REG', 'C321'), Campo(2, 'COD_ITEM'), CampoNumerico(3, 'QTD'), Campo(4, 'UNID'), CampoNumerico(5, 'VL_ITEM'), CampoNumerico(6, 'VL_DESC'), CampoNumerico(7, 'VL_BC_ICMS'), CampoNumerico(8, 'VL_ICMS'), CampoNumerico(9, 'VL_PIS'), CampoNumerico(10, ... | ITENS DO RESUMO DIÁRIO DOS DOCUMENTOS (CÓDIGO 02) | 625990336fece00bbacccaab |
class TestLogging(MockHttpTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestLogging, self).setUp() <NEW_LINE> self.swiftclient_logger = logging.getLogger("swiftclient") <NEW_LINE> self.log_level = self.swiftclient_logger.getEffectiveLevel() <NEW_LINE> self.swiftclient_logger.setLevel(logging.INF... | Make sure all the lines in http_log are covered. | 625990338a43f66fc4bf328b |
class AsyncBulbInterface(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, event, heartbeat_ms): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.stopped = event <NEW_LINE> self.hb_rate = heartbeat_ms <NEW_LINE> self.device_list = [] <NEW_LINE> self.color_queue = {} <NEW_LINE> self.color_cach... | Asynchronous networking layer between LIFX devices and the GUI. | 6259903350485f2cf55dc080 |
class nonascii: <NEW_LINE> <INDENT> pass | Це не латиниця | 625990331f5feb6acb163cf4 |
class Math(StdOutCommandLine): <NEW_LINE> <INDENT> input_spec = MathInputSpec <NEW_LINE> output_spec = MathOutputSpec <NEW_LINE> _cmd = "mincmath" <NEW_LINE> def _format_arg(self, name, spec, value): <NEW_LINE> <INDENT> assert value is not None <NEW_LINE> if name in self.input_spec.bool_or_const_traits: <NEW_LINE> <IND... | Various mathematical operations supplied by mincmath.
Examples
--------
>>> from nipype.interfaces.minc import Math
>>> from nipype.interfaces.minc.testdata import minc2Dfile
Scale: volume*3.0 + 2:
>>> scale = Math(input_files=[minc2Dfile], scale=(3.0, 2))
>>> scale.run() # doctest: +SKIP
Test if >= 1.5:
>>> gt =... | 625990338c3a8732951f765c |
class CreateRouter(SimpleRouter): <NEW_LINE> <INDENT> routes = [ Route(url=r'^{prefix}{trailing_slash}$', mapping={ 'post': 'create', }, name='{basename}-detail', initkwargs={'suffix': 'Detail'}) ] | Router for get and update only | 62599034cad5886f8bdc58fd |
class MemoryReadSignExtender_t(unittest.TestCase): <NEW_LINE> <INDENT> def test_constructor(self): <NEW_LINE> <INDENT> x = Bus(32) <NEW_LINE> s = Bus(2) <NEW_LINE> y = Bus(32) <NEW_LINE> with self.assertRaises(TypeError): <NEW_LINE> <INDENT> mrse = MemoryReadSignExtender('x',s,y) <NEW_LINE> <DEDENT> with self.assertRai... | Tests MemoryReadSignExtender's constructor and run functionality | 62599034d53ae8145f919568 |
class ApiTokenView(View): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def authenticate_user(cls, request): <NEW_LINE> <INDENT> if 'HTTP_AUTHORIZATION' not in request.META: <NEW_LINE> <INDENT> data = {'message': 'Use Basic Auth and supply your username and password.'} <NEW_LINE> return JsonResponse(data, status=401) <NE... | View for handling issuing and revoking api token. | 6259903430c21e258be99911 |
class BlockingOSCUDPServer(socketserver.UDPServer): <NEW_LINE> <INDENT> def __init__(self, server_address, dispatcher): <NEW_LINE> <INDENT> super().__init__(server_address, _UDPHandler) <NEW_LINE> self._dispatcher = dispatcher <NEW_LINE> <DEDENT> def verify_request(self, request, client_address): <NEW_LINE> <INDENT> re... | Blocking version of the UDP server.
Each message will be handled sequentially on the same thread.
Use this is you don't care about latency in your message handling or don't
have a multiprocess/multithread environment (really?). | 6259903491af0d3eaad3af34 |
class _TransacitonCtx(object): <NEW_LINE> <INDENT> def __enter__(self): <NEW_LINE> <INDENT> global _db_ctx <NEW_LINE> self.should_close_conn = False <NEW_LINE> if not _db_ctx.is_init(): <NEW_LINE> <INDENT> _db_ctx.init() <NEW_LINE> self.should_close_conn = True <NEW_LINE> <DEDENT> _db_ctx.transactions = _db_ctx.transac... | _TransacitonCtx object that can handle transactions
with _TransacitonCtx():
pass | 62599034d4950a0f3b1116c1 |
class User(object): <NEW_LINE> <INDENT> def __init__(self, bb, username): <NEW_LINE> <INDENT> self.bb = bb <NEW_LINE> self.username = username <NEW_LINE> <DEDENT> def followers(self): <NEW_LINE> <INDENT> url = api_base + 'users/{0}/followers/'.format(self.username) <NEW_LINE> return self.bb._loads(url) <NEW_LINE> <DEDE... | API encapsulation for user related bitbucket queries. | 625990346e29344779b01758 |
class ComparisonTestFramework(bfbTestFramework): <NEW_LINE> <INDENT> def set_test_params(self): <NEW_LINE> <INDENT> self.num_nodes = 2 <NEW_LINE> self.setup_clean_chain = True <NEW_LINE> <DEDENT> def add_options(self, parser): <NEW_LINE> <INDENT> parser.add_option("--testbinary", dest="testbinary", default=os.getenv("B... | Test framework for doing p2p comparison testing
Sets up some bfbd binaries:
- 1 binary: test binary
- 2 binaries: 1 test binary, 1 ref binary
- n>2 binaries: 1 test binary, n-1 ref binaries | 625990345e10d32532ce4186 |
class SigninCard(Model): <NEW_LINE> <INDENT> _attribute_map = { 'text': {'key': 'text', 'type': 'str'}, 'buttons': {'key': 'buttons', 'type': '[CardAction]'}, } <NEW_LINE> def __init__(self, *, text: str=None, buttons=None, **kwargs) -> None: <NEW_LINE> <INDENT> super(SigninCard, self).__init__(**kwargs) <NEW_LINE> sel... | A card representing a request to sign in.
:param text: Text for signin request
:type text: str
:param buttons: Action to use to perform signin
:type buttons: list[~botframework.connector.models.CardAction] | 6259903430c21e258be99913 |
class MD5(Watcher): <NEW_LINE> <INDENT> def _get_value(self): <NEW_LINE> <INDENT> md5_hash = hashlib.md5() <NEW_LINE> with open(self.file_name, 'rb') as file_handle: <NEW_LINE> <INDENT> chunk = file_handle.read(4096) <NEW_LINE> while chunk: <NEW_LINE> <INDENT> md5_hash.update(chunk) <NEW_LINE> chunk = file_handle.read(... | MD5 hash based change detection.
This class uses MD5 hashes based on the files contents to enable change
detection. | 625990344e696a045264e6a5 |
class UserInventory(Base): <NEW_LINE> <INDENT> __tablename__ = 'user_inventories' <NEW_LINE> user_id = Column(Integer, ForeignKey('users.id'), primary_key=True) <NEW_LINE> product_id = Column(Integer, ForeignKey('products.id'), primary_key=True) <NEW_LINE> product_count = Column(Integer) <NEW_LINE> def __repr__(self): ... | ユーザーインベントリモデル | 6259903421bff66bcd723d6d |
class SeatCategoryMapping(models.Model): <NEW_LINE> <INDENT> event = models.ForeignKey(Event, related_name='seat_category_mappings', on_delete=models.CASCADE) <NEW_LINE> subevent = models.ForeignKey(SubEvent, null=True, blank=True, related_name='seat_category_mappings', on_delete=models.CASCADE) <NEW_LINE> layout_categ... | Input seating plans have abstract "categories", such as "Balcony seat", etc. This model maps them to actual
pretix product on a per-(sub)event level. | 6259903494891a1f408b9f7d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.