code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
@attr('functional') <NEW_LINE> class TestExplorerJob(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> arkane = Arkane() <NEW_LINE> cls.job_list = arkane.load_input_file( os.path.join(os.path.dirname(os.path.abspath(__file__)), 'data', 'methoxy_explore.py')) <NEW_L... | Contains tests for ExplorerJob class execute method | 62599040be383301e0254a9d |
class Update(APIResource): <NEW_LINE> <INDENT> SCHEMAS = { "POST": Schema({ Required("version"): STRINGS})} <NEW_LINE> isLeaf = False <NEW_LINE> def post(self, **kwargs): <NEW_LINE> <INDENT> request = kwargs["request"] <NEW_LINE> data = kwargs["data"] <NEW_LINE> agent = config["agent"] <NEW_LINE> url = "%s/agents/updat... | Requests the agent to download and apply the specified version of itself.
Will make the agent restart at the next opportunity.
.. http:post:: /api/v1/update HTTP/1.1
**Request**
.. sourcecode:: http
POST /api/v1/update HTTP/1.1
Accept: application/json
{
"version": 1.2.3... | 62599040b830903b9686edbc |
@six.add_metaclass(abc.ABCMeta) <NEW_LINE> class _ExprOperator(_Expr): <NEW_LINE> <INDENT> def __init__(self, backend, key, operand, transform): <NEW_LINE> <INDENT> super(_ExprOperator, self).__init__(backend) <NEW_LINE> self._key = key <NEW_LINE> self._operand = operand <NEW_LINE> self._transform = transform <NEW_LINE... | Base term (<key operator operand>) node.
ExprOperator subclasses must define the function Apply(self, value, operand)
that returns the result of <value> <op> <operand>.
Attributes:
_key: Resource object key (list of str, int and/or None values).
_normalize: The resource value normalization function.
_operand: T... | 625990408a43f66fc4bf3416 |
class Expr(expr.Expr): <NEW_LINE> <INDENT> def __init__(self, where, queryables=None, encoding=None, scope_level=0): <NEW_LINE> <INDENT> where = _validate_where(where) <NEW_LINE> self.encoding = encoding <NEW_LINE> self.condition = None <NEW_LINE> self.filter = None <NEW_LINE> self.terms = None <NEW_LINE> self._visitor... | hold a pytables like expression, comprised of possibly multiple 'terms'
Parameters
----------
where : string term expression, Expr, or list-like of Exprs
queryables : a "kinds" map (dict of column name -> kind), or None if column
is non-indexable
encoding : an encoding that will encode the query terms
Returns
---... | 62599040d99f1b3c44d06922 |
class TProcessor(object): <NEW_LINE> <INDENT> def __init__(self, service, handler): <NEW_LINE> <INDENT> self._service = service <NEW_LINE> self._handler = handler <NEW_LINE> <DEDENT> def process_in(self, iprot): <NEW_LINE> <INDENT> api, type, seqid = iprot.read_message_begin() <NEW_LINE> if api not in self._service.thr... | Base class for procsessor, which works on two streams. | 6259904007d97122c4217f25 |
class StudentProfileForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = StudentProfile <NEW_LINE> exclude = ('user_profile', ) | Student Profile Form | 6259904015baa72349463217 |
class EditPost(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self, postkey): <NEW_LINE> <INDENT> user = users.get_current_user() <NEW_LINE> singlepost = Post.get(postkey) <NEW_LINE> parentblog = Blog.get_by_id(int(singlepost.parent_key().id())) <NEW_LINE> if user: <NEW_LINE> <INDENT> if parentblog.ownerid == use... | Edit Post, content will be prefilled by previous one | 62599040c432627299fa4244 |
class OrdemDeServico(models.Model): <NEW_LINE> <INDENT> numero = models.CharField(_(u'Número'), max_length=20) <NEW_LINE> tipo = models.ForeignKey('outorga.TipoContrato') <NEW_LINE> acordo = models.ForeignKey('outorga.Acordo') <NEW_LINE> contrato = models.ForeignKey('outorga.Contrato') <NEW_LINE> data_inicio = NARADate... | Uma instância dessa classe representa uma ordem de serviço de um Contrato.
arquivos: related_name para ArquivoOS | 62599040e64d504609df9d14 |
class GroupExpirationMiddleware(MiddlewareMixin): <NEW_LINE> <INDENT> def process_request(self, request): <NEW_LINE> <INDENT> user = request.user <NEW_LINE> if hasattr(user, 'active_range') and user.groups.exists(): <NEW_LINE> <INDENT> today = now().date() <NEW_LINE> end_date = user.active_range.end_date <NEW_LINE> if ... | Middleware which removes users from all groups after a specified expiration
date.
Needs to come after auth middleware because it needs request.user.
Needs to come after message middleware because it needs request._messages. | 625990401d351010ab8f4da4 |
class Player(Model): <NEW_LINE> <INDENT> def __init__(self, name, number=None, team=None, color=None, **kwargs): <NEW_LINE> <INDENT> super(Player, self).__init__(**kwargs) <NEW_LINE> self.name = name <NEW_LINE> self.number = number <NEW_LINE> if isinstance(team, Team): <NEW_LINE> <INDENT> self.team = team <NEW_LINE> <D... | Um jogador de futebol | 625990408e05c05ec3f6f79e |
@dataclass <NEW_LINE> class CaptureTextEvent: <NEW_LINE> <INDENT> capture_id: str <NEW_LINE> text: str <NEW_LINE> complete: bool | Keyboard event denoting the current capture state of text
Capturing text is triggered by calling `capture_text` on the keyboard handler. | 6259904016aa5153ce401774 |
class ConditionException(Exception): <NEW_LINE> <INDENT> def __init__(self, var = "Condition Fail"): <NEW_LINE> <INDENT> self.var = var | If there is a failure in building a condition this is raised | 6259904050485f2cf55dc20b |
class UnlockServer(command.Command): <NEW_LINE> <INDENT> def get_parser(self, prog_name): <NEW_LINE> <INDENT> parser = super(UnlockServer, self).get_parser(prog_name) <NEW_LINE> parser.add_argument( 'server', metavar='<server>', nargs='+', help=_('Server(s) to unlock (name or ID)'), ) <NEW_LINE> return parser <NEW_LINE... | Unlock server(s) | 62599040b830903b9686edbd |
class Cell: <NEW_LINE> <INDENT> def __init__(self, value, row, column, block_size): <NEW_LINE> <INDENT> self.value = value <NEW_LINE> self.row = row <NEW_LINE> self.column = column <NEW_LINE> self.block = self.calc_block_index(block_size) <NEW_LINE> self.candidate_set = set() <NEW_LINE> self.index = column + row*(block... | 数独表のセルの管理クラス | 625990401f5feb6acb163e7b |
class rbm_qmc: <NEW_LINE> <INDENT> def __init__(self, nvisible, nhidden, hbias=None, vbias=None, W_real=None, W_imag=None, input=None, np_rng=None, theano_rng=None, ): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def prop_up(self,vsample): <NEW_LINE> <INDENT> pass | This is a variational monte carlo implementation on the Neural Network
representing ground state.
It is the Python implementation with Theano on the Science paper
Science 355 ,602-606 (2017).
For the details, please refer to the original paper. | 625990404e696a045264e765 |
class ClientViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> serializer_class = serializers.ClientSerializer <NEW_LINE> queryset = models.Client.objects.all() | A viewset for viewing and editing user instances. | 62599040d6c5a102081e33ad |
class C4View: <NEW_LINE> <INDENT> def prompt_turn(self, name): <NEW_LINE> <INDENT> choice = input("{}, where would you like to go? ".format(name)) <NEW_LINE> return choice <NEW_LINE> <DEDENT> def show_instructions(self): <NEW_LINE> <INDENT> print_statement = ("1. On your turn, drop one of your discs into any... | Connect 4 view | 62599040711fe17d825e15e0 |
class TestNodeCLI(): <NEW_LINE> <INDENT> def __init__(self, binary, datadir): <NEW_LINE> <INDENT> self.options = [] <NEW_LINE> self.binary = binary <NEW_LINE> self.datadir = datadir <NEW_LINE> self.input = None <NEW_LINE> self.log = logging.getLogger('TestFramework.bitcoincli') <NEW_LINE> <DEDENT> def __call__(self, *o... | Interface to eros-cli for an individual node | 6259904023849d37ff852341 |
class PelicanMathJaxCorrectDisplayMath(markdown.treeprocessors.Treeprocessor): <NEW_LINE> <INDENT> def __init__(self, pelican_mathjax_extension): <NEW_LINE> <INDENT> self.pelican_mathjax_extension = pelican_mathjax_extension <NEW_LINE> <DEDENT> def correct_html(self, root, children, div_math, insert_idx, text): <NEW_LI... | Corrects invalid html that results from a <div> being put inside
a <p> for displayed math | 62599040e76e3b2f99fd9c94 |
class PerformanceResource(api.ApiResource): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> LOG.debug('=== Creating PerformanceResource ===') <NEW_LINE> <DEDENT> def on_get(self, req, resp): <NEW_LINE> <INDENT> resp.status = falcon.HTTP_200 <NEW_LINE> resp.body = '42' | Supports a static response to support performance testing. | 625990403c8af77a43b68880 |
class PartsmanagementException(Exception): <NEW_LINE> <INDENT> def __init__(self, error): <NEW_LINE> <INDENT> super(PartsmanagementException, self).__init__(error) <NEW_LINE> logger.error(_("An fatal error has been occurred: %s" % error)) | Base exceptions for this packages | 62599040b57a9660fecd2d03 |
class ModuleComponentFilter(MultiValueFilter): <NEW_LINE> <INDENT> @value_is_not_empty <NEW_LINE> def _filter(self, qs, name, values): <NEW_LINE> <INDENT> query = Q() <NEW_LINE> for value in values: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> name, branch = value.split('/', 2) <NEW_LINE> filters = {'name': name, 'srpm... | Multi-value filter for modules with an RPM with given name and branch. | 62599040507cdc57c63a6024 |
class NoSignupAccountAdapter(DefaultAccountAdapter): <NEW_LINE> <INDENT> def is_open_for_signup(self, request): <NEW_LINE> <INDENT> return False | Disable open signup. | 6259904024f1403a92686211 |
class TradesLine(object): <NEW_LINE> <INDENT> def __init__(self, src, dest, rate, amount, date, sell_or_buy, fee): <NEW_LINE> <INDENT> self.src = src <NEW_LINE> self.dest = dest <NEW_LINE> self.rate = rate <NEW_LINE> self.amount = amount <NEW_LINE> self.date = date <NEW_LINE> self.type = sell_or_buy <NEW_LINE> self.fee... | A representation of a line inside the trades CSV file | 6259904007f4c71912bb06bb |
class _LayerList(list): <NEW_LINE> <INDENT> def __new__(cls, data=None): <NEW_LINE> <INDENT> obj = super(_LayerList, cls).__new__(cls, data) <NEW_LINE> return obj <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> if len(self) == 0: <NEW_LINE> <INDENT> return '[]' <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> ... | Like regular list, but has a different str and repr function | 6259904023e79379d538d789 |
class Command(WeblateTranslationCommand): <NEW_LINE> <INDENT> help = 'performs automatic translation based on other components' <NEW_LINE> def add_arguments(self, parser): <NEW_LINE> <INDENT> super(Command, self).add_arguments(parser) <NEW_LINE> parser.add_argument( '--user', default='anonymous', help=( 'User performin... | Command for mass automatic translation. | 625990403eb6a72ae038b8f4 |
class Frame(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.frame = [] <NEW_LINE> <DEDENT> def __contains__(self, searched_item): <NEW_LINE> <INDENT> if len(self.frame) == 0: <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> for item_dict in self.frame: <NEW_LINE> <INDENT> for item_name in ... | Base class for every frame | 6259904015baa7234946321b |
class _SparseFeatureHandler(object): <NEW_LINE> <INDENT> def __init__(self, name, feature_spec, value_index, index_index, reader=None, encoder=None): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._cast_fn = _make_cast_fn(feature_spec.dtype) <NEW_LINE> self._np_dtype = feature_spec.dtype.as_numpy_dtype <NEW_LINE... | Handler for `SparseFeature` values.
`SparseFeature` values will be parsed as a tuple of 1-D arrays where the first
array corresponds to their indices and the second to the values. | 62599040b5575c28eb71360e |
class PreferencesProxy(PreferencesDialog): <NEW_LINE> <INDENT> def __init__(self, parent, session): <NEW_LINE> <INDENT> PreferencesDialog.__init__(self, "Proxy") <NEW_LINE> proxies = [ ["Proxy for torrent peer connections", session.peer_proxy, session.set_peer_proxy], ["Proxy for torrent web seed connections", session.... | Proxy preference dialog | 6259904063b5f9789fe863f6 |
class StatsLogNotFound(StepNotFound): <NEW_LINE> <INDENT> pass | Step of statslog not found in pipeline | 62599040e76e3b2f99fd9c96 |
class PLATFORM(_Enum): <NEW_LINE> <INDENT> AMD = _Enum_Type(0) <NEW_LINE> APPLE = _Enum_Type(1) <NEW_LINE> INTEL = _Enum_Type(2) <NEW_LINE> NVIDIA = _Enum_Type(3) <NEW_LINE> BEIGNET = _Enum_Type(4) <NEW_LINE> POCL = _Enum_Type(5) <NEW_LINE> UNKNOWN = _Enum_Type(-1) | ArrayFire enum for common platforms | 625990406e29344779b018dc |
class InventoryRoles(CumulocityResource): <NEW_LINE> <INDENT> def __init__(self, c8y): <NEW_LINE> <INDENT> super().__init__(c8y, '/user/inventoryroles') <NEW_LINE> self.object_name = "roles" <NEW_LINE> <DEDENT> def get(self, id: str | int) -> InventoryRole: <NEW_LINE> <INDENT> role = InventoryRole.from_json(self._get_o... | Provides access to the InventoryRole API.
This class can be used for get, search for, create, update and
delete inventory roles within the Cumulocity database.
See also: https://cumulocity.com/api/#tag/Inventory-Roles | 6259904045492302aabfd765 |
class ObjKey2(A10BaseClass): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> self.ERROR_MSG = "" <NEW_LINE> self.required = [ "k1","k2"] <NEW_LINE> self.b_key = "obj-key-2" <NEW_LINE> self.a10_url="/axapi/v3/cm-ut/obj-key-2/{k1}+{k2}" <NEW_LINE> self.DeviceProxy = "" <NEW_LINE> self.k2 = "" <NEW_L... | Class Description::
Unit test of optional key.
Class obj-key-2 supports CRUD Operations and inherits from `common/A10BaseClass`.
This class is the `"PARENT"` class for this module.`
:param k2: {"minLength": 1, "maxLength": 32, "type": "string", "optional": false, "format": "string"}
:param k1: {"optional": false, "mi... | 625990408e05c05ec3f6f7a0 |
class ImportBlockbotList(BaseModel): <NEW_LINE> <INDENT> blockbot_id: str <NEW_LINE> name: str <NEW_LINE> class Config: <NEW_LINE> <INDENT> orm_mode = True | Details needed to import a Twitter list. | 6259904030c21e258be99a97 |
class Whoami(Plugin): <NEW_LINE> <INDENT> def tell(self, msg): <NEW_LINE> <INDENT> return msg['from'] <NEW_LINE> <DEDENT> def _init(self, event): <NEW_LINE> <INDENT> self.dispatcher.notify_until(Event(self, 'console.command.add', {'plugin': self.__class__.__name__, 'actions': {'tell': (self.te... | Plugin that tells caller about itself profile | 62599040507cdc57c63a6026 |
class UserProfile(models.Model): <NEW_LINE> <INDENT> user = models.OneToOneField(User, related_name='profile') <NEW_LINE> picture = models.ImageField(upload_to='profile_images', blank=True, help_text='Your pretty face') <NEW_LINE> pushover_key = models.CharField(max_length=256, help_text='account key from pushover') <N... | Extra information to track for each user | 625990408e71fb1e983bcd58 |
class IncomeTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> income = pd.read_excel("indicator gapminder gdp_per_capita_ppp.xlsx", index_col = "gdp pc test") <NEW_LINE> self.income = income.transpose() | Base class for TestCases that require income DF | 62599040287bf620b6272e71 |
class SmtpSinkServer(smtpd.SMTPServer): <NEW_LINE> <INDENT> __version__ = 'SMTP Test Sink version 1.00' <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> smtpd.SMTPServer.__init__(self, *args, **kwargs) <NEW_LINE> self.mailboxFile = None <NEW_LINE> <DEDENT> def setMailboxFile(self, mailboxFile): <NEW_... | Unix Mailbox File SMTP Server Class | 6259904007d97122c4217f2a |
class Documento: <NEW_LINE> <INDENT> file_path = "" <NEW_LINE> arquivo = None <NEW_LINE> texto = "" <NEW_LINE> palavras = None <NEW_LINE> indice = None <NEW_LINE> classe = "" <NEW_LINE> def __init__(self, f): <NEW_LINE> <INDENT> self.file_path = f <NEW_LINE> self.palavras = array <NEW_LINE> self.indice = dict() <NEW_LI... | Classe modelo para o documento | 625990408da39b475be0447a |
class IdenticaResponder(utils.RouteResponder): <NEW_LINE> <INDENT> map = Mapper() <NEW_LINE> map.connect('login', '/auth', action='login', requirements=dict(method='POST')) <NEW_LINE> map.connect('process', '/process', action='process') <NEW_LINE> def __init__(self, storage, consumer_key, consumer_secret): <NEW_LINE> <... | Handle Identi.ca OAuth login/authentication | 62599040711fe17d825e15e2 |
class OWLObjectProperty(OWLObjectPropertyExpression, OWLProperty): <NEW_LINE> <INDENT> def __init__(self, iri_or_str): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> if isinstance(iri_or_str, str): <NEW_LINE> <INDENT> self.iri = URIRef(iri_or_str) <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> self.iri = iri_or_str <... | Represents an
<a href="http://www.w3.org/TR/owl2-syntax/#Object_Properties">Object Property</a>
in the OWL 2 Specification. | 62599040d164cc6175822202 |
class Interpreter(): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.handleArguments(sys.argv) <NEW_LINE> <DEDENT> def handleArguments(self, argv): <NEW_LINE> <INDENT> if (argv[1] != "--ip" or argv[3] != "--port" or argv[5] != "--protocol") : <NEW_LINE> <INDENT> print("Call with: --ip <ip> --port <port... | Class Config | 62599040d99f1b3c44d06928 |
class CTD_ANON_80 (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = None <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_ELEMENT_ONLY <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = None <NEW_LINE> _XSDLocation = pyxb.utils.utility.Location('/Users/ethan... | Sends a rewards when an agent comes in contact with a specific block type. | 62599040d53ae8145f9196e8 |
class CreateCharacterResponseSchema(schema.ResponseSchema): <NEW_LINE> <INDENT> fields = { "CharacterId": fields.Str(required=True, load_from="CharacterId"), } | CreateCharacter - 创建角色 | 625990400a366e3fb87ddc71 |
class TaggedRelation: <NEW_LINE> <INDENT> def __init__(self, tag, head = -1, dep = -1): <NEW_LINE> <INDENT> self.tag = tag <NEW_LINE> self.head = head <NEW_LINE> self.dep = dep | Relation between two annotations that are identified by ordinal number. | 62599040c432627299fa4247 |
class SecurityVERIFYUnapprovedExecutableWithSetUIDCompareRPMs(TestCompareRPMs): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.after_rpm.add_installed_file( "/usr/bin/verify", rpmfluff.SourceFile("file", "a" * 5), mode="4755" ) <NEW_LINE> self.inspection = "permissions" <NEW_LI... | Assert when a setuid file is in a package and it's on the fileinfo list,
INFO result occurs when testing the RPMs. | 625990401d351010ab8f4da9 |
class Image(models.Model): <NEW_LINE> <INDENT> property = models.ForeignKey(Property) <NEW_LINE> imagetype = models.ForeignKey(ImageType, null=True, blank=True) <NEW_LINE> capture_date = models.DateField(null=True, blank=True) <NEW_LINE> webserver_layer = models.CharField(max_length=200, null=True, blank=True) <NEW_LIN... | Image object | 6259904023849d37ff852346 |
class ExpressionInitializationError(Exception): <NEW_LINE> <INDENT> pass | An exception used to indicate an error during initialization
of an expression. | 62599040d4950a0f3b111786 |
class Cell: <NEW_LINE> <INDENT> def __init__(self, store_type, obj_count=0): <NEW_LINE> <INDENT> self.store_type = store_type <NEW_LINE> self.count = obj_count <NEW_LINE> self.ids = set() <NEW_LINE> if self.store_type == StoreType.matrix: <NEW_LINE> <INDENT> size = range(self.count) <NEW_LINE> self.pairs = [[False for ... | This class represents single cell in grid (dense matrix).
It implements methods for adding and removing pairs. | 6259904063b5f9789fe863f8 |
class Hinge(Joint): <NEW_LINE> <INDENT> __swig_setmethods__ = {} <NEW_LINE> for _s in [Joint]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) <NEW_LINE> __setattr__ = lambda self, name, value: _swig_setattr(self, Hinge, name, value) <NEW_LINE> __swig_getmethods__ = {} <NEW_LINE> for _s in [Joint]: __s... | 1 | 62599040e76e3b2f99fd9c98 |
class TestIbzkpt(mytest.MyTestCase): <NEW_LINE> <INDENT> def test_example(self): <NEW_LINE> <INDENT> ibz_file = 'IBZKPT.example' <NEW_LINE> kpoints = Kpoints() <NEW_LINE> kpoints.from_file(vasp_dir=_rpath, ibz_filename=ibz_file) <NEW_LINE> testout = _rpath + 'IBZKPT.example.out.test' <NEW_LINE> with open(testout, 'w') ... | Function:
def read_plocar(filename)
Scenarios:
- full IBZKPT file with tetrahedra
- partial IBZKPT file with k-points only | 6259904071ff763f4b5e8a2b |
class ShowSubnet(ShowCommand): <NEW_LINE> <INDENT> resource = 'subnet' <NEW_LINE> log = logging.getLogger(__name__ + '.ShowSubnet') <NEW_LINE> def add_known_arguments(self, parser): <NEW_LINE> <INDENT> parser.add_argument( '--network_id', help='Neutron Netwotk Id') | Show information of a given OF Subnet. | 62599040e64d504609df9d17 |
class GaussianAndEpsilonStrategy(RawExplorationStrategy): <NEW_LINE> <INDENT> def __init__(self, action_space, epsilon, max_sigma=1.0, min_sigma=None, decay_period=1000000): <NEW_LINE> <INDENT> assert len(action_space.shape) == 1 <NEW_LINE> if min_sigma is None: <NEW_LINE> <INDENT> min_sigma = max_sigma <NEW_LINE> <DED... | With probability epsilon, take a completely random action.
with probability 1-epsilon, add Gaussian noise to the action taken by a
deterministic policy. | 625990408c3a8732951f77e5 |
class GetRecentMeUrls(TLObject): <NEW_LINE> <INDENT> __slots__ = ["referer"] <NEW_LINE> ID = 0x3dc0f114 <NEW_LINE> QUALNAME = "functions.help.GetRecentMeUrls" <NEW_LINE> def __init__(self, *, referer: str): <NEW_LINE> <INDENT> self.referer = referer <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def read(b: BytesIO, *arg... | Attributes:
LAYER: ``112``
Attributes:
ID: ``0x3dc0f114``
Parameters:
referer: ``str``
Returns:
:obj:`help.RecentMeUrls <pyrogram.api.types.help.RecentMeUrls>` | 62599040b57a9660fecd2d07 |
class Resource(base.Resource): <NEW_LINE> <INDENT> def update(self, new_domain=UNDEF, project=UNDEF, scope=UNDEF, availability_zone=UNDEF): <NEW_LINE> <INDENT> self._http.put(self._url_resource_path, self._id, data=utils.get_json_body( 'domain_entry', domain=new_domain, project=project, scope=scope, availability_zone=a... | Resource class for floating IP DNS entries in Compute API v2 | 62599040507cdc57c63a6028 |
class MongoDB: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> print('Connecting to the DB - {} {}.{}'.format(Config.host_DB, Config.DB_name, Config.DB_collection)) <NEW_LINE> self.client = pymongo.MongoClient(Config.host_DB) <NEW_LINE> self.db_name = self.client[Config.DB_name] <NE... | Object initiator function | 6259904030c21e258be99a99 |
class ConfigurationStorage(storage.GenericAnnotationStorage): <NEW_LINE> <INDENT> grok.context(IStructuredItem) <NEW_LINE> grok.provides(storage.IStorage) <NEW_LINE> storage = AdapterAnnotationProperty( storage.IDictStorage['storage'], ns="sd.rendering.configuration" ) | Stores a configuration sheet onto the object in an annotation.
| 6259904076d4e153a661dbba |
class ModuleStoreEnum(object): <NEW_LINE> <INDENT> class Type(object): <NEW_LINE> <INDENT> split = 'split' <NEW_LINE> mongo = 'mongo' <NEW_LINE> xml = 'xml' <NEW_LINE> <DEDENT> class RevisionOption(object): <NEW_LINE> <INDENT> draft_preferred = 'rev-opt-draft-preferred' <NEW_LINE> draft_only = 'rev-opt-draft-only' <NEW... | A class to encapsulate common constants that are used with the various modulestores. | 62599040a79ad1619776b30c |
class Electronic(models.Model): <NEW_LINE> <INDENT> author = models.ForeignKey('auth.User', null=True, on_delete=models.DO_NOTHING) <NEW_LINE> edited_by = models.CharField(max_length=200, null=True) <NEW_LINE> type_component = models.ForeignKey('Type_Component', help_text="Type of the electronic component.", on_delete=... | Electronic model docstring.
This model stores the electronic components. | 6259904007f4c71912bb06be |
class DummyEnv(gym.Env): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.episode_over = False <NEW_LINE> self.action_space = gym.spaces.Discrete(2) <NEW_LINE> self.state = np.zeros(3) <NEW_LINE> self.observation_space = self.state <NEW_LINE> self.reward_range = (-1, 1000) <NEW_LINE> self.start_state = ... | DummyEnv - The simplest possible implementation of an OpenAI gym environment | 6259904015baa7234946321e |
class EnergyGoalSetting(ResourceGoalSetting): <NEW_LINE> <INDENT> pass | Energy goal settings. | 625990408da39b475be0447c |
class BillingTier(models.Model): <NEW_LINE> <INDENT> cost_to_operator_per_min = models.IntegerField(default=0) <NEW_LINE> cost_to_operator_per_sms = models.IntegerField(default=0) <NEW_LINE> cost_to_subscriber_per_min = models.IntegerField(default=0) <NEW_LINE> cost_to_subscriber_per_sms = models.IntegerField(default=0... | A network billing tier.
This is how we charge operators and allow operators to set prices for their
subscribers. All costs to operators are in millicents; all costs to
subscribers are in currency-agnostic "credits". Credits are always integer
values that, when combined with a currency code, can yield a useful value.... | 6259904023e79379d538d78c |
class KeyError(Exception): <NEW_LINE> <INDENT> pass | Exception raise while input an error key.
| 62599040004d5f362081f92b |
class UserLoginViews(generics.GenericAPIView): <NEW_LINE> <INDENT> serializer_class = LoginSerializer <NEW_LINE> JWT_serializer_class = JWTSerializer <NEW_LINE> permission_classes = (AllowAny,) <NEW_LINE> @sensitive_post_parameters_m <NEW_LINE> def dispatch(self, *args, **kwargs): <NEW_LINE> <INDENT> return super(UserL... | Endpoint For User Login. | 62599040711fe17d825e15e3 |
class GwyGraphModel_init(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.test_meta = {'ncurves': 2, 'title': 'Plot', 'top_label': 'Top label', 'left_label': 'Left label', 'right_label': 'Right label', 'bottom_label': 'Bottom label', 'x_unit': 'm', 'y_unit': 'm', 'x_min': 0., 'x_min_set... | Test constructor of GwyGraphModel class
| 62599040596a897236128ef5 |
class ResourceInformation(object): <NEW_LINE> <INDENT> def __init__(self, name: str, addresses: List[str]): <NEW_LINE> <INDENT> self._name = name <NEW_LINE> self._addresses = addresses <NEW_LINE> <DEDENT> @property <NEW_LINE> def name(self) -> str: <NEW_LINE> <INDENT> return self._name <NEW_LINE> <DEDENT> @property <NE... | Class to hold information about a type of Resource. A resource could be a GPU, FPGA, etc.
The array of addresses are resource specific and its up to the user to interpret the address.
One example is GPUs, where the addresses would be the indices of the GPUs
.. versionadded:: 3.0.0
Parameters
----------
name : str
... | 625990408a43f66fc4bf341e |
class Item(Resource): <NEW_LINE> <INDENT> resource = "data/item" <NEW_LINE> def build_url(self, item, resource=resource): <NEW_LINE> <INDENT> url = super(Item, self).build_url(resource=self.resource) <NEW_LINE> return "%s/%s" % (url, item) | A Resource for a Diablo Item. See http://blizzard.github.io/d3-api-docs/#item-information/item-information-example | 62599040d53ae8145f9196ea |
class SetRadioText(Action): <NEW_LINE> <INDENT> def execute(self, instance): <NEW_LINE> <INDENT> index = self.evaluate_index(0) <NEW_LINE> value = self.evaluate_index(0) <NEW_LINE> instance.objectPlayer.set_text(index, value) | Set Radio button->Change text
Parameters:
0: Change text (EXPRESSION, ExpressionParameter)
1: Change text (EXPSTRING, ExpressionParameter) | 6259904076d4e153a661dbbb |
class FastGrrMessageList(rdf_structs.RDFProtoStruct): <NEW_LINE> <INDENT> type_description = type_info.TypeDescriptorSet( type_info.ProtoList(type_info.ProtoEmbedded( name="job", field_number=1, nested=StructGrrMessage)) ) | A Faster implementation of GrrMessageList. | 6259904024f1403a92686214 |
class MethodInstanceHop(object): <NEW_LINE> <INDENT> def __init__(self, part_name): <NEW_LINE> <INDENT> self._part_name = part_name <NEW_LINE> self._next_parts = [] <NEW_LINE> <DEDENT> def _append_next(self, next): <NEW_LINE> <INDENT> self._next_parts.append(next) <NEW_LINE> <DEDENT> def _get_next(self, name): <NEW_LIN... | 方法实例跳板
| 6259904023e79379d538d78e |
class UnstructuredGrid(PointSet): <NEW_LINE> <INDENT> def GetCellTypes(self): <NEW_LINE> <INDENT> if not self.VTKObject.GetCellTypesArray(): <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> return vtkDataArrayToVTKArray( self.VTKObject.GetCellTypesArray(), self) <NEW_LINE> <DEDENT> def GetCellLocations(self): <NEW_L... | This is a python friendly wrapper of a vtkUnstructuredGrid that defines
a few useful properties. | 6259904007f4c71912bb06c1 |
class PosixPipeInput(Vt100Input, PipeInput): <NEW_LINE> <INDENT> _id = 0 <NEW_LINE> def __init__(self, text: str = "") -> None: <NEW_LINE> <INDENT> self._r, self._w = os.pipe() <NEW_LINE> class Stdin: <NEW_LINE> <INDENT> encoding = "utf-8" <NEW_LINE> def isatty(stdin) -> bool: <NEW_LINE> <INDENT> return True <NEW_LINE>... | Input that is send through a pipe.
This is useful if we want to send the input programmatically into the
application. Mostly useful for unit testing.
Usage::
input = PosixPipeInput()
input.send_text('inputdata') | 62599040ec188e330fdf9b29 |
class Album(LogOwlModel): <NEW_LINE> <INDENT> title = models.CharField(max_length=255) <NEW_LINE> prefix = models.CharField(max_length=20, blank=True) <NEW_LINE> subtitle = models.CharField(blank=True, max_length=255) <NEW_LINE> slug = models.SlugField() <NEW_LINE> band = models.ForeignKey(Band, blank=True) <NEW_LINE> ... | Album model | 6259904007d97122c4217f2f |
class SubprocessTimeoutTest(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self._path = os.path.dirname(os.path.realpath(__file__)) <NEW_LINE> <DEDENT> def test_normal_exec_no_timeout(self): <NEW_LINE> <INDENT> cmdline = "sleep 1; echo Done" <NEW_LINE> (return_code, output, err) = sub.run(... | Test the support for execution of programs with timeouts | 625990401d351010ab8f4dad |
class VesperRpgSystem(Thread): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> while rpg_const.SYSTEM_ACTIVE: <NEW_LINE> <INDENT> RpgTick.all_tock() <NEW_LINE> time.sleep(1 / rpg_const.FPS_MAX) | Class to manage the continuous processing of VesperRpg System in a separate
thread. | 6259904073bcbd0ca4bcb51b |
class Encryption(base.LibvirtXMLBase): <NEW_LINE> <INDENT> __slots__ = ('format', 'secret') <NEW_LINE> def __init__(self, virsh_instance=base.virsh): <NEW_LINE> <INDENT> accessors.XMLAttribute('format', self, parent_xpath='/', tag_name='encryption', attribute='format') <NEW_LINE> accessors.XMLElementDict('secret', self... | Encryption volume XML class
Properties:
format:
string.
secret:
dict, keys: type, uuid | 625990401d351010ab8f4dae |
class AddFields(logging.Filter): <NEW_LINE> <INDENT> def __init__(self, attribute_name, thread_local_field_names, constant_field_values): <NEW_LINE> <INDENT> self.attribute_name = attribute_name <NEW_LINE> self.thread_local_field_names = thread_local_field_names <NEW_LINE> self.constant_field_values = constant_field_va... | add custom fields to messages for graypy to forward to graylog
if the values are constant, can may be added as a dictionary when the filter is created.
if they change, the values can be copied form thread-local fields with the given names.
NOTE: graypy will automatically also add: function, pid, process_name, thread_na... | 6259904029b78933be26aa0b |
class SetReference(Reference): <NEW_LINE> <INDENT> def __init__(self, element, location=None): <NEW_LINE> <INDENT> super(SetReference, self).__init__(None, location=location) <NEW_LINE> self.element = reference(element) <NEW_LINE> self._init_type() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<Se... | SetReference has a child for an element, creates a set on linking. | 62599040d53ae8145f9196ed |
class Model(Shape): <NEW_LINE> <INDENT> def __init__(self, camera=None, light=None, file_string=None, name="", x=0.0, y=0.0, z=0.0, rx=0.0, ry=0.0, rz=0.0, sx=1.0, sy=1.0, sz=1.0, cx=0.0, cy=0.0, cz=0.0): <NEW_LINE> <INDENT> super(Model, self).__init__(camera, light, name, x, y, z, rx, ry, rz, sx, sy, sz, cx, cy, cz) <... | 3d model inherits from Shape
loads vertex, normal, uv, index, texture and material data from obj or egg files
at the moment it doesn't fully implement the features such as animation,
reflectivity etc | 6259904045492302aabfd76b |
class Alarm(AWSObject): <NEW_LINE> <INDENT> resource_type = "AWS::CloudWatch::Alarm" <NEW_LINE> props: PropsDictType = { "ActionsEnabled": (boolean, False), "AlarmActions": ([str], False), "AlarmDescription": (str, False), "AlarmName": (str, False), "ComparisonOperator": (str, True), "DatapointsToAlarm": (integer, Fals... | `Alarm <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cw-alarm.html>`__ | 625990408e05c05ec3f6f7a3 |
class LEDDownBlock(nn.Layer): <NEW_LINE> <INDENT> def __init__(self, in_channels, out_channels, correct_size_mismatch, bn_eps, data_format="channels_last", **kwargs): <NEW_LINE> <INDENT> super(LEDDownBlock, self).__init__(**kwargs) <NEW_LINE> self.correct_size_mismatch = correct_size_mismatch <NEW_LINE> self.data_forma... | LEDNet specific downscale block.
Parameters:
----------
in_channels : int
Number of input channels.
out_channels : int
Number of output channels.
correct_size_mistmatch : bool
Whether to correct downscaled sizes of images.
bn_eps : float
Small float added to variance in Batch norm.
data_format : str, d... | 62599040507cdc57c63a602c |
class RealChange(NamedTuple): <NEW_LINE> <INDENT> id_code: str <NEW_LINE> value: float | Real value (floating point) change descriptor. | 625990408e71fb1e983bcd5e |
class SelectionFrame(tk.Frame): <NEW_LINE> <INDENT> def __init__(self,master,data,plot): <NEW_LINE> <INDENT> super().__init__(master) <NEW_LINE> self._master = master <NEW_LINE> self._stationselect = tk.Label(master,text="Station Selection: ") <NEW_LINE> self._stationselect.pack(side=tk.LEFT,anchor=tk.SW, pady = 20) <N... | This class inherits from tkinter Frame class
It holds the checkbuttons responsible for toggling
each station's Boolean value | 6259904007d97122c4217f30 |
class Weather : <NEW_LINE> <INDENT> def __init__(self,id,url) : <NEW_LINE> <INDENT> self.url = url <NEW_LINE> self.id = id <NEW_LINE> self.refresh() <NEW_LINE> <DEDENT> def refresh(self) : <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> page = urllib.urlopen(self.url) <NEW_LINE> report = page.readline() <NEW_LINE> data = ... | cut down version just for the barometer mock | 6259904050485f2cf55dc215 |
class SBS_COMMAND_BQ_TURBO(DecoratedEnum): <NEW_LINE> <INDENT> TURBO_POWER = 0x59 <NEW_LINE> TURBO_FINAL = 0x5a <NEW_LINE> TURBO_PACK_R = 0x5b <NEW_LINE> TURBO_SYS_R = 0x5c <NEW_LINE> TURBO_EDV = 0x5d <NEW_LINE> TURBO_CURRENT = 0x5e | Commands used in BQ family SBS chips which support TURBO mode
| 62599040a4f1c619b294f7d0 |
class MySensorsBinarySensor(mysensors.device.MySensorsEntity, BinarySensorEntity): <NEW_LINE> <INDENT> @property <NEW_LINE> def is_on(self) -> bool: <NEW_LINE> <INDENT> return self._values.get(self.value_type) == STATE_ON <NEW_LINE> <DEDENT> @property <NEW_LINE> def device_class(self) -> str | None: <NEW_LINE> <INDENT>... | Representation of a MySensors Binary Sensor child node. | 625990401f5feb6acb163e85 |
class NullRegister(Register): <NEW_LINE> <INDENT> def write(self, val): <NEW_LINE> <INDENT> pass | Supports read and write, but always returns 0. | 625990408a349b6b436874d9 |
class Get_revit_elements: <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def get_elems_by_category(cls, category_class, active_view=None, name=None): <NEW_LINE> <INDENT> if not active_view: <NEW_LINE> <INDENT> els = FilteredElementCollector(doc).OfClass(category_class). ToElements() <NEW_LINE> <DEDENT> el... | Класс для поиска элементов в Revit. | 6259904015baa72349463223 |
class EventObjectQueueProducer(QueueProducer): <NEW_LINE> <INDENT> def ProduceEventObject(self, event_object): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> self._queue.PushItem(event_object) <NEW_LINE> <DEDENT> except ValueError as exception: <NEW_LINE> <INDENT> logging.error(( u'Unable to produce a serialized event ob... | Class that implements the event object queue producer.
The producer generates updates on the queue. | 6259904050485f2cf55dc216 |
class NtdtestFoldingGetIterMixedKeyTd(NetAppObject): <NEW_LINE> <INDENT> _key_2 = None <NEW_LINE> @property <NEW_LINE> def key_2(self): <NEW_LINE> <INDENT> return self._key_2 <NEW_LINE> <DEDENT> @key_2.setter <NEW_LINE> def key_2(self, val): <NEW_LINE> <INDENT> if val != None: <NEW_LINE> <INDENT> self.validate('key_2',... | Key typedef for table ntdtest_folding | 6259904073bcbd0ca4bcb51d |
class ModificationDateTimeField(CreationDateTimeField): <NEW_LINE> <INDENT> def pre_save(self, model, add): <NEW_LINE> <INDENT> value = datetime.datetime.now() <NEW_LINE> setattr(model, self.attname, value) <NEW_LINE> return value <NEW_LINE> <DEDENT> def get_internal_type(self): <NEW_LINE> <INDENT> return "DateTimeFiel... | ModificationDateTimeField
By default, sets editable=False, blank=True, default=datetime.now
Sets value to datetime.now() on each save of the model. | 6259904071ff763f4b5e8a31 |
@dns.immutable.immutable <NEW_LINE> class ZONEMD(dns.rdata.Rdata): <NEW_LINE> <INDENT> __slots__ = ['serial', 'scheme', 'hash_algorithm', 'digest'] <NEW_LINE> def __init__(self, rdclass, rdtype, serial, scheme, hash_algorithm, digest): <NEW_LINE> <INDENT> super().__init__(rdclass, rdtype) <NEW_LINE> self.serial = self.... | ZONEMD record | 625990406e29344779b018e4 |
class AnalogPotentiometer(LiveWindowSendable): <NEW_LINE> <INDENT> def __init__(self, channel, fullRange=1.0, offset=0.0): <NEW_LINE> <INDENT> if not hasattr(channel, "getVoltage"): <NEW_LINE> <INDENT> channel = AnalogInput(channel) <NEW_LINE> <DEDENT> self.analog_input = channel <NEW_LINE> self.fullRange = fullRange <... | Reads a potentiometer via an :class:`.AnalogInput`
Analog potentiometers read
in an analog voltage that corresponds to a position. The position is in
whichever units you choose, by way of the scaling and offset constants
passed to the constructor.
.. not_implemented: initPot | 6259904029b78933be26aa0c |
class Spider(object): <NEW_LINE> <INDENT> page_loader = loader.Loader() <NEW_LINE> links_parser = parser.LinksParser() <NEW_LINE> use_existing = True <NEW_LINE> def __init__(self, ldr=None, links_parser=None): <NEW_LINE> <INDENT> if not ldr is None: <NEW_LINE> <INDENT> self.page_loader = ldr <NEW_LINE> <DEDENT> if not ... | Gets page content, parses it for new links.
If use_existing is True then if content is already loaded
it will be parsed, not loaded again. | 6259904045492302aabfd76d |
class Solution: <NEW_LINE> <INDENT> def kClosest(self, points, origin, k): <NEW_LINE> <INDENT> return sorted(points, key=lambda p: ((p.x - origin.x)**2 + (p.y - origin.y)**2, p.x, p.y))[:k] | @param points: a list of points
@param origin: a point
@param k: An integer
@return: the k closest points | 6259904030c21e258be99aa0 |
class BufferCopyRequest(Request): <NEW_LINE> <INDENT> request_id = RequestId.BUFFER_GENERATE <NEW_LINE> def __init__( self, frame_count=None, source_buffer_id=None, source_starting_frame=None, target_buffer_id=None, target_starting_frame=None, ): <NEW_LINE> <INDENT> Request.__init__(self) <NEW_LINE> self._source_buffer... | A `/b_gen copy` request.
::
>>> import supriya.commands
>>> request = supriya.commands.BufferCopyRequest(
... source_buffer_id=23,
... target_buffer_id=666,
... )
>>> print(request)
BufferCopyRequest(
source_buffer_id=23,
target_buffer_id=666,
)
::
>>> req... | 62599040287bf620b6272e79 |
@dataclasses.dataclass <NEW_LINE> class TestSuites: <NEW_LINE> <INDENT> name: t.Optional[str] = None <NEW_LINE> suites: t.List[TestSuite] = dataclasses.field(default_factory=list) <NEW_LINE> @property <NEW_LINE> def disabled(self) -> int: <NEW_LINE> <INDENT> return sum(suite.disabled for suite in self.suites) <NEW_LINE... | A collection of test suites. | 6259904024f1403a92686216 |
class StatusDisplay: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.preText = '' <NEW_LINE> self.percentage = 0.0 <NEW_LINE> self.overwriteLine = False <NEW_LINE> self.silent = False <NEW_LINE> self.percentFormat = '% 5.1f' <NEW_LINE> self.textLength = 0 <NEW_LINE> <DEDENT> def display_percentage(self... | A class to sequentially display percentage completion of an iterative
process on a single line. | 6259904007f4c71912bb06c5 |
class TranslationExtension(Extension): <NEW_LINE> <INDENT> tags = {"translation"} <NEW_LINE> def parse(self, parser): <NEW_LINE> <INDENT> lineno = next(parser.stream).lineno <NEW_LINE> block_language = parser.parse_expression() <NEW_LINE> body = parser.parse_statements(["name:endtranslation"], drop_needle=True) <NEW_LI... | Provide a Jinja2 tag like Django's {% translation %} block
Usage:
{% translation 'en-US' %}
<p>_('This string is translatable, but displayed in English.')</p>
{% endtranslation %}
See Django documentation for details:
https://docs.djangoproject.com/en/1.11/topics/i18n/translation/#switching-language-in-templates
... | 6259904023e79379d538d792 |
class ListTagView(LGRHandlingBaseMixin, TemplateView): <NEW_LINE> <INDENT> template_name = 'lgr_editor/tags.html' <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE> <INDENT> ctx = super().get_context_data(**kwargs) <NEW_LINE> tag_classes = self.lgr_info.lgr.get_tag_classes() <NEW_LINE> tags = [{ 'name': tag, '... | List/edit tags of an LGR. | 62599040d99f1b3c44d06930 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.