code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class PetShop: <NEW_LINE> <INDENT> def __init__(self, animal_factory=None): <NEW_LINE> <INDENT> self.pet_factory = animal_factory <NEW_LINE> <DEDENT> def show_pet(self): <NEW_LINE> <INDENT> pet = self.pet_factory.get_pet() <NEW_LINE> print("This is a lovely", pet) <NEW_LINE> print("It says", pet.speak()) <NEW_LINE> pri...
A pet shop
6259904776d4e153a661dc2f
class TFramedTransport: <NEW_LINE> <INDENT> def __init__(self, base): <NEW_LINE> <INDENT> self.__base = base <NEW_LINE> self.__read_buffer = BytesIO() <NEW_LINE> self.__write_buffer = BytesIO() <NEW_LINE> <DEDENT> def read(self, n=-1): <NEW_LINE> <INDENT> if len(self.__read_buffer.getvalue()) == 0: <NEW_LINE> <INDENT> ...
Implement the Twisted framed transport protocol. Since most async servers use this including the python2 twisted bindings, this is likely of interest.
62599047b57a9660fecd2def
class PrimitiveProcedure(Procedure): <NEW_LINE> <INDENT> def __init__(self, fn, use_env=False, name='primitive'): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fn = fn <NEW_LINE> self.use_env = use_env <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '#[{0}]'.format(self.name) <NEW_LINE> <DEDENT...
A Scheme procedure defined as a Python function.
6259904729b78933be26aa7c
class TestStackList(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.A = Node(1) <NEW_LINE> self.B = Node(2) <NEW_LINE> self.C = Node(3) <NEW_LINE> self._stack = StackList() <NEW_LINE> <DEDENT> def test1(self): <NEW_LINE> <INDENT> self.assertEqual(self._stack.count(), 0) <NEW_LINE> self...
Test the StackList class
62599047dc8b845886d5492e
class Error(Exception): <NEW_LINE> <INDENT> pass
Base class for all redpipe errors
62599047097d151d1a2c23df
class LoaderError(Exception): <NEW_LINE> <INDENT> pass
Loader base error.
62599047462c4b4f79dbcd72
class ExperimentSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Experiment <NEW_LINE> fields = '__all__'
JSON serialized representation of the Experiment Model
6259904771ff763f4b5e8b17
class TestingConfig(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> SQLALCHEMY_DATABASE_URI = os.getenv('TEST_DATABASE_URI') <NEW_LINE> PRESERVE_CONTEXT_ON_EXCEPTION = False
Testing configurations
6259904773bcbd0ca4bcb600
class Map(object): <NEW_LINE> <INDENT> TILE_SIZE = 256 <NEW_LINE> LEVEL_NUMBER = 20 <NEW_LINE> ZOOM_FACTOR = 2 <NEW_LINE> srs = '+init=epsg:4326' <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> for elem, value in kwargs.items(): <NEW_LINE> <INDENT> setattr(self, elem, value)
used for carry Map Element attributes
625990478a43f66fc4bf3508
class TestEstoriaApp(TestCase): <NEW_LINE> <INDENT> def test_apps(self): <NEW_LINE> <INDENT> self.assertEqual(EstoriaAppConfig.name, 'estoria_app') <NEW_LINE> self.assertEqual(apps.get_app_config('estoria_app').name, 'estoria_app')
Test apps.py
6259904730dc7b76659a0ba6
class BasicCancel(AMQPMethodPayload): <NEW_LINE> <INDENT> __slots__ = ( u'consumer_tag', u'no_wait', ) <NEW_LINE> NAME = u'basic.cancel' <NEW_LINE> INDEX = (60, 30) <NEW_LINE> BINARY_HEADER = b'\x00\x3C\x00\x1E' <NEW_LINE> SENT_BY_CLIENT, SENT_BY_SERVER = True, True <NEW_LINE> IS_SIZE_STATIC = False <NEW_LINE> IS_CONTE...
End a queue consumer This method cancels a consumer. This does not affect already delivered messages, but it does mean the server will not send any more messages for that consumer. The client may receive an arbitrary number of messages in between sending the cancel method and receiving the cancel-ok reply. It may also...
625990470fa83653e46f6250
class FionaReader(object): <NEW_LINE> <INDENT> def __init__(self, filename, bbox=None): <NEW_LINE> <INDENT> self._data = [] <NEW_LINE> with fiona.open(filename) as f: <NEW_LINE> <INDENT> if bbox is not None: <NEW_LINE> <INDENT> assert len(bbox) == 4 <NEW_LINE> features = f.filter(bbox=bbox) <NEW_LINE> <DEDENT> else: <N...
Provides an interface for accessing the contents of a shapefile with the fiona library, which has a much faster reader than pyshp. The primary methods used on a Reader instance are :meth:`~Reader.records` and :meth:`~Reader.geometries`.
6259904710dbd63aa1c71f4e
class CopyProcess(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.__process = client.CopyProcess() <NEW_LINE> <DEDENT> def add_job(self, source, target, sourcelimit = 1, force = False, posc = False, coerce = False, mkdir = False, thirdparty = 'none', ...
Add multiple individually-configurable copy jobs to a "copy process" and run them in parallel (yes, in parallel, because ``xrootd`` isn't limited by the `GIL`.
625990473617ad0b5ee074b0
class Form(Base): <NEW_LINE> <INDENT> __tablename__ = 'forms' <NEW_LINE> __mapper_args__ = {'polymorphic_on': 'type'} <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> type = Column(String(16), nullable=False) <NEW_LINE> project_id = Column(Integer, ForeignKey('projects.id')) <NEW_LINE> def __init__(self, pr...
A collection of widgets
6259904707d97122c4218016
class FieldGetDbPrepValueMixin(object): <NEW_LINE> <INDENT> get_db_prep_lookup_value_is_iterable = False <NEW_LINE> @classmethod <NEW_LINE> def get_prep_lookup_value(cls, value, output_field): <NEW_LINE> <INDENT> if hasattr(value, '_prepare'): <NEW_LINE> <INDENT> return value._prepare(output_field) <NEW_LINE> <DEDENT> ...
Some lookups require Field.get_db_prep_value() to be called on their inputs.
62599047d53ae8145f9197d4
class BaseConfig(object): <NEW_LINE> <INDENT> TESTING = False <NEW_LINE> DEBUG = False <NEW_LINE> SECRET_KEY = "justincase"
Common configurations
62599047379a373c97d9a39f
class ChangeRoomForm(forms.ModelForm): <NEW_LINE> <INDENT> labels_file = forms.FileField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = OTreeInstance <NEW_LINE> fields = ['otree_room_name', 'labels_file'] <NEW_LINE> <DEDENT> def clean_labels_file(self): <NEW_LINE> <INDENT> participant_label_file = self.cleaned_da...
Form for changing room details
6259904763b5f9789fe864e1
class AllTests(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_zero_hour(self): <NEW_LINE> <INDENT> self.assertEqual( hour_man.hhmmss2sec(0,0,0), 0 ) <NEW_LINE> <DEDENT> def test_random_hour(self): <NEW_LINE> <INDENT> self.assertEqual( hour_man.hhmmss2sec(15,32,11),...
Test the stand-alone module functions.
62599047b57a9660fecd2df2
class Field(ScopeContext): <NEW_LINE> <INDENT> def __init__(self, type_, default=UNSET, serializer=UNSET): <NEW_LINE> <INDENT> self.type_ = type_ <NEW_LINE> self.default = default <NEW_LINE> self.serializer = serializer <NEW_LINE> <DEDENT> def serialize(self, value): <NEW_LINE> <INDENT> serializer = self.serializer <NE...
A schema field.
625990471f5feb6acb163f6b
class _MoeUITask(object): <NEW_LINE> <INDENT> def __init__(self, ui, task_name, description, formatter): <NEW_LINE> <INDENT> self._ui = ui <NEW_LINE> self._task_name = task_name <NEW_LINE> self._description = description <NEW_LINE> self._formatter = formatter <NEW_LINE> self._result = None <NEW_LINE> <DEDENT> def __ent...
_MoeUITask encapsulates a single, transactional task in the UI.
6259904730dc7b76659a0ba8
class ArgumentError(SQLAlchemyError): <NEW_LINE> <INDENT> pass
Raised when an invalid or conflicting function argument is supplied. This error generally corresponds to construction time state errors.
6259904710dbd63aa1c71f50
class RandInt(PyoObject): <NEW_LINE> <INDENT> def __init__(self, max=100, freq=1.0, mul=1, add=0): <NEW_LINE> <INDENT> pyoArgsAssert(self, "OOOO", max, freq, mul, add) <NEW_LINE> PyoObject.__init__(self, mul, add) <NEW_LINE> self._max = max <NEW_LINE> self._freq = freq <NEW_LINE> max, freq, mul, add, lmax = convertArgs...
Periodic pseudo-random integer generator. RandInt generates a pseudo-random integer number between 0 and `max` values at a frequency specified by `freq` parameter. RandInt will hold generated value until the next generation. :Parent: :py:class:`PyoObject` :Args: max: float or PyoObject, optional Maximum...
6259904707d97122c4218017
class FunctionalForm(Component): <NEW_LINE> <INDENT> def __init__(self, extent, decay, rough, left_component, right_component, name='', reverse=False, microslab_max_thickness=1): <NEW_LINE> <INDENT> super(FunctionalForm, self).__init__(name=name) <NEW_LINE> self.left_component = left_component <NEW_LINE> self.right_com...
Component describing an analytic SLD profile. An exponential profile is hard coded here. Parameters ---------- extent : Parameter or float The total extent of the functional region decay : Parameter or float Decay length of exponential profile rough : Parameter or float Roughness between this Component and...
6259904707d97122c4218018
class Maciek(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name
Model definition for Maciek.
625990478da39b475be04566
class StoppableThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(StoppableThread, self).__init__(**kwargs) <NEW_LINE> self._stop_requested = threading.Event() <NEW_LINE> <DEDENT> def stop(self): <NEW_LINE> <INDENT> self._stop_requested.set() <NEW_LINE> <DEDENT> def st...
Thread class with a stop() method. The thread itself has to check regularly for the stopped() condition. http://stackoverflow.com/questions/323972/is-there-any-way-to-kill-a-thread-in-python
6259904745492302aabfd848
class TestTileProcessor(TileProcessor): <NEW_LINE> <INDENT> def setup(self, parameters): <NEW_LINE> <INDENT> self.parameters = parameters <NEW_LINE> <DEDENT> def process(self, file_path, x_index, y_index, z_index, t_index=None): <NEW_LINE> <INDENT> return open(file_path, 'rb')
Example processor for unit tests
62599047c432627299fa42be
class Wait(object): <NEW_LINE> <INDENT> CLASS_NAME = "Native_wait___" <NEW_LINE> def __init__(self, driver, timeout, poll_frequency=POLL_FREQUENCY, ignored_exceptions=None): <NEW_LINE> <INDENT> self._driver = driver <NEW_LINE> self._timeout = timeout <NEW_LINE> self._poll = poll_frequency <NEW_LINE> if self._poll == 0:...
Native find element wait
6259904730c21e258be99b7d
class Permission(db.Model, IdModel, SoftDeleteModel): <NEW_LINE> <INDENT> __tablename__ = 'permission' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> role_id = db.Column(db.Integer, db.ForeignKey('role.id'), index=True) <NEW_LINE> read = db.Column(db.Boolean, default=False) <NEW_LINE> write = db.Col...
A set of rights granted to a role on a resource.
6259904794891a1f408ba0b1
class Management(models.Model): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> app_label = 'course_manager' <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "the Management"
deprecated! This class covers no functionality at all and should be removed with the next update. Mind possible cross-dependencies when applying changes.
6259904729b78933be26aa7e
class IntentPolicy(object): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, policy_name): <NEW_LINE> <INDENT> super(IntentPolicy, self).__init__() <NEW_LINE> self.policy_name = policy_name <NEW_LINE> <DEDENT> def get_policy_name(self): <NEW_LINE> <INDENT> return self.policy_name <NEW_LINE>...
Policy to handle an intention of the user.
62599047baa26c4b54d50621
class AlphaBetaAgent(MultiAgentSearchAgent): <NEW_LINE> <INDENT> def getAction(self, gameState): <NEW_LINE> <INDENT> def maxFunction(gameState, depth, alpha, beta): <NEW_LINE> <INDENT> if gameState.isWin() or gameState.isLose() or depth == 0: <NEW_LINE> <INDENT> return self.evaluationFunction(gameState) <NEW_LINE> <DED...
Your minimax agent with alpha-beta pruning (question 3)
6259904723e79379d538d875
class MyChevyHub(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, client, hass, hass_config): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._client = client <NEW_LINE> self.hass = hass <NEW_LINE> self.hass_config = hass_config <NEW_LINE> self.cars = [] <NEW_LINE> self.status = None <NEW_LINE> self.rea...
MyChevy Hub. Connecting to the mychevy website is done through a selenium webscraping process. That can only run synchronously. In order to prevent blocking of other parts of Home Assistant the architecture launches a polling loop in a thread. When new data is received, sensors are updated, and hass is signaled that ...
62599047097d151d1a2c23e3
@admin.register(GlobalSeo) <NEW_LINE> class GlobalSeoAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> fieldsets = ( ('Главная страница', {'fields': ('main_seo_title', 'main_seo_description', 'main_seo_keywords')}), ('Блог', {'fields': ('blog_seo_title', 'blog_seo_description', 'blog_seo_keywords')}), ('Портфолио', {'fields...
Admin for global SEO settings
625990471f5feb6acb163f6d
class ReplicaAppResource(tardis.tardis_portal.api.ReplicaResource): <NEW_LINE> <INDENT> class Meta(tardis.tardis_portal.api.ReplicaResource.Meta): <NEW_LINE> <INDENT> resource_name = 'replica' <NEW_LINE> authorization = ACLAuthorization() <NEW_LINE> queryset = DataFileObject.objects.all() <NEW_LINE> filtering = { 'veri...
Extends MyTardis's API for DFOs, adding in the size as measured by file_object.size
62599047d7e4931a7ef3d3ed
class TestDedupeApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = isi_sdk_8_2_1.api.dedupe_api.DedupeApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_dedupe_dedupe_summary(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT>...
DedupeApi unit test stubs
62599047596a897236128f6b
class ApplicationConfig(BaseWorker.CONFIG_CLASS): <NEW_LINE> <INDENT> transport_name = ConfigText( "The name this application instance will use to create its queues.", required=True, static=True) <NEW_LINE> send_to = ConfigDict( "'send_to' configuration dict.", default={}, static=True)
Base config definition for applications. You should subclass this and add application-specific fields.
6259904726238365f5faded4
class Hunt_Specification( namedtuple('Hunt_Specification', ('J', 'C', 'h', 's', 'Q', 'M', 'H', 'HC'))): <NEW_LINE> <INDENT> pass
Defines the Hunt colour appearance model specification. This specification has field names consistent with the remaining colour appearance models in :mod:`colour.appearance` but diverge from Fairchild (2013) reference. Parameters ---------- J : numeric Correlate of *Lightness* :math:`J`. C : numeric Correlate...
6259904715baa72349463309
class Solution(object): <NEW_LINE> <INDENT> def countAndSay(self, n): <NEW_LINE> <INDENT> res = '1' <NEW_LINE> for _ in range(n - 1): <NEW_LINE> <INDENT> res = self.helper(res) <NEW_LINE> <DEDENT> return res <NEW_LINE> <DEDENT> def helper(self, n): <NEW_LINE> <INDENT> count, i, res = 1, 0, "" <NEW_LINE> while i < len(n...
理解了题意即懂如何做,题意是依据上一个字符串来推导下一个字符串,第一个字符串是"1",所以第二个就是1个1,即"11", 第三个就是2个1,即"21",第四个就是1个2,1个1,即"1211"; 解法就是遍历需要得到的答案位于第几个,然后针对每一个去求得它的值 Runtime: 24 ms, faster than 64.32% of Python online submissions for Count and Say. Memory Usage: 11.8 MB, less than 5.40% of Python online submissions for Count and Say.
62599047e76e3b2f99fd9d84
class number_of_jobs(Variable): <NEW_LINE> <INDENT> _return_type="int32" <NEW_LINE> def dependencies(self): <NEW_LINE> <INDENT> return [attribute_label("faz", "large_area_id"), attribute_label("faz", "number_of_jobs"), my_attribute_label("large_area_id")] <NEW_LINE> <DEDENT> def compute(self, dataset_pool): <NEW_LINE> ...
Number of jobs in each area
62599047b830903b9686ee37
class BitwiseNegationOperator(UnaryOperator): <NEW_LINE> <INDENT> pass
Represents the '~' bitwise negation operator
625990474e696a045264e7dd
class CmdChannels(MuxCommand): <NEW_LINE> <INDENT> key = "channels" <NEW_LINE> aliases = ["comlist"] <NEW_LINE> help_category = "Comms" <NEW_LINE> locks = "cmd: not pperm(channel_banned)" <NEW_LINE> account_caller = True <NEW_LINE> def func(self): <NEW_LINE> <INDENT> caller = self.caller <NEW_LINE> channels = [chan for...
list all channels available to you Usage: channels clist comlist Lists all channels available to you, whether you listen to them or not. Use 'comlist' to only view your current channel subscriptions. Use addcom/delcom to join and leave channels
6259904796565a6dacd2d946
class GameObject(metaclass=GameObjectMeta): <NEW_LINE> <INDENT> registry = GameObjectRegistry() <NEW_LINE> load_priority = 0 <NEW_LINE> hooks = [] <NEW_LINE> def __init__(self, id_=None): <NEW_LINE> <INDENT> id_ = id_ or self.registry.make_id() <NEW_LINE> self.id_ = id_ <NEW_LINE> self.registry[id_] = self <NEW_LINE> <...
{ cls: class_name, id: id_ or None }
62599047b57a9660fecd2df6
class ConfigurationException(mcxPyBotException): <NEW_LINE> <INDENT> pass
Exception for configuration errors detected on runtime of mcxPyBot.
62599047d53ae8145f9197d9
@parser(Specs.sysctl_conf_initramfs) <NEW_LINE> class SysctlConfInitramfs(CommandParser, LogFileOutput): <NEW_LINE> <INDENT> def parse_content(self, content): <NEW_LINE> <INDENT> valid_lines = [] <NEW_LINE> for line in content: <NEW_LINE> <INDENT> line = line.strip() <NEW_LINE> if line and not (line.startswith('#') or ...
Shared parser for the output of ``lsinitrd`` applied to kdump initramfs images to view ``sysctl.conf`` and ``sysctl.d`` configurations. For now, the file is treated as raw lines (as a ``LogFileOutput`` parser. This is because the output of the command, applied to multiple files to examine multiple files does not seem...
6259904771ff763f4b5e8b1d
class ContatosViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Contato.objects.all() <NEW_LINE> serializer_class = ContatoSerializer
Exibindo todos os Contatos
6259904773bcbd0ca4bcb606
class Odbc(Publisher): <NEW_LINE> <INDENT> def __init__(self, dsn): <NEW_LINE> <INDENT> Publisher.__init__(self) <NEW_LINE> self._dsn = dsn <NEW_LINE> self._sql = None <NEW_LINE> self._cursor = None <NEW_LINE> self._sql = None <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self._sql = odbc.odbc(self._dsn) <NE...
Publisher for ODBC connections. Generated data sent as a SQL query via execute. Calling receave will return a string of all row data concatenated together with as field separator. Currently this Publisher makes use of the odbc package which is some what broken in that you must create an actual ODBC DSN via th...
6259904710dbd63aa1c71f54
class HttpMessage(object): <NEW_LINE> <INDENT> def __init__(self, version='1.1'): <NEW_LINE> <INDENT> self.version = version <NEW_LINE> self._headers = dict() <NEW_LINE> <DEDENT> @property <NEW_LINE> def headers(self): <NEW_LINE> <INDENT> return self._headers <NEW_LINE> <DEDENT> def header(self, name): <NEW_LINE> <INDE...
Parent class for requests and responses. Many of the elements in the messages share common structures. Attributes: version A bytearray or string value representing the major-minor version of the HttpMessage.
6259904721a7993f00c672e3
class MLPHeb(HebbianNetwork): <NEW_LINE> <INDENT> def __init__(self, config=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> defaults = dict( device="cpu", input_size=784, num_classes=10, hidden_sizes=[100, 100, 100], percent_on_k_winner=[1.0, 1.0, 1.0], boost_strength=[1.4, 1.4, 1.4], boost_strength_factor=[0....
Simple 3 hidden layers + output MLP
6259904707f4c71912bb07ac
class FUGUE(FSLCommand): <NEW_LINE> <INDENT> _cmd = 'fugue' <NEW_LINE> input_spec = FUGUEInputSpec <NEW_LINE> output_spec = FUGUEOutputSpec <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(FUGUE, self).__init__(**kwargs) <NEW_LINE> warn( 'This interface has not been fully tested. Please report any fai...
Use FSL FUGUE to unwarp epi's with fieldmaps Examples -------- Please insert examples for use of this command
6259904707d97122c421801c
class ControllerGetResponse(object): <NEW_LINE> <INDENT> swagger_types = { 'more_items_remaining': 'bool', 'total_item_count': 'int', 'continuation_token': 'str', 'items': 'list[Controller]' } <NEW_LINE> attribute_map = { 'more_items_remaining': 'more_items_remaining', 'total_item_count': 'total_item_count', 'continuat...
Attributes: swagger_types (dict): The key is attribute name and the value is attribute type. attribute_map (dict): The key is attribute name and the value is json key in definition.
625990478e71fb1e983bce47
class Test_Traversal(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.g = graph.DirectedGraph() <NEW_LINE> self.g.add_node("a") <NEW_LINE> self.g.add_node("b", ["a"]) <NEW_LINE> self.g.add_node("c", ["b"]) <NEW_LINE> self.g.add_node("d", ["b"]) <NEW_LINE> self.g.add_node("e") <NEW_LINE>...
Many tests using the same tree which contains all the cases.
62599047d53ae8145f9197da
class Assessment(UserResource): <NEW_LINE> <INDENT> lead = models.OneToOneField(Lead, default=None, blank=True, null=True) <NEW_LINE> lead_group = models.OneToOneField(LeadGroup, default=None, blank=True, null=True) <NEW_LINE> metadata = JSONField(default=None, blank=True, null=True) <NEW_LINE> methodology = JSONField(...
Assesssment belonging to a lead
62599047d6c5a102081e3496
class BinaryPredicate(Predicate): <NEW_LINE> <INDENT> def __init__(self, label, pairs, kb, producer_pred=None): <NEW_LINE> <INDENT> Predicate.__init__(self, label, kb, producer_pred) <NEW_LINE> if not producer_pred: <NEW_LINE> <INDENT> self.input_var = Predicate._avar() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> sel...
A binary predicate.
6259904715baa7234946330b
class ShowFirewallRule(neutronv20.ShowCommand): <NEW_LINE> <INDENT> resource = 'firewall_rule' <NEW_LINE> log = logging.getLogger(__name__ + '.ShowFirewallRule')
Show information of a given firewall rule.
6259904745492302aabfd84c
class ITC03010801_InstallHost_Maintenance(BaseTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.dm = super(self.__class__, self).setUp() <NEW_LINE> self.host_api = HostAPIs() <NEW_LINE> LogPrint().info('Pre-Test-1: Create Host "%s" in Cluster "%s".' % (self.dm.host_name, ModuleData.cluster_name))...
@summary: ITC-03主机管理-01主机操作-08安装-01主机Maintenance状态
62599047379a373c97d9a3a5
class Solution: <NEW_LINE> <INDENT> def searchRange(self, root, k1, k2): <NEW_LINE> <INDENT> res = [] <NEW_LINE> self.helper(res, root, k1, k2) <NEW_LINE> return res <NEW_LINE> <DEDENT> def helper(self, res, root, k1, k2): <NEW_LINE> <INDENT> if not root: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> if root.val < k1:...
@param root: param root: The root of the binary search tree @param k1: An integer @param k2: An integer @return: return: Return all keys that k1<=key<=k2 in ascending order
62599047711fe17d825e165b
class SubmittedThing (CloneableModelMixin, CacheClearingModel, ModelWithDataBlob, TimeStampedModel): <NEW_LINE> <INDENT> submitter = models.ForeignKey(User, related_name='things', null=True, blank=True) <NEW_LINE> dataset = models.ForeignKey('DataSet', related_name='things', blank=True) <NEW_LINE> visible = models.Bool...
A SubmittedThing generally comes from the end-user. It may be a place, a comment, a vote, etc.
6259904794891a1f408ba0b3
class Escape(ColorMixin, BackGroundColorMixin, ModifiersMixin, object): <NEW_LINE> <INDENT> def __init__(self, *args): <NEW_LINE> <INDENT> self._original_string = ''.join( [arg.encode('utf-8') if (not PY3 and isinstance(arg, unicode)) else str(arg) for arg in args] ) <NEW_LINE> self._styled_string = self._original_stri...
Simple string like class to produce ansi-escaped strings
6259904729b78933be26aa80
class ConsumptionFilter(FilterBase): <NEW_LINE> <INDENT> def __init__( self, csv_path: str, category: str, indicator: str, frequency: TemporalFrequency): <NEW_LINE> <INDENT> super().__init__(csv_path=csv_path) <NEW_LINE> self.category = category <NEW_LINE> self.indicator = indicator <NEW_LINE> self.frequency = frequenc...
Consumption Filter.
6259904782261d6c52730883
class Discriminator(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_channels=1, n_filters=16): <NEW_LINE> <INDENT> super(Discriminator, self).__init__() <NEW_LINE> ndf = n_filters <NEW_LINE> self.network = nn.Sequential( nn.Conv2d(input_channels, ndf, 4, 2, 1, bias=False), nn.LeakyReLU(0.2, inplace=True), nn.C...
Discriminator module for the GAN.
62599047d99f1b3c44d06a1b
class DataUpdateCoordinatorMixin: <NEW_LINE> <INDENT> async def async_read_data(self, module_id: str, data_id: str) -> list[str, bool]: <NEW_LINE> <INDENT> client = self._plenticore.client <NEW_LINE> if client is None: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT> val = await client.get_...
Base implementation for read and write data.
6259904715baa7234946330c
class Assign(object): <NEW_LINE> <INDENT> def __init__(self, left_attribute, right_attribute=None, right=None, **kwargs): <NEW_LINE> <INDENT> if not right_attribute and not right: <NEW_LINE> <INDENT> raise ValueError('require argument: right_attribute or right') <NEW_LINE> <DEDENT> assert left_attribute is not None <NE...
Assigns a new value to an attribute. The source may be either a static value, or another attribute.
6259904721a7993f00c672e5
class SubmissionFlair: <NEW_LINE> <INDENT> def __init__(self, submission: "Submission"): <NEW_LINE> <INDENT> self.submission = submission <NEW_LINE> <DEDENT> def choices(self) -> List[Dict[str, Union[bool, list, str]]]: <NEW_LINE> <INDENT> url = API_PATH["flairselector"].format(subreddit=self.submission.subreddit) <NEW...
Provide a set of functions pertaining to Submission flair.
62599047d53ae8145f9197dc
class agilentMSOX4022A(agilent4000A): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__dict__.setdefault('_instrument_id', 'MSO-X 4022A') <NEW_LINE> super(agilentMSOX4022A, self).__init__(*args, **kwargs) <NEW_LINE> self._analog_channel_count = 2 <NEW_LINE> self._digital_channel_count...
Agilent InfiniiVision MSOX4022A IVI oscilloscope driver
62599047d4950a0f3b111800
class Queensland(DstTzInfo): <NEW_LINE> <INDENT> zone = 'Australia/Queensland' <NEW_LINE> _utc_transition_times = [ d(1,1,1,0,0,0), d(1916,12,31,14,1,0), d(1917,3,24,15,0,0), d(1941,12,31,16,0,0), d(1942,3,28,15,0,0), d(1942,9,26,16,0,0), d(1943,3,27,15,0,0), d(1943,10,2,16,0,0), d(1944,3,25,15,0,0), d(1971,10,30,16,0,...
Australia/Queensland timezone definition. See datetime.tzinfo for details
62599047b5575c28eb713687
class Config(dict): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Config, self).__init__() <NEW_LINE> <DEDENT> def __getattribute__(self, attr): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return super(Config, self).__getattribute__(attr) <NEW_LINE> <DEDENT> except AttributeError: <NEW_LINE> <INDEN...
Holds all configuration information about the Client
62599047a79ad1619776b3fd
class EventTestMixin(object): <NEW_LINE> <INDENT> def setUp(self, tracker): <NEW_LINE> <INDENT> super(EventTestMixin, self).setUp() <NEW_LINE> self.tracker = tracker <NEW_LINE> patcher = patch(self.tracker) <NEW_LINE> self.mock_tracker = patcher.start() <NEW_LINE> self.addCleanup(patcher.stop) <NEW_LINE> <DEDENT> def a...
Generic mixin for verifying that events were emitted during a test.
6259904730c21e258be99b83
class Users(API): <NEW_LINE> <INDENT> def create(self, email, password): <NEW_LINE> <INDENT> data = {'email': email, 'password': password} <NEW_LINE> return self.client.post('/v2/users', data) <NEW_LINE> <DEDENT> def authenticate(self, email, password): <NEW_LINE> <INDENT> data = {'email': email, 'password': password} ...
Users endpoints.
6259904729b78933be26aa81
class FullBeam(Obit.FullBeam): <NEW_LINE> <INDENT> def __init__(self, name="no_name", image=None, err=None) : <NEW_LINE> <INDENT> super(FullBeam, self).__init__() <NEW_LINE> Obit.CreateFullBeam(self.this, name, image, err) <NEW_LINE> self.myClass = myClass <NEW_LINE> <DEDENT> def __del__(self, DeleteFullBeam=_Obit.Dele...
Python Obit FullBeam class This class provides values of the beam shape derived from an image Gains at specified offsets from the beam center at giv3en parallactic angles are interpolated from a Full Beam image. FullBeam Members with python interfaces:
62599047004d5f362081f9a5
class GetMessages(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self, gameid, since): <NEW_LINE> <INDENT> user = auth() <NEW_LINE> if user == None: <NEW_LINE> <INDENT> self.response.out.write(json.dumps({'error': 'No autheticated user'})) <NEW_LINE> return <NEW_LINE> <DEDENT> logging.debug("here") <NEW_LINE> sin...
Messages are fetched by user using game id
6259904750485f2cf55dc305
class AddView(LoginRequiredMixin, generic.CreateView): <NEW_LINE> <INDENT> model = Issue <NEW_LINE> form_class = IssueCreateForm <NEW_LINE> login_url = 'lanve:signin' <NEW_LINE> success_url = reverse_lazy('lanve:list') <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> messages.success(self.request, 'Your issue...
Create new issues View
62599047462c4b4f79dbcd7c
class setGlobalConfiguration_result: <NEW_LINE> <INDENT> thrift_spec = ( (0, TType.BOOL, 'success', None, None, ), ) <NEW_LINE> def __init__(self, success=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__ == TBinaryProtocol.TBinaryProtoc...
Attributes: - success
62599047d53ae8145f9197dd
@WordSplitter.register('just_spaces') <NEW_LINE> class JustSpacesWordSplitter(WordSplitter): <NEW_LINE> <INDENT> @overrides <NEW_LINE> def split_words(self, sentence: str) -> List[Token]: <NEW_LINE> <INDENT> return [Token(t) for t in sentence.split()]
A ``WordSplitter`` that assumes you've already done your own tokenization somehow and have separated the tokens by spaces. We just split the input string on whitespace and return the resulting list. We use a somewhat odd name here to avoid coming too close to the more commonly used ``SpacyWordSplitter``. Note that w...
62599047d99f1b3c44d06a1d
class ComputeDistanceMap(SEMLikeCommandLine): <NEW_LINE> <INDENT> input_spec = ComputeDistanceMapInputSpec <NEW_LINE> output_spec = ComputeDistanceMapOutputSpec <NEW_LINE> _cmd = " ComputeDistanceMap " <NEW_LINE> _outputs_filenames = {'distanceMap':'distanceMap.nii'}
title: ComputeDistanceMap category: Chest Imaging Platform.Toolkit.Processing description: This program computes a distance map from an input binary map. A donwsampling can be applied prior to the distance map computation to improve performance. The resulting distance map will by upsampled by the same amount befor...
625990473c8af77a43b688fc
class SIPpFailure(RuntimeError): <NEW_LINE> <INDENT> pass
SIPp commands failed
62599047507cdc57c63a611c
class TextProcessor: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(TextProcessor, self).__init__() <NEW_LINE> self.TAG = "Text Processor" <NEW_LINE> print("Current class:", self.TAG)
TextProcessor creates text bundles in a video from text sources.
6259904776d4e153a661dc35
class POWER_SEQUENCER_OT_split_strips_under_cursor(bpy.types.Operator): <NEW_LINE> <INDENT> doc = { "name": doc_name(__qualname__), "demo": "https://i.imgur.com/ZyEd0jD.gif", "description": doc_description(__doc__), "shortcuts": [({"type": "K", "value": "PRESS"}, {}, "Cut All Strips Under Cursor")], "keymap": "Sequence...
Splits all strips under cursor including muted strips, but excluding locked strips. Auto selects sequences under the time cursor when you don't have a selection
62599047b57a9660fecd2dfb
class Slide(Orderable): <NEW_LINE> <INDENT> homepage = models.ForeignKey(HomePage, related_name="slides") <NEW_LINE> image = FileField(verbose_name=_("Image"), upload_to=upload_to("theme.Slide.image", "slider"), format="Image", max_length=255, null=True, blank=True) <NEW_LINE> title = models.CharField(max_length=50, de...
A slide in a slider connected to a HomePage
62599047b830903b9686ee3a
class MAVLink_state_correction_message(MAVLink_message): <NEW_LINE> <INDENT> id = MAVLINK_MSG_ID_STATE_CORRECTION <NEW_LINE> name = 'STATE_CORRECTION' <NEW_LINE> fieldnames = ['xErr', 'yErr', 'zErr', 'rollErr', 'pitchErr', 'yawErr', 'vxErr', 'vyErr', 'vzErr'] <NEW_LINE> ordered_fieldnames = [ 'xErr', 'yErr', 'zErr', 'r...
Corrects the systems state by adding an error correction term to the position and velocity, and by rotating the attitude by a correction angle.
62599047097d151d1a2c23eb
class WorkspaceViewerServerPlanar( TrajectoryOptimizationViewer, WorkspaceViewerServer): <NEW_LINE> <INDENT> def __init__(self, workspace, trajectory, use_gl=True, scale=700.): <NEW_LINE> <INDENT> WorkspaceViewerServer.__init__(self, workspace, trajectory) <NEW_LINE> TrajectoryOptimizationViewer.__init__( self, None, d...
Workspace display based on pyglet backend
62599047d53ae8145f9197df
class _DictAccessor (object): <NEW_LINE> <INDENT> def __init__ (self,namespace): <NEW_LINE> <INDENT> object.__setattr__(self,'namespace',namespace); <NEW_LINE> <DEDENT> def __call__ (self,name,default=""): <NEW_LINE> <INDENT> if isinstance(default,str): <NEW_LINE> <INDENT> default = interpolate(default,inspect.currentf...
Helper class that maps dicts to attributes
62599047e64d504609df9d90
class VSEQFQuickTagsClear(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = 'vseqf.quicktags_clear' <NEW_LINE> bl_label = 'VSEQF Quick Tags Clear' <NEW_LINE> bl_description = 'Clear all tags on all selected sequences' <NEW_LINE> mode: bpy.props.StringProperty('selected') <NEW_LINE> def execute(self, context): <NEW_L...
Clears all tags on the selected and active sequences
6259904710dbd63aa1c71f5a
class QLearningAgent(ReinforcementAgent): <NEW_LINE> <INDENT> def __init__(self, **args): <NEW_LINE> <INDENT> ReinforcementAgent.__init__(self, **args) <NEW_LINE> self.qValuelist = {} <NEW_LINE> "*** YOUR CODE HERE ***" <NEW_LINE> <DEDENT> def getQValue(self, state, action): <NEW_LINE> <INDENT> if(state, action) not in...
Q-Learning Agent Functions you should fill in: - computeValueFromQValues - computeActionFromQValues - getQValue - getAction - update Instance variables you have access to - self.epsilon (exploration prob) - self.alpha (learning rate) - self.discount (discount rate) Functions you should use - self.g...
62599047435de62698e9d185
class Plugin(DecoderPlugin): <NEW_LINE> <INDENT> def __init__(self, context): <NEW_LINE> <INDENT> super().__init__('URL', "Thomas Engel", ["urllib"], context) <NEW_LINE> <DEDENT> def run(self, text): <NEW_LINE> <INDENT> import urllib.parse <NEW_LINE> return urllib.parse.unquote(text) <NEW_LINE> <DEDENT> def can_decode_...
Decodes an URL. Example: Input: abcdefghijklmnopqrstuvwxyz \ %0A%5E%C2%B0%21%22%C2%A7%24%25%26/%28%29%3D%3F%C2%B4%60%3C%3E%7C%20%2C.-%3B%3A_%23%2B%27%2A%7E%0A \ 0123456789 Output: abcdefghijklmnopqrstuvwxyz ^°!"§$%&/()=?´`<>| ,.-;:_#+'*~ 0123456789
6259904726068e7796d4dcc7
class Order(Base): <NEW_LINE> <INDENT> __tablename__ = 'order' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> order_num = Column(Integer) <NEW_LINE> day = Column(String) <NEW_LINE> date = Column(String) <NEW_LINE> payment = Column(String) <NEW_LINE> restaurant = Column(String) <NEW_LINE> address = Column(...
Database model for Order data
6259904763b5f9789fe864ed
class Answer(): <NEW_LINE> <INDENT> def __init__(self, answer_string='', comment='', is_correct=False): <NEW_LINE> <INDENT> assert answer_string, 'Answer Object has to have a description/entry!' <NEW_LINE> self.answer_string = answer_string <NEW_LINE> self.comment = comment <NEW_LINE> self.is_correct = is_correct <NEW_...
Impl. of an Answer; check if setting of answer properties is valid; store, if answer has a comment (and handle printing); store, if answer is correct answer
625990473cc13d1c6d466ab7
class RevoluteJoint(Joint): <NEW_LINE> <INDENT> def set_velocity(self, amount): <NEW_LINE> <INDENT> self._set_angular_velocity(amount)
Es un tipo de unión que realiza movimientos de rotación con un grado de libertad.
625990478a349b6b436875cd
class income_and_ln_residential_units(Variable): <NEW_LINE> <INDENT> _return_type="float32" <NEW_LINE> parcel_residential_units = "residential_units" <NEW_LINE> hh_income = "income" <NEW_LINE> def dependencies(self): <NEW_LINE> <INDENT> return ["parcel_ln_residential_units = ln(psrc.parcel.residential_units)", attribut...
income * ln_residential_units
625990478a43f66fc4bf3516
class MongoDBCredentials(BaseCredentials): <NEW_LINE> <INDENT> def __init__(self, username=None, password=None, source=None, mechanism=None, ssl_obj=None): <NEW_LINE> <INDENT> self.auth_username = username <NEW_LINE> self.auth_password = password <NEW_LINE> self.auth_source = source <NEW_LINE> self.auth_mechanism = mec...
MongoDB Credentials Provider
625990471f5feb6acb163f77
class SwimFishModel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.fish = Fish((209, 95, 238), 60, 50, 200, 450) <NEW_LINE> self.monsters = [] <NEW_LINE> self.choices = ['images/octopus1_png.png', 'images/crab1.png', 'images/jellyfish.png', 'images/shark.png', 'images/stingray.png']
Encodes the game state
62599047d7e4931a7ef3d3f7
class WordFrequencyExtractor: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> <DEDENT> def fit(self, text): <NEW_LINE> <INDENT> text = ''.join( [c if c in string.ascii_letters or c.isspace() or c in string.digits else '' for c in text]) <NEW_LINE> words = find_word_count(te...
Extract word frequencies from a text. The class is initialized with number of most frequent words to use. After the feature extractor has been created it has to be fitted. To fit it give the text to fit to. The fitting text is used to identify the most common words. When features are then extracted from another text t...
62599047d10714528d69f04e
class Person: <NEW_LINE> <INDENT> def __init__(self, name, eyecolor, age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.eyecolor = eyecolor <NEW_LINE> self.age = age
This class eloborates about the Person
625990473617ad0b5ee074be
class SharedEbs(Ebs): <NEW_LINE> <INDENT> def __init__( self, mount_dir: str, name: str, kms_key_id: str = None, snapshot_id: str = None, volume_id: str = None, raid: Raid = None, deletion_policy: str = None, **kwargs, ): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.kms_key_id = Resource.init_param(km...
Represent a shared EBS, inherits from both _SharedStorage and Ebs classes.
6259904721a7993f00c672eb
class SenMLDocument(object): <NEW_LINE> <INDENT> measurement_factory = SenMLMeasurement <NEW_LINE> def __init__(self, measurements=None, *args, base=None, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.measurements = measurements <NEW_LINE> self.base = base <NEW_LINE> <DEDENT> @classme...
A collection of SenMLMeasurement data points
62599047cad5886f8bdc5a3f
class OkonomibelopValidator(BaseValidator): <NEW_LINE> <INDENT> def validate_put_fields(self): <NEW_LINE> <INDENT> self.validate_is_positive_integer('belop', 'Beløp', requires_value=False) <NEW_LINE> return self
Validator klasse for Okonomibelop
62599047d53ae8145f9197e2
class SteadyState(Filter): <NEW_LINE> <INDENT> inputs = Types(('values', list, list, (int, float))) <NEW_LINE> outputs = Types(('values', list, list, (int, float))) <NEW_LINE> def __init__(self, k, threshold): <NEW_LINE> <INDENT> super(SteadyState, self).__init__() <NEW_LINE> self.threshold = threshold <NEW_LINE> self....
Determines for each invocation the iteration where steady-state performance is reached and suppose that we want to retain ``k`` measurements per invocation. I.e. once the coefficient of variation of the ``k`` iterations falls below ``threshold`` (typically 0.01 or 0.02). Inputs: - ``values``: 2d list of measurements ...
6259904750485f2cf55dc30a
class Column(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def get_value(self, n): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def set_value(self, n, item): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def add_value(self, item): <NEW_LINE> <INDENT> pass
Class representing a column
6259904723e79379d538d880
class Answer: <NEW_LINE> <INDENT> question = Question() <NEW_LINE> answers = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.question = Question() <NEW_LINE> <DEDENT> def parsejson(self,immutableDict): <NEW_LINE> <INDENT> self.answers = immutableDict.getlist(self.question.id)
This Object will be generated by connecting server based on the json sent in by frontend This Object will be sent to DNA DNA will return a Question Object & A list of data
6259904745492302aabfd854
class TestPageObject(unittest2.TestCase): <NEW_LINE> <INDENT> driver = None <NEW_LINE> def tearDown(self): <NEW_LINE> <INDENT> do_and_ignore(lambda: WTF_WEBDRIVER_MANAGER.close_driver()) <NEW_LINE> <DEDENT> def test_createPage_createsPageFromFactory(self): <NEW_LINE> <INDENT> config_reader = mock() <NEW_LINE> when(conf...
Unit test of the PageObject Class
6259904726068e7796d4dcc9
class GMMConv(torch.nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, dim, bias=True): <NEW_LINE> <INDENT> super(GMMConv, self).__init__() <NEW_LINE> self.in_channels = in_channels <NEW_LINE> self.out_channels = out_channels <NEW_LINE> self.dim = dim <NEW_LINE> self.mu = Parameter(in_channel...
The gaussian mixture model convolutional operator from the `"Geometric Deep Learning on Graphs and Manifolds using Mixture Model CNNs" <https://arxiv.org/abs/1611.08402>`_ paper .. math:: \mathbf{x}^{\prime}_i = \mathbf{\Theta} \cdot \sum_{j \in \mathcal{N}(i) \cup \{ i \}} w(\mathbf{e}_{i,j}) \odot \mathb...
6259904724f1403a9268628e