code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class itkBinaryMarkBranchingPointImageFilterIUL3IUL3(itkImageToImageFilterAPython.itkImageToImageFilterIUL3IUL3): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No construct... | Proxy of C++ itkBinaryMarkBranchingPointImageFilterIUL3IUL3 class | 62598ef41f5feb6acb1614b7 |
class Server(AcquiaResource): <NEW_LINE> <INDENT> valid_keys = ['name', 'fqdn', 'services', 'status', 'ami_type', 'ec2_region', 'ec2_availability_zone'] | Acquia Cloud API Server. | 62598ef4d7e4931a7ef3a900 |
@attr('UNIT', group='mi') <NEW_LINE> class FLORDTelemeteredGliderTest(GliderParserUnitTestCase): <NEW_LINE> <INDENT> config = { DataSetDriverConfigKeys.PARTICLE_MODULE: 'mi.dataset.parser.glider', DataSetDriverConfigKeys.PARTICLE_CLASS: 'FlordTelemeteredDataParticle' } <NEW_LINE> resource_path = os.path.join(BASE_RESOU... | Test cases for flord glider data | 62598ef47c178a314d78bcfc |
class AvailableWorkflowTransitions(object): <NEW_LINE> <INDENT> implements(IVocabularyFactory) <NEW_LINE> def __call__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> terms = list() <NEW_LINE> portal_workflow = getToolByName(context, 'portal_workflow') <NEW_LINE> workflows = portal_workflow.getWor... | Vocabulary that returns all available workflow transition available on
the current object. | 62598ef48e7ae83300ee78ee |
class Test45(unittest.TestCase): <NEW_LINE> <INDENT> def test_g_0(self) -> None: <NEW_LINE> <INDENT> p, q, _ = m44.get_parameters().values() <NEW_LINE> g = 0 <NEW_LINE> keypair = m43.keygen(p, q, g) <NEW_LINE> m_1 = b"Hello, world" <NEW_LINE> m_2 = b"Goodbye, world" <NEW_LINE> signature_1 = m45.sign_relaxed(m_1, keypai... | DSA parameter tampering | 62598ef47b25080760ed5d01 |
class SequentialIntVectorReader(_SequentialReaderBase, _kaldi_table.SequentialIntVectorReader): <NEW_LINE> <INDENT> pass | Sequential table reader for integer sequences. | 62598ef432920d7e50bc4891 |
class LoginView(MethodView): <NEW_LINE> <INDENT> def post(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = User.query.filter_by(email=request.data['email']).first() <NEW_LINE> if user and user.password_is_valid(request.data['password']): <NEW_LINE> <INDENT> access_token = user.generate_token(user.id) <NEW_LIN... | This class-based view handles user login and access token generation. | 62598ef432920d7e50bc4892 |
class AsyncPluggableDimmer(AsyncDimmer): <NEW_LINE> <INDENT> pass | HMIP-PDT Pluggable Dimmer | 62598ef4ff9c53063f518ec5 |
class SyntaxErrorRequest(DaideRequest): <NEW_LINE> <INDENT> __slots__ = ['message_bytes'] <NEW_LINE> params = { strings.MESSAGE_BYTES: bytes } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.message_bytes = b'' <NEW_LINE> super(SyntaxErrorRequest, self).__init__(message_bytes=b'', **kwargs) <NEW_LINE>... | Represents a HUH DAIDE request. Sent by the client to specify an error in a message.
Syntax: ::
HUH (message) | 62598ef4dc8b845886d51e2a |
class LCA: <NEW_LINE> <INDENT> def __init__(self, parent, RangeMinFactory=RestrictedRangeMin): <NEW_LINE> <INDENT> children = defaultdict(list) <NEW_LINE> for x in parent: <NEW_LINE> <INDENT> children[parent[x]].append(x) <NEW_LINE> <DEDENT> root = [x for x in children if x not in parent] <NEW_LINE> if len(root) != 1: ... | Structure for finding least common ancestors in trees.
Tree nodes may be any hashable objects; a tree is specified
by a dictionary mapping nodes to their parents.
LCA(T)(x,y) finds the LCA of nodes x and y in tree T. | 62598ef44a966d76dd5ed73f |
class AreaUnivarResultModel(Schema): <NEW_LINE> <INDENT> type = 'object' <NEW_LINE> properties = { 'fid': { 'type': 'string', 'description': 'Field id from the polygon of the vector map layer ' 'used for area stats computation' }, 'cat': { 'type': 'string', 'description': 'The category id from the polygon of the vector... | Response schema for the result of univariate computations of raster layers
based on a vector area.
It is used as schema to define the process_result in a ProcessingResponseModel.
cat
fid
raster_number
raster_minimum
raster_maximum
raster_range
raster_average
raster_median
raster_stddev
raster_sum
raster_variance
ras... | 62598ef4460517430c430ced |
class FuncDeclRef(AstRef): <NEW_LINE> <INDENT> def as_ast(self): <NEW_LINE> <INDENT> return Z3_func_decl_to_ast(self.ctx_ref(), self.ast) <NEW_LINE> <DEDENT> def as_func_decl(self): <NEW_LINE> <INDENT> return self.ast <NEW_LINE> <DEDENT> def name(self): <NEW_LINE> <INDENT> return _symbol2py(self.ctx, Z3_get_decl_name(s... | Function declaration. Every constant and function have an associated declaration.
The declaration assigns a name, a sort (i.e., type), and for function
the sort (i.e., type) of each of its arguments. Note that, in Z3,
a constant is a function with 0 arguments. | 62598ef491f36d47f22302d7 |
class PolicyFixture(fixtures.Fixture): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> cinder.policy.reset() <NEW_LINE> cinder.policy.init(suppress_deprecation_warnings=True) <NEW_LINE> self.addCleanup(cinder.policy.reset) <NEW_LINE> <DEDENT> def set_rules(self, rules, overwrite=True... | Load the live policy for tests.
A base policy fixture that starts with the assumption that you'd
like to load and enforce the shipped default policy in tests. | 62598ef43539df3088ecab11 |
class Joker(models.Model): <NEW_LINE> <INDENT> team_captain = models.ForeignKey(User, on_delete=models.CASCADE) <NEW_LINE> rider = models.ForeignKey(Rider, on_delete=models.CASCADE) <NEW_LINE> value = models.IntegerField(default=0) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return "%s %s %s" %(self.team_captain.... | TeamCaptains can have a "Joker" placed on three riders they have had in
previous year(s). This allows them to buy that Rider for a lower amount than
the other TeamCaptains. A Joker with a value of 0 allows them to buy the
rider for the highest amount the other TeamCaptains have bidded.
A Joker with a negative value ge... | 62598ef463b5f9789fe839c4 |
class TripUnpacker(Unpacker): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Unpacker.__init__( self, scalars=('name', 'password', 'start_date', 'end_date'), vectors=('travelers', ) ) | Specialized unpacker for Trip data | 62598ef45fdd1c0f98e5c807 |
class AuthTimeoutException(AuthException, TimeoutException): <NEW_LINE> <INDENT> pass | Raised when an auth request times out. | 62598ef43d592f4c4edb9751 |
class ObjectBuilderAdd(Command): <NEW_LINE> <INDENT> log = logging.getLogger(__name__) <NEW_LINE> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(ObjectBuilderAdd, self).get_parser(prog_name) <NEW_LINE> parser.add_argument('--user', help='the username to connect to the remote host', action='store', ... | add each storage node to the object ring | 62598ef43317a56b869bd998 |
class PartOfSpeech(XMLModel): <NEW_LINE> <INDENT> def __init__(self, name=None, shortcut=None, remarks=None, id=0, elem=None): <NEW_LINE> <INDENT> assert name is None or isinstance(name, basestring) <NEW_LINE> assert shortcut is None or isinstance(shortcut, basestring) <NEW_LINE> assert remarks is None or isinstance(re... | This class represents a part-of-speech section from the language database. | 62598ef43346ee7daa336a9a |
class Equation(Hook): <NEW_LINE> <INDENT> attrib = {'NAME': 'plugins/latex/LatexNodeHook.properties'} <NEW_LINE> identifier = {r'NAME': r'plugins/latex/LatexNodeHook.properties'} <NEW_LINE> spec = {'NAME': [str], 'EQUATION': [str]} | Equation allows a LaTeX-style equation to be inserted into a particular
Node. Define the equation using Equation['EQUATION'] = latex-string | 62598ef48a43f66fc4bf09da |
class BahrForm(object): <NEW_LINE> <INDENT> def __init__(self, feet): <NEW_LINE> <INDENT> self.feet = feet <NEW_LINE> <DEDENT> def validate(self, emeter, units=[]): <NEW_LINE> <INDENT> parts = [] <NEW_LINE> text_emeter = emeter <NEW_LINE> units_cp = list(units) <NEW_LINE> for foot in self.feet: <NEW_LINE> <INDENT> text... | The form of a Bahr (meter).
For a given Arabic meter (Bahr), there may be multiple forms.
Parameters
----------
feet : list(Tafiila)
A list of feet describing the meter.
Attributes
----------
feet: list(Tafiila)
A list of feet describing the meter. | 62598ef44f6381625f1988ef |
class DataTypeFilter(NbConvertBase): <NEW_LINE> <INDENT> def __call__(self, output): <NEW_LINE> <INDENT> for fmt in self.display_data_priority: <NEW_LINE> <INDENT> if fmt in output: <NEW_LINE> <INDENT> return [fmt] <NEW_LINE> <DEDENT> <DEDENT> return [] | Returns the preferred display format | 62598ef4a8370b77170eec4a |
class PhotoNamePairList(APIView): <NEW_LINE> <INDENT> def get(self, request, format=None): <NEW_LINE> <INDENT> photonamepairs = PhotoNamePair.objects.all() <NEW_LINE> serializer = PhotoNamePairSerializer(photonamepairs, many=True) <NEW_LINE> return Response(serializer.data) <NEW_LINE> <DEDENT> def post(self, request, f... | Show photo name pair | 62598ef42c8b7c6e89bd2029 |
class Country(TitleSlugMixin): <NEW_LINE> <INDENT> iso_country = CountryField(blank=True) <NEW_LINE> continent = models.CharField( choices=ISO_CONTINENTS, blank=True, null=True, max_length=31) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "Countries" <NEW_LINE> ordering = ('slug',) <NEW_LINE> <DEDENT... | A model that represents a country on earth.
This is initially derived from the countries in django-countries, but the
user can modify the list to suit their needs (including preferred designations
and historical countries) | 62598ef410dbd63aa1c6f3df |
class IPermission(Interface): <NEW_LINE> <INDENT> id = TextLine( title=_("Id"), description=_("Id as which this permission will be known and used."), readonly=True, required=True) <NEW_LINE> title = TextLine( title=_("Title"), description=_("Provides a title for the permission."), required=True) <NEW_LINE> description ... | A permission object. | 62598ef4cc0a2c1114479866 |
class NoTokenError(AuthenticationError): <NEW_LINE> <INDENT> def __init__(self, message: str=None) -> None: <NEW_LINE> <INDENT> super().__init__(ErrorType.NO_TOKEN, message) | An error thrown when a token is required but not provided. | 62598ef466673b3332c2ec11 |
class SkipDataset(UnaryUnchangedStructureDataset): <NEW_LINE> <INDENT> def __init__(self, input_dataset, count): <NEW_LINE> <INDENT> self._input_dataset = input_dataset <NEW_LINE> self._count = ops.convert_to_tensor(count, dtype=dtypes.int64, name="count") <NEW_LINE> variant_tensor = gen_dataset_ops.skip_dataset( input... | A `Dataset` skipping the first `count` elements from its input. | 62598ef4379a373c97d9785d |
class AtomicExpr(Expression): <NEW_LINE> <INDENT> def __init__(self, name, value): <NEW_LINE> <INDENT> super(AtomicExpr, self).__init__() <NEW_LINE> self.name = name <NEW_LINE> self.value = value | "Atomic expression | 62598ef47047854f4633dc2e |
class OracleGate(Gate): <NEW_LINE> <INDENT> gate_name = 'V' <NEW_LINE> gate_name_latex = 'V' <NEW_LINE> @classmethod <NEW_LINE> def _eval_args(cls, args): <NEW_LINE> <INDENT> if len(args) != 2: <NEW_LINE> <INDENT> raise QuantumError( 'Insufficient/excessive arguments to Oracle. Please ' + 'supply the number of qubits ... | A black box gate.
The gate marks the desired qubits of an unknown function by flipping
the sign of the qubits. The unknown function returns true when it
finds its desired qubits and false otherwise.
Parameters
==========
qubits : int
Number of qubits.
oracle : callable
A callable function that returns a bo... | 62598ef4796e427e5384d000 |
class StringIO(TextIOWrapper): <NEW_LINE> <INDENT> def __init__(self, initial_value="", newline="\n"): <NEW_LINE> <INDENT> super(StringIO, self).__init__(BytesIO(), encoding="utf-8", errors="strict", newline=newline) <NEW_LINE> if newline is None: <NEW_LINE> <INDENT> self._writetranslate = False <NEW_LINE> <DEDENT> if ... | Text I/O implementation using an in-memory buffer.
The initial_value argument sets the value of object. The newline
argument is like the one of TextIOWrapper's constructor. | 62598ef499cbb53fe682f715 |
class HttpMethod(enum.Enum): <NEW_LINE> <INDENT> GET = 1 <NEW_LINE> POST = 2 <NEW_LINE> PUT = 3 <NEW_LINE> DELETE = 4 <NEW_LINE> PATCH = 5 <NEW_LINE> TRACE = 6 <NEW_LINE> HEAD = 7 | Supported HTTP verbs.
| 62598ef4bf627c535bcafcd7 |
class Batch(object): <NEW_LINE> <INDENT> def __init__(self, data=None, dataset=None, device=None): <NEW_LINE> <INDENT> if data is not None: <NEW_LINE> <INDENT> self.batch_size = len(data) <NEW_LINE> self.dataset = dataset <NEW_LINE> self.fields = dataset.fields.keys() <NEW_LINE> self.input_fields = [k for k, v in datas... | Defines a batch of examples along with its Fields.
Attributes:
batch_size: Number of examples in the batch.
dataset: A reference to the dataset object the examples come from
(which itself contains the dataset's Field objects).
train: Deprecated: this attribute is left for backwards compatibility,
... | 62598ef4fff4ab517ebcc03f |
class Inductance(PassiveElement): <NEW_LINE> <INDENT> def __init__(self, name, element, evaluated_paramsd, parent): <NEW_LINE> <INDENT> if 'l' in element.paramsd: <NEW_LINE> <INDENT> lvalue_expresion = element.paramsd['l'] <NEW_LINE> <DEDENT> elif 'L' in element.paramsd: <NEW_LINE> <INDENT> lvalue_expresion = element.p... | Object with instance of a inductance of a circuit.
| 62598ef456ac1b37e6300a53 |
class Infix: <NEW_LINE> <INDENT> def __init__(self, function): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> <DEDENT> def __or__(self, other): <NEW_LINE> <INDENT> return self.function(other) <NEW_LINE> <DEDENT> def __ror__(self, other): <NEW_LINE> <INDENT> return Infix(functools.partial(self.function, other))... | Definition of an infix operator class. Call as a decorator. The new operator can't be a
Python operator. '|' is the operator with the lowest priority still practical to use.
Examples:
# 2-fold product
@Infix
def x(a, b):
return a * b
c = 2 |x| 4
print(c)
COUT: 8
# Functional progr... | 62598ef430bbd7224646849c |
class FromRemote(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, paths): <NEW_LINE> <INDENT> sublime.set_timeout_async(lambda: from_remote_async(paths[0]), 0) | Sync a local directory from a remote directory. | 62598ef45fc7496912d476a6 |
class Money(object): <NEW_LINE> <INDENT> def __init__(self, amount: int, currency: str) -> None: <NEW_LINE> <INDENT> self._amount = amount <NEW_LINE> self._currency = currency <NEW_LINE> <DEDENT> def times(self, multiplier: int) -> Money: <NEW_LINE> <INDENT> return Money(self._amount * multiplier, self.currency()) <NEW... | 通貨の継承元 | 62598ef4be383301e0252043 |
@common_routes.view(r'/ni/' + View.valid_user_journeys + '/address-in-wales/') <NEW_LINE> class CommonAddressInWales(CommonCommon): <NEW_LINE> <INDENT> @aiohttp_jinja2.template('common-address-in-wales.html') <NEW_LINE> async def get(self, request): <NEW_LINE> <INDENT> display_region = 'ni' <NEW_LINE> user_journey = re... | Route to render an 'Address in Wales' page during address lookups if display_region is 'ni'
and selected addresses region is W | 62598ef4a219f33f346c5096 |
class CustomerOrderApiTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.owner = get_user_model().objects.create_user( email='owner@cinolabs.com', password='testpass', name='store owner' ) <NEW_LINE> self.customer = get_user_model().objects.create_user( email='customer@cinolabs.com', passwor... | Test the store order (private) | 62598ef4dc8b845886d51e2c |
class TextHelper(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.stop_words = get_stop_words('en') <NEW_LINE> <DEDENT> def clean(self, s): <NEW_LINE> <INDENT> translator = "".maketrans("", "", string.punctuation) <NEW_LINE> return s.translate(translator) <NEW_LINE> <DEDENT> def tokenize(self, text):... | Class has methods for pre-processing text, such as tokenizing and stemming | 62598ef463d6d428bbee1036 |
class Unique(IdentityConstrants): <NEW_LINE> <INDENT> required = ['name'] <NEW_LINE> attributes = {'id':None, 'name':None} <NEW_LINE> contents = {'xsd':['annotation', 'selector', 'field']} <NEW_LINE> tag = 'unique' | <unique name> Enforce fields are unique w/i a specified scope.
parent:
element
attributes:
id -- ID
name -- NCName, required
contents:
annotation?, selector, field+ | 62598ef4a8370b77170eec4c |
class PicResource(Resource): <NEW_LINE> <INDENT> def get(self, file_path): <NEW_LINE> <INDENT> if not file_path: <NEW_LINE> <INDENT> return {'message': 'no image path provided'}, 400 <NEW_LINE> <DEDENT> if file_path.startswith('images/'): <NEW_LINE> <INDENT> file_path = file_path[len('images/'):] <NEW_LINE> <DEDENT> pi... | PicResource provides image data access API.
| 62598ef466656f66f7d58c4b |
class BlockHorizontalLinearOperator(BlockLinearOperator): <NEW_LINE> <INDENT> def __init__(self, blocks, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> for block in blocks: <NEW_LINE> <INDENT> op_shape = block.shape <NEW_LINE> <DEDENT> <DEDENT> except (TypeError, AttributeError): <NEW_LINE> <INDENT> raise Valu... | A block horizontal linear operator.
Each block must be a linear operator.
The blocks must be specified as one list, e.g., `[A, B, C]`. | 62598ef44527f215b58e8767 |
class SixDofDomainBody(ReadWriteFile): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def Build(cls , case, mass, inertia, COG, nModes=0, donName=None) : <NEW_LINE> <INDENT> res = cls( name = join(case, getFilePath("sixDofDomainBody") ), read = False ) <NEW_LINE> res.header["class"] = "dictionary" <NEW_LINE> res.header["... | SixDofDomainBody dictionnary
| 62598ef4d7e4931a7ef3a903 |
class Solution: <NEW_LINE> <INDENT> def combinationSum2(self, num, target): <NEW_LINE> <INDENT> nuLm.sort() <NEW_LINE> ans = [] <NEW_LINE> self.dfs(num, target, [], 0, 0, ans) <NEW_LINE> return ans <NEW_LINE> <DEDENT> def dfs(self, num, target, chosen, index, curr_sum, answer): <NEW_LINE> <INDENT> if curr_sum == target... | @param num: Given the candidate numbers
@param target: Given the target number
@return: All the combinations that sum to target | 62598ef45fcc89381b26555c |
class GooglePrivacyDlpV2InspectContentRequest(_messages.Message): <NEW_LINE> <INDENT> inspectConfig = _messages.MessageField('GooglePrivacyDlpV2InspectConfig', 1) <NEW_LINE> inspectTemplateName = _messages.StringField(2) <NEW_LINE> item = _messages.MessageField('GooglePrivacyDlpV2ContentItem', 3) | Request to search for potentially sensitive info in a ContentItem.
Fields:
inspectConfig: Configuration for the inspector. What specified here will
override the template referenced by the inspect_template_name argument.
inspectTemplateName: Optional template to use. Any configuration directly
specified in ... | 62598ef466673b3332c2ec13 |
class ReportingPolicy: <NEW_LINE> <INDENT> exposed = False <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.transaction_summary = TransactionSummary() <NEW_LINE> self.transaction_details = TransactionDetails() | CherryPy root object class.
not exposed by default the base objects are exposed. | 62598ef4aad79263cf42d075 |
class writeMessage_args(object): <NEW_LINE> <INDENT> def __init__(self, _v=None,): <NEW_LINE> <INDENT> self._v = _v <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None: <NEW_LINE> <IN... | Attributes:
- _v | 62598ef43d592f4c4edb9754 |
class AttachmentField(object): <NEW_LINE> <INDENT> def __init__(self, name, type=None, path=None, fields=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.type = "attachment" <NEW_LINE> self.path = path <NEW_LINE> self.fields = dict([(name, get_field(name, data)) for name, data in list(fields.items())]) <NEW_... | An attachment field.
Requires the mapper-attachments plugin to be installed to be used. | 62598ef4aad79263cf42d076 |
class NeighborFormatter(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> @classmethod <NEW_LINE> def write_listing(cls, structure, listings, output_file): <NEW_LINE> <INDENT> with open(output_file, 'w+') as f: <NEW_LINE> <INDENT> f.write(cls.format_listings(structure, listings)) <NEW_LINE> <DEDENT> <... | abstract interface for formatting neighbor listings | 62598ef4009cb60464cffdb8 |
class CoordsUniformPoints(CoordsPoints): <NEW_LINE> <INDENT> @types.apply_annotations <NEW_LINE> def __init__(self, coords: types.arraydata, volume: float): <NEW_LINE> <INDENT> self.weights = numeric.full(coords.shape[:1], fill_value=volume/coords.shape[0], dtype=float) <NEW_LINE> super().__init__(coords) | Manually supplied points with uniform weights. | 62598ef460cbc95b06362b9e |
@prepoperator.register_operator("identity_filter") <NEW_LINE> class IdentityFilter(prepoperator.Filter): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def _config_schema(cls): <NEW_LINE> <INDENT> schema = super(IdentityFilter, cls)._config_schema() <NEW_LINE> schema["properties"].update( {"min_characters": {"type": "inte... | Ignore TU with the same source and target. | 62598ef48e7ae83300ee78f2 |
class SelectWithDisabled(forms.Select): <NEW_LINE> <INDENT> def render_option(self, selected_choices, option_value, option_label): <NEW_LINE> <INDENT> option_value = force_text(option_value) <NEW_LINE> if option_value in selected_choices: <NEW_LINE> <INDENT> selected_html = mark_safe(' selected="selected"') <NEW_LINE> ... | Modified the stock Select widget to accept choices using a dict() for a label. The dict for each option must include
'label' (string) and 'disabled' (boolean). | 62598ef45166f23b2e241c42 |
class PID: <NEW_LINE> <INDENT> def __init__(self, P=0.2, I=0.0, D=0.0): <NEW_LINE> <INDENT> self.Kp = P <NEW_LINE> self.Ki = I <NEW_LINE> self.Kd = D <NEW_LINE> self.sample_time = 0.00 <NEW_LINE> self.current_time = time.time() <NEW_LINE> self.last_time = self.current_time <NEW_LINE> self.SetPoint = 0.0 <NEW_LINE> self... | PID Controller
| 62598ef4ec188e330fdf7110 |
class Parent: <NEW_LINE> <INDENT> __slots__ = ("name", "age") <NEW_LINE> def __init__(self, name, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age | instance of Parent attr in __slots__ | 62598ef4851cf427c66b6b2d |
class FakeResource: <NEW_LINE> <INDENT> def __init__(self, accessed_attributes=None): <NEW_LINE> <INDENT> self._accessed_attributes = accessed_attributes <NEW_LINE> <DEDENT> def _notice(self, attr): <NEW_LINE> <INDENT> if self._accessed_attributes is not None: <NEW_LINE> <INDENT> self._accessed_attributes.add(attr) <NE... | A resource that seemingly has any accessed attribute.
All attributes resolve back to the their name. All accessed attributes are
recorded and can be referenced from a set that needs to be passed to the
initializer. Knowledge about accessed attributes can be helpful in various
forms of static analysis. | 62598ef456ac1b37e6300a55 |
@skipUnless(settings.ROOT_URLCONF == 'lms.urls', 'Tests only valid in LMS') <NEW_LINE> class CourseTalkKeyTests(test.TestCase): <NEW_LINE> <INDENT> PLATFORM_KEY = 'some_platform' <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(CourseTalkKeyTests, self).setUp() <NEW_LINE> self.course_key = SlashSeparatedCourseKey(... | CourseTalkKeyTests:
tests for function get_coursetalk_course_key
tests for function inject_coursetalk_keys_into_context | 62598ef423849d37ff84f925 |
class Receiver(): <NEW_LINE> <INDENT> def __init__(self, db_host, db_port=5432, db_user='puser', db_pwd='1234'): <NEW_LINE> <INDENT> conn_str = 'host=%s port=%d user=%s password=%s dbname=statistics' % ( db_host, db_port, db_user, db_pwd) <NEW_LINE> self.conn = psycopg2.connect(conn_str) <NEW_LINE> self.cur = self.conn... | Recive data from old statistics format | 62598ef4377c676e912f6196 |
class View(object): <NEW_LINE> <INDENT> def __init__(self, img=np.zeros((5, 5, 3))): <NEW_LINE> <INDENT> self.img = img.copy() <NEW_LINE> <DEDENT> def show(self, winname): <NEW_LINE> <INDENT> cv.imshow(winname, self.img) <NEW_LINE> <DEDENT> def set_img(self, img): <NEW_LINE> <INDENT> self.img = img.copy() <NEW_LINE> <D... | A view holds the currently displayed image and has the functionality of displaying it and transforming.
Depending on how the transformation will be handled in the future this class might be obsolete | 62598ef45fc7496912d476a7 |
class GNUCompiler(Compiler): <NEW_LINE> <INDENT> CC = 'gcc' <NEW_LINE> CPP = 'g++' <NEW_LINE> MPICC = 'mpicc' <NEW_LINE> MPICXX = 'mpicxx' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(GNUCompiler, self).__init__(*args, **kwargs) <NEW_LINE> self.cflags += ['-march=native', '-Wno-unused-resul... | Set of standard compiler flags for the GCC toolchain. | 62598ef44a966d76dd5ed743 |
class TestOrganizationHookRequiresAuth( helper.UnitRequiresAuthenticationHelper ): <NEW_LINE> <INDENT> described_class = OrganizationHook <NEW_LINE> example_data = hook_example_data <NEW_LINE> def test_delete(self): <NEW_LINE> <INDENT> self.assert_requires_auth(self.instance.delete) <NEW_LINE> <DEDENT> def test_edit(se... | Test methods on OrganizationHook object that require authentication. | 62598ef430bbd7224646849e |
class DBMSampler(Block): <NEW_LINE> <INDENT> def __init__(self, dbm): <NEW_LINE> <INDENT> super(DBMSampler, self).__init__() <NEW_LINE> self.theano_rng = make_theano_rng(None, 2012+10+14, which_method="binomial") <NEW_LINE> self.dbm = dbm <NEW_LINE> assert len(self.dbm.hidden_layers) == 1 <NEW_LINE> <DEDENT> def __call... | A Block used to sample from the last layer of a DBM with one hidden layer.
Parameters
----------
dbm : WRITEME | 62598ef426068e7796d4b1c6 |
class mac_check_trap_table(common.AbstractMacCommand): <NEW_LINE> <INDENT> def calculate(self): <NEW_LINE> <INDENT> common.set_plugin_members(self) <NEW_LINE> sym_addrs = self.profile.get_all_addresses() <NEW_LINE> ntraps = obj.Object("int", offset = self.get_profile_symbol("_mach_trap_count"), vm = self.addr_space) <N... | Checks to see if system call table entries are hooked | 62598ef4adb09d7d5dc08e28 |
class RNNCell(): <NEW_LINE> <INDENT> def __init__(self, i, h, o): <NEW_LINE> <INDENT> self.Wh = np.random.normal(size=(h + i, h)) <NEW_LINE> self.Wy = np.random.normal(size=(h, o)) <NEW_LINE> self.bh = np.zeros((1, h)) <NEW_LINE> self.by = np.zeros((1, o)) <NEW_LINE> <DEDENT> def softmax(self, x): <NEW_LINE> <INDENT> x... | Class RNNCell that represents a cell of a simple RNN: | 62598ef47d43ff248742682f |
class ClassLoopMultiNestedLoopSimpler2Caller: <NEW_LINE> <INDENT> def call(self, p1): <NEW_LINE> <INDENT> b = ClassLoopMultiNestedLoopSimpler2() <NEW_LINE> b.doB(p1) | ClassLoopNestedCaller is the entry point of our sequence diagram. | 62598ef4bd1bec0571e144ff |
class ThreadedDisplay(Node): <NEW_LINE> <INDENT> def __init__(self, proc, queue, **data): <NEW_LINE> <INDENT> Node.__init__(self, **data) <NEW_LINE> self.process = proc <NEW_LINE> self.queue = queue <NEW_LINE> self._frame = None <NEW_LINE> self.attach_receiver(MouseReceiver(self._mouse_passthrough)) <NEW_LINE> self.att... | A ThreadedDisplay node is used to display the UI of a Subprocess and display it as a Node.
The Node is automatically resized to match the Display size communicated by the process.
The queue argument is the Queue object returned by start_app.
Supported parameters:
- Node parameters | 62598ef4498bea3a75a5639e |
class PhpbbUser(models.Model): <NEW_LINE> <INDENT> user_id = models.IntegerField(primary_key=True) <NEW_LINE> username = models.CharField(max_length=255) <NEW_LINE> username_clean = models.CharField(max_length=255) <NEW_LINE> user_password = models.CharField(max_length=40) <NEW_LINE> user_posts = models.IntegerField() ... | Model for phpBB user. | 62598ef4a8370b77170eec4e |
class ListModelTest(TestCase): <NEW_LINE> <INDENT> def test_get_absolute_url(self): <NEW_LINE> <INDENT> list_ = List.objects.create() <NEW_LINE> self.assertEqual(list_.get_absolute_url(), '/lists/%d/' % (list_.id,)) <NEW_LINE> <DEDENT> def test_create_new_creates_list_and_first_item(self): <NEW_LINE> <INDENT> List.crea... | tests for models.List | 62598ef42c8b7c6e89bd202d |
class AlignmentWriter(interfaces.AlignmentWriter): <NEW_LINE> <INDENT> def write_header(self, alignments): <NEW_LINE> <INDENT> stream = self.stream <NEW_LINE> try: <NEW_LINE> <INDENT> program = alignments.program <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDENT> program = "Biopython" <NEW_LINE> version = B... | Clustalw alignment writer. | 62598ef4e5267d203ee6a16d |
class AutoDocExcludesTests(SphinxExtTestCase): <NEW_LINE> <INDENT> config = { 'autoclass_content': 'class', 'autodoc_default_options': { 'members': None, 'member-order': 'bysource', 'special-members': None, 'undoc-members': None, }, } <NEW_LINE> extensions = [ 'sphinx.ext.autodoc', 'sphinx.ext.napoleon', 'beanbag_docut... | Unit tests for autodoc_excludes setting. | 62598ef471ff763f4b5e5fc9 |
class AccessError(MetadataError): <NEW_LINE> <INDENT> pass | Raised by the ``notify_*`` methods in MetadataProvider if the supplied
User is not recognized or a functionality is not implemented for this User. | 62598ef47d847024c075ac38 |
class Bloco9(Bloco): <NEW_LINE> <INDENT> registro_abertura = Registro9001() <NEW_LINE> registro_encerramento = Registro9990() <NEW_LINE> @property <NEW_LINE> def fechamento(self): <NEW_LINE> <INDENT> registro = super(Bloco9, self).fechamento <NEW_LINE> registro[2] += 1 <NEW_LINE> return registro | Controle e Encerramento do Arquivo Digital | 62598ef432920d7e50bc4897 |
class DocumentGraph(object): <NEW_LINE> <INDENT> class Vertex(object): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> <DEDENT> ENTRY = Vertex('ENTRY') <NEW_LINE> EXIT = Vertex('EXIT') <N... | Graph to keep all connections between nodes in a document. | 62598ef47b25080760ed5d07 |
class Logger(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def logging(log_path, log_file, msg, mode = 'a'): <NEW_LINE> <INDENT> if not os.path.isdir(log_path): <NEW_LINE> <INDENT> os.mkdir(log_path) <NEW_LINE> <DEDENT> with open(os.path.join(log_path, log_file), mode) as f: <NEW_LINE> <INDENT> f.write(msg + '\... | 日志记录 | 62598ef432920d7e50bc4898 |
class ApplicationLeaderForm(forms.ModelForm): <NEW_LINE> <INDENT> is_recommendation = forms.BooleanField(required=False, label="Is a recommendation") <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = models.LeaderRating <NEW_LINE> fields = ['rating', 'notes'] <NEW_LINE> widgets = {'notes': forms.Textarea(attrs={'rows'... | Form for assigning a rating from a leader application.
Since the participant and activity are given by the application itself,
we need not include those an options in the form. | 62598ef47b180e01f3e4847b |
class RandomTargetBreakout(StandardBreakout): <NEW_LINE> <INDENT> def __init__(self, num_bricks=(2, 4), *args, **kwargs): <NEW_LINE> <INDENT> kwargs.setdefault('starting_ball_movement_radius', _MAX_SPEED) <NEW_LINE> super(RandomTargetBreakout, self).__init__(**kwargs) <NEW_LINE> self.num_bricks = num_bricks <NEW_LINE> ... | A single target appears and respawns each time it is hit. | 62598ef4f548e778e5969df7 |
class Comment(models.Model): <NEW_LINE> <INDENT> nid = models.AutoField(primary_key=True) <NEW_LINE> article = models.ForeignKey(to="Article", to_field="nid", on_delete=models.CASCADE) <NEW_LINE> user = models.ForeignKey(to="UserInfo", to_field="nid", on_delete=models.CASCADE) <NEW_LINE> content = models.CharField(max_... | 评论表 | 62598ef4ec188e330fdf7112 |
class HNSHA(FinTS3Segment): <NEW_LINE> <INDENT> type = 'HNSHA' <NEW_LINE> version = 2 <NEW_LINE> SECURITY_FUNC = 999 <NEW_LINE> SECURITY_BOUNDARY = 1 <NEW_LINE> SECURITY_SUPPLIER_ROLE = 1 <NEW_LINE> PINTAN_VERSION = 1 <NEW_LINE> def __init__(self, segno, secref, pin): <NEW_LINE> <INDENT> data = [ secref, '', pin ] <NEW... | HNSHA (Signaturabschluss)
Section B.5.2 | 62598ef426068e7796d4b1c8 |
class Image(JSONSerializable, GetOrCreateForeignObject): <NEW_LINE> <INDENT> yaml_tag = '!image' <NEW_LINE> yaml_loader = yaml.SafeLoader <NEW_LINE> model = WagtailImage <NEW_LINE> file = None <NEW_LINE> def lookup(self): <NEW_LINE> <INDENT> return {'file': self.db_filename} <NEW_LINE> <DEDENT> @property <NEW_LINE> def... | A reference to an image | 62598ef4e1aae11d1e7cdc76 |
class GroupingPhrase(_BaseWordsGrouping): <NEW_LINE> <INDENT> GROUP_JUDGE_SET = [ ("GROUP", "BY"), ("ORDER", "BY"), ("PARTITION", "BY"), ("DENSE_RANK", ("LAST", "FIRST")), ("CONNECT", "BY"), ("START", "WITH"), ] <NEW_LINE> def get_group_class(self): <NEW_LINE> <INDENT> return Phrase <NEW_LINE> <DEDENT> def init_group_t... | Phraseのグルーピングを拡張 | 62598ef45fdd1c0f98e5c80e |
class KaraboOffstudy(InfantCrfModelMixin): <NEW_LINE> <INDENT> report_datetime = models.DateTimeField( verbose_name="Report Date", validators=[ datetime_not_before_study_start, datetime_not_future], default=get_utcnow, help_text=('If reporting today, use today\'s date/time, otherwise use' ' the date/time this informati... | A model completed by the user when the infant is taken off study. | 62598ef466673b3332c2ec17 |
class WireArrangement(IdentifiedObject): <NEW_LINE> <INDENT> def __init__(self, position=0, mountingPointX=0.0, mountingPointY=0.0, WireType=None, ConductorInfo=None, *args, **kw_args): <NEW_LINE> <INDENT> self.position = position <NEW_LINE> self.mountingPointX = mountingPointX <NEW_LINE> self.mountingPointY = mounting... | Identification, spacing and configuration of the wires of a Conductor, with reference to their type.
| 62598ef4d268445f26638fc5 |
class ActionTabs(QTabWidget): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.parent = parent <NEW_LINE> self.filters_tab = FiltersTab(self) <NEW_LINE> self.adjustment_tab = AdjustingTab(self) <NEW_LINE> self.modification_tab = ModificationTab(self) <NEW_LINE> self... | Action tabs widget | 62598ef455399d3f05624d92 |
class LishipinPipeline(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.server = redis.from_url(REDIS_URL) <NEW_LINE> <DEDENT> def process_item(self, item, spider): <NEW_LINE> <INDENT> if spider.name != 'livideo': <NEW_LINE> <INDENT> return item <NEW_LINE> <DEDENT> if item["videoAddr"]: <NEW_LI... | 将视频插入到redis,从reids中弹出item进行下载 | 62598ef4851cf427c66b6b31 |
class NerfTable(LookUpTable): <NEW_LINE> <INDENT> __tablename__ = None <NEW_LINE> @staticmethod <NEW_LINE> def from_file(source_file="nerf_int.npz", instance=None): <NEW_LINE> <INDENT> return LookUpTable.populate_table(instance or NerfTable(), source_file) | Look up table containing the values of Nerf integral within the :math:`\phi`
function that describes how the discharge rate vary as a function of parameters
defining the statistical properties of the membrane potential in presence of synaptic inputs. | 62598ef491f36d47f22302da |
class Platform(Enum): <NEW_LINE> <INDENT> Unknown = 'Unknown' <NEW_LINE> macOS = 'macOS' <NEW_LINE> iOS = 'iOS' <NEW_LINE> tvOS = 'tvOS' | The platform of the managed device. | 62598ef47047854f4633dc35 |
class TheHiveException(Exception): <NEW_LINE> <INDENT> pass | Base class for TheHive exceptions | 62598ef456ac1b37e6300a59 |
class TimingParametersContainer(Container): <NEW_LINE> <INDENT> container_prefix = "timing" <NEW_LINE> slope = Field(nan, "Slope of arrival times along main shower axis") <NEW_LINE> slope_err = Field(nan, "Uncertainty `slope`") <NEW_LINE> intercept = Field(nan, "intercept of arrival times along main shower axis") <NEW_... | Slope and Intercept of a linear regression of the arrival times
along the shower main axis | 62598ef467a9b606de54483b |
class ChatConsumer(AsyncWebsocketConsumer): <NEW_LINE> <INDENT> def __init__(self, scope): <NEW_LINE> <INDENT> super().__init__(scope) <NEW_LINE> self.room_name = None <NEW_LINE> self.room_group_name = None <NEW_LINE> <DEDENT> async def connect(self): <NEW_LINE> <INDENT> self.room_name = self.scope['url_route']['kwargs... | A single channel consumer for handing room chat. | 62598ef4ec188e330fdf7114 |
@tvm._ffi.register_object("relay.attrs.AvgPool2DAttrs") <NEW_LINE> class AvgPool2DAttrs(Attrs): <NEW_LINE> <INDENT> pass | Attributes used in avg_pool2d operators | 62598ef4f548e778e5969df9 |
class UserRegistrationView(View): <NEW_LINE> <INDENT> template_name = 'users/register.html' <NEW_LINE> def dispatch(self, request, *args, **kwargs): <NEW_LINE> <INDENT> if request.user.is_authenticated: <NEW_LINE> <INDENT> return redirect('home') <NEW_LINE> <DEDENT> return super().dispatch(request, *args, **kwargs) <NE... | Register a new user account | 62598ef432920d7e50bc4899 |
class TestSettingsView(gui_test_lib.GRRSeleniumTest): <NEW_LINE> <INDENT> def testSettingsView(self): <NEW_LINE> <INDENT> with test_lib.ConfigOverrider({ "ACL.group_access_manager_class": "Foo bar.", "AdminUI.bind": "127.0.0.1" }): <NEW_LINE> <INDENT> self.Open("/#/config") <NEW_LINE> self.WaitUntil(self.IsTextPresent,... | Test the settings GUI. | 62598ef4adb09d7d5dc08e2c |
class BitmapButton(wx.BitmapButton): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> wx.BitmapButton.__init__(self, *args, **kwargs) <NEW_LINE> <DEDENT> def SetToolTip(self, tip): <NEW_LINE> <INDENT> if wxPythonPhoenix: <NEW_LINE> <INDENT> wx.BitmapButton.SetToolTip(self, tipString=tip) <NE... | Wrapper around wx.BitmapButton to have more control
over the widget on different platforms/wxpython versions | 62598ef55fc7496912d476a9 |
class Keras_LR(): <NEW_LINE> <INDENT> def __init__(self, n_epoch, batchsize): <NEW_LINE> <INDENT> self.n_epoch = n_epoch <NEW_LINE> self.batchsize = batchsize <NEW_LINE> <DEDENT> def fit(self, train_x, train_y): <NEW_LINE> <INDENT> train_x = train_x.astype('float32') <NEW_LINE> n_dim = train_x.shape[1] <NEW_LINE> n_fla... | Logistic Regression with Chainer | 62598ef5097d151d1a2bf88f |
class MsgCommand(Message): <NEW_LINE> <INDENT> type = 'command' <NEW_LINE> want_response = True | Command message | 62598ef57d847024c075ac3b |
class SudokuUnSolver: <NEW_LINE> <INDENT> def __init__(self, solved_board: Board): <NEW_LINE> <INDENT> self.solved_board = solved_board <NEW_LINE> self.length = len(solved_board) <NEW_LINE> self.quadrant_dimension = int(math.sqrt(self.length)) <NEW_LINE> <DEDENT> def _get_next_coords(self) -> Optional[Tuple[int, int]]:... | From a solved Sudoku board generate possible Sudoku problems.
These are boards with some of the entries of the solution erased that have a unique
solution.
The randomness comes from randomly choosing which squares to erase and from permuting
the labels (numbers 1..9) of the generated Sudoku problem
If I understood gro... | 62598ef54c34283577618b53 |
class ERUGrad(function_node.FunctionNode): <NEW_LINE> <INDENT> def __init__(self, r): <NEW_LINE> <INDENT> self.r = r <NEW_LINE> self.ir = float(1/self.r) <NEW_LINE> self.r2 = float(r**2) <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check._argname(in_types, ('x',)) <NEW_LINE> type... | Exponential Root Unit gradient function. | 62598ef563d6d428bbee103c |
class NsrSyncNackRsnErrRxUnexpOpenIdentity(NsrSyncNackRsnIdentity): <NEW_LINE> <INDENT> _prefix = 'mpls-ldp-ios-xe-oper' <NEW_LINE> _revision = '2017-02-07' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> NsrSyncNackRsnIdentity.__init__(self) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> ... | NSR failed due to an unexpected open. | 62598ef5283ffb24f3cf2116 |
class CVS(Source): <NEW_LINE> <INDENT> name = "cvs" <NEW_LINE> def __init__(self, cvsroot, cvsmodule, global_options=[], branch=None, checkoutDelay=None, checkout_options=[], login=None, **kwargs): <NEW_LINE> <INDENT> self.checkoutDelay = checkoutDelay <NEW_LINE> self.branch = branch <NEW_LINE> Source.__init__(self, **... | I do CVS checkout/update operations.
Note: if you are doing anonymous/pserver CVS operations, you will need
to manually do a 'cvs login' on each buildslave before the slave has any
hope of success. XXX: fix then, take a cvs password as an argument and
figure out how to do a 'cvs login' on each build | 62598ef597e22403b383975d |
class CNN1DClassifier(PTLClassifierBase): <NEW_LINE> <INDENT> def __init__(self, kernel_size=3, dropout=None, n_layers=1, n_neurons=32, epochs=10, batch_size=256, alpha=0.001, beta1=0.9, beta2=0.999): <NEW_LINE> <INDENT> super(CNN1DClassifier, self).__init__( epochs, batch_size, alpha, beta1, beta2 ) <NEW_LINE> self.n_... | Estimator with one dimensional convolutional neural network.
Parameters
----------
For any parameters not listed, see PTLClassifierBase.
n_layers: int > 0
Number of layers in the NN
n_neurons: int > 0
Number of neurons in every layer | 62598ef555399d3f05624d94 |
class PdfImage(Image): <NEW_LINE> <INDENT> def __init__(self, scene=None): <NEW_LINE> <INDENT> debugMsg("Called PdfImage.__init__()") <NEW_LINE> Image.__init__(self) <NEW_LINE> if scene is not None: <NEW_LINE> <INDENT> self.renderer = scene.renderer <NEW_LINE> <DEDENT> self.format = "pdf" <NEW_LINE> <DEDENT> def load(s... | Subclass of Image class to explicitly handle pdf images | 62598ef58a349b6b43684aaf |
class ParsedVocabulary(RDFStatInterface): <NEW_LINE> <INDENT> def __init__(self, results, model_path): <NEW_LINE> <INDENT> super(ParsedVocabulary, self).__init__(results) <NEW_LINE> if model_path is not None: <NEW_LINE> <INDENT> model = realpath(model_path) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> model = realpath... | count usage of everything that #isDefinedBy some vocabulary | 62598ef58a43f66fc4bf09e2 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.