code
stringlengths
4
4.48k
docstring
stringlengths
1
6.45k
_id
stringlengths
24
24
class TaskManager(ResultManager): <NEW_LINE> <INDENT> @transaction_retry(max_retries=1) <NEW_LINE> def get_task(self, task_id): <NEW_LINE> <INDENT> task, created = self.get_or_create(task_id=task_id) <NEW_LINE> return task <NEW_LINE> <DEDENT> def is_successful(self, task_id): <NEW_LINE> <INDENT> return self.get_task(ta...
Manager for :class:`celery.models.Task` models.
62598ef4ff9c53063f518eb9
class Period(AbstractTimeStampedModel): <NEW_LINE> <INDENT> scenario = models.ForeignKey( 'Scenario', related_name='periods', on_delete=models.CASCADE, ) <NEW_LINE> order = models.IntegerField(default=0, db_index=True) <NEW_LINE> data = JSONField(default=dict, blank=True) <NEW_LINE> class Meta(object): <NEW_LINE> <INDE...
Period model
62598ef43d592f4c4edb9745
@color_utils.pixel_source <NEW_LINE> class Plaid(color_utils.PixelGenerator): <NEW_LINE> <INDENT> def __init__(self, layout): <NEW_LINE> <INDENT> super().__init__(layout) <NEW_LINE> <DEDENT> def pixel_color(self, t, ii): <NEW_LINE> <INDENT> x, y, z = self._layout[ii] <NEW_LINE> r = color_utils.cos(x + y + z, offset=t /...
Plaid generator.
62598ef4f548e778e5969de5
class PySweeperUI: <NEW_LINE> <INDENT> def __init__(self, rows: int, columns: int, mines: int) -> None: <NEW_LINE> <INDENT> self.board = Board(rows, columns, mines) <NEW_LINE> self.columns = [ urwid.Columns( TileWidget( tile=tile, position=position, on_left_click=self.on_left_click, on_right_click=self.on_right_click, ...
The urwid based UI class for PySweeper.
62598ef47b180e01f3e48472
class Product: <NEW_LINE> <INDENT> YES = 'yes' <NEW_LINE> NO = 'no' <NEW_LINE> NONE = '-' <NEW_LINE> def __init__(self, asin='-', image='-', link='-', price='-', prime=NO, rating='-', reviews='-', sponsored=NO, title='-'): <NEW_LINE> <INDENT> self.asin = asin <NEW_LINE> self.image = image <NEW_LINE> self.link = link <N...
A class representing an Amazon Product structure
62598ef45fdd1c0f98e5c7fb
class FakeParser(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.arguments = [] <NEW_LINE> <DEDENT> def add_argument(self, name, *unused_args, **kwargs): <NEW_LINE> <INDENT> positional = not name.startswith("-") <NEW_LINE> while name.startswith("-"): <NEW_LINE> <INDENT> name = name[1:] <NEW_LI...
Fake parser used to reflect on Replugins' arguments.
62598ef4a8370b77170eec3d
class Opaque(Node): <NEW_LINE> <INDENT> def __init__(self, children): <NEW_LINE> <INDENT> super().__init__('opaque', children, None) <NEW_LINE> self.id = children[0] <NEW_LINE> self.name = self.id.name <NEW_LINE> self.line = self.id.line <NEW_LINE> self.file = self.id.file <NEW_LINE> if len(children) == 3: <NEW_LINE> <...
Node for an OPENQASM opaque gate declaration. children[0] is an id node. If len(children) is 3, children[1] is an expressionlist node, and children[2] is an idlist node. Otherwise, children[1] is an idlist node.
62598ef432920d7e50bc4886
class ProductoViewSet(viewsets.ReadOnlyModelViewSet): <NEW_LINE> <INDENT> queryset = Producto.objects.all().order_by('-creado') <NEW_LINE> serializer_class = ProductoSerializer
API endpoint that allows users to be viewed or edited.
62598ef45fc7496912d4769f
class ForgeGitApp(RepositoryApp): <NEW_LINE> <INDENT> __version__ = version.__version__ <NEW_LINE> tool_label='Git' <NEW_LINE> ordinal=2 <NEW_LINE> forkable=True <NEW_LINE> default_branch_name='ref/master' <NEW_LINE> def __init__(self, project, config): <NEW_LINE> <INDENT> super(ForgeGitApp, self).__init__(project, con...
This is the Git app for PyForge
62598ef4a219f33f346c5087
class PeristalticPumpControl(Controller): <NEW_LINE> <INDENT> DOSE_INTERVAL = 60 * 60 * 4 <NEW_LINE> def __init__(self, config): <NEW_LINE> <INDENT> self.component = components.Peristaltic(config['pin'], config['wiringpi']) <NEW_LINE> Controller.__init__(self, config) <NEW_LINE> self.totalofday = 0 <NEW_LINE> self.reco...
Controls a peristaltic pump over time.
62598ef4be383301e0252035
class UserBinSource(object): <NEW_LINE> <INDENT> def __new__(cls, regSpec, binSpec, genome=None, categoryFilterList=None, strictMatch=True, includeExtraChrs = False): <NEW_LINE> <INDENT> if regSpec in ['file', 'track'] + getSupportedFileSuffixesForBinning(): <NEW_LINE> <INDENT> assert genome is not None <NEW_LINE> from...
Possible definitions of UserBinSource, based on (regSpec,binSpec)-tuple: ('file',fn) where instead of 'file', a more specific filetype such as 'bed' could be specified (chrReg,binSize) where chrReg is a Region specification as in UCSC Genome browser (string), or '*' to denote whole genome, and where binSize is a number...
62598ef4236d856c2adc8844
class InvalidPathException(PathException): <NEW_LINE> <INDENT> pass
Path contains a structural problem
62598ef456ac1b37e6300a46
class ApprovalForm2(forms.ModelForm): <NEW_LINE> <INDENT> mental = forms.ModelChoiceField(queryset=MentalModel.objects.all(), widget=forms.HiddenInput()) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = ApprovalModel <NEW_LINE> fields = ('mental', 'hospital','period','foodallow','savetimes','savecontinue',...
申批表
62598ef4f548e778e5969de6
class Muparser(Package): <NEW_LINE> <INDENT> homepage = "http://muparser.beltoforion.de/" <NEW_LINE> url = "https://github.com/beltoforion/muparser/archive/v2.2.5.tar.gz" <NEW_LINE> version('2.2.5', '02dae671aa5ad955fdcbcd3fee313fb7') <NEW_LINE> def install(self, spec, prefix): <NEW_LINE> <INDENT> options = ['--di...
C++ math expression parser library.
62598ef4adb09d7d5dc08e1a
class ReviewByUserIdResource(Resource): <NEW_LINE> <INDENT> @api_validation <NEW_LINE> @marshal_with(review_fields) <NEW_LINE> def get(self, id): <NEW_LINE> <INDENT> user = session.query(User).filter(User.id == id).first() <NEW_LINE> if not user: <NEW_LINE> <INDENT> abort(400, message="User with id={} doesn't exist".fo...
Class for handling the GET "/user/<int:id>/review" GET is used to get the reviews for a User model, given a User id
62598ef4d268445f26638fbc
class AnalysisDisplayColoredSurfaceSettings(object, IDisposable): <NEW_LINE> <INDENT> def Dispose(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def IsEqual(self, other): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def ReleaseUnmanagedResources(self, *args): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __ente...
Contains colored surface settings for analysis display style element. AnalysisDisplayColoredSurfaceSettings() AnalysisDisplayColoredSurfaceSettings(other: AnalysisDisplayColoredSurfaceSettings)
62598ef401c39578d7f115fd
class PayInvoiceAsk(ModelView): <NEW_LINE> <INDENT> __name__ = 'account.invoice.pay.ask' <NEW_LINE> type = fields.Selection([ ('writeoff', 'Write-Off'), ('partial', 'Partial Payment'), ], 'Type', required=True) <NEW_LINE> journal_writeoff = fields.Many2One('account.journal', 'Write-Off Journal', domain=[ ('type', '=', ...
Pay Invoice
62598ef4cc40096d61619605
class BUS(IComponent): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.REGISTERED_COMPONENT = set() <NEW_LINE> self.reset() <NEW_LINE> <DEDENT> def reset(self): <NEW_LINE> <INDENT> self.ADDR = 0 <NEW_LINE> self.DATA = 0 <NEW_LINE> self.waiting(True) <NEW_LINE> <DEDENT> def register(self, *components): ...
BUS, FOR COMMUNICATION
62598ef4dc8b845886d51e20
class ShortcutBlock(HybridBlock): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, bn_use_global_stats, **kwargs): <NEW_LINE> <INDENT> super(ShortcutBlock, self).__init__(**kwargs) <NEW_LINE> with self.name_scope(): <NEW_LINE> <INDENT> self.conv1 = conv3x3_block( in_channels=in_channels, out_channels=i...
ESPNetv2 shortcut block. Parameters: ---------- in_channels : int Number of input channels. out_channels : int Number of output channels. bn_use_global_stats : bool Whether global moving statistics is used instead of local batch-norm for BatchNorm layers.
62598ef4bd1bec0571e144f8
class AssemblyLegend(object): <NEW_LINE> <INDENT> def legend_artist(self, legend, orig_handle, fontsize, handlebox): <NEW_LINE> <INDENT> letter, index = orig_handle <NEW_LINE> x0, y0 = handlebox.xdescent, handlebox.ydescent <NEW_LINE> width, height = handlebox.width, handlebox.height <NEW_LINE> x = x0 + width / 2.0 <NE...
Custom Legend artist handler. Matplotlib allows you to define a class that implements ``legend_artist`` to give you full control over how the legend keys and labels are drawn. This is done here to get Hexagons with Letters in them on the legend, which is not a built-in legend option. See: http://matplotlib.org/users/...
62598ef4bf627c535bcafccb
class TeXLoader(BaseLoader): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = path <NEW_LINE> <DEDENT> def get_source(self, environment, template): <NEW_LINE> <INDENT> path = join(self.path, template) <NEW_LINE> if not exists(path): <NEW_LINE> <INDENT> raise TemplateNotFound(template) <NEW_...
This environment loader allows us to readily customize the Jinja2 BaseLoader class for our purposes
62598ef456ac1b37e6300a47
class EmptyMonitor(ScalyrMonitor): <NEW_LINE> <INDENT> def run(self, run_time=0.5): <NEW_LINE> <INDENT> time.sleep(run_time) <NEW_LINE> self._run_state.stop()
Monitor class which is running for run_time seconds.
62598ef4be7bc26dc9251290
class MealSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> restaurant = RestaurantSerializer(many=False) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Meal <NEW_LINE> fields = ('id', 'name', 'restaurant', 'user_rating', 'avg_rating')
JSON serializer for meals
62598ef457b8e32f52507531
class TMNT(): <NEW_LINE> <INDENT> def choose_me(self): <NEW_LINE> <INDENT> auto.keyDown("right") <NEW_LINE> time.sleep(0.3) <NEW_LINE> auto.keyUp("right") <NEW_LINE> time.sleep(0.5) <NEW_LINE> auto.keyDown("right") <NEW_LINE> time.sleep(0.3) <NEW_LINE> auto.keyUp("right") <NEW_LINE> time.sleep(0.5) <NEW_LINE> auto.keyD...
Classe para o personagem TMNT.
62598ef430bbd72246468490
class FoldedCase(str): <NEW_LINE> <INDENT> def __lt__(self, other): <NEW_LINE> <INDENT> return self.lower() < other.lower() <NEW_LINE> <DEDENT> def __gt__(self, other): <NEW_LINE> <INDENT> return self.lower() > other.lower() <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self.lower() == other.l...
A case insensitive string class; behaves just like str except compares equal when the only variation is case. >>> s = FoldedCase('hello world') >>> s == 'Hello World' True >>> 'Hello World' == s True >>> s.index('O') 4 >>> s.split('O') ['hell', ' w', 'rld'] >>> names = map(FoldedCase, ['GAMMA', 'alpha', 'Beta']) >...
62598ef492d797404e387fa9
class Corr(MyImage): <NEW_LINE> <INDENT> def find_peak(self, msize = 5): <NEW_LINE> <INDENT> best = (0,0,0) <NEW_LINE> for x in range(self.data.shape[0] - msize): <NEW_LINE> <INDENT> for y in range(self.data.shape[1] - msize): <NEW_LINE> <INDENT> s = 0 <NEW_LINE> for i in range(msize): <NEW_LINE> <INDENT> for j in rang...
This class provide additional methods in case the picture is a correlation picture.
62598ef4236d856c2adc8845
class HttpMoved(HttpMove): <NEW_LINE> <INDENT> code = 301 <NEW_LINE> title = 'Moved Permanently'
HTTP 301.
62598ef456ac1b37e6300a48
class WindowController(QObject): <NEW_LINE> <INDENT> activated = pyqtSignal() <NEW_LINE> def __init__(self, w_window:QMainWindow) -> None: <NEW_LINE> <INDENT> super().__init__(w_window) <NEW_LINE> self._w_window = w_window <NEW_LINE> w_window.installEventFilter(self) <NEW_LINE> <DEDENT> def eventFilter(self, _, event:Q...
Wrapper class with methods for manipulating the main window.
62598ef497e22403b383974a
class Fieldset(object): <NEW_LINE> <INDENT> def __init__(self, form, name, boundfields, legend='', classes='', description=''): <NEW_LINE> <INDENT> self.form = form <NEW_LINE> self.boundfields = boundfields <NEW_LINE> if legend is None: legend = name <NEW_LINE> self.legend = mark_safe(legend) <NEW_LINE> self.classes = ...
An iterable Fieldset with a legend and a set of BoundFields.
62598ef455399d3f05624d82
class ADataStoreManager(object): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> @abstractmethod <NEW_LINE> def exist(self, hashKey): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def set(self, path, data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def get(...
Abstract class for managing stored data in the form: path:value
62598ef47c178a314d78bcf4
class MySlave(Slave): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(MySlave, self).__init__() <NEW_LINE> <DEDENT> def do_work(self, data): <NEW_LINE> <INDENT> rank = MPI.COMM_WORLD.Get_rank() <NEW_LINE> name = MPI.Get_processor_name() <NEW_LINE> task, task_arg = data <NEW_LINE> print(' Slave %s ran...
A slave process extends Slave class, overrides the 'do_work' method and calls 'Slave.run'. The Master will do the rest
62598ef4adb09d7d5dc08e1b
class ImportFrom(stmt): <NEW_LINE> <INDENT> def init(self, module, names, level): <NEW_LINE> <INDENT> if module: <NEW_LINE> <INDENT> assert_str(module, 'module') <NEW_LINE> <DEDENT> assert_aliases(names, 'names') <NEW_LINE> if level: <NEW_LINE> <INDENT> assert_int(level, 'level') <NEW_LINE> <DEDENT> self.module = modul...
Import from statement. Inherits stmt. module : a string. Can be None. names : a list of alias nodes. level : an integer. Can be None.
62598ef44527f215b58e875c
class Node: <NEW_LINE> <INDENT> nodes = [] <NEW_LINE> def __init__(self, address, loop): <NEW_LINE> <INDENT> self.host, self.port = address <NEW_LINE> print ("node:%s:%s"%(self.host,self.port)) <NEW_LINE> self.cluster = set() <NEW_LINE> self.loop = loop <NEW_LINE> self.state = State(self) <NEW_LINE> self.requests = asy...
Raft Node (Server)
62598ef463d6d428bbee102b
class CephSocketpath(CephArgtype): <NEW_LINE> <INDENT> def valid(self, s, partial=False): <NEW_LINE> <INDENT> mode = os.stat(s).st_mode <NEW_LINE> if not stat.S_ISSOCK(mode): <NEW_LINE> <INDENT> raise ArgumentValid('socket path {0} is not a socket'.format(s)) <NEW_LINE> <DEDENT> self.val = s <NEW_LINE> <DEDENT> def __s...
Admin socket path; check that it's readable and S_ISSOCK
62598ef42c8b7c6e89bd201f
class PubsubProjectsTopicsTestIamPermissionsRequest(_messages.Message): <NEW_LINE> <INDENT> resource = _messages.StringField(1, required=True) <NEW_LINE> testIamPermissionsRequest = _messages.MessageField('TestIamPermissionsRequest', 2)
A PubsubProjectsTopicsTestIamPermissionsRequest object. Fields: resource: REQUIRED: The resource for which policy detail is being requested. Resource is usually specified as a path, such as, projects/{project}. testIamPermissionsRequest: A TestIamPermissionsRequest resource to be passed as the request ...
62598ef4009cb60464cffdac
class MovieCollection(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'moviecollection' <NEW_LINE> __table_args__ = {'extend_existing': True} <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> movie_id = db.Column(db.Integer, db.ForeignKey('movie.id')) <NEW_LINE> user_id = db.Column(db.Integer, db.Foreig...
电影收藏
62598ef4097d151d1a2bf87d
class Paginator(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> paginator = "%s -FRSX" % utils_path.find_command('less') <NEW_LINE> <DEDENT> except utils_path.CmdNotFoundError: <NEW_LINE> <INDENT> paginator = None <NEW_LINE> <DEDENT> paginator = os.environ.get('PAGER', pagi...
Paginator that uses less to display contents on the terminal. Contains cleanup handling for when user presses 'q' (to quit less).
62598ef4a05bb46b384890cf
class RequerimentGraphDetailView(TemplateViewProjectFilter): <NEW_LINE> <INDENT> template_name = 'requeriment/graph_detail.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(RequerimentGraphDetailView, self).get_context_data(**kwargs) <NEW_LINE> requeriment = RequerimentService.g...
#class:US014
62598ef44428ac0f6e656daa
class ConnectionAdapterServicer(object): <NEW_LINE> <INDENT> def Send(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 Close(self,...
The Broker side serivce. It provides a set of APIs to handle a protcol access
62598ef45fc7496912d476a1
class BackwardEulerMethodBuilder(SimpleButcherTableauMethodBuilder): <NEW_LINE> <INDENT> c = (0,) <NEW_LINE> a_explicit = ( (1,), ) <NEW_LINE> output_coeffs = (1,) <NEW_LINE> recycle_last_stage_coeff_set_names = ()
.. automethod:: __init__ .. automethod:: generate
62598ef467a9b606de54482b
@dataclass(frozen=True) <NEW_LINE> class CorosyncCannotAddRemoveLinksBadTransport(ReportItemMessage): <NEW_LINE> <INDENT> actual_transport: str <NEW_LINE> required_transports: List[str] <NEW_LINE> add_or_not_remove: bool <NEW_LINE> _code = codes.COROSYNC_CANNOT_ADD_REMOVE_LINKS_BAD_TRANSPORT <NEW_LINE> @property <NEW_L...
Cannot add or remove corosync links, used transport does not allow that actual_transport -- transport used in the cluster required_transports -- transports allowing links to be added / removed add_or_not_remove -- True for add, False for remove
62598ef430bbd72246468492
class ValidateStreamingService(Rule): <NEW_LINE> <INDENT> priority = 32 <NEW_LINE> consequence = RemoveMatch <NEW_LINE> def when(self, matches, context): <NEW_LINE> <INDENT> to_remove = [] <NEW_LINE> for service in matches.named('streaming_service'): <NEW_LINE> <INDENT> next_match = matches.next(service, lambda match: ...
Validate streaming service matches.
62598ef4379a373c97d97855
class ChangeMixin(YAMLRoot): <NEW_LINE> <INDENT> _inherited_slots: ClassVar[List[str]] = [] <NEW_LINE> class_class_uri: ClassVar[URIRef] = KGCL.ChangeMixin <NEW_LINE> class_class_curie: ClassVar[str] = "kgcl:ChangeMixin" <NEW_LINE> class_name: ClassVar[str] = "change mixin" <NEW_LINE> class_model_uri: ClassVar[URIRef] ...
root class for all change mixins
62598ef4956e5f7376df4aa7
class Participant(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> event_id = db.Column(db.Integer, db.ForeignKey("event.id")) <NEW_LINE> event = db.relationship("Event") <NEW_LINE> name = db.Column(db.Text) <NEW_LINE> timeslots = db.relationship("Timeslot") <NEW_LINE> is_admin = d...
Database model for participants
62598ef41f5feb6acb1614b1
class CValueSet(ValueSet): <NEW_LINE> <INDENT> cond = "is_callable" <NEW_LINE> def matches(self, other): <NEW_LINE> <INDENT> super().matches(other) <NEW_LINE> if not self.value: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> for key, value in self.value: <NEW_LINE> <INDENT> if key not in other.keyset: <NEW_LINE> <...
Valueset evaluable for Callable facttypes
62598ef4d7e4931a7ef3a8f9
class CopiedFailure(failure.Failure, copyable.RemoteCopyOldStyle): <NEW_LINE> <INDENT> nonCyclic = True <NEW_LINE> stateSchema = FailureConstraint() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> copyable.RemoteCopyOldStyle.__init__(self) <NEW_LINE> <DEDENT> def __getstate__(self): <NEW_LINE> <INDENT> s = failure.F...
I am a shadow of some remote Failure instance. I contain less information than the original did. You can still extract a (brief) printable traceback from me. My .parents attribute is a list of strings describing the class of the exception that I contain, just like the real Failure had, so my trap() and check() methods...
62598ef466673b3332c2ec09
class Deck(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.deck = deque() <NEW_LINE> <DEDENT> def shuffle(self): <NEW_LINE> <INDENT> random.shuffle(self.deck) <NEW_LINE> <DEDENT> def cut(self, cut_size): <NEW_LINE> <INDENT> self.deck.rotate(cut_size) <NEW_LINE> <DEDENT> def deal_n_cards(self, ...
Contains common deck methods.
62598ef44527f215b58e875d
class IdentifiedObjectList(StrPropertyList): <NEW_LINE> <INDENT> @property <NEW_LINE> def property_name(self): <NEW_LINE> <INDENT> return 'identification' <NEW_LINE> <DEDENT> def modify_key(self, key): <NEW_LINE> <INDENT> return remove_whitespace(key)
A list of objects indexable with an integer or object's identification. It provides support for a list of objects that have an ``identification`` attribute or property that can be indexed with an integer or object's identification. For example, consider a ``Variable`` class with an ``identification`` attribute: .. c...
62598ef44c34283577618b44
class SearchStockReport(View): <NEW_LINE> <INDENT> def post(self, request): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> json_data = request.body <NEW_LINE> data = json.loads(json_data) <NEW_LINE> <DEDENT> except Exception: <NEW_LINE> <INDENT> return JsonError("解析失败") <NEW_LINE> <DEDENT> if not data: <NEW_LINE> <INDENT...
库存查询
62598ef4097d151d1a2bf87f
class PublicCertificateLocation(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)): <NEW_LINE> <INDENT> CURRENT_USER_MY = "CurrentUserMy" <NEW_LINE> LOCAL_MACHINE_MY = "LocalMachineMy" <NEW_LINE> UNKNOWN = "Unknown"
Public Certificate Location
62598ef456ac1b37e6300a4b
class DescribeAssetListRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Params = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.Params = params.get("Params")
DescribeAssetList请求参数结构体
62598ef4e1aae11d1e7cdc70
class Cluster(object): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.hostname = socket.gethostname() <NEW_LINE> self.nodes = cfg['nodes'] <NEW_LINE> self.ppn = cfg['ppn'] <NEW_LINE> self.free_nodes = self.nodes
Represents the computing cluster available.
62598ef4460517430c430ce7
class MongoDoc(object): <NEW_LINE> <INDENT> def __init__(s, collection='', data=None): <NEW_LINE> <INDENT> s.collection = collection <NEW_LINE> s.data = data <NEW_LINE> <DEDENT> def store(s): <NEW_LINE> <INDENT> s.data['insert_time'] = datetime.now() <NEW_LINE> Mdb[s.collection].insert_one(s.data) <NEW_LINE> <DEDENT> d...
base class representing record obj to be stored, compared, or updated into a MongoDB collection. classes that inherit specify type of info and target collection
62598ef4be7bc26dc9251292
class Fertilizer(): <NEW_LINE> <INDENT> def __init__(self, FertName, FertData): <NEW_LINE> <INDENT> self.name = FertName <NEW_LINE> self.appYear = FertData['Year'] <NEW_LINE> self.appDay = FertData['JDay'] <NEW_LINE> self.fertPMass = FertData['PMass'] <NEW_LINE> self.depth = FertData['Depth'] <NEW_LINE> self.percentOnS...
Description: An instance of this class represents a particular fertilizer and the date of its application.
62598ef4adb09d7d5dc08e1e
class PseudoPartialWaveWfsMover: <NEW_LINE> <INDENT> description = 'Improved wavefunction reuse through dual PAW basis' <NEW_LINE> def initialize(self, lcaowfs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def cut_wfs(self, wfs, spos_ac): <NEW_LINE> <INDENT> ni_a = {} <NEW_LINE> for a in range(len(wfs.setups)): <NEW_L...
Move wavefunctions with atoms according to PAW basis Wavefunctions are approximated around atom a as ~ -- ~ a ~a ~ psi (r) ~ > phi (r) < p | psi > n -- i i n ai This quantity is then subtracted and re-added at the new positions.
62598ef4bd1bec0571e144fa
class RNNCell(tf.nn.rnn_cell.RNNCell): <NEW_LINE> <INDENT> def __init__(self, input_size, state_size): <NEW_LINE> <INDENT> self.input_size = input_size <NEW_LINE> self._state_size = state_size <NEW_LINE> <DEDENT> @property <NEW_LINE> def state_size(self): <NEW_LINE> <INDENT> return self._state_size <NEW_LINE> <DEDENT> ...
Wrapper around our RNN cell implementation that allows us to play nicely with TensorFlow.
62598ef45166f23b2e241c38
class ApplicationGatewayBackendHealthHttpSettings(Model): <NEW_LINE> <INDENT> _attribute_map = { 'backend_http_settings': {'key': 'backendHttpSettings', 'type': 'ApplicationGatewayBackendHttpSettings'}, 'servers': {'key': 'servers', 'type': '[ApplicationGatewayBackendHealthServer]'}, } <NEW_LINE> def __init__(self, **k...
Application gateway BackendHealthHttp settings. :param backend_http_settings: Reference of an ApplicationGatewayBackendHttpSettings resource. :type backend_http_settings: ~azure.mgmt.network.v2018_08_01.models.ApplicationGatewayBackendHttpSettings :param servers: List of ApplicationGatewayBackendHealthServer resourc...
62598ef4f548e778e5969deb
class ComplexStructFactory(type): <NEW_LINE> <INDENT> pass
===================================================== | Providence/Clarity Structures: Complex Struct Factory | ===================================================== This class creates a modified dictionary at runtime out of an easily-definable OOP-based 'Struct' schema. The ComplexStruct class uses this as a factory f...
62598ef4ff9c53063f518ebf
class MockFTPServer: <NEW_LINE> <INDENT> server = None <NEW_LINE> running = False <NEW_LINE> def start_ftp_server(self, conf): <NEW_LINE> <INDENT> authorizer = DummyAuthorizer() <NEW_LINE> address = (conf.host, conf.port) <NEW_LINE> authorizer.add_user('admin', 'abc@123', '.', perm='elradfmwM') <NEW_LINE> authorizer.ad...
Mock the foscam ftp folder structure
62598ef463b5f9789fe839be
class CPreProcessor(object): <NEW_LINE> <INDENT> Error = CPreProcessorError <NEW_LINE> def __init__(self, includes=None, opts=None, bin="cpp", verbose=0): <NEW_LINE> <INDENT> self.includes = ["."] <NEW_LINE> if includes is not None: <NEW_LINE> <INDENT> self.includes = includes <NEW_LINE> <DEDENT> self.opts = ["-DHAVE_C...
Pre-process source code with ANSI CPP.
62598ef4a219f33f346c508d
class SyslogUDPHandler(socketserver.BaseRequestHandler): <NEW_LINE> <INDENT> def handle(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> data = bytes.decode(self.request[0].strip(), encoding="utf-8") <NEW_LINE> <DEDENT> except UnicodeError: <NEW_LINE> <INDENT> data = 'unkown packet contents' <NEW_LINE> <DEDENT> prin...
The actual core of the script, this listens on the socket.
62598ef43539df3088ecab0b
class DatasetPermissions(Model): <NEW_LINE> <INDENT> manage: List[EncodedDatabaseIdField] = Field( [], title="Management", description="The set of roles (encoded IDs) that can manage this dataset.", ) <NEW_LINE> access: List[EncodedDatabaseIdField] = Field( [], title="Access", description="The set of roles (encoded IDs...
Role-based permissions for accessing and managing a dataset.
62598ef4236d856c2adc8847
class Esquema(EntidadPadre): <NEW_LINE> <INDENT> __tablename__ = "esquema" <NEW_LINE> __mapper_args__ = {'polymorphic_identity': 'esquema'} <NEW_LINE> _id = Column(Integer, ForeignKey('entidad_padre._id'), primary_key=True) <NEW_LINE> _nombre = Column(String, nullable=False) <NEW_LINE> _descripcion = Column(String, nul...
Crea una la tabla esquema con - _nombre: nombre del esquema - _descripcion : descripcion del esquema - _etiqueta: etiqueda del esquema - _color: color para identificar al esquema - _fase_id: relacion con la fase sobre la que se crea el esquema
62598ef42c8b7c6e89bd2022
class RejectedTakeoff(FlightPhaseNode): <NEW_LINE> <INDENT> def derive(self, accel_lon=P('Acceleration Longitudinal Offset Removed'), groundeds=S('Grounded')): <NEW_LINE> <INDENT> accel_lon_smoothed = moving_average(accel_lon.array) <NEW_LINE> accel_lon_masked = np.ma.copy(accel_lon_smoothed) <NEW_LINE> accel_lon_maske...
Rejected Takeoff based on Acceleration Longitudinal Offset Removed exceeding the TAKEOFF_ACCELERATION_THRESHOLD and not being followed by a liftoff.
62598ef48e7ae83300ee78e9
class PositionalEncoding(nn.Module): <NEW_LINE> <INDENT> def __init__(self, size: int = 0, max_len: int = 5000): <NEW_LINE> <INDENT> if size % 2 != 0: <NEW_LINE> <INDENT> raise ValueError(f"Cannot use sin/cos positional encoding with " f"odd dim (got dim={size})") <NEW_LINE> <DEDENT> pe = torch.zeros(max_len, size) <NE...
Pre-compute position encodings (PE). In forward pass, this adds the position-encodings to the input for as many time steps as necessary. Implementation based on OpenNMT-py. https://github.com/OpenNMT/OpenNMT-py
62598ef4379a373c97d97857
class TestIDF(object): <NEW_LINE> <INDENT> def test_removeidfobject(self): <NEW_LINE> <INDENT> idftxt = "" <NEW_LINE> idfhandle = StringIO(idftxt) <NEW_LINE> idf = IDF(idfhandle) <NEW_LINE> key = "BUILDING" <NEW_LINE> idf.newidfobject(key, Name="Building_remove") <NEW_LINE> idf.newidfobject(key, Name="Building1") <NEW_...
py.test for IDF function
62598ef4d268445f26638fbf
class ID3ParameterException(ID3Exception): <NEW_LINE> <INDENT> pass
Parameters are missing or malformed
62598ef4f9cc0f698b1c46ff
class TracedCompactNode(object): <NEW_LINE> <INDENT> compact_node = None <NEW_LINE> simulation = None <NEW_LINE> traced_attributes_name = None <NEW_LINE> def __init__(self, compact_node, simulation, traced_attributes_name): <NEW_LINE> <INDENT> self.compact_node = compact_node <NEW_LINE> self.simulation = simulation <NE...
A proxy for CompactNode which stores the a simulation instance. Used for simulations with trace mode enabled. Overload __delitem__, __getitem__ and __setitem__ even if __getattribute__ is defined because of: http://stackoverflow.com/questions/11360020/why-is-getattribute-not-invoked-on-an-implicit-getitem-invocation
62598ef41f5feb6acb1614b3
class AppPath(): <NEW_LINE> <INDENT> def new(cls): <NEW_LINE> <INDENT> if not hasattr(cls, 'instance'): <NEW_LINE> <INDENT> cls.instance = super(Singleton, cls).__new__(cls) <NEW_LINE> return cls.instance <NEW_LINE> <DEDENT> <DEDENT> def main(self): <NEW_LINE> <INDENT> if platform.system() == "Linux": <NEW_LINE> <INDE...
Singleton class for set windows location parameters
62598ef44527f215b58e8760
class StoppingTaskBaseTestCase(TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.D = 6 <NEW_LINE> self.Lower, self.Upper = [2, 1, 1], [10, 10, 2] <NEW_LINE> self.task = StoppingTask(Lower=self.Lower, Upper=self.Upper, D=self.D) <NEW_LINE> <DEDENT> def test_dim_ok(self): <NEW_LINE> <INDENT> self.a...
Test case for testing `Task`, `StoppingTask` and `CountingTask` classes. Date: April 2019 Author: Klemen Berkovič See Also: * :class:`NiaPy.util.Task` * :class:`NiaPy.util.CountingTask` * :class:`NiaPy.util.StoppingTask`
62598ef466656f66f7d58c43
class ChatSessionMessageView(APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticated,) <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> uri = kwargs['uri'] <NEW_LINE> chat_session = ChatSession.objects.get(uri=uri) <NEW_LINE> messages = [chat_session_message.to_json() for ...
Create/Get Chat session messages.
62598ef42c8b7c6e89bd2023
class SnippetViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Snippet.objects.all() <NEW_LINE> serializer_class = SnippetSerializer <NEW_LINE> permission_classes = (permissions.IsAuthenticatedOrReadOnly,IsOwnerOrReadOnly,) <NEW_LINE> @detail_route(renderer_classes=[renderers.StaticHTMLRenderer ]) <NEW_LIN...
This viewset automatically provides `list`, `create`, `retri eve`, `update` and `destroy` actions. Additionally we also provide an extra `highlight` action.
62598ef432920d7e50bc488d
class o(): <NEW_LINE> <INDENT> def __init__(i, **fields): <NEW_LINE> <INDENT> i.override(fields) <NEW_LINE> <DEDENT> def override(i, d): i.__dict__.update(d); return i <NEW_LINE> def __repr__(i): <NEW_LINE> <INDENT> d = i.__dict__ <NEW_LINE> name = i.__class__.__name__ <NEW_LINE> return name + '{' + ' '.join([':%s %s' ...
Anonymous container
62598ef47047854f4633dc28
class ArqueacaoVolume(models.Model): <NEW_LINE> <INDENT> altura_em_cm = models.PositiveIntegerField(verbose_name='Altura do liquido combustivel em cm') <NEW_LINE> volume = models.DecimalField(max_digits=10, decimal_places=2) <NEW_LINE> tanque = models.ForeignKey('Tanque', related_name='registros_volume_arqueadura') <NE...
Descreve a relacao entre a `altura_em_cm` e o `volume` do liquido combustivel dentro de um deterninado tanque. Basicamente eh uma relacao chave:valor, onde a chave eh `altura_em_cm` e o valor `volume`. Os dados necessarios para ArqueacaoVolume, são descritos na "Tabela Fisica Volumetrica" especifica para o tanque, Est...
62598ef4e1aae11d1e7cdc71
class FlinkApplicationConfiguration(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "CheckpointConfiguration": (CheckpointConfiguration, False), "MonitoringConfiguration": (MonitoringConfiguration, False), "ParallelismConfiguration": (ParallelismConfiguration, False), }
`FlinkApplicationConfiguration <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-kinesisanalyticsv2-application-flinkapplicationconfiguration.html>`__
62598ef423849d37ff84f91d
class Pool: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> @asyncio.coroutine <NEW_LINE> def create(cls, host='localhost', port=6379, *, password=None, db=0, encoder=None, poolsize=1, auto_reconnect=True, loop=None, protocol_class=RedisProtocol): <NEW_LINE> <INDENT> self = cls() <NEW_LINE> self._host = host <NEW_LINE> sel...
Pool of connections. Each Takes care of setting up the connection and connection pooling. When poolsize > 1 and some connections are in use because of transactions or blocking requests, the other are preferred. :: pool = yield from Pool.create(host='localhost', port=6379, poolsize=10) result = yield from con...
62598ef44a966d76dd5ed73b
class StyleByTypeListView(StyleListView): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> qs = super().get_queryset() <NEW_LINE> style_type = self.kwargs['style_type'] <NEW_LINE> return qs.filter(style_type__name=style_type) <NEW_LINE> <DEDENT> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> c...
Display StyleListView filtered on style type
62598ef4be7bc26dc9251293
class HeapSortTests(unittest.TestCase): <NEW_LINE> <INDENT> max = 100 <NEW_LINE> arr = [] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.arr = random.sample(range(self.max), self.max) <NEW_LINE> <DEDENT> def test_null_input(self): <NEW_LINE> <INDENT> inp = None <NEW_LINE> with self.assertRaises(TypeError) as ex: ...
heap sort unit tests class
62598ef45166f23b2e241c3a
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
62598ef4167d2b6e312b57fb
class Tag(models.Model): <NEW_LINE> <INDENT> taxonomy = models.ForeignKey( Taxonomy, related_name='tags' ) <NEW_LINE> name = models.CharField( _('Name'), max_length=100 ) <NEW_LINE> slug = AutoSlugField( populate_from='name', unique=False ) <NEW_LINE> @models.permalink <NEW_LINE> def get_absolute_url(self): <NEW_LINE> ...
A tag with full unicode support.
62598ef4a219f33f346c508f
class LoginForm(Form): <NEW_LINE> <INDENT> username = fields.TextField(validators=[validators.required()]) <NEW_LINE> password = fields.PasswordField(validators=[validators.required()]) <NEW_LINE> def validate_password(self, field): <NEW_LINE> <INDENT> self.user = models.User.query.filter_by(username=self.username.data...
Login form with built in validation of password.
62598ef43539df3088ecab0d
class Square(Rectangle): <NEW_LINE> <INDENT> def __init__(self, a): <NEW_LINE> <INDENT> if a <= 0: <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> self.name = "Square" <NEW_LINE> self.a = a <NEW_LINE> self.b = self.a <NEW_LINE> self.area = a*a <NEW_LINE> self.perimeter = 4*a <NEW_LINE> <DEDENT> def __str__(sel...
This class inherits from Rectangle and creates a square object
62598ef467a9b606de544830
class Key(object): <NEW_LINE> <INDENT> def __init__(self, keydata=None, **kwargs): <NEW_LINE> <INDENT> self.kwargs = kwargs <NEW_LINE> self.__generate(keydata) <NEW_LINE> <DEDENT> def __generate(self, keydata): <NEW_LINE> <INDENT> if keydata: <NEW_LINE> <INDENT> if 'priv' in keydata: <NEW_LINE> <INDENT> self.priv = nac...
Used to manage high level nacl operations
62598ef4498bea3a75a56396
@dataclasses.dataclass <NEW_LINE> class SklearnTransformer(amicus.base.Quirk): <NEW_LINE> <INDENT> name: str = None <NEW_LINE> contents: Union[Callable, Type, object, str] = None <NEW_LINE> parameters: Union[Mapping[str, Any], base.Parameters] = base.Parameters() <NEW_LINE> iterations: Union[int, str] = 1 <NEW_LINE> mo...
Wrapper for a scikit-learn transformer. Args: name (str): designates the name of a class instance that is used for internal referencing throughout amicus. For example, if an amicus instance needs options from a Configuration instance, 'name' should match the appropriate section name in a...
62598ef4d58c6744b42db6e6
class NodeManager(object): <NEW_LINE> <INDENT> def get_node(self, node_id): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def start_posthook(self): <NEW_LINE> <INDENT> raise NotImplementedError()
Not implemented
62598ef421bff66bcd7214b8
class TaskDetailRob(APIView): <NEW_LINE> <INDENT> permission_classes = (permissions.IsAuthenticatedOrReadOnly,) <NEW_LINE> def get_task(self, project_id,task_id): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> project = get_object_or_404(Project, pk=project_id) <NEW_LINE> return project.task_set.get(id=task_id) <NEW_LINE...
Create, Update or delete a task instance.
62598ef4009cb60464cffdb2
class UserTestCase(BaseTestCase): <NEW_LINE> <INDENT> def test_registration(self): <NEW_LINE> <INDENT> response = self.client.post( '/api/v1/auth/register', data=json.dumps(dict( username='joe', password='123456' )), content_type='application/json' ) <NEW_LINE> data = json.loads(response.data.decode()) <NEW_LINE> self....
Test endpoints for users
62598ef4aad79263cf42d06f
class EspecialidadeAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ['nome'] <NEW_LINE> search_fields = ['nome']
Admin para o model Especialidade
62598ef47047854f4633dc2a
class ImporterPlugin(IndicoPlugin): <NEW_LINE> <INDENT> category = PluginCategory.importers <NEW_LINE> def init(self): <NEW_LINE> <INDENT> super(ImporterPlugin, self).init() <NEW_LINE> self.inject_js('importer_js', WPConfModifScheduleGraphic) <NEW_LINE> self.inject_css('importer_css', WPConfModifScheduleGraphic) <NEW_L...
Importer Extends Indico for other plugins to import data from external sources to the timetable.
62598ef45166f23b2e241c3c
class MockAlwaysFailCall(object): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.init_kwargs = kwargs <NEW_LINE> <DEDENT> def __call__(self, **kwargs): <NEW_LINE> <INDENT> issue = dict(self.init_kwargs) <NEW_LINE> issue.update(kwargs) <NEW_LINE> return issue
Unconditionally return an issue dictionary composed of all the keyword arguments of the constructor and the call.
62598ef4bf627c535bcafcd3
@_register_item_type('mvAppItemType::StyleWindow') <NEW_LINE> class StyleEditorWindow(Window): <NEW_LINE> <INDENT> def __init__(self, **config): <NEW_LINE> <INDENT> super().__init__(**config) <NEW_LINE> <DEDENT> def __setup_add_widget__(self, dpg_args) -> None: <NEW_LINE> <INDENT> dpgcore.add_style_window(self.id, **dp...
Developer tool, creates a window containing a GUI style editor..
62598ef4ff9c53063f518ec3
class User(ModelMixin, db.Model): <NEW_LINE> <INDENT> __tablename__ = "users" <NEW_LINE> user_session = db.Column(db.Integer, autoincrement=True, primary_key=True) <NEW_LINE> user_language = db.Column(db.String(2), nullable=True) <NEW_LINE> def __repr__(self): <NEW_LINE> <INDENT> return f'<session: {self.user_session} ...
user's session
62598ef499cbb53fe682f711
class ExperimentResource(MyTardisModelResource): <NEW_LINE> <INDENT> created_by = fields.ForeignKey(UserResource, 'created_by') <NEW_LINE> parameter_sets = fields.ToManyField( ExperimentParameterSetResource, 'experimentparameterset_set', related_name='experiment', full=True, null=True) <NEW_LINE> class Meta(MyTardisMod...
API for Experiments also creates a default ACL and allows ExperimentParameterSets to be read and written. TODO: catch duplicate schema submissions for parameter sets
62598ef47b180e01f3e48477
class GuideCategories(AbstractCategories): <NEW_LINE> <INDENT> def __init__(self, api, url): <NEW_LINE> <INDENT> super().__init__(api, url, 'guideCategories?')
Returns a list of categories that can be associated with YouTube channels
62598ef4adb09d7d5dc08e22
class chemical_product_analysis_model(osv.osv): <NEW_LINE> <INDENT> _name = 'product.product.analysis.model' <NEW_LINE> _inherit = 'product.product.analysis.model' <NEW_LINE> _columns = { 'analysis_line_ids':fields.one2many('product.product.analysis.line', 'model_id', 'Lines per element', required=False), }
Element that could belong to a category
62598ef456ac1b37e6300a50
class TopoLogical(object): <NEW_LINE> <INDENT> @check_G <NEW_LINE> def __init__(self, G): <NEW_LINE> <INDENT> self.orders = [] <NEW_LINE> cyclefinder = DirectedCycle(G) <NEW_LINE> if not cyclefinder.hasCycle(): <NEW_LINE> <INDENT> dfs = DepthFirstOrder(G) <NEW_LINE> self.orders = dfs.reversePost() <NEW_LINE> <DEDENT> e...
有向图中顶点拓扑排序
62598ef426068e7796d4b1c0
class SetAlias(Operation): <NEW_LINE> <INDENT> def __init__(self, parent, alias, target, noSet=False): <NEW_LINE> <INDENT> Operation.__init__(self, parent, pargs=alias, qargs=target) <NEW_LINE> self.alias = alias[0] <NEW_LINE> if noSet: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> self.alias.set_target(alias[1], targ...
Set an alias to refer to a quantum register
62598ef4a219f33f346c5092
class UpdateOwnProfile(permissions.BasePermission): <NEW_LINE> <INDENT> def has_object_permission(self, request, view, obj): <NEW_LINE> <INDENT> if request.method in permissions.SAFE_METHODS: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> return obj.id == request.user.id
Allow users to update their own profile
62598ef43539df3088ecab0f
class HashlibToolsTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_get_chunked_hash(self): <NEW_LINE> <INDENT> test_output = six.StringIO() <NEW_LINE> test_data = os.urandom(150000) <NEW_LINE> if not six.PY2: <NEW_LINE> <INDENT> test_data = six.text_type(test_data) <NEW_LINE> <DEDENT> test_output.write(test_da...
TestCase for HashlibTools
62598ef4be383301e025203f
class SortedPriorityQueue(PriorityQueueBase): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._data = PositionalList() <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self._data) <NEW_LINE> <DEDENT> def add(self, key, value): <NEW_LINE> <INDENT> new = self._Item(key, value) <NEW_L...
A min-oriented Priority Queue implementation using a sorted list.
62598ef401c39578d7f11606