code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class IN5_GenerateLogbook_Test(systemtesting.MantidSystemTest): <NEW_LINE> <INDENT> _data_directory = None <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super(IN5_GenerateLogbook_Test, self).__init__() <NEW_LINE> self.setUp() <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> config['default.facility'] = 'IL... | Tests generating logbook for IN5 data. | 6259903b30c21e258be999ff |
class PanParam: <NEW_LINE> <INDENT> def __init__(self, id, name, shortName, param_type, source, unit=None): <NEW_LINE> <INDENT> self.id=id <NEW_LINE> self.name=name <NEW_LINE> self.shortName=shortName <NEW_LINE> ns=('CF','OS') <NEW_LINE> self.synonym=dict.fromkeys(ns) <NEW_LINE> self.type=param_type <NEW_LINE> self.sou... | PANGAEA Parameter
Shoud be used to create PANGAEA parameter objects. Parameter is used here to represent 'measured variables'
Parameters
----------
id : int
the identifier for the parameter
name : str
A long name or title used for the parameter
shortName : str
A short name or label to identify the paramete... | 6259903b1f5feb6acb163de4 |
class CloudErrorBody(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } <NEW_LINE> def __init__( self, **kwargs ... | An error response from the Batch service.
:param code: An identifier for the error. Codes are invariant and are intended to be consumed
programmatically.
:type code: str
:param message: A message describing the error, intended to be suitable for display in a user
interface.
:type message: str
:param target: The targ... | 6259903b82261d6c527307bc |
class NefitStatus(NefitSensor): <NEW_LINE> <INDENT> @property <NEW_LINE> def native_value(self) -> StateType: <NEW_LINE> <INDENT> return get_status(self.coordinator.data.get(self.entity_description.key)) | Representation of the boiler status. | 6259903ba4f1c619b294f780 |
class Mods_LockLoadOrder(CheckLink): <NEW_LINE> <INDENT> _text = _(u'Lock Load Order') <NEW_LINE> _help = _(u'Will reset mod Load Order to whatever Wrye Bash has saved for' u' them whenever Wrye Bash refreshes data/starts up.') <NEW_LINE> def _check(self): return load_order.locked <NEW_LINE> def Execute(self): <NEW_LIN... | Turn on Lock Load Order feature. | 6259903b07d97122c4217e8f |
class RecipeViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> authentication_classes = (TokenAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> queryset = Recipe.objects.all() <NEW_LINE> serializer_class = serializers.RecipeSerializer <NEW_LINE> def _params_to_ints(self, qs): <NEW_LINE> <I... | Manage recipes in the database | 6259903b16aa5153ce4016df |
class CUCollection(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.collection = [] <NEW_LINE> <DEDENT> def getCollection(self): <NEW_LINE> <INDENT> return(self.collection) <NEW_LINE> <DEDENT> def addCU(self,CU): <NEW_LINE> <INDENT> self.collection.append(CU) <NEW_LINE> <DEDENT> def getCUID(self,CUNa... | CUCollection is the collection of CUs in the project | 6259903b23e79379d538d6f2 |
class OSLCStats(jsl.Document): <NEW_LINE> <INDENT> class Options(object): <NEW_LINE> <INDENT> definition_id = "oslc_stats" <NEW_LINE> additional_properties = True | JSL schema for oslc. | 6259903b379a373c97d9a21a |
class Transaction(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'transactions' <NEW_LINE> id = db.Column(db.Integer, primary_key=True,autoincrement=True) <NEW_LINE> accounts_id = db.Column(db.Integer, db.ForeignKey('accounts.id')) <NEW_LINE> amount = db.Column(db.Integer, nullable=False) <NEW_LINE> t_time= db.Column(d... | Create an Contract table | 6259903b73bcbd0ca4bcb47b |
class SaltCall(parsers.SaltCallOptionParser): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> self.parse_args() <NEW_LINE> if self.options.file_root: <NEW_LINE> <INDENT> file_root = os.path.abspath(self.options.file_root) <NEW_LINE> self.config['file_roots'] = {'base': _expand_glob_path([file_root])} <NEW_LINE> ... | Used to locally execute a salt command | 6259903bbaa26c4b54d5049a |
class Logger(): <NEW_LINE> <INDENT> def __init__(self, name, **kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.level = kwargs.pop('level', LEVEL_ENV_VAR_VAL if LEVEL_ENV_VAR_VAL else DFL_LEVEL) <NEW_LINE> <DEDENT> def get_logger(self): <NEW_LINE> <INDENT> logger = logging.getLogger(self.name) <NEW_LINE> l... | Class initialization
This class is a simple wrapper around the built-in logging module functionality.
Attributes
----------
name : str
the logger name
level : str
the logging level to use, such as ERROR, WARNING, INFO or DEBUG
Methods
-------
get_logger()
Refer to method documentation
Notes
-----
The bu... | 6259903bb5575c28eb7135c2 |
class Node: <NEW_LINE> <INDENT> def __init__(self, item = None, pos_item = None): <NEW_LINE> <INDENT> self._item = item <NEW_LINE> self._next = pos_item <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(self._item) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return str(self._item) | '' 链表节点实现 | 6259903b10dbd63aa1c71dc8 |
class CooperativeEngine(BaseEngine): <NEW_LINE> <INDENT> def start_socket_loop(self, socket): <NEW_LINE> <INDENT> socket.loop() <NEW_LINE> return None <NEW_LINE> <DEDENT> def sleep(self, seconds): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> Buffer = NotImplemented | An engine that assumes cooperative scheduling for persistent sockets.
| 6259903bb57a9660fecd2c6e |
class Post(models.Model): <NEW_LINE> <INDENT> title = models.CharField(max_length=67, unique=True) <NEW_LINE> slug = models.SlugField(max_length=100, unique=True, blank=True, editable=False) <NEW_LINE> meta_description = models.CharField("Meta description for SEO", max_length=155) <NEW_LINE> abstract = models.TextField... | Post class to generate blog posts. | 6259903b8c3a8732951f774a |
class MultiprocessingCounter(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.val = Value('i', 0) <NEW_LINE> <DEDENT> def increment(self, n=1): <NEW_LINE> <INDENT> with self.val.get_lock(): <NEW_LINE> <INDENT> self.val.value += n <NEW_LINE> <DEDENT> <DEDENT> @property <NEW_LINE> def value(self)... | Instance of this class can be shared
safely between threads and between processes | 6259903b1f5feb6acb163de6 |
class Timing(Builtin): <NEW_LINE> <INDENT> attributes = ("HoldAll",) <NEW_LINE> summary_text = "CPU time to run a Mathics command" <NEW_LINE> def apply(self, expr, evaluation): <NEW_LINE> <INDENT> start = time.process_time() <NEW_LINE> result = expr.evaluate(evaluation) <NEW_LINE> stop = time.process_time() <NEW_LINE> ... | <dl>
<dt>'Timing[$expr$]'
<dd>measures the processor time taken to evaluate $expr$.
It returns a list containing the measured time in seconds and the result of the evaluation.
</dl>
>> Timing[50!]
= {..., 30414093201713378043612608166064768844377641568960512000000000000}
>> Attributes[Timing]
= {HoldAll, Protect... | 6259903b23849d37ff8522ac |
class WeightedDemParWassGpGan(WeightedDemParWassGan): <NEW_LINE> <INDENT> def __init__(self, *args, gp=10.0, batch_size=64, **kwargs): <NEW_LINE> <INDENT> super(WeightedDemParWassGpGan, self).__init__(*args, **kwargs) <NEW_LINE> self.gp = gp <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.grad_norms = self._gra... | gradient penalty style training;
want the norm of the auditor gradients close to 1 in regions of Z space between the two groups,
i.e. broaden the decision boundary to give useful gradients, and make the auditor 1-Lipshitz | 6259903b91af0d3eaad3b028 |
class WebTest(unittest.TestCase): <NEW_LINE> <INDENT> URL = os.environ.get('ARCHELON_TEST_URL', 'http://localhost:8580') <NEW_LINE> TOKEN = os.environ.get('ARCHELON_TEST_TOKEN', '1234') <NEW_LINE> CASSETTE_LIBRARY_BASE = 'archelonc/tests/testdata/cassettes/' <NEW_LINE> VCR = vcr.VCR( serializer='yaml', record_mode='onc... | Battery for verifying the Web history class works as expected. | 6259903b66673b3332c315ea |
class EXCEL: <NEW_LINE> <INDENT> def __init__(self, workbook, worksheet): <NEW_LINE> <INDENT> self.workbook = workbook <NEW_LINE> self.worksheet = worksheet <NEW_LINE> try: <NEW_LINE> <INDENT> self.wb = xlrd.open_workbook(self.workbook) <NEW_LINE> self.ws = self.wb.sheet_by_name(self.worksheet) <NEW_LINE> <DEDENT> exce... | EXCEL class contains definitions for many useful and custom utilities required to address the capabilities
of the Dev/Test framework.It contains methods for reading and writing from/to an Excel workbook | 6259903b3eb6a72ae038b85e |
class DistribGatherComp(Component): <NEW_LINE> <INDENT> def __init__(self, arr_size=11): <NEW_LINE> <INDENT> super(DistribGatherComp, self).__init__() <NEW_LINE> self.arr_size = arr_size <NEW_LINE> self.add_trait('invec', Array(np.ones(arr_size, float), iotype='in')) <NEW_LINE> self.add_trait('outvec', Array(np.ones(ar... | Uses 2 procs gathers a distrib input into a full output | 6259903b30c21e258be99a02 |
class LocalRegionLayer(Layer): <NEW_LINE> <INDENT> def __init__(self, nofm, sofm, nreg, sreg, ntrd=1, strd=1): <NEW_LINE> <INDENT> super(LocalRegionLayer, self).__init__(nofm, sofm, strd=strd) <NEW_LINE> if isinstance(sreg, int): <NEW_LINE> <INDENT> hreg = sreg <NEW_LINE> wreg = sreg <NEW_LINE> <DEDENT> elif len(sreg) ... | NN layer which computes on a local region. The layer has no or limited
shared weights, whose impact can be ignored during scheduling.
Includes pooling layer, normalization layer, and element-wise layer. | 6259903b1d351010ab8f4d11 |
class Hemorrhage(TimerBaseClass): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sinkTerm = 0 <NEW_LINE> self.vesselWithSink = 0 <NEW_LINE> self.update(TimeDict) <NEW_LINE> self.start = int(self.Tstart/self.dt) <NEW_LINE> self.end = int(self.Tend/self.dt) <NEW_LINE> <DEDENT> def __call__(self): <NEW_L... | class to implement a hemorrhagic event (blood loss) | 6259903b15baa72349463186 |
class GraphNeuralNetwork_transition(_base.AbstractModule): <NEW_LINE> <INDENT> def __init__(self, edge_model_fn, node_model_fn, name="fwd_gnn"): <NEW_LINE> <INDENT> super(GraphNeuralNetwork_transition, self).__init__(name=name) <NEW_LINE> with self._enter_variable_scope(): <NEW_LINE> <INDENT> self._edge_block = blocks.... | GNN-based transition function. | 6259903bd53ae8145f91965b |
class TestVirtualizationApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = netbox_client.api.virtualization_api.VirtualizationApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_virtualization_cluster_groups_create(self): <NEW_LINE... | VirtualizationApi unit test stubs | 6259903b91af0d3eaad3b02a |
class QuizQuestion(models.Model): <NEW_LINE> <INDENT> QTYPE_CHOICES = ( ("SC", _("Single Choice")), ("MC", _("Multiple Choice")), ("DD", _("Drag and Drop")), ("RG", _("Ranking")), ("HS", _("Hotspot")), ) <NEW_LINE> DIFFICULTY_CHOICES = ((1, 1), (2, 2), (3, 3), (4, 4), (5, 5)) <NEW_LINE> qtext = models.CharField( max_le... | This Model Defines Questions for the Self-learn Quiz in the GeoMat App. | 6259903b50485f2cf55dc177 |
class Add(Operator): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Add, self).__init__() <NEW_LINE> <DEDENT> def forward(self, a, b): <NEW_LINE> <INDENT> res = singa.__add__(a, b) <NEW_LINE> if training: <NEW_LINE> <INDENT> self.shape0 = list(a.shape()) <NEW_LINE> self.shape1 = list(b.shape()) <NEW_... | Performs element-wise binary addition. | 6259903bc432627299fa41ef |
class match(object): <NEW_LINE> <INDENT> def __init__(self, matcher): <NEW_LINE> <INDENT> self.matcher = matcher <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.matcher.matches(other) | Allow use of hamcrest matchers in mock.assert_*(..) methods.
Example:
m = Mock()
m('foo')
m.assert_called_with(match(starts_with('f'))) | 6259903b8da39b475be043e5 |
class MarkAmphoraPendingDeleteInDB(BaseDatabaseTask): <NEW_LINE> <INDENT> def execute(self, amphora): <NEW_LINE> <INDENT> LOG.debug("Mark PENDING DELETE in DB for amphora: %s " "with compute id %s", (amphora.id, amphora.compute_id)) <NEW_LINE> self.amphora_repo.update(db_apis.get_session(), amphora.id, status=constants... | Mark the amphora pending delete in the DB.
Since sqlalchemy will likely retry by itself always revert if it fails | 6259903bb57a9660fecd2c71 |
class ServicePlacementPolicy(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'type': {'required': True}, } <NEW_LINE> _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, } <NEW_LINE> _subtype_map = { 'type': {'InvalidDomain': 'ServicePlacementInvalidDomainPolicy', 'NonPartiallyPlaceService': 'Se... | Describes the policy to be used for placement of a Service Fabric service.
You probably want to use the sub-classes and not this class directly. Known
sub-classes are: ServicePlacementInvalidDomainPolicy, ServicePlacementNonPartiallyPlaceServicePolicy, ServicePlacementPreferPrimaryDomainPolicy, ServicePlacementRequire... | 6259903b21bff66bcd723e5f |
class YahooTermExtractor(object): <NEW_LINE> <INDENT> __slots__ = ('r', ) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.r = Retrieve( YahooTermExtractor.__name__ ) <NEW_LINE> <DEDENT> def extractTerms(self, content): <NEW_LINE> <INDENT> params = urlencode( {'appid': YAHOO_APP_ID, 'context': content, 'output':... | interfaces with yahoo's search service
* Term extraction: extract terms from yahoo search
http://developer.yahoo.com/search/content/V1/termExtraction.html | 6259903be76e3b2f99fd9c02 |
class RequestHandler(ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def post(self, request): <NEW_LINE> <INDENT> pass | The class that users should sub-class and provide implementation. Each of
these functions **should** return an instance of the `Response` class | 6259903b8e05c05ec3f6f756 |
class ServiceregistryEndpointsUpdateRequest(_messages.Message): <NEW_LINE> <INDENT> endpoint = _messages.StringField(1, required=True) <NEW_LINE> endpointResource = _messages.MessageField('Endpoint', 2) <NEW_LINE> project = _messages.StringField(3, required=True) | A ServiceregistryEndpointsUpdateRequest object.
Fields:
endpoint: The name of the endpoint for this request.
endpointResource: A Endpoint resource to be passed as the request body.
project: The project ID for this request. | 6259903b23e79379d538d6f6 |
class GlobalAveragePoolBlock(BaseBlock): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(regexp='gap', **kwargs) <NEW_LINE> <DEDENT> def _handle_parsed_args(self) -> None: <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def inverse_code(self) -> str: <NEW_LINE> <INDENT> raise ValueEr... | Global average pooling block effectively flattening spatial dimensions of the input feature maps.
.. warning::
Expects ?HWC data format (e.g. BHWC or BTHWC). | 6259903bd4950a0f3b11173b |
class StripeResourceMixin: <NEW_LINE> <INDENT> def ensure_stripe_resource(self, resource, attrs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> instance = resource.retrieve(attrs['id']) <NEW_LINE> <DEDENT> except (KeyError, InvalidRequestError): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> del attrs['id'] <NEW_LINE> <DE... | Stripe actions for resources, available as a Form mixin class. | 6259903b711fe17d825e1597 |
@Attention.register("dot_product") <NEW_LINE> class DotProductAttention(Attention): <NEW_LINE> <INDENT> @overrides <NEW_LINE> def _forward_internal(self, vector: torch.Tensor, matrix: torch.Tensor) -> torch.Tensor: <NEW_LINE> <INDENT> return matrix.bmm(vector.unsqueeze(-1)).squeeze(-1) <NEW_LINE> <DEDENT> @classmethod ... | Computes attention between a vector and a matrix using dot product. | 6259903b287bf620b6272de1 |
class Enrollment(Base): <NEW_LINE> <INDENT> __tablename__ = 'enrollments' <NEW_LINE> id = sa.Column(sa.Integer, sa.Sequence('enrollement_id_seq'), primary_key=True) <NEW_LINE> student_id = sa.Column(sa.Integer, sa.ForeignKey(Student.id)) <NEW_LINE> class_instance_id = sa.Column(sa.Integer, sa.ForeignKey(ClassInstance.i... | An enrollment is a :py:class:`Student` to :py:class:`ClassInstance` relationship | 6259903bbe383301e0254a0e |
class VideoInfoLectureCommentAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('message', 'register_date', 'author',) <NEW_LINE> list_per_page = 30 <NEW_LINE> list_filter = ('author',) <NEW_LINE> search_fields = ('message',) <NEW_LINE> date_hierarchy = 'register_date' <NEW_LINE> readonly_fields = ('message',... | 视频区评论 | 6259903b4e696a045264e71d |
class User(Base): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> first_name = Column(Unicode(255), nullable=False) <NEW_LINE> last_name = Column(Unicode(255), nullable=False) <NEW_LINE> email = Column(Unicode(255), nullable=False, unique=True) <NEW_LINE> passwor... | User schema. | 6259903b0fa83653e46f60d2 |
class QueuePropertiesPaged(AsyncPageIterator): <NEW_LINE> <INDENT> def __init__(self, command, prefix=None, results_per_page=None, continuation_token=None): <NEW_LINE> <INDENT> super(QueuePropertiesPaged, self).__init__( self._get_next_cb, self._extract_data_cb, continuation_token=continuation_token or "" ) <NEW_LINE> ... | An iterable of Queue properties.
:ivar str service_endpoint: The service URL.
:ivar str prefix: A queue name prefix being used to filter the list.
:ivar str marker: The continuation token of the current page of results.
:ivar int results_per_page: The maximum number of results retrieved per API call.
:ivar str next_ma... | 6259903b30c21e258be99a04 |
class ModelFrame: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass | Downsampled representation of a single Frame, produced by the model. | 6259903b76d4e153a661db6f |
class List(Base): <NEW_LINE> <INDENT> def __init__(self, value=None, *args, **kwargs): <NEW_LINE> <INDENT> from casper.lib.controls import controls <NEW_LINE> if "content" not in kwargs: <NEW_LINE> <INDENT> raise ValueError("A 'content' argument describing the 'List' " "content is expected.") <NEW_LINE> <DEDENT> inner... | Define a list parameter.
| 6259903bcad5886f8bdc5978 |
class l10n_br_base_city(orm.Model): <NEW_LINE> <INDENT> _name = 'l10n_br_base.city' <NEW_LINE> _description = u'Municipio' <NEW_LINE> _columns = { 'name': fields.char('Nome', size=64, required=True), 'state_id': fields.many2one('res.country.state', 'Estado', required=True), 'ibge_code': fields.char('Codigo IBGE', size=... | Este objeto persite todos os municípios relacionado a um estado.
No Brasil é necesário em alguns documentos fiscais informar o código
do IBGE dos município envolvidos da transação. | 6259903b73bcbd0ca4bcb481 |
class ImageServerWindow(Window): <NEW_LINE> <INDENT> flipVertical = False <NEW_LINE> gui = False <NEW_LINE> imageWinName = "Image Server Window" <NEW_LINE> def __init__(self, port=ImageServer.default_port, start_server=True, *args, **kwargs): <NEW_LINE> <INDENT> self.logger = logging.getLogger(self.__class__.__name__) ... | A variant of psychopy.visual.Window (running on pyglet) that automatically posts screen images over RPC.
Usage:
# Create an ImageServerWindow (drop-in replacement for psychopy.visual.Window)
from lumos.output import ImageServerWindow
win = ImageServerWindow(size=(800, 600), fullscr=True, screen=0, allowGUI=False, all... | 6259903b66673b3332c315ee |
class selectRow(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.editable = True <NEW_LINE> self.enabled = True <NEW_LINE> self.items = range(1, 38) <NEW_LINE> self.dropdownWidth = 'WWWWW' <NEW_LINE> self.width = 'WWW' <NEW_LINE> self.value = "" <NEW_LINE> <DEDENT> def onSelChange(self, selecti... | Implementation for addin_addin.getRow (ComboBox) | 6259903bb57a9660fecd2c73 |
class _JSONEditor ( UIEditor ): <NEW_LINE> <INDENT> root = List <NEW_LINE> view = View( UItem( 'root', editor = GridEditor( adapter = JSONAdapter, operations = [] ) ) ) <NEW_LINE> def init_ui ( self, parent ): <NEW_LINE> <INDENT> return self.edit_facets( parent = parent, kind = 'editor' ) <NEW_LINE> <DEDENT> def upd... | Defines the implementation of the editor class for viewing the contents
of a Python JSON object. | 6259903b07d97122c4217e96 |
class TestPruferSequence(object): <NEW_LINE> <INDENT> def test_nontree(self): <NEW_LINE> <INDENT> with pytest.raises(nx.NotATree): <NEW_LINE> <INDENT> G = nx.cycle_graph(3) <NEW_LINE> nx.to_prufer_sequence(G) <NEW_LINE> <DEDENT> <DEDENT> def test_null_graph(self): <NEW_LINE> <INDENT> with pytest.raises(nx.NetworkXPoint... | Unit tests for the Prüfer sequence encoding and decoding
functions. | 6259903b73bcbd0ca4bcb482 |
class KernelCullingTest(NotebookTestBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_argv(cls): <NEW_LINE> <INDENT> argv = super(KernelCullingTest, cls).get_argv() <NEW_LINE> argv.extend(['--MappingKernelManager.cull_idle_timeout=2', '--MappingKernelManager.cull_interval=1', '--MappingKernelManager.cull_conne... | Test kernel culling | 6259903bd4950a0f3b11173c |
class Model(nn.Module): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, args): <NEW_LINE> <INDENT> super(Model, self).__init__() <NEW_LINE> self.l2_norm = args.l2_norm <NEW_LINE> self.Ci = 2 if args.multichannel else 1 <NEW_LINE> self.Co = args.feature_maps <NEW_LINE> self.embeddings = nn.ModuleList([nn.embedding(a... | Implementing "Convolutional Neural Networks for Sentence Classification" | 6259903b63f4b57ef0086670 |
class TestUnitManager(unittest.TestCase): <NEW_LINE> <INDENT> def test_small(self): <NEW_LINE> <INDENT> value = 5 <NEW_LINE> result = convert_with_unit(value) <NEW_LINE> assert(result == '5') <NEW_LINE> <DEDENT> def test_large(self): <NEW_LINE> <INDENT> value = 12345. <NEW_LINE> result = convert_with_unit(value) <NEW_L... | Conversion utilisant les puissances d'une unité. | 6259903b1f5feb6acb163dec |
class CloudFilesUKStorageDriver(CloudFilesStorageDriver): <NEW_LINE> <INDENT> type = Provider.CLOUDFILES_UK <NEW_LINE> name = 'CloudFiles (UK)' <NEW_LINE> _region = 'lon' | Cloudfiles storage driver for the UK endpoint. | 6259903b23849d37ff8522b2 |
class Printer: <NEW_LINE> <INDENT> def __init__(self, file=sys.stderr, header=HEADER, verbose_level=None, debug=None): <NEW_LINE> <INDENT> verbose_level = get_verbose_level(verbose_level) <NEW_LINE> debug = get_debug(debug) <NEW_LINE> self._file = file <NEW_LINE> self._header = header <NEW_LINE> self._prev_line = None ... | The printer context manager | 6259903b23e79379d538d6f9 |
class Diagnosis(Enum): <NEW_LINE> <INDENT> Undiagnosed = 'undiag' <NEW_LINE> Diagnosed = 'diag' | Agent's diagnosis status indicates
whether the diagnosis of SARS-CoV-2/COVID-19 infection was made or not | 6259903b30dc7b76659a0a2b |
class GetCategoryBox: <NEW_LINE> <INDENT> def __init__(self, category, img_path): <NEW_LINE> <INDENT> self.category = category <NEW_LINE> self.img_path = img_path <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_main_box(boxes): <NEW_LINE> <INDENT> if len(boxes) > 1: <NEW_LINE> <INDENT> x1 = boxes[:, 0] <NEW_LINE> ... | Gets the biggest box from given category | 6259903b76d4e153a661db70 |
class SettingsCommand(object): <NEW_LINE> <INDENT> parser = argparse.ArgumentParser(description="ptah settings management") <NEW_LINE> parser.add_argument('-a', '--all', action="store_true", dest='all', help='List all registered settings') <NEW_LINE> parser.add_argument('-l', '--list', dest='section', default='', help=... | 'settings' command | 6259903b91af0d3eaad3b02e |
class PlayList(QFrame): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> super(PlayList, self).__init__() <NEW_LINE> self.parent = parent <NEW_LINE> self.setParent(self.parent.parent) <NEW_LINE> self.setObjectName("PlayList") <NEW_LINE> self.musicList = [] <NEW_LINE> self.currentRow = -1 <NEW_LI... | 播放列表。 | 6259903b50485f2cf55dc17b |
class RelatedTo(Relation): <NEW_LINE> <INDENT> relation_name = 'related_to' | related_to relation. | 6259903bcad5886f8bdc5979 |
class TestPcaEval(unittest.TestCase): <NEW_LINE> <INDENT> def test_pca_plot(self): <NEW_LINE> <INDENT> features_1 = np.random.normal(size=100) <NEW_LINE> features_1 = features_1.reshape(len(features_1), 1) <NEW_LINE> features = features_1 <NEW_LINE> for i in range(2, 11): <NEW_LINE> <INDENT> features = np.concatenate((... | Testing the function to run the pca algo for various number of
dimensions on the given dataset | 6259903bbaa26c4b54d504a2 |
class Trace(models.Model): <NEW_LINE> <INDENT> creation_date = models.DateTimeField( auto_now_add=True, editable=False, verbose_name=('Creation date'), ) <NEW_LINE> view_name = models.CharField( max_length=50, verbose_name=('View name'), ) <NEW_LINE> ip = models.IPAddressField( verbose_name=('IP'), ) <NEW_LINE> session... | Model to track a user's view hits.
:creation_date: Auto-added datetime of the model creation.
:view_name: Name of the called view.
:ip: IP of the visitor.
:user_agent: User agent of the request.
:session_key: Session key in the request.
:user: User who called the website, if not anonymous.
:view_object: Object of the ... | 6259903b8da39b475be043e9 |
class Command(BaseCommand): <NEW_LINE> <INDENT> def handle(self, *args, **options): <NEW_LINE> <INDENT> self.stdout.write('Waiting for database...') <NEW_LINE> db_conn = None <NEW_LINE> while not db_conn: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> db_conn = connections['default'] <NEW_LINE> <DEDENT> except Operationa... | Django command to pause execution until database is available | 6259903b8a349b6b4368743e |
class TestReview(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.new_review = Review() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> if os.path.exists("file.json"): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> os.remove("file.json") <NEW_LINE> <DEDENT> except: <NEW_LINE> ... | class for testing review | 6259903bb5575c28eb7135c6 |
class FunctionType(Enum): <NEW_LINE> <INDENT> DCV = 1 <NEW_LINE> ACV = 2 <NEW_LINE> OHM = 3 <NEW_LINE> OHMF = 4 <NEW_LINE> DCI = 5 <NEW_LINE> ACI = 6 <NEW_LINE> OHM_EXT = 7 <NEW_LINE> NTC = 8 <NEW_LINE> NTCF = 9 | The measurement functions. See page 55 of the extented ohms setting. | 6259903b10dbd63aa1c71dd0 |
class IPostPoolSheet(ISheet): <NEW_LINE> <INDENT> pass | Marker interfaces for sheets with :term:`post_pool` Attributes.
This implies the sheet schema is a subtype of
:class:`adhocracy_core.schema.PostPoolSchema` or has at least a
field node with :class:`adhocracy_core.Schema.PostPool`. | 6259903b287bf620b6272de5 |
class FakeClockCounter(object): <NEW_LINE> <INDENT> def __init__(self, fake_clock, num_waiters): <NEW_LINE> <INDENT> self.__fake_clock = fake_clock <NEW_LINE> self.__num_waiters = num_waiters <NEW_LINE> self.__count = 0 <NEW_LINE> self.__condition = threading.Condition() <NEW_LINE> <DEDENT> def count(self): <NEW_LINE> ... | Helper class for multithreaded testing. Provides a method for a thread to block until a count has reached target
value. Moreover, for every successfully observed increment, it will advance the fake_clock and wait for all
other threads (driven by the fake clock) to wait on the clock. For example usage, see MonitorsMan... | 6259903b8c3a8732951f7752 |
class SubmittedComponent(models.Model): <NEW_LINE> <INDENT> submission = models.ForeignKey(Submission, on_delete=models.PROTECT) <NEW_LINE> submit_time = models.DateTimeField(auto_now_add = True) <NEW_LINE> def get_time(self): <NEW_LINE> <INDENT> return self.submit_time.strftime("%Y-%m-%d %H:%M:%S") <NEW_LINE> <DEDENT>... | Part of a student's/group's submission | 6259903b4e696a045264e71f |
class BooleanImages ( SingletonHasPrivateFacets ): <NEW_LINE> <INDENT> true = Image( '@facets:on2' ) <NEW_LINE> false = Image( '@facets:off5' ) <NEW_LINE> check = Image( '@facets:on1' ) | Helper class use to define the true/false images used by the
boolean_cell_paint function. | 6259903bd10714528d69ef89 |
class TdlcIdentity(IanaInterfaceTypeIdentity): <NEW_LINE> <INDENT> _prefix = 'ianaift' <NEW_LINE> _revision = '2014-05-08' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> IanaInterfaceTypeIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.ietf._... | IBM twinaxial data link control. | 6259903b30dc7b76659a0a2d |
@skip_unless_lms <NEW_LINE> @ddt.ddt <NEW_LINE> class TestCohortOauth(SharedModuleStoreTestCase): <NEW_LINE> <INDENT> password = 'password' <NEW_LINE> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> super().setUpClass() <NEW_LINE> cls.user = UserFactory(username=USERNAME, email=USER_MAIL, password=cls.... | Tests for cohort API oauth authentication | 6259903b94891a1f408b9ff5 |
class Object_OT_MBDyn_update_beam3(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "update.mbdyn_beam3" <NEW_LINE> bl_label = "Updates beam3 curve configuration" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> ed = context.scene.mbdyn.elems <NEW_LINE> ret_val = update_beam3(ed[context.object.name]) <NEW... | Calls the update_beam3() function to update the current configuration
of the curve representing the beam3 element | 6259903b1d351010ab8f4d18 |
class CallableBool: <NEW_LINE> <INDENT> do_not_call_in_templates = True <NEW_LINE> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __bool__(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> def __call__(self): <NEW_LINE> <INDENT> warnings.warn( "Using user.is_aut... | An boolean-like object that is also callable for backwards compatibility. | 6259903b15baa7234946318d |
class KafkaConnection(object): <NEW_LINE> <INDENT> def __init__(self, host, port, bufsize=4096): <NEW_LINE> <INDENT> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.bufsize = bufsize <NEW_LINE> self._sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self._sock.connect((host, port)) <NEW_L... | A socket connection to a single Kafka broker
This class is _not_ thread safe. Each call to `send` must be followed
by a call to `recv` in order to get the correct response. Eventually,
we can do something in here to facilitate multiplexed requests/responses
since the Kafka API includes a correlation id. | 6259903b71ff763f4b5e8998 |
class GetKIFTestFilterTest(TestCase): <NEW_LINE> <INDENT> def test_correct(self): <NEW_LINE> <INDENT> tests = [ 'KIF.test1', 'KIF.test2', ] <NEW_LINE> expected = 'NAME:test1|test2' <NEW_LINE> self.assertEqual(test_runner.get_kif_test_filter(tests), expected) <NEW_LINE> <DEDENT> def test_correct_inverted(self): <NEW_LIN... | Tests for test_runner.get_kif_test_filter. | 6259903b73bcbd0ca4bcb486 |
class PostPage(BlogHandler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> key = ndb.Key('Post', int(post_id), parent=blog_key()) <NEW_LINE> post = key.get() <NEW_LINE> comments = Comment.gql("WHERE post_id=%s ORDER BY created DESC" % int(post_id)) <NEW_LINE> liked = None <NEW_LINE> if self.user: <NEW... | Renders the page for a single post, handles comments and likes on post | 6259903bbe383301e0254a14 |
class TestDirectoriesManager(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> cls.directory_manager = DirectoriesManager() <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def tearDownClass(cls): <NEW_LINE> <INDENT> shutil.rmtree(cls.directory_manager.get_directory(Def... | Tests the behavior of DirectoriesManager class. | 6259903b4e696a045264e720 |
@override_settings(**dict( TEST_SETTINGS, STATICFILES_STORAGE='django.contrib.staticfiles.storage.CachedStaticFilesStorage', DEBUG=False, )) <NEW_LINE> class TestCollectionCachedStorage(TestHashedFiles, BaseCollectionTestCase, BaseStaticFilesTestCase, TestCase): <NEW_LINE> <INDENT> def test_cache_invalidation(self): <N... | Tests for the Cache busting storage | 6259903bd10714528d69ef8a |
class DUIK_OT_remove_texanim_image( bpy.types.Operator ): <NEW_LINE> <INDENT> bl_idname = "texanim.remove_texanim_image" <NEW_LINE> bl_label = "Remove Image" <NEW_LINE> bl_options = {'REGISTER','UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> node = dublf.context.get_active_node(co... | Removes the active Image | 6259903b76d4e153a661db72 |
class Person(object): <NEW_LINE> <INDENT> def __init__(self, _id, is_vaccinated, infection=None): <NEW_LINE> <INDENT> self._id = _id <NEW_LINE> self.is_alive = True <NEW_LINE> self.is_vaccinated = is_vaccinated <NEW_LINE> self.infection = infection <NEW_LINE> <DEDENT> def did_survive_infection(self): <NEW_LINE> <INDENT... | Person objects will populate the simulation. | 6259903b91af0d3eaad3b032 |
class SPSAAdam(UnrolledAdam): <NEW_LINE> <INDENT> def __init__(self, lr=0.01, delta=0.01, num_samples=128, num_iters=1, compare_to_analytic_grad=False): <NEW_LINE> <INDENT> super(SPSAAdam, self).__init__(lr=lr) <NEW_LINE> assert num_samples % 2 == 0, "number of samples must be even" <NEW_LINE> self._delta = delta <NEW_... | Optimizer for gradient-free attacks in https://arxiv.org/abs/1802.05666.
Gradients estimates are computed using Simultaneous Perturbation Stochastic
Approximation (SPSA), combined with the ADAM update rule. | 6259903be76e3b2f99fd9c0a |
class Platform(object): <NEW_LINE> <INDENT> def __init__(self, operating_system, architecture): <NEW_LINE> <INDENT> self.operating_system = operating_system <NEW_LINE> self.architecture = architecture <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def Current(os_override=None, arch_override=None): <NEW_LINE> <INDENT> ret... | Holds an operating system and architecture. | 6259903b6e29344779b01850 |
class TestSimplifyIndex(object): <NEW_LINE> <INDENT> def setup(self): <NEW_LINE> <INDENT> self.shape = (3, 4, 5) <NEW_LINE> self.data = np.arange(np.product(self.shape)).reshape(self.shape) <NEW_LINE> <DEDENT> def _test_with(self, indices): <NEW_LINE> <INDENT> expected = self.data[indices] <NEW_LINE> simplified = _simp... | Test the :func:`~katdal.lazy_indexer._simplify_index` function. | 6259903b07d97122c4217e9c |
class AssetCollection(object): <NEW_LINE> <INDENT> def __init__(self, parent=None, guid=None, *args, **kwargs): <NEW_LINE> <INDENT> super(AssetCollection, self).__init__(*args, **kwargs) <NEW_LINE> if not guid: <NEW_LINE> <INDENT> guid = str(uuid.uuid4()) <NEW_LINE> <DEDENT> collection = self.get_collection() <NEW_LINE... | User Defined Domain Objects are the customizable collections to represent
data in the Asset Service.
This is experimental to provide a base class for a sort of ORM between
domain objects to marshall and unmarshall between Python and the REST
endpoints. | 6259903b71ff763f4b5e899b |
class UserProfile(AbstractBaseUser, PermissionsMixin): <NEW_LINE> <INDENT> email = models.EmailField(max_length=255, unique=True) <NEW_LINE> name = models.CharField(max_length=255) <NEW_LINE> is_active = models.BooleanField(default=True) <NEW_LINE> is_staff = models.BooleanField(default=False) <NEW_LINE> objects = User... | Represent a "user profile" inside our system | 6259903bb57a9660fecd2c79 |
class PART_ENTRY(v_types.VStruct): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(PART_ENTRY, self).__init__() <NEW_LINE> self.BootIndicator = v_types.uint8(enum=BOOTINDICATOR) <NEW_LINE> self.StartingHead = v_types.uint8() <NEW_LINE> self.StartingSectCylinder = v_types.uint16() <NEW_LINE> self.Syste... | partition entry in the MBR. | 6259903bb57a9660fecd2c7a |
class SphericalCoords(Distribution): <NEW_LINE> <INDENT> def __init__(self, m): <NEW_LINE> <INDENT> super(SphericalCoords, self).__init__() <NEW_LINE> self.m = m <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "%s(%r)" % (type(self).__name__, self.m) <NEW_LINE> <DEDENT> def sample(self, n, d=None, rn... | Spherical coordinates for inverse transform method.
This is used to map the hypercube onto the hypersphere and hyperball. [#]_
Parameters
----------
m : ``integer``
Positive index for spherical coordinate.
See Also
--------
:func:`.spherical_transform`
:class:`nengo.dists.SqrtBeta`
References
----------
.. [#] ... | 6259903b82261d6c527307c3 |
class MySingleOrderApi(LoginBaseApi): <NEW_LINE> <INDENT> url = "/info/mySingleOrder" <NEW_LINE> def build_custom_param(self, data): <NEW_LINE> <INDENT> return {'status':data['status'],'page': 1, 'length': 20} | 获取用户单买(自买)订单记录信息
status
状态
否
int
0待开奖
1未中奖
2中小奖
3中大奖
默认为全部
| 6259903b23849d37ff8522b8 |
class CarliniWagnerL2(Attack): <NEW_LINE> <INDENT> def __init__(self, model, back='tf', sess=None): <NEW_LINE> <INDENT> super(CarliniWagnerL2, self).__init__(model, back, sess) <NEW_LINE> import tensorflow as tf <NEW_LINE> self.feedable_kwargs = {'y': tf.float32, 'y_target': tf.float32} <NEW_LINE> self.structural_kwarg... | This attack was originally proposed by Carlini and Wagner. It is an
iterative attack that finds adversarial examples on many defenses that
are robust to other attacks.
Paper link: https://arxiv.org/abs/1608.04644
At a high level, this attack is an iterative attack using Adam and
a specially-chosen loss function to fin... | 6259903b30dc7b76659a0a31 |
class MongologTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.log = teamFourMongolog.Logger() <NEW_LINE> self.testRecord = self.log.prepRecord(testEventString, testPayload) <NEW_LINE> self.t = datetime.datetime.utcnow() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> s... | Unit tests for the teamFourMongolog module.
The teamFourMongolog module contains the logging and timer functionality. | 6259903c30c21e258be99a0c |
class NoneType(Type): <NEW_LINE> <INDENT> def optimize(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> def merge(self, another): <NEW_LINE> <INDENT> if isinstance(another, NoneType): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> return another.merge(self) <NEW_LINE> <DEDENT> def to_string(self, shift=0... | Represent null | 6259903cdc8b845886d547b5 |
class _Holder(Process): <NEW_LINE> <INDENT> def __init__(self,name,sim=None): <NEW_LINE> <INDENT> Process.__init__(self,name=name,sim=sim) <NEW_LINE> <DEDENT> def trigger(self, delay): <NEW_LINE> <INDENT> yield hold, self, delay <NEW_LINE> if not proc in b[2].activeQ: <NEW_LINE> <INDENT> proc.sim.reactivate(proc) | Provides timeout process | 6259903cb830903b9686ed79 |
class AttributeDict(dict): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AttributeDict, self).__init__(*args, **kwargs) <NEW_LINE> self.__dict__ = self | Dict which can handle access to keys using attributes.
Example:
>>> ad = AttributeDict({'a': 'b'})
>>> ad.a
... b | 6259903ce76e3b2f99fd9c0c |
class TestApisMaxTps(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 testApisMaxTps(self): <NEW_LINE> <INDENT> pass | ApisMaxTps unit test stubs | 6259903c71ff763f4b5e899d |
class TestBlobIO(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> os.mkdir("temp") <NEW_LINE> <DEDENT> def test_init(self): <NEW_LINE> <INDENT> init_catalog("./data/blob_resource_glossary.json", "temp") <NEW_LINE> with open("./data/blob_resource_glossary.json", "r") as f: <NEW_LINE> <INDENT>... | Test that write behavior is as-expected when passed a glossary of entries corresponding solely with the files
contained in a single blob resource. In this case we expect that only one catalog folder, one task folder,
one datapackage, and one depositor be written to the file. | 6259903c15baa72349463191 |
class MinimalPeakGroup(PeakGroupBase): <NEW_LINE> <INDENT> def __init__(self, unique_id, fdr_score, assay_rt, selected, cluster_id, peptide, intensity=None, dscore=None): <NEW_LINE> <INDENT> super(MinimalPeakGroup, self).__init__() <NEW_LINE> self.id_ = unique_id <NEW_LINE> self.fdr_score = fdr_score <NEW_LINE> self.no... | A single peakgroup that is defined by a retention time in a chromatogram
of multiple transitions. Additionally it has an fdr_score and it has an
aligned RT (e.g. retention time in normalized space).
A peakgroup can be selected for quantification or not (this is stored as
having cluster_id == 1).
Note that for performa... | 6259903cb57a9660fecd2c7b |
class Database(ABC): <NEW_LINE> <INDENT> def __init__(self, library: Optional[papis.library.Library] = None): <NEW_LINE> <INDENT> self.lib = library or papis.config.get_lib() <NEW_LINE> assert(isinstance(self.lib, papis.library.Library)) <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def initialize(self) -> None: <NEW_... | Abstract class for the database backends
| 6259903c1f5feb6acb163df4 |
class PostDeleteView(AutoPermissionRequiredMixin, UpdateView): <NEW_LINE> <INDENT> model = Post <NEW_LINE> template_name = "blog/post_confirm_delete.html" <NEW_LINE> form_class = PostDeleteForm <NEW_LINE> success_url = reverse_lazy("blog:post_list") <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> if self.request... | PostDeleteView
View to delete a Post
Args:
AutoPermissionRequiredMixin ([type]): Tests if the User has the permission to do that
UpdateView ([type]): [description]
Raises:
PermissionDenied: [description]
Returns:
[type]: [description] | 6259903cd10714528d69ef8c |
class MalformedManifest(Exception): <NEW_LINE> <INDENT> def __init__(self, value=''): <NEW_LINE> <INDENT> Exception.__init__(self, value) | Invalid manifest form | 6259903c0fa83653e46f60dc |
class set_root_password(my_cnf): <NEW_LINE> <INDENT> def __init__(self, password=None, **kwargs): <NEW_LINE> <INDENT> kwargs.update(password=password, switch_user='root') <NEW_LINE> super(set_root_password, self).__init__(**kwargs) <NEW_LINE> <DEDENT> def do(self): <NEW_LINE> <INDENT> new_password = self.args['password... | set mysql root password and store it in ~/.my.cnf | 6259903c23e79379d538d701 |
class Altitude(Value): <NEW_LINE> <INDENT> default_unit = 'm' <NEW_LINE> units = { 'm': Unit(1, 'm', 'meters', 0), 'ft': Unit(3.2808398950131, 'ft', 'feet', 0) } | Represents a height | 6259903c50485f2cf55dc183 |
class Scheduler: <NEW_LINE> <INDENT> def __init__(self, app): <NEW_LINE> <INDENT> self._app = app <NEW_LINE> self._queue = TaskQueue() <NEW_LINE> self._runners = [ Runner(self._queue, self._app) for _ in range(NB_RUNNER) ] <NEW_LINE> self._running = False <NEW_LINE> <DEDENT> def add_task(self, task): <NEW_LINE> <INDENT... | 'Scheduler' is probably a bad name for this class, but I do not know
what else to call it. It takes tasks and distributes them to runners.
Except it doesn't even do that, because the runners themselves take the
tasks from the queue.
In essence, this is just a container class to hold a queue and some
runners, and to pr... | 6259903cd99f1b3c44d068a8 |
@base.ReleaseTracks(base.ReleaseTrack.ALPHA) <NEW_LINE> class CreateAlpha(Create): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def Args(cls, parser): <NEW_LINE> <INDENT> flags.MakeCommitmentArg(False).AddArgument(parser, operation_type='create') <NEW_LINE> flags.AddCreateFlags(parser, enable_ssd_and_accelerator_support... | Create Google Compute Engine commitments. | 6259903c8a349b6b43687446 |
class Result(SampleableEnum): <NEW_LINE> <INDENT> Zero = 0 <NEW_LINE> One = 1 | Represents the `Result` Q# type. | 6259903cbaa26c4b54d504aa |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.