code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class TestSuiteJSONSchema(Base): <NEW_LINE> <INDENT> __tablename__ = 'TestSuiteJSONSchemas' <NEW_LINE> testsuite_name = Column("TestSuiteName", String(256), primary_key=True) <NEW_LINE> jsonschema = Column("JSONSchema", Binary) <NEW_LINE> def __init__(self, testsuite_name, data): <NEW_LINE> <INDENT> self.testsuite_name... | Saves the json schema used when creating a testsuite. Only used for suites
created with a json schema description. | 625990520c0af96317c577d4 |
class MutableURL(object): <NEW_LINE> <INDENT> def __init__(self, url): <NEW_LINE> <INDENT> self.parts = urlparse(url) <NEW_LINE> self.query = dict(parse_qsl(self.parts[4])) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> scheme, netloc, path, params, query, fragment = self.parts <NEW_LINE> query = urlencode(... | Object wrapping a Uniform Resource Locator.
Supports editing the query parameter list.
You can convert the object back to a string, the query will be
properly urlencoded.
Examples
>>> url = URL('http://www.google.com:6580/foo/bar?x=3&y=4#foo')
>>> url.query
{'x': '3', 'y': '4'}
>>> str(url)
'http... | 6259905276e4537e8c3f0a71 |
class Principal(object): <NEW_LINE> <INDENT> swagger_types = { 'email': 'str', 'name': 'str' } <NEW_LINE> attribute_map = { 'email': 'email', 'name': 'name' } <NEW_LINE> def __init__(self, email=None, name=None): <NEW_LINE> <INDENT> self._email = None <NEW_LINE> self._name = None <NEW_LINE> self.discriminator = None <N... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259905263d6d428bbee3cb7 |
class QSingleton(Singleton, type(QObject)): <NEW_LINE> <INDENT> pass | A metaclass for making Qt objects singletons | 62599052009cb60464d02a24 |
class Combatant: <NEW_LINE> <INDENT> def __init__(self, combat_wait): <NEW_LINE> <INDENT> self.combat_wait = combat_wait <NEW_LINE> <DEDENT> def decide_combat_moves(self, gm, moveset): <NEW_LINE> <INDENT> self.decide_melee_moves(gm, moveset) <NEW_LINE> self.decide_close_moves(gm, moveset) <NEW_LINE> return moveset <NEW... | Handle all the moves for combat zones. | 625990523539df3088ecd78c |
class RandomWalk(): <NEW_LINE> <INDENT> def __init__(self, num_points=5000): <NEW_LINE> <INDENT> self.num_points = num_points <NEW_LINE> self.x_values = [0] <NEW_LINE> self.y_values = [0] <NEW_LINE> <DEDENT> def get_step(self): <NEW_LINE> <INDENT> direction = choice([1, -1]) <NEW_LINE> distance = choice(list(range(16))... | A class to generate random walks. | 62599052a8ecb033258726fd |
class ScopSearch(unittest.TestCase): <NEW_LINE> <INDENT> def test_search(self): <NEW_LINE> <INDENT> handle = SCOP.search("1JOY") | SCOP search tests. | 6259905215baa72349463478 |
class Meta: <NEW_LINE> <INDENT> model_class = ConnectionRequest | Connection request schema metadata. | 6259905210dbd63aa1c720ca |
class TwentyFortyEight: <NEW_LINE> <INDENT> def __init__(self, grid_height, grid_width): <NEW_LINE> <INDENT> self._height=grid_height <NEW_LINE> self._width=grid_width <NEW_LINE> self.grid=[] <NEW_LINE> self._INITI_TILES={} <NEW_LINE> self._INITI_TILES[UP]= [(0, index) for index in range(self._width)] <NEW_LINE> self._... | Class to run the game logic. | 62599052d6c5a102081e3604 |
class QLearning(object): <NEW_LINE> <INDENT> def __init__(self, action_space, epsilon, alpha, gamma): <NEW_LINE> <INDENT> self.action_space = action_space <NEW_LINE> self.epsilon = epsilon <NEW_LINE> self.alpha = alpha <NEW_LINE> self.gamma = gamma <NEW_LINE> self.Q = {} <NEW_LINE> <DEDENT> def update(self, obs, obs_ol... | Q-Learning Algorithm | 6259905276d4e153a661dcee |
class DreamViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, ) <NEW_LINE> queryset = Dream.objects.all() <NEW_LINE> serializer_class = DreamSerializer | API endpoint that allows dream to be created, viewed, edited or deleted. | 625990522ae34c7f260ac5cd |
class FloatField(Field): <NEW_LINE> <INDENT> def process_jsondata(self, value): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self.data = float(value) <NEW_LINE> <DEDENT> except (ValueError, TypeError): <NEW_LINE> <INDENT> self.data = None <NEW_LINE> raise ValueError(self.gettext('Not a valid float value')) | A text field, except all input is coerced to an float. | 62599052379a373c97d9a50c |
class State(IntEnum): <NEW_LINE> <INDENT> strongly_not_taken = 0 <NEW_LINE> weakly_not_taken = 1 <NEW_LINE> weakly_taken = 2 <NEW_LINE> strongly_taken = 3 | Potential states of the branch predictor. | 6259905229b78933be26ab38 |
class Job(JobMetaClass('JobBase', (object,), {'abstract': True})): <NEW_LINE> <INDENT> abstract = True <NEW_LINE> timeout = None <NEW_LINE> expires = None <NEW_LINE> doc_syntax = 'markdown' <NEW_LINE> can_overlap = True <NEW_LINE> def __call__(self, consumer, *args, **kwargs): <NEW_LINE> <INDENT> raise NotImplementedEr... | The Job class which is used in a distributed task queue.
.. attribute:: name
The unique name which defines the Job and which can be used to retrieve
it from the job registry. This attribute is set to the Job class name
in lower case by default, unless a ``name`` class attribute is defined.
.. attribute::... | 6259905216aa5153ce4019cd |
class Cie10(models.Model): <NEW_LINE> <INDENT> value = models.CharField("Valor", max_length=10) <NEW_LINE> description = models.CharField("Descripción", max_length=100) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.value <NEW_LINE> <DEDENT> class Meta: <NEW_LINE> <INDENT> verbose_name = "Cie-10" <NE... | This model represnt the cie-10 medical clasification for illness
http://es.wikipedia.org/wiki/CIE-10 | 625990522ae34c7f260ac5ce |
class Dotkeys(dict): <NEW_LINE> <INDENT> __var_name = re.compile('^[a-zA-Z_]+[a-zA-Z_0-9]*$') <NEW_LINE> def __dir__(self): <NEW_LINE> <INDENT> return [i for i in self if type(i) == str and self.__var_name.match(i)] <NEW_LINE> <DEDENT> def __getattribute__(self, key, *argv): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT>... | This is a sick-minded hack of dict, intended to be an eye-candy.
It allows to get dict's items byt dot reference:
ipdb["lo"] == ipdb.lo
ipdb["eth0"] == ipdb.eth0
Obviously, it will not work for some cases, like unicode names
of interfaces and so on. Beside of that, it introduces some
complexity.
But it simplifies li... | 625990524428ac0f6e659a20 |
class IWSSetResourceAvailability(Interface): <NEW_LINE> <INDENT> pass | Marker interface | 6259905226068e7796d4de2f |
class AccountInvoiceDiscountTestCase(ModuleTestCase): <NEW_LINE> <INDENT> module = 'account_invoice_discount' | Test Account Invoice Discount module | 62599052a79ad1619776b531 |
class SeaLevels(ListAPIView): <NEW_LINE> <INDENT> renderer_classes = replace_json_renderer(ListAPIView.renderer_classes) <NEW_LINE> serializer_class = SeaLevelSerializer <NEW_LINE> def get_queryset(self, query_params=None, *args, **kwargs): <NEW_LINE> <INDENT> if query_params is None: <NEW_LINE> <INDENT> query_params =... | Get tidal predictions at a given location. Valid parameters are
`start` and `end` (in format `2014-05-01T00:17:00Z`) and `interval` in
minutes. | 62599052e64d504609df9e44 |
class Products(db.Model): <NEW_LINE> <INDENT> __bind_key__ = 'tysql' <NEW_LINE> __tablename__ = 'products' <NEW_LINE> prod_id = db.Column(db.String(10), primary_key=True, nullable=False, comment='产品ID') <NEW_LINE> prod_name = db.Column(db.String(255), nullable=False, comment='产品名') <NEW_LINE> prod_price = db.Column(db.... | 产品信息 | 625990524a966d76dd5f03d7 |
class Results(Page): <NEW_LINE> <INDENT> def vars_for_template(self): <NEW_LINE> <INDENT> return { 'total_earnings': self.group.total_contribution * (self.group.mpcr * Constants.players_per_group), } | Players payoff: How much each has earned | 6259905263b5f9789fe8665a |
class ApiUserDeleteHandler(ApiBaseHandler): <NEW_LINE> <INDENT> def __init__(self, application, request, **kwargs): <NEW_LINE> <INDENT> super().__init__(application, request, **kwargs) <NEW_LINE> self.username = self.get_argument("username", "") <NEW_LINE> <DEDENT> @auth_token <NEW_LINE> @gen.coroutine <NEW_LINE> def p... | 删除一个用户类 | 625990524e4d5625663738ef |
class Sensor: <NEW_LINE> <INDENT> def __init__(self, car: Car, space: pymunk.Space, angle: float, max_measure_dist: int=60): <NEW_LINE> <INDENT> self._car = car <NEW_LINE> self._angle = angle + self._car.shape.body.angle - radians(90) <NEW_LINE> self._max_measure_dist = max_measure_dist <NEW_LINE> self._line_one, self.... | Class for a Sensor. | 625990527d847024c075d8c3 |
class EditorCalltipsPage(ConfigurationPageBase, Ui_EditorCalltipsPage): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> ConfigurationPageBase.__init__(self) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.setObjectName("EditorCalltipsPage") <NEW_LINE> self.ctEnabledCheckBox.setChecked( Preferences.... | Class implementing the Editor Calltips configuration page. | 625990526e29344779b01b31 |
class Recording(Util): <NEW_LINE> <INDENT> def __init__(self, starttime, recordpath, frequency, length, gain=50, uniques=None): <NEW_LINE> <INDENT> self.starttime = datetime.datetime.strptime(starttime, "%m/%d/%Y %H:%M") <NEW_LINE> self.recordpath = recordpath <NEW_LINE> self.frequency = float(frequency) <NEW_LINE> se... | Defines everything you need to know to schedule a record | 62599052435de62698e9d2eb |
class RawPal(LfdFile): <NEW_LINE> <INDENT> _filepattern = r'.*\.(pal|raw|bin|lut)' <NEW_LINE> def _init(self): <NEW_LINE> <INDENT> if self._filesize not in (768, 1024): <NEW_LINE> <INDENT> raise LfdFile.Error(self) <NEW_LINE> <DEDENT> self.dtype = numpy.dtype('u1') <NEW_LINE> <DEDENT> def _data(self, order=None): <NEW_... | Raw color palette.
PAL files contain a single RGB or RGBA color palette, stored as 256x3 or
256x4 unsigned bytes in C or Fortran order, without any header.
Examples
--------
>>> with RawPal('rgb.pal') as f:
... print(f.asarray()[100])
[ 16 255 239]
>>> with RawPal('rgba.pal') as f:
... print(f.asarray()[100])... | 625990527cff6e4e811b6f2a |
class FlightSearchFormView(GetFormMixin, FormView): <NEW_LINE> <INDENT> template_name = "index.haml" <NEW_LINE> form_class = FlightSearchForm <NEW_LINE> def form_valid(self, form): <NEW_LINE> <INDENT> return redirect("%s?%s" % (reverse('search_results'), self.request.GET.urlencode())) | View that displays flight search form, if form is valid redirects
to `FlightSearchResultsView` or displays errors | 625990522ae34c7f260ac5cf |
class Formatter(object): <NEW_LINE> <INDENT> formatters = [] <NEW_LINE> separator = ' ' <NEW_LINE> show_headings = True <NEW_LINE> def __init__(self, name, desc): <NEW_LINE> <INDENT> Formatter.formatters.append(self) <NEW_LINE> self.name = name <NEW_LINE> self.desc = desc <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> d... | A base class for an object that formats query results into a stream. | 6259905207f4c71912bb0923 |
class Pause: <NEW_LINE> <INDENT> def __init__(self, duration): <NEW_LINE> <INDENT> self._duration = 0x80 <NEW_LINE> self.duration = duration <NEW_LINE> <DEDENT> @property <NEW_LINE> def raw_value(self): <NEW_LINE> <INDENT> return self._duration <NEW_LINE> <DEDENT> @property <NEW_LINE> def duration(self): <NEW_LINE> <IN... | DRV2605 waveform sequence timed delay. | 62599052e76e3b2f99fd9ee8 |
class _KnuthF: <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> self.data = np.array(data, copy=True) <NEW_LINE> if self.data.ndim != 1: <NEW_LINE> <INDENT> raise ValueError("data should be 1-dimensional") <NEW_LINE> <DEDENT> self.data.sort() <NEW_LINE> self.n = self.data.size <NEW_LINE> from scipy imp... | Class which implements the function minimized by knuth_bin_width
Parameters
----------
data : array-like, one dimension
data to be histogrammed
Notes
-----
the function F is given by
.. math::
F(M|x,I) = n\log(M) + \log\Gamma(\frac{M}{2})
- M\log\Gamma(\frac{1}{2})
- \log\Gamma(\frac{2n+M}{2})
+ ... | 625990522ae34c7f260ac5d0 |
class StringSerializePipeline(SerializePipeline): <NEW_LINE> <INDENT> pass | StringSerializePipeline
.. seealso::
:class:`kim.pipelines.serialization.SerializePipeline` | 62599052a219f33f346c7cee |
@dataclasses.dataclass(order=True, frozen=True) <NEW_LINE> class Lang: <NEW_LINE> <INDENT> lang: str <NEW_LINE> country: str = None <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> assert all(len(x) == 2 for x in filter(None, [self.lang, self.country])), self <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <IN... | Language (and maybe country) code. | 6259905276e4537e8c3f0a75 |
class BaseRelation(object): <NEW_LINE> <INDENT> def __init__(self, item, status, relation_type=None): <NEW_LINE> <INDENT> if status not in ('attached', 'detached'): <NEW_LINE> <INDENT> raise ValueError <NEW_LINE> <DEDENT> self.item = item <NEW_LINE> self.status = status <NEW_LINE> self.relation_type = relation_type <NE... | Class for all basic relations. | 625990523eb6a72ae038bb49 |
class CourseCommentView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request, course_id): <NEW_LINE> <INDENT> course = Course.objects.get(id=int(course_id)) <NEW_LINE> user_courses = UserCourse.objects.filter(course=course) <NEW_LINE> user_ids = [user_course.user.id for user_course in user_courses] <NEW... | 课程评论 | 62599052a8ecb03325872701 |
class Chunk(object): <NEW_LINE> <INDENT> def __init__(self, nbt): <NEW_LINE> <INDENT> chunk_data = nbt['Level'] <NEW_LINE> self.coords = chunk_data['xPos'],chunk_data['zPos'] <NEW_LINE> self.blocks = BlockArray(chunk_data['Blocks'].value, chunk_data['Data'].value) <NEW_LINE> <DEDENT> def get_coords(self): <NEW_LINE> <I... | Class for representing a single chunk. | 62599052cb5e8a47e493cbfc |
class Subject(BaseModel): <NEW_LINE> <INDENT> name = models.CharField( verbose_name = u'Название', max_length = 254, ) <NEW_LINE> short_name = models.CharField( verbose_name = u'Короткое_название', max_length = 25, ) <NEW_LINE> description = models.TextField( verbose_name = u'Описание' ) <NEW_LINE> created_at = models.... | Предмет | 62599052e64d504609df9e45 |
class ConnectionThread(NetworkThread): <NEW_LINE> <INDENT> def __init__(self, url, timeout): <NEW_LINE> <INDENT> NetworkThread.__init__(self) <NEW_LINE> self.url = url <NEW_LINE> self.timeout = timeout <NEW_LINE> self.conn = None <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> info = sel... | Abstract base class for connection threads. | 625990538e71fb1e983bcfb4 |
class ServosDriver(object): <NEW_LINE> <INDENT> def __init__(self, panpin, tiltpin, idletimeout, minsteps, maxsteps, panmaxangle, tiltmaxangle): <NEW_LINE> <INDENT> self._panpin = panpin <NEW_LINE> self._tiltpin = tiltpin <NEW_LINE> self._idletimeout = idletimeout <NEW_LINE> self._minsteps = minsteps <NEW_LINE> self._m... | Class which starts the servod blaster and configures it
It also initiates servos which are connected (pan and tilt) | 6259905338b623060ffaa2c4 |
class SpatialSoftmax(nn.Module): <NEW_LINE> <INDENT> def __init__(self, height, width, channel): <NEW_LINE> <INDENT> super(SpatialSoftmax, self).__init__() <NEW_LINE> self.height = height <NEW_LINE> self.width = width <NEW_LINE> self.channel = channel <NEW_LINE> pos_x, pos_y = np.meshgrid( np.linspace(-1., 1., self.hei... | Spatial Softmax Implementation | 625990537d847024c075d8c5 |
class GenNoteClear(Operator): <NEW_LINE> <INDENT> bl_idname = "node.gen_note_clear" <NEW_LINE> bl_label = "Clear Text" <NEW_LINE> bl_options = {'REGISTER', 'UNDO'} <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> node = context.node <NEW_LINE> node.clear() <NEW_LINE> return {'FINISHED'} | Clear Note Node | 62599053d99f1b3c44d06b8a |
class _WeightedSparseColumn(_FeatureColumn, collections.namedtuple( "_WeightedSparseColumn", ["sparse_id_column", "weight_column_name", "dtype"])): <NEW_LINE> <INDENT> def __new__(cls, sparse_id_column, weight_column_name, dtype): <NEW_LINE> <INDENT> return super(_WeightedSparseColumn, cls).__new__(cls, sparse_id_colum... | See `weighted_sparse_column`. | 6259905321a7993f00c67458 |
class FileTmpdirPermissionError(FileError): <NEW_LINE> <INDENT> pass | File tmpdir permission error class. | 625990538da39b475be046d6 |
class LiveThreadContribution(object): <NEW_LINE> <INDENT> def __init__(self, thread): <NEW_LINE> <INDENT> self.thread = thread <NEW_LINE> <DEDENT> def add(self, body): <NEW_LINE> <INDENT> url = API_PATH['live_add_update'].format(id=self.thread.id) <NEW_LINE> self.thread._reddit.post(url, data={'body': body}) <NEW_LINE>... | Provides a set of contribution functions to a LiveThread. | 62599053dc8b845886d54aaf |
class Agency: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.name = None <NEW_LINE> self.url = None <NEW_LINE> self.timezone = None <NEW_LINE> self.lang = None <NEW_LINE> self.phone = None <NEW_LINE> self.fare_url = None <NEW_LINE> self.email = None | contents of the **agency.txt** file (from https://developers.google.com/transit/gtfs/reference/)
Fields
______
* **id** `(agency_id)` **Optional** - The agency_id field is an ID that uniquely identifies a transit agency. A transit feed may represent data from more than one agency. The agency_id is dataset unique. Th... | 62599053f7d966606f74932d |
class Player: <NEW_LINE> <INDENT> def __init__(self, inventory = {}): <NEW_LINE> <INDENT> self.inventory = inventory | A player | 62599053379a373c97d9a510 |
class MappingContext(object): <NEW_LINE> <INDENT> def __init__(self, rxnorm, treatment, drug_problem=None): <NEW_LINE> <INDENT> self._rxnorm=rxnorm <NEW_LINE> self._treatment=treatment <NEW_LINE> self._drug_problem = drug_problem <NEW_LINE> concept_names = {} <NEW_LINE> for c in rxnorm.concepts: <NEW_LINE> <INDENT> cn ... | Packages the information needed to map medications to each other and the
UMLS. | 62599053b5575c28eb713741 |
class Merger(Thread): <NEW_LINE> <INDENT> __metaclass__ = abc.ABCMeta <NEW_LINE> def __init__(self, config, work_queue, pipe): <NEW_LINE> <INDENT> self.config = config <NEW_LINE> self.merge_logger = get_logger( '{name}_merge'.format(name=self.config.name), redirect_to_file=True) <NEW_LINE> self.work_queue = work_queue ... | Merger is the base class for all mergers.
| 6259905355399d3f05627a0a |
class VideoUploader(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._session = None <NEW_LINE> <DEDENT> def upload(self, video, wait_for_encoding=False): <NEW_LINE> <INDENT> if self._session: <NEW_LINE> <INDENT> raise FacebookError( "There is already an upload session for this video uploader" ... | Video Uploader that can upload videos to adaccount | 62599053be383301e0254d02 |
class Limit(object): <NEW_LINE> <INDENT> def __init__(self, limit=None): <NEW_LINE> <INDENT> self.data = limit <NEW_LINE> self.stub = Cuebot.getStub('limit') <NEW_LINE> <DEDENT> def create(self): <NEW_LINE> <INDENT> return Limit(self.stub.Create( limit_pb2.LimitCreateRequest(name=self.name(), max_value=self.maxValue())... | This class contains the grpc implementation related to a Limit. | 62599053596a897236129025 |
class OrganizationAddress(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'organization_addresses' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> organization_id = db.Column(db.ForeignKey( 'organizations.id', ondelete='cascade'), nullable=False) <NEW_LINE> address_id = db.Column(db.ForeignKey( 'addre... | link table for organization : n addresses | 6259905394891a1f408ba16c |
class ConfirmFileOverwriteDialog(QDialog): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(ConfirmFileOverwriteDialog, self).__init__(*args, **kwargs) <NEW_LINE> self.setWindowTitle("Overwrite current file") <NEW_LINE> message = "You are trying to open a new file. <br>" ... | Dialog to display when user wants to open a new file if a file is currently open. | 62599053b830903b9686eef3 |
class Rate(object): <NEW_LINE> <INDENT> PERIODS = { 's': 1, 'm': 60, 'h': 60 * 60, 'd': 24 * 60 * 60, } <NEW_LINE> RATE_RE = re.compile(r'(\d+)/(\d*)([smhd])?') <NEW_LINE> @classmethod <NEW_LINE> def parse(cls, rate_str): <NEW_LINE> <INDENT> m = Rate.RATE_RE.match(rate_str) <NEW_LINE> if m: <NEW_LINE> <INDENT> count, m... | A rate representing login attempt frequency.
The main functionality of this class is found in the :py:meth:`parse`
function. This class converts a rate into a Rate object, which
contains the number of login attempts allowed within a time period based
on a given rate string. | 625990534e4d5625663738f3 |
class Server(object): <NEW_LINE> <INDENT> auth = HTTPBasicAuth() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.process = None <NEW_LINE> self.app = Flask(__name__) <NEW_LINE> self.api = Api(self.app) <NEW_LINE> self.context = ('appqos.crt', 'appqos.key') <NEW_LINE> self.api.add_resource(Apps, '/apps') <NEW_LI... | REST API server | 6259905376d4e153a661dcf1 |
class UniqueFileTest(test_util.TempDirTestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super(UniqueFileTest, self).setUp() <NEW_LINE> self.default_name = os.path.join(self.tempdir, "foo.txt") <NEW_LINE> <DEDENT> def _call(self, mode=0o600): <NEW_LINE> <INDENT> from certbot.util import unique_file <NE... | Tests for certbot.util.unique_file. | 62599053b7558d58954649a0 |
class enable_options_from_developer_options( parent_ui_steps.enable_options_from_developer_options): <NEW_LINE> <INDENT> pass | description:
enables an option from developer options
if <enabled> parameter is True, <Developer options> is enabled
usage:
ui_steps.enable_options_from_developer_options(developer_options =
["Verify apps over USB"])()
tags:
ui, android, enable, develop... | 6259905321a7993f00c6745a |
class User(flask_restful.Resource): <NEW_LINE> <INDENT> SCHEMA_POST = { "type": "object", "properties": { "bio": {"type": "string"}, "username": {"type": "string"}, "password": {"type": "string"}, }, "required": ["username", "password"], } <NEW_LINE> @limiter.limit(config.LIMITS_USER_GET) <NEW_LINE> def get(self, user_... | User account resource; manage users
in the system. | 6259905382261d6c52730940 |
class GammatonegramTester: <NEW_LINE> <INDENT> def __init__(self, name, args, sig, erb_fb_out, expected): <NEW_LINE> <INDENT> self.signal = np.asarray(sig) <NEW_LINE> self.expected = np.asarray(expected) <NEW_LINE> self.erb_fb_out = np.asarray(erb_fb_out) <NEW_LINE> self.args = args <NEW_LINE> self.description = "Gamma... | Testing class for gammatonegram calculation | 625990532ae34c7f260ac5d3 |
@method_decorator(login_required, name='dispatch') <NEW_LINE> class CreateEntrega(FormView): <NEW_LINE> <INDENT> form_class = EntregaForm <NEW_LINE> template_name = 'delivery_helper_app/entrega_create.html' <NEW_LINE> def get_form_kwargs(self): <NEW_LINE> <INDENT> kwargs = super(CreateEntrega, self).get_form_kwargs() <... | Create Entrega view. | 6259905307d97122c4218197 |
class sublime_plugin(object): <NEW_LINE> <INDENT> all_callbacks = { 'on_load': [] } <NEW_LINE> '''Classes''' <NEW_LINE> class WindowCommand(object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> class TextCommand(object): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> class EventListener(object): <NEW_LINE> <INDENT> pass | Constants | 625990532ae34c7f260ac5d4 |
class SyncRecipeCreator(SingleOutputRecipeCreator): <NEW_LINE> <INDENT> def __init__(self, name, project): <NEW_LINE> <INDENT> SingleOutputRecipeCreator.__init__(self, 'sync', name, project) | Create a Sync recipe | 62599053097d151d1a2c2564 |
class User(ndb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty(required=True) <NEW_LINE> email = ndb.StringProperty() <NEW_LINE> date_created = ndb.DateTimeProperty(auto_now_add=True) <NEW_LINE> @classmethod <NEW_LINE> def create_user(cls, user_name, email): <NEW_LINE> <INDENT> p_key = ndb.Key(User, user_name) <N... | User profile | 62599053596a897236129026 |
class Qubit: <NEW_LINE> <INDENT> def __init__(self, label_circuit="", label_physical=""): <NEW_LINE> <INDENT> self.label_circuit = label_circuit <NEW_LINE> self.label_physical = label_physical <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "[Circuit={}, Physical={}]".format(self.label_circuit, self.l... | Qubit class. Even though this class contains no method, this class
will become handy in recursively generating DMERA ansatz at different
scales. | 625990531f037a2d8b9e52e4 |
class CompleteMultiPartUpload(object): <NEW_LINE> <INDENT> def __init__(self, bucket=None): <NEW_LINE> <INDENT> self.bucket = bucket <NEW_LINE> self.location = None <NEW_LINE> self.bucket_name = None <NEW_LINE> self.key_name = None <NEW_LINE> self.etag = None <NEW_LINE> self.version_id = None <NEW_LINE> self.encrypted ... | Represents a completed MultiPart Upload. Contains the
following useful attributes:
* location - The URI of the completed upload
* bucket_name - The name of the bucket in which the upload
is contained
* key_name - The name of the new, completed key
* etag - The MD5 hash of the completed, combined ... | 62599053b830903b9686eef4 |
class Help(SidebarBase): <NEW_LINE> <INDENT> shorthand = 'help' <NEW_LINE> def context(self, http_client, request): <NEW_LINE> <INDENT> subtemplates = [] <NEW_LINE> for layer_name in sorted(layer_names(request)): <NEW_LINE> <INDENT> template_name = 'regulations/sidebar/help/{}.html'.format( layer_name) <NEW_LINE> try: ... | Help info; composed of subtemplates defined by the active layers | 625990538e71fb1e983bcfb8 |
class NodeStmt(Node): <NEW_LINE> <INDENT> def __init__(self, node): <NEW_LINE> <INDENT> super(NodeStmt, self).__init__() <NEW_LINE> self.node = node <NEW_LINE> <DEDENT> def eval(self, env): <NEW_LINE> <INDENT> return self.node.eval(env) | generated source for class NodeStmt | 625990534e4d5625663738f6 |
class RunResult: <NEW_LINE> <INDENT> def __init__(self, command: List[str], stdout: bytes, stderr: bytes, return_code: int, piped_out: bool, piped_err: bool) -> None: <NEW_LINE> <INDENT> self.command = command <NEW_LINE> self.stdout_piped = piped_out <NEW_LINE> self.stderr_piped = piped_err <NEW_LINE> if piped_out: <NE... | A container for simplifying the results of running a command | 625990530c0af96317c577d7 |
class CrossRefs(object): <NEW_LINE> <INDENT> InterestingXRef = { "GO", "HAMAP", "InterPro", "Gene3D", "SUPFAM", "PANTHER", "Pfam", "PIRSF", "PRINTS", "ProDom", "SMART", "TIGRFAMs", "PROSITE", } | Class listing the types of cross references to be considered. | 62599053d99f1b3c44d06b8e |
class Solution: <NEW_LINE> <INDENT> def lengthOfLongestSubstring(self, s): <NEW_LINE> <INDENT> seen = {} <NEW_LINE> ret = char_to_start = 0 <NEW_LINE> for idx, context in enumerate(s): <NEW_LINE> <INDENT> if context in seen and char_to_start <= seen[context]: <NEW_LINE> <INDENT> char_to_start = seen[context] + 1 <NEW_L... | def lengthOfLongestSubstring(self, s):
if len(s) == 0:
return 0
ret = 1
i = 0
while i < len(s) - 1:
j = i + 1
uni_set = set()
uni_set.add(s[i])
i += 1
while j < len(s):
if s[j] not in uni_set:
uni_set.add(s[j])
... | 625990537d847024c075d8c9 |
class TestIntegerPropertyDefinitionResource(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 testIntegerPropertyDefinitionResource(self): <NEW_LINE> <INDENT> pass | IntegerPropertyDefinitionResource unit test stubs | 62599053287bf620b62730de |
class GetTeamInfo(REST): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(GetTeamInfo, self).__init__('getteaminfo.do', 3.0, **kwargs) <NEW_LINE> <DEDENT> @classmethod <NEW_LINE> def get(self, **args): <NEW_LINE> <INDENT> return self().GET(args, format='text') | class: veracode.API.admin.GetTeamInfo
params: dynamic, see veracode.SDK.admin.GetTeamInfo for more info
returns: XML data from veracode API | 62599053435de62698e9d2f1 |
class armAnimation: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.flagInit = True <NEW_LINE> self.fig, self.ax = plt.subplots() <NEW_LINE> self.handle = [] <NEW_LINE> self.length=P.length <NEW_LINE> self.width=P.width <NEW_LINE> plt.axis([-2.0*P.length, 2.0*P.length, -2.0*P.length, 2.0*P.length]) <NE... | Create arm animation | 6259905330dc7b76659a0cf6 |
class syncContacts_result(object): <NEW_LINE> <INDENT> def __init__(self, success=None, e=None,): <NEW_LINE> <INDENT> self.success = success <NEW_LINE> self.e = e <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot._fast_decode is not None and isinstance(iprot.trans, TTransport.CReadableTransport) a... | Attributes:
- success
- e | 6259905307f4c71912bb0928 |
class Winch(Subsystem): <NEW_LINE> <INDENT> def __init__(self, robot): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.robot = robot <NEW_LINE> self.motor = wpilib.Jaguar(4) <NEW_LINE> <DEDENT> def initDefaultCommand(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def manualSet(self, output): <NEW_LINE> <IND... | Runs the winch. | 625990532ae34c7f260ac5d5 |
class Index(Resource): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> return success(success_msg['landing_page']) | Root endpoint | 6259905373bcbd0ca4bcb77f |
class TokenizationError(Exception): <NEW_LINE> <INDENT> def __init__(self, message, line, position): <NEW_LINE> <INDENT> Exception.__init__(self, message) <NEW_LINE> self.message = message <NEW_LINE> self.line = line <NEW_LINE> self.position = position <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return s... | Raised when a problem tokenizing text is encountered | 62599053b57a9660fecd2f6a |
class test_hophdr_keepalive_toClt(ProxyTest): <NEW_LINE> <INDENT> def test_hophdr_keepalive_toClt(self): <NEW_LINE> <INDENT> self.start_test() <NEW_LINE> <DEDENT> def get_response_headers(self, content): <NEW_LINE> <INDENT> headers = super(test_hophdr_keepalive_toClt, self).get_response_headers(content) <NEW_LIN... | Proxy must not forward Keep-Alive: response header | 62599053ac7a0e7691f739d0 |
class TestFeed(TestSetupMixin, object): <NEW_LINE> <INDENT> def test_accept_entry(self): <NEW_LINE> <INDENT> assert self.feed._accept_entry(GOOD_FEED_ENTRY) is True <NEW_LINE> assert self.feed._accept_entry(FOOBAR_FEED_ENTRY) is False <NEW_LINE> assert self.feed._accept_entry(STALE_FEED_ENTRY) is False <NEW_LINE> <DEDE... | Tests for the feedbot Feed class. | 62599053379a373c97d9a515 |
class TestDocCode(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 testDocCode(self): <NEW_LINE> <INDENT> model = swagger_client.models.doc_code.DocCode() | DocCode unit test stubs | 62599053b830903b9686eef5 |
class StorageProfiles(Task): <NEW_LINE> <INDENT> def __init__(self, datalab): <NEW_LINE> <INDENT> Task.__init__(self, datalab, 'list_storage_profiles', 'List the available Storage Manager profiles') <NEW_LINE> self.addOption("profile", Option("profile", "", "Profile to list", required=False, default=None)) <NEW_LINE> s... | List the available Storage Manager profiles. | 62599053009cb60464d02a2e |
class TestCase(NdParentTest): <NEW_LINE> <INDENT> def run_test(self, redant): <NEW_LINE> <INDENT> redant.set_volume_options(self.vol_name, {'storage.reserve': '50'}, self.server_list[0]) <NEW_LINE> redant.validate_volume_option(self.vol_name, {'storage.reserve': '50'}, self.server_list[0]) <NEW_LINE> redant.reset_volum... | Testing set and reset of Reserve limit in GlusterD | 6259905355399d3f05627a0e |
class Entity(object): <NEW_LINE> <INDENT> parameters = list() <NEW_LINE> def __init__(self, **kwargs): <NEW_LINE> <INDENT> if not hasattr(self, 'values'): <NEW_LINE> <INDENT> self.values = dict() <NEW_LINE> <DEDENT> for field, field_type, in self.parameters: <NEW_LINE> <INDENT> if field in kwargs: <NEW_LINE> <INDENT> s... | Base class for a rule
| 6259905324f1403a92686347 |
class RegisterTokensTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_register_token(self): <NEW_LINE> <INDENT> class Token(tdparser.Token): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> lexer = tdparser.Lexer() <NEW_LINE> self.assertEqual(0, len(lexer.tokens)) <NEW_LINE> lexer.register_token(Token, r'a') <NEW_L... | Tests for Lexer.register_token / Lexer.register_tokens. | 625990531f037a2d8b9e52e5 |
class CsapschannelprotocolEnum(Enum): <NEW_LINE> <INDENT> bellcore = 1 <NEW_LINE> itu = 2 <NEW_LINE> @staticmethod <NEW_LINE> def _meta_info(): <NEW_LINE> <INDENT> from ydk.models.cisco_ios_xe._meta import _CISCO_SONET_MIB as meta <NEW_LINE> return meta._meta_table['CiscoSonetMib.Csapsconfigtable.Csapsconfigentry.Csaps... | CsapschannelprotocolEnum
This object allows to configure APS channel protocol to
be implemented at Near End terminal.
K1 and K2 overhead bytes in a SONET signal are used as
an APS channel.
This channel is used to carry APS protocol.
Possible values\:
bellcore(1) \: Implements APS channel protocol as defined
... | 62599053be383301e0254d04 |
class NoodleEditGroup(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "node."+APIPRE+"_edit_group" <NEW_LINE> bl_label = "Edit Group ("+NODETREE_EDITOR_NAME+")" <NEW_LINE> node_path : bpy.props.StringProperty(name="node_path") <NEW_LINE> @classmethod <NEW_LINE> def poll(cls, context): <NEW_LINE> <INDENT> return Tr... | Make newgroup node from selected nodes | 625990534a966d76dd5f03df |
class PornImgReviewTemplateInfoForUpdate(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Switch = None <NEW_LINE> self.LabelSet = None <NEW_LINE> self.BlockConfidence = None <NEW_LINE> self.ReviewConfidence = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> s... | 画面鉴别涉及令人反感的信息的任务控制参数。
| 6259905391af0d3eaad3b319 |
class ComputedStringField(fields.StringField): <NEW_LINE> <INDENT> def populate_obj(self, obj, name): <NEW_LINE> <INDENT> pass | Use on computed fields and forms with mixins to skip populate_obj. | 6259905338b623060ffaa2c7 |
class Todo: <NEW_LINE> <INDENT> title = 'My Todo' <NEW_LINE> tasks = [] <NEW_LINE> def __init__(self, title) -> None: <NEW_LINE> <INDENT> self.title = title <NEW_LINE> pass <NEW_LINE> <DEDENT> def rename(self, newTitle): <NEW_LINE> <INDENT> self.title = newTitle <NEW_LINE> return <NEW_LINE> <DEDENT> def addTask(self, d... | List of tasks to complete | 6259905345492302aabfd9c8 |
class HTTPSConnection(http_client.HTTPSConnection): <NEW_LINE> <INDENT> def is_local(self): <NEW_LINE> <INDENT> if self.sock is None: <NEW_LINE> <INDENT> self.connect() <NEW_LINE> <DEDENT> return self.sock.getsockname()[0] == self.sock.getpeername()[0] <NEW_LINE> <DEDENT> @property <NEW_LINE> def server_address(self): ... | Enhanced HTTPS connection. | 625990538da39b475be046db |
class RatelimitMismatchError(ConfigurationError): <NEW_LINE> <INDENT> pass | Raise when validating ratelimit (configured <=> api_response.headers) fails. | 6259905399cbb53fe68323db |
class Cat: <NEW_LINE> <INDENT> def __init__(self,name,age): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.age = age <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "%s的年龄是:%d岁"%(self.name,self.age) <NEW_LINE> <DEDENT> def eat(self): <NEW_LINE> <INDENT> print("%s在吃鱼..."%self.name) <NEW_LINE> <DE... | 定义一个Cat类 | 625990530a50d4780f706837 |
class ProductionConfig(Config): <NEW_LINE> <INDENT> pass | Production Config | 62599053b5575c28eb713744 |
class HTML: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def send(bot, user_id, content): <NEW_LINE> <INDENT> bot.send_message( chat_id=user_id, text=content, parse_mode='HTML' ) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def get_content(message): <NEW_LINE> <INDENT> return message.text_html | Wrapper class for handling messages with formatting entities | 62599053d486a94d0ba2d4ba |
class Algorithm(object): <NEW_LINE> <INDENT> def __init__(self, date, data_dir): <NEW_LINE> <INDENT> self.date = date <NEW_LINE> self.data_dir = data_dir <NEW_LINE> self.results = {} <NEW_LINE> try: <NEW_LINE> <INDENT> self.player_data = PlayerData(self.date, self.data_dir) <NEW_LINE> <DEDENT> except Exception as e: <N... | Base class that can be overridden with the specifics of an algorithm
but also provides basic interfaces for calling by wrapper and infrastructure code | 625990532ae34c7f260ac5d8 |
class Warning(Exception): <NEW_LINE> <INDENT> def __init__(self, message): <NEW_LINE> <INDENT> self.message = message | Exception raised for important warnings like data truncations
while inserting, etc. | 6259905326068e7796d4de39 |
class GetDigest(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> mandatory_fields = ('site', 'begin_date', 'end_date') <NEW_LINE> def get(self, request): <NEW_LINE> <INDENT> params = request.GET.dict() <NEW_LINE> for key in self.mandatory_fields: <NEW_LINE> <INDENT> if key not in params.... | Digest Api.
Examples:
http://api.addnow.dev/api/v1/digest?site=1&begin_date=<timestamp>&end_date=<timestamp>
http://api.addnow.dev/api/v1/digest?site=1&begin_date=<timestamp>&end_date=<timestamp>&aggregation=day | 625990537b25080760ed8758 |
class OHEMSampler(gluon.Block): <NEW_LINE> <INDENT> def __init__(self, ratio, min_samples=0, thresh=0.5): <NEW_LINE> <INDENT> super(OHEMSampler, self).__init__() <NEW_LINE> assert ratio > 0, "OHEMSampler ratio must > 0, {} given".format(ratio) <NEW_LINE> self._ratio = ratio <NEW_LINE> self._min_samples = min_samples <N... | A sampler implementing Online Hard-negative mining.
As described in paper https://arxiv.org/abs/1604.03540.
Parameters
----------
ratio : float
Ratio of negative vs. positive samples. Values >= 1.0 is recommended.
min_samples : int, default 0
Minimum samples to be selected regardless of positive samples.
F... | 625990538e7ae83300eea589 |
class Solution: <NEW_LINE> <INDENT> def backPackVIII(self, n, value, amount): <NEW_LINE> <INDENT> m = len(value) <NEW_LINE> dp = [[False] * (n+1) for i in range(m+1)] <NEW_LINE> for i in range(m+1): <NEW_LINE> <INDENT> dp[i][0] = True <NEW_LINE> <DEDENT> for i in range(1, m+1): <NEW_LINE> <INDENT> for j in range(1, n+1... | @param n: the value from 1 - n
@param value: the value of coins
@param amount: the number of coins
@return: how many different value | 62599053be8e80087fbc0572 |
class Cybersource(PaymentMethod): <NEW_LINE> <INDENT> name = settings.SOURCE_TYPE <NEW_LINE> code = "cybersource" <NEW_LINE> serializer_class = PaymentMethodSerializer <NEW_LINE> def _record_payment(self, request, order, method_key, amount, reference, **kwargs): <NEW_LINE> <INDENT> extra_fields = {} <NEW_LINE> signals.... | This is an example of how to implement a payment method that required some off-site
interaction, like Cybersource Secure Acceptance, for example. It returns a pending
status initially that requires the client app to make a form post, which in-turn
redirects back to us. This is a common pattern in PCI SAQ A-EP ecommerce... | 62599053596a897236129028 |
class TestNotEquals(unittest.TestCase): <NEW_LINE> <INDENT> def test_a(self): <NEW_LINE> <INDENT> v1 = versions.Version(version='1.2.3', name='foo') <NEW_LINE> v2 = versions.Version(version='2.2.3', name='bar') <NEW_LINE> self.assertTrue(v1 != v2) <NEW_LINE> self.assertTrue(v2 != v1) <NEW_LINE> <DEDENT> def test_b(self... | A suite of test that compare not equivalence, ``!=`` | 625990534a966d76dd5f03e1 |
class sbb_gz(models.Model): <NEW_LINE> <INDENT> sbb_gz_type_choice = ( (0, '测酒仪'), (1, '模拟机'), (2, '验卡器'), (3, '读卡器'), (4, '自助出退勤'), (5, '其他') ) <NEW_LINE> sbb_type = models.SmallIntegerField(choices=sbb_gz_type_choice, default=0, verbose_name="设备类型") <NEW_LINE> bianhao = models.CharField(max_length=64, verbose_name="设... | 设备分类 | 62599053e64d504609df9e49 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.