code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class HTTPSClientAuthHandler(urllib2.HTTPSHandler): <NEW_LINE> <INDENT> def __init__(self, key, cert): <NEW_LINE> <INDENT> urllib2.HTTPSHandler.__init__(self) <NEW_LINE> self.key = key <NEW_LINE> self.cert = cert <NEW_LINE> <DEDENT> def https_open(self, req): <NEW_LINE> <INDENT> return self.do_open(self.getConnection, ... | urllib2 does not natively support HTTPS client authentication | 62598f5f1d351010ab8f3150 |
class Customer(): <NEW_LINE> <INDENT> def __init__(self, dict): <NEW_LINE> <INDENT> self.__dict__.update(dict) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "{}".format(self.__dict__) | Класс с информацией о покупателе, для учета брака предприятия
| 62598f5f1d351010ab8f3151 |
class SRSCreateMixin(CreateModelMixin): <NEW_LINE> <INDENT> def create(self, request, *args, **kwargs): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> response = super().create(request, *args, **kwargs) <NEW_LINE> <DEDENT> except ValidationError as e: <NEW_LINE> <INDENT> response = e <NEW_LINE> <DEDENT> if response.statu... | This makes the responses of create generic views
compliant to the SRS document we agreed on before | 62598f5f6fece00bbaccaf9f |
class Panel(Screen): <NEW_LINE> <INDENT> def __init__(self, html = None, fullscreen = None, margin = None, padding = None, scroll = None, layout = None, ui=None, htmlStyle=None, alwaysReload=None, cssClass=None): <NEW_LINE> <INDENT> super(Panel, self).__init__(fullscreen=fullscreen, margin=margin, padding=padding, layo... | Sencha Touch Panel Component
One of the main Sencha Touch components.
:param html: HTML code to insert into panel
:type html: String
:param scroll: Configure the component to be scrollable. Acceptable values are:
* ``'horizontal'``
* ``'vertical'``
* ``'both'``
* ``False`` to explicitly disable scroll... | 62598f5fbf627c535bcb0a8b |
class MyPyAnalyser(LintAnalyzer): <NEW_LINE> <INDENT> document_name = 'mypy_lint' <NEW_LINE> weight = 0.5 <NEW_LINE> def run(self, path): <NEW_LINE> <INDENT> cmd = ['mypy', '--ignore-missing-imports', '--allow-untyped-globals'] <NEW_LINE> for folder, _, filenames in os.walk(path): <NEW_LINE> <INDENT> for filename in fi... | An analyzer for MyPy linting | 62598f5f8c3a8732951f5b5e |
class IPPAPackageFilter(Interface): <NEW_LINE> <INDENT> name_filter = TextLine( title=_("Package name contains"), required=False) <NEW_LINE> series_filter = Choice( source=ArchiveSeriesVocabularyFactory(), required=False) <NEW_LINE> status_filter = Choice(vocabulary=SimpleVocabulary(( SimpleTerm(active_publishing_statu... | The interface used as the schema for the package filtering form. | 62598f5f91af0d3eaad39414 |
class ReplayBuffer: <NEW_LINE> <INDENT> def __init__(self, action_size, buffer_size, batch_size, seed): <NEW_LINE> <INDENT> self.action_size = action_size <NEW_LINE> self.memory = deque(maxlen=buffer_size) <NEW_LINE> self.batch_size = batch_size <NEW_LINE> self.experience = namedtuple("Experience", field_names=["state"... | Fixed-size buffer to store experience tuples. | 62598f5f796e427e5384dda0 |
class Attribute: <NEW_LINE> <INDENT> def __init__(self, name, value=None): <NEW_LINE> <INDENT> self.parent = None <NEW_LINE> self.prefix, self.name = splitPrefix(name) <NEW_LINE> self.setValue(value) <NEW_LINE> <DEDENT> def clone(self, parent=None): <NEW_LINE> <INDENT> a = Attribute(self.qname(), self.value) <NEW_LINE>... | An XML attribute object.
@ivar parent: The node containing this attribute
@type parent: L{element.Element}
@ivar prefix: The I{optional} namespace prefix.
@type prefix: basestring
@ivar name: The I{unqualified} name of the attribute
@type name: basestring
@ivar value: The attribute's value
@type value: basestring | 62598f5f56b00c62f0fb1ec3 |
class PerformanceWarning(Warning): <NEW_LINE> <INDENT> pass | Warning raised when there is a possible
performance impact. | 62598f5fd18da76e235b6c3c |
class BadRequest(CamundaException): <NEW_LINE> <INDENT> pass | Raised if an API request is somehow malformed.
| 62598f5fff9c53063f519c5f |
class UserEmailDetail(Resource): <NEW_LINE> <INDENT> @login_required <NEW_LINE> @require_me_or_admin <NEW_LINE> def delete(self, email, user_id=None, user=None): <NEW_LINE> <INDENT> if user is None: <NEW_LINE> <INDENT> user = user_or_404(user_id) <NEW_LINE> <DEDENT> email = user.emails.filter( UserEmail.email.ilike(ema... | Deletion of user email addresses | 62598f5fbf627c535bcb0a8d |
class CPlusPlusHighLine(HighLine): <NEW_LINE> <INDENT> def __init__(self, lineno, assembly_instructions): <NEW_LINE> <INDENT> HighLine.__init__(self, lineno) <NEW_LINE> self.assembly_instructions = [] <NEW_LINE> assembly_instructions = [i.strip() for i in assembly_instructions.split('\n') if i.strip()] <NEW_LINE> for i... | An abstract representation of a high level C++ line | 62598f5f21a7993f00c65586 |
class TopicAuditEntryData(sgqlc.types.Interface): <NEW_LINE> <INDENT> __schema__ = github_schema <NEW_LINE> __field_names__ = ('topic', 'topic_name') <NEW_LINE> topic = sgqlc.types.Field('Topic', graphql_name='topic') <NEW_LINE> topic_name = sgqlc.types.Field(String, graphql_name='topicName') | Metadata for an audit entry with a topic. | 62598f5fd164cc6175820586 |
class GCodeSpindleRPMMode(GCodeSpindleSpeedMode): <NEW_LINE> <INDENT> param_letters = set('D') <NEW_LINE> word_key = Word('G', 97) | G97: Spindle RPM Speed | 62598f608c3a8732951f5b61 |
class Graph(common.Drawable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Vertices = [] <NEW_LINE> self.Edges = set() <NEW_LINE> <DEDENT> def addVertex(self, vname): <NEW_LINE> <INDENT> if vname in self.Vertices: <NEW_LINE> <INDENT> raise common.DuplicateName <NEW_LINE> <DEDENT> self.Vertices.appen... | Graph base class
:var list Vertices: Vertices' names
:var set Edges: set of pairs (always sorted)
.. inheritance-diagram:: Graph | 62598f6063f4b57ef0085877 |
class train_dataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, cfg): <NEW_LINE> <INDENT> self.img_h = cfg.img_size[0] <NEW_LINE> self.img_w = cfg.img_size[1] <NEW_LINE> self.clip_length = 5 <NEW_LINE> self.videos = [] <NEW_LINE> self.all_seqs = [] <NEW_LINE> for folder in sorted(glob.glob(f'{cfg.train_data}/*')):... | No data augmentation.
Normalized from [0, 255] to [-1, 1], the channels are BGR due to cv2 and liteFlownet. | 62598f601d351010ab8f3155 |
class Solution: <NEW_LINE> <INDENT> def subsetsWithDup(self, S): <NEW_LINE> <INDENT> results = [] <NEW_LINE> if not S: <NEW_LINE> <INDENT> return results <NEW_LINE> <DEDENT> S.sort() <NEW_LINE> self.dfsHelper(S, 0, [], results) <NEW_LINE> return results <NEW_LINE> <DEDENT> def dfsHelper(self, S, start_index, subset, re... | @param S: A set of numbers.
@return: A list of lists. All valid subsets. | 62598f605e10d32532ce33ef |
class DocTestMismatch(Mismatch): <NEW_LINE> <INDENT> def __init__(self, matcher, with_nl): <NEW_LINE> <INDENT> self.matcher = matcher <NEW_LINE> self.with_nl = with_nl <NEW_LINE> <DEDENT> def describe(self): <NEW_LINE> <INDENT> s = self.matcher._describe_difference(self.with_nl) <NEW_LINE> if str_is_unicode or isinstan... | Mismatch object for DocTestMatches. | 62598f60287bf620b62711c8 |
class NestedListView(generics.ListAPIView): <NEW_LINE> <INDENT> pagination_class = PageNumberPagination <NEW_LINE> serializer_class = ParentSerializer <NEW_LINE> CONDITION_KEYS = { 'parent_column': 'parent_column__contains', 'child1_column': 'child1s__child1_column__contains', 'child2_column': 'child2s__child2_column__... | ネストしたリソースのlistメソッド
listだけ使いたいのでgenerics.ListAPIViewを使用 | 62598f606fece00bbaccafa3 |
class SubFactory(OrderedDeclaration): <NEW_LINE> <INDENT> def __init__(self, factory, **kwargs): <NEW_LINE> <INDENT> super(SubFactory, self).__init__() <NEW_LINE> self.defaults = kwargs <NEW_LINE> self.factory = factory <NEW_LINE> <DEDENT> def evaluate(self, create, extra, containers): <NEW_LINE> <INDENT> defaults = di... | Base class for attributes based upon a sub-factory.
Attributes:
defaults (dict): Overrides to the defaults defined in the wrapped
factory
factory (base.Factory): the wrapped factory | 62598f60167d2b6e312b658d |
class Double(Float): <NEW_LINE> <INDENT> def __new__(cls, stream): <NEW_LINE> <INDENT> obj = Float.__new__(cls, stream, precision="double") <NEW_LINE> return obj | Float from a binary stream, with index | 62598f6021a7993f00c65588 |
class SpiderResultManager(models.Manager): <NEW_LINE> <INDENT> def add_result(self, spider_task, item, unique=False, unique_keys=None, tags=None): <NEW_LINE> <INDENT> redis_server = redis.Redis(**settings.REDIS_CONFIG) <NEW_LINE> if not tags: <NEW_LINE> <INDENT> tags = [] <NEW_LINE> <DEDENT> sha = hashlib.sha256() <NEW... | spider result model manager
| 62598f600383005118f6cd17 |
class TestCompareXLSXFiles(ExcelComparisonTest): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.maxDiff = None <NEW_LINE> filename = 'chart_display_units08.xlsx' <NEW_LINE> test_dir = 'xlsxwriter/test/comparison/' <NEW_LINE> self.got_filename = test_dir + '_test_' + filename <NEW_LINE> self.exp_filename ... | Test file created by XlsxWriter against a file created by Excel. | 62598f605166f23b2e2429eb |
class AstroObject( models.Model ): <NEW_LINE> <INDENT> AstroObjectID = models.IntegerField( primary_key=True ) <NEW_LINE> LocusID = models.ForeignKey( Locus ) <NEW_LINE> Catalog = models.CharField( max_length=500 ) <NEW_LINE> IDinCatalog = models.IntegerField() <NEW_LINE> IsPointSource = models.BooleanField( default=Fa... | The class corresponds to the 'AstroObject' table. | 62598f60be8e80087fbbe66a |
class Modsel(SystemTestCase): <NEW_LINE> <INDENT> def test_aic_mod_sel_diff_tensor(self): <NEW_LINE> <INDENT> pipe_list = ['sphere', 'spheroid'] <NEW_LINE> tensors = [1e-9, (1e-9, 0, 0, 0)] <NEW_LINE> path = status.install_path + sep+'test_suite'+sep+'shared_data'+sep+'model_free'+sep+'S2_0.970_te_2048_Rex_0.149' <NEW_... | Class for testing model selection. | 62598f605e10d32532ce33f0 |
class YouTubePlaylistEntry(gdata.GDataEntry): <NEW_LINE> <INDENT> _tag = gdata.GDataEntry._tag <NEW_LINE> _namespace = gdata.GDataEntry._namespace <NEW_LINE> _children = gdata.GDataEntry._children.copy() <NEW_LINE> _attributes = gdata.GDataEntry._attributes.copy() <NEW_LINE> _children['{%s}description' % YOUTUBE_NAMESP... | Represents a playlist in YouTube. | 62598f60507cdc57c63a43ae |
class TopwordReceiver(BaseReceiver): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> <DEDENT> def options_from_front_end(self) -> TopwordAnalysisType: <NEW_LINE> <INDENT> if self._front_end_data["comparison_method"] == "Each Document to the Corpus": <NEW_LINE> <I... | This is the class that receives the options from front end. | 62598f60167d2b6e312b658f |
class Metric(collections.namedtuple('Metric', 'type labels')): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> @classmethod <NEW_LINE> def _from_dict(cls, info): <NEW_LINE> <INDENT> return cls( type=info['type'], labels=info.get('labels', {}), ) <NEW_LINE> <DEDENT> def _to_dict(self): <NEW_LINE> <INDENT> return { 'type':... | A specific metric identified by specifying values for all labels.
The preferred way to construct a metric object is using the
:meth:`~google.cloud.monitoring.client.Client.metric` factory method
of the :class:`~google.cloud.monitoring.client.Client` class.
:type type: str
:param type: The metric type name.
:type lab... | 62598f601d351010ab8f3157 |
class PaneNumber(UIControl): <NEW_LINE> <INDENT> WIDTH = 5 <NEW_LINE> HEIGHT = 5 <NEW_LINE> def __init__(self, pymux, arrangement_pane, on_click): <NEW_LINE> <INDENT> self.pymux = pymux <NEW_LINE> self.arrangement_pane = arrangement_pane <NEW_LINE> self.on_click = on_click <NEW_LINE> <DEDENT> def _get_index(self, cli):... | Number of panes, to be drawn in the middle of the pane. | 62598f60ff9c53063f519c63 |
class Terrain: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.data = (size*size)*[None] <NEW_LINE> <DEDENT> def initdata(self): <NEW_LINE> <INDENT> for i in range(self.size): <NEW_LINE> <INDENT> for j in range(self.size): <NEW_LINE> <INDENT> self.data[i*self.size + j]... | the terrain is composed of a grid of squares with all verticies at 0 height (initially).
height can be adjusted via a heightmap passed in a bitmap, where pixels and verticies are mapped 1-to-1
and the height of each vertex is set based on the red (0-255) value for the corresponding pixel and a scale parameter.
data/h... | 62598f60d18da76e235b6c3e |
class NUSimIngressACLEntryTemplate(NUSimResource): <NEW_LINE> <INDENT> __vspk_class__ = vsdk.NUIngressACLEntryTemplate <NEW_LINE> __unique_fields__ = ['externalID'] <NEW_LINE> __mandatory_fields__ = ['DSCP', 'action', 'locationType', 'etherType'] <NEW_LINE> __default_fields__ = { } <NEW_LINE> __get_parents__ = ['domain... | Represents a IngressACLEntryTemplate
Notes:
Defines the template of Ingress ACL entries | 62598f600383005118f6cd19 |
class Queen(BasePiece): <NEW_LINE> <INDENT> name = "queen" <NEW_LINE> step = strike = { DirectionEnum.VERT_FORWARD: SIZE, DirectionEnum.HORI_RIGHT: SIZE, DirectionEnum.VERT_BACK: SIZE, DirectionEnum.HORI_LEFT: SIZE, DirectionEnum.DIAG_LEFT_BACK: SIZE, DirectionEnum.DIAG_LEFT_FORWARD: SIZE, DirectionEnum.DIAG_RIGHT_BACK... | Queen
| 62598f60d164cc617582058a |
class DFAState(Generic[_TokenTypeT]): <NEW_LINE> <INDENT> def __init__(self, from_rule: str, nfa_set: Set[NFAState], final: NFAState): <NEW_LINE> <INDENT> assert isinstance(nfa_set, set) <NEW_LINE> assert isinstance(next(iter(nfa_set)), NFAState) <NEW_LINE> assert isinstance(final, NFAState) <NEW_LINE> self.from_rule =... | The DFAState object is the core class for pretty much anything. DFAState
are the vertices of an ordered graph while arcs and transitions are the
edges.
Arcs are the initial edges, where most DFAStates are not connected and
transitions are then calculated to connect the DFA state machines that have
different nontermina... | 62598f6021a7993f00c6558a |
class AWSClusterElement(ClusterElement): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(AWSClusterElement, self).__init__(*args, **kwargs) | Represents an AWS Cluster Element. Should be extended with concrete
element types. | 62598f6063f4b57ef0085879 |
class Theme(object): <NEW_LINE> <INDENT> def __init__(self, path): <NEW_LINE> <INDENT> self.path = os.path.abspath(path) <NEW_LINE> with open(os.path.join(self.path, 'info.json')) as fd: <NEW_LINE> <INDENT> self.info = i = json.load(fd) <NEW_LINE> <DEDENT> self.name = i['name'] <NEW_LINE> self.application = i['applicat... | This contains a theme's metadata.
:param path: The path to the theme directory. | 62598f609b70327d1c57e3bb |
class KanaKind(object): <NEW_LINE> <INDENT> def __init__(self, kind, kindIndex): <NEW_LINE> <INDENT> self.kind = kind <NEW_LINE> self.members = {} <NEW_LINE> self.sets = {} <NEW_LINE> self.setOrder = [] <NEW_LINE> self.kindIndex = kindIndex <NEW_LINE> <DEDENT> def __setitem__(self, key, value): <NEW_LINE> <INDENT> self... | Represents a kind of Kana, one of the alphabets. | 62598f60711fe17d825dfd0a |
class InvalidPublicKey(DatariumdbException): <NEW_LINE> <INDENT> pass | Raised if a public key is invalid. E.g.: :obj:`None`. | 62598f603eb6a72ae0389c56 |
class LoadResult(NamedTuple): <NEW_LINE> <INDENT> data: dict <NEW_LINE> success: bool <NEW_LINE> time_ns: int = -1 <NEW_LINE> def __eq__(self, other: object) -> bool: <NEW_LINE> <INDENT> assert isinstance(other, (LoadResult, tuple)) <NEW_LINE> return self.data == other[0] and self.success == other[1] <NEW_LINE> <DEDENT... | An encapsulation of the result of loading raw data, the data collected and
whether or not it succeeded. | 62598f60167d2b6e312b6592 |
class ReciboDetailView(DetailView, LoginRequiredMixin): <NEW_LINE> <INDENT> model = Recibo <NEW_LINE> object_context_name = 'recibo' <NEW_LINE> template_name = 'invoice/recibo_detail.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> context = super(ReciboDetailView, self).get_context_data(**kwa... | Muestra los detalles del :class:`Recibo` para agregar :class:`Producto`s
ir a la vista de impresión y realizar otras tareas relacionadas con
facturación | 62598f60be8e80087fbbe66e |
class Resize(object): <NEW_LINE> <INDENT> def __init__(self, output_size): <NEW_LINE> <INDENT> assert isinstance(output_size, (int, tuple)) <NEW_LINE> if isinstance(output_size, int): <NEW_LINE> <INDENT> self.output_size = (output_size, output_size) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> assert len(output_size) ... | Rescale the image in a sample to a given size.
Args:
output_size (tuple or int): Desired output size. If tuple, output is
matched to output_size. If int, smaller of image edges is matched
to output_size keeping aspect ratio the same. | 62598f608c3a8732951f5b67 |
class BaseAPI(API): <NEW_LINE> <INDENT> def _facet_str(self, *facets): <NEW_LINE> <INDENT> r = [] <NEW_LINE> for f in facets: <NEW_LINE> <INDENT> if isinstance(f, string_types): <NEW_LINE> <INDENT> r.append(f) <NEW_LINE> <DEDENT> elif isinstance(f, tuple) and len(f) == 2: <NEW_LINE> <INDENT> r.append("{}:{}".format(*f)... | Base class for communicating with the API of Shodan.
Note: All API methods are rate-limited to 1 request/second. | 62598f605e10d32532ce33f2 |
class TestPOSTOrderRequestTypeSubscriptions(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 testPOSTOrderRequestTypeSubscriptions(self): <NEW_LINE> <INDENT> pass | POSTOrderRequestTypeSubscriptions unit test stubs | 62598f60287bf620b62711ce |
class Location(object): <NEW_LINE> <INDENT> def __init__(self, name, probability=100, treasure=None, weapons=None, NPCs=None, description=None, attributes=None): <NEW_LINE> <INDENT> self.attributes = attributes <NEW_LINE> self._type = name <NEW_LINE> if not isinstance(attributes, type(None)) and "Names" in ... | Stores information relating to locations | 62598f60507cdc57c63a43b3 |
class Typed(Descriptor): <NEW_LINE> <INDENT> _expected_type = type(None) <NEW_LINE> def __set__(self, instance, value): <NEW_LINE> <INDENT> if not isinstance(value, self._expected_type): <NEW_LINE> <INDENT> raise TypeError("expected {}".format(self._expected_type)) <NEW_LINE> <DEDENT> super().__set__(instance, value) | Add type checking to attributes. | 62598f60d164cc617582058d |
class Molecule(Structure): <NEW_LINE> <INDENT> _fields_ = [ ('nDIM', c_int), ('energies', POINTER(c_double)), ('gamma_decay', POINTER(c_double)), ('gamma_pure_dephasing', POINTER(c_double)), ('mu', POINTER(c_complex)), ('rho', POINTER(c_complex)), ('rho_0', POINTER(c_complex)), ('abs_spectra', POINTER(c_double)), ('ems... | Parameters structure ctypes | 62598f60ff9c53063f519c67 |
class Solution: <NEW_LINE> <INDENT> def hashCode(self, key, HASH_SIZE): <NEW_LINE> <INDENT> result = 0 <NEW_LINE> for i in range(len(key)): <NEW_LINE> <INDENT> result *= 33 <NEW_LINE> result += ord(key[i]) <NEW_LINE> result %= HASH_SIZE <NEW_LINE> <DEDENT> return result | @param key: A String you should hash
@param HASH_SIZE: An integer
@return an integer | 62598f6076d4e153a661c228 |
class ChangeChallengeTTLSettingRequest(JDCloudRequest): <NEW_LINE> <INDENT> def __init__(self, parameters, header=None, version="v1"): <NEW_LINE> <INDENT> super(ChangeChallengeTTLSettingRequest, self).__init__( '/zones/{zone_identifier}/settings$$challenge_ttl', 'PATCH', header, version) <NEW_LINE> self.parameters = pa... | 指定访问者在成功完成一项挑战(如验证码)后允许访问您的网站多长时间。在TTL过期后,访问者将不得不完成新的挑战。我们建议设置为15-45分钟,并将尝试遵守任何超过45分钟的设置。 | 62598f605166f23b2e2429f1 |
class IMBDDataset(Dataset): <NEW_LINE> <INDENT> def __init__(self, data_list, target_list): <NEW_LINE> <INDENT> self.data_list = data_list <NEW_LINE> self.target_list = target_list <NEW_LINE> assert (len(self.data_list) == len(self.target_list)) <NEW_LINE> <DEDENT> def __len__(self): <NEW_LINE> <INDENT> return len(self... | IMBD sentiment dataset in PyTorch format;
inherits torch.utils.data.Dataset | 62598f608c3a8732951f5b68 |
class RHL9Guest(oz.RedHat.RedHatLinuxCDGuest): <NEW_LINE> <INDENT> def __init__(self, tdl, config, auto, output_disk, netdev, diskbus, macaddress): <NEW_LINE> <INDENT> oz.RedHat.RedHatLinuxCDGuest.__init__(self, tdl, config, auto, output_disk, netdev, diskbus, False, True, None, macaddress) <NEW_LINE> if self.tdl.arch ... | Class for RHL-9 installation. | 62598f604d74a7450cd589e4 |
class GameSim(): <NEW_LINE> <INDENT> def __init__(self, game_id, top_n=5, lsh_file=_utils.LSH_SAVENAME): <NEW_LINE> <INDENT> self.game_id = game_id <NEW_LINE> self.top_n = top_n <NEW_LINE> self.lsh_file = lsh_file <NEW_LINE> self.is_game = True <NEW_LINE> self.lsh = self.load_lsh() <NEW_LINE> try: <NEW_LINE> <INDENT> w... | Game similarity object | 62598f60d18da76e235b6c41 |
class Users(db.Document): <NEW_LINE> <INDENT> user_name = db.StringField(max_length=255, required=True) <NEW_LINE> session = db.StringField(max_length=255, required=True) <NEW_LINE> game = db.ReferenceField(Games, dbref=True) <NEW_LINE> field_battle = db.ReferenceField(Fields, dbref=True) <NEW_LINE> status = db.IntFiel... | model contain info about users
- field `session`: uniq session
- field `user`: name user from form
- field `game`: id game
- field `field_battle`: id fields
- field `status`: status of user
`0` - user wait oponent
`1` - user build power on field
`2` - user in games
`3` ... | 62598f60bf627c535bcb0a97 |
class Worker(threading.Thread): <NEW_LINE> <INDENT> def __init__(self, queue, done, timeout, multi_lock, multi_counter, max_multi): <NEW_LINE> <INDENT> threading.Thread.__init__(self) <NEW_LINE> self.queue = queue <NEW_LINE> self.done = done <NEW_LINE> self.timeout = timeout <NEW_LINE> self.multi_lock = multi_lock <NEW... | This thread is in charge of performing the tasks provided via
the main queue ``queue``. Across all ``worker`` threads, there can
only be the ``max_multi`` amount of multipart operations at a time or
deadlock occurs because ``worker`` threads are needed to perform the
part operations of multipart operations. The ``wor... | 62598f601d351010ab8f315e |
class DemoSelect(SelectEntity): <NEW_LINE> <INDENT> _attr_should_poll = False <NEW_LINE> def __init__( self, unique_id: str, name: str, icon: str, device_class: str | None, current_option: str | None, options: list[str], ) -> None: <NEW_LINE> <INDENT> self._attr_unique_id = unique_id <NEW_LINE> self._attr_name = name o... | Representation of a demo select entity. | 62598f605e10d32532ce33f4 |
class AdditionalPropertiesAnyType(object): <NEW_LINE> <INDENT> openapi_types = { 'name': 'str' } <NEW_LINE> attribute_map = { 'name': 'name' } <NEW_LINE> def __init__(self, name=None, local_vars_configuration=None): <NEW_LINE> <INDENT> if local_vars_configuration is None: <NEW_LINE> <INDENT> local_vars_configuration = ... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f609b70327d1c57e3c1 |
class RolesCheckboxes(widget.select.Checkboxes): <NEW_LINE> <INDENT> def __init__(self, uid: str, **kwargs): <NEW_LINE> <INDENT> items = [] <NEW_LINE> for role in auth.find_roles(): <NEW_LINE> <INDENT> if role.name == 'anonymous': <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> role_desc = role.description <NEW_LINE> ... | Roles Checkboxes Widget
| 62598f60925a0f43d25e764f |
class NotSelectLine(ValueError): <NEW_LINE> <INDENT> pass | to be raised when the line isn't actually a selection line | 62598f60711fe17d825dfd10 |
class CoqtailServer: <NEW_LINE> <INDENT> serv = None <NEW_LINE> @staticmethod <NEW_LINE> def start_server(sync: bool) -> int: <NEW_LINE> <INDENT> CoqtailHandler.sync = sync <NEW_LINE> CoqtailServer.serv = ThreadingTCPServer(("localhost", 0), CoqtailHandler) <NEW_LINE> CoqtailServer.serv.daemon_threads = True <NEW_LINE>... | A server through which Vim and Coqtail communicate. | 62598f6021a7993f00c65592 |
class Matrix: <NEW_LINE> <INDENT> def __init__(self, numbers, size, min_index=0): <NEW_LINE> <INDENT> self.numbers = list(numbers) <NEW_LINE> self.size = size <NEW_LINE> self.min_index = min_index <NEW_LINE> <DEDENT> def __getitem__(self, key): <NEW_LINE> <INDENT> return self.value_at(*key) <NEW_LINE> <DEDENT> def valu... | A square matrix created from a list of numbers.
Elements are accessible using matrix notation. Negative indexing is not
allowed.
:param list numbers: the elements of the matrix
:param int size: the width (also height) of the matrix
:param int min_index: the minimum index | 62598f6056b00c62f0fb1ed1 |
class BoxCoxTransformer(BaseEstimator, TransformerMixin): <NEW_LINE> <INDENT> def __init__(self, transformed_features, eps = 1e-8, copy = True): <NEW_LINE> <INDENT> self.eps = eps <NEW_LINE> self.copy = copy <NEW_LINE> self.transformed_features = transformed_features <NEW_LINE> <DEDENT> def fit(self, data, y = None): <... | BoxCox transformation on individual features. It wil be applied on
each feature (each column of the data matrix) with lambda evaluated
to maximise the log-likelihood
Parameters
----------
transformed_features : str 1d ndarray/list or "all"
Specify what features are to be transformed.
- "all" (default) : All fe... | 62598f605e10d32532ce33f5 |
class UnsafeInputError(Error): <NEW_LINE> <INDENT> pass | A subclass of `Error` raised if user input is possibly insecure. | 62598f60507cdc57c63a43b9 |
class Solution(object): <NEW_LINE> <INDENT> def getIntersectionNode(self, headA, headB): <NEW_LINE> <INDENT> p1 = headA; p2 = headB <NEW_LINE> while p1 and p2: <NEW_LINE> <INDENT> p1 = p1.next <NEW_LINE> p2 = p2.next <NEW_LINE> <DEDENT> p1_prime = headA <NEW_LINE> while p1: <NEW_LINE> <INDENT> p1 = p1.next <NEW_LINE> p... | Improvement of previous solution.
p1_prime and p2_prime will be same sooner or later. If there is intersaction,
they will meet at the intersaction node. Otherwise, they will point to None
at same time. | 62598f60bf627c535bcb0a9b |
class ColorFabPanel(bpy.types.Panel): <NEW_LINE> <INDENT> bl_label = "ColorFab Panel" <NEW_LINE> bl_space_type = 'VIEW_3D' <NEW_LINE> bl_region_type = 'TOOLS' <NEW_LINE> def draw(self, context): <NEW_LINE> <INDENT> layout = self.layout <NEW_LINE> row = layout.row() <NEW_LINE> row.label(text="Load file") <NEW_LINE> spli... | Creates a Custom Panel to Load and Save File, and Voxelize Models | 62598f6066673b3332c2f9d7 |
class TestConnection(TestCase): <NEW_LINE> <INDENT> def _setup_config(self): <NEW_LINE> <INDENT> config = DotDict(); <NEW_LINE> config.crashstorage_class = FakeCrashStore <NEW_LINE> return config <NEW_LINE> <DEDENT> def test_constructor(self): <NEW_LINE> <INDENT> config = self._setup_config() <NEW_LINE> ncs = RMQNewCra... | Test PostgreSQLBase class. | 62598f60ac7a0e7691f71b2e |
class Axis(object): <NEW_LINE> <INDENT> def __init__(self, name, values): <NEW_LINE> <INDENT> if not isinstance(name, str): <NEW_LINE> <INDENT> raise TypeError("type of {} is not str".format(repr(name))) <NEW_LINE> <DEDENT> values = np.atleast_1d(values) <NEW_LINE> if values.ndim > 1: <NEW_LINE> <INDENT> raise ValueErr... | A named sequence of values. Can be used as non-indexable axis in Cube.
Name is a string. Values are stored in one-dimensional numpy array. | 62598f6056b00c62f0fb1ed3 |
class non_nesting_atomic(ContextDecorator): <NEW_LINE> <INDENT> def __init__(self, using: Union[str, Callable], savepoint: bool = True) -> None: <NEW_LINE> <INDENT> self.using = using <NEW_LINE> self.atomic_context_decorator = Atomic(self.using, savepoint) <NEW_LINE> <DEDENT> def __enter__(self) -> None: <NEW_LINE> <IN... | This class acts as either decorator or context manager.
It discovers when the callable or code is being run in nested database transaction and raises exception.
Otherwise it wraps callable or code in database transaction. | 62598f6030c21e258be97e20 |
class Population: <NEW_LINE> <INDENT> def __init__(self, size): <NEW_LINE> <INDENT> self.generation = 0 <NEW_LINE> self.idv_tab = [] <NEW_LINE> self.gen_fit_score = [] <NEW_LINE> for i in range(size): <NEW_LINE> <INDENT> self.idv_tab.append(Individu(self)) <NEW_LINE> <DEDENT> <DEDENT> def get_idv(self, index): <NEW_LIN... | Classe simulant un ensemble d'individu au sein d'un algorithme
génétique nommé Population. Une population est dépendante d'un
numéro de génération qui correspondra au degré d'évolution de
l'espèce.
Attributs
---------
generation
Numéro de génération, équivalent au degré d'évolution de
l'espèce, plus il est hau... | 62598f606fece00bbaccafb1 |
class Cloner(object): <NEW_LINE> <INDENT> implements(zope.filerepresentation.interfaces.IDirectoryFactory) <NEW_LINE> def __init__(self, context): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> <DEDENT> def __call__(self, name): <NEW_LINE> <INDENT> return removeSecurityProxy(self.context).__class__() | `IContainer` to `IDirectoryFactory` adapter that clones
This adapter provides a factory that creates a new empty container
of the same class as it's context. | 62598f60507cdc57c63a43bb |
@attr.s(init=False, auto_attribs=True) <NEW_LINE> class MarkDecorator: <NEW_LINE> <INDENT> mark: Mark <NEW_LINE> def __init__(self, mark: Mark, *, _ispytest: bool = False) -> None: <NEW_LINE> <INDENT> check_ispytest(_ispytest) <NEW_LINE> self.mark = mark <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <... | A decorator for applying a mark on test functions and classes.
``MarkDecorators`` are created with ``pytest.mark``::
mark1 = pytest.mark.NAME # Simple MarkDecorator
mark2 = pytest.mark.NAME(name1=value) # Parametrized MarkDecorator
and can then be applied as decorators to test functions::
@... | 62598f60d164cc6175820596 |
class Movie(): <NEW_LINE> <INDENT> def __init__(self, title, story, poster_image, movie_trailer,rating, director): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.director = director <NEW_LINE> self.story = story <NEW_LINE> self.poster_image_url = poster_image <NEW_LINE> self.trailer_youtube_url = movie_trailer ... | Instaneous class for Movies and its attribute | 62598f60ac7a0e7691f71b30 |
class MeetupDayException(Exception): <NEW_LINE> <INDENT> pass | Exception for a day that is out of bounds | 62598f60be8e80087fbbe678 |
class sauvola_threshold(PluginFunction): <NEW_LINE> <INDENT> return_type = ImageType([ONEBIT], "output") <NEW_LINE> self_type = ImageType([GREYSCALE]) <NEW_LINE> args = Args([Int("region size", default=15), Real("sensitivity", default=0.5), Int("dynamic range", range=(1, 255), default=128), Int("lower bound", range=(0,... | Creates a binary image using Sauvola's adaptive algorithm.
Sauvola, J. and M. Pietikainen. 2000. Adaptive document image
binarization. *Pattern Recognition* 33: 225--236.
Like the QGAR library, there are two extra global thresholds for
the lightest and darkest regions.
*region_size*
The size of the region in whic... | 62598f6063f4b57ef008587f |
class GADisulphidePeptideChromosome(GAPeptideChromosome): <NEW_LINE> <INDENT> constraint_type = 'SS' | Represents an arbitrary disulphide wrapped peptide sequence chromosome. | 62598f601d351010ab8f3164 |
class Hero(pygame.sprite.Sprite): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pygame.sprite.Sprite.__init__(self) <NEW_LINE> self.image = load_image('hero.png').convert_alpha() <NEW_LINE> self.velocity = [0, 0] <NEW_LINE> self._position = [0, 0] <NEW_LINE> self._old_position = self.position <NEW_LINE> s... | Our Hero
The Hero has three collision rects, one for the whole sprite "rect" and
"old_rect", and another to check collisions with walls, called "feet".
The position list is used because pygame rects are inaccurate for
positioning sprites; because the values they get are 'rounded down' to
as integers, the sprite would... | 62598f60ff9c53063f519c71 |
class Meta: <NEW_LINE> <INDENT> model = Tag <NEW_LINE> fields = ('id', 'name') <NEW_LINE> read_only_fields = ('id',) | Define some data. | 62598f6076d4e153a661c232 |
class RemoteRepoExistsError(Error): <NEW_LINE> <INDENT> pass | Thrown when a remote Github repo already exists | 62598f600383005118f6cd27 |
class SubscriptionRestView(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated,) <NEW_LINE> def get(self, request, **kwargs): <NEW_LINE> <INDENT> customer, _created = Customer.get_or_create( subscriber=subscriber_request_callback(self.request), ) <NEW_LINE> if not customer.subscription: <NEW_LINE> <INDE... | API Endpoints for the Subscription object. | 62598f6066673b3332c2f9db |
class WalkwayRoom(DefaultRoom): <NEW_LINE> <INDENT> messages = ( "Intercom: \"Welcome to The Park!\"", "Intercom: \"By participating in rides and attractions you can earn Park Points!\"", "Intercom: \"Spend your Park Points at any gift shop to get wonderful prizes!\"", ) <NEW_LINE> cur_message_index = 0 <NEW_LINE> def ... | This is the walkway from the Entrance to the Courtyard.
It has an intercom that gives players a personalized intro into the park while
they travel along an automated walkway. | 62598f603eb6a72ae0389c62 |
class Portfolio(object): <NEW_LINE> <INDENT> def __init__(self, books=None): <NEW_LINE> <INDENT> self.books = books <NEW_LINE> <DEDENT> def positions_by_book(self): <NEW_LINE> <INDENT> positions = None <NEW_LINE> for book in self.books(): <NEW_LINE> <INDENT> positions[book] = book.positions() <NEW_LINE> <DEDENT> <DEDEN... | TODO - does this derive from anything? Sort of depends on whether or not we are planning on storing it. | 62598f6056b00c62f0fb1ed7 |
class LLSMPostProcessStub(object): <NEW_LINE> <INDENT> def __init__(self, channel): <NEW_LINE> <INDENT> self.GetList = channel.unary_unary( '/LLSMPostProcess/GetList', request_serializer=llsm__post__process__pb2.Empty.SerializeToString, response_deserializer=llsm__post__process__pb2.AvailableServices.FromString, ) <NEW... | Missing associated documentation comment in .proto file. | 62598f6030c21e258be97e23 |
class MixExistsError(MixFSError): <NEW_LINE> <INDENT> pass | Raised when trying to set a name evaluating to an existing key.
See help(MixFSError) for accurate signature. | 62598f6063f4b57ef0085880 |
class SessionAPI(object): <NEW_LINE> <INDENT> def __init__(self, base_url): <NEW_LINE> <INDENT> self.base_url = base_url <NEW_LINE> <DEDENT> def _req(self, verb, path, body=None): <NEW_LINE> <INDENT> response = requests.request(verb, url_path_join(self.base_url, 'api/sessions', path), data=body) <NEW_LINE> if 400 <= re... | Wrapper for notebook API calls. | 62598f60a8ecb03325870824 |
class Defends: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def defend(id): <NEW_LINE> <INDENT> character = get_object_or_404(Character, pk=id) <NEW_LINE> healing_value = character.hp * character.defence / 200 <NEW_LINE> if character.hp - character.current_hp < healing_value: <NEW_LINE> <INDENT> character.current_hp +=... | Heals your character, restores mana and stamina | 62598f601d351010ab8f3167 |
class Constant(lasagne.init.Constant): <NEW_LINE> <INDENT> def __init__(self, val=0.0): <NEW_LINE> <INDENT> super(Constant, self).__init__(val=val) | Initialize weights with constant value. | 62598f60711fe17d825dfd18 |
class MeasurementGroup(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=150) <NEW_LINE> description = models.TextField() <NEW_LINE> created = models.DateTimeField(auto_now_add=True) <NEW_LINE> group_type = models.CharField(max_length=50) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return ... | For example a workout or event
| 62598f6066673b3332c2f9dd |
class FiniteMap(Generic[A, B], Mapping[A, B], ABC): <NEW_LINE> <INDENT> @abstractmethod <NEW_LINE> def source(self) -> FiniteSet[A]: <NEW_LINE> <INDENT> ... <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def target(self) -> FiniteSet[B]: <NEW_LINE> <INDENT> ... | A finite map is a mapping between two finite sets. | 62598f603eb6a72ae0389c64 |
class ItemRevisions(BaseWikidataAPIQueryTriggerView): <NEW_LINE> <INDENT> default_fields = {'itemid': 'Q12345'} <NEW_LINE> query_params = {'action': 'query', 'prop': 'revisions', 'titles': None, 'rvlimit': 50, 'rvprop': 'ids|timestamp|user|size|comment', 'format': 'json'} <NEW_LINE> def get_query(self): <NEW_LINE> <IND... | Trigger for revisions to a specified Wikidata item. | 62598f608c3a8732951f5b74 |
class UnknownError(PushNotifyError): <NEW_LINE> <INDENT> pass | Raised when the notification server returns an unknown error.
Args:
args[0]: A string containing a message from the server.
args[1]: An integer containing an error code from the server. | 62598f60be8e80087fbbe67c |
class DT_raw(Datatype): <NEW_LINE> <INDENT> pass | pass on data, identical to base class | 62598f608c3a8732951f5b75 |
class LuongDecoder(nn.Module): <NEW_LINE> <INDENT> def __init__(self, insize,hidden_size,out_size,drop): <NEW_LINE> <INDENT> super(LuongDecoder, self).__init__() <NEW_LINE> self.rnn_nets=nn.ModuleList() <NEW_LINE> self.drops=nn.ModuleList() <NEW_LINE> self.concat=nn.Linear(hidden_size*2,out_size) <NEW_LINE> for d in dr... | docstring for [object Object]. | 62598f606fece00bbaccafb7 |
class FileAdmin(sqla.ModelView): <NEW_LINE> <INDENT> form_columns = ['name', 'path'] <NEW_LINE> form_overrides = { 'path': form.FileUploadField } <NEW_LINE> form_args = { 'path': { 'label': 'File', 'base_path': file_path, 'allow_overwrite': True } } | File view definition | 62598f6076d4e153a661c236 |
class TestSQSHandler(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.s3_mock = mock_s3() <NEW_LINE> self.s3_mock.start() <NEW_LINE> self.sqs_mock = mock_sqs() <NEW_LINE> self.sqs_mock.start() <NEW_LINE> self.sqs_queue_name = "test_query_job_q_name" <NEW_LINE> self.sqs = boto3.resource(... | Unit tests for the SQSHandler class | 62598f601f037a2d8b9e3716 |
class IgneousRock(Element): <NEW_LINE> <INDENT> @property <NEW_LINE> def shc(self) -> float: <NEW_LINE> <INDENT> return 1.000 | Igneous rock class | 62598f601d351010ab8f316a |
class NormalisationLayer(lasagne.layers.Layer): <NEW_LINE> <INDENT> def __init__(self, incoming, norm_sum=1.0, allow_negative=False, **kwargs): <NEW_LINE> <INDENT> super(NormalisationLayer, self).__init__(incoming, **kwargs) <NEW_LINE> self.norm_sum = norm_sum <NEW_LINE> self.allow_negative = allow_negative <NEW_LINE> ... | Layer which normalises the input over the first axis.
Normalisation is achieved by simply dividing by the sum. | 62598f60796e427e5384ddb8 |
class DirectoryNumberRefJson(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'server_id': 'int', 'url': 'str', 'extension': 'str', 'description': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'server_id': 'serverId', 'url': 'url', 'extension': 'extension', 'description': 'description' } <NEW_LINE> def __... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 62598f60ac7a0e7691f71b36 |
class UpdateStorageInstanceForm(forms.ModelForm): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(UpdateStorageInstanceForm, self).__init__(*args, **kwargs) <NEW_LINE> self.fields['parent'].queryset = StorageInstance.objects.exclude(id__exact=self.instance.id) <NEW_LINE> <DEDENT> clas... | Form for updating an existing storage instance | 62598f600383005118f6cd2d |
class DatetimeHasZoneError(SuretimeValueError): <NEW_LINE> <INDENT> pass | Raised when a zone is unexpectedly present in a datetime. | 62598f6021a7993f00c6559e |
class VarSlice(AST): <NEW_LINE> <INDENT> def __init__(self, var, slice, set=False, setval=None): <NEW_LINE> <INDENT> self.var = var <NEW_LINE> self.slice = slice <NEW_LINE> self.set = set <NEW_LINE> self.setval = setval | The VarSlice node defines slice which needs to be accessed. | 62598f6056b00c62f0fb1edd |
class UserForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = [ 'username', 'first_name', 'last_name', 'email', 'password' ] <NEW_LINE> widgets = { 'password': forms.PasswordInput(render_value=True) } <NEW_LINE> labels = { 'username': 'Nome de usuário', 'first_nam... | Form for user registration. | 62598f6063f4b57ef0085883 |
class BaseDeviceHandler(object): <NEW_LINE> <INDENT> def __init__(self, com): <NEW_LINE> <INDENT> self.com = com <NEW_LINE> self.open() <NEW_LINE> <DEDENT> def open(self): <NEW_LINE> <INDENT> self.com.open() <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> self.com.close() | Base device handler.
This is the base class of device handlers.
Note:
This class itself is not used, but it is inherited by
child classes and used.
Args:
com (communicator): Communicator instance. | 62598f604d74a7450cd589ec |
class Config(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super(Config, self).__init__() <NEW_LINE> self.project_path = os.getcwd() <NEW_LINE> <DEDENT> def init_config(self): <NEW_LINE> <INDENT> shutil.copy(os.path.dirname(os.path.abspath(__file__)) + '/template.config.json', self.project_path +... | docstring for . | 62598f606fece00bbaccafbb |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.