code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TestItem(unittest.TestCase): <NEW_LINE> <INDENT> def test_hierarchy(self): <NEW_LINE> <INDENT> me = Item(1, 'tag','me') <NEW_LINE> la = Item(2, 'tag', 'la') <NEW_LINE> me2 = Item(3, 'tag','me') <NEW_LINE> self.assertTrue(me == me2) <NEW_LINE> self.assertEqual(me2, me) <NEW_LINE> me.add_child(la) <NEW_LINE> self.a...
Test various methods on Item class.
62598f1f187af65679d292f0
class FileAccessTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.module = inspect.getmodule(self) <NEW_LINE> self.file = inspect.getsourcefile(self.module) <NEW_LINE> <DEDENT> def test_open_permissions(self): <NEW_LINE> <INDENT> metamodes = ['', 'b', 'U'] <NEW_LINE> tmp = open(self...
Tests for file access on App Engine.
62598f1f97e22403b3839cb9
class Breach: <NEW_LINE> <INDENT> def __init__(self, Address, breachDetails): <NEW_LINE> <INDENT> self.Address = Address <NEW_LINE> self.Title = breachDetails['Title'] <NEW_LINE> self.Site = breachDetails['Domain'] <NEW_LINE> self.BreachDate = breachDetails['BreachDate'] <NEW_LINE> self.Body = breachDetails['Descriptio...
Title: Breach Author: Edward Klesel Date: 08/07/2018 Description: Breach containing data from the HaveIBeenPwned API, which allows main() to determine whether to write this breach to file, amend this breach of do nothing at all.
62598f1fad47b63b2c5a65e4
class TaskDelayQueueServiceServicer(object): <NEW_LINE> <INDENT> def PushTask(self, request, context): <NEW_LINE> <INDENT> context.set_code(grpc.StatusCode.UNIMPLEMENTED) <NEW_LINE> context.set_details('Method not implemented!') <NEW_LINE> raise NotImplementedError('Method not implemented!') <NEW_LINE> <DEDENT> def Fin...
Missing associated documentation comment in .proto file.
62598f1f091ae356687039e0
class PyBonjourProtocol(BaseProtocol): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def find(uuid_id): <NEW_LINE> <INDENT> result = [] <NEW_LINE> for srv in SERVICE_TABLE.values(): <NEW_LINE> <INDENT> if srv['uuid'] == uuid_id: <NEW_LINE> <INDENT> result.append((srv['host'], srv['port'])) <NEW_LINE> <DEDENT> <DEDENT> r...
PyBonjour Protocol
62598f1f31939e2706ed114e
class MapperAttribute(object): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @property <NEW_LINE> def localization_precision(self): <NEW_LINE> <INDENT> return self._parent.localization_precision <NEW_LINE> <DEDENT> @localization_precision.setter <NEW_LINE> def localization_precision(self, sigma): <NEW_LINE> <INDENT> se...
Mixin class for accessing the `localization_precision`, `localization_error` and `temperature` attributes. Also features side functionalities that are expected in both the initializer and specialized mapper attributes.
62598f1ffbf16365ca792e7a
class ChangePasswordView(PasswordChangeView): <NEW_LINE> <INDENT> form_class = PasswordChangingForm <NEW_LINE> success_url = reverse_lazy('home')
view which allows user to change their password
62598f1fc4546d3d9def6952
class SignaturesGenerator(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.sigs = update_metadata_pb2.Signatures() <NEW_LINE> <DEDENT> def AddSig(self, version, data): <NEW_LINE> <INDENT> sig = self.sigs.signatures.add() <NEW_LINE> if version is not None: <NEW_LINE> <INDENT> sig.version = versi...
Generates a payload signatures data block.
62598f1f4c342835776190b1
class Webserver(Thread): <NEW_LINE> <INDENT> def __init__(self, port=8000, www_root='.'): <NEW_LINE> <INDENT> Thread.__init__(self) <NEW_LINE> Handler = AcrylServe <NEW_LINE> Handler.www_root = www_root <NEW_LINE> Handler.log_error = lambda x, *y: None <NEW_LINE> Handler.log_message = lambda x, *y: None <NEW_LINE> self...
A single-threaded webserver to serve while generation.
62598f1ffbf16365ca792e7e
class VorbisNumberingTag(TrackNumberingTag): <NEW_LINE> <INDENT> def __init__(self, track, tag): <NEW_LINE> <INDENT> super(VorbisNumberingTag, self).__init__(track, tag) <NEW_LINE> if not isinstance(track, vorbis): <NEW_LINE> <INDENT> raise TagError('Track is not instance of vorbis') <NEW_LINE> <DEDENT> if self.tag not...
Vorbis tags for storing track or disk numbers. The tag can be either a single number or two numbers separated by / If total is given, the value must be integer.
62598f1f091ae356687039e6
class Window(game): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.winsizex = winsizex <NEW_LINE> self.winsizey = winsizey <NEW_LINE> self.panels = []
class that contains info about the game window - handles placement of sim grid, menus, etc. basically keeps track of the screen layout.
62598f1fab23a570cc2d445a
class Ship(Space_Object): <NEW_LINE> <INDENT> def __init__(self, position, width, height): <NEW_LINE> <INDENT> Space_Object.__init__(self, position, width, height) <NEW_LINE> self.relative_coord = [[-self.width // 2, self.height * 2 // 5], [0, self.height // 5], [self.width // 2, self.height * 2 // 5], [0, -self.height...
The user controlled space ship. Has special methods shoot, control, and remove_shots. Stores the number of ship shots currently active and applies a shot limit. Holds the ships limiting factors: acceleration, turn speed.
62598f1f091ae356687039e8
class UserViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = User.objects.all().order_by('-date_joined') <NEW_LINE> serializer_class = UserSerializer
允许用户查看或编辑的 API 端点。
62598f1fad47b63b2c5a65ef
class WikiArticleRequester: <NEW_LINE> <INDENT> numberOfHttpRequests = 0 <NEW_LINE> base_url = 'https://en.wikipedia.org/w/' <NEW_LINE> random_article_query_string = 'api.php?action=query&format=json&list=random&rnnamespace=0&rnlimit=NUMBER_OF_ARTICLES_HERE' <NEW_LINE> raw_article_query_template = 'index.php?title=TITL...
This class is responsible for making requests to the Wiki API to retrieve articles
62598f1f4c342835776190b7
class CaselessLiteral(Literal): <NEW_LINE> <INDENT> def __init__(self, matchString): <NEW_LINE> <INDENT> Literal.__init__(self, matchString.upper()) <NEW_LINE> self.match = matchString <NEW_LINE> self.pattern = re.compile(re.escape(matchString), re.I) <NEW_LINE> self.parser_name = str(self.pattern) <NEW_LINE> <DEDENT> ...
Token to match a specified string, ignoring case of letters. Note: the matched results will always be in the case of the given match string, NOT the case of the input text.
62598f20091ae356687039ec
class PVComboBox(wx.ComboBox, PVCtrlMixin): <NEW_LINE> <INDENT> def __init__(self, parent, pv=None, **kw): <NEW_LINE> <INDENT> wx.ComboBox.__init__(self, parent, **kw) <NEW_LINE> PVCtrlMixin.__init__(self, pv=pv, font="", fg=None, bg=None) <NEW_LINE> self.Bind(wx.EVT_TEXT, self.OnText) <NEW_LINE> <DEDENT> def _SetValue...
A ComboBox linked to a PV. Both reads/writes the combo value on changes
62598f20ab23a570cc2d445d
class EuEstoniaTransformFunctions(CommonCompHarmTransformFunctions): <NEW_LINE> <INDENT> ESTONIA_SPECIFIC_CATEGORY_MAPPINGS = { "(?i).*PERSONAL.*WASH.*": "Personal Care", } <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.category_mappings = dict( comp_harm_constants.ENGLI...
All custom (uncommon) transform functions **SPECIFIC to individual processing task** must be defined as part of this class.
62598f20fbf16365ca792e86
class DevConfig(Config): <NEW_LINE> <INDENT> FLASK_ENV = 'development' <NEW_LINE> DEBUG = True <NEW_LINE> TESTING = True <NEW_LINE> DATABASE_URI = os.environ.get('DEV_DATABASE_URI')
Development Config
62598f20091ae356687039ee
class IReferenceManual(IReferenceSection): <NEW_LINE> <INDENT> taggedValue('name', 'Reference Manual') <NEW_LINE> description = Attribute(u'Description')
A reference manual in a community
62598f20c4546d3d9def6958
class LRFinder(LearnerCallback): <NEW_LINE> <INDENT> def __init__(self, learn:Learner, start_lr:float=1e-7, end_lr:float=10, num_it:int=100, stop_div:bool=True): <NEW_LINE> <INDENT> super().__init__(learn) <NEW_LINE> self.data,self.stop_div = learn.data,stop_div <NEW_LINE> self.sched = Scheduler((start_lr, end_lr), num...
Causes `learn` to go on a mock training from `start_lr` to `end_lr` for `num_it` iterations.
62598f20ad47b63b2c5a65f5
class ColorectalHistology(tfds.core.GeneratorBasedBuilder): <NEW_LINE> <INDENT> VERSION = tfds.core.Version( "2.0.0", "New split API (https://tensorflow.org/datasets/splits)") <NEW_LINE> SUPPORTED_VERSIONS = [ tfds.core.Version("0.0.1", experiments={tfds.core.Experiment.S3: False}), ] <NEW_LINE> def _info(self): <NEW_L...
Biological 8-class classification problem.
62598f20ab23a570cc2d445f
class DuplicateTaskIdFound(AirflowException): <NEW_LINE> <INDENT> pass
Raise when a Task with duplicate task_id is defined in the same DAG
62598f20c4546d3d9def6959
@xnmt.require_dynet <NEW_LINE> class LatticeBiasedMlpAttender(MlpAttender, Serializable): <NEW_LINE> <INDENT> yaml_tag = '!LatticeBiasedMlpAttender' <NEW_LINE> @events.register_xnmt_handler <NEW_LINE> @serializable_init <NEW_LINE> def __init__(self, input_dim: numbers.Integral = Ref("exp_global.default_layer_dim"), sta...
Modified MLP attention, where lattices are assumed as input and the attention is biased toward confident nodes. Args: input_dim: input dimension state_dim: dimension of state inputs hidden_dim: hidden MLP dimension param_init: how to initialize weight matrices bias_init: how to initialize bias vectors
62598f2026238365f5fab972
class SubhookedABCMeta(with_metaclass(abc.ABCMeta)): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def __subclasshook__(cls, subclass): <NEW_LINE> <INDENT> for abstract_method in cls.__abstractmethods__: <NEW_LINE> <INDENT> if not any(abstract_method in C.__dict__ for C in subclass.__mro__): <NEW_LINE> <INDENT> return Fa...
Abstract class with an implementation of __subclasshook__. The __subclasshook__ method checks that the instance implement the abstract properties and methods defined by the abstract class. This allow classes to implement an abstraction without explicitly subclassing it. Examples -------- >>> class MyInterface(Subhook...
62598f2031939e2706ed1156
class ContainerComponent(object): <NEW_LINE> <INDENT> def __init__(self, component_id, config, proto, session): <NEW_LINE> <INDENT> self.started = datetime.utcnow() <NEW_LINE> self.id = component_id <NEW_LINE> self.config = config <NEW_LINE> self.proto = proto <NEW_LINE> self.session = session <NEW_LINE> self._stopped ...
An application component running inside a container. This class is for _internal_ use within ContainerController.
62598f2026238365f5fab974
class FormularioEntidad(FlaskForm): <NEW_LINE> <INDENT> id = StringField(validators=[DataRequired()]) <NEW_LINE> razon_social = StringField(validators=[DataRequired()]) <NEW_LINE> nombre_comercial = StringField(validators=[]) <NEW_LINE> id_fiscal = StringField(validators=[DataRequired()]) <NEW_LINE> moneda = SelectFiel...
Formulario base para la administración de entidades. Este formulario este vinculada la la tabla Entidad en la base de datos y debe contener un mapeo de la mayoria de sus campos.
62598f20187af65679d292fa
class ImageShift2(Deflector): <NEW_LINE> <INDENT> def __init__(self, tem): <NEW_LINE> <INDENT> super().__init__(tem=tem) <NEW_LINE> self._setter = self._tem.setImageShift2 <NEW_LINE> self._getter = self._tem.getImageShift2 <NEW_LINE> self.key = 'IS2'
ImageShift control (IS2)
62598f20ad47b63b2c5a65f9
class CallAction(Action): <NEW_LINE> <INDENT> def __init__(self, url: str) -> None: <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.__url = url <NEW_LINE> <DEDENT> def __call__(self, event_id: str, extra: Mapping[str, Any]) -> None: <NEW_LINE> <INDENT> doorpi.INSTANCE.sipphone.call(self.__url) <NEW_LINE> <DEDENT...
Calls a static number.
62598f204c342835776190c1
class UserChoice(models.Model): <NEW_LINE> <INDENT> choice = models.ForeignKey(Choice, related_name="users") <NEW_LINE> weddingguest = models.ForeignKey(WeddingGuest, related_name="poll_answers") <NEW_LINE> invitation = models.ForeignKey(Invitation, related_name="poll_answers") <NEW_LINE> freetext_answer = models.TextF...
it represents the vote for each user with timestamp
62598f20187af65679d292fb
class Hand(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.cards=[] <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.cards: <NEW_LINE> <INDENT> rep="" <NEW_LINE> for card in self.cards: <NEW_LINE> <INDENT> rep+=str(card)+"\t" <NEW_LINE> <DEDENT> <DEDENT> else: <NEW_LINE> <IND...
HAND: cards of one player
62598f20091ae356687039f6
class Focus(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._focuspoints = [] <NEW_LINE> <DEDENT> def add_focus_x(self, xo, factor=2.0, Rx=0.1): <NEW_LINE> <INDENT> self._focuspoints.append(_Focus_x(xo, factor, Rx)) <NEW_LINE> <DEDENT> def add_focus_y(self, yo, factor=2.0, Ry=0.1): <NEW_LINE> ...
Return a container for a sequence of Focus objects foc = Focus() The sequence is populated by using the 'add_focus_x' and 'add_focus_y' methods. These methods define a point ('xo' or 'yo'), around witch to focus, a focusing factor of 'focus', and x and y extent of focusing given by Rx or Ry. The region of focusing wi...
62598f20c4546d3d9def695c
class DastardPulse(object): <NEW_LINE> <INDENT> version = 0 <NEW_LINE> def __init__(self, channel, presamples, sampletime, voltsperarb): <NEW_LINE> <INDENT> self.__dict__.update(locals()) <NEW_LINE> self.serialnumber = 0 <NEW_LINE> <DEDENT> def packheader(self, data, trig_time = None, serialnumber = None): <NEW_LINE> <...
Represent a single pulse record from DASTARD
62598f20ab23a570cc2d4462
class TestSetup(unittest.TestCase): <NEW_LINE> <INDENT> layer = PS_PLONE_MLSTILES_INTEGRATION_TESTING <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.app = self.layer['app'] <NEW_LINE> self.portal = self.layer['portal'] <NEW_LINE> <DEDENT> def test_product_is_installed(self): <NEW_LINE> <INDENT> qi = self.portal.p...
Validate setup process for ps.plone.mlstiles.
62598f20ad47b63b2c5a65fc
class CustomContentFooterBar(AbstractFootbar): <NEW_LINE> <INDENT> def __init__(self, content_dir, avail_langs, default_lang): <NEW_LINE> <INDENT> self._content_dir = content_dir <NEW_LINE> self._avail_langs = avail_langs <NEW_LINE> self._default_lang = default_lang <NEW_LINE> self._lang_text_map = {} <NEW_LINE> for it...
CustomContentFooterBar loads localized Markdown files from a specified directory and passes them to document.tmpl template. The only forced contents is 'debugging mode' box in case debugging mode is on.
62598f20187af65679d292fd
class StdErrThread(QThread): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> QThread.__init__(self) <NEW_LINE> self.ansi_escape = re.compile(r'(\x9B|\x1B\[)[0-?]*[ -/]*[@-~]') <NEW_LINE> <DEDENT> def escape_ansi(self, line): <NEW_LINE> <INDENT> return self.ansi_escape.sub('', line) <NEW_LINE> <DEDENT> def c...
The StdErrThread listens to the stderr for the signer
62598f2026238365f5fab97b
class TestCollectionViewSetReorderApps(CollectionViewSetChangeAppsMixin): <NEW_LINE> <INDENT> def random_app_order(self): <NEW_LINE> <INDENT> apps = list(a.pk for a in self.apps) <NEW_LINE> shuffle(apps) <NEW_LINE> return apps <NEW_LINE> <DEDENT> def test_reorder_anon(self): <NEW_LINE> <INDENT> res, data = self.reorder...
Tests the `reorder` action on CollectionViewSet.
62598f20091ae356687039fa
class OptionsBase(QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None, name=None): <NEW_LINE> <INDENT> super(OptionsBase, self).__init__(parent) <NEW_LINE> self.Layout = QHBoxLayout() <NEW_LINE> self.Label = QLabel(name) <NEW_LINE> self.Layout.addWidget(self.Label) <NEW_LINE> return <NEW_LINE> <DEDENT> def Get...
Base class for setting up a lot of GUI components
62598f20fbf16365ca792e94
class ApplicationGatewayAvailableWafRuleSetsResult(Model): <NEW_LINE> <INDENT> _attribute_map = { 'value': {'key': 'value', 'type': '[ApplicationGatewayFirewallRuleSet]'}, } <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ApplicationGatewayAvailableWafRuleSetsResult, self).__init__(**kwargs) <NEW_LIN...
Response for ApplicationGatewayAvailableWafRuleSets API service call. :param value: The list of application gateway rule sets. :type value: list[~azure.mgmt.network.v2017_08_01.models.ApplicationGatewayFirewallRuleSet]
62598f20d8ef3951e32c7550
class Testing(Config): <NEW_LINE> <INDENT> TESTING = True <NEW_LINE> DEBUG = True <NEW_LINE> DB_NAME = os.getenv("TEST_DB_NAME")
Congigurations for testing
62598f20c4546d3d9def6960
class AddressBookHomeResource(CardDAVResource): <NEW_LINE> <INDENT> pass
AddressBook home resource. This resource is backed by an L{IAddressBookHome} implementation.
62598f20d8ef3951e32c7551
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('email', 'username','password', 'phone_number', 'reputation', 'is_active', 'is_admin') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE> <...
A form for updating users. Includes all the fields on the user, but replaces the password field with admin's password hash display field.
62598f204c342835776190cc
class TransactionListApiView(generics.ListCreateAPIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> authentication_classes = (TokenAuthentication,) <NEW_LINE> serializer_class = TransactionSerializer <NEW_LINE> def get_queryset(self): <NEW_LINE> <INDENT> return Transaction.objects.filter( b...
To set up transaction list api view.
62598f20fbf16365ca792e9a
class ConnectionMonitorEndpoint(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'name': {'required': True}, } <NEW_LINE> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'resource_id': {'key': 'resourceId', 'type': 'str'}, 'address': {'key': 'address', 'type': 'str'}, 'filter': {'key': 'filte...
Describes the connection monitor endpoint. All required parameters must be populated in order to send to Azure. :param name: Required. The name of the connection monitor endpoint. :type name: str :param resource_id: Resource ID of the connection monitor endpoint. :type resource_id: str :param address: Address of the ...
62598f20ad47b63b2c5a6605
class TestSuite(): <NEW_LINE> <INDENT> def __init__(self, file): <NEW_LINE> <INDENT> with open(file, 'r') as infile: <NEW_LINE> <INDENT> self.data = json.load(infile) <NEW_LINE> <DEDENT> self.groups = [] <NEW_LINE> for group, obj in self.data.items(): <NEW_LINE> <INDENT> self.groups.append(TestGroup(group, obj)) <NEW_L...
Test suite class, contains multiple test cases
62598f2097e22403b3839cdd
class LiveMonitoring(TrainExtension): <NEW_LINE> <INDENT> def __init__(self, address='*', req_port=5555, pub_port=5556): <NEW_LINE> <INDENT> if not zmq_available: <NEW_LINE> <INDENT> raise ImportError('zeromq needs to be installed to ' 'use this module.') <NEW_LINE> <DEDENT> self.address = 'tcp://%s' % address <NEW_LIN...
A training extension for remotely monitoring and filtering the channels being monitored in real time. PyZMQ must be installed for this extension to work. Parameters ---------- address : string The IP addresses of the interfaces on which the monitor should listen. req_port : int The port number to be used to s...
62598f20091ae35668703a04
class LoaderTests(abc.LoaderTests): <NEW_LINE> <INDENT> @ext_util.skip_unless__testcapi <NEW_LINE> def load_module(self, fullname): <NEW_LINE> <INDENT> loader = _bootstrap._ExtensionFileLoader(ext_util.NAME, ext_util.FILEPATH) <NEW_LINE> return loader.load_module(fullname) <NEW_LINE> <DEDENT> def test_module(self): <NE...
Test load_module() for extension modules.
62598f2097e22403b3839cdf
class BaseTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_get_ingredient_price(self): <NEW_LINE> <INDENT> extended_ingredients = ingredients + ['salt', 'milk'] <NEW_LINE> for i in range(len(extended_ingredients)): <NEW_LINE> <INDENT> for p in range(len(prices)): <NEW_LINE> <INDENT> if(i == p): <NEW_LINE> <IND...
BaseTestCase class. Contains all tests. Must be inherited by class with setUpClass() method implemented.
62598f20c4546d3d9def6964
class Report(object): <NEW_LINE> <INDENT> def __init__(self, out_directory_name, report_name, browser_type, url): <NEW_LINE> <INDENT> self.report_dir_name = out_directory_name <NEW_LINE> shutil.rmtree(out_directory_name, True) <NEW_LINE> if not os.path.exists(out_directory_name): <NEW_LINE> <INDENT> os.makedirs(out_dir...
Report builder
62598f20ab23a570cc2d446a
class ExtensionElement(object): <NEW_LINE> <INDENT> __slots__ = ('rep', 'ext') <NEW_LINE> def __init__(self, rep, ext): <NEW_LINE> <INDENT> self.rep = rep <NEW_LINE> self.ext = ext <NEW_LINE> <DEDENT> def __neg__(f): <NEW_LINE> <INDENT> return ExtElem(-f.rep, f.ext) <NEW_LINE> <DEDENT> def _get_rep(f, g): <NEW_LINE> <I...
Element of a finite extension. A class of univariate polynomials modulo the ``modulus`` of the extension ``ext``. It is represented by the unique polynomial ``rep`` of lowest degree. Both ``rep`` and the representation ``mod`` of ``modulus`` are of class DMP.
62598f2097e22403b3839ce3
class Result(object): <NEW_LINE> <INDENT> def __init__( self, tables, target_columns, source_column_configs, aggregate=False, sort=False, variables=None, table_numbering_start=1 ): <NEW_LINE> <INDENT> self.__dict__ = { tc['target']: get_from_clause( tables, tc, source_column_configs, aggregate, sort, variables=variable...
This lets a user refer to the columns of the result of the initial query from within a HAVING clause
62598f2026238365f5fab98d
@implementer(IRichText, IFromUnicode) <NEW_LINE> class RichText(Object): <NEW_LINE> <INDENT> default_mime_type = 'text/html' <NEW_LINE> output_mime_type = 'text/x-html-safe' <NEW_LINE> allowed_mime_types = None <NEW_LINE> max_length = None <NEW_LINE> def __init__(self, default_mime_type='text/html', output_mime_type='t...
Text field that also stores MIME type.
62598f214c342835776190d8
class TransitionEvent(BaseEvent): <NEW_LINE> <INDENT> def __init__(self, sourcenode=None, message=None, severity=1): <NEW_LINE> <INDENT> super(TransitionEvent, self).__init__(sourcenode, message, severity) <NEW_LINE> self.EventType = ua.NodeId(ua.ObjectIds.TransitionEventType)
TransitionEvent:
62598f2197e22403b3839ce7
class Subtasks(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=256) <NEW_LINE> comment = models.TextField() <NEW_LINE> due_date = models.DateField() <NEW_LINE> class SubtaskStatus(models.IntegerChoices): <NEW_LINE> <INDENT> TO_DO = 0 <NEW_LINE> IN_PROGRESS = 5 <NEW_LINE> DONE = 10 <NEW_LINE> <DEDE...
Model describing a Subtasks For a subtask has a foreign key to the Feature - each Subtask has one Feature it is under. For a Subtask has a foreign key to the User - each Subtask has one assigned user.
62598f21187af65679d29307
class Hat(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Style = None <NEW_LINE> self.Color = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Style") is not None: <NEW_LINE> <INDENT> self.Style = AttributeItem() <NEW_LINE> self.Style._deseria...
帽子信息
62598f2126238365f5fab98f
class DeleteView(TemplateResponseMixin, BaseDeleteView): <NEW_LINE> <INDENT> pass
View for deleting an object retrieved with self.get_object(), with a response rendered by a template.
62598f21091ae35668703a0e
class FlightManager(models.Manager): <NEW_LINE> <INDENT> def arrived_but_not_flagged(self, game, now=None): <NEW_LINE> <INDENT> now = now or game.time <NEW_LINE> flights = Flight.objects.filter(game=game) <NEW_LINE> flights = flights.filter(arrival_time__lte=now) <NEW_LINE> flights = flights.exclude(state='Arrived') <N...
we manage flights
62598f21ad47b63b2c5a660d
class Entity: <NEW_LINE> <INDENT> def __init__(self, name, category, size): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.category = category <NEW_LINE> self.size = size <NEW_LINE> self.x = None <NEW_LINE> self.y = None <NEW_LINE> self.width = 1 <NEW_LINE> self.alpha = 1
Represents a requester or domain. name: copyright owner name or domain name category: requester or target size: how large the circle should be x, y, width, alpha: line properties
62598f21fbf16365ca792ea8
class TestCurrenciesGetRequest(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 testCurrenciesGetRequest(self): <NEW_LINE> <INDENT> model = payoneer_mobile_api.models.currencies_get_request.Currenci...
CurrenciesGetRequest unit test stubs
62598f2126238365f5fab997
class GetData(object): <NEW_LINE> <INDENT> def __init__(self, repo_dir, commit_id='84d63bb9aa33b'): <NEW_LINE> <INDENT> self.repo_dir= repo_dir <NEW_LINE> self.commit_id= commit_id <NEW_LINE> self.Sql= SqliteConnection() <NEW_LINE> <DEDENT> def fetch(self): <NEW_LINE> <INDENT> curr_path = os.getcwd() <NEW_LINE> os.chdi...
Fetches and loads decam.sqlite3 data as Pandas df Args: repo_dir: path to obsbot repo, eg. $repo_dir/obsbot commit_id: commit id for data version in obsbot repo, default: Aug 25, 2017
62598f21c4546d3d9def696c
class BaseContract(BaseACIObject): <NEW_LINE> <INDENT> def __init__(self, contract_name, parent=None): <NEW_LINE> <INDENT> super(BaseContract, self).__init__(contract_name, parent) <NEW_LINE> self._scope = 'context' <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _get_contract_code(): <NEW_LINE> <INDENT> raise NotImpl...
BaseContract : Base class for Contracts and Taboos
62598f21ad47b63b2c5a6617
class LazyRateCalculator(object): <NEW_LINE> <INDENT> def __init__(self, value_getter, min_interval=0.5): <NEW_LINE> <INDENT> self.__value_getter = value_getter <NEW_LINE> self.__min_interval = min_interval <NEW_LINE> self.__time = time.time() <NEW_LINE> self.__last_value = value_getter() <NEW_LINE> self.__last_rate = ...
Given a monotonically increasing value, allow polling its rate of increase.
62598f21091ae35668703a1a
class WallpaperSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Wallpaper <NEW_LINE> fields = ('id', 'title', 'author', 'author_email', 'tags', 'ext', 'downloads', 'date_created', 'resolution', 'category', 'description') <NEW_LINE> read_only_fields = ( ['ext', 'resolu...
Serializer to map the Model instance into JSON format.
62598f21187af65679d2930d
class CRFDecode_vb(): <NEW_LINE> <INDENT> def __init__(self, tagset_size, start_tag, end_tag, average_batch=True): <NEW_LINE> <INDENT> self.tagset_size = tagset_size <NEW_LINE> self.start_tag = start_tag <NEW_LINE> self.end_tag = end_tag <NEW_LINE> self.average_batch = average_batch <NEW_LINE> <DEDENT> def decode(self,...
Batch-mode viterbi decode args: tagset_size: target_set_size start_tag: ind for <start> end_tag: ind for <pad> average_batch: whether average the loss among batch
62598f214c342835776190e6
class RayPath(RayMonitor): <NEW_LINE> <INDENT> def __init__(self,ray = None, wavelength = None): <NEW_LINE> <INDENT> RayMonitor.__init__(self,wavelength) <NEW_LINE> self.x = [] <NEW_LINE> self.y = [] <NEW_LINE> self.z = [] <NEW_LINE> if ray != None: <NEW_LINE> <INDENT> ray.addMonitor(self) <NEW_LINE> self.wavelength = ...
Class to record a ray path. the path in held in three lists x[], y[] and z[] :param wavelength: Wavelength of ray, (Default = None, give package default) :type wavelength: float
62598f21d8ef3951e32c755f
class PatchclampSealTest: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.constants = MeasurementConstants() <NEW_LINE> self.sampleRate = self.constants.patchSealSampRate <NEW_LINE> self.frequency = self.constants.patchSealFreq <NEW_LINE> self.voltMin = self.constants.patchSealMinVol <NEW_LINE> self.vo...
Class for doing a patchclamp seal test. A continuous measurement can be done of which the data is returned continuously as well. We want to use the nidaqmx.task.timing to assign a clock and a conversion rate to the task. Then we need to make sure to call the read function regularly to read all the samples automatically...
62598f21ab23a570cc2d4475
class BoughtGamesTest(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> logger.debug('BoughtGamesTest.setUp') <NEW_LINE> self.parser = JSONParser() <NEW_LINE> self.client = APIClient() <NEW_LINE> dev_group = Group.objects.get(name='Developer') <NEW_LINE> ply_group = Group.objects.get(name='Player') <N...
Tests the querying of games bought by users and the lists of buyers by game.
62598f21187af65679d2930e
class ApiGetTestCase(object): <NEW_LINE> <INDENT> def test_ordering(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_get_detail(self): <NEW_LINE> <INDENT> if self.private_resource: <NEW_LINE> <INDENT> response = self.client.get(self.url_detail) <NEW_LINE> self.assertEqual(response.status_code, status.HTTP_4...
Base test case for testing GET access to the API
62598f21d8ef3951e32c7560
class StockMove(orm.Model): <NEW_LINE> <INDENT> _inherit = 'stock.move' <NEW_LINE> _columns = { 'price_unit': fields.float( 'Unit Price', help='Load price', digits_compute=dp.get_precision('Stock move price'), ), }
Model name: StockMove
62598f2197e22403b3839cf7
class modify_expiry_date(osv.osv_memory): <NEW_LINE> <INDENT> _name = "modify.expiry.date" <NEW_LINE> _columns = {'kit_id': fields.many2one('composition.kit', string='Composition List', readonly=True), 'date': fields.date(string='Date', readonly=True), 'new_date': fields.date(string='New Date', help="When using automat...
wizard called to confirm an action
62598f2131939e2706ed116d
class SecurityError(Exception): <NEW_LINE> <INDENT> pass
Security-related error
62598f21d8ef3951e32c7561
class DataFeed(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> raise NotImplementedError('This class is abstract. Derive it.') <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> raise NotImplementedError('This method is abstract. Override it.')
The model of the classes which serve as observations sources.
62598f2197e22403b3839cf9
class Distance(object): <NEW_LINE> <INDENT> x = None <NEW_LINE> y = None <NEW_LINE> radius = None <NEW_LINE> def __init__(self, x=_nan, y=_nan, radius=_nan): <NEW_LINE> <INDENT> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.radius = radius <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return isins...
Represents a Distance geometry for DSE
62598f21091ae35668703a20
class TestRegexWrapper(unittest.TestCase): <NEW_LINE> <INDENT> def test_fill_template(self): <NEW_LINE> <INDENT> wrapper = RegexWrapper({ "Brand": r"(fiat|gm|chevrolet|wv|volkswagen|ford)", "Model": r"^(\w+)[^\w]?([a-zA-Z]\w*)?[^\w]?([a-zA-Z]\w*)?[^\w]", "Motor": r"[^\w\.\,](\d\.\d)[^\w\.\,]", "Year": r"[^\w\.\,](\d{2,...
Tests the RegexWrapper class
62598f21fbf16365ca792eba
class TestTimeSheet(TestCase): <NEW_LINE> <INDENT> @patch('builtins.input', side_effect=['2']) <NEW_LINE> def test_get_hours_for_day(self, mock_input): <NEW_LINE> <INDENT> hours = timesheets.get_hours_for_day('Tuesday') <NEW_LINE> self.assertEqual(2, hours) <NEW_LINE> <DEDENT> @patch('builtins.input', side_effect=['dog...
mock input() and force it to return a value
62598f21091ae35668703a22
class CUTEFF(KeywordBase): <NEW_LINE> <INDENT> efficiency = DecimalField('Cutting Efficiency', precision=2) <NEW_LINE> def __init__(self, efficiency=1.0, **kargs): <NEW_LINE> <INDENT> KeywordBase.__init__(self, 'CUTEFF', 'Global cutting efficiency' , format=KW_FMT_ONELINE , **kargs ) <NEW_LINE> self.efficiency = effici...
Global cutting efficiency default
62598f21ad47b63b2c5a6623
class PortfolioSerializer(ModelSerializer): <NEW_LINE> <INDENT> user_id = SerializerMethodField() <NEW_LINE> items = ItemSerializer(many=True, read_only=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Portfolio <NEW_LINE> fields = ('id','name','user_id','items') <NEW_LINE> <DEDENT> def get_user_id(self, obj): ...
Portfolio serializer
62598f21ab23a570cc2d4479
class DocTree(object): <NEW_LINE> <INDENT> src_path = None <NEW_LINE> out_path = None <NEW_LINE> has_intersphinx = False <NEW_LINE> def __init__(self, prj, rel_doc_tree): <NEW_LINE> <INDENT> self.rel_path = rel_doc_tree <NEW_LINE> self.prj = prj <NEW_LINE> if rel_doc_tree in ('', '.'): <NEW_LINE> <INDENT> src_path = pr...
Base class for a doctree descriptor. Atelier currently supports `Sphinx <http://www.sphinx-doc.org/en/stable/>`__ and `Nikola <https://getnikola.com/>`__ docs.
62598f2131939e2706ed1170
class ForeignShellFunctionAlias(ForeignShellBaseAlias): <NEW_LINE> <INDENT> INPUT = "{funcname} {args}\n" <NEW_LINE> def __init__(self, funcname, shell, sourcer=None, files=(), extra_args=()): <NEW_LINE> <INDENT> super().__init__( shell=shell, sourcer=sourcer, files=files, extra_args=extra_args ) <NEW_LINE> self.funcna...
This class is responsible for calling foreign shell functions as if they were aliases. This does not currently support taking stdin.
62598f21c4546d3d9def6973
class TestRepoAPI(LoreTestCase): <NEW_LINE> <INDENT> def test_get_repo(self): <NEW_LINE> <INDENT> api.get_repo(self.repo.slug, self.user.id) <NEW_LINE> self.assertRaises( api.NotFound, api.get_repo, "nonexistent_repo", self.user.id ) <NEW_LINE> self.assertRaises( api.PermissionDenied, api.get_repo, self.repo.slug, self...
Tests repo getters
62598f21ab23a570cc2d447a
class CallGraphDynlibs(gdb.Parameter): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(CallGraphDynlibs, self).__init__('call-graph-dynlibs', gdb.COMMAND_NONE, gdb.PARAM_BOOLEAN) <NEW_LINE> <DEDENT> def get_set_string(self): <NEW_LINE> <INDENT> return 'call-graph will {}include dynamic libraries'.form...
Should `call-graph` trace symbols in dynamic libraries. Boolean - true => trace dynamic library functions. false => do not trace dynamic library functions.
62598f2197e22403b3839cff
class Scrape(Command): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> start_time = time.time() <NEW_LINE> deputy_loader.update_deputies() <NEW_LINE> self.deputies = Deputy.query.all() <NEW_LINE> budget_date_loader.update_budget_dates(self.deputies) <NEW_LINE> self.budget_dates = BudgetDate.query.all() <NEW_LINE...
Scrape and load the ALMG data into the database (will take about 6 minutes)
62598f21d8ef3951e32c7565
class SectionUpdate(PermissionRequiredMixin, LoginRequiredMixin, View): <NEW_LINE> <INDENT> model = Section <NEW_LINE> permission_required = 'section.add_section' <NEW_LINE> def post(self, request, *args, **kwargs): <NEW_LINE> <INDENT> id = kwargs.get('pk') <NEW_LINE> section_table = str(Section.objects.get(pk=id)).low...
"Agregamos campos a la seccion url=r'^(?P<pk>[0-9])/update/'
62598f2197e22403b3839d01
class PHCRule(Rule): <NEW_LINE> <INDENT> def predicate(self, raw_crash, dumps, processed_crash, proc_meta): <NEW_LINE> <INDENT> return "PHCKind" in raw_crash <NEW_LINE> <DEDENT> def action(self, raw_crash, dumps, processed_crash, proc_meta): <NEW_LINE> <INDENT> processed_crash["phc_kind"] = raw_crash["PHCKind"] <NEW_LI...
Performs PHC-related annotation processing. PHC stands for probabilistic heap checker. It adds a set of annotations that need to be adjusted so as to be searchable and usable in Crash Stats. Bug #1523278.
62598f21091ae35668703a28
class ArithmeticProgression(object): <NEW_LINE> <INDENT> def __init__(self, count, start=1, diff=1): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self._current = 0 <NEW_LINE> self.count = count <NEW_LINE> self.delta = diff <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> ...
Arithmetic Progression class: In it's simplest form acts as an AP iterator.
62598f2131939e2706ed1172
class Example(object): <NEW_LINE> <INDENT> def __init__(self, article, abstract_sentences, vocab, hpm): <NEW_LINE> <INDENT> self.hpm = hpm <NEW_LINE> start_decoding = vocab.word_to_id(START_DECODING) <NEW_LINE> stop_decoding = vocab.word_to_id(STOP_DECODING) <NEW_LINE> article_words = article.split() <NEW_LINE> if len(...
Class representing a train/val/test example for text summarization.
62598f21ad47b63b2c5a662b
class DogsVsCatsSegment(Dataset): <NEW_LINE> <INDENT> def __init__(self, gas, segment_name, transform): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.dataset = TensorBayDataset("DogsVsCats", gas) <NEW_LINE> self.segment = self.dataset[segment_name] <NEW_LINE> self.category_to_index = self.dataset.catalog.class...
class for wrapping a DogsVsCats segment.
62598f2197e22403b3839d05
class Extended_status(extensions.ExtensionDescriptor): <NEW_LINE> <INDENT> name = "ExtendedStatus" <NEW_LINE> alias = "OS-EXT-STS" <NEW_LINE> namespace = ("http://docs.openstack.org/compute/ext/" "extended_status/api/v1.1") <NEW_LINE> updated = "2011-11-03T00:00:00+00:00" <NEW_LINE> def get_controller_extensions(self):...
Extended Status support
62598f21c4546d3d9def6977
class AnswerSubmittedEventLogEntryModel(base_models.BaseModel): <NEW_LINE> <INDENT> exp_id = datastore_services.StringProperty(indexed=True) <NEW_LINE> exp_version = datastore_services.IntegerProperty(indexed=True) <NEW_LINE> state_name = datastore_services.StringProperty(indexed=True) <NEW_LINE> session_id = datastore...
An event triggered by a student submitting an answer.
62598f2231939e2706ed1175
class TestLongCallVerticalSpread(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 testLongCallVerticalSpread(self): <NEW_LINE> <INDENT> pass
LongCallVerticalSpread unit test stubs
62598f22fbf16365ca792eca
class MockTMMBeanClient(object): <NEW_LINE> <INDENT> BEANBAG = { "stringHub": { "stringhub": { "NumberOfActiveChannels": 2, "NumberOfActiveAndTotalChannels": [1, 2], "TotalLBMOverflows": 20, }, "sender": { "NumHitsReceived": 0, "NumReadoutRequestsReceived": 0, "NumReadoutsSent": 0, }, }, "iceTopTrigger": { "icetopHit":...
Mock MBean client
62598f22c4546d3d9def6979
class MysqlSortScan(MysqlStatu): <NEW_LINE> <INDENT> statu_name="sort_scan"
全表扫描之后又排序(排序键不是主键)的次数
62598f22d8ef3951e32c756a
class Eventhandler(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'eventhandlers' <NEW_LINE> __table_args__ = {'extend_existing': True} <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> event = db.Column(db.String(32)) <NEW_LINE> handler = db.Column(db.String(64)) <NEW_LINE> position = db.Column(db.Int...
Eventhandler class
62598f22091ae35668703a34
class Radio: <NEW_LINE> <INDENT> def __init__(self, bot): <NEW_LINE> <INDENT> self.bot = bot <NEW_LINE> self.session = aiohttp.ClientSession(loop=self.bot.loop) <NEW_LINE> <DEDENT> @commands.command(no_pm=True) <NEW_LINE> async def play(self, ctx): <NEW_LINE> <INDENT> channel = ctx.author.voice.channel <NEW_LINE> if ct...
Radio Haru - www.RadioHaru.pw
62598f22c4546d3d9def697b
class ResponseHeader(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Switch = None <NEW_LINE> self.HeaderRules = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Switch = params.get("Switch") <NEW_LINE> if params.get("HeaderRules") is not None: <NEW_LINE...
自定义响应头配置,默认为关闭状态
62598f22d8ef3951e32c756c
class FeatureTypes(object): <NEW_LINE> <INDENT> CROP_HINTS = 'CROP_HINTS' <NEW_LINE> DOCUMENT_TEXT_DETECTION = 'DOCUMENT_TEXT_DETECTION' <NEW_LINE> FACE_DETECTION = 'FACE_DETECTION' <NEW_LINE> IMAGE_PROPERTIES = 'IMAGE_PROPERTIES' <NEW_LINE> LABEL_DETECTION = 'LABEL_DETECTION' <NEW_LINE> LANDMARK_DETECTION = 'LANDMARK_...
Feature Types to indication which annotations to perform. See https://cloud.google.com/vision/docs/reference/rest/v1/images/annotate#Type
62598f2226238365f5fab9b7
class Solution: <NEW_LINE> <INDENT> def myPow(self, x: float, n: int) -> float: <NEW_LINE> <INDENT> flag = True <NEW_LINE> temp = {} <NEW_LINE> if n == 0: <NEW_LINE> <INDENT> return 1 <NEW_LINE> <DEDENT> if n < 0: <NEW_LINE> <INDENT> n *= -1 <NEW_LINE> flag = False <NEW_LINE> <DEDENT> def _pow(x, n): <NEW_LINE> <INDENT...
二分 + 记忆化
62598f22ab23a570cc2d4483
class Meta: <NEW_LINE> <INDENT> verbose_name_plural = "User"
docstring for meta
62598f22187af65679d2931c
class NTAG210(NTAG21x): <NEW_LINE> <INDENT> def __init__(self, clf, target): <NEW_LINE> <INDENT> super(NTAG210, self).__init__(clf, target) <NEW_LINE> self._product = "NXP NTAG210" <NEW_LINE> self._cfgpage = 16 <NEW_LINE> <DEDENT> def dump(self): <NEW_LINE> <INDENT> footer = dict(zip(range(16, 20), ("MIRROR_BYTE, RFU, ...
The NTAG210 provides 48 bytes user data memory, password protection, originality signature and a UID mirror function.
62598f2231939e2706ed117b
class ModelIpaddressTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.host = Host.objects.create(name='host.example.org') <NEW_LINE> self.ipaddress_sample = Ipaddress(host=self.host, ipaddress='192.168.202.123', macaddress='a4:34:d9:0e:88:b9') <NEW_LINE> self.ipv6address_sample = Ipaddre...
This class defines the test suite for the Ipaddress model.
62598f22187af65679d2931d
class Vertex: <NEW_LINE> <INDENT> def __init__(self, id): <NEW_LINE> <INDENT> self.id = str(id) <NEW_LINE> self.key = None <NEW_LINE> self.pi = None <NEW_LINE> self.neighbors = [] <NEW_LINE> self.edges = {} <NEW_LINE> <DEDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return self.key < other.key <NEW_LINE> <DEDENT> ...
Class Vertex.
62598f22d8ef3951e32c756f