code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class brick(object): <NEW_LINE> <INDENT> def __init__(self, position, width, height, file, side): <NEW_LINE> <INDENT> self.x = position[0] <NEW_LINE> self.y = position[1] <NEW_LINE> self.height = width <NEW_LINE> self.width = height <NEW_LINE> self.rectangle = pygame.Rect((position[0],position[1]),(self.width,self.heig... | a class that encompasses all of the bricks | 62598f5e76d4e153a661c1f8 |
class Cosine_Prior(Function1D, metaclass=FunctionMeta): <NEW_LINE> <INDENT> def _setup(self): <NEW_LINE> <INDENT> self._fixed_units = (astropy_units.dimensionless_unscaled,astropy_units.dimensionless_unscaled) <NEW_LINE> self._is_prior = True <NEW_LINE> <DEDENT> def _set_units(self, x_unit, y_unit): <NEW_LINE> <INDENT>... | description :
A function which is constant on the interval angular interval of cosine
latex : $\cos(x)$
parameters :
lower_bound :
desc : Lower bound for the interval
initial value : -90
min : -np.inf
max : np.inf
upper_bound :
desc : Upper bound for the interv... | 62598f5eac7a0e7691f71af8 |
class Frame: <NEW_LINE> <INDENT> vblank = 3 <NEW_LINE> hblank = 2 <NEW_LINE> def __init__(self, data): <NEW_LINE> <INDENT> self.data = data <NEW_LINE> <DEDENT> def gen_line(self, line, fval=1): <NEW_LINE> <INDENT> for i in range(self.hblank): <NEW_LINE> <INDENT> yield encode(line[0], fval=fval, lval=0, dval=0) <NEW_LIN... | Generate Camera Link 28 bit encoded words from a frame with
given data, vblank and hblank sizes. Handles encoding and insertion of
control bits. | 62598f5ed18da76e235b6c29 |
class UnsubscribeAction(Resource): <NEW_LINE> <INDENT> def put(self, customer_id): <NEW_LINE> <INDENT> customer = Customer.find(customer_id) <NEW_LINE> if not customer: <NEW_LINE> <INDENT> abort(status.HTTP_404_NOT_FOUND, "Customer with id '{}' was not found.".format(customer_id)) <NEW_LINE> <DEDENT> customer.subscribe... | Resource to Unsubscribe a Customer | 62598f5e6fece00bbaccaf7a |
class Lampada: <NEW_LINE> <INDENT> def __init__(self, voltagem: int, cor: int): <NEW_LINE> <INDENT> self.__voltagem = voltagem <NEW_LINE> self.__cor = cor <NEW_LINE> self.__ligada = False <NEW_LINE> <DEDENT> @property <NEW_LINE> def voltagem(self): <NEW_LINE> <INDENT> return self.__voltagem <NEW_LINE> <DEDENT> @propert... | Classe lâmpada. | 62598f5e91af0d3eaad393f0 |
class Integer(Numeric): <NEW_LINE> <INDENT> default = 0 <NEW_LINE> def __init__(self, field, config={}, pos=None): <NEW_LINE> <INDENT> Numeric.__init__(self, field, config, pos) <NEW_LINE> <DEDENT> def parse(self, value, config={}, pos=None): <NEW_LINE> <INDENT> mask = False <NEW_LINE> if isinstance(value, six.string_t... | The base class for all the integral datatypes. | 62598f5ed164cc6175820560 |
class MenuItems(ObjectCollectorMixin, RegistryInstallerMixin, ListCollector): <NEW_LINE> <INDENT> export_key = 'menu_items' <NEW_LINE> registry_class = MenuItemRegistry <NEW_LINE> ext_name = 'menu' | This collector collects menu items. | 62598f5e3eb6a72ae0389c2b |
class Encryption(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'key_vault_properties': {'key': 'keyVaultProperties', 'type': 'KeyVaultProperties'}, 'key_source': {'key': 'keySource', 'type': 'str'}, } <NEW_LINE> def __init__( self, *, key_vault_properties: Optional["KeyVaultProperties"] = None, ke... | Properties to configure Encryption.
:param key_vault_properties: Properties of KeyVault.
:type key_vault_properties: ~azure.mgmt.cognitiveservices.models.KeyVaultProperties
:param key_source: Enumerates the possible value of keySource for Encryption. Possible values
include: "Microsoft.CognitiveServices", "Microsoft.... | 62598f5e8c3a8732951f5b3b |
class cached_property(object): <NEW_LINE> <INDENT> def __init__(self, wrapped): <NEW_LINE> <INDENT> self.wrapped = wrapped <NEW_LINE> functools.update_wrapper(self, wrapped) <NEW_LINE> <DEDENT> def __get__(self, obj, type=None): <NEW_LINE> <INDENT> if obj is None: <NEW_LINE> <INDENT> return self <NEW_LINE> <DEDENT> ret... | Like @property but the function will only be called once per instance.
When used as a method decorator, this will act like @property but instead
of calling the function each time the attribute is accessed, instead it
will only call it on first access and then replace itself on the instance
with the return value of the... | 62598f5e6fece00bbaccaf7c |
class CreateTokenView(ObtainAuthToken): <NEW_LINE> <INDENT> serializer_class = AuthTokenSerializer <NEW_LINE> renderer_classes = api_settings.DEFAULT_RENDERER_CLASSES | Create a new auth token for user. | 62598f5e3eb6a72ae0389c2d |
class ResponseLowPower(ResponsePacket): <NEW_LINE> <INDENT> PACKET_TYPE_CHAR='L' <NEW_LINE> def __init__(self,time,packet_bytes): <NEW_LINE> <INDENT> ResponsePacket.__init__(self,time,packet_bytes) <NEW_LINE> self.enable_low_power=self._packet_bytes[2]>0 | Returns whether Low Power Mode is enabled or not.
The least significant bit of the Enable byte is 1 for Low Power Mode
or 0 for normal mode. | 62598f5e507cdc57c63a4388 |
class add_tally(tally): <NEW_LINE> <INDENT> pass | Add column with tally of items in each group
Similar to :class:`tally`, but it adds a column and does
not collapse the groups.
Parameters
----------
data : dataframe, optional
Useful when not using the ``>>`` operator.
weights : str or array-like, optional
Weight of each row in the group.
sort : bool, optiona... | 62598f5eac7a0e7691f71afc |
class Exp_Replay(): <NEW_LINE> <INDENT> def __init__(self, num, s_dim): <NEW_LINE> <INDENT> self.pointer = -1 <NEW_LINE> self.size = num <NEW_LINE> self.length = 0 <NEW_LINE> self.s = np.zeros([num] + s_dim) <NEW_LINE> self.a = np.zeros(num,dtype = int) <NEW_LINE> self.r = np.zeros(num) <NEW_LINE> self.s1 = np.zeros([n... | self.size: The size of the experience replay
self.length: Occupied space
self.s: Current state
self.a: Action executed
self.r: Reward Received
self.s1: Next state
self.i: is Terminal? | 62598f5ebe8e80087fbbe644 |
class Sigmoid(function.Function): <NEW_LINE> <INDENT> def __init__(self, use_cudnn=True): <NEW_LINE> <INDENT> self.use_cudnn = use_cudnn <NEW_LINE> <DEDENT> def check_type_forward(self, in_types): <NEW_LINE> <INDENT> type_check.expect(in_types.size() == 1) <NEW_LINE> type_check.expect(in_types[0].dtype.kind == 'f') <NE... | Logistic sigmoid function. | 62598f5e167d2b6e312b6569 |
class Dataspaces(AutotoolsPackage): <NEW_LINE> <INDENT> homepage = "http://www.dataspaces.org" <NEW_LINE> url = "http://personal.cac.rutgers.edu/TASSL/projects/data/downloads/dataspaces-1.6.2.tar.gz" <NEW_LINE> git = "https://github.com/melrom/dataspaces.git" <NEW_LINE> version('develop', branch='master') <NE... | an extreme scale data management framework. | 62598f5e3eb6a72ae0389c2f |
class PuddlePlugin(Plugin): <NEW_LINE> <INDENT> id = "puddle.puddle_plugin" <NEW_LINE> name = "Puddle" <NEW_LINE> VIEWS = "enthought.envisage.ui.workbench.views" <NEW_LINE> PERSPECTIVES = "enthought.envisage.ui.workbench.perspectives" <NEW_LINE> ACTION_SETS = "enthought.envisage.ui.workbench.action_sets" <NEW_LINE> my_... | Overridden actions and preferences pages.
| 62598f5e6fece00bbaccaf7f |
@docstr.get_sections(base='EffectiveDiffusivitySettings', sections=['Parameters']) <NEW_LINE> @docstr.dedent <NEW_LINE> class EffectiveDiffusivitySettings: <NEW_LINE> <INDENT> prefix = 'edif' <NEW_LINE> inlet = 'left' <NEW_LINE> outlet = 'right' <NEW_LINE> area = None <NEW_LINE> length = None | Defines the settings for EffectiveDiffusivity
----------
prefix : str
The default prefix to use when generating a name
inlet : str
The pore labels for diffusion inlet.
outlet : str
The pore labels for diffusion outlet.
area : scalar
The cross sectional area of the network relative to the inlet and outl... | 62598f5e76d4e153a661c1fe |
class Bigeminy(Cardiac_Rhythm): <NEW_LINE> <INDENT> pass | This class represents a bigeminy rhythm | 62598f5eff9c53063f519c3d |
class EditArticleView(LoginRequiredMixin, AuthorRequiredMixin, UpdateView): <NEW_LINE> <INDENT> model = Article <NEW_LINE> message = "您的文章编辑成功!" <NEW_LINE> form_class = ArticleForm <NEW_LINE> template_name = 'articles/article_update.html' <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> form.instance.user = s... | edit article | 62598f5e4d74a7450cd589cf |
class NetLogoException(Exception): <NEW_LINE> <INDENT> pass | Basic project exception
| 62598f5fd164cc6175820565 |
class CustomUserLoginForm(user_forms.AuthenticationForm, forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = CustomUser <NEW_LINE> fields = ("username", "password") <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> for fie... | Форма для авторизации | 62598f5f3eb6a72ae0389c31 |
class TestingCreating(TestCase): <NEW_LINE> <INDENT> def test_offer(cls): <NEW_LINE> <INDENT> TestOffer.objects.create(price=12) <NEW_LINE> TestOffer.objects.create(price=13, name='Offer', description="OfferDescription") <NEW_LINE> <DEDENT> def test_offer_page(cls): <NEW_LINE> <INDENT> TestOfferPage.objects.create(slug... | В тесте проверятеся, может ли миксин создаваться,
нет ли ошибок при создании | 62598f5f6fece00bbaccaf81 |
class TextNode(str, Node): <NEW_LINE> <INDENT> def __new__(cls, text: str) -> "TextNode": <NEW_LINE> <INDENT> s = str.__new__(cls, text) <NEW_LINE> s.parent = None <NEW_LINE> return s <NEW_LINE> <DEDENT> def __init__(self, text: str) -> None: <NEW_LINE> <INDENT> Node.__init__(self) <NEW_LINE> <DEDENT> def __repr__(self... | Represents a text node.
Subclasses :class:`Node` and :class:`str`. | 62598f5f76d4e153a661c200 |
class Range: <NEW_LINE> <INDENT> def __init__(self, start, stop=None, step=1): <NEW_LINE> <INDENT> if step == 0: <NEW_LINE> <INDENT> raise ValueError('step cannot be 0') <NEW_LINE> <DEDENT> if stop is None: <NEW_LINE> <INDENT> start, stop = 0, start <NEW_LINE> <DEDENT> self._length = max(0, (stop - start + step - 1) //... | A class that mimic's the built-in range class. | 62598f5f507cdc57c63a438c |
class KeyGen(object): <NEW_LINE> <INDENT> def __init__(self, prefix): <NEW_LINE> <INDENT> self.prefix = prefix <NEW_LINE> <DEDENT> def random_generator(self): <NEW_LINE> <INDENT> return self.gen_key(str(uuid4())) <NEW_LINE> <DEDENT> def gen_table_key(self, table, db='default'): <NEW_LINE> <INDENT> table = unicode(table... | This class is responsible for generating keys. | 62598f5f4d74a7450cd589d0 |
class Z_Normalization(NormalizationMethod): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Z_Normalization, self).__init__() <NEW_LINE> <DEDENT> def normalize(self, image): <NEW_LINE> <INDENT> image = super().normalize(image) <NEW_LINE> mean_ = np.mean(image.flatten()) <NEW_LINE> std_ = np.std(image.... | Normalize to zero mean and unit variance | 62598f5fbf627c535bcb0a6e |
class CircuitNode: <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name | super class | 62598f5f0383005118f6ccf7 |
class CMFAdding(Implicit, ContentAdding): <NEW_LINE> <INDENT> id = '+' <NEW_LINE> def add(self, content): <NEW_LINE> <INDENT> content = super(CMFAdding, self).add(content) <NEW_LINE> getToolByName(content, 'portal_types') <NEW_LINE> return content <NEW_LINE> <DEDENT> def nextURL(self): <NEW_LINE> <INDENT> return "%s/%s... | An adding view with a less silly next-url
| 62598f5fff9c53063f519c41 |
class DatabaseHandler(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.lock = Lock() <NEW_LINE> <DEDENT> def add(self, entry): <NEW_LINE> <INDENT> with self.lock: <NEW_LINE> <INDENT> _DBTransaction_store(id(self), entry) | The database handler is used by the plugin to interact with the
database. | 62598f5fd164cc6175820568 |
@final <NEW_LINE> class ConsecutiveSlicesViolation(ASTViolation): <NEW_LINE> <INDENT> error_template = 'Found consecutive slices' <NEW_LINE> code = 471 | Forbid consecutive slices.
Reasoning:
Consecutive slices reduce readability of the code and obscure
intended meaning of the expression.
Solution:
Compress multiple consecutive slices into a single one.
Example::
# Correct:
my_list[1:3]
# Wrong:
my_list[1:][:2]
.. versionadded:: 0.16.0 | 62598f5f925a0f43d25e7627 |
class nullbackend(defaultaccountbackend.defaultaccountbackend): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> defaultaccountbackend.defaultaccountbackend.__init__(self) <NEW_LINE> self.config_dir = None <NEW_LINE> <DEDENT> def set_account(self, email): <NEW_LINE> <INDENT> dir = tempfile.mkdtemp() <NEW_LIN... | Backend that will not save anything permanentely, used for on-the-fly-sessions. | 62598f5f9b70327d1c57e399 |
class TestApiResponseOrganisation(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 make_instance(self, include_optional): <NEW_LINE> <INDENT> if include_optional : <NEW_LINE> <INDENT> return ApiResp... | ApiResponseOrganisation unit test stubs | 62598f5fd164cc617582056a |
class SetupMaster: <NEW_LINE> <INDENT> _SETUP_FUNC_REGISTRY: List[SetupFunc] = [] <NEW_LINE> @classmethod <NEW_LINE> def register( cls, setup_func: SetupFunc = None, *, debug: bool = False ) -> Callable: <NEW_LINE> <INDENT> if setup_func is None: <NEW_LINE> <INDENT> return partial(cls.register, debug=debug) <NEW_LINE> ... | Setup Master Class
All setup functions MUST register with this class or they will not be
called. | 62598f5f56b00c62f0fb1eaa |
class AzureResource(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'loca... | An Azure resource object.
Variables are only populated by the server, and will be ignored when sending a request.
:ivar id: The resource Id.
:vartype id: str
:ivar name: The name of the resource.
:vartype name: str
:ivar type: The type of the resource.
:vartype type: str
:param location: The location of the resource.... | 62598f5f6fece00bbaccaf87 |
class PasswordResetSerializer(serializers.Serializer): <NEW_LINE> <INDENT> email = serializers.EmailField() <NEW_LINE> password_reset_form_class = PasswordResetForm <NEW_LINE> def validate_email(self, attrs, source): <NEW_LINE> <INDENT> self.reset_form = self.password_reset_form_class(data=attrs) <NEW_LINE> if not self... | Serializer for requesting a password reset e-mail. | 62598f5f91af0d3eaad393fc |
class ParametrizedTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def __init__(self, methodName='runTest', param=None): <NEW_LINE> <INDENT> super(ParametrizedTestCase, self).__init__(methodName) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> pass <NEW_LINE> cls.driver = get_driver... | TestCase classes that want to be parametrized should
inherit from this class. | 62598f5f66673b3332c2f9ae |
class DmarTbl: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.drhd_offset = 0 <NEW_LINE> self.dmar_drhd = 0 <NEW_LINE> self.dmar_dev_scope = 0 <NEW_LINE> self.dev_scope_offset = 0 <NEW_LINE> self.dev_scope_cnt = 0 <NEW_LINE> self.path_offset = 0 <NEW_LINE> <DEDENT> def style_check_1(self): <NEW_LINE> ... | DMAR TBL | 62598f5fff9c53063f519c45 |
class CreatePhotoPostWithImageFileResultSet(ResultSet): <NEW_LINE> <INDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | Retrieve the value for the "Response" output from this choreography execution. ((xml) The response from Tumblr in XML format.) | 62598f5f796e427e5384dd88 |
class Test_tools(unittest.TestCase): <NEW_LINE> <INDENT> def test_search_all_Cnumber_from_label(self): <NEW_LINE> <INDENT> expected = (['C00001546', 'C00017854', 'C00017855', 'C00027106', 'C00036583', 'C00037061', 'C00045424', 'C00045427'], 8) <NEW_LINE> label = "N1b-C2c-S2a" <NEW_LINE> actual = tools.search_all_Cnumbe... | test for control_all_genus | 62598f5f63f4b57ef008586a |
class PyvisaDummy(Mock): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def query(command: str): <NEW_LINE> <INDENT> if command in QUERY_COMMANDS: <NEW_LINE> <INDENT> return QUERY_COMMANDS[command] <NEW_LINE> <DEDENT> return Mock() | Mock class for the pyvisa package when using the
Newport devices as dummy. | 62598f5f167d2b6e312b6573 |
class FileAttachment(models.Model): <NEW_LINE> <INDENT> caption = models.CharField(_("caption"), max_length=256, blank=True) <NEW_LINE> draft_caption = models.CharField(_("draft caption"), max_length=256, blank=True) <NEW_LINE> file = models.FileField(_("file"), upload_to=os.path.join('uploaded', 'files', '%Y', '%m', '... | A file associated with a review request.
Like diffs, a file can have comments associated with it.
These comments are of type :model:`reviews.FileComment`. | 62598f5f287bf620b62711af |
class ServicesManager(models.Manager): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return ( super(ServicesManager, self) .get_queryset() .filter(Q(category="SERVICES") | Q(category="GOODSANDSERVICES")) ) | Manage barriers within the model, with status not 0 | 62598f5f6fece00bbaccaf89 |
class Export: <NEW_LINE> <INDENT> def __init__(self, params): <NEW_LINE> <INDENT> self.params = params <NEW_LINE> <DEDENT> def pdf_print(self): <NEW_LINE> <INDENT> html_string = self.__export_html(TEMPLATE) <NEW_LINE> tempfilename = export_pdf(html_string, CSS) <NEW_LINE> return tempfilename <NEW_LINE> <DEDENT> def __e... | Class for pdf export of telemedical equipment. | 62598f5fd18da76e235b6c31 |
class ChangeFormFieldset(Fieldset): <NEW_LINE> <INDENT> def __init__(self, form, classes=(), **kwargs): <NEW_LINE> <INDENT> if classes: <NEW_LINE> <INDENT> css_class_map = { 'collapse': ('-can-collapse', '-is-collapsed'), 'wide': ('-is-wide',), } <NEW_LINE> classes = tuple(itertools.chain.from_iterable( css_class_map.g... | A fieldset in an administration change form.
This takes care of providing state to the change form to represent a
fieldset and each row in that fieldset.
The fieldset makes use of the ``.rb-c-form-fieldset`` CSS component. | 62598f5f6fece00bbaccaf8b |
class TextShape(Shape): <NEW_LINE> <INDENT> LEFT, CENTER, RIGHT = -1, 0, 1 <NEW_LINE> def __init__(self, pen, x, y, j, w, t): <NEW_LINE> <INDENT> Shape.__init__(self) <NEW_LINE> self.pen = pen.copy() <NEW_LINE> self.x = x <NEW_LINE> self.y = y <NEW_LINE> self.j = j <NEW_LINE> self.w = w <NEW_LINE> self.t = t <NEW_LINE>... | Used to draw a text shape with a QPainter | 62598f5fac7a0e7691f71b0a |
class default_zero_dict(dict): <NEW_LINE> <INDENT> def __missing__(self, key): <NEW_LINE> <INDENT> return 0.0 | A dictionary where missing keys have the value 0.0 | 62598f5f5166f23b2e2429d5 |
class UserList(GridReport): <NEW_LINE> <INDENT> title = _("users") <NEW_LINE> basequeryset = User.objects.all() <NEW_LINE> model = User <NEW_LINE> frozenColumns = 2 <NEW_LINE> multiselect = False <NEW_LINE> permissions = (("change_user", "Can change user"),) <NEW_LINE> rows = ( GridFieldInteger('id', title=_('id'), key... | A list report to show users. | 62598f5f167d2b6e312b6577 |
class RPCAllocateFixedIP(object): <NEW_LINE> <INDENT> servicegroup_api = None <NEW_LINE> def _allocate_fixed_ips(self, context, instance_id, host, networks, **kwargs): <NEW_LINE> <INDENT> green_pool = greenpool.GreenPool() <NEW_LINE> vpn = kwargs.get('vpn') <NEW_LINE> requested_networks = kwargs.get('requested_networks... | Mixin class originally for FlatDCHP and VLAN network managers.
used since they share code to RPC.call allocate_fixed_ip on the
correct network host to configure dnsmasq | 62598f5fd164cc6175820571 |
class BOT_103: <NEW_LINE> <INDENT> pass | Stargazer Luna | 62598f5f287bf620b62711b3 |
class SelectBlueprintForm(forms.Form): <NEW_LINE> <INDENT> blueprint = forms.CharField(max_length=100, widget=forms.TextInput(attrs={'class': 'input-large required'})) <NEW_LINE> def clean_blueprint(self): <NEW_LINE> <INDENT> blueprint_name = self.cleaned_data['blueprint'] <NEW_LINE> if len(blueprint_name) < 3: <NEW_LI... | Form to select the blueprint the user wants to manufacture. | 62598f5fff9c53063f519c4b |
class FalseNode(Node): <NEW_LINE> <INDENT> def __new__(cls): <NEW_LINE> <INDENT> return super(Node, cls).__new__(cls) <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> if not isinstance(other, FalseNode): <NEW_LINE> <INDENT> return NotImplemented <NEW_LINE> <DEDENT> return True <NEW_LINE> <DEDENT> def _t... | Tree node for an always-failing filter. | 62598f5f56b00c62f0fb1eb1 |
class RsyncSshInitSettingsCommand(sublime_plugin.TextCommand): <NEW_LINE> <INDENT> def run(self, edit, **args): <NEW_LINE> <INDENT> project_data = self.view.window().project_data() <NEW_LINE> if project_data == None: <NEW_LINE> <INDENT> console_print("", "", "Unable to initialize settings, you must have a .sublime-proj... | Sublime Command for creating the rsync_ssh block in the project settings file | 62598f5f711fe17d825dfcf2 |
class ListManufacturersHandler(common.BasePageHandler): <NEW_LINE> <INDENT> TEMPLATE = 'templates/manufacturers.tmpl' <NEW_LINE> def GetTemplateData(self): <NEW_LINE> <INDENT> manufacturers = [] <NEW_LINE> query = Manufacturer.all() <NEW_LINE> query.order('name') <NEW_LINE> for manufacturer in query: <NEW_LINE> <INDENT... | Display a list of manufacturers. | 62598f5fa8ecb03325870800 |
class MenuBar(Menu): <NEW_LINE> <INDENT> def __init__(self, master, main): <NEW_LINE> <INDENT> self.master = master <NEW_LINE> self.main = main <NEW_LINE> super(MenuBar, self).__init__(self.master) <NEW_LINE> tool_menu = Menu(self, tearoff=0) <NEW_LINE> tool_menu.add_command(label='类别编辑器', command=self.category_editor)... | doc | 62598f5f5166f23b2e2429d9 |
@keys.assign(seq=seqs.SEMICOLON, modes=_MODES_MOTION) <NEW_LINE> class ViRepeatCharSearchForward(ViMotionDef): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> ViMotionDef.__init__(self, *args, **kwargs) <NEW_LINE> self.updates_xpos = True <NEW_LINE> self.scroll_into_view = True <NEW_LINE> <... | Vim: `;` | 62598f5f167d2b6e312b657b |
class RpkiBase(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.tracer = eossdk.Tracer(self.__class__.__name__) <NEW_LINE> <DEDENT> def _trace(self, msg, level=0): <NEW_LINE> <INDENT> self.tracer.trace(level, str(msg)) <NEW_LINE> <DEDENT> def emerg(self, msg): <NEW_LINE> <INDENT> self._trace(ms... | Base class that implements tracing. | 62598f5fd164cc6175820575 |
class my_list(list, obj_base): <NEW_LINE> <INDENT> def sample(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def insert(self, i, elt): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def remove(self, i): <NEW_LINE> <INDENT> pass | set of objects that can be inserted/removed is pre-set | 62598f5f3eb6a72ae0389c40 |
class Disk(parted.Disk): <NEW_LINE> <INDENT> def __init__(self, *methodName, **kwargs): <NEW_LINE> <INDENT> super(Disk, self).__init__(*methodName, **kwargs) <NEW_LINE> <DEDENT> def getLastPartition(self): <NEW_LINE> <INDENT> return self.partitions[-1] | Disk()
Represents a higher level piece of a block device, extending the Disk class from parted module
with usefull filesystem operations, e.g. creating filesystems. | 62598f5f21a7993f00c65576 |
class Grid(object): <NEW_LINE> <INDENT> WIN_O = 'OOO' <NEW_LINE> WIN_X = 'XXX' <NEW_LINE> EMPTY = "" <NEW_LINE> def __init__(self, length, xPos, yPos, outlineColor="black", fillColor="white", letter="X"): <NEW_LINE> <INDENT> self._letter = letter <NEW_LINE> self._grid = list() <NEW_LINE> index = 0 <NEW_LINE> y = yPos <... | Represents a Tic-Tac-Toe grid. | 62598f5f796e427e5384dd92 |
class bomb(box): <NEW_LINE> <INDENT> bombSize = 0 <NEW_LINE> counter = 0 <NEW_LINE> mPlayer = None <NEW_LINE> def __init__(self, gf, player, mySize, x, y): <NEW_LINE> <INDENT> super(bomb, self).__init__() <NEW_LINE> self.isWall = True <NEW_LINE> self.isBomb = True <NEW_LINE> self.breakable = True <NEW_LINE> self.bombSi... | update(gf, x, y) | 62598f5f507cdc57c63a439c |
class ModifyImageSharePermissionRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ImageId = None <NEW_LINE> self.AccountIds = None <NEW_LINE> self.Permission = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ImageId = params.get("ImageId") <NEW_LI... | ModifyImageSharePermission请求参数结构体
| 62598f5fbe8e80087fbbe658 |
class LightningBolt(Spell): <NEW_LINE> <INDENT> name = "Lightning Bolt" <NEW_LINE> level = 3 <NEW_LINE> casting_time = "1 action" <NEW_LINE> components = ('V', 'S', 'M') <NEW_LINE> materials = "a bit of fur and a rod of amber, crystal, or glass" <NEW_LINE> duration = "Instantaneous" <NEW_LINE> magic_school = "Evocation... | A stroke of lightning forming a line 100 feet long and 5 feet wide
blasts out from you in a direction you choose. Each creature in
the line must make a Dexterity saving throw. A creature takes 8d6
lightning damage on a failed save, or half as much damage on a
successful one. The lightning ignites flammable objects in t... | 62598f5f5e10d32532ce33e7 |
class MSGraphAuth(requests.auth.AuthBase): <NEW_LINE> <INDENT> def __init__(self, access_token): <NEW_LINE> <INDENT> self.access_token = access_token <NEW_LINE> <DEDENT> def __call__(self, request): <NEW_LINE> <INDENT> request.headers['Authorization'] = "Bearer {}".format(self.access_token) <NEW_LINE> return request | Adds the access token to a request. | 62598f5f925a0f43d25e7635 |
class Money(object): <NEW_LINE> <INDENT> def __init__(self, amount: int, currency: str): <NEW_LINE> <INDENT> self._amount = amount <NEW_LINE> self._currency = currency <NEW_LINE> <DEDENT> def __eq__(self, other): <NEW_LINE> <INDENT> return self._amount == other._amount and self.currency() == other.currency()... | Money class | 62598f5f91af0d3eaad39408 |
class Page(object): <NEW_LINE> <INDENT> def __init__(self, driver, **kwargs): <NEW_LINE> <INDENT> self.driver = driver <NEW_LINE> self.timeout = kwargs.get('timeout', 30) <NEW_LINE> <DEDENT> @property <NEW_LINE> def unique_locator(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @property <NEW_LINE> def is_current_p... | Page object allowing simple, expressive interactions with a web page or mobile screen.
All domain-specific page classes should inherite from Page.
Attributes:
unique_locator (slimleaf.webdriver.locator.Locator): locator for an element unique to
this page, which will be used to identify whether or not page... | 62598f5f8c3a8732951f5b53 |
class Conv(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_size, output_size, kernel_size, pad_type): <NEW_LINE> <INDENT> super(Conv, self).__init__() <NEW_LINE> padding = (kernel_size - 1, 0) if pad_type == 'left' else (kernel_size // 2, (kernel_size - 1) // 2) <NEW_LINE> self.pad = nn.ConstantPad1d(padding, ... | Convenience class that does padding and convolution for inputs in the format
[batch_size, sequence length, hidden size] | 62598f5f30c21e258be97e09 |
class VariableMgrDistributedFetchFromStagedPS( VariableMgrDistributedFetchFromPS): <NEW_LINE> <INDENT> def __init__(self, benchmark_cnn): <NEW_LINE> <INDENT> super(VariableMgrDistributedFetchFromStagedPS, self).__init__(benchmark_cnn) <NEW_LINE> self.staging_vars_on_devices = [dict() for _ in self.benchmark_cnn.raw_dev... | Extends VariableMgrDistributedFetchFromPS for --staged_vars. | 62598f5f56b00c62f0fb1eb7 |
class _RayAsyncMapResult(Generic[_OutputType], MapResult[_OutputType]): <NEW_LINE> <INDENT> def __init__(self, async_results: List[AsyncResult[List[_OutputType]]]) -> None: <NEW_LINE> <INDENT> self.results: List[AsyncResult[List[_OutputType]]] = async_results <NEW_LINE> <DEDENT> def get(self, timeout: Optional[float]) ... | [summary]
:param Generic: [description]
:type Generic: [type]
:param MapResult: [description]
:type MapResult: [type] | 62598f5f4d74a7450cd589d9 |
class NSNitroNserrSelToomany(NSNitroCrErrors): <NEW_LINE> <INDENT> pass | Nitro error code 675
Selector limit reached | 62598f5f711fe17d825dfcf8 |
class prman(parser.parser): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> parser.parser.__init__(self) <NEW_LINE> <DEDENT> def do(self, i_args): <NEW_LINE> <INDENT> data = i_args['data'] <NEW_LINE> lines = data.split('\n') <NEW_LINE> for line in lines: <NEW_LINE> <INDENT> pattern = re.compile(IMAGE) <NEW_... | PIXAR's RenderMan
| 62598f5fd164cc6175820579 |
class TestIAggregatedOrderData(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 testIAggregatedOrderData(self): <NEW_LINE> <INDENT> pass | IAggregatedOrderData unit test stubs | 62598f5f9b70327d1c57e3a9 |
class Channel: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.userdict = IRCDict() <NEW_LINE> self.operdict = IRCDict() <NEW_LINE> self.voiceddict = IRCDict() <NEW_LINE> self.modes = {} <NEW_LINE> <DEDENT> def users(self): <NEW_LINE> <INDENT> return self.userdict.keys() <NEW_LINE> <DEDENT> def opers(s... | A class for keeping information about an IRC channel.
This class can be improved a lot. | 62598f5fd164cc617582057a |
class BlockIndex(BlockwiseDep): <NEW_LINE> <INDENT> produces_tasks: bool = False <NEW_LINE> def __init__(self, numblocks: tuple[int, ...]): <NEW_LINE> <INDENT> self.numblocks = numblocks <NEW_LINE> <DEDENT> def __getitem__(self, idx: tuple[int, ...]) -> tuple[int, ...]: <NEW_LINE> <INDENT> return idx <NEW_LINE> <DEDENT... | Index BlockwiseDep argument
The purpose of this class is to provide each
block of a ``Blockwise``-based operation with
the current block index. | 62598f5f56b00c62f0fb1eb9 |
class NumberInput(Widget): <NEW_LINE> <INDENT> MIN_WIDTH = 100 <NEW_LINE> def __init__(self, id=None, style=None, factory=None, step=1, min_value=None, max_value=None, readonly=False, on_change=None): <NEW_LINE> <INDENT> super().__init__(id=id, style=style, factory=factory) <NEW_LINE> self._value = None <NEW_LINE> self... | A `NumberInput` widget specifies a fixed range of possible numbers.
The user has two buttons to increment/decrement the value by a step size.
Args:
id (str): An identifier for this widget.
style (:obj:`Style`): an optional style object.
If no style is provided then a new one will be created for the wi... | 62598f5f4d74a7450cd589da |
class PublishDevice(Device): <NEW_LINE> <INDENT> def onInit(self): <NEW_LINE> <INDENT> log.info('Zeroconf publish init') <NEW_LINE> self.ip_addr = self._get_ip() <NEW_LINE> self.hostname = socket.gethostname() <NEW_LINE> self.services = [] <NEW_LINE> self.desc = {'Description': 'Chains Home Automation service on rabbit... | Device implementing zeroconf publishing service for chains master servers | 62598f5f5166f23b2e2429df |
class RoleForm(FormRevMixin, ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Role <NEW_LINE> fields = "__all__" <NEW_LINE> widgets = { "servers": AutocompleteMultipleModelWidget( url="/machines/interface-autocomplete" ) } <NEW_LINE> <DEDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDEN... | Form used to add and edit roles. | 62598f5f925a0f43d25e7639 |
class JsonString(Container): <NEW_LINE> <INDENT> def __init__(self, name, value, fuzzable=True): <NEW_LINE> <INDENT> if isinstance(value, BaseField): <NEW_LINE> <INDENT> value_field = value <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> value_field = String(value, fuzzable=fuzzable, name=_valuename(name)) <NEW_LINE> <DE... | JSON string field | 62598f5f462c4b4f79dbb009 |
class InputText(luigi.ExternalTask): <NEW_LINE> <INDENT> date = luigi.DateParameter() <NEW_LINE> def output(self): <NEW_LINE> <INDENT> return luigi.hdfs.HdfsTarget(self.date.strftime('/tmp/text/%Y-%m-%d.txt')) | This task is a :py:class:`luigi.task.ExternalTask` which means it doesn't generate the
:py:meth:`~.InputText.output` target on its own instead relying on the execution something outside of Luigi to produce it. | 62598f5fbf627c535bcb0a83 |
class DayTimeRange(Token): <NEW_LINE> <INDENT> def __init__(self, start, end): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> self.end = end <NEW_LINE> <DEDENT> def datetime(self, now): <NEW_LINE> <INDENT> return (self.start.datetime(now), self.end.datetime(now)) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <I... | >>> dt1 = DayTimeToken(2018, 8, 1, 10)
>>> dt2 = DayTimeToken(2018, 8, 1, 11)
>>> dt3 = DayTimeToken(2018, 8, 1, 1, time_of_day='pm')
>>> dt4 = DayTimeToken(2018, 8, 3, 11)
>>> DayTimeRange(dt1, dt2)
8/1/2018 10:00 - 11:00
>>> DayTimeRange(dt1, dt3)
8/1/2018 10:00 - 1 pm
>>> DayTimeRange(dt1, dt4)
8/1/2018 10:00 - 8/3/... | 62598f5f796e427e5384dd98 |
class TestTransferChallengeResponse(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 testTransferChallengeResponse(self): <NEW_LINE> <INDENT> pass | TransferChallengeResponse unit test stubs | 62598f5f63f4b57ef0085872 |
class RyuApp(object): <NEW_LINE> <INDENT> _CONTEXTS = {} <NEW_LINE> _EVENTS = [] <NEW_LINE> @classmethod <NEW_LINE> def context_iteritems(cls): <NEW_LINE> <INDENT> return cls._CONTEXTS.iteritems() <NEW_LINE> <DEDENT> def __init__(self, *_args, **_kwargs): <NEW_LINE> <INDENT> super(RyuApp, self).__init__() <NEW_LINE> se... | Base class for Ryu network application | 62598f5f462c4b4f79dbb00b |
class TreeViewHelper(object): <NEW_LINE> <INDENT> LAST_TOOLTIP = '_gpodder_last_tooltip' <NEW_LINE> CAN_TOOLTIP = '_gpodder_can_tooltip' <NEW_LINE> ROLE = '_gpodder_role' <NEW_LINE> COLUMNS = '_gpodder_columns' <NEW_LINE> ROLE_PODCASTS, ROLE_EPISODES, ROLE_DOWNLOADS = range(3) <NEW_LINE> @classmethod <NEW_LINE> def set... | Container for gPodder-specific TreeView attributes. | 62598f5fd18da76e235b6c38 |
class SubpageFilterGeneratorTestCase(TestCase): <NEW_LINE> <INDENT> family = 'test' <NEW_LINE> code = 'test' <NEW_LINE> def test_subpage_filter(self): <NEW_LINE> <INDENT> site = self.get_site() <NEW_LINE> test_cat = pywikibot.Category(site, 'Subpage testing') <NEW_LINE> gen = CategorizedPageGenerator(test_cat) <NEW_LIN... | Test SubpageFilterGenerator. | 62598f5fd164cc617582057d |
class BaseGenericRelation(GenericRelation): <NEW_LINE> <INDENT> fields = {} <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.frozen_by_south = kwargs.pop("frozen_by_south", False) <NEW_LINE> kwargs.setdefault("object_id_field", "object_pk") <NEW_LINE> to = getattr(self, "related_model", None) <N... | Extends ``GenericRelation`` to:
- Add a consistent default value for ``object_id_field`` and
check for a ``related_model`` attribute which can be defined
on subclasses as a default for the ``to`` argument.
- Add one or more custom fields to the model that the relation
field is applied to, and then call a ``rela... | 62598f5f6fece00bbaccaf99 |
class UpdateCollaborationInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccessToken(self, value): <NEW_LINE> <INDENT> super(UpdateCollaborationInputSet, self)._set_input('AccessToken', value) <NEW_LINE> <DEDENT> def set_AsUser(self, value): <NEW_LINE> <INDENT> super(UpdateCollaborationInputSet, self)._set_input('AsUse... | An InputSet with methods appropriate for specifying the inputs to the UpdateCollaboration
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62598f5fbf627c535bcb0a85 |
class ProductView: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def display_choices(products: list): <NEW_LINE> <INDENT> print() <NEW_LINE> for row in products: <NEW_LINE> <INDENT> for key, value in row.items(): <NEW_LINE> <INDENT> print( f"{key}: {value['ProductName']} | score: {value['NutriscoreName']}" ) <NEW_LINE> ... | ProductView class. | 62598f5fac7a0e7691f71b18 |
class Result(db.Model, DomainObject): <NEW_LINE> <INDENT> __tablename__ = 'result' <NEW_LINE> id = Column(Integer, primary_key=True) <NEW_LINE> created = Column(Text, default=make_timestamp) <NEW_LINE> project_id = Column(Integer, ForeignKey('project.id'), nullable=False) <NEW_LINE> task_id = Column(Integer, ForeignKey... | A result associated for a task and its task runs. | 62598f5f30c21e258be97e0f |
class ControllerMethodNotFoundError(ChulaException): <NEW_LINE> <INDENT> def __init__(self, _pkg, append=None): <NEW_LINE> <INDENT> self.message = 'Unable to find the following method: %s' % _pkg <NEW_LINE> self.append = append | Exception indicating the requested controller method not found. | 62598f5fa8ecb0332587080a |
class Label(FormField): <NEW_LINE> <INDENT> params = ['text'] <NEW_LINE> text = '' <NEW_LINE> template = "tw.forms.templates.label" <NEW_LINE> validator = None <NEW_LINE> suppress_label = True | A textual label | 62598f5f462c4b4f79dbb00d |
class ConfigGroupTestCase(UITestCase): <NEW_LINE> <INDENT> @run_only_on('sat') <NEW_LINE> @tier1 <NEW_LINE> def test_positive_create(self): <NEW_LINE> <INDENT> with Session(self.browser) as session: <NEW_LINE> <INDENT> for name in valid_data_list(): <NEW_LINE> <INDENT> with self.subTest(name): <NEW_LINE> <INDENT> make_... | Implements Config Groups tests in UI. | 62598f5fd18da76e235b6c39 |
class DBSerializer(Serializer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> client = MongoClient() <NEW_LINE> self.db = client["1001tracklists"] <NEW_LINE> self.mixes = self.db.mixes <NEW_LINE> <DEDENT> def insert(self, mix, id): <NEW_LINE> <INDENT> mix["_id"] = id <NEW_LINE> self.mixes.insert_one(mix) ... | class handling jams serialization of track or mixes | 62598f5fd164cc617582057f |
class _Pack: <NEW_LINE> <INDENT> def __init__(self, optimizer): <NEW_LINE> <INDENT> self.opt = optimizer <NEW_LINE> self.particles = [] <NEW_LINE> for n in range(self.opt.nparticles): <NEW_LINE> <INDENT> pos = np.zeros(self.opt.dim) <NEW_LINE> for d in range(self.opt.dim): <NEW_LINE> <INDENT> pos[d] = np.random.uniform... | A class for a pack of Particles. Initialized and used by EMoptimizer. | 62598f5f0383005118f6cd0f |
class Query(sqlalchemy.orm.query.Query): <NEW_LINE> <INDENT> def soft_delete(self, synchronize_session='evaluate'): <NEW_LINE> <INDENT> return self.update({'deleted': literal_column('id'), 'updated_at': literal_column('updated_at'), 'deleted_at': datetime.utcnow()}, synchronize_session=synchronize_session) <NEW_LINE> <... | Subclass of sqlalchemy.query with soft_delete() method. | 62598f5fbf627c535bcb0a87 |
class HedgedAcquisition(AcquisitionStrategy): <NEW_LINE> <INDENT> def __init__(self, *strategies: AcquisitionStrategy) -> None: <NEW_LINE> <INDENT> self.strategies: t.Iterable[AcquisitionStrategy] = strategies <NEW_LINE> if not strategies: <NEW_LINE> <INDENT> raise TypeError("at least one strategy required") <NEW_LINE>... | Randomly assign parent individuals to a sub-strategy. | 62598f5f66673b3332c2f9c2 |
class ValidatableStringSetting(StringSetting): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, name, default_value, string_validator): <NEW_LINE> <INDENT> super(ValidatableStringSetting, self).__init__(name, default_value) <NEW_LINE> self._string_validator = string_validator <NEW_LINE> for... | This class is an abstract class for string settings which are meant to be
validated with one of the `pgpath.StringValidator` subclasses.
To determine whether the string is valid, the `is_valid()` method from the
subclass being used is called.
Allowed GIMP PDB types:
* PDB_STRING
Raises:
* `SettingValueError` - The... | 62598f5f91af0d3eaad39410 |
class Agent(model_base.BASEV2, HasId): <NEW_LINE> <INDENT> __table_args__ = ( sa.UniqueConstraint('agent_type', 'host', name='uniq_agents0agent_type0host'), ) <NEW_LINE> agent_type = sa.Column(sa.String(255), nullable=False) <NEW_LINE> binary = sa.Column(sa.String(255), nullable=False) <NEW_LINE> topic = sa.Column(sa.S... | Represents agents running in neutron deployments. | 62598f5f21a7993f00c65580 |
class DeleteSuggestion(graphene.ClientIDMutation): <NEW_LINE> <INDENT> similar_suggestion = graphene.Field( SimilarSuggestionType ) <NEW_LINE> class Input: <NEW_LINE> <INDENT> id = graphene.ID( required=True ) <NEW_LINE> <DEDENT> @access_required <NEW_LINE> def mutate_and_get_payload(self, info, **_input): <NEW_LINE> <... | Deletes a Similar Suggestion | 62598f5f63f4b57ef0085874 |
class CipdBootstrapTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.tempdir = tempfile.mkdtemp('depot_tools_cipd') <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> shutil.rmtree(self.tempdir) <NEW_LINE> <DEDENT> def stage_files(self, cipd_version=None, digests=None): <NE... | Tests that CIPD client can bootstrap from scratch and self-update from some
old version to a most recent one.
WARNING: This integration test touches real network and real CIPD backend and
downloads several megabytes of stuff. | 62598f5fac7a0e7691f71b1a |
class Server(servers.Server): <NEW_LINE> <INDENT> flavour = "Thrift" <NEW_LINE> def __init__(self, service, **kwargs): <NEW_LINE> <INDENT> self.service = service <NEW_LINE> super(Server, self).__init__(**kwargs) <NEW_LINE> pass <NEW_LINE> <DEDENT> def scaffold(self): <NEW_LINE> <INDENT> processor = self.service.Process... | The Thrift server instance.
This class wraps the creation of our Thrift server in the
Rpc API.
>>> with Server('localhost', 666, Handler, service=Service) as s:
... s.serve() | 62598f5fa8ecb0332587080c |
@implementer(INamedFile) <NEW_LINE> class NamedFile(File): <NEW_LINE> <INDENT> def __init__(self, data='', contentType='', filename=None): <NEW_LINE> <INDENT> if filename is not None and contentType in ('', 'application/octet-stream'): <NEW_LINE> <INDENT> contentType = get_contenttype(filename=filename) ... | A non-BLOB file that stores a filename. | 62598f5f462c4b4f79dbb00f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.