code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class RawSPTableToPG(RawSPToPG): <NEW_LINE> <INDENT> table = luigi.Parameter() <NEW_LINE> def requires(self): <NEW_LINE> <INDENT> return RawDataToPG.requires(self) <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> schema_cmd = ("mdb-schema -T %s %s postgres | " "sed -e 's/Postgres_Unknown 0x10/TEXT/' | " 'psql "db... | Imports single Safety Pad tables
| 6259902b287bf620b6272bd9 |
class EngineServer(object): <NEW_LINE> <INDENT> def __init__(self, engine): <NEW_LINE> <INDENT> self._engine = engine <NEW_LINE> <DEDENT> def start_workflow(self, rpc_ctx, workflow_name, workflow_input, params): <NEW_LINE> <INDENT> LOG.info( "Received RPC request 'start_workflow'[rpc_ctx=%s," " workflow_name=%s, workfl... | RPC Engine server. | 6259902b711fe17d825e148e |
class TestBaseFCM(object): <NEW_LINE> <INDENT> def test_base_manager_stores_data(self): <NEW_LINE> <INDENT> b = BaseFlowControlManager(65535) <NEW_LINE> assert b.initial_window_size == 65535 <NEW_LINE> assert b.window_size == 65535 <NEW_LINE> assert b.document_size is None <NEW_LINE> <DEDENT> def test_base_manager_stor... | Tests the base flow control manager. | 6259902b0a366e3fb87dd9d0 |
class LOOT_375: <NEW_LINE> <INDENT> pass | Guild Recruiter | 6259902b30c21e258be997f4 |
class PasswordCheckRequest(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._password = "" <NEW_LINE> self._password_confirmation = "" <NEW_LINE> self._policy = None <NEW_LINE> self._pwquality_settings = None <NEW_LINE> self._username = "root" <NEW_LINE> self._fullname = "" <NEW_LINE> self._sec... | A wrapper for a password check request.
This in general means the password to be checked as well as its validation criteria
such as minimum length, if it can be empty, etc. | 6259902b9b70327d1c57fd6c |
class EmailHandler(object): <NEW_LINE> <INDENT> def __init__(self, successor=None): <NEW_LINE> <INDENT> print("EmailHandler - set _successor ", type(successor)) <NEW_LINE> self._successor = successor <NEW_LINE> <DEDENT> def handle_mail(self, subject, mail): <NEW_LINE> <INDENT> print('HANDLE_REQUEST IN BASE CLASS ') <NE... | an interface for handling mails | 6259902b1f5feb6acb163bda |
class Route(SubResource): <NEW_LINE> <INDENT> _validation = { 'next_hop_type': {'required': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'address_prefix': {'key': 'properties.addressPrefix', 'type': 'str'}, 'next_hop_type': {'key': 'properties.nextHopType', 'type': 'str'}, 'next_hop_ip_add... | Route resource.
All required parameters must be populated in order to send to Azure.
:param id: Resource ID.
:type id: str
:param address_prefix: The destination CIDR to which the route applies.
:type address_prefix: str
:param next_hop_type: Required. The type of Azure hop the packet should be
sent to. Possible val... | 6259902b50485f2cf55dbf65 |
class CustomFieldSelection(Base): <NEW_LINE> <INDENT> __tablename__ = "customfieldselection" <NEW_LINE> __table_args__ = {"schema": dbname, "keep_existing": True} <NEW_LINE> encodedKey = Column(String, primary_key=True) <NEW_LINE> id = Column(String) <NEW_LINE> value = Column(String) <NEW_LINE> score = Column(Integer) ... | CustomFieldValue table. | 6259902bc432627299fa3fde |
class UniversalParser(object): <NEW_LINE> <INDENT> parser = cparser <NEW_LINE> def __init__(self, parser): <NEW_LINE> <INDENT> self.parser = parser <NEW_LINE> <DEDENT> def parse_args(self): <NEW_LINE> <INDENT> self.args = self.parser.parse_args() <NEW_LINE> for arg in var(self.args): <NEW_LINE> <INDENT> try: <NEW_LINE>... | Store everything as a string except bool arguments
so that you can evaluate them | 6259902bd6c5a102081e3111 |
class NamespaceInjector(SONManipulator): <NEW_LINE> <INDENT> def transform_incoming(self, son, collection): <NEW_LINE> <INDENT> son["_ns"] = collection.name() <NEW_LINE> return son | A son manipulator that adds the _ns field.
| 6259902b796e427e5384f767 |
class ApplicationGatewayFrontendPort(SubResource): <NEW_LINE> <INDENT> _validation = { 'etag': {'readonly': True}, 'type': {'readonly': True}, 'provisioning_state': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'key': 'etag', 'ty... | Frontend port of an application gateway.
Variables are only populated by the server, and will be ignored when sending a request.
:param id: Resource ID.
:type id: str
:param name: Name of the frontend port that is unique within an Application Gateway.
:type name: str
:ivar etag: A unique read-only string that changes... | 6259902b5e10d32532ce40f9 |
class UpdateTrackingList(): <NEW_LINE> <INDENT> def __init__(self, productURL, chatId): <NEW_LINE> <INDENT> print("Enter: UpdateTrackingList class") <NEW_LINE> self.productDetails = ProductInfo(productURL, chatId) <NEW_LINE> <DEDENT> def addToTrackingList(self): <NEW_LINE> <INDENT> print("Enter: Add to tracking list") ... | Update the changes in tracking list | 6259902b3eb6a72ae038b650 |
class NetworkAdapterDoesNotExistException(MCVirtException): <NEW_LINE> <INDENT> pass | The network adapter does not exist | 6259902bd4950a0f3b111633 |
class Crc32Fixup(Fixup): <NEW_LINE> <INDENT> def __init__(self, ref): <NEW_LINE> <INDENT> Fixup.__init__(self) <NEW_LINE> self.ref = ref <NEW_LINE> <DEDENT> def fixup(self): <NEW_LINE> <INDENT> self.context.defaultValue = "0" <NEW_LINE> stuff = self.context.findDataElementByName(self.ref).getValue() <NEW_LINE> if stuff... | Standard CRC32 as defined by ISO 3309. Used by PNG, ZIP, etc. | 6259902bd10714528d69ee82 |
class SimulationMetadata: <NEW_LINE> <INDENT> def __init__(self, path: Path, format: str): <NEW_LINE> <INDENT> self.path = Path(path) <NEW_LINE> self.format = format <NEW_LINE> if self.path.is_dir(): <NEW_LINE> <INDENT> self.path = self.path / f"{format}.out" <NEW_LINE> <DEDENT> self.data_path = self.path.parent <NEW_L... | Pluto simulation metadata reader and parser
Read metadata from `format.out` files (e.g. `dbl.out`, `flt.out`).
Attributes:
path (Path): path to outputfile
file_mode (str): PLUTO output in `"single"` or `"multiple"` files.
vtk_offsets (:obj:`dict` of :obj:`int`): Byte offsets of data in VTK file
t (:ob... | 6259902b9b70327d1c57fd6e |
class SshCounterAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('name','script') <NEW_LINE> search_fields = ('name','script') | The **SshCounterAdmin** class represents the **SshCounter** model administration page | 6259902b66673b3332c313dc |
@ddt.ddt <NEW_LINE> @skip_unless_lms <NEW_LINE> class TestRegisterRetiredUsername(TestCase): <NEW_LINE> <INDENT> INVALID_ACCT_ERR_MSG = ('An account with the Public Username', 'already exists.') <NEW_LINE> INVALID_ERR_MSG = ('It looks like', 'belongs to an existing account. Try again with a different username.') <NEW_L... | Tests to ensure that retired usernames can no longer be used in registering new accounts. | 6259902b796e427e5384f769 |
class FlowFilter(filters.FilterSet): <NEW_LINE> <INDENT> time_stamp = django_filters.DateTimeFilter(name="time_stamp", lookup_expr='gte') <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = LectureFlow <NEW_LINE> fields = ['time_stamp'] | Gives the possibility to only return votes after a time
eg.: http://localhost:8000/lecture/3/flow/?time_stamp=2017-03-13%2017:10:10
returns only votes after 2017-03-13%2016:10:10 | 6259902b8a43f66fc4bf3170 |
class UserInfo(AbstractUserInfo): <NEW_LINE> <INDENT> gender_choice = ( (1, '男'), (2, '女'), ) <NEW_LINE> gender = models.IntegerField(verbose_name='性别', choices=gender_choice, default=1) <NEW_LINE> depart = models.ForeignKey(verbose_name='部门', to='Department') <NEW_LINE> email = models.EmailField(verbose_name='邮箱') <NE... | 用户表 | 6259902b15baa72349462f85 |
class BitcoinFeefilter(BitcoinMessage): <NEW_LINE> <INDENT> cmd = "feefilter" <NEW_LINE> fields_desc = [ XLELongField("feerate", 0), ] | Added in protocol version 70013.
The feefilter message is a request to the receiving peer to not relay any transaction inv messages to the sending peer where the fee rate for the transaction is below the fee rate specified in the feefilter message. | 6259902b8a349b6b43687227 |
class Controller(rest.RestController): <NEW_LINE> <INDENT> nodes = node.NodesController() <NEW_LINE> ports = port.PortsController() <NEW_LINE> chassis = chassis.ChassisController() <NEW_LINE> drivers = driver.DriversController() <NEW_LINE> @expose.expose(V1) <NEW_LINE> def get(self): <NEW_LINE> <INDENT> return V1.conve... | Version 1 API controller root. | 6259902b8c3a8732951f7545 |
class GreaterThanOp(UnaryRule): <NEW_LINE> <INDENT> grammar = omit(re.compile(r"after|>", re.IGNORECASE)), attr('op', SimpleValue) | Greater than operator.
Supports queries like author-count > 2000 or date after 10-2000. | 6259902b30c21e258be997f9 |
class BookInstance(models.Model): <NEW_LINE> <INDENT> id = models.UUIDField(primary_key=True, default=uuid.uuid4, help_text="Уникальный ID для конкретной книги во всей библиотеке") <NEW_LINE> book = models.ForeignKey("Book", on_delete=models.SET_NULL, null=True) <NEW_LINE> imprint = models.CharField(max_length=200) <NE... | Модель представляет определенную копию книги (которая может найдена в библиотеке) | 6259902b1f5feb6acb163bde |
class SymbolExpression(AtomExpression): <NEW_LINE> <INDENT> def evaluate(self, environment, debug): <NEW_LINE> <INDENT> if debug: <NEW_LINE> <INDENT> return self.track_result(environment.retrieve_definition(self).copy()) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> return self.track_result(environment.retrieve_definit... | A symbol. (Any atom which isn't a number). | 6259902bec188e330fdf9881 |
@view_defaults( context=IRootPool, name='password_reset', ) <NEW_LINE> class PasswordResetView: <NEW_LINE> <INDENT> def __init__(self, context: IRootPool, request: IRequest): <NEW_LINE> <INDENT> self.context = context <NEW_LINE> self.request = request <NEW_LINE> <DEDENT> @api_view(request_method='OPTIONS') <NEW_LINE> d... | Reset a user password. | 6259902b6fece00bbaccc99d |
class Query(object): <NEW_LINE> <INDENT> def __init__(self, query=None): <NEW_LINE> <INDENT> self.params = {} <NEW_LINE> if query: <NEW_LINE> <INDENT> self.parse(query) <NEW_LINE> <DEDENT> <DEDENT> def parse(self, query): <NEW_LINE> <INDENT> if isinstance(query, dict): <NEW_LINE> <INDENT> self.params = {k:urllib.unquot... | Represents a URL query comprised of zero or more unique parameters and their
respective values.
http://tools.ietf.org/html/rfc3986#section-3.4
Repeated URL parameters, like 'a=1&a=2', are deprecated to their first value,
'a=1'. This is a tradeoff in favor of ease of use over the rarely needed
flexibility of repeate... | 6259902bd53ae8145f919452 |
class TApplicationException(TException): <NEW_LINE> <INDENT> UNKNOWN = 0 <NEW_LINE> UNKNOWN_METHOD = 1 <NEW_LINE> INVALID_MESSAGE_TYPE = 2 <NEW_LINE> WRONG_METHOD_NAME = 3 <NEW_LINE> BAD_SEQUENCE_ID = 4 <NEW_LINE> MISSING_RESULT = 5 <NEW_LINE> INTERNAL_ERROR = 6 <NEW_LINE> PROTOCOL_ERROR = 7 <NEW_LINE> def __init__(sel... | Application level thrift exceptions. | 6259902b66673b3332c313de |
@dataclass <NEW_LINE> class ActionResult: <NEW_LINE> <INDENT> result: Any | Library unified action result object. | 6259902b23e79379d538d4fa |
class PerlSubIdentify(PerlPackage): <NEW_LINE> <INDENT> homepage = "http://search.cpan.org/~rgarcia/Sub-Identify-0.14/lib/Sub/Identify.pm" <NEW_LINE> url = "http://search.cpan.org/CPAN/authors/id/R/RG/RGARCIA/Sub-Identify-0.14.tar.gz" <NEW_LINE> version('0.14', '014f19e72698b6a2cbcb54adc9691825') | Retrieve names of code references | 6259902b287bf620b6272be1 |
@namespace('/chat') <NEW_LINE> class ChatNamespace(BaseNamespace, RoomsMixin, BroadcastMixin): <NEW_LINE> <INDENT> user_list = [] <NEW_LINE> def initialize(self): <NEW_LINE> <INDENT> log.info("Chat session started") <NEW_LINE> <DEDENT> def on_file(self, msg): <NEW_LINE> <INDENT> user = self.socket.session['nick'] <NEW_... | Implement API for websocket channels | 6259902b6e29344779b01640 |
class HistoryEntry(TableBase): <NEW_LINE> <INDENT> __tablename__ = 'history_entries' <NEW_LINE> id = IDColumn() <NEW_LINE> __table_args__ = (UniqueConstraint('commit', 'status'), ) <NEW_LINE> commit = Column( Unicode(), nullable=False) <NEW_LINE> status = Column( ForeignKey(Status.ident), nullable=False) <NEW_LINE> dat... | Stores the database's history. | 6259902b73bcbd0ca4bcb282 |
class Placeholder(object): <NEW_LINE> <INDENT> pass | A placeholder used instead of a state or a history browser. | 6259902bd18da76e235b7946 |
class DupeFinderBase(FWSerializable): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def verify(self, spec1, spec2): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def query(self, spec): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> @serialize... | This serves an Abstract class for implementing Duplicate Finders | 6259902b0a366e3fb87dd9d8 |
class Profile(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=50) <NEW_LINE> sic_code = models.CharField(max_length=10, blank=True, null=True) <NEW_LINE> class Meta: <NEW_LINE> <INDENT> verbose_name = 'Profile' <NEW_LINE> <DEDENT> def __unicode__(self): <NEW_LINE> <INDENT> return self.name | Company description type and associated SIC code | 6259902b8a43f66fc4bf3174 |
class Node: <NEW_LINE> <INDENT> def __init__(self, state, parent, cost): <NEW_LINE> <INDENT> self.state = state <NEW_LINE> self.parent = parent <NEW_LINE> self.cost = cost | A node represents a particular point in search space, contained within
the tree of state spaces to search for a goal state. | 6259902b6fece00bbaccc9a0 |
class TestCreateS3KeyResponseKeys(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 testCreateS3KeyResponseKeys(self): <NEW_LINE> <INDENT> pass | CreateS3KeyResponseKeys unit test stubs | 6259902bd4950a0f3b111636 |
class fetchgroup_indom(object): <NEW_LINE> <INDENT> def __init__(self, pmtype, num): <NEW_LINE> <INDENT> stss_t = c_int * num <NEW_LINE> values_t = pmAtomValue * num <NEW_LINE> icodes_t = c_int * num <NEW_LINE> inames_t = c_char_p * num <NEW_LINE> self.sts = c_int() <NEW_LINE> self.stss = stss_t() <NEW_LINE> self.pmtyp... | An internal class to receive value/status for an indom of
items. It may be called as if it were a function object to
create an list of tuples containing instance-code/-name/value
information. Each value is a function object that decodes
the embedded pmAtomValue, which was set at the most recent
fetch() call. | 6259902b8c3a8732951f7549 |
class StandardManager(OptimizerManager): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._optimizer = None <NEW_LINE> <DEDENT> @property <NEW_LINE> def hparam(self): <NEW_LINE> <INDENT> return self._hparam <NEW_LINE> <DEDENT> @property <NEW_LINE> def optimizer(self): <NEW_LINE> <INDENT> if self._optimi... | Second layer of meta class that implements generic access to optimizer and hparam | 6259902b8c3a8732951f754a |
@config(compat="windows", category="exploit") <NEW_LINE> class ImpersonateModule(PupyModule): <NEW_LINE> <INDENT> max_clients=1 <NEW_LINE> dependencies=["pupwinutils.security"] <NEW_LINE> def init_argparse(self): <NEW_LINE> <INDENT> self.arg_parser = PupyArgumentParser(prog="impersonate", description=self.__doc__) <NEW... | list/impersonate process tokens | 6259902bd10714528d69ee85 |
class Scale(object): <NEW_LINE> <INDENT> def __init__(self, attribute_code='weight', default_weight=None): <NEW_LINE> <INDENT> self.attribute = attribute_code <NEW_LINE> self.default_weight = default_weight <NEW_LINE> <DEDENT> def weigh_product(self, product): <NEW_LINE> <INDENT> weight = None <NEW_LINE> try: <NEW_LINE... | For calculating the weight of a product or basket | 6259902b63f4b57ef008656b |
class ImageExtracter(object): <NEW_LINE> <INDENT> def __init__(self, filename, interval=0): <NEW_LINE> <INDENT> self.__captor = cv2.VideoCapture(filename) <NEW_LINE> if not self.__captor.isOpened(): <NEW_LINE> <INDENT> raise ValueError(f'{colorama.Fore.RED}cannot open video {filename}') <NEW_LINE> <DEDENT> self.__eof =... | 图像提取器
| 6259902b50485f2cf55dbf6d |
class Car: <NEW_LINE> <INDENT> NUMBER_OF_WHEELS = 4 <NEW_LINE> def __init__(self, name): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.distance = 0 | A car description | 6259902b73bcbd0ca4bcb284 |
class TestCheckpoint: <NEW_LINE> <INDENT> def test_with_return(self): <NEW_LINE> <INDENT> class TestClass(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.resume = False <NEW_LINE> <DEDENT> @checkpoint <NEW_LINE> def dont_wrap_me_bro(self): <NEW_LINE> <INDENT> return "I told you not to do this.... | Test the checkpoint() decorator. | 6259902b66673b3332c313e2 |
class Correction: <NEW_LINE> <INDENT> def __init__(self, of): <NEW_LINE> <INDENT> self.of = of <NEW_LINE> <DEDENT> def correct(self, x): <NEW_LINE> <INDENT> return np.minimum(np.maximum(x, self.of.a), self.of.b) | Baseline mutation correction strategy - "sticks" the solution to domain boundaries | 6259902bbe8e80087fbc006d |
class SaleItem(models.Model): <NEW_LINE> <INDENT> name = models.TextField() <NEW_LINE> description = models.TextField(max_length=500) <NEW_LINE> low_price = models.DecimalField(max_digits=10, decimal_places=2) <NEW_LINE> high_price = models.DecimalField(max_digits=10, decimal_places=2) <NEW_LINE> artisan_name = models.... | DESCRIPTION: Keeps track of the items sold by artisans at each area.
NOTES: artisan - must be a registered user. | 6259902b8c3a8732951f754b |
class SeleniumCommandInfo(object): <NEW_LINE> <INDENT> swagger_types = { 'id': 'str', 'name': 'str', 'target': 'str', 'value': 'str', 'targets': 'list[TargetListData]' } <NEW_LINE> attribute_map = { 'id': 'id', 'name': 'name', 'target': 'target', 'value': 'value', 'targets': 'targets' } <NEW_LINE> def __init__(self, id... | NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually. | 6259902bd99f1b3c44d06697 |
class XegerError(Exception): <NEW_LINE> <INDENT> def __init__(self, value): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return repr(self.value) | Exception type for reporting Xeger generation errors | 6259902bc432627299fa3fe8 |
class RandomElastic: <NEW_LINE> <INDENT> def __init__(self,params): <NEW_LINE> <INDENT> self.params=params <NEW_LINE> self.last_grid=None <NEW_LINE> self.params_p=np.array([x[2] for x in self.params]) <NEW_LINE> self.params_p=self.params_p/np.sum(self.params_p) <NEW_LINE> <DEDENT> def get_params_random(self): <NEW_LINE... | Elastic deformation of images as described in [Simard2003]
Simard, Steinkraus and Platt, "Best Practices for
Convolutional Neural Networks applied to Visual Document Analysis", in
Proc. of the International Conference on Document Analysis and
Recognition, 2003.
Copied from https://gist.github.com/chsasank/4d8f68caf01f... | 6259902b6e29344779b01644 |
class PageType: <NEW_LINE> <INDENT> FrontCover = "FrontCover" <NEW_LINE> InnerCover = "InnerCover" <NEW_LINE> Roundup = "Roundup" <NEW_LINE> Story = "Story" <NEW_LINE> Advertisement = "Advertisement" <NEW_LINE> Editorial = "Editorial" <NEW_LINE> Letters = "Letters" <NEW_LINE> Preview = "Preview" <NEW_LINE> BackCover = ... | These page info classes are exactly the same as the CIX scheme, since
it's unique | 6259902b6fece00bbaccc9a3 |
class SiteAnnotationForm(forms.Form): <NEW_LINE> <INDENT> def clean(self): <NEW_LINE> <INDENT> return self.cleaned_data | Form asking the curator to fill the information regarding each site.
In particular, the user can:
- visualize again site information, including chromosome,
- toggle the graphical view (off by default)
- edit the qualitative values
- specify which techniques were used to determine this site
- define the site as repress... | 6259902b56b00c62f0fb38b5 |
class FederatedType(Type): <NEW_LINE> <INDENT> def __init__(self, member, placement, all_equal=False): <NEW_LINE> <INDENT> if not isinstance(placement, placement_literals.PlacementLiteral): <NEW_LINE> <INDENT> raise NotImplementedError( 'At the moment, only specifying placement literals is implemented.') <NEW_LINE> <DE... | An implementation of `tff.Type` representing federated types in TFF. | 6259902b5e10d32532ce40fe |
class TransformPoincareDisk(Transform): <NEW_LINE> <INDENT> def __init__(self, base, R=1.): <NEW_LINE> <INDENT> super(TransformPoincareDisk, self).__init__(base) <NEW_LINE> self.R = R <NEW_LINE> <DEDENT> def to_base(self, ndata): <NEW_LINE> <INDENT> Lab = ndata.copy() <NEW_LINE> Lab[:, 1:] = 0 <NEW_LINE> x = ndata[:, 1... | Transform from Cartesian coordinates to Poincare disk coordinates.
The coordinate transform only changes the radius (chroma, typically),
and does so in a way that preserves the radial distance with respect to
the Euclidean metric and the Poincare disk metric in the source and
target spaces, respectively. | 6259902b9b70327d1c57fd78 |
class Obstacle: <NEW_LINE> <INDENT> def __init__(self, screen): <NEW_LINE> <INDENT> self.change = 4 <NEW_LINE> self.y = random.randrange(0, 560) <NEW_LINE> self.x = 999 <NEW_LINE> self.img = pygame.image.load(os.path.join("resources", "Obstacle.png")) <NEW_LINE> self.size = self.img.get_size() <NEW_LINE> self.screen = ... | Contains all the functions and variables specific to the boxes | 6259902b287bf620b6272be7 |
class AuthenticationRequired(ElasticException): <NEW_LINE> <INDENT> pass | Cluster requires authentication. | 6259902b711fe17d825e1495 |
class UserChangeForm(forms.ModelForm): <NEW_LINE> <INDENT> password = ReadOnlyPasswordHashField() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = User <NEW_LINE> fields = ('username', 'email', 'first_name', 'last_name', 'password', 'is_active', 'is_superuser') <NEW_LINE> <DEDENT> def clean_password(self): <NEW_LINE>... | A form for updating users. Includes all the fields on the user, but replaces the password field with
admin's password hash display field. | 6259902b66673b3332c313e6 |
class FileStorage: <NEW_LINE> <INDENT> __file_path = "file.json" <NEW_LINE> __objects = {} <NEW_LINE> def all(self, cls=None): <NEW_LINE> <INDENT> state_obj = {} <NEW_LINE> if cls is None: <NEW_LINE> <INDENT> return self.__objects <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> for k, v in self.__objects.items(): <NEW_LI... | This class serializes instances to a JSON file and
deserializes JSON file to instances
Attributes:
__file_path: path to the JSON file
__objects: objects will be stored | 6259902bbf627c535bcb24ae |
class CustomerRequirement(models.Model): <NEW_LINE> <INDENT> customer = models.ForeignKey(Customer,verbose_name=_('Customer')) <NEW_LINE> requirement = models.ForeignKey(Requirement,verbose_name=_('Requirement')) <NEW_LINE> role = models.ForeignKey(DanceRole,null=True,blank=True,verbose_name=_('Dance role'),help_text=_... | This class allows for override of requirements on a per-customer basis. | 6259902bbe8e80087fbc0071 |
class ImageResizingFilter(ImageFilter): <NEW_LINE> <INDENT> _log_attributes = ('size', 'maintain_aspect_ratio', 'resample') <NEW_LINE> VERSION = '1.0' <NEW_LINE> def __init__(self, size, maintain_aspect_ratio=False, resample='bicubic'): <NEW_LINE> <INDENT> self.size = size <NEW_LINE> self.maintain_aspect_ratio = mainta... | Resizes an image, while optionally maintaining aspect ratio.
Args:
size (tuple of two ints): new size of the image.
maintain_aspect_ratio (boolean): if true, resize the image while
maintaining aspect ratio, and pad the rest with zero values.
Otherwise, potentially distort the image during resiz... | 6259902b3eb6a72ae038b65c |
@inside_spirv_testsuite('SpirvOptFlags') <NEW_LINE> class TestLoopPeelingThresholdArgsInvalidNumber(expect.ErrorMessageSubstr): <NEW_LINE> <INDENT> spirv_args = ['--loop-peeling-threshold=a10f'] <NEW_LINE> expected_error_substr = 'must have a positive integer argument' | Tests invalid arguments to --loop-peeling-threshold. | 6259902bec188e330fdf988b |
class HelloViewSet(viewsets.ViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.HelloSerializer <NEW_LINE> def list(self, request): <NEW_LINE> <INDENT> a_viewset = [ 'Uses actions(list, create, retrieve, update, partial_update)', 'automatically maps to URLs using routers', 'provides more functionality with les... | Test API ViewSet | 6259902b711fe17d825e1496 |
class Workspace: <NEW_LINE> <INDENT> def __init__(self, params_file: pathlib.Path) -> None: <NEW_LINE> <INDENT> params = json.loads(params_file.read_text(encoding='utf-8')) <NEW_LINE> workspace_name = 'phst_rules_elisp' <NEW_LINE> srcs = [] <NEW_LINE> tempdir = pathlib.Path(tempfile.mkdtemp(prefix='pylint-')) <NEW_LINE... | Represents a temporary workspace for Pylint and Pytype. | 6259902b8a43f66fc4bf317c |
class Topic(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.TopicId = None <NEW_LINE> self.TopicName = None <NEW_LINE> self.ProductId = None <NEW_LINE> self.MsgLife = None <NEW_LINE> self.MsgSize = None <NEW_LINE> self.MsgCount = None <NEW_LINE> self.Deleted = None <NEW_LINE> self.Path ... | Topic
| 6259902b796e427e5384f775 |
class ProxyViewGetOnlyTest(APITestCase): <NEW_LINE> <INDENT> class TestView(ProxyViewGetOnly): <NEW_LINE> <INDENT> source = 'api/test' <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> self.view = self.TestView() <NEW_LINE> <DEDENT> def test_blocked_methods(self): <NEW_LINE> <INDENT> response = self.view.delete(... | Test the HTTP methods of the ProxyViewGetOnly view. | 6259902b6fece00bbaccc9a8 |
class TimeoutException(Exception): <NEW_LINE> <INDENT> pass | It took too long to compile and execute. | 6259902b30c21e258be99805 |
class CheckBox(ToggleButtonBehavior, Widget): <NEW_LINE> <INDENT> def _get_active(self): <NEW_LINE> <INDENT> return self.state == 'down' <NEW_LINE> <DEDENT> def _set_active(self, value): <NEW_LINE> <INDENT> self.state = 'down' if value else 'normal' <NEW_LINE> <DEDENT> active = AliasProperty( _get_active, _set_active, ... | CheckBox class, see module documentation for more information.
| 6259902bd164cc6175821f6b |
@ns_function.route('/') <NEW_LINE> @ns_function.doc(security='apikey', responses=default_responses) <NEW_LINE> class Functions(Resource): <NEW_LINE> <INDENT> @accept('application/vnd.mycodo.v1+json') <NEW_LINE> @ns_function.marshal_with(function_list_fields) <NEW_LINE> @flask_login.login_required <NEW_LINE> def get(sel... | Function information. | 6259902bd99f1b3c44d0669d |
class LIST_OT_NewItem(bpy.types.Operator): <NEW_LINE> <INDENT> bl_idname = "my_list.new_item" <NEW_LINE> bl_label = "Add a new item" <NEW_LINE> def execute(self, context): <NEW_LINE> <INDENT> context.scene.my_list.add() <NEW_LINE> return{'FINISHED'} | Add a new item to the list | 6259902b6fece00bbaccc9a9 |
class RectangularRoom(object): <NEW_LINE> <INDENT> def __init__(self, width, height): <NEW_LINE> <INDENT> self.width = width <NEW_LINE> self.height = height <NEW_LINE> self.numTilesCleaned = 0 <NEW_LINE> self.tiles = [[False for j in range(width)] for i in range(height)] <NEW_LINE> self.numCleanedTiles = 0 <NEW_LINE> <... | A RectangularRoom represents a rectangular region containing clean or dirty
tiles.
A room has a width and a height and contains (width * height) tiles. At any
particular time, each of these tiles is either clean or dirty. | 6259902bd53ae8145f91945e |
class WaitForMsgState(smach.State): <NEW_LINE> <INDENT> def __init__(self, topic, msg_type, msg_cb=None, output_keys=None, latch=False, timeout=None, u_execute=None, outcomes=['succeeded','aborted','preempted']): <NEW_LINE> <INDENT> if output_keys is None: <NEW_LINE> <INDENT> output_keys = [] <NEW_LINE> <DEDENT> smach.... | This class acts as a generic message listener with blocking, timeout, latch and flexible usage.
It is meant to be extended with a case specific class that initializes this one appropriately
and contains the msg_cb (or overrides execute if really needed).
Its waitForMsg method implements the core functionality: waitin... | 6259902b50485f2cf55dbf76 |
class Admin2OfSchool(KLPDetailAPIView): <NEW_LINE> <INDENT> serializer_class = BoundaryWithParentSerializer <NEW_LINE> bbox_filter_field = 'boundarycoord__coord' <NEW_LINE> def get_object(self): <NEW_LINE> <INDENT> school_id = self.kwargs.get('pk') <NEW_LINE> school = get_object_or_404(School.objects.all(), id=school_i... | Returns the block/project for the given school
| 6259902b66673b3332c313ea |
class EditorController: <NEW_LINE> <INDENT> def __init__(self, model, x, y, w, h, painter): <NEW_LINE> <INDENT> self.model = model <NEW_LINE> self.model.set_port(x, y, w, h, painter) <NEW_LINE> self.active_state = ActiveStateContainer(self.model) <NEW_LINE> <DEDENT> def change_state(self, new_state): <NEW_LINE> <INDENT... | Класс контроллер | 6259902b21a7993f00c66f78 |
class Board(EntityBase, EntityFactoryBase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def from_json(cls, json_obj): <NEW_LINE> <INDENT> board = Board() <NEW_LINE> board.id = json_obj['id'] <NEW_LINE> board.name = json_obj['name'] <NEW_LINE> board.description = json_obj.get('desc','') <NEW_LINE> board.closed = json_ob... | Class representing a Trello board entity. | 6259902b30c21e258be99806 |
class MouseEnterCallback(PointerXYCallback): <NEW_LINE> <INDENT> on_events = ['mouseenter'] | Returns the mouse x/y-position on mouseenter event, i.e. when
mouse enters the plot canvas. | 6259902b8a349b6b43687234 |
@dataclass <NEW_LINE> class TransformerStd: <NEW_LINE> <INDENT> std_type: str <NEW_LINE> name: str <NEW_LINE> parallel: int <NEW_LINE> def update_pandapower( self, net: pandapowerNet, source: str, target: str, ): <NEW_LINE> <INDENT> hv_bus = pp.get_element_index(net, "bus", source) <NEW_LINE> lv_bus = pp.get_element_in... | Essential transformer parameters. | 6259902b6fece00bbaccc9aa |
class PacketPokerAnteRequest(PacketPokerAnte): <NEW_LINE> <INDENT> pass | =========== =======================================================================================================================================================================================================
Semantics the player "serial" is required to pay the an ante
of "amount" for game"game_id".
Di... | 6259902be76e3b2f99fd9a08 |
class TemplateFormatter: <NEW_LINE> <INDENT> def __init__(self, template, **kwargs): <NEW_LINE> <INDENT> self.template = template <NEW_LINE> self.context_getters = { "host": lambda _: platform.node(), } <NEW_LINE> self.context_getters.update(kwargs) <NEW_LINE> <DEDENT> def make_context(self, metric_name): <NEW_LINE> <I... | Formatter based on a template string
:param template: A template string that will be rendered for each metric
Additionnal keyword arguments must be callable, they will be called during
rendering with the metric name and should return a string.
The template must use the modern python formatting syntax, but does not
s... | 6259902b3eb6a72ae038b660 |
class MirraApp(main.App): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.caption = "mirra example complex" <NEW_LINE> self.size = 640, 480 <NEW_LINE> self.pos = 100,100 <NEW_LINE> self.fullScreen = 0 <NEW_LINE> self.frameRate = 15 <NEW_LINE> <DEDENT> def start(self): <NEW_LINE> <INDENT> self.text = Text(... | main appplication class, handles window contains events and graphics manager.
Subclasses main.App and extends its public methods | 6259902b8c3a8732951f7553 |
@_plugin_type <NEW_LINE> class InstrumentFile: <NEW_LINE> <INDENT> _FILETYPES = [] <NEW_LINE> def __init__(self, fp, file: str): <NEW_LINE> <INDENT> self.instruments = {} <NEW_LINE> self.file = file <NEW_LINE> try: <NEW_LINE> <INDENT> self.fp = fp <NEW_LINE> self._load_file() <NEW_LINE> <DEDENT> finally: <NEW_LINE> <IN... | The base class for instrument file types. | 6259902b9b70327d1c57fd7e |
class MatplotlibSurfactantViewer(AbstractMatplotlibViewer): <NEW_LINE> <INDENT> def __init__(self, distanceVar, surfactantVar=None, levelSetValue=0., title=None, smooth=0, zoomFactor=1., animate=False, limits={}, **kwlimits): <NEW_LINE> <INDENT> kwlimits.update(limits) <NEW_LINE> AbstractMatplotlibViewer.__init__(self,... | The `MatplotlibSurfactantViewer` creates a viewer with the Matplotlib_ python
plotting package that displays a `DistanceVariable`.
.. _Matplotlib: http://matplotlib.sourceforge.net/ | 6259902b507cdc57c63a5da3 |
class _IndexCondition(Condition): <NEW_LINE> <INDENT> def __init__(self, index_or_name: Union[index.Index, str]): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if isinstance(index_or_name, index.Index): <NEW_LINE> <INDENT> self.name = index_or_name.name <NEW_LINE> self.index = index_or_name <NEW_LINE> <DEDENT> else... | Base class for conditions based on an Index. | 6259902bec188e330fdf988f |
class SingleAckGraphWalkerImpl(object): <NEW_LINE> <INDENT> def __init__(self, walker): <NEW_LINE> <INDENT> self.walker = walker <NEW_LINE> self._sent_ack = False <NEW_LINE> <DEDENT> def ack(self, have_ref): <NEW_LINE> <INDENT> if not self._sent_ack: <NEW_LINE> <INDENT> self.walker.send_ack(have_ref) <NEW_LINE> self._s... | Graph walker implementation that speaks the single-ack protocol. | 6259902b711fe17d825e1498 |
class IntegrationServiceEnvironment(Resource): <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'}, 'locati... | The integration service environment.
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: Gets the resource name.
:vartype name: str
:ivar type: Gets the resource type.
:vartype type: str
:param location: The resource location.... | 6259902be76e3b2f99fd9a0a |
class WordEnd(_PositionToken): <NEW_LINE> <INDENT> def __init__(self, wordChars = printables): <NEW_LINE> <INDENT> super(WordEnd,self).__init__() <NEW_LINE> self.wordChars = set(wordChars) <NEW_LINE> self.skipWhitespace = False <NEW_LINE> self.errmsg = "Not at the end of a word" <NEW_LINE> <DEDENT> def parseImpl(self, ... | Matches if the current position is at the end of a Word, and is
not followed by any character in a given set of ``wordChars``
(default= ``printables``). To emulate the ```` behavior of
regular expressions, use ``WordEnd(alphanums)``. ``WordEnd``
will also match at the end of the string being parsed, or at the end
of a... | 6259902b30c21e258be99809 |
class SingleGrid(Grid): <NEW_LINE> <INDENT> empties = set() <NEW_LINE> def __init__(self, width: int, height: int, torus: bool) -> None: <NEW_LINE> <INDENT> super().__init__(width, height, torus) <NEW_LINE> <DEDENT> def position_agent( self, agent: Agent, x: Union[int, str] = "random", y: Union[int, str] = "random" ) -... | Grid where each cell contains exactly at most one object. | 6259902b1d351010ab8f4b15 |
class PyFlworError(Exception): <NEW_LINE> <INDENT> pass | Base pyflwor Exception | 6259902b287bf620b6272beb |
class TestDestinyDefinitionsDirectorDestinyActivityGraphNodeDefinition(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 testDestinyDefinitionsDirectorDestinyActivityGraphNodeDefinition(self): <NEW_L... | DestinyDefinitionsDirectorDestinyActivityGraphNodeDefinition unit test stubs | 6259902bb57a9660fecd2a80 |
class CooldownMeasurement(State): <NEW_LINE> <INDENT> def __init__(self, fsm): <NEW_LINE> <INDENT> super(CooldownMeasurement, self).__init__(fsm) <NEW_LINE> self.cooldown_csv = self.fsm.data['FilePaths']['cooldown_csv'] <NEW_LINE> <DEDENT> def enter(self): <NEW_LINE> <INDENT> self.log.info('===> Measure cool down state... | measure pressure and temperature | 6259902b21bff66bcd723c61 |
class SubOption(): <NEW_LINE> <INDENT> def __init__(self, title=None, call=None, info=None): <NEW_LINE> <INDENT> self.title = title <NEW_LINE> self.call = call <NEW_LINE> self.info = info | A menu corresponding to a suboption within menu of a single option
in the options menu; contains information such as the | 6259902b73bcbd0ca4bcb290 |
class HistoryServerClient(object): <NEW_LINE> <INDENT> DEFAULT_PORT = 19888 <NEW_LINE> def __init__(self, host, port=DEFAULT_PORT, start_time=None, timeout=30): <NEW_LINE> <INDENT> self.history_server_api_url = 'http://%s:%s/ws/v1/history/mapreduce/jobs' % (host, port) <NEW_LINE> self.api_params = {'finishedTimeBegin':... | Client for History Server | 6259902b8a349b6b43687238 |
class ManifestV1Renderer(JSONRenderer): <NEW_LINE> <INDENT> media_type = "application/vnd.docker.distribution.manifest.v1+prettyjws" | 防止 docker 只传 Manifest Type 的请求,然后导致 416 发生 | 6259902b30c21e258be9980a |
class FormFloat(QLineEdit): <NEW_LINE> <INDENT> def __init__(self, default=None, maxw=None, significant_digits=3): <NEW_LINE> <INDENT> super().__init__('') <NEW_LINE> self.significant_digits = significant_digits <NEW_LINE> if default is not None: <NEW_LINE> <INDENT> self.set_value(default) <NEW_LINE> <DEDENT> if maxw i... | Subclass QLineEdit for float to have a more consistent API across
widgets.
Parameters
----------
significant_digits : int
number of significant digits | 6259902b15baa72349462f97 |
class Suite(Base): <NEW_LINE> <INDENT> __tablename__ = 'suite' <NEW_LINE> archive = sqlalchemy.orm.relation('Archive', backref='suites') | Model for a suite
This class represents a suite in an `Archive`. | 6259902be76e3b2f99fd9a0c |
class UserList(APIView): <NEW_LINE> <INDENT> permission_classes = (IsAuthenticated, ) <NEW_LINE> def get(self, request, format=None): <NEW_LINE> <INDENT> users = CustomUser.objects.all() <NEW_LINE> serializer = UserItemSerializer(users, many=True) <NEW_LINE> return Response({'users': serializer.data}) | List all users | 6259902bac7a0e7691f734e8 |
class GLU(Module): <NEW_LINE> <INDENT> __constants__ = ['dim'] <NEW_LINE> def __init__(self, dim=-1): <NEW_LINE> <INDENT> super(GLU, self).__init__() <NEW_LINE> self.dim = dim <NEW_LINE> <DEDENT> def forward(self, input): <NEW_LINE> <INDENT> return F.glu(input, self.dim) <NEW_LINE> <DEDENT> def extra_repr(self): <NEW_L... | Applies the gated linear unit function
:math:`{GLU}(a, b)= a \otimes \sigma(b)` where :math:`a` is the first half
of the input matrices and :math:`b` is the second half.
Args:
dim (int): the dimension on which to split the input. Default: -1
Shape:
- Input: :math:`(\ast_1, N, \ast_2)` where `*` means, any num... | 6259902b3eb6a72ae038b664 |
class BaseVariables(object): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_all_variables(cls): <NEW_LINE> <INDENT> methods = inspect.getmembers(cls) <NEW_LINE> return [ { 'name': m[0], 'label': m[1].label, 'field_type': m[1].field_type.name, 'options': m[1].options, 'params': m[1].params, 'public': m[1].public, }... | Classes that hold a collection of variables to use with the rules
engine should inherit from this. | 6259902bd164cc6175821f71 |
class UserAuthenticationView(APIView): <NEW_LINE> <INDENT> serializer_class = UserAuthenticationSerializer <NEW_LINE> def post(self,request,*args,**kwargs): <NEW_LINE> <INDENT> serializer=self.serializer_class(data=self.request.data) <NEW_LINE> if serializer.is_valid(): <NEW_LINE> <INDENT> user=serializer.validated_dat... | Authentication View. | 6259902cd10714528d69ee8c |
class InteriorNode(Node): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._in_nodes = None <NEW_LINE> self._num_ready_in_nodes = 0 <NEW_LINE> <DEDENT> def _gather_shapes_dtypes_for_build(self): <NEW_LINE> <INDENT> assert self._in_nodes, 'Tried to build an internal node wit... | A non-input node (the normal case). | 6259902c1d351010ab8f4b17 |
class BadReferenceError(PatternError): <NEW_LINE> <INDENT> errmsg = "This reference-name has no definition (yet)." | Raised if a pattern refers to a subexpression name not defined in the context of the analysis.
args are the offending reference and the span within the pattern (offset/length pair) where it appears. | 6259902c9b70327d1c57fd82 |
class GetWeeklyArtistChart(Choreography): <NEW_LINE> <INDENT> def __init__(self, temboo_session): <NEW_LINE> <INDENT> Choreography.__init__(self, temboo_session, '/Library/LastFm/User/GetWeeklyArtistChart') <NEW_LINE> <DEDENT> def new_input_set(self): <NEW_LINE> <INDENT> return GetWeeklyArtistChartInputSet() <NEW_LINE>... | Create a new instance of the GetWeeklyArtistChart Choreography. A TembooSession object, containing a valid
set of Temboo credentials, must be supplied. | 6259902c507cdc57c63a5da7 |
class Pgdspider(Package): <NEW_LINE> <INDENT> homepage = "http://www.cmpg.unibe.ch/software/PGDSpider" <NEW_LINE> url = "http://www.cmpg.unibe.ch/software/PGDSpider/PGDSpider_2.1.1.2.zip" <NEW_LINE> version('2.1.1.2', sha256='a630ef9f3ef0c36be0d613867c5293378d77b52396ac701bc7b9ec5d3ba7f2e1') <NEW_LINE> depends_on(... | "PGDSpider is a powerful automated data conversion tool for population
genetic and genomics programs | 6259902cd4950a0f3b11163d |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.