code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class Process: <NEW_LINE> <INDENT> def __init__(self, p_id, arrival_time, burst_time, priority=1): <NEW_LINE> <INDENT> self.p_id = p_id <NEW_LINE> self.arrival_time = arrival_time <NEW_LINE> self.burst_time = burst_time <NEW_LINE> self.priority = priority <NEW_LINE> self.waiting_time = 0 <NEW_LINE> self.return_time = 0...
Args: - p_id (int) : process ID - arrival_time (int) : process Arriva time in ready queue - burst_time (int) : Burst Time - priority (int) : priority of the process , default: 1 Defaults: - self.waiting_time = 0 - self.return_time = 0 - self.turnaround_time = 0 - self.response_time = 0...
62598f79287bf620b627150c
class Car(): <NEW_LINE> <INDENT> def __init__(self, make, model, year, odometer_reading=0): <NEW_LINE> <INDENT> self.make = make <NEW_LINE> self.model = model <NEW_LINE> self.year = year <NEW_LINE> self.odometer_reading = odometer_reading <NEW_LINE> <DEDENT> def get_descriptive_name(self): <NEW_LINE> <INDENT> long_name...
一次模拟汽车的简单尝试
62598f798c3a8732951f5ea3
class AnnotationTransformEvent(object): <NEW_LINE> <INDENT> def __init__(self, request, annotation, annotation_dict): <NEW_LINE> <INDENT> self.request = request <NEW_LINE> self.annotation = annotation <NEW_LINE> self.annotation_dict = annotation_dict
An event fired before an annotation is indexed or otherwise needs to be transformed by third-party code. This event can be used by subscribers who wish to modify the content of an annotation just before it is indexed or in other use-cases.
62598f7926238365f5fac4c5
class PythonWriter(object): <NEW_LINE> <INDENT> def __init__(self, keep_markdown=None): <NEW_LINE> <INDENT> self._output = StringIO() <NEW_LINE> self._markdown_filter = MarkdownFilter(keep_markdown) <NEW_LINE> <DEDENT> def _new_paragraph(self): <NEW_LINE> <INDENT> self._output.write('\n\n') <NEW_LINE> <DEDENT> def appe...
Python writer.
62598f79596a8972361275c9
class ReviewForm(forms.Form): <NEW_LINE> <INDENT> is_favourite = forms.BooleanField( label="Favourite?", help_text="In your top 20 books of all time?", required=False, ) <NEW_LINE> review = forms.CharField( widget=forms.Textarea, min_length=350, error_messages={ 'required': "Please, enter your review", 'min_length': "P...
Book review form.
62598f7930dc7b766599f1af
class GraphQLList(GraphQLType): <NEW_LINE> <INDENT> def __init__(self, type): <NEW_LINE> <INDENT> self.of_type = type <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '[' + str(self.of_type) + ']'
List Modifier A list is a kind of type marker, a wrapping type which points to another type. Lists are often created within the context of defining the fields of an object type. Example: class PersonType(GraphQLObjectType): name = 'Person' def get_fields(self): return { ...
62598f7923e79379d538be50
class MonochromeTerminal(MockTerminal): <NEW_LINE> <INDENT> @property <NEW_LINE> def number_of_colors(self): <NEW_LINE> <INDENT> return 0
Work around color reporting never going back to 0 once it's been 256.
62598f790383005118f6d056
class TestPreprocessString(unittest.TestCase): <NEW_LINE> <INDENT> preprocess_string_data_provider = lambda: ( ("abc", "abc"), ("".join(punctuation), ""), ("a.b,c", "abc"), ("abc😀abc", "abcabc"), ) <NEW_LINE> @data_provider(preprocess_string_data_provider) <NEW_LINE> def test_preprocess_string(self, input_data: str, e...
Tests lib.src.align.utils.preprocess_string
62598f79a05bb46b3848a1d2
class TokChunks(Chunks): <NEW_LINE> <INDENT> def __init__(self, string, ignore_chars=None, space_as_punct=False): <NEW_LINE> <INDENT> super().__init__(string, ignore_chars=ignore_chars) <NEW_LINE> self.chunks = None <NEW_LINE> self.space_as_punct = space_as_punct <NEW_LINE> <DEDENT> def serve_syls_to_trie(self): <NEW_L...
This class uses the chunks produced by ``Chunks`` to identify Tibetan syllables and clean them. Thus produces pre-processed Tibetan text that can be further processed. Every chunk produced by ``Chunks`` is wrapped into a tuple containing: - either None or a list containing the cleaned syllable (the i...
62598f798da39b475be02b39
class MoonProgressStatus(BaseProgressStatus): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.idx = 0 <NEW_LINE> self.msg_chars = MSG_CHARS_MOON <NEW_LINE> self.msg_ready = MSG_READY_MOON <NEW_LINE> <DEDENT> def show_next_message(self): <NEW_LINE> <INDENT> if not self.show...
Progress status that shows phases of the moon.
62598f7915baa723494618d5
class Book(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.title = "Title" <NEW_LINE> self.author = "Author" <NEW_LINE> self.year = 0
Структура книги БЕЗ: Кода - ее порядковый номер Номера стелажа - рандомное число
62598f79b57a9660fecd13d4
class Goods(models.Model): <NEW_LINE> <INDENT> category = models.ForeignKey(GoodsCategory, null=True, blank=True, verbose_name='商品类别', on_delete=models.SET_NULL) <NEW_LINE> goods_sn = models.CharField(max_length=50, unique=True, verbose_name=u'商品唯一货号') <NEW_LINE> name = models.CharField(max_length=300, verbose_name='商品...
商品
62598f79507cdc57c63a46e1
class TaskDescriptor: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.category = "" <NEW_LINE> self.name = "" <NEW_LINE> self.due = "" <NEW_LINE> self.prettyDue = "" <NEW_LINE> self.priority = ""
Class to describe a single task
62598f7926068e7796d4c2b1
class ComboField(Field): <NEW_LINE> <INDENT> def __init__(self, fields=(), *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> for f in fields: <NEW_LINE> <INDENT> f.required = False <NEW_LINE> <DEDENT> self.fields = fields <NEW_LINE> <DEDENT> def clean(self, value): <NEW_LINE> <INDENT> s...
A Field whose clean() method calls multiple Field clean() methods.
62598f791f037a2d8b9e3a41
class _Meta(_StaticElement): <NEW_LINE> <INDENT> def __init__(self, label="", privLevels=[], applicables=[], compiler=None): <NEW_LINE> <INDENT> _compiler = compiler or self._COMPILER <NEW_LINE> _StaticElement.__init__(self, label, privLevels, applicables, _compiler)
A meta element of protocol (such as Recv or Send)
62598f798c3a8732951f5ea4
class LeaveViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Leave.objects.all() <NEW_LINE> serializer_class = LeaveSerializer
LeaveViewSet.
62598f7aec188e330fdf81f5
class RunOnce(RoboProcess): <NEW_LINE> <INDENT> def on_exit(self, returncode): <NEW_LINE> <INDENT> self.process = None
Process that runs
62598f7a7b25080760ed6df7
class CompDCVar(_CompNodeVar): <NEW_LINE> <INDENT> def __init__(self, solver: Solver, component_id: str, chain_id: str, node: str, app_name: str, component_name: str): <NEW_LINE> <INDENT> super().__init__(component_id=component_id, chain_id=chain_id, node=node, var=solver.BoolVar(f"{COMPIN_DC_VAR},{component_id},{chain...
Represents Compin-DC variable, de facto wrapper for IntVar. When this variable is set to 1, it means that compin with specified component type ID and chain ID is supposed to run in a specified data center.
62598f7a9b70327d1c57e6fc
class Point2D(object): <NEW_LINE> <INDENT> def __init__(self,x,y): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> print (str(self.x)+', '+str(self.y)) <NEW_LINE> <DEDENT> def plot(self, col): <NEW_LINE> <INDENT> plt.plot(self.x,self.y,'o', color=str(col)...
A two dimensional point. Parameters ---------- x : float the x coordinate y : float the y coordinate
62598f7a8c3a8732951f5ea5
class ExpressRouteServiceProvidersOperations(object): <NEW_LINE> <INDENT> models = _models <NEW_LINE> def __init__(self, client, config, serializer, deserializer): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._serialize = serializer <NEW_LINE> self._deserialize = deserializer <NEW_LINE> self._config = conf...
ExpressRouteServiceProvidersOperations operations. You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. :type models: ~azure.mgmt.network.v2019_12_01...
62598f7a66656f66f7d59d49
class PerformTenantScopeTests(SynchronousTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.log = object() <NEW_LINE> self.authenticator = object() <NEW_LINE> self.service_configs = { ServiceType.CLOUD_SERVERS: { 'name': 'cloudServersOpenStack', 'region': 'DFW'} } <NEW_LINE> def concretize(au, lo,...
Tests for :func:`perform_tenant_scope`.
62598f7a8a349b6b43685b99
class Major_Req: <NEW_LINE> <INDENT> valid_grades = ['A', 'A-', 'B+', 'B', 'B-', 'C+', 'C'] <NEW_LINE> __slots__ = ["major", "required", "elective"] <NEW_LINE> def __init__(self, major): <NEW_LINE> <INDENT> self.major = major <NEW_LINE> self.required = set () <NEW_LINE> self.elective = set () <NEW_LINE> <DEDENT> def ad...
This class allows an instance of major to be created
62598f7a30c21e258be9815e
class HDADeserializer( datasets.DatasetAssociationDeserializer, taggable.TaggableDeserializerMixin, annotatable.AnnotatableDeserializerMixin ): <NEW_LINE> <INDENT> model_manager_class = HDAManager <NEW_LINE> def __init__( self, app ): <NEW_LINE> <INDENT> super( HDADeserializer, self ).__init__( app ) <NEW_LINE> self.hd...
Interface/service object for validating and deserializing dictionaries into histories.
62598f7a004d5f362081eca6
class Bewertung(models.Model): <NEW_LINE> <INDENT> teilnehmer = models.ForeignKey('Teilnehmer') <NEW_LINE> posten = models.ForeignKey('Posten') <NEW_LINE> bewertungsart = models.ForeignKey('Bewertungsart') <NEW_LINE> note = models.DecimalField(max_digits=6, decimal_places=1, default=0) <NEW_LINE> zeit = models.DecimalF...
Wert ist entweder Anzahl Punkte oder Zeit in Hundertstel Sekunden.
62598f7a8a43f66fc4bf1ad5
class RequestUriTooLong(HTTPClientError): <NEW_LINE> <INDENT> http_status = http_client.REQUEST_URI_TOO_LONG <NEW_LINE> message = _("Request-URI Too Long")
HTTP 414 - Request-URI Too Long. The URI provided was too long for the server to process.
62598f7ab830903b9686e11e
class InsertQuery(_BaseSQLQuery): <NEW_LINE> <INDENT> def __init__(self, model, query=None, query_kwargs=None, raw_values=None, values=None): <NEW_LINE> <INDENT> if query is None: <NEW_LINE> <INDENT> query = 'INSERT INTO %s' % model.__table__ <NEW_LINE> <DEDENT> super(InsertQuery, self).__init__(model, query, query_kwa...
INSERT INTO query. Be care with raw_values. See each method doc string below.
62598f7a4d74a7450cd58b82
class Tipo_eleccion(models.Model): <NEW_LINE> <INDENT> categoria = models.ForeignKey(Categoria) <NEW_LINE> tipo = models.CharField(max_length=100, ) <NEW_LINE> niveles = models.IntegerField(null=True) <NEW_LINE> user_create = models.ForeignKey(User, null=True, blank=True, related_name='+') <NEW_LINE> user_update = mode...
Clase que define todo lo referente a las `Tipo_eleccion` en base a la categoria: Registrar, Modificar, Eliminar y Consultar :param ForeignKey user_create: campo que llama al modelo User. :param ForeignKey user_update: campo que llama al modelo User. :param IntegerField niveles: campo para seleccionar el nivel de la el...
62598f7a82261d6c5272fb7f
class RequestCache(Cache): <NEW_LINE> <INDENT> @property <NEW_LINE> def d(self): <NEW_LINE> <INDENT> return web.ctx.setdefault("request-local-cache", {}) <NEW_LINE> <DEDENT> def get(self, key): <NEW_LINE> <INDENT> return self.d.get(key) <NEW_LINE> <DEDENT> def set(self, key, value, expires=0): <NEW_LINE> <INDENT> self....
Request-Local cache. The values are cached only in the context of the current request.
62598f7ad164cc61758208cd
class InlineModelConverter(InlineModelConverterBase): <NEW_LINE> <INDENT> inline_field_list_type = InlineModelFormList <NEW_LINE> def get_info(self, p): <NEW_LINE> <INDENT> info = super(InlineModelConverter, self).get_info(p) <NEW_LINE> if info is None: <NEW_LINE> <INDENT> if isinstance(p, BaseModel): <NEW_LINE> <INDEN...
Inline model form helper.
62598f7af7d966606f74793f
class ProcessConfig(object): <NEW_LINE> <INDENT> def __init__(self, filep="config.ini"): <NEW_LINE> <INDENT> self.filep = filep <NEW_LINE> <DEDENT> def readConfig(self): <NEW_LINE> <INDENT> Config = ConfigParser.ConfigParser() <NEW_LINE> Config.read(self.filep) <NEW_LINE> sections = Config.sections() <NEW_LINE> for par...
Reads in optional configuration file that replaces command line options
62598f7ad10714528d69d826
class ExponentialModel(FitModel): <NEW_LINE> <INDENT> def __init__(self, amplitude=1, decay=1, background=None, **kws): <NEW_LINE> <INDENT> FitModel.__init__(self, background=background, **kws) <NEW_LINE> self.params.add('amplitude', value=amplitude) <NEW_LINE> self.params.add('decay', value=decay) <NEW_LINE> <DEDENT>...
Exponential Model: amplitude, decay, optional background
62598f7ac432627299fa2930
class TestHealthView(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUp(cls): <NEW_LINE> <INDENT> app = Flask(__name__) <NEW_LINE> healthcheck.HealthView.register(app) <NEW_LINE> app.config['TESTING'] = True <NEW_LINE> cls.app = app.test_client() <NEW_LINE> <DEDENT> @patch.object(healthcheck.fire...
A set of test cases for the HealthView object
62598f7a73bcbd0ca4bc9ba8
class ExpressionEngine(Atom): <NEW_LINE> <INDENT> _handlers = Typed(sortedmap, ()) <NEW_LINE> _guards = Typed(set, ()) <NEW_LINE> def __nonzero__(self): <NEW_LINE> <INDENT> return len(self._handlers) > 0 <NEW_LINE> <DEDENT> def add_pair(self, name, pair): <NEW_LINE> <INDENT> handler = self._handlers.get(name) <NEW_LINE...
A class which manages reading and writing bound expressions.
62598f7a21bff66bcd7225be
class TestSeminarApi(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.api = openapi_client.api.seminar_api.SeminarApi() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_seminar_delete(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def te...
SeminarApi unit test stubs
62598f7a07f4c71912baeda5
class Scoreboard: <NEW_LINE> <INDENT> def __init__(self, ai_settings, screen, stats): <NEW_LINE> <INDENT> self.screen = screen <NEW_LINE> self.screen_rect = screen.get_rect() <NEW_LINE> self.ai_settings = ai_settings <NEW_LINE> self.stats = stats <NEW_LINE> self.text_color = (30, 30, 30) <NEW_LINE> self.font = pygame.f...
Class to report scoring info
62598f7ad4950a0f3b110ae2
class IDDataset(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def __getitem__(self, index): <NEW_LINE> <INDENT> return self.data[index] <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self.data)
Irony Detection Dataset 用于封装整体数据,增加切片索引功能
62598f7ad53ae8145f917def
class AlchemistWarning(RuntimeWarning): <NEW_LINE> <INDENT> pass
Warnings of features that will be removed in a next version.
62598f7a0383005118f6d05a
class Customer(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=32, blank=True, null=True) <NEW_LINE> qq = models.CharField(max_length=64, unique=True) <NEW_LINE> qq_name = models.CharField(max_length=64, blank=True, null=True) <NEW_LINE> phone = models.CharField(max_length=64, blank=True, null=Tru...
客户信息表
62598f7a30c21e258be98160
class Scraper(): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.articles = [] <NEW_LINE> request = requests.get(self.url) <NEW_LINE> self.content = BeautifulSoup(request.text, "html.parser") <NEW_LINE> <DEDENT> def get_article_text(self, url): <NEW_LINE> <INDENT> text = ...
Generic scraper. Not itself ever instatiated.
62598f7a5e10d32532ce359a
class Output(Component): <NEW_LINE> <INDENT> def __init__(self, master, input_connect=None): <NEW_LINE> <INDENT> Component.__init__(self, master, input_connect) <NEW_LINE> <DEDENT> def process(self): <NEW_LINE> <INDENT> self.master.curr_output[:] = self.curr_input[:]
Output component. Writes the output of whatever is connected to its input_connect to the synth-level output. Only this class should reference the master output.
62598f7a4e696a045264daac
class BusTypes: <NEW_LINE> <INDENT> PCI = 0x01 <NEW_LINE> ISAPNP = 0x02 <NEW_LINE> USB = 0x03 <NEW_LINE> HIL = 0x04 <NEW_LINE> BLUETOOTH = 0x05 <NEW_LINE> VIRTUAL = 0x06
This class defines the bus types as defined in /usr/include/linux/input.h
62598f7a16aa5153ce3ffe58
class UploadFile(APIView): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> @async_call <NEW_LINE> def save_to_db(data): <NEW_LINE> <INDENT> with transaction.atomic(): <NEW_LINE> <INDENT> save_id = transaction.savepoint() <NEW_LINE> try: <NEW_LINE> <INDENT> con = create_engine(UPLOAD_DB_ENGINE) <NEW_LINE> data.to_sql('tb_c...
post: 上传csv/excel格式的数据
62598f7a8a43f66fc4bf1ad7
class RouteFilterRuleListResult(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[RouteFilterRule]'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, } <NEW_LINE> def __init__( self, **kwargs ): <NEW_LINE> <INDENT> super(RouteFilterRuleListResult, self).__init__(**...
Response for the ListRouteFilterRules API service call. :param value: A list of RouteFilterRules in a resource group. :type value: list[~azure.mgmt.network.v2020_08_01.models.RouteFilterRule] :param next_link: The URL to get the next set of results. :type next_link: str
62598f7a0383005118f6d05b
class Resample(DsBase): <NEW_LINE> <INDENT> def rsum(self, time_period: str, num_col: str = "Number", dateindex: str = None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> df = self._resample_("sum", time_period, num_col, dateindex) <NEW_LINE> if df is None: <NEW_LINE> <INDENT> self.err("Can not sum data") <NEW_LINE> <D...
A class to resample timeseries
62598f7ab57a9660fecd13d8
class Routing(object): <NEW_LINE> <INDENT> tree = RoutingTree() <NEW_LINE> @classmethod <NEW_LINE> def add(cls, routings): <NEW_LINE> <INDENT> for path, dest in routings: <NEW_LINE> <INDENT> names = cls.split(path) <NEW_LINE> for i, key in enumerate(names): <NEW_LINE> <INDENT> if 1 < len(names) and 0 < i and key == '':...
URL mapping class.
62598f7a7c178a314d78ce02
class ATCCoin(Bitcoin): <NEW_LINE> <INDENT> name = 'atccoin' <NEW_LINE> symbols = ('ATCC', ) <NEW_LINE> nodes = ("166.62.123.137", ) <NEW_LINE> port = 9333 <NEW_LINE> message_start = b'\xc3\xd2\xd1\xbd' <NEW_LINE> base58_prefixes = { 'PUBKEY_ADDR': 23, 'SCRIPT_ADDR': 5, 'SECRET_KEY': 151 }
Class with all the necessary ATC Coin network information based on https://github.com/atccoin2017/atccoin/blob/master/src/net.cpp (date of access: 02/13/2018)
62598f7a73bcbd0ca4bc9ba9
class CertificateDetail(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.CertificateId = None <NEW_LINE> self.CertificateType = None <NEW_LINE> self.CertificateAlias = None <NEW_LINE> self.CertificateContent = None <NEW_LINE> self.CertificateKey = None <NEW_LINE> self.CreateTime = None <...
证书详情,包括证书ID, 证书名字,证书类型,证书内容以及密钥内容。
62598f7ad99f1b3c44d05007
class PostUpdateView(LoginRequiredMixin, UserPassesTestMixin, UpdateView): <NEW_LINE> <INDENT> model = Post <NEW_LINE> fields = ["title", "link"] <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> form.instance.author = self.request.user <NEW_LINE> return super().form_valid(form) <NEW_LINE> <DEDENT> def test_fu...
Class-based generic view for post updating
62598f7a596a8972361275cd
class SiteMapView(BrowserView): <NEW_LINE> <INDENT> template = ViewPageTemplateFile('sitemap_templates/sitemap.xml') <NEW_LINE> def __init__(self, context, request): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.request = request <NEW_LINE> self.root = api.portal.get() <NEW_LINE> self.filename = 'sitemap.x...
Creates the sitemap as explained in the specifications. http://www.sitemaps.org/protocol.php
62598f7a4e696a045264daad
class Lemmatizer(nn.Module): <NEW_LINE> <INDENT> def __init__(self, embedding_dim, hidden_dim, vocab_size, mlp_size, n_layers=2, dropOut=0.2, gpu=False): <NEW_LINE> <INDENT> super(Lemmatizer, self).__init__() <NEW_LINE> self.embedding_dim = embedding_dim <NEW_LINE> self.mlp_size = mlp_size <NEW_LINE> self.vocab_size = ...
Lemmatizer module: Still under construction
62598f7ab57a9660fecd13d9
class GenericListStore(gtk.GenericTreeModel): <NEW_LINE> <INDENT> class RowRef(object): <NEW_LINE> <INDENT> def __init__(self, index, key): <NEW_LINE> <INDENT> self.__index = index <NEW_LINE> self.__key = key <NEW_LINE> <DEDENT> path = property(lambda self: (self.__index, )) <NEW_LINE> index = property(lambda self: sel...
Generic base class for implementing flat tree-models.
62598f7a0383005118f6d05d
class GGCQServiceTimeStopIteration(RuntimeError): <NEW_LINE> <INDENT> pass
Exception thrown if service time generator is exhausted Should not base StopIteration as simpy uses that exception to signify the end of the process!
62598f7a711fe17d825e0042
class RadiusAttr_Password_Retry(_RadiusAttrIntValue): <NEW_LINE> <INDENT> val = 75
RFC 2869
62598f7a50485f2cf55da8cb
class FieldZeroP(FieldOp): <NEW_LINE> <INDENT> def __init__(self, comment, in_wire, out_wire, m_wire): <NEW_LINE> <INDENT> FieldOp.__init__(self, comment) <NEW_LINE> self.in_wire = in_wire <NEW_LINE> self.out_wire = out_wire <NEW_LINE> self.m_wire = m_wire <NEW_LINE> <DEDENT> def field_command(self): <NEW_LINE> <INDENT...
Adds support for the zero-equals gate described in the paper
62598f7a30dc7b766599f1b6
class RazerOrochi2011(__RazerDeviceBrightnessSuspend): <NEW_LINE> <INDENT> USB_VID = 0x1532 <NEW_LINE> USB_PID = 0x0013 <NEW_LINE> EVENT_FILE_REGEX = re.compile(r'.*Razer_Orochi-if01-event-kbd') <NEW_LINE> METHODS = ['get_firmware', 'get_matrix_dims', 'has_matrix', 'get_device_name', 'get_device_type_mouse', 'set_logo_...
Class for the Razer Orochi 2011
62598f7a23849d37ff850a17
class WorksetQueuesHandler(SafeHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> t = self.application.loader.load("workset_queues.html") <NEW_LINE> self.write(t.generate(gs_globals=self.application.gs_globals, user=self.get_current_user()))
Serves a page with sequencing queues from LIMS listed URL: /workset_queues
62598f7abde94217f3707314
class HelpFrame(Frame): <NEW_LINE> <INDENT> def __init__(self, master=None): <NEW_LINE> <INDENT> Frame.__init__(self, master) <NEW_LINE> self.root = master <NEW_LINE> self.createPage() <NEW_LINE> <DEDENT> def createPage(self): <NEW_LINE> <INDENT> Label(self, text='帮助').grid(row=0,column=0)
帮助
62598f7aec188e330fdf81fb
class SelectQuery(ConditionsMixin, JoinMixin, BaseSqlQuery): <NEW_LINE> <INDENT> def __init__(self, builder: SqlBuilder): <NEW_LINE> <INDENT> super().__init__(builder) <NEW_LINE> self.fields = [] <NEW_LINE> <DEDENT> def set_fields(self, fields: list): <NEW_LINE> <INDENT> self.fields = fields <NEW_LINE> <DEDENT> def get...
SQL-Запрос на выборку данных из таблицы базы данных
62598f7ad10714528d69d829
class VimPosition(Position): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pos = vim_helper.buf.cursor <NEW_LINE> self._mode = vim_helper.eval("mode()") <NEW_LINE> Position.__init__(self, pos.line, pos.col) <NEW_LINE> <DEDENT> @property <NEW_LINE> def mode(self): <NEW_LINE> <INDENT> return self._mode
Represents the current position in the buffer, together with some status variables that might change our decisions down the line.
62598f7aa4f1c619b294df48
class CodiceArticoloType (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName( Namespace, 'CodiceArticoloType') <NE...
Complex type {http://ivaservizi.agenziaentrate.gov.it/docs/xsd/fatture/v1.2}CodiceArticoloType with content type ELEMENT_ONLY
62598f7a07f4c71912baeda9
class irConfig: <NEW_LINE> <INDENT> k1 = 1.5 <NEW_LINE> b = 0.75 <NEW_LINE> BLOCK_SIZE = 500000 <NEW_LINE> DB_PATH = "data/db_features.txt" <NEW_LINE> IDF_PATH = "data/idf.pkl" <NEW_LINE> REV_PATH = "data/rev.pkl" <NEW_LINE> stop_flag = ['t','x', 'c', 'u', 'p', 'm', 'f', 'r']
检索模型配置文件 k1:取值范围[1.2,2.0] b取0.75
62598f7a50485f2cf55da8cd
class TestHarnessLogger: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ef = self.new_pair() <NEW_LINE> self.uf = self.new_pair() <NEW_LINE> self.ep = self.new_pair() <NEW_LINE> self.up = self.new_pair() <NEW_LINE> self.descf = [("Expected Failures", self.ef) ,("Unexpected Failures", self.uf)] <NEW_LI...
Defines the logger for the test harness. * The first 4 fields are defined as follows: * prefix: e (expected), u (unexpected) * postfix: p (pass), f (failure) (A further sub-division into regressions (r) and tests (t)) * Verbose logging works as follows: Either 1) Verbose for all or ...
62598f7a711fe17d825e0044
class ReviewInline(admin.TabularInline): <NEW_LINE> <INDENT> model = Review <NEW_LINE> extra = 1 <NEW_LINE> readonly_fields = ("creator", "review_text", "rating")
Отзывы на странице фильма
62598f7a30c21e258be98165
class HttpRequestEntityTooLarge(HttpClientError): <NEW_LINE> <INDENT> pass
413 Request Entity Too Large
62598f7a29b78933be269d8a
class BratabaseBackend(OAuthBackend): <NEW_LINE> <INDENT> name = 'bratabase' <NEW_LINE> EXTRA_DATA = [ ('user_id', 'user_id'), ] <NEW_LINE> def get_user_id(self, details, response): <NEW_LINE> <INDENT> return response['body']['user_id'] <NEW_LINE> <DEDENT> def get_user_details(self, response): <NEW_LINE> <INDENT> body ...
Bratabase OAuth2 authentication backend
62598f7ab57a9660fecd13db
class NoInspectionAvailable(InvalidRequestError): <NEW_LINE> <INDENT> pass
A subject passed to :func:`sqlalchemy.inspection.inspect` produced no context for inspection.
62598f7a7b25080760ed6dff
class ReluNormal(Initializer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def sample(self, shape): <NEW_LINE> <INDENT> if len(shape) < 2: <NEW_LINE> <INDENT> raise RuntimeError("Only shapes of length 2 or more are " "supported.") <NEW_LINE> <DEDENT> receptive_field_size = np.pr...
Initializer based on He et al, "Delving Deep into Rectifiers: Surpassing Human-Level Performance on Imagenet Classification".
62598f7a6fece00bbaccb2e4
class BlinkException(Exception): <NEW_LINE> <INDENT> def __init__(self, errcode): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.errid = errcode[0] <NEW_LINE> self.message = errcode[1]
Class to throw general blink exception.
62598f7aac7a0e7691f71e76
class HuntConfigureFlow(renderers.Splitter2WayVertical): <NEW_LINE> <INDENT> description = "What to run?" <NEW_LINE> left_renderer = "FlowTree" <NEW_LINE> right_renderer = "HuntFlowForm" <NEW_LINE> min_left_pane_width = 200 <NEW_LINE> def Layout(self, request, response): <NEW_LINE> <INDENT> response = super(HuntConfigu...
Configure the generic hunt's flow.
62598f7a15baa723494618de
class UtilityGraph(object): <NEW_LINE> <INDENT> def __init__(self, n_variables, n_clauses, clauses, graph_type='cvig'): <NEW_LINE> <INDENT> if graph_type == 'cvig': <NEW_LINE> <INDENT> self.graph = CVIG(n_variables, n_clauses, clauses) <NEW_LINE> <DEDENT> <DEDENT> def set_current_embedding(self, current_embedding): <NE...
This class outlines a typical graph class. The functions defined here will be required in DQN.
62598f7a0fa83653e46f484e
class TestSimulationDefinition(unittest.TestCase): <NEW_LINE> <INDENT> pass
Tests the :py:class:`definition.SimulationDefinition` class.
62598f7ab57a9660fecd13dc
class KeywordStatement(Base): <NEW_LINE> <INDENT> __slots__ = ('name', 'start_pos', 'stmt', 'parent') <NEW_LINE> def __init__(self, name, start_pos, parent, stmt=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.start_pos = start_pos <NEW_LINE> self.stmt = stmt <NEW_LINE> self.parent = parent <NEW_LINE> if st...
For the following statements: `assert`, `del`, `global`, `nonlocal`, `raise`, `return`, `yield`, `pass`, `continue`, `break`, `return`, `yield`.
62598f7abaa26c4b54d4ec10
class RosenbrockModule(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.a1 = 100.0 <NEW_LINE> self.a2 = 20.0 <NEW_LINE> <DEDENT> def computeLikelihood(self, ctx): <NEW_LINE> <INDENT> p = ctx.getParams() <NEW_LINE> return -(self.a1 * (p.y - p.x**2)**2 + (1 - p.x)**2) / self.a2 <NEW_LINE> <DEDENT...
A module for the computation of the rosenbrock likelihood
62598f7a73bcbd0ca4bc9bad
class Breadcrumb(object): <NEW_LINE> <INDENT> def __init__(self, url=None, id=None, name=None): <NEW_LINE> <INDENT> self.swagger_types = { 'url': 'str', 'id': 'int', 'name': 'str' } <NEW_LINE> self.attribute_map = { 'url': 'url', 'id': 'id', 'name': 'name' } <NEW_LINE> self._url = url <NEW_LINE> self._id = id <NEW_LINE...
NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually.
62598f7a1f5feb6acb162593
class ProfileInfo(object): <NEW_LINE> <INDENT> def __init__( self, name, driver_name, xsize, ysize, zsize, can_print, can_print_to_file, has_heated_platform, number_of_tools): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.driver_name = driver_name <NEW_LINE> self.xsize = xsize <NEW_LINE> self.ysize = ysize <NEW_...
This is the JSON-serializable portion of a `Profile`.
62598f7ad99f1b3c44d0500a
class ThresholdedPeakFiltering(PreprocessorMixin): <NEW_LINE> <INDENT> def __init__(self, threshold=1.0, remove_mz_values=True): <NEW_LINE> <INDENT> self.threshold = threshold <NEW_LINE> self.remove_mz_values = remove_mz_values <NEW_LINE> <DEDENT> def transform(self, spectra_list): <NEW_LINE> <INDENT> spectra_list = np...
A pre-processor for removing the peaks that are less intense than a given threshold.
62598f7a596a8972361275d0
class PPAttachmentCorpusReader(CorpusReader): <NEW_LINE> <INDENT> def attachments(self, fileids): <NEW_LINE> <INDENT> return concat( [ StreamBackedCorpusView(fileid, self._read_obj_block, encoding=enc) for (fileid, enc) in self.abspaths(fileids, True) ] ) <NEW_LINE> <DEDENT> def tuples(self, fileids): <NEW_LINE> <INDEN...
sentence_id verb noun1 preposition noun2 attachment
62598f7a07f4c71912baedab
class Solution: <NEW_LINE> <INDENT> def findFirstBadVersion(self, n): <NEW_LINE> <INDENT> start = 0 <NEW_LINE> end = n + 1 <NEW_LINE> while start + 1 < end: <NEW_LINE> <INDENT> mid = start + (end - start) // 2 <NEW_LINE> if SVNRepo.isBadVersion(mid): <NEW_LINE> <INDENT> end = mid <NEW_LINE> <DEDENT> else: <NEW_LINE> <I...
class SVNRepo: @classmethod def isBadVersion(cls, id) # Run unit tests to check whether verison `id` is a bad version # return true if unit tests passed else false. You can use SVNRepo.isBadVersion(10) to check whether version 10 is a bad version.
62598f7ae76e3b2f99fd8390
class theme_matplotlib(theme): <NEW_LINE> <INDENT> def __init__(self, rc=None, fname=None, matplotlib_defaults=True): <NEW_LINE> <INDENT> self._rcParams={} <NEW_LINE> if matplotlib_defaults: <NEW_LINE> <INDENT> _copy = mpl.rcParams.copy() <NEW_LINE> for key in mpl._deprecated_map: <NEW_LINE> <INDENT> if key in _copy: ...
The default matplotlib look and feel. The theme can be used (and has the same parameter to customize) like a matplotlib rc_context() manager. Parameters ----------- rc : dict of rcParams rcParams which should be aplied on top of mathplotlib default fname : Filename (str) a filename to a matplotlibrc file m...
62598f7a0383005118f6d060
class InvalidPackageType(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, package_type): <NEW_LINE> <INDENT> self.package_type = package_type <NEW_LINE> super(InvalidPackageType, self).__init__(self._error_message) <NEW_LINE> <DEDENT> @property <NEW_LINE> def _error_message(self): <NEW_LINE> <INDENT> msg = '{type}...
Raised when trying to set the package type to an invalid type. @ivar package_type: The type that is invalid.
62598f7a8a349b6b43685ba1
class DateTimeHeaderElement (WebDAVTextElement): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def fromDate(clazz, date): <NEW_LINE> <INDENT> def format(date): <NEW_LINE> <INDENT> return date.strftime("%a, %d %b %Y %H:%M:%S GMT") <NEW_LINE> <DEDENT> if type(date) is int: <NEW_LINE> <INDENT> date = format(datetime.datetim...
WebDAV date-time element for elements that substitute for HTTP headers. (RFC 2068, section 3.3.1)
62598f7a8e05c05ec3f6eaf6
class AdminControllerBase(object): <NEW_LINE> <INDENT> def __init__(self, driver): <NEW_LINE> <INDENT> self.driver = driver
Top-level class for controllers. :param driver: Instance of the driver instantiating this controller.
62598f7a287bf620b6271517
class Property(object): <NEW_LINE> <INDENT> def __init__(self, fget=None, name=None, default=None, nullable=True, unique=False, indexed=False): <NEW_LINE> <INDENT> self.fget = fget <NEW_LINE> self.name = name <NEW_LINE> self.default = default <NEW_LINE> self.nullable = nullable <NEW_LINE> self.index...
Abstract base class for database property types used in Models. :param fget: Method name that returns a calculated value. Defaults to None. :type fget: str :param name: Database property name. Defaults to the Property key. :type name: str :param default: Default property value. Defaults to None. :type default: str, ...
62598f7ab5575c28eb712975
class PresentableSlugRelatedField(PresentableRelatedFieldMixin, SlugRelatedField): <NEW_LINE> <INDENT> pass
Override SlugRelatedField to represent serializer data instead of a slug field of the object.
62598f7a8e71fb1e983bb415
class TargetSumImplMemoSearch(TargetSum): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.prefix_sums = [] <NEW_LINE> self.memo = {} <NEW_LINE> <DEDENT> def find_target_sum_ways(self, nums, S): <NEW_LINE> <INDENT> self.prefix_sums = self.get_prefix_sums(nums) <NEW_LINE> self.memo = {} <NEW_LINE> return...
https://leetcode.com/problems/target-sum/description/ Time: O(N * S) memo search极限情况就是转换成dp以后的复杂度 Space: O(N * S)
62598f7ad10714528d69d82e
class ResourceUsage: <NEW_LINE> <INDENT> def __init__(self, cores=1, memory=mib(100), duration=hours(1), nodes=1, more={}): <NEW_LINE> <INDENT> self.cores = cores <NEW_LINE> self.memory = memory <NEW_LINE> self.duration = duration <NEW_LINE> self.nodes = nodes <NEW_LINE> self.more = dict(more) <NEW_LINE> <DEDENT> def _...
Representation of resource usage for a job
62598f7a6e29344779afffc1
class TestSubcommandConfig(SubcommandTestHelper): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.subcommand = CfgSubcommand() <NEW_LINE> self.subcommand_str = "config" <NEW_LINE> super(TestSubcommandConfig, self).setUp() <NEW_LINE> <DEDENT> def test_parse_config_set(self): <NEW_LINE> <INDENT> self.assert...
Jump subcommand test suite.
62598f7ad164cc61758208d6
class HassIOAuth(HassIOBaseAuth): <NEW_LINE> <INDENT> name = "api:hassio:auth" <NEW_LINE> url = "/api/hassio_auth" <NEW_LINE> @RequestDataValidator(SCHEMA_API_AUTH) <NEW_LINE> async def post(self, request, data): <NEW_LINE> <INDENT> self._check_access(request) <NEW_LINE> await self._check_login(data[ATTR_USERNAME], dat...
Hass.io view to handle auth requests.
62598f7a9b70327d1c57e705
class cd(object): <NEW_LINE> <INDENT> def __init__(self, new_path): <NEW_LINE> <INDENT> self._new_path = new_path <NEW_LINE> self._current_path = None <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self._current_path = os.getcwd() <NEW_LINE> os.chdir(self._new_path) <NEW_LINE> <DEDENT> def __exit__(self, ...
进入目录执行对应操作后回到目录
62598f7a0fa83653e46f4850
class UserManagementHelperTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(UserManagementHelperTest, self).setUp() <NEW_LINE> self.request = RequestFactory().post('/') <NEW_LINE> self.old_user = UserFactory.create() <NEW_LINE> self.new_user = UserFactory.create() <NEW_LINE> self.new_user.s...
Tests for the helper functions in users.py
62598f7aec188e330fdf81ff
class NSNitroNserrMaxRltSelectors(NSNitroGslbErrors): <NEW_LINE> <INDENT> pass
Nitro error code 1938 Number of limit selectors exceeds limit
62598f7aac7a0e7691f71e78
class DonorDB(): <NEW_LINE> <INDENT> def __init__(self, donor=None): <NEW_LINE> <INDENT> self._database = {} <NEW_LINE> if donor: <NEW_LINE> <INDENT> self._database[donor.name] = donor <NEW_LINE> <DEDENT> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.display_database() <NEW_LINE> <DEDENT> def __repr__(sel...
DonorDB class Attributes: database: Data structure containing donors
62598f7acad5886f8bdc4c83
class FileObjForWebobFiles: <NEW_LINE> <INDENT> def __init__(self, webob_file): <NEW_LINE> <INDENT> self.file = webob_file.file <NEW_LINE> self.name = webob_file.filename <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> return getattr(self.file, name)
Turn Webob cgi.FieldStorage uploaded files into pure file objects. Webob represents uploaded files as cgi.FieldStorage objects, which have a .file attribute. We wrap the FieldStorage object, delegating attribute access to the .file attribute. But the files have no name, so we carry the FieldStorage .filename attribu...
62598f7a596a8972361275d2
class DeceptionHistogram(Diagram): <NEW_LINE> <INDENT> key = "deception distribution" <NEW_LINE> window_title = "Distribution of Deception probability" <NEW_LINE> def plot(self): <NEW_LINE> <INDENT> data = self.simulation.log["deception_probability"] <NEW_LINE> self.subplot.cla() <NEW_LINE> if len(data): <NEW_LINE> <IN...
A modified PlotWindow to display an updateable histogram
62598f7a4e696a045264dab0
class AddressBook: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._employee_addresses = { 1: Address('121 Admin Rd.', 'Concord', 'NH', '03301'), 2: Address('67 Paperwork Ave', 'Manchester', 'NH', '03101'), 3: Address('15 Rose St', 'Concord', 'NH', '03301', 'Apt. B-1'), 4: Address('39 Sole St.', 'Conco...
Класс AddressBook хранит внутреннюю базу данных объектов Address для каждого сотрудника. Он предоставляет метод get_employee_address(), который возвращает адрес указанного идентификатора сотрудника. Если идентификатор сотрудника не существует, то возникает ошибка ValueError
62598f7a004d5f362081ecab
class ResourceVersionStatus(Enum,IComparable,IFormattable,IConvertible): <NEW_LINE> <INDENT> def __eq__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __format__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ge__(self,*args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __gt__(self,...
An enum indicating whether a resource is current or out of date. enum ResourceVersionStatus,values: Current (0),OutOfDate (1),Unknown (2)
62598f7a0383005118f6d062
class ExcludingBrowserBehaviourMixin(ExcludingBehaviourMixin): <NEW_LINE> <INDENT> def update_button(self, component, mode, selected_mode): <NEW_LINE> <INDENT> component.get_mode_button(mode).set_light('DefaultButton.On' if not self.is_excluded(component, selected_mode) else 'DefaultButton.Disabled')
ExcludingBehaviourMixin that does not indicate the selected mode
62598f7a287bf620b6271519
class color_table(aetools.ComponentItem): <NEW_LINE> <INDENT> want = 'clrt'
color table -
62598f7a50485f2cf55da8d2
class FlickPricingSensor(SensorEntity): <NEW_LINE> <INDENT> _attr_native_unit_of_measurement = UNIT_NAME <NEW_LINE> def __init__(self, api: FlickAPI) -> None: <NEW_LINE> <INDENT> self._api: FlickAPI = api <NEW_LINE> self._price: FlickPrice = None <NEW_LINE> self._attributes = { ATTR_ATTRIBUTION: ATTRIBUTION, ATTR_FRIEN...
Entity object for Flick Electric sensor.
62598f7af7d966606f747949
class CornersProblem(search.SearchProblem): <NEW_LINE> <INDENT> def __init__(self, startingGameState): <NEW_LINE> <INDENT> self.walls = startingGameState.getWalls() <NEW_LINE> self.startingPosition = startingGameState.getPacmanPosition() <NEW_LINE> top, right = self.walls.height-2, self.walls.width-2 <NEW_LINE> self.co...
This search problem finds paths through all four corners of a layout. You must select a suitable state space and successor function
62598f7a8c3a8732951f5eac