code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class MappingCollection(dict): <NEW_LINE> <INDENT> def __init__(self, item_name): <NEW_LINE> <INDENT> dict.__init__(self) <NEW_LINE> self.item_name = item_name <NEW_LINE> <DEDENT> def filter_by_name(self, names): <NEW_LINE> <INDENT> for name in set(self) - set(names): <NEW_LINE> <INDENT> self.remove(name) <NEW_LINE> <D...
Dictionary like object for managing collections of items. Item is expected to support the following interface, and should be hashable. class Item(object): def get_name(self): ... def restore_state(self, state_data): ... def disable(self): ... def __eq__(self, other): ...
62599098283ffb24f3cf5669
class TestArchitecture(unittest.TestCase): <NEW_LINE> <INDENT> def test_modify_arch(self): <NEW_LINE> <INDENT> for _ in xrange(10): <NEW_LINE> <INDENT> setArchitecture(random.choice((ARCH.X86_64, ARCH.X86)))
Testing the architectures.
62599098091ae35668706a02
class RunePage(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.current = kwargs['current'] <NEW_LINE> self.id = kwargs['id'] <NEW_LINE> self.name = kwargs['name'] <NEW_LINE> if 'slots' in kwargs: <NEW_LINE> <INDENT> slots = [] <NEW_LINE> for slot in kwargs['slots']: <NEW_LINE> <INDEN...
current boolean Indicates if the page is the current page. id long Rune page ID. name string Rune page name. slots List[RuneSlotDto] List of rune slots associated with the rune page.
625990985fdd1c0f98e5fd45
class Betaplane(): <NEW_LINE> <INDENT> def __init__(self,lat): <NEW_LINE> <INDENT> const = Constants() <NEW_LINE> self.f0 = 2.*const.omega*sin(lat*pi/180.) <NEW_LINE> self.beta = 2*const.omega*cos(lat*pi/180.)/const.radius_mean
A class that represents parameters of the beta plane centered at lat
62599098283ffb24f3cf566b
class DescribeTaskLastStatusRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TaskId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.TaskId = params.get("TaskId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for name, value in vars(sel...
DescribeTaskLastStatus请求参数结构体
62599098099cdd3c636762e2
@taskrooms_ns.expect(auth_parser) <NEW_LINE> @taskrooms_ns.route('') <NEW_LINE> class Rooms(Resource): <NEW_LINE> <INDENT> @jwt_required <NEW_LINE> @taskrooms_ns.expect(room_request) <NEW_LINE> def post(self): <NEW_LINE> <INDENT> email = get_jwt_identity() <NEW_LINE> payload = marshal(api.payload, room_request) <NEW_LI...
Create and Get Rooms
62599098283ffb24f3cf566d
class ItemAccessPermissions(BaseAccessPermissions): <NEW_LINE> <INDENT> base_permission = "agenda.can_see" <NEW_LINE> async def get_restricted_data( self, full_data: List[Dict[str, Any]], user_id: int ) -> List[Dict[str, Any]]: <NEW_LINE> <INDENT> def filtered_data(full_data, blocked_keys): <NEW_LINE> <INDENT> whitelis...
Access permissions container for Item and ItemViewSet.
62599098656771135c48af1a
class EndpointConsumer(bootsteps.ConsumerStep): <NEW_LINE> <INDENT> def get_consumers(self, channel): <NEW_LINE> <INDENT> return [Consumer(channel, queues=[Queue(Config.CELERY_DEFAULT_QUEUE)], on_message=self.on_message, tag_prefix='tentacle',)] <NEW_LINE> <DEDENT> def on_message(self, message): <NEW_LINE> <INDENT> if ...
Consumer that is used to provide endpoints to the Event Repository. http://celery.readthedocs.org/en/latest/userguide/extending.html
62599098099cdd3c636762e3
class NumberSet: <NEW_LINE> <INDENT> def __init__(self, x=-1, z=-1, a=-1): <NEW_LINE> <INDENT> pass
common base class for all number manipulations
62599098adb09d7d5dc0c32e
class USTimeZones(zc.sourcefactory.basic.BasicSourceFactory): <NEW_LINE> <INDENT> tzs = [tz for tz in pytz.common_timezones if 'US/' in tz and 'Pacific-New' not in tz] <NEW_LINE> def getValues(self): <NEW_LINE> <INDENT> return self.tzs <NEW_LINE> <DEDENT> def getTitle(self, value): <NEW_LINE> <INDENT> return value <NEW...
List of timezones taken from pytz
625990985fdd1c0f98e5fd49
class TestGetPseudonym(TestCase): <NEW_LINE> <INDENT> def test_pseudonym(self): <NEW_LINE> <INDENT> user_data = {'first_name': 'Eda', 'last_name': 'Tester', 'birth_date': datetime.date(2000, 5, 1)} <NEW_LINE> with responses.RequestsMock() as rsps: <NEW_LINE> <INDENT> rsps.add(responses.POST, 'https://tnia.eidentita.cz/...
Unittests for get_pseudonym function.
6259909850812a4eaa621ab1
class PosixLDIFMail(PosixLDIF): <NEW_LINE> <INDENT> def init_user(self, *args, **kwargs): <NEW_LINE> <INDENT> self.__super.init_user(*args, **kwargs) <NEW_LINE> timer = make_timer(self.logger, 'Starting PosixLDIFMail.init_user...') <NEW_LINE> self.mail_attrs = cereconf.LDAP_USER.get('mail_attrs', ['mail']) <NEW_LINE> f...
PosixLDIF mixin for mail attributes.
62599098be7bc26dc9252d40
class Template(_messages.Message): <NEW_LINE> <INDENT> @encoding.MapUnrecognizedFields('additionalProperties') <NEW_LINE> class ActionsValue(_messages.Message): <NEW_LINE> <INDENT> class AdditionalProperty(_messages.Message): <NEW_LINE> <INDENT> key = _messages.StringField(1) <NEW_LINE> value = _messages.MessageField('...
A Template represents a complete configuration for a Deployment. Messages: ActionsValue: Action definitions for use in Module intents in this Template. ModulesValue: A list of modules for this Template. Fields: actions: Action definitions for use in Module intents in this Template. description: A user-sup...
62599098c4546d3d9def8186
class _Sentinel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._sentinels = {} <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return self._sentinels.setdefault(name, _SentinelObject(name))
Access attributes to return a named object, usable as a sentinel.
625990985fdd1c0f98e5fd4b
import naarad.utils <NEW_LINE> logger = logging.getLogger('naarad.metrics.ProcVmstatMetric') <NEW_LINE> class ProcVmstatMetric(Metric): <NEW_LINE> <INDENT> def __init__ (self, metric_type, infile_list, hostname, output_directory, resource_path, label, ts_start, ts_end, rule_strings, important_sub_metrics, **other_optio...
logs of /proc/vmstat The raw log file is assumed to have a timestamp prefix of all lines. E.g. in the format of "2013-01-02 03:55:22.13456 compact_fail 36" The log lines can be generated by 'cat /proc/vmstat | sed "s/^/$(date +%Y-%m-%d\ %H:%M:%S.%05N) /" '
62599098656771135c48af1c
class FavoriteManager(models.Manager): <NEW_LINE> <INDENT> def favorites_for_user(self, user): <NEW_LINE> <INDENT> return self.get_query_set().filter(user=user) <NEW_LINE> <DEDENT> def favorites_for_model(self, model, user=None): <NEW_LINE> <INDENT> content_type = ContentType.objects.get_for_model(model) <NEW_LINE> qs ...
A Manager for Favorites
625990988a349b6b43688039
class TestSecure3D21AuthenticationUpdateRequestAllOf(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 testSecure3D21AuthenticationUpdateRequestAllOf(self): <NEW_LINE> <INDENT> pass
Secure3D21AuthenticationUpdateRequestAllOf unit test stubs
62599098be7bc26dc9252d41
class Color(object): <NEW_LINE> <INDENT> RED = Fore.RED <NEW_LINE> WHITE = Fore.WHITE <NEW_LINE> CYAN = Fore.CYAN <NEW_LINE> GREEN = Fore.GREEN <NEW_LINE> MAGENTA = Fore.MAGENTA <NEW_LINE> BLUE = Fore.BLUE <NEW_LINE> YELLOW = Fore.YELLOW <NEW_LINE> BLACK = Fore.BLACK <NEW_LINE> BRIGHT_RED = Style.BRIGHT + Fore.RED <NEW...
Wrapper around colorama colors that are undefined in importing
62599098099cdd3c636762e6
@register_event('output') <NEW_LINE> @register <NEW_LINE> class OutputEvent(BaseSchema): <NEW_LINE> <INDENT> __props__ = { "seq": { "type": "integer", "description": "Sequence number (also known as message ID). For protocol messages of type 'request' this ID can be used to cancel the request." }, "type": { "type": "str...
The event indicates that the target has produced some output. Note: automatically generated code. Do not edit manually.
62599098d8ef3951e32c8d49
class DisconfAPIFactory(object): <NEW_LINE> <INDENT> def __init__(self, dapi, api): <NEW_LINE> <INDENT> self.__dapi = dapi <NEW_LINE> self.__api = api <NEW_LINE> <DEDENT> def __checkAuth__(self): <NEW_LINE> <INDENT> self.__dapi.__checkAuth__() <NEW_LINE> <DEDENT> def __getattr__(self, method): <NEW_LINE> <INDENT> def f...
Disconf API Factory
625990983617ad0b5ee07f2e
class registrovacunaView(View): <NEW_LINE> <INDENT> template_name = 'admin/registro-vacunas.html' <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> return render(request, self.template_name, {})
Vista de la pagina Home
625990988a349b6b4368803d
class RunTaskFailure(TaskError): <NEW_LINE> <INDENT> pass
Error from rpc_run_task in Odoo.
62599098d8ef3951e32c8d4a
class PriceRange(proto.Message): <NEW_LINE> <INDENT> min_ = proto.Field( proto.FLOAT, number=1, ) <NEW_LINE> max_ = proto.Field( proto.FLOAT, number=2, )
Product price range when there are a range of prices for different variations of the same product. Attributes: min_ (float): Required. The minimum product price. max_ (float): Required. The maximum product price.
62599099099cdd3c636762e8
class QuadTree: <NEW_LINE> <INDENT> def __init__(self, data, mins, maxs, depth=10): <NEW_LINE> <INDENT> self.data = np.asarray(data) <NEW_LINE> assert self.data.shape[1] == 2 <NEW_LINE> if mins is None: <NEW_LINE> <INDENT> mins = data.min(0) <NEW_LINE> <DEDENT> if maxs is None: <NEW_LINE> <INDENT> maxs = data.max(0) <N...
Simple Quad-tree class
62599099091ae35668706a10
class UpdateInterventionStatus(Resource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = IncidentModel() <NEW_LINE> <DEDENT> @require_token <NEW_LINE> def patch(current_user, self, incident_id): <NEW_LINE> <INDENT> if current_user['isadmin'] is False: <NEW_LINE> <INDENT> return only_admin_can_edi...
docstring for patching status of an intervention
625990995fdd1c0f98e5fd55
class TestV1ReplicaSpec(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 testV1ReplicaSpec(self): <NEW_LINE> <INDENT> pass
V1ReplicaSpec unit test stubs
6259909950812a4eaa621ab7
class CyberListenerSnort(CyberListener): <NEW_LINE> <INDENT> def runit(self): <NEW_LINE> <INDENT> i=1 <NEW_LINE> while (1): <NEW_LINE> <INDENT> line = linecache.getline(self.def_log_file,i) <NEW_LINE> if (len(line)>1): <NEW_LINE> <INDENT> line = line.split(',') <NEW_LINE> self.sendEvenToMaster( CyberEvent("Snort", line...
classdocs
625990993617ad0b5ee07f34
class TimeUnit(StrEnum): <NEW_LINE> <INDENT> NS = 'ns' <NEW_LINE> US = 'us' <NEW_LINE> MS = 'ms' <NEW_LINE> S = 's' <NEW_LINE> M = 'm' <NEW_LINE> H = 'h' <NEW_LINE> D = 'd' <NEW_LINE> @property <NEW_LINE> def multiplier(self) -> float: <NEW_LINE> <INDENT> mult = (1.0, 1.0E3, 1.0E6, 1.0E9, 6.0E10, 3.6E12, 8.64E13) <NEW_...
Time unit.
62599099adb09d7d5dc0c33c
class DataParser: <NEW_LINE> <INDENT> def __init__(self, acc_unit=100, gy_unit=100): <NEW_LINE> <INDENT> self.data_split = range(6) <NEW_LINE> self.acc_unit = acc_unit <NEW_LINE> self.gy_unit = gy_unit <NEW_LINE> <DEDENT> def parse_data(self, buffer, sensor): <NEW_LINE> <INDENT> for i in range(6): <NEW_LINE> <INDENT> s...
parses bytes from sensor and saves the values in a SensorStream; acc_unit and gy_unit are the quantization steps for accelerometer and gyroscope respectively
625990995fdd1c0f98e5fd59
class HelloViewSets(viewsets.ViewSet): <NEW_LINE> <INDENT> serializer_class = serializer.HelloSerializer <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> aViewset=[ 'Uses the Actions: List, Create, Retrive, Update, Partial_Update', 'Automatic mapping of urls by the Router', 'Provides more functionality with less...
To Explain viewsets
62599099283ffb24f3cf567f
class Faculty(PriorityQueue): <NEW_LINE> <INDENT> def find(self, image): <NEW_LINE> <INDENT> return "Found image in database: " + image
Locates images in database.
62599099dc8b845886d5539f
class SearchAutoCompleteAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> change_list_template = 'search_admin_autocomplete/change_list.html' <NEW_LINE> search_fields = [] <NEW_LINE> search_prefix = '__contains' <NEW_LINE> max_results = 10 <NEW_LINE> def get_urls(self) -> List[URLPattern]: <NEW_LINE> <INDENT> urls = super(S...
Basic admin class that allows to enable search autocomplete for certain model. Usage: .. code-block:: python class MyModelAdmin(SearchAutoCompleteAdmin) search_fields = ['search_field', ] admin.site.register(MyModel, MyModelAdmin)
62599099adb09d7d5dc0c342
class DataClass2(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.data = np.zeros((60,3,32,32)) <NEW_LINE> self.indexes = np.arange(self.data.shape[0]) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return self.data.shape[0] <NEW_LINE> <DEDENT> def __getitem__(self, indexes): <NEW_...
docstring for A
62599099d8ef3951e32c8d50
class ServiceException(PythonRuntimeException): <NEW_LINE> <INDENT> pass
Exception thrown in case of an error in Zserio Service
625990995fdd1c0f98e5fd5d
class Reviews(Base): <NEW_LINE> <INDENT> _review_locator = (By.CSS_SELECTOR, '#review-list li') <NEW_LINE> _success_notification_locator = (By.CSS_SELECTOR, 'section.notification-box.full > div.success') <NEW_LINE> def __init__(self, testsetup, app_name = False): <NEW_LINE> <INDENT> Base.__init__(self, testsetup) <NEW_...
Page with all reviews of an app. https://marketplace-dev.allizom.org/en-US/app/app-name/reviews/
625990993617ad0b5ee07f3c
class ClassifyEvaluator(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, labels_to_names): <NEW_LINE> <INDENT> self._labels_to_names = labels_to_names <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def add_single_detected_image_info(self, detections_dict): <NEW_LINE> <INDENT> pass <NEW...
Interface for object classify evalution classes. Example usage of the Evaluator: ------------------------------ evaluator = ClassifyEvaluator(categories) # Classifys and groundtruth for image 1. evaluator.add_single_detected_image_info(...) # Classifys and groundtruth for image 2. evaluator.add_single_detected_image...
62599099dc8b845886d553a1
class BJ_Game(object): <NEW_LINE> <INDENT> def __init__(self, names): <NEW_LINE> <INDENT> self.players = [] <NEW_LINE> for name in names: <NEW_LINE> <INDENT> player = BJ_Player(name) <NEW_LINE> self.players.append(player) <NEW_LINE> <DEDENT> self.dealer = BJ_Dealer("Rozdający") <NEW_LINE> self.deck = BJ_Deck() <NEW_LIN...
Gra w blackjacka.
625990995fdd1c0f98e5fd5f
class Output(object): <NEW_LINE> <INDENT> COLOR = rh.terminal.Color() <NEW_LINE> COMMIT = COLOR.color(COLOR.CYAN, 'COMMIT') <NEW_LINE> RUNNING = COLOR.color(COLOR.YELLOW, 'RUNNING') <NEW_LINE> PASSED = COLOR.color(COLOR.GREEN, 'PASSED') <NEW_LINE> FAILED = COLOR.color(COLOR.RED, 'FAILED') <NEW_LINE> def __init__(self, ...
Class for reporting hook status.
6259909950812a4eaa621abc
class Command(BaseCommand): <NEW_LINE> <INDENT> help = "for all source models, collect rss feed and create items" <NEW_LINE> def handle(self, *args, **options): <NEW_LINE> <INDENT> collect_all_rss_items()
collect rss
62599099c4546d3d9def8191
class TestReadsIntervalIteratorClassMethods(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.read = generateReadAlignment(5) <NEW_LINE> self.intervalIterator = backend.ReadsIntervalIterator <NEW_LINE> <DEDENT> def testGetReadStart(self): <NEW_LINE> <INDENT> result = self.intervalIterato...
Test the variants interval iterator class methods
62599099dc8b845886d553a5
class TestUserTemplatesWithImpressionsFromEmptyDatabase(UserTemplatesFixture): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__({'impressions_enabled': True}) <NEW_LINE> <DEDENT> def setup(self): <NEW_LINE> <INDENT> super().setup() <NEW_LINE> ut.generate_templates(self.session_context) <NEW_...
Class for testing barbante.maintenance.user_templates when impressions are enabled, starting from a database with no impressions at all.
62599099099cdd3c636762f1
class Visitor(object): <NEW_LINE> <INDENT> node_method_map = {} <NEW_LINE> visit_childs = True <NEW_LINE> visit_next = True <NEW_LINE> visit_index = 0 <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.node_method_map = {} <NEW_LINE> self.visit_childs = True <NEW_LINE> self.visit_next = True <NEW_LINE> self.visit_...
The visitor class.
62599099283ffb24f3cf568d
class LocationManipulator(object): <NEW_LINE> <INDENT> def __init__(self, v, ratio, brakeDuration, sleep): <NEW_LINE> <INDENT> self.v = v <NEW_LINE> self.ratio = ratio <NEW_LINE> self.sleep = sleep <NEW_LINE> self.brakeDuration = brakeDuration <NEW_LINE> self.centrePoint = 1515 <NEW_LINE> <DEDENT> def move(self, x, y):...
moves the quad and shit
6259909950812a4eaa621ac0
class TestLexer(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> pass
test: Lexer.get_next_token
62599099656771135c48af2a
class TestMyDatFileIO(TestWEFileIO): <NEW_LINE> <INDENT> def test_duplication(self): <NEW_LINE> <INDENT> self._test_duplication(MyDatFileIO, './test/dat/test_file.dat')
Test class for MyFileType class
625990995fdd1c0f98e5fd69
class CheckAgainType(object): <NEW_LINE> <INDENT> CAN_CHI = 1 <NEW_LINE> CAN_PENG = 2 <NEW_LINE> CAN_DIAN_PAO = 3 <NEW_LINE> CAN_DIAN_GANG = 4 <NEW_LINE> @classmethod <NEW_LINE> def to_dict(cls): <NEW_LINE> <INDENT> return { "can_chi": cls.CAN_CHI, "can_peng": cls.CAN_PENG, "can_dian_pao": cls.CAN_DIAN_PAO, "can_dian_g...
某次出牌后,检查其他玩家可进行的操作配置项
62599099656771135c48af2b
class SciUnit(SciUnitNS, DataObject, metaclass=SciUnitClass): <NEW_LINE> <INDENT> class_context = SU_CONTEXT <NEW_LINE> rdf_type_object_deferred = True
Base class for SciUnit `DataObject`s
62599099283ffb24f3cf5691
class Cosine(AngularPotential): <NEW_LINE> <INDENT> pmiproxydefs = dict( cls = 'espressopp.interaction.CosineLocal', pmiproperty = ['K', 'theta0'] )
The Cosine potential.
6259909950812a4eaa621ac2
class Preference(BaseModel): <NEW_LINE> <INDENT> title = models.CharField(max_length=1024,verbose_name="优惠标题") <NEW_LINE> link = models.CharField(max_length=128,verbose_name="优惠链接",null=True,blank=True) <NEW_LINE> descp = models.TextField(verbose_name="优惠描述",null=True,blank=True) <NEW_LINE> class Meta: <NEW_LINE> <INDE...
优惠信息
62599099d8ef3951e32c8d58
class AirlyAirQuality(AirQualityEntity): <NEW_LINE> <INDENT> def __init__(self, airly, name, unique_id): <NEW_LINE> <INDENT> self.airly = airly <NEW_LINE> self.data = airly.data <NEW_LINE> self._name = name <NEW_LINE> self._unique_id = unique_id <NEW_LINE> self._pm_2_5 = None <NEW_LINE> self._pm_10 = None <NEW_LINE> se...
Define an Airly air quality.
62599099c4546d3d9def8197
class VarCharField(SQLField): <NEW_LINE> <INDENT> def __init__(self, max_length, silent_truncate=False, **kwargs): <NEW_LINE> <INDENT> super().__init__(py_type=None, **kwargs) <NEW_LINE> self._max_length = max_length <NEW_LINE> self._silent_truncate = silent_truncate <NEW_LINE> <DEDENT> def convert(self, value): <NEW_L...
Represents a VARCHAR field in a database, which maps to str in Python. The field has a maximum length max_length and it is selectable on initialisation whether values longer than this will be silently truncated, or will trigger an exception.
62599099adb09d7d5dc0c354
class ConfigError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg: str, path: Optional[Iterable[str]] = None): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> self.path = path
Represents a problem parsing the configuration Args: msg: A textual description of the error. path: Where appropriate, an indication of where in the configuration the problem lies.
6259909950812a4eaa621ac4
class EventServerThread(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, address): <NEW_LINE> <INDENT> super(EventServerThread, self).__init__() <NEW_LINE> self.stop_flag = threading.Event() <NEW_LINE> self.address = address <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> listener = EventServer(self.add...
The thread in which the event listener server will run
625990995fdd1c0f98e5fd71
class AspectBaseTest: <NEW_LINE> <INDENT> def test_class(self): <NEW_LINE> <INDENT> assert not isinstance(aspectbase, aspectclass) <NEW_LINE> <DEDENT> def test_init_needs_aspectclass(self): <NEW_LINE> <INDENT> with pytest.raises(AttributeError): <NEW_LINE> <INDENT> aspectbase('py')
aspectbase is just a mixin base class for new aspectclasses and is therefore only usable works with a derived aspectclass and therefore doesn't use the aspectclass meta for itself
62599099099cdd3c636762f8
class GcLogger: <NEW_LINE> <INDENT> def __enter__(self) -> 'GcLogger': <NEW_LINE> <INDENT> self.gc_start_time = None <NEW_LINE> self.gc_time = 0.0 <NEW_LINE> self.gc_calls = 0 <NEW_LINE> self.gc_collected = 0 <NEW_LINE> self.gc_uncollectable = 0 <NEW_LINE> gc.callbacks.append(self.gc_callback) <NEW_LINE> self.start_tim...
Context manager to log GC stats and overall time.
6259909a5fdd1c0f98e5fd73
@db_test_lib.DualDBTest <NEW_LINE> class GetMBRFlowTest(flow_test_lib.FlowTestsBaseclass): <NEW_LINE> <INDENT> mbr = (b"123456789" * 1000)[:4096] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> super(GetMBRFlowTest, self).setUp() <NEW_LINE> self.client_id = self.SetupClient(0) <NEW_LINE> <DEDENT> def testGetMBR(self): ...
Test the transfer mechanism.
6259909a3617ad0b5ee07f52
class File(FileStr): <NEW_LINE> <INDENT> def __init__(self, fpath, comment_char="//"): <NEW_LINE> <INDENT> super(File, self).__init__(comment_char) <NEW_LINE> self._fpath = Path(fpath).resolve() <NEW_LINE> <DEDENT> @property <NEW_LINE> def fpath(self): <NEW_LINE> <INDENT> return self._fpath <NEW_LINE> <DEDENT> def pre_...
Top level file str
6259909a091ae35668706a32
class RecipeForm(Form): <NEW_LINE> <INDENT> title = StringField(u'Title', validators=[validators.Length(min=1, max=200)]) <NEW_LINE> category = SelectField(u'Category', coerce=str) <NEW_LINE> ingredients = StringField(u'Ingredients', validators=[validators.Length(min=1, max=200)]) <NEW_LINE> steps = TextAreaField(u'Ste...
Recipe form for adding and editing recipes
6259909ac4546d3d9def819c
class Box(BodyPart): <NEW_LINE> <INDENT> MASS = 1.0 <NEW_LINE> X = 1.0 <NEW_LINE> Y = 1.0 <NEW_LINE> Z = 1.0 <NEW_LINE> def __init__(self, id, conf, **kwargs): <NEW_LINE> <INDENT> self.x, self.y, self.z = self.X, self.Y, self.Z <NEW_LINE> self.mass = self.MASS <NEW_LINE> super(Box, self).__init__(id, conf, **kwargs) <N...
A base class that allows to you quickly define a body part that is just a simple box.
6259909a656771135c48af32
class BIOBERT_DISEASE_BC5CDR(ColumnCorpus): <NEW_LINE> <INDENT> def __init__(self, base_path: Union[str, Path] = None, in_memory: bool = True): <NEW_LINE> <INDENT> columns = {0: "text", 1: "ner"} <NEW_LINE> dataset_name = self.__class__.__name__.lower() <NEW_LINE> if base_path is None: <NEW_LINE> <INDENT> base_path = f...
BC5CDR corpus with disease annotations as used in the evaluation of BioBERT. For further details regarding BioBERT and it's evaluation, see Lee et al.: https://academic.oup.com/bioinformatics/article/36/4/1234/5566506 https://github.com/dmis-lab/biobert
6259909adc8b845886d553bb
class Function(object): <NEW_LINE> <INDENT> def __init__(self, function, msg=None, message=None): <NEW_LINE> <INDENT> self.function = function <NEW_LINE> if msg is not None and message is not None: <NEW_LINE> <INDENT> raise ValueError('Only one of msg and message can be passed') <NEW_LINE> <DEDENT> if msg is None and m...
Validator which accepts a function and an optional message; the function is called with the ``value`` during validation. If the function returns anything falsy (``None``, ``False``, the empty string, ``0``, an object with a ``__nonzero__`` that returns ``False``, etc) when called during validation, an :exc:`colander.I...
6259909a3617ad0b5ee07f58
class TextLine(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'text_lines' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> line = db.Column(db.String(250)) <NEW_LINE> line_no = db.Column(db.Integer) <NEW_LINE> text_to_compare_id = db.Column(db.Integer, db.ForeignKey('texts.id')) <NEW_LINE> text_to_co...
Lines that are compared. These belong to a text to compare.
6259909adc8b845886d553bd
class ArmHandler(tornado.web.RequestHandler): <NEW_LINE> <INDENT> def __init__(self, application, *args, **kwargs): <NEW_LINE> <INDENT> self.client = application.client <NEW_LINE> super(ArmHandler, self).__init__(application, *args, **kwargs) <NEW_LINE> <DEDENT> def post(self, *args, **kwargs): <NEW_LINE> <INDENT> self...
Arm handler
6259909a091ae35668706a38
class FastWeightsStateTuple(_FastWeightsStateTuple): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @property <NEW_LINE> def dtype(self): <NEW_LINE> <INDENT> (c, a) = self <NEW_LINE> if c.dtype != a.dtype: <NEW_LINE> <INDENT> raise TypeError("Inconsistent internal state: {} vs {}".format( (str(c.dtype), str(a.dtype)))) ...
Tuple used by FastWeights Cells for `state_size`, `zero_state`, and output state. Stores two elements: `(c, A)`, in that order. Where `c` is the hidden state and `A` is the fast weights state.
6259909a656771135c48af34
class MediaBaseResource(MediaResource): <NEW_LINE> <INDENT> title = CharField(_('title'), required=True) <NEW_LINE> description = CharField(_('description_old')) <NEW_LINE> descriptions = TextField(_('description')) <NEW_LINE> code = CharField(_('code'), unique=True, ...
Describe a media base resource
6259909aadb09d7d5dc0c364
class Tooth_30_pt(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "object.tooth_30_pt" <NEW_LINE> bl_label = "Tooth 30" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> found = 'Tooth 30' in bpy.data.objects <NEW_LINE> if found == False: <N...
Tooltip
6259909adc8b845886d553c1
class LdapBooleanAttribute(LdapAttribute): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def parse(value): <NEW_LINE> <INDENT> return value.lower() == b'true'
A boolean LDAP attribute
6259909a283ffb24f3cf56a5
class StandardPermutations_n_abstract(Permutations): <NEW_LINE> <INDENT> def __init__(self, n, category=None): <NEW_LINE> <INDENT> self.n = n <NEW_LINE> if category is None: <NEW_LINE> <INDENT> category = FiniteEnumeratedSets() <NEW_LINE> <DEDENT> Permutations.__init__(self, category=category) <NEW_LINE> <DEDENT> def _...
Abstract base class for subsets of permutations of the set `\{1, 2, \ldots, n\}`. .. WARNING:: Anything inheriting from this class should override the ``__contains__`` method.
6259909a656771135c48af36
class EntityMeta(type): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def __prepare__(cls, name, bases): <NEW_LINE> <INDENT> return collections.OrderedDict() <NEW_LINE> <DEDENT> def __init__(cls, name, bases, attr_dict): <NEW_LINE> <INDENT> super().__init__(name, bases, attr_dict) <NEW_LINE> cls._field_names = [] <NEW_LI...
Metaclass for business entities with validated fields
6259909a283ffb24f3cf56a9
class GameScreen(Screen): <NEW_LINE> <INDENT> switch_screen = ObjectProperty() <NEW_LINE> disabled = BooleanProperty(False) <NEW_LINE> @property <NEW_LINE> def app(self): <NEW_LINE> <INDENT> return App.get_running_app() <NEW_LINE> <DEDENT> @property <NEW_LINE> def engine(self): <NEW_LINE> <INDENT> return App.get_runnin...
A version of :class:`kivy.uix.screenmanager.Screen` that is easier to set up and use with ELiDE Should be a child of the :class:`ELiDE.game.Screens` widget, which will never itself be displayed. ``GameScreen`` instances in it will be added to the screen manager, so that you can switch to them with the ``switch_screen`...
6259909a099cdd3c63676301
class GetTicketInputSet(InputSet): <NEW_LINE> <INDENT> def set_Email(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'Email', value) <NEW_LINE> <DEDENT> def set_ID(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'ID', value) <NEW_LINE> <DEDENT> def set_Password(self, value): <NEW_LINE> <INDENT> ...
An InputSet with methods appropriate for specifying the inputs to the GetTicket Choreo. The InputSet object is used to specify input parameters when executing this Choreo.
6259909a656771135c48af39
class ServiceProxy (object): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> if not (url.startswith('http://') or url.startswith('https://')): <NEW_LINE> <INDENT> url = 'http://' + url <NEW_LINE> <DEDENT> self.url = url <NEW_LINE> <DEDENT> def _compose(self, endpoint): <NEW_LINE> <INDENT> return '/'.jo...
Helper class for interacting with an external service.
6259909aadb09d7d5dc0c36c
class RendererOfNumericalExperiment(RendererBase): <NEW_LINE> <INDENT> @property <NEW_LINE> def view_type(self): <NEW_LINE> <INDENT> return 'numericalExperiment' <NEW_LINE> <DEDENT> def render(self): <NEW_LINE> <INDENT> return u'TODO - render {0}'.format(self.view_type)
Manages rendering of a view over a cim numerical experiment.
6259909aadb09d7d5dc0c36e
class KeventDescriptorSet: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._descriptors = set() <NEW_LINE> self._descriptor_for_path = dict() <NEW_LINE> self._descriptor_for_fd = dict() <NEW_LINE> self._kevents = list() <NEW_LINE> self._lock = threading.Lock() <NEW_LINE> <DEDENT> @property <NEW_LINE> d...
Thread-safe kevent descriptor collection.
6259909a099cdd3c63676304
class Task(BaseModel): <NEW_LINE> <INDENT> OPEN = 'O' <NEW_LINE> IN_PROGRESS = 'I' <NEW_LINE> COMPLETE = 'C' <NEW_LINE> STATUS_CHOICES = ( (OPEN, 'Open'), (IN_PROGRESS, 'In Progress'), (COMPLETE, 'Complete') ) <NEW_LINE> status = models.CharField( max_length=2, choices = STATUS_CHOICES, default=OPEN ) <NEW_LINE> title ...
Model for a Task
6259909a5fdd1c0f98e5fd89
class EmrClusterException(Exception): <NEW_LINE> <INDENT> pass
Exception for unsuccessful step submission to EMR cluster.
6259909a099cdd3c63676305
class HtmlTidy(Linter): <NEW_LINE> <INDENT> syntax = ('html', 'html 5') <NEW_LINE> cmd = 'tidy -errors -quiet -utf8' <NEW_LINE> regex = r'^line (?P<line>\d+) column (?P<col>\d+) - (?:(?P<error>Error)|(?P<warning>Warning)): (?P<message>.+)' <NEW_LINE> line_col_base = (1, 1) <NEW_LINE> error_stream = util.STREAM_STDERR
Provides an interface to tidy.
6259909adc8b845886d553d0
class Exponential(gamma.Gamma): <NEW_LINE> <INDENT> def __init__(self, lam, validate_args=False, allow_nan_stats=True, name="Exponential"): <NEW_LINE> <INDENT> parameters = locals() <NEW_LINE> parameters.pop("self") <NEW_LINE> with ops.name_scope(name, values=[lam]) as ns: <NEW_LINE> <INDENT> self._lam = ops.convert_to...
The Exponential distribution with rate parameter lam. The PDF of this distribution is: ```prob(x) = (lam * e^(-lam * x)), x > 0``` Note that the Exponential distribution is a special case of the Gamma distribution, with Exponential(lam) = Gamma(1, lam).
6259909a099cdd3c63676307
class EventResultOrError: <NEW_LINE> <INDENT> def __init__(self, loop): <NEW_LINE> <INDENT> self._loop = loop <NEW_LINE> self._exc = None <NEW_LINE> self._event = asyncio.Event(loop=loop) <NEW_LINE> self._waiters = collections.deque() <NEW_LINE> <DEDENT> def set(self, exc=None): <NEW_LINE> <INDENT> self._exc = exc <NEW...
This class wrappers the Event asyncio lock allowing either awake the locked Tasks without any error or raising an exception. thanks to @vorpalsmith for the simple design.
6259909a3617ad0b5ee07f6f
class CTRL(IPACommon): <NEW_LINE> <INDENT> def ctrl_SET(self, data, op_id, v): <NEW_LINE> <INDENT> self.dbg('CTRL SET [%s] %s' % (op_id, v)) <NEW_LINE> <DEDENT> def ctrl_SET_REPLY(self, data, op_id, v): <NEW_LINE> <INDENT> self.dbg('CTRL SET REPLY [%s] %s' % (op_id, v)) <NEW_LINE> <DEDENT> def ctrl_GET(self, data, op_i...
Implementation of Osmocom control protocol for IPA multiplex
6259909a091ae35668706a4e
class LiveGraph(): <NEW_LINE> <INDENT> def __init__(self, fields, title='MAVProxy: LiveGraph', timespan=20.0, tickresolution=0.2, colors=[ 'red', 'green', 'blue', 'orange', 'olive', 'yellow', 'grey', 'black']): <NEW_LINE> <INDENT> import multiprocessing <NEW_LINE> self.fields = fields <NEW_LINE> self.colors = colors <N...
a live graph object using wx and matplotlib All of the GUI work is done in a child process to provide some insulation from the parent mavproxy instance and prevent instability in the GCS New data is sent to the LiveGraph instance via a pipe
6259909adc8b845886d553d4
class Unauthorized(HomeAssistantError): <NEW_LINE> <INDENT> def __init__( self, context: Optional["Context"] = None, user_id: Optional[str] = None, entity_id: Optional[str] = None, config_entry_id: Optional[str] = None, perm_category: Optional[str] = None, permission: Optional[Tuple[str]] = None, ) -> None: <NEW_LINE> ...
When an action is unauthorized.
6259909b656771135c48af42
class TestFunctionTestWebPageContent(InvenioTestCase): <NEW_LINE> <INDENT> def test_twpc_username_arg(self): <NEW_LINE> <INDENT> self.assertEqual([], test_web_page_content(CFG_SITE_URL, username="admin", expected_text="</html>")) <NEW_LINE> errmsgs = test_web_page_content(CFG_SITE_URL, username="admin", password="foo",...
Check browser test_web_page_content() function.
6259909bd8ef3951e32c8d6f
class BaseService(object, Root): <NEW_LINE> <INDENT> services = {} <NEW_LINE> name = None <NEW_LINE> description = None <NEW_LINE> cmdline = None <NEW_LINE> def __init__(self, *a, **kw): <NEW_LINE> <INDENT> super(BaseService, self).__init__() <NEW_LINE> self.factory = None <NEW_LINE> self.listener = None <NEW_LINE> for...
Base PB service. Inherit from this class and define name, description and cmdline. If 'start' is called, 'shutdown' should be called when done.
6259909b091ae35668706a5a
class TestGetInstance(testtools.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(TestGetInstance, self).setUp() <NEW_LINE> self.pvc_id = 123456789 <NEW_LINE> self.pvcdrv_init_copy = PowerVCDriver.__init__ <NEW_LINE> <DEDENT> def test_get_instance_found(self): <NEW_LINE> <INDENT> pvc_svc = mock....
This is the test fixture for PowerVCDriver.get_instance.
6259909b50812a4eaa621adb
class TrackError(Exception): <NEW_LINE> <INDENT> pass
General error class raised by Track
6259909bd8ef3951e32c8d71
class Forbidden(CloudServersException): <NEW_LINE> <INDENT> http_status = 403 <NEW_LINE> message = "Forbidden"
HTTP 403 - Forbidden: your credentials don't give you access to this resource.
6259909badb09d7d5dc0c386
class WKTAdapter: <NEW_LINE> <INDENT> def __init__(self, geom): <NEW_LINE> <INDENT> self.wkt = geom.wkt <NEW_LINE> self.srid = geom.srid <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return ( isinstance(other, WKTAdapter) and self.wkt == other.wkt and self.srid == other.srid ) <NEW_LINE> <DEDENT> def...
An adaptor for Geometries sent to the MySQL and Oracle database backends.
6259909bd8ef3951e32c8d72
class TestSamConverterRoundTrip(TestSamConverter): <NEW_LINE> <INDENT> def _testRoundTrip(self, binaryOutput): <NEW_LINE> <INDENT> with tempfile.NamedTemporaryFile() as fileHandle: <NEW_LINE> <INDENT> filePath = fileHandle.name <NEW_LINE> samConverter = converters.SamConverter( None, self.getReads(), filePath, binaryOu...
Write a sam file and see if pysam can read it
6259909b656771135c48af47
def __init__(self): <NEW_LINE> <INDENT> self.x = 0 <NEW_LINE> self.y = 0 <NEW_LINE> self.last_x = 0 <NEW_LINE> self.last_y = 0 <NEW_LINE> self.xDiff = 0 <NEW_LINE> self.yDiff = 0 <NEW_LINE> self.xDiff1 = 0 <NEW_LINE> self.yDiff1 = 0 <NEW_LINE> self.diffMag1 = 0 <NEW_LINE> self.diffMag2 = 0 <NEW_LINE> self.B2P_angle = 0...
Bullet()
6259909b3617ad0b5ee07f81
class DiscontinuousInterpolator(object): <NEW_LINE> <INDENT> def __init__(self,x,y,period,offset=0): <NEW_LINE> <INDENT> y=y-offset <NEW_LINE> di=np.where(y[1:]-y[:-1]<0) <NEW_LINE> for i in di[0]: <NEW_LINE> <INDENT> y[i:]=y[i:]+offset <NEW_LINE> <DEDENT> self.int=interp1d(x,y) <NEW_LINE> self.period=24 <NEW_LINE> sel...
Interpolates a function which increases monotonically but resets to zero upon reaching a defined value
6259909b091ae35668706a60
class LeaveComment(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/Facebook/Publishing/LeaveComment') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return LeaveCommentInputSet() <NEW_LINE> <DEDENT> def _m...
Create a new instance of the LeaveComment Choreography. A TembooSession object, containing a valid set of Temboo credentials, must be supplied.
6259909b099cdd3c63676311
class InferenceEngine: <NEW_LINE> <INDENT> def __init__(self, bnet, do_print=False, is_quantum=False): <NEW_LINE> <INDENT> self.bnet = bnet <NEW_LINE> self.do_print = do_print <NEW_LINE> self.is_quantum = is_quantum <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def print_annotated_story(annotated_story): <NEW_LINE> <IND...
This is the parent class of all inference engines. Attributes ---------- bnet : BayesNet do_print : bool is_quantum : bool
6259909bdc8b845886d553e7
class JSONClient(client.RESTClient): <NEW_LINE> <INDENT> _req_class = JSONRequest <NEW_LINE> _content_type = 'application/json' <NEW_LINE> def __init__(self, baseurl, headers=None, debug=False, client=None): <NEW_LINE> <INDENT> super(JSONClient, self).__init__(baseurl, headers, debug, client) <NEW_LINE> self._headers.s...
Process JSON data in requests and responses. Augments RESTClient to include the _attach_obj() helper method, for attaching JSON objects to requests. Also uses JSONRequest in preference to HTTPRequest, so that JSON data in responses is processed.
6259909bd8ef3951e32c8d75
class DictChunk(Chunk): <NEW_LINE> <INDENT> default = {} <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(DictChunk, self).__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.internal_value[key] <NEW_LINE> <DEDENT> def __getattr__(self, name...
A chunk whereby the internal value is stored as a python list
6259909bc4546d3d9def81b5
class APIRouterV21(base_wsgi.Router): <NEW_LINE> <INDENT> def __init__(self, custom_routes=None): <NEW_LINE> <INDENT> super(APIRouterV21, self).__init__(nova.api.openstack.ProjectMapper()) <NEW_LINE> if custom_routes is None: <NEW_LINE> <INDENT> custom_routes = tuple() <NEW_LINE> <DEDENT> for path, methods in ROUTE_LIS...
Routes requests on the OpenStack API to the appropriate controller and method. The URL mapping based on the plain list `ROUTE_LIST` is built at here.
6259909bdc8b845886d553eb
class ecs(object): <NEW_LINE> <INDENT> def __init__(self, RA, Dec): <NEW_LINE> <INDENT> self.RA = RA <NEW_LINE> self.Dec = Dec <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '%s(%g S) %s(%g s)' % (self.RA, self.RA.SSuncertainty ,self.Dec,self.Dec.SSuncertainty) <NEW_LINE> <DEDENT> def ecs2gcs(self): ...
Equatorial coordinate system
6259909badb09d7d5dc0c390
class GroupViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Group.objects.all() <NEW_LINE> serializer_class = GroupSerializer
retrieve: Return o group instance list: Return all group,odered by most recent joined create: Create a new group delete: Remove a existing group partial_update: Update one or more fields on a existing group update: Update a group
6259909bdc8b845886d553ed
class CatalogGenreView(ListView): <NEW_LINE> <INDENT> model = Genre <NEW_LINE> newdeals = Book.objects.all().order_by('-pk')[:6] <NEW_LINE> extra_context = {'newdeals':newdeals} <NEW_LINE> template_name = "catalog/catalog_list.html"
displays cards with Genres objects
6259909b099cdd3c63676315
class Interval(Reference): <NEW_LINE> <INDENT> def __init__(self, vertices=((0,), (1,))): <NEW_LINE> <INDENT> self.tdim = 1 <NEW_LINE> self.name = "interval" <NEW_LINE> self.origin = vertices[0] <NEW_LINE> self.axes = (vsub(vertices[1], vertices[0]),) <NEW_LINE> self.reference_vertices = ((0,), (1,)) <NEW_LINE> self.ve...
An interval.
6259909bdc8b845886d553f1