code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class OrderListView(APIView): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> orders = Order.objects.all() <NEW_LINE> serializer = OrderListSerializer(orders, many=True) <NEW_LINE> return Response(serializer.data)
Вывод списка заказов
6259907399cbb53fe68327fc
class LoggingStream(object): <NEW_LINE> <INDENT> def __init__(self, logfile, verbose_printing, formatter=None): <NEW_LINE> <INDENT> self.__logger = get_validator_logger() <NEW_LINE> self.__logger.handlers = [] <NEW_LINE> self.__logger.setLevel(logging.DEBUG) <NEW_LINE> self.__logger.propagate = False <NEW_LINE> stream_...
A fake 'stream' to be used for logging in tests.
625990734428ac0f6e659e47
class TAGraphConvolution(Layer): <NEW_LINE> <INDENT> def __init__(self, input_dim, output_dim, placeholders, dropout=0., sparse_inputs=False, act=tf.nn.relu, bias=False, featureless=False, **kwargs): <NEW_LINE> <INDENT> super(TAGraphConvolution, self).__init__(**kwargs) <NEW_LINE> if dropout: <NEW_LINE> <INDENT> self.d...
Graph convolution layer.
62599073009cb60464d02e4c
class FTPClient(ftputil.FTPHost, BaseClient): <NEW_LINE> <INDENT> def __init__(self, factory=ftplib.FTP, **kwargs): <NEW_LINE> <INDENT> BaseClient.__init__(self, uri=kwargs.pop('uri', 'ftp://'), **kwargs) <NEW_LINE> ftputil.FTPHost.__init__( self, kwargs.pop('server', kwargs.pop('host', kwargs.pop('hostname', self.host...
Simplified yet flexible FTP client
6259907344b2445a339b75e7
class UnsupportedVersion(Exception): <NEW_LINE> <INDENT> pass
Indication for using an unsupported version of the API. Indicates that the user is trying to use an unsupported version of the API.
625990737d43ff248742809c
class Material(object): <NEW_LINE> <INDENT> MaterialString = property(lambda self: object(), lambda self, v: None, lambda self: None)
Material()
6259907338b623060ffaa4de
class _BulkNegativeKeyword(_SingleRecordBulkEntity): <NEW_LINE> <INDENT> def __init__(self, status=None, negative_keyword=None, parent_id=None): <NEW_LINE> <INDENT> super(_BulkNegativeKeyword, self).__init__() <NEW_LINE> self._negative_keyword = negative_keyword <NEW_LINE> self._status = status <NEW_LINE> self._parent_...
The base class for all bulk negative keywords. Either assigned individually to a campaign or ad group entity, or shared in a negative keyword list. *See also:* * :class:`.BulkAdGroupNegativeKeyword` * :class:`.BulkCampaignNegativeKeyword` * :class:`.BulkSharedNegativeKeyword`
625990734a966d76dd5f07fd
class SomeGraph: <NEW_LINE> <INDENT> def __init__( self, array_of_integers: typing.List[int]) -> None: <NEW_LINE> <INDENT> self.array_of_integers = array_of_integers
defines some object graph.
625990738a43f66fc4bf3aa8
class IAREmbeddedWorkbench(Exporter): <NEW_LINE> <INDENT> NAME = 'IAR' <NEW_LINE> TOOLCHAIN = 'IAR' <NEW_LINE> TARGETS = [ 'LPC1768', 'LPC1347', 'LPC11U24', 'LPC11U35_401', 'LPC11U35_501', 'LPC1114', 'LPC1549', 'LPC812', 'LPC4088', 'LPC4088_DM', 'LPC824', 'UBLOX_C027', 'ARCH_PRO', 'K20D50M', 'KL05Z', 'KL25Z', 'KL46Z', ...
Exporter class for IAR Systems.
62599073cc0a2c111447c75a
class NeXtVLADModel(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def create_model(self, video_input, audio_input, is_training = True, class_dim = None, cluster_size = None, hidden_size = None, groups = None, expansion = None, drop_rate = None, gating_reduction = None, l2...
Creates a NeXtVLAD based model. Args: model_input: A LoDTensor of [-1, N] for the input video frames. vocab_size: The number of classes in the dataset.
625990734e4d562566373d1a
class Attachment(object): <NEW_LINE> <INDENT> file_name = "" <NEW_LINE> content = None <NEW_LINE> mime_type = "" <NEW_LINE> ext = "" <NEW_LINE> size = 0 <NEW_LINE> def __init__(self, file_name="", content="", mime_type="", ext="", size=0): <NEW_LINE> <INDENT> self.file_name = file_name <NEW_LINE> self.content = content...
Attachmnent class
625990732ae34c7f260ac9f7
class Blueprint(models.Model): <NEW_LINE> <INDENT> class Meta(object): <NEW_LINE> <INDENT> ordering = ["module_type__name", "name", "grade"] <NEW_LINE> <DEDENT> name = models.CharField(max_length=100) <NEW_LINE> grade = models.PositiveSmallIntegerField(choices=BLUEPRINT_GRADE_CHOICES) <NEW_LINE> module_type = models.Fo...
Blueprints are used to craft upgrades for a ship's module.
6259907332920d7e50bc795b
class TestSuiteOverview(_messages.Message): <NEW_LINE> <INDENT> errorCount = _messages.IntegerField(1, variant=_messages.Variant.INT32) <NEW_LINE> failureCount = _messages.IntegerField(2, variant=_messages.Variant.INT32) <NEW_LINE> name = _messages.StringField(3) <NEW_LINE> skippedCount = _messages.IntegerField(4, vari...
A summary of a test suite result either parsed from XML or uploaded directly by a user. Note: the API related comments are for StepService only. This message is also being used in ExecutionService in a read only mode for the corresponding step. Fields: errorCount: Number of test cases in error, typically set by the...
6259907366673b3332c31d12
class HomeEntities: <NEW_LINE> <INDENT> all_entities = [] <NEW_LINE> @classmethod <NEW_LINE> def disable(cls): <NEW_LINE> <INDENT> for ele in cls.all_entities: <NEW_LINE> <INDENT> ele.enabled = False <NEW_LINE> <DEDENT> <DEDENT> @classmethod <NEW_LINE> def enable(cls): <NEW_LINE> <INDENT> for ele in cls.all_entities: <...
Home 패이지를 소멸,복구하는것을 도와주는 클래스 만약 simul설계에 처음부터 이런것을 도입했다면...
625990738e7ae83300eea9a5
class RemoteSlaveContext(IModbusSlaveContext): <NEW_LINE> <INDENT> def __init__(self, client, unit=None): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self.unit = unit <NEW_LINE> self.__build_mapping() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> raise NotImplementedException() <NEW_LINE> <DEDENT> d...
TODO This creates a modbus data model that connects to a remote device (depending on the client used)
6259907397e22403b383c817
class ExportControllersHandler(webapp.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.response.headers['Content-Type'] = 'text/plain' <NEW_LINE> results = Controller.all() <NEW_LINE> controllers = [] <NEW_LINE> for controller in Controller.all(): <NEW_LINE> <INDENT> controller_output = { 'm...
Return all controllers for the RDM Protocol Site. This is used by the rdmprotocol.org site. Don't change the format without checking in with Peter Kirkup.
6259907360cbc95b063659f7
class AirflowPostAnalyzer: <NEW_LINE> <INDENT> def get_next_state(results, in_state): <NEW_LINE> <INDENT> if results["valid"] is False: <NEW_LINE> <INDENT> raise InvalidDesign("Magnet temperature beyond limits") <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> state_out = deepcopy(in_state) <NEW_LINE> state_out.conditions...
Converts a State into a problem
6259907344b2445a339b75e8
class FlashMessages(object): <NEW_LINE> <INDENT> def __init__(self, controller): <NEW_LINE> <INDENT> self.controller = controller <NEW_LINE> self.controller.events.before_render += self._on_before_render <NEW_LINE> <DEDENT> def flash(self, message, level='info'): <NEW_LINE> <INDENT> flash = self.controller.session.get(...
Flash Messages are brief messages that are stored in the session and displayed to the user on the next page. These are useful for things like create/edit/delete acknowledgements.
625990734a966d76dd5f07fe
class JudgeDetailsView(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> queryset = Judge.objects.all() <NEW_LINE> serializer_class = JudgeSerializer <NEW_LINE> authentication_classes = (TokenAuthentication, BasicAuthentication)
This class handles the http GET, PUT and DELETE requests.
62599073adb09d7d5dc0be7e
class Collision(Sensor): <NEW_LINE> <INDENT> _name = "Collision" <NEW_LINE> _short_desc = "Detect objects colliding with the current object." <NEW_LINE> add_data('collision', False, "bool", "objects colliding with the current object") <NEW_LINE> add_data('objects', "", "string", "A list of colliding objects.") <NEW_LIN...
Sensor to detect objects colliding with the current object, with more settings than the Touch sensor
625990735fcc89381b266de2
class StateDependentExplorer(Explorer, ParameterContainer): <NEW_LINE> <INDENT> def __init__(self, statedim, actiondim, sigma= -2.): <NEW_LINE> <INDENT> Explorer.__init__(self, actiondim, actiondim) <NEW_LINE> self.statedim = statedim <NEW_LINE> self.actiondim = actiondim <NEW_LINE> ParameterContainer.__init__(self, ac...
A continuous explorer, that perturbs the resulting action with additive, normally distributed random noise. The exploration has parameter(s) sigma, which are related to the distribution's standard deviation. In order to allow for negative values of sigma, the real std. derivation is a transformation of sigma according ...
6259907399fddb7c1ca63a5e
class IUSToolsError(Exception): <NEW_LINE> <INDENT> def __init__(self, value, code=1): <NEW_LINE> <INDENT> Exception.__init__(self) <NEW_LINE> self.msg = value <NEW_LINE> self.code = code <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.msg <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <IN...
Generic errors.
625990734f6381625f19a134
class ClearNewProduct(ClearProduct, NewProductView): <NEW_LINE> <INDENT> pass
Clear new product from session and redirect to Basic Info.
625990737047854f46340ccd
class User(SAFRSBase, db.Model): <NEW_LINE> <INDENT> __tablename__ = 'users' <NEW_LINE> id = Column(String, primary_key=True) <NEW_LINE> name = Column(String, default = '') <NEW_LINE> email = Column(String, default = '') <NEW_LINE> crossdomain_kwargs = { 'origin' : '*', 'methods' : ['GET', 'PATCH', 'OPTIONS'], 'headers...
description: User description
625990738a43f66fc4bf3aaa
class EventsRequestInfo(Model): <NEW_LINE> <INDENT> _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'success': {'key': 'success', 'type': 'str'}, 'duration': {'key': 'duration', 'type': 'float'}, 'performance_bucket': {'key': 'performanceBucket', 'type': 'str'}, 'result_...
The request info. :param name: The name of the request :type name: str :param url: The URL of the request :type url: str :param success: Indicates if the request was successful :type success: str :param duration: The duration of the request :type duration: float :param performance_bucket: The performance bucket of the...
6259907363b5f9789fe86a79
class GetCurrentSceneCollection(BaseRequest): <NEW_LINE> <INDENT> name = 'GetCurrentSceneCollection' <NEW_LINE> category = 'scene collections' <NEW_LINE> fields = [] <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.datain = {} <NEW_LINE> self.datain['sc-name'] = None <NEW_LINE> <DED...
Get the name of the current scene collection. :Returns: *sc_name* type: String Name of the currently active scene collection.
625990732ae34c7f260ac9f9
class Document(DocumentContent): <NEW_LINE> <INDENT> grok.implements(IDocument) <NEW_LINE> meta_type = 'Silva Document' <NEW_LINE> silvaconf.version_class(DocumentVersion) <NEW_LINE> silvaconf.priority(-6) <NEW_LINE> silvaconf.icon('document.png')
A new style Document.
62599073aad79263cf4300cc
class SaveToMongoDB(FillTraining): <NEW_LINE> <INDENT> def __init__( self, db_config: Tuple[str, str], name: str, keras_model: Model, save_initial_weights: bool=True, epoch_save_condition: Callable=None): <NEW_LINE> <INDENT> super().__init__(name, keras_model) <NEW_LINE> self._epoch_save_condition = epoch_save_conditio...
Callback to save Trainings & Results to a local MongoDB
625990738e7ae83300eea9a6
class MovFormat(BaseFormat): <NEW_LINE> <INDENT> format_name = 'mov' <NEW_LINE> ffmpeg_format_name = 'mov'
Mov container format, used mostly with H.264 video content, often for mobile platforms.
6259907376e4537e8c3f0e94
class Frequency(PropertyHolder): <NEW_LINE> <INDENT> enabled = BoolProperty(default=False, title="Report Frequency?") <NEW_LINE> report_interval = TimeDeltaProperty(default={"seconds": 1}, title="Report Interval") <NEW_LINE> averaging_interval = TimeDeltaProperty(default={"seconds": 5}, title="Averaging Interval")
An object to encapsulate frequency reporting configuration. Properties: enabled (bool): Is frequency reporting enabled? report_interval (timedelta): The interval at which to report the frequency. averaging_interval (timedelta): The period over which frequencies are calculated.
6259907391f36d47f2231b19
class IHostVideoInputDevice(Interface): <NEW_LINE> <INDENT> __uuid__ = 'a1ceae44-d65e-4156-9359-d390f93ee9a0' <NEW_LINE> __wsmap__ = 'managed' <NEW_LINE> @property <NEW_LINE> def name(self): <NEW_LINE> <INDENT> ret = self._get_attr("name") <NEW_LINE> return ret <NEW_LINE> <DEDENT> @property <NEW_LINE> def path(self): <...
Represents one of host's video capture devices, for example a webcam.
625990738e7ae83300eea9a7
class ThumbnailBackend(object): <NEW_LINE> <INDENT> default_options = { 'format': settings.THUMBNAIL_FORMAT, 'quality': settings.THUMBNAIL_QUALITY, 'colorspace': settings.THUMBNAIL_COLORSPACE, 'upscale': settings.THUMBNAIL_UPSCALE, 'crop': False, } <NEW_LINE> extra_options = ( ('progressive', 'THUMBNAIL_PROGRESSIVE'), ...
The main class for sorl-thumbnail, you can subclass this if you for example want to change the way destination filename is generated.
62599073d268445f2663a7e8
class EventListener(EventListenerBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.sock = None <NEW_LINE> self.ip_address = None <NEW_LINE> self.port = None <NEW_LINE> self.runner = None <NEW_LINE> self.site = None <NEW_LINE> self.session = None <NEW_LINE> self.start_...
The Event Listener. Runs an http server which is an endpoint for ``NOTIFY`` requests from Sonos devices. Inherits from `soco.events_base.EventListenerBase`.
625990731f5feb6acb164509
class ControlTool(Tool): <NEW_LINE> <INDENT> def __init__(self, name, model): <NEW_LINE> <INDENT> super(ControlTool, self).__init__(name, model) <NEW_LINE> <DEDENT> def canDraw(self): <NEW_LINE> <INDENT> return False
ControlTool abstract class. This class defines tools able to do some sort of control.
62599073442bda511e95d9e2
class DeviceBackendTestCase(TestCase): <NEW_LINE> <INDENT> def test_mds_backend(self): <NEW_LINE> <INDENT> device = Device.objects.create(name='test_mds_device', description='Test MDS Device', data_backend='mds') <NEW_LINE> device.full_clean() <NEW_LINE> <DEDENT> def test_h1_backend(self): <NEW_LINE> <INDENT> device = ...
Make sure we can create a device for each backend.
6259907399cbb53fe6832800
class KNearestNeighbor(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def train(self, X, y): <NEW_LINE> <INDENT> self.X_train = X <NEW_LINE> self.y_train = y <NEW_LINE> <DEDENT> def predict(self, X, k=1, num_loops=0): <NEW_LINE> <INDENT> if num_loops == 0: <NEW_LINE> <INDE...
a kNN classifier with L2 distance
62599073009cb60464d02e50
class InNode(Node): <NEW_LINE> <INDENT> def __init__(self, world): <NEW_LINE> <INDENT> super().__init__(world) <NEW_LINE> self.nchannels = world.nchannels <NEW_LINE> self.w_out = [] <NEW_LINE> for i in range(self.nchannels): <NEW_LINE> <INDENT> self.w_out.append(OutWire(self, world.buf_len)) <NEW_LINE> <DEDENT> self.w_...
in_wires: - w_level : controlRate out_wires: - w_out : list, audioRate
625990735166f23b2e244ceb
class gwo_test_case(_ut.TestCase): <NEW_LINE> <INDENT> def runTest(self): <NEW_LINE> <INDENT> from .core import gwo, algorithm <NEW_LINE> from pickle import loads, dumps <NEW_LINE> uda = gwo() <NEW_LINE> uda = gwo(gen=1000, seed=5) <NEW_LINE> self.assertEqual(uda.get_seed(), 5) <NEW_LINE> a = algorithm(uda) <NEW_LINE> ...
Test case for the UDA gwo
625990734527f215b58eb62b
class LinterFailure(Exception): <NEW_LINE> <INDENT> def __init__(self, message, repl): <NEW_LINE> <INDENT> super(LinterFailure, self).__init__() <NEW_LINE> self.message = message <NEW_LINE> self.replacement = repl <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str("{0}".format(self.message))
Exception raised when the linter reports a message.
625990734f88993c371f11ac
class NellaUser: <NEW_LINE> <INDENT> username = "" <NEW_LINE> email = "" <NEW_LINE> def __init__(self, username, email): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.email = email <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "<NellaUser [\"%s\", \"%s\"]>" % (self.username, self.ema...
Represents TKL user Attributes: email (str): User email address username (str): Username
62599073ec188e330fdfa1bb
class InstanceElement(use_metaclass(cache.CachedMetaClass)): <NEW_LINE> <INDENT> def __init__(self, instance, var, is_class_var=False): <NEW_LINE> <INDENT> if isinstance(var, parsing.Function): <NEW_LINE> <INDENT> var = Function(var) <NEW_LINE> <DEDENT> elif isinstance(var, parsing.Class): <NEW_LINE> <INDENT> var = Cla...
InstanceElement is a wrapper for any object, that is used as an instance variable (e.g. self.variable or class methods).
625990734a966d76dd5f0801
class Commit(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> SYNCHRONOUS_COMMIT = "SYNCHRONOUS_COMMIT" <NEW_LINE> ASYNCHRONOUS_COMMIT = "ASYNCHRONOUS_COMMIT"
Replica commit mode in availability group.
62599073fff4ab517ebcf132
class ChillTouch(Spell): <NEW_LINE> <INDENT> name = "Chill Touch" <NEW_LINE> level = 0 <NEW_LINE> casting_time = "1 action" <NEW_LINE> casting_range = "120 feet" <NEW_LINE> components = ('V', 'S') <NEW_LINE> materials = "" <NEW_LINE> duration = "1 round" <NEW_LINE> magic_school = "Necromancy" <NEW_LINE> classes = ('Sor...
You create a ghostly, skeletal hand in the space of a creature within range. Make a ranged spell attack including spell attack bonus, against the creature to assail it with the chill of the grave. On a hit, the target takes 1d8 necrotic damage, and it can't regain hit points until the start of your next turn. Until the...
625990738e7ae83300eea9a8
class OperationDisplay(Model): <NEW_LINE> <INDENT> _validation = { 'provider': {'readonly': True}, 'resource': {'readonly': True}, 'operation': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'provider': {'key': 'provider', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'str'}, 'operation': {'key': 'operat...
The object that represents the operation. Variables are only populated by the server, and will be ignored when sending a request. :ivar provider: Service provider: Microsoft.Cdn :vartype provider: str :ivar resource: Resource on which the operation is performed: Profile, endpoint, etc. :vartype resource: str :ivar o...
625990731b99ca40022901c1
class rotateZy(bpy.types.Operator): <NEW_LINE> <INDENT> bl_label = "Zy 45°" <NEW_LINE> bl_idname = "mesh.face_rotate_zy45" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> bpy.ops.mesh.rot_con(axis='2', caxis='1', rdeg=45) <NEW_LINE> return {"FINISHED"}
rotate selected face > Zy 45°
6259907376e4537e8c3f0e96
class TopologyMutexFormula(ActivationOutcomesFormula): <NEW_LINE> <INDENT> def __init__(self, ts): <NEW_LINE> <INDENT> super(TopologyMutexFormula, self).__init__(sys_props = [], outcomes = ['completed'], ts = ts) <NEW_LINE> self.formulas = self.gen_mutex_formulas(self.env_props, future = True) <NEW_LINE> self.type = 'e...
Generate environment assumptions/constraints that enforce mutual exclusion between the topology propositions; Eq. (1) The transition system TS, is provided in the form of a dictionary.
625990738e7ae83300eea9a9
class CircularOrientedPathway(OrientedPathway): <NEW_LINE> <INDENT> def __init__(self, start, stop, normal, angle): <NEW_LINE> <INDENT> self._normal = direction(normal) <NEW_LINE> self._angle = angle <NEW_LINE> delta = stop.position - start.position <NEW_LINE> midpoint = (stop.position + start.position) / 2 <NEW_LINE> ...
Special case of OrientedPathway along a circular arc.
62599073627d3e7fe0e087a0
class RandomNavigator: <NEW_LINE> <INDENT> def __init__(self, seq): <NEW_LINE> <INDENT> self.seq = seq <NEW_LINE> self.last = None <NEW_LINE> self.current = random.choice(self.seq) <NEW_LINE> <DEDENT> def move_next(self): <NEW_LINE> <INDENT> self.last = self.current <NEW_LINE> self.current = random.choice(self.seq) <NE...
Navigates over a sequence in a random fashion, ensuring no consecutive repetition.
625990734428ac0f6e659e4c
class CreateFolderResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Token(self): <NEW_LINE> <INDENT> return self._output.get('Token', None) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output...
A ResultSet with methods tailored to the values returned by the CreateFolder Choreo. The ResultSet object is used to retrieve the results of a Choreo execution.
62599073b7558d5895464bbf
class AdSchedule(models.Model): <NEW_LINE> <INDENT> name = models.CharField(blank=True, max_length=255) <NEW_LINE> description = models.TextField(blank=True) <NEW_LINE> deleted = models.BooleanField(default=False) <NEW_LINE> date_start = models.DateTimeField(help_text="Date/Time Ad Schedule Should Begin To Appear In Fe...
Ad Schedules Control What Ads Get Inserted Where For A Title.
6259907321bff66bcd724580
class TestArrayToIndexDeprecation(TestCase): <NEW_LINE> <INDENT> def test_array_to_index_error(self): <NEW_LINE> <INDENT> a = np.array([[[1]]]) <NEW_LINE> assert_raises(TypeError, operator.index, np.array([1])) <NEW_LINE> assert_raises(TypeError, np.reshape, a, (a, -1)) <NEW_LINE> assert_raises(TypeError, np.take, a, [...
Creating an an index from array not 0-D is an error.
6259907360cbc95b063659f9
class AcreditadoraAutoComplete(autocomplete.Select2QuerySetView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> queryset = Ieu.objects.all() <NEW_LINE> if self.q: <NEW_LINE> <INDENT> queryset = queryset.filter(ieu_acreditadora_edit_icontains=self.q) <NEW_LINE> <DEDENT> return queryset
AutoComplete para filtrar listado del modelo Acreditadora.
6259907399cbb53fe6832802
class LIFOQueue(FIFOQueue): <NEW_LINE> <INDENT> def pop(self): <NEW_LINE> <INDENT> return self.nodes.pop() <NEW_LINE> <DEDENT> def __iter__(self): <NEW_LINE> <INDENT> return reversed(self.nodes)
A last-in-first-out queue. Used to get depth first search behavior. >>> lifo = LIFOQueue() >>> lifo.push(0) >>> lifo.push(1) >>> lifo.push(2) >>> list(lifo) [2, 1, 0] >>> print(lifo.pop()) 2 >>> print(lifo.pop()) 1 >>> print(lifo.pop()) 0
6259907326068e7796d4e255
class DocsView(APIView): <NEW_LINE> <INDENT> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> apidocs = {'products': request.build_absolute_uri('product/'), 'categories': request.build_absolute_uri('category/'), 'providers': request.build_absolute_uri('provider/'), 'user creation': request.build_absolute_ur...
RESTFul Documentation of my app
62599073ad47b63b2c5a9167
class BaseApiTestCase(TestCaseMixin, APITestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> APITestCase.setUp(self) <NEW_LINE> TestCaseMixin.setUp(self) <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> TestCaseMixin.tearDown(self) <NEW_LINE> APITestCase.tearDown(self)
Base Django rest framework api test case class
62599073ec188e330fdfa1bd
class Control(Point): <NEW_LINE> <INDENT> def __init__(self, point, number): <NEW_LINE> <INDENT> super().__init__(point.lat, point.lon) <NEW_LINE> self.number = number <NEW_LINE> <DEDENT> def getNumber(self): <NEW_LINE> <INDENT> return self.number <NEW_LINE> <DEDENT> def getScore(self): <NEW_LINE> <INDENT> return 10 * ...
A Point with a control number.
625990734f6381625f19a136
class Message: <NEW_LINE> <INDENT> def __init__(self, t: str, *args): <NEW_LINE> <INDENT> self.t = t <NEW_LINE> self.args = args
Helper class describing an IPC message.
6259907355399d3f05627e31
class nodeStatistics(): <NEW_LINE> <INDENT> def __init__(self, nodename): <NEW_LINE> <INDENT> self.nodename = nodename <NEW_LINE> self.node_mppdb_cpu_busy_time = None <NEW_LINE> self.node_host_cpu_busy_time = None <NEW_LINE> self.node_host_cpu_total_time = None <NEW_LINE> self.node_mppdb_cpu_time_in_busy_time = None <N...
Class for stating node message
62599073baa26c4b54d50bc7
class ReaderGroupDataType(FrozenClass): <NEW_LINE> <INDENT> ua_types = [ ('Name', 'String'), ('Enabled', 'Boolean'), ('SecurityMode', 'MessageSecurityMode'), ('SecurityGroupId', 'String'), ('SecurityKeyServices', 'ListOfEndpointDescription'), ('MaxNetworkMessageSize', 'UInt32'), ('GroupProperties', 'ListOfKeyValuePair'...
:ivar Name: :vartype Name: String :ivar Enabled: :vartype Enabled: Boolean :ivar SecurityMode: :vartype SecurityMode: MessageSecurityMode :ivar SecurityGroupId: :vartype SecurityGroupId: String :ivar SecurityKeyServices: :vartype SecurityKeyServices: EndpointDescription :ivar MaxNetworkMessageSize: :vartype MaxNetworkM...
625990737b25080760ed8971
class Rectangle: <NEW_LINE> <INDENT> def __init__(self, p1: Point, p2: Point): <NEW_LINE> <INDENT> self.p1: Point = p1 <NEW_LINE> self.p2: Point = p2 <NEW_LINE> <DEDENT> def left(self) -> int: <NEW_LINE> <INDENT> return min(self.p1.x, self.p2.x) <NEW_LINE> <DEDENT> def right(self) -> int: <NEW_LINE> <INDENT> return max...
Represents an axis-aligned rectangle in 2D integer Cartesian coordinates.
62599073009cb60464d02e54
class ApplicationGatewayBackendHealthHttpSettings(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } <NEW_LINE> d...
Application gateway BackendHealthHttp settings. :param backend_http_settings: Reference of an ApplicationGatewayBackendHttpSettings resource. :type backend_http_settings: ~azure.mgmt.network.v2019_08_01.models.ApplicationGatewayBackendHttpSettings :param servers: List of ApplicationGatewayBackendHealthServer resource...
625990735fcc89381b266de5
class SingleBookFactory(BaseBookFactory): <NEW_LINE> <INDENT> id = 999999 <NEW_LINE> title = "Performance optimisation" <NEW_LINE> publisher = SubFactory('factories.books_publisher.SinglePublisherFactory') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> django_get_or_create = ('id',) <NEW_LINE> <DEDENT> @post_generation <NE...
Book factory, but limited to a single book.
62599073d486a94d0ba2d8d3
class ActiveDirectoryUPNException(Exception): <NEW_LINE> <INDENT> pass
Raised in case the user's login credentials cannot be mapped to a UPN
62599073fff4ab517ebcf135
class RegexValidator(Validator): <NEW_LINE> <INDENT> default_error_messages = { 'invalid': 'This value does not match the required pattern.' } <NEW_LINE> def __init__(self, regex, error_messages=None): <NEW_LINE> <INDENT> super().__init__(error_messages) <NEW_LINE> self.regex = regex <NEW_LINE> <DEDENT> def __call__(se...
Validator which succeeds if the `value` matches with the regex. :param regex: The regular expression string to use. Can also be a compiled regular expression pattern. :param dict error_messages: The error messages for various kinds of errors.
625990733317a56b869bf1d2
class EfergySensor(EfergyEntity, SensorEntity): <NEW_LINE> <INDENT> def __init__( self, api: Efergy, description: SensorEntityDescription, server_unique_id: str, period: str | None = None, currency: str | None = None, sid: str = "", ) -> None: <NEW_LINE> <INDENT> super().__init__(api, server_unique_id) <NEW_LINE> self....
Implementation of an Efergy sensor.
625990734f88993c371f11ae
class magento_website(orm.Model): <NEW_LINE> <INDENT> _inherit = 'magento.website' <NEW_LINE> _columns = { 'import_pricelist_from_date':fields.datetime( 'Import Pricelist from date' ), } <NEW_LINE> def _get_store_view_ids(self, cr, uid, website, context=None): <NEW_LINE> <INDENT> stores = website.store_ids or [] <NEW_L...
Inherit magento website
62599073167d2b6e312b821d
class HttpNotFound(HttpException): <NEW_LINE> <INDENT> def __init__(self, uri): <NEW_LINE> <INDENT> HttpException.__init__(self, 404, "Not found\n\n'%s'" % uri)
Error "404: Not found" default exception handler.
6259907399cbb53fe6832805
class LicensesModifiedEvent(ObjectModifiedEvent): <NEW_LINE> <INDENT> implements(ILicensesModifiedEvent) <NEW_LINE> def __init__(self, product, user=None): <NEW_LINE> <INDENT> super(LicensesModifiedEvent, self).__init__( product, product, [], user)
See `ILicensesModifiedEvent`.
6259907376e4537e8c3f0e9a
class EditPostHandler(Handler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> post = PostData.get_by_id(int(re.escape(post_id))) <NEW_LINE> if self.user: <NEW_LINE> <INDENT> if post.creator == self.user: <NEW_LINE> <INDENT> self.render("edit.html", post=post, registered_user=self.user) <NEW_LINE> <DED...
Edit posts
62599073e5267d203ee6d04b
class AnyBICIdentifier (pyxb.binding.datatypes.string): <NEW_LINE> <INDENT> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'AnyBICIdentifier') <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/home/toivotuo/Dropbox/Personal/Studies/UoH/tlbop/tapestry/tapestry/router/xsd/rocs.001.001.06.xsd', 7, 2) <NEW_LI...
An atomic simple type.
6259907397e22403b383c81f
class InvalidToken(Exception): <NEW_LINE> <INDENT> pass
Raised if token is token is invalid.
62599073a17c0f6771d5d839
class StandardDaterange(AbstractDaterange): <NEW_LINE> <INDENT> def __init__(self, params, parsing=True): <NEW_LINE> <INDENT> super(StandardDaterange, self).__init__(params, parsing=parsing) <NEW_LINE> self.other = params['other'] <NEW_LINE> if 'timeranges' in params: <NEW_LINE> <INDENT> self.timeranges = [Timerange(pa...
StandardDaterange is for standard entry (weekday - weekday)
6259907321bff66bcd724584
class ProgramEntryPoint(EntryPointConstruct): <NEW_LINE> <INDENT> def type(self): <NEW_LINE> <INDENT> return 'program'
Represents a Gobstones program block
625990737d43ff24874280a1
class QueryParameterBase(QueryParameter): <NEW_LINE> <INDENT> def __str__(self) -> str: <NEW_LINE> <INDENT> return self._widget_item_name <NEW_LINE> <DEDENT> def get_modified_objects( self, unused_my_objects: types.MyObjectSet ) -> types.MyObjectSet: <NEW_LINE> <INDENT> new_objects = self._get_widget_item_objects() <NE...
Base parameter. Can only be added to a QueryParameters in first position. A QueryParameterBase doesn't modify an existing set of objects but instead serves as the base, the first parameter.
62599073ad47b63b2c5a916b
class Batch(object): <NEW_LINE> <INDENT> def __init__(self, record_def, records, check_datatype=True): <NEW_LINE> <INDENT> if check_datatype: <NEW_LINE> <INDENT> map(lambda r: Record._chk_type(record_def, r), records) <NEW_LINE> <DEDENT> self._rdef = record_def <NEW_LINE> self._records = records <NEW_LINE>...
Set of records
625990737047854f46340cd5
class LedgerIdentityInformation(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'ledger_id': {'readonly': True}, 'ledger_tls_certificate': {'required': True}, } <NEW_LINE> _attribute_map = { 'ledger_id': {'key': 'ledgerId', 'type': 'str'}, 'ledger_tls_certificate': {'key': 'ledgerTlsCertificate', 'type...
Contains the information about a Confidential Ledger. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to Azure. :ivar ledger_id: Id for the ledger. :vartype ledger_id: str :param ledger_tls_certificate: Required. PEM-e...
625990737b180e01f3e49cf3
class AssTweetUrl(TableMixin, Base): <NEW_LINE> <INDENT> tweet_id = Column(Integer, ForeignKey( 'tweet.id', ondelete='CASCADE', onupdate='CASCADE')) <NEW_LINE> url_id = Column(Integer, ForeignKey( 'url.id', ondelete='CASCADE', onupdate='CASCADE')) <NEW_LINE> __table_args__ = (UniqueConstraint( 'tweet_id', 'url_id', nam...
Association table to connect table `tweet` and `url`.
62599073aad79263cf4300d4
class EndpointTestCase(AsyncHTTPTestCase): <NEW_LINE> <INDENT> def get_app(self): <NEW_LINE> <INDENT> self.app = app = make_app(debug=False) <NEW_LINE> app.db = MagicMock() <NEW_LINE> return app <NEW_LINE> <DEDENT> def _get_secure_cookie(self, cookie_name, cookie_value): <NEW_LINE> <INDENT> cookie_name, cookie_value = ...
Endpoint TestCase a base test case used for testing endpoints
62599073e5267d203ee6d04c
class Together(Builtin): <NEW_LINE> <INDENT> attributes = ['Listable'] <NEW_LINE> def apply(self, expr, evaluation): <NEW_LINE> <INDENT> expr_sympy = expr.to_sympy() <NEW_LINE> result = sympy.together(expr_sympy) <NEW_LINE> result = from_sympy(result) <NEW_LINE> result = cancel(result) <NEW_LINE> return result
<dl> <dt>'Together[$expr$]' <dd>writes sums of fractions in $expr$ together. </dl> >> Together[a / c + b / c] = (a + b) / c 'Together' operates on lists: >> Together[{x / (y+1) + x / (y+1)^2}] = {x (2 + y) / (1 + y) ^ 2} But it does not touch other functions: >> Together[f[a / c + b / c]] = f[a / c + b / c] #>...
625990734428ac0f6e659e4f
class MetadataNotFound(Exception): <NEW_LINE> <INDENT> user_id = None <NEW_LINE> data_key = None
Particualr user metadata entry was not found.
625990731f5feb6acb164511
class Database: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.url = 'https://bookstore-5217.restdb.io' <NEW_LINE> self.collection = '/rest/books' <NEW_LINE> self.headers = { 'content-type': 'application/json', 'x-apikey': '5e5f9cf028222370f14d4ece', 'cache-control': 'no-cache', } <NEW_LINE> <DEDENT> ...
A class containing methods needed for communication with database. ... Attributes ---------- url : str database address collection : str name of collection in database headers : dict dictionary containing information send with request to database
62599073b7558d5895464bc2
class Command(ProjectCommand): <NEW_LINE> <INDENT> help = "Create all databases for a new project." <NEW_LINE> option_list = ProjectCommand.option_list + ( make_option("--perftest_host", action="store", dest="perftest_host", default=None, help="The host name for the perftest database"), make_option("--objectstore_host"...
Management command to create all databases for a new project. This extends ProjectCommandBase rather than ProjectBatchCommandBase because the latter handles not just the cron_batch param, but also looping. This mgmt command is not about looping, it's about a single project, and about adding that project to a single c...
625990735fc7496912d48ef8
class log(Elementwise): <NEW_LINE> <INDENT> def __init__(self, x): <NEW_LINE> <INDENT> super(log, self).__init__(x) <NEW_LINE> <DEDENT> @Elementwise.numpy_numeric <NEW_LINE> def numeric(self, values): <NEW_LINE> <INDENT> return np.log(values[0]) <NEW_LINE> <DEDENT> def sign_from_args(self): <NEW_LINE> <INDENT> return (...
Elementwise :math:`\log x`.
6259907323849d37ff8529d5
class ClaimItem(backboneelement.BackboneElement): <NEW_LINE> <INDENT> resource_name = "ClaimItem" <NEW_LINE> def __init__(self, jsondict=None): <NEW_LINE> <INDENT> self.bodySite = None <NEW_LINE> self.detail = None <NEW_LINE> self.diagnosisLinkId = None <NEW_LINE> self.factor = None <NEW_LINE> self.modifier = None <NEW...
Goods and Services. First tier of goods and services.
625990737d43ff24874280a2
class ClassNode: <NEW_LINE> <INDENT> def __init__(self, name, parent_node, type_sort): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.parent_node = parent_node <NEW_LINE> self.children = [] <NEW_LINE> self.type_sort = type_sort <NEW_LINE> <DEDENT> def find(self, name): <NEW_LINE> <INDENT> if name == self.name: <N...
Class representing a node in a tree where each node represents a class, and has references to the base class and subclasses.
625990735166f23b2e244cf3
class Cell(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> return
This class will be a encapsulate future functionality for table cells
62599073adb09d7d5dc0be89
class Affine(snt.Linear): <NEW_LINE> <INDENT> def __init__(self, n_output, transfer=default_activation, initializers=None, transfer_based_init=False): <NEW_LINE> <INDENT> if initializers is None: <NEW_LINE> <INDENT> initializers = default_init <NEW_LINE> <DEDENT> if transfer_based_init and 'w' not in initializers: <NEW...
Layer implementing an affine non-linear transformation
625990733346ee7daa3382ef
class Fellow(Person): <NEW_LINE> <INDENT> def __init__(self, first_name, second_name, wants_accommodation, office_name=None, livingspace_name=None, is_allocated=False): <NEW_LINE> <INDENT> super(Fellow, self).__init__(first_name, second_name, office_name, is_allocated) <NEW_LINE> self.wants_accommodation = wants_accomm...
Fellow class that inherits from Person but includes data for accommodation
625990735fdd1c0f98e5f89d
class Addr(common.Addr): <NEW_LINE> <INDENT> def __init__(self, host, port, ssl, default): <NEW_LINE> <INDENT> super(Addr, self).__init__((host, port)) <NEW_LINE> self.ssl = ssl <NEW_LINE> self.default = default <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def fromstring(cls, str_addr): <NEW_LINE> <INDENT> parts = str_a...
Represents an Nginx address, i.e. what comes after the 'listen' directive. According to the `documentation`_, this may be address[:port], port, or unix:path. The latter is ignored here. The default value if no directive is specified is \*:80 (superuser) or \*:8000 (otherwise). If no port is specified, the default is ...
6259907316aa5153ce401df8
class BaseDigest(object): <NEW_LINE> <INDENT> def __init__(self, wall_time, locator): <NEW_LINE> <INDENT> self._wall_time = wall_time <NEW_LINE> self._locator = locator <NEW_LINE> <DEDENT> @property <NEW_LINE> def wall_time(self): <NEW_LINE> <INDENT> return self._wall_time <NEW_LINE> <DEDENT> @property <NEW_LINE> def l...
Base class for digest. Properties: wall_time: A timestamp for the digest as a `float` (unit: s). locator: A datum that allows tracng the digest to its original location. It can be either of the two: 1. Bytes offset from the beginning of the file as a single integer, for the case of all digests of ...
62599073435de62698e9d726
class ReceiverArray(object): <NEW_LINE> <INDENT> def __init__(self, quantities=None, last_value_only=False, filename=None): <NEW_LINE> <INDENT> self.quantities = quantities if quantities else ["pressure"] <NEW_LINE> self.last_value_only = last_value_only <NEW_LINE> self.filename = filename <NEW_LINE> <DEDENT> def shape...
Receiver array.
62599073a8370b77170f1cea
class Params(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.params =[] <NEW_LINE> <DEDENT> def init_param(self, size, scale=.01, mode='n', name=''): <NEW_LINE> <INDENT> if mode == 'normal' or mode == 'n': <NEW_LINE> <INDENT> param = theano.shared(value=scale*self.numpy_rng.normal( size=size)....
Base class: Params
62599073097d151d1a2c2992
class _Node(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.host = None <NEW_LINE> self.port = None <NEW_LINE> self.iface= None
Object representing node details.
62599073796e427e53850098
class Messenger: <NEW_LINE> <INDENT> def __init__(self, domain): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.domain = domain <NEW_LINE> import logging <NEW_LINE> self.logger = logging.getLogger(__name__) <NEW_LINE> <DEDENT> def add_info_to_req(self, request, message): <NEW_LINE> <INDENT> messages.add_message...
Simpole wrapper for the django messages
62599073cc0a2c111447c760
class NoContextBranchListingView(BranchListingView): <NEW_LINE> <INDENT> field_names = ['lifecycle'] <NEW_LINE> no_sort_by = (BranchListingSort.DEFAULT, ) <NEW_LINE> no_branch_message = ( 'There are no branches that match the current status filter.') <NEW_LINE> extra_columns = ('author', 'product', 'date_created') <NEW...
A branch listing that has no associated product or person.
625990737047854f46340cd7
class Translator: <NEW_LINE> <INDENT> def __init__(self, document_markup): <NEW_LINE> <INDENT> self.document_markup = document_markup
The translator is the core algorithm of ScriptTex. It takes a document markup object and an input and produces whatever is defined in the markup.
625990738e7ae83300eea9b0
class HTTPApiKeyAuth(AuthBase): <NEW_LINE> <INDENT> def __init__(self, username, key): <NEW_LINE> <INDENT> self._username = username <NEW_LINE> self._key = key <NEW_LINE> <DEDENT> def __call__(self, req): <NEW_LINE> <INDENT> req.headers['Authorization'] = 'ApiKey {0}:{1}'.format(self._username, self._key) <NEW_LINE> re...
Use TastyPie's ApiKey authentication when communicating with the API.
6259907497e22403b383c823
class RegistrationFormNoFreeEmail(RegistrationForm): <NEW_LINE> <INDENT> bad_domains = ['aim.com', 'aol.com', 'email.com', 'gmail.com', 'googlemail.com', 'hotmail.com', 'hushmail.com', 'msn.com', 'mail.ru', 'mailinator.com', 'live.com'] <NEW_LINE> def clean_email(self): <NEW_LINE> <INDENT> email_domain = self.cleaned_d...
Subclass of ``RegistrationForm`` which disallows registration with email addresses from popular free webmail services; moderately useful for preventing automated spam registrations. To change the list of banned domains, subclass this form and override the attribute ``bad_domains``.
6259907471ff763f4b5e90c9
class EnhancedTextWidget(forms.MultiWidget): <NEW_LINE> <INDENT> def __init__(self, textareaattrs={'class': 'enhanced_text'}, selectattrs={'class' : 'enhanced_text_format',}, initial=None): <NEW_LINE> <INDENT> self.initial=initial <NEW_LINE> widgets = (forms.Textarea(attrs=textareaattrs), forms.Select(attrs=selectattrs...
A multi-widget for the EnhancedTextFormField that renders a Textarea and a select widget for choosing the format of the Textarea.
6259907492d797404e3897eb
class XML2DF(): <NEW_LINE> <INDENT> def __init__(self, xml_path): <NEW_LINE> <INDENT> self.root = ET.parse(xml_path) <NEW_LINE> <DEDENT> def find_data(self): <NEW_LINE> <INDENT> income = self.root.find('income') <NEW_LINE> return income
Converts XML file to pandas dataframe. Adapted from http://austintaylor.io/lxml/python/pandas/xml/dataframe/2016/07/08/convert-xml-to-pandas-dataframe/.
62599074379a373c97d9a940