code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class DepthFirstCrawler(Crawler): <NEW_LINE> <INDENT> def _crawl(self, nodes): <NEW_LINE> <INDENT> node_list = nodes <NEW_LINE> cur_node = node_list[-1] <NEW_LINE> while cur_node and cur_node.depth < self.max_depth: <NEW_LINE> <INDENT> new_node = None <NEW_LINE> while not new_node and len(cur_node.links) > 0: <NEW_LINE... | Implements a depth first strategy to crawl. This will randomly select a link on each page to follow to the next
level. Terminates after reaching the desired depth or when the termination phrase is encountered | 62599062627d3e7fe0e08562 |
class ACLAction(Base): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super(ACLAction, self).__init__(ACLActionParam, [ACLActionParam.NAME, ACLActionParam.DESCRIPTION], kwargs) <NEW_LINE> self.grant_rules = [] <NEW_LINE> self.revoke_rules = [] <NEW_LINE> <DEDENT> def grant(self, acl_action_rule):... | This class represents a ACLAction
:param id_unique: ID of the ACLAction
:type id_unique: int
:param name: Name of the ACLAction
:type name: str
:param description: Description of the ACLAction
:type description: str
:param activate: Is the ACLAction enabled?
:type activate: bool | 625990626e29344779b01d27 |
class BatchNorm2d(_BatchNorm): <NEW_LINE> <INDENT> def _check_input_dim(self, input): <NEW_LINE> <INDENT> if input.dim() != 4: <NEW_LINE> <INDENT> raise ValueError('expected 4D input (got {}D input)' .format(input.dim())) | Applies Batch Normalization over a 4D input (a mini-batch of 2D inputs
with additional channel dimension) as described in the paper
`Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift`_ .
.. math::
y = \frac{x - \mathrm{E}[x]}{ \sqrt{\mathrm{Var}[x] + \epsilon}} * \gamma ... | 625990624e4d562566373ade |
class HelpersDirectoryTests(unittest.TestCase): <NEW_LINE> <INDENT> @unittest.skip('Not yet implemented') <NEW_LINE> def test_make_dirs(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @unittest.skip('Not yet implemented') <NEW_LINE> def test_delete_empty_folders(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> @... | Test directory methods | 62599062be8e80087fbc075e |
class cutfastqC(): <NEW_LINE> <INDENT> def __init__(self, *fastq, length=0, size=0, outprefix=''): <NEW_LINE> <INDENT> self._file = fastq <NEW_LINE> self._fastq = [] <NEW_LINE> self._length = float(length) <NEW_LINE> self._size = self._normalized(size) <NEW_LINE> self._out = outprefix <NEW_LINE> self._fs = '/annoroad/d... | trim fastq data(use c program fastq-tool) | 625990623d592f4c4edbc5b4 |
@place(DEVICES) <NEW_LINE> @parameterize((TEST_CASE_NAME, 'x', 'n', 'axis', 'norm'), [ ('test_x_complex128', (np.random.randn(4, 4, 4) + 1j * np.random.randn(4, 4, 4) ).astype(np.complex128), None, None, "backward"), ('test_n_grater_than_input_length', np.random.randn(4, 4, 4) + 1j * np.random.randn(4, 4, 4), [4], None... | Test hfftn with norm condition
| 6259906276e4537e8c3f0c63 |
class BaseType: <NEW_LINE> <INDENT> valid_values = None <NEW_LINE> special = False <NEW_LINE> def __init__(self, none_ok=False): <NEW_LINE> <INDENT> self.none_ok = none_ok <NEW_LINE> <DEDENT> def _basic_validation(self, value): <NEW_LINE> <INDENT> if not value: <NEW_LINE> <INDENT> if self.none_ok: <NEW_LINE> <INDENT> r... | A type used for a setting value.
Attributes:
none_ok: Whether to convert to None for an empty string.
Class attributes:
valid_values: Possible values if they can be expressed as a fixed
string. ValidValues instance.
special: If set, the type is only used for one option and isn't
... | 625990624e4d562566373adf |
class AddColumns(Operation): <NEW_LINE> <INDENT> __metaclass__ = ABCMeta <NEW_LINE> def __init__(self, join_kind="left"): <NEW_LINE> <INDENT> self.join_kind = join_kind <NEW_LINE> <DEDENT> @abstractmethod <NEW_LINE> def build_output(self, story_data): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def transform(self, sto... | Very typical case of an operation that appends (i.e. joins) columns to
the previous result | 625990627d847024c075daad |
class TestLinearCreateStopOrderResultBase(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 testLinearCreateStopOrderResultBase(self): <NEW_LINE> <INDENT> pass | LinearCreateStopOrderResultBase unit test stubs | 6259906232920d7e50bc771f |
class OperationTypeValueValuesEnum(_messages.Enum): <NEW_LINE> <INDENT> TYPE_UNSPECIFIED = 0 <NEW_LINE> CREATE_CLUSTER = 1 <NEW_LINE> DELETE_CLUSTER = 2 <NEW_LINE> UPGRADE_MASTER = 3 <NEW_LINE> UPGRADE_NODES = 4 <NEW_LINE> REPAIR_CLUSTER = 5 <NEW_LINE> UPDATE_CLUSTER = 6 <NEW_LINE> CREATE_NODE_POOL = 7 <NEW_LINE> DELET... | The operation type.
Values:
TYPE_UNSPECIFIED: Not set.
CREATE_CLUSTER: Cluster create.
DELETE_CLUSTER: Cluster delete.
UPGRADE_MASTER: A master upgrade.
UPGRADE_NODES: A node upgrade.
REPAIR_CLUSTER: Cluster repair.
UPDATE_CLUSTER: Cluster update.
CREATE_NODE_POOL: Node pool create.
DELETE_NODE_POOL:... | 62599062d268445f2663a6c9 |
class ThomsonDeviceScanner(object): <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.host = config[CONF_HOST] <NEW_LINE> self.username = config[CONF_USERNAME] <NEW_LINE> self.password = config[CONF_PASSWORD] <NEW_LINE> self.lock = threading.Lock() <NEW_LINE> self.last_results = {} <NEW_LINE> dat... | This class queries a router running THOMSON firmware
for connected devices. Adapted from ASUSWRT scanner. | 6259906245492302aabfdbb3 |
class InstallNodeDependenciesCommand(Command): <NEW_LINE> <INDENT> description = 'Install the node packages required for building static media.' <NEW_LINE> user_options = [ (str('use-npm-cache'), None, 'Use npm-cache to install packages'), ] <NEW_LINE> boolean_options = [str('use-npm-cache')] <NEW_LINE> def init... | Installs all node.js dependencies from npm.
If ``--use-npm-cache`` is passed, this will use :command:`npm-cache`
to install the packages, which is best for Continuous Integration setups.
Otherwise, :command:`npm` is used. | 625990624a966d76dd5f05cd |
class ControlPanel(wx.Panel): <NEW_LINE> <INDENT> def __init__(self, parent, vsProc): <NEW_LINE> <INDENT> wx.Panel.__init__(self, parent, -1, style=wx.WANTS_CHARS) <NEW_LINE> self.parent = parent <NEW_LINE> self.vsProc = vsProc <NEW_LINE> gbs = wx.GridBagSizer(3, 4) <NEW_LINE> label = wx.StaticText(self, -1, _("Source ... | Panel with the files selections grid. | 625990623eb6a72ae038bd38 |
class ErrorController(BaseController): <NEW_LINE> <INDENT> def document(self): <NEW_LINE> <INDENT> page = error_document_template % dict(prefix=request.environ.get('SCRIPT_NAME', ''), code=request.params.get('code', ''), message=request.params.get('message', '')) <NEW_LINE> return render('not_found.html') <N... | Generates error documents as and when they are required.
The ErrorDocuments middleware forwards to ErrorController when error
related status codes are returned from the application.
This behaviour can be altered by changing the parameters to the
ErrorDocuments middleware in your config/middleware.py file. | 625990624f88993c371f108b |
class NewsSourceForm(OptionalValidateUniqueMixin, forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = NewsSourceModel <NEW_LINE> fields = '__all__' | Model form to validate data from newsapi.org | 625990628e71fb1e983bd1a4 |
class Solution: <NEW_LINE> <INDENT> def is_monotonic(self, a): <NEW_LINE> <INDENT> if len(a) < 2: <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> s = set() <NEW_LINE> n = len(a) <NEW_LINE> for i in range(0, n - 1, 1): <NEW_LINE> <INDENT> if a[i + 1] - a[i] == 0: <NEW_LINE> <INDENT> continue <NEW_LINE> <DEDENT> elif... | Iteration over all elements in array.
Time complexity: O(n)
- Iterate over all array elements
Space complexity: O(1)
- Amortized collect one element in unique set | 62599062a17c0f6771d5d711 |
class _DictMixed(IValidator): <NEW_LINE> <INDENT> cleaned_data = None <NEW_LINE> errors = None <NEW_LINE> error_msg = 'No validator for {}' <NEW_LINE> error_msg_required = 'Field {} required' <NEW_LINE> def __init__(self, validators, policy='error', required=False): <NEW_LINE> <INDENT> self.validators = validators <NEW... | Validate dict keys by multiple validators
:param dict validators: validator which be applyed to all values of dict.
:param str policy: policy if validator for data not found:
"error" - add error into `errors` attr and return False.
"except" - raise KeyError exception.
"ignore" - add source value into clean... | 62599062097d151d1a2c2749 |
class Subscription(graphene.ObjectType): <NEW_LINE> <INDENT> new_message = graphene.Field(MessageType, channel_id=graphene.ID()) <NEW_LINE> notifications = graphene.Field(RoomType, user_id=graphene.Int()) <NEW_LINE> on_focus = graphene.Boolean(room_id=graphene.ID()) <NEW_LINE> has_unreaded_messages = graphene.Boolean(u... | All Subscriptions | 62599062d6c5a102081e37fe |
class AmbientSpace(ambient_space.AmbientSpace): <NEW_LINE> <INDENT> @lazy_attribute <NEW_LINE> def _dual_space(self): <NEW_LINE> <INDENT> K = self.base_ring() <NEW_LINE> return self.cartan_type().dual().root_system().ambient_space(K) <NEW_LINE> <DEDENT> def dimension(self): <NEW_LINE> <INDENT> return self.root_system.d... | Ambient space for a dual finite Cartan type.
It is constructed in the canonical way from the ambient space of
the original Cartan type by switching the roles of simple roots,
fundamental weights, etc.
.. NOTE::
Recall that, for any finite Cartan type, and in particular the
a simply laced one, the dual Cartan... | 62599062ac7a0e7691f73bbe |
class VoxelGeoVolumeFile(GeoprobeVolumeFileV2): <NEW_LINE> <INDENT> _magic_number = 43970 | Appears to be identical to a geoprobe volume, but uses a different magic
number. It's possible (and likely?) that there are other differences, but
I don't have access to VoxelGeo to test and see. | 62599062435de62698e9d4e1 |
class EtlHeadGenerator(object): <NEW_LINE> <INDENT> def __init__(self, source_key): <NEW_LINE> <INDENT> self.source_key = source_key <NEW_LINE> self.next_id = 0 <NEW_LINE> <DEDENT> def next( self, source_etl, **kwargs ): <NEW_LINE> <INDENT> num = self.next_id <NEW_LINE> self.next_id = num + 1 <NEW_LINE> dest_key = self... | WILL RETURN A UNIQUE ETL STRUCTURE, GIVEN A SOURCE AND A DESTINATION NAME | 62599062e5267d203ee6cf2c |
class FileInit(): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def client_init_files(): <NEW_LINE> <INDENT> open("current_request.txt", "w") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def executor_init_files(): <NEW_LINE> <INDENT> FileInit.make_dir("Requests_To_Execute/") <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> ... | The class initializes the files the system is going to use on this client. | 62599062a8370b77170f1aa8 |
class SessionPasswordNeeded(Unauthorized): <NEW_LINE> <INDENT> ID = "SESSION_PASSWORD_NEEDED" <NEW_LINE> MESSAGE = __doc__ | Two-step verification password required | 625990624428ac0f6e659c0d |
@dataclass <NEW_LINE> class OffsetData: <NEW_LINE> <INDENT> value: typing.List[float] <NEW_LINE> last_modified: typing.Optional[datetime] | Class to categorize the shape of a
given calibration data. | 62599062dd821e528d6da4ee |
class EditarDependencia(UpdateView): <NEW_LINE> <INDENT> model = Dependencia <NEW_LINE> template_name = 'configuracion/dependencia/modificar.html' <NEW_LINE> context_object_name = "editar_dependencia" <NEW_LINE> success_url = reverse_lazy("listar_dependencia") <NEW_LINE> def get_context_data(self, **kwargs): <NEW_LINE>... | Vista basada en clase: (`Editar`)
:param template_name: ruta de la plantilla
:param model: Modelo al cual se hace referencia
:param success_url: nombre de la ruta a la cual se redireccionara la aplicacion una vez culminada la edición del
registro satisfactoriamente
:param context_object_name: nombre del objeto que... | 625990623617ad0b5ee07829 |
@dataclasses.dataclass <NEW_LINE> class SteelMaterial(): <NEW_LINE> <INDENT> name: str <NEW_LINE> E: unyt.unyt_quantity <NEW_LINE> Fy: unyt.unyt_quantity <NEW_LINE> Fu: unyt.unyt_quantity <NEW_LINE> Ry: float <NEW_LINE> Rt: float <NEW_LINE> def __post_init__(self): <NEW_LINE> <INDENT> get_stress = units.UnitInputParser... | A steel material.
Parameters
----------
name : str
Name of the material.
E : float, unyt.unyt_array
Elastic modulus. If units are not specified, assumed to be ksi.
Fy : float, unyt.unyt_array
Design yield strength. If units are not specified, assumed to be ksi.
Fu : float, unyt.unyt_array
Design tensil... | 625990627b25080760ed884e |
class InvalidTwitterEndpointException(TwitterApplianceException): <NEW_LINE> <INDENT> def __init__(self, endpoint, msg): <NEW_LINE> <INDENT> self.endpoint = endpoint <NEW_LINE> self.msg = msg | Exception raised by looking for invalid resources
Attributes:
endpoint -- the endpoint looked for
msg -- explanation of the error | 62599062d486a94d0ba2d6a3 |
class Event(generics.GenericModel, Generic[IDT, PayloadT]): <NEW_LINE> <INDENT> id: IDT <NEW_LINE> delivery_id: UUID <NEW_LINE> hook_id: int <NEW_LINE> payload: PayloadT | Represents an abstract Github webhook event.
All known GitHub webhook events should derive from this class and specify the
event 'name' that they should be parsed from.
Event models encapsulate information that comes in both the webhook request payload
and HTTP headers. | 625990623539df3088ecd978 |
class ResourceItemAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ('title', 'file', 'description',) <NEW_LINE> prepopulated_fields = {'slug':('title',)} | Admin View for ResourceItem | 6259906256b00c62f0fb3fa6 |
class EmptyLayerException(Exception): <NEW_LINE> <INDENT> pass | Raises error if user tries to add a layer with less than one neurode | 6259906216aa5153ce401bb7 |
@global_preferences_registry.register <NEW_LINE> class LdapNonOrionADNodesReportSubscription(StringPreference): <NEW_LINE> <INDENT> section = LDAP_PROBE <NEW_LINE> name = 'ldap_non_orion_ad_nodes_subscription' <NEW_LINE> default = 'LDAP: non Orion AD nodes' <NEW_LINE> required = True <NEW_LINE> verbose_name = _( 'Email... | Dynamic preferences class controlling the name of the
:class:`Email subscription <p_soc_auto_base.models.Subscription>`
used for dispatching `LDAP` reports about `AD` nodes not defined
on the `Orion` server
:access_key: 'ldapprobe__ldap_non_orion_ad_nodes_subscription' | 62599062462c4b4f79dbd0e1 |
class GaussianMP2Test(GenericMP2Test): <NEW_LINE> <INDENT> def testnocoeffs(self): <NEW_LINE> <INDENT> self.assertEquals(self.data.nocoeffs.shape, (self.data.nmo, self.data.nbasis)) <NEW_LINE> <DEDENT> def testnocoeffs(self): <NEW_LINE> <INDENT> self.assertEquals(self.data.nooccnos.shape, (self.data.nmo, )) | Customized MP2 unittest | 62599062627d3e7fe0e08566 |
class IperfSessionBuilder(BaseToolBuilder): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(IperfSessionBuilder, self).__init__(*args, **kwargs) <NEW_LINE> self._test = None <NEW_LINE> self._directions = None <NEW_LINE> self._filename = None <NEW_LINE> return <NEW_LINE> <DEDENT> @prop... | A class to build an iperf session | 62599062be8e80087fbc0762 |
class Cola(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.frente, self.final, self.tamanio = None, None, 0 | TDA cola | 62599062435de62698e9d4e3 |
class ForeignKeysResponse: <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.LIST, 'foreignKeys', (TType.STRUCT,(SQLForeignKey, SQLForeignKey.thrift_spec)), None, ), ) <NEW_LINE> def __init__(self, foreignKeys=None,): <NEW_LINE> <INDENT> self.foreignKeys = foreignKeys <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_L... | Attributes:
- foreignKeys | 6259906263d6d428bbee3df6 |
class Section(object): <NEW_LINE> <INDENT> subsections_number = 0 <NEW_LINE> @classmethod <NEW_LINE> def reset(cls): <NEW_LINE> <INDENT> cls.subsections_number = 0 <NEW_LINE> Subsection.reset() <NEW_LINE> return <NEW_LINE> <DEDENT> def __init__(self, number, title=None): <NEW_LINE> <INDENT> self.number = number <NEW_LI... | Section object.
Attributes
----------
subsections_number: int | 62599062009cb60464d02c13 |
class CAdvCopy(object): <NEW_LINE> <INDENT> fieldlist = {'xxx': 999} <NEW_LINE> template = "" <NEW_LINE> def __init__(self,fieldlist,template): <NEW_LINE> <INDENT> self.fieldlist.clear() <NEW_LINE> self.template = template <NEW_LINE> for field in fieldlist: <NEW_LINE> <INDENT> u = uuid.uuid4() <NEW_LINE> suuid = str(u.... | Generates a universally unique ID. args make it more random,
if used. | 6259906276e4537e8c3f0c65 |
class Commands: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.handlers = {} <NEW_LINE> <DEDENT> def add(self, name, auth_required=True, list_command=True, **validators): <NEW_LINE> <INDENT> def wrapper(func): <NEW_LINE> <INDENT> if name in self.handlers: <NEW_LINE> <INDENT> raise ValueError(f"{name} ... | Collection of MPD commands to expose to users.
Normally used through the global instance which command handlers have been
installed into. | 62599062f7d966606f749427 |
class StaticRNNMemoryLink(object): <NEW_LINE> <INDENT> def __init__(self, init, pre_mem, mem=None): <NEW_LINE> <INDENT> self.init = init <NEW_LINE> self.pre_mem = pre_mem <NEW_LINE> self.mem = mem | StaticRNNMemoryLink class.
StaticRNNMemoryLink class is used to create a link between two
memory cells of a StaticRNN.
NOTE: This is a internal data structure of a very low-level API.
Please use StaticRNN instead.
Args:
init(Variable): the initial variable for Memory.
pre_mem(Variable): the memory variable ... | 62599062379a373c97d9a700 |
class Combatant(DirectionalGameObject): <NEW_LINE> <INDENT> def __init__(self, x, y, direction, score, hp, shield_active, laser_count, teleport_count, shield_count): <NEW_LINE> <INDENT> super().__init__(x, y, direction) <NEW_LINE> self.score = score <NEW_LINE> self.hp = hp <NEW_LINE> self.shield_active = shield_active ... | A general object representing a player on the gameboard.
Attributes:
score (int): This Combatant's current score.
hp (int): This Combatant's current hp (remaining lives/hit points).
shield_active (boolean): True iff this Combatant's shield is currently active.
laser_count (int): The number of laser pow... | 6259906224f1403a9268643c |
class Coverage(object): <NEW_LINE> <INDENT> config = Config( cmd_run_test = "`which py.test`", branch=True, parallel=False, omit=[]) <NEW_LINE> def __init__(self, pkgs, config=None): <NEW_LINE> <INDENT> self.config = self.config.make(config) <NEW_LINE> self.pkgs = [] <NEW_LINE> for pkg in pkgs: <NEW_LINE> <INDENT> if i... | generate tasks for coverage.py | 625990628e71fb1e983bd1a7 |
class base_case(object): <NEW_LINE> <INDENT> def handle_file(self, handler, full_path): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with open(full_path, 'rb') as reader: <NEW_LINE> <INDENT> content = reader.read() <NEW_LINE> <DEDENT> handler.send_content(content) <NEW_LINE> <DEDENT> except IOError as msg: <NEW_LINE> <... | 条件处理基类 | 6259906229b78933be26ac32 |
class TransformEvaluatorRegistry(object): <NEW_LINE> <INDENT> def __init__(self, evaluation_context): <NEW_LINE> <INDENT> assert evaluation_context <NEW_LINE> self._evaluation_context = evaluation_context <NEW_LINE> self._evaluators = { io.Read: _BoundedReadEvaluator, io.ReadStringsFromPubSub: _PubSubReadEvaluator, cor... | For internal use only; no backwards-compatibility guarantees.
Creates instances of TransformEvaluator for the application of a transform. | 625990627b25080760ed884f |
class _DenseAsppBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, input_num, num1, num2, dilation_rate, drop_out, bn_start=True,modulation=True,adaptive_d=True): <NEW_LINE> <INDENT> super(_DenseAsppBlock, self).__init__() <NEW_LINE> self.modulation = modulation <NEW_LINE> self.adaptive_d = adaptive_d <NEW_LINE> ... | ConvNet block for building DenseASPP. | 6259906201c39578d7f142a3 |
class CThostFtdcCombinationLegField: <NEW_LINE> <INDENT> def __init__(self,**fields): <NEW_LINE> <INDENT> """组合合约代码""" <NEW_LINE> self.CombInstrumentID = None <NEW_LINE> """单腿编号""" <NEW_LINE> self.LegID = None <NEW_LINE> """单腿合约代码""" <NEW_LINE> self.LegInstrumentID = None <NEW_LINE> """买卖方向""" <NEW_LINE> self.Direction... | 组合交易合约的单腿
CombInstrumentID 组合合约代码 char[31]
LegID 单腿编号 int
LegInstrumentID 单腿合约代码 char[31]
Direction 买卖方向 char
LegMultiple 单腿乘数 int
ImplyLevel 派生层数 int | 625990628e71fb1e983bd1a8 |
class FunctionKinds(IntEnum): <NEW_LINE> <INDENT> interpreted_function = 1 <NEW_LINE> uninterpreted_function = 2 <NEW_LINE> synth_function = 3 <NEW_LINE> macro_function = 4 | Function Kinds.
builtin_function: represents a builtin function.
macro_function: represents a user defined macro.
unknown_function: represents a function to be synthesized for. | 6259906256b00c62f0fb3fa8 |
class SessionAuthentication(Authentication): <NEW_LINE> <INDENT> def is_authenticated(self, request, **kwargs): <NEW_LINE> <INDENT> if request.method in ("GET", "HEAD", "OPTIONS", "TRACE"): <NEW_LINE> <INDENT> return request.user.is_authenticated() <NEW_LINE> <DEDENT> if getattr(request, "_dont_enforce_csrf_checks", Fa... | An authentication mechanism that piggy-backs on Django sessions.
This is useful when the API is talking to Javascript on the same site.
Relies on the user being logged in through the standard Django login
setup.
Requires a valid CSRF token. | 625990628da39b475be048c6 |
class process: <NEW_LINE> <INDENT> def __init__(self, number, numRefs, S, A, B, C): <NEW_LINE> <INDENT> self.number = int(number) <NEW_LINE> self.numRefs = int(numRefs) <NEW_LINE> self.numRefsLeft = int(numRefs) <NEW_LINE> self.refSize = int(S) <NEW_LINE> self.nextWordRef = (111 * self.number) % self.refSize <NEW_LINE... | implementation of process | 62599062097d151d1a2c274d |
class DbConnectionRefusedError(DatabaseError): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.message = 'connection refused. are the credentials and replica set name correct?' | Exception raise when connection is refused to mongodb
Attributes:
message -- generated explanation of the error | 625990626e29344779b01d2d |
class Boolean(TypeEngine, SchemaType): <NEW_LINE> <INDENT> __visit_name__ = 'boolean' <NEW_LINE> def __init__(self, create_constraint=True, name=None): <NEW_LINE> <INDENT> self.create_constraint = create_constraint <NEW_LINE> self.name = name <NEW_LINE> <DEDENT> def _should_create_constraint(self, compiler): <NEW_LINE>... | A bool datatype.
Boolean typically uses BOOLEAN or SMALLINT on the DDL side, and on
the Python side deals in ``True`` or ``False``. | 62599062627d3e7fe0e08568 |
class CategoryArticleList(ArticleListBase): <NEW_LINE> <INDENT> def get_queryset(self): <NEW_LINE> <INDENT> return super(CategoryArticleList, self).get_queryset().filter( categories=self.category ) <NEW_LINE> <DEDENT> def get(self, request, category): <NEW_LINE> <INDENT> language = translation.get_language_from_request... | A list of articles filtered by categories. | 62599062ac7a0e7691f73bc2 |
class GetTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def test_get(self): <NEW_LINE> <INDENT> adapter = get() <NEW_LINE> self.assertIsNotNone(adapter) <NEW_LINE> self.assertEqual('root', adapter.logger.name) <NEW_LINE> <DEDENT> def test_get_with_name(self): <NEW_LINE> <INDENT> adapter = get('logger_test') <NEW_LINE... | Tests for the monocle.logger.get() function. | 625990628e7ae83300eea76b |
class IapProjectsIapWebSetIamPolicyRequest(_messages.Message): <NEW_LINE> <INDENT> resource = _messages.StringField(1, required=True) <NEW_LINE> setIamPolicyRequest = _messages.MessageField('SetIamPolicyRequest', 2) | A IapProjectsIapWebSetIamPolicyRequest object.
Fields:
resource: REQUIRED: The resource for which the policy is being specified.
See the operation documentation for the appropriate value for this
field.
setIamPolicyRequest: A SetIamPolicyRequest resource to be passed as the
request body. | 62599062fff4ab517ebcef04 |
@deconstructible <NEW_LINE> class AlphanumericExcludingDiacritic: <NEW_LINE> <INDENT> def __init__(self, start=0): <NEW_LINE> <INDENT> self.start = start <NEW_LINE> <DEDENT> def __call__(self, value): <NEW_LINE> <INDENT> stripped_value = value[self.start :] <NEW_LINE> match = WORD_REGEX.match(stripped_value) <NEW_LINE>... | Alle alfanumerieke tekens m.u.v. diacrieten.
RGBZ heeft hier een vreemde definitie voor. De oorsprong is dat dit gek is
voor bestandsnamen, en dus speciale karakters uitgesloten worden. | 62599062be8e80087fbc0764 |
class abstract_declarator_Node(ParseNode): <NEW_LINE> <INDENT> def __init__(self, **kw): <NEW_LINE> <INDENT> ParseNode.__init__(self, **kw) <NEW_LINE> <DEDENT> def dump(self, indent=0): <NEW_LINE> <INDENT> ParseNode.dump(self, indent) | Holds an "abstract_declarator" parse target and its components. | 62599062baa26c4b54d50980 |
class DivExpression(BinaryExpression): <NEW_LINE> <INDENT> pass | {{ foo / bar }} | 6259906221bff66bcd724343 |
class AtLeastImportTestCase(unittest.TestCase): <NEW_LINE> <INDENT> failureException = ImportError <NEW_LINE> def test_misc(self): <NEW_LINE> <INDENT> from twisted import copyright <NEW_LINE> <DEDENT> def test_persisted(self): <NEW_LINE> <INDENT> from twisted.persisted import dirdbm <NEW_LINE> from twisted.persisted im... | I test that there are no syntax errors which will not allow importing. | 62599062d7e4931a7ef3d6f4 |
class ProcPipeMaxSize(KernelProcFileTestBase.KernelProcFileTestBase): <NEW_LINE> <INDENT> def parse_contents(self, contents): <NEW_LINE> <INDENT> return self.parse_line("{:d}\n", contents)[0] <NEW_LINE> <DEDENT> def get_path(self): <NEW_LINE> <INDENT> return "/proc/sys/fs/pipe-max-size" <NEW_LINE> <DEDENT> def get_perm... | /proc/sys/fs/pipe-max-size reports the maximum size (in bytes) of
individual pipes. | 625990620a50d4780f70692e |
class InstanceBoundTypeMixin(object): <NEW_LINE> <INDENT> __slots__ = () <NEW_LINE> _type_eq = classmethod(lambda cls, other: cls is type(other)) <NEW_LINE> _type_hash = classmethod(id) <NEW_LINE> def __eq__(self, other): <NEW_LINE> <INDENT> return self._type_eq(type(other)) <NEW_LINE> <DEDENT> def __hash__(self): <N... | Base class for per-instance types, that is types defined for each instance
of the target type.
Do not use without mixing in a instance-private type. | 625990627cff6e4e811b7124 |
class RandomNumOp(dsl.ContainerOp): <NEW_LINE> <INDENT> def __init__(self, low, high): <NEW_LINE> <INDENT> super(RandomNumOp, self).__init__( name='Random number', image='python:alpine3.6', command=['sh', '-c'], arguments=['python -c "import random; print(random.randint(%s,%s))" | tee /tmp/output' % (low, high)], file_... | Generate a random number between low and high. | 62599062379a373c97d9a702 |
class RouteGuideServicer(route_guide_pb2.EarlyAdopterRouteGuideServicer): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.db = route_guide_resources.read_route_guide_database() <NEW_LINE> <DEDENT> def GetFeature(self, request, context): <NEW_LINE> <INDENT> feature = get_feature(self.db, request) <NEW_L... | Provides methods that implement functionality of route guide server. | 625990624f6381625f19a012 |
class ln_service_sector_employment_within_walking_distance(Variable): <NEW_LINE> <INDENT> _return_type="float32" <NEW_LINE> service_sector_employment_within_walking_distance = "service_sector_employment_within_walking_distance" <NEW_LINE> def dependencies(self): <NEW_LINE> <INDENT> return [my_attribute_label(self.servi... | Natural log of the service_sector_employment_within_walking_distance for this gridcell | 62599062e64d504609df9f3d |
class Income: <NEW_LINE> <INDENT> name = 'Доход' <NEW_LINE> def __init__(self, date, money, num, comment): <NEW_LINE> <INDENT> self.date = date <NEW_LINE> self.money = money <NEW_LINE> self.comment = comment <NEW_LINE> self.num = num <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return f'*{self.name} {self... | Новый доход | 625990621f037a2d8b9e53da |
class SmsCodeViewset(CreateModelMixin, viewsets.GenericViewSet): <NEW_LINE> <INDENT> serializer_class = SmsSerializer <NEW_LINE> def generate_code(self): <NEW_LINE> <INDENT> seeds = '1234567890' <NEW_LINE> random_str = [] <NEW_LINE> for i in range(4): <NEW_LINE> <INDENT> random_str.append(choice(seeds)) <NEW_LINE> <DED... | 发送短信验证码 | 625990622ae34c7f260ac7c5 |
class FilterModule(object): <NEW_LINE> <INDENT> def filters(self): <NEW_LINE> <INDENT> return { 'b64decode': base64.b64decode, 'b64encode': base64.b64encode, 'to_json': json.dumps, 'to_nice_json': to_nice_json, 'from_json': json.loads, 'to_yaml': yaml.safe_dump, 'to_nice_yaml': to_nice_yaml, 'from_yaml': yaml.safe_load... | Ansible core jinja2 filters | 6259906266673b3332c31adb |
class StopSystemException(AxonException): <NEW_LINE> <INDENT> pass | This exception is used to stop the whole Axon system. | 62599062d486a94d0ba2d6a7 |
class ConnectionMonitorResultProperties(ConnectionMonitorParameters): <NEW_LINE> <INDENT> _validation = { 'monitoring_interval_in_seconds': {'maximum': 1800, 'minimum': 30}, 'provisioning_state': {'readonly': True}, 'start_time': {'readonly': True}, 'monitoring_status': {'readonly': True}, 'connection_monitor_type': {'... | Describes the properties of a connection monitor.
Variables are only populated by the server, and will be ignored when sending a request.
:param source: Describes the source of connection monitor.
:type source: ~azure.mgmt.network.v2020_11_01.models.ConnectionMonitorSource
:param destination: Describes the destinatio... | 625990628e71fb1e983bd1aa |
class VocabularyTest(unittest.TestCase): <NEW_LINE> <INDENT> def test_load_from_json(self): <NEW_LINE> <INDENT> voc = Loader(0, "test/data") <NEW_LINE> vocabulary = voc.load_json("test/data/Vocabulary/sample.json") <NEW_LINE> print(*vocabulary) <NEW_LINE> self.assertTrue(len(vocabulary) == 2, f"Found: {len(vocabulary)}... | Vocabulary module tester class
| 625990627d847024c075dab4 |
class PortString(object): <NEW_LINE> <INDENT> def __init__(self, message=None, max_values=constants.MAX_COMMA_VALUES): <NEW_LINE> <INDENT> if not message: <NEW_LINE> <INDENT> message = u'Invalid syntax: ' <NEW_LINE> <DEDENT> self.message = message <NEW_LINE> self.max_values = max_values <NEW_LINE> <DEDENT> def __call__... | Validator for port string - must be translatable to ExaBgp syntax
Max number of comma separated values must be <= 6 (default) | 62599062d268445f2663a6cc |
@linter(executable=sys.executable, prerequisite_check_command=(sys.executable, '-m', 'mypy', '-V'), output_format='regex', output_regex=r'[^:]+:(?:(?P<line>\d+):)? ' '(?P<severity>error): (?P<message>.*)') <NEW_LINE> class MypyBear: <NEW_LINE> <INDENT> LANGUAGES = {'Python', 'Python 2', 'Python 3'} <NEW_LINE> AUTHORS =... | Type-checks your Python files!
Checks optional static typing using the mypy tool.
See <http://mypy.readthedocs.io/en/latest/basics.html> for info on how to
add static typing. | 625990624e4d562566373ae6 |
class Data(pyffi.object_models.FileFormat.Data): <NEW_LINE> <INDENT> fileinfos = [] <NEW_LINE> def read(self, stream): <NEW_LINE> <INDENT> raise NotImplementedError | Process archives described by mexscript files. | 62599062460517430c432bc3 |
class TestNewTasks(unittest.TestCase): <NEW_LINE> <INDENT> def test_verify_data(self): <NEW_LINE> <INDENT> parser = setup_args() <NEW_LINE> opt = parser.parse_args(print_args=False) <NEW_LINE> changed_task_files = [ fn for fn in testing_utils.git_changed_files() if testing_utils.is_new_task_filename(fn) ] <NEW_LINE> if... | Make sure any changes to tasks pass verify_data test. | 6259906244b2445a339b74d0 |
class UTF8Deserializer(Serializer): <NEW_LINE> <INDENT> def loads(self, stream): <NEW_LINE> <INDENT> length = read_int(stream) <NEW_LINE> return stream.read(length).decode('utf8') <NEW_LINE> <DEDENT> def load_stream(self, stream): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> yield self.l... | Deserializes streams written by String.getBytes. | 625990623cc13d1c6d466e22 |
class NamespacedAngularAppStorage(AppStaticStorage): <NEW_LINE> <INDENT> source_dir = 'app' <NEW_LINE> def __init__(self, app, *args, **kwargs): <NEW_LINE> <INDENT> self.prefix = os.path.join(*(app.split('.'))) <NEW_LINE> super(NamespacedAngularAppStorage, self).__init__(app, *args, **kwargs) | A file system storage backend that takes an app module and works
for the ``app`` directory of it. The app module will be included
in the url for the content. | 62599062baa26c4b54d50982 |
class IPV6Sample(object): <NEW_LINE> <INDENT> def __init__(self, u): <NEW_LINE> <INDENT> self.length = u.unpack_uint() <NEW_LINE> self.protocol = u.unpack_uint() <NEW_LINE> self.src_ip = u.unpack_fstring(16) <NEW_LINE> self.dst_ip = u.unpack_fstring(16) <NEW_LINE> self.src_port = u.unpack_uint() <NEW_LINE> self.dst_por... | IPv6 sample data
| 62599062009cb60464d02c17 |
@admin.register(models.Photo) <NEW_LINE> class PhotoAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ("__str__", "get_thumnail") <NEW_LINE> def get_thumnail(self, obj): <NEW_LINE> <INDENT> return mark_safe(f'<img width="50px"src="{obj.file.url}"/>') <NEW_LINE> <DEDENT> get_thumnail.short_description = "Thumn... | Photo Admin Difinition | 62599062f548e778e596cc68 |
class MessageSender(MessageProcessor): <NEW_LINE> <INDENT> def run(self, job: Job, messages: List[Message]): <NEW_LINE> <INDENT> job.distributor.distribute(job, messages) <NEW_LINE> return [] | 消息 分发处理器 | 62599062379a373c97d9a704 |
class CollinsClient: <NEW_LINE> <INDENT> def __init__(self, username, passwd, host): <NEW_LINE> <INDENT> self.username = username <NEW_LINE> self.passwd = passwd <NEW_LINE> self.host = host <NEW_LINE> <DEDENT> def async_update_asset(self, tag, params={}): <NEW_LINE> <INDENT> url = "/api/asset/%s" % tag <NEW_LINE> retur... | This client will help you interface with Collins in a meaningful way
giving access to all the different apis that Collins allows. | 6259906232920d7e50bc7726 |
class BookInfoAdmin(admin.ModelAdmin): <NEW_LINE> <INDENT> list_display = ['id','btitle','bpub_data'] | 图书模型管理类 | 6259906207f4c71912bb0b17 |
class TestImobiliariaController(BaseTestCase): <NEW_LINE> <INDENT> def test_imobiliaria_get(self): <NEW_LINE> <INDENT> response = self.client.open( '/api/v1.0/imobiliaria', method='GET') <NEW_LINE> self.assert200(response, 'Response body is : ' + response.data.decode('utf-8')) <NEW_LINE> <DEDENT> def test_imobiliaria_i... | ImobiliariaController integration test stubs | 6259906245492302aabfdbbb |
class CeilingMixin: <NEW_LINE> <INDENT> def __init__(self, ceiling: torch.Tensor, *args, **kwargs): <NEW_LINE> <INDENT> self.ceiling = ceiling <NEW_LINE> super().__init__(*args, **kwargs) <NEW_LINE> <DEDENT> def cdf(self, value: torch.Tensor) -> torch.Tensor: <NEW_LINE> <INDENT> ceiling, value = broadcast_all(self.ceil... | Mixin for torch.distribution.Distributions where instead of assuming that events always happen eventually, the
event-probability asymptotes to some probability less than 1.0. | 6259906291f36d47f22319ff |
class FilterExpression(AWSProperty): <NEW_LINE> <INDENT> props: PropsDictType = { "Expression": (str, True), "ValuesMap": ([FilterValue], True), } | `FilterExpression <http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-databrew-dataset-filterexpression.html>`__ | 62599062a17c0f6771d5d715 |
class SearchSpaceGenerator(ast.NodeTransformer): <NEW_LINE> <INDENT> def __init__(self, module_name): <NEW_LINE> <INDENT> self.module_name = module_name <NEW_LINE> self.search_space = {} <NEW_LINE> self.last_line = 0 <NEW_LINE> <DEDENT> def visit_Call(self, node): <NEW_LINE> <INDENT> self.generic_visit(node) <NEW_LINE>... | Generate search space from smart parater APIs | 6259906299cbb53fe68325c3 |
class phi1DTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.prior_seterr = numpy.seterr(divide='raise') <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> numpy.seterr(**self.prior_seterr) <NEW_LINE> <DEDENT> xx = dadi.Numerics.default_grid(20) <NEW_LINE> def test_snm(... | Test routines for generating input phi's.
These tests are primarily motivated by the desire to avoid divide by
zero warnings. | 62599062442bda511e95d8ca |
class PCA(LocalSystem): <NEW_LINE> <INDENT> def __new__(cls, coords): <NEW_LINE> <INDENT> eigen_vectors, eigen_values = eigen(coords) <NEW_LINE> center = np.mean(coords, axis=0) <NEW_LINE> dim = len(center) <NEW_LINE> T = LocalSystem(identity(dim + 1)).view(cls) <NEW_LINE> T[:dim, :dim] = eigen_vectors.T <NEW_LINE> T =... | Principal Component Analysis (PCA).
Parameters
----------
coords : array_like(Number, shape=(n, k))
Represents `n` data points of `k` dimensions. These coordinates are
used to fit a PCA.
Attributes
----------
eigen_values : np.ndarray(Number, shape=(k))
Characteristic Eigenvalues of the PCA.
Notes
-----
... | 62599062462c4b4f79dbd0e7 |
class Computer(Player): <NEW_LINE> <INDENT> def __repr__(self): <NEW_LINE> <INDENT> return 'Computer(%s)' % str(self) <NEW_LINE> <DEDENT> def get_move(self): <NEW_LINE> <INDENT> return random.randint(1, 10) | 计算机抽象类 | 6259906238b623060ffaa3c1 |
class KafkaCompressSink(KafkaSink): <NEW_LINE> <INDENT> def producer_config(self, kafka_config: Dict[str, Any]) -> Dict[str, Any]: <NEW_LINE> <INDENT> config = kafka_config.copy() <NEW_LINE> config.update( { "compression.codec": "gzip", "retry.backoff.ms": 250, "linger.ms": 1000, "batch.num.messages": 50, "delivery.rep... | Variant of KafkaSink for large documents. Used for, eg, GROBID output. | 62599062d6c5a102081e3806 |
class PluginsDao(object): <NEW_LINE> <INDENT> def __init__(self, data_path): <NEW_LINE> <INDENT> self.data_path = data_path <NEW_LINE> self.path = self.data_path / Path('plugins_lv2.json') <NEW_LINE> <DEDENT> def load(self): <NEW_LINE> <INDENT> return Persistence.read(self.path) <NEW_LINE> <DEDENT> def save(self, data)... | Persists and loads Lv2Plugins data | 62599062d268445f2663a6cd |
class Alien(GSprite): <NEW_LINE> <INDENT> def __init__(self,x1,y1,n): <NEW_LINE> <INDENT> super().__init__(width=ALIEN_WIDTH,height=ALIEN_HEIGHT,x=x1,y=y1, source=ALIEN_IMAGES[n],format=(3,2)) <NEW_LINE> <DEDENT> def collides(self, bolt): <NEW_LINE> <INDENT> collide = False <NEW_LINE> if bolt.isPlayerBolt(): <NEW_LINE>... | A class to represent a single alien.
At the very least, you want a __init__ method to initialize the alien dimensions.
These dimensions are all specified in consts.py.
You also MIGHT want to add code to detect a collision with a bolt. We do not require
this. You could put this method in Wave if you wanted to. But t... | 62599062be8e80087fbc0768 |
class Writer(Collab): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> Collab.__init__(self, 'ace_text-input') <NEW_LINE> self.__word_to_type = "type_something" <NEW_LINE> <DEDENT> def run(self): <NEW_LINE> <INDENT> print("=== Writer is starting ===") <NEW_LINE> self.alive = True <NEW_LINE> while self.alive:... | docstring for Writer | 62599062f7d966606f74942a |
class Physics(mujoco.Physics): <NEW_LINE> <INDENT> def upright(self): <NEW_LINE> <INDENT> return self.named.data.xmat['torso', 'zz'] <NEW_LINE> <DEDENT> def torso_velocity(self): <NEW_LINE> <INDENT> return self.data.sensordata <NEW_LINE> <DEDENT> def joint_velocities(self): <NEW_LINE> <INDENT> return self.named.data.qv... | Physics simulation with additional features for the Fish domain. | 625990629c8ee82313040cfa |
class TransportError(Exception): <NEW_LINE> <INDENT> pass | Exception class for Transport errors | 625990628a43f66fc4bf3871 |
class ROSWorld(AbstractWorld): <NEW_LINE> <INDENT> def __init__(self, subscriptions, publications): <NEW_LINE> <INDENT> super(ROSWorld, self).__init__() <NEW_LINE> rospy.init_node(name='rlpy', anonymous=True, disable_signals=True) <NEW_LINE> self.proxy = ROSProxy(subscriptions, publications) <NEW_LINE> self.thread = th... | Bridge between ROS (Robot OS) and this framework.
This world subscribes to ROS topics and use them to produce states.
When actions are performed, they are transformed to publishings in the
ROS network. | 6259906267a9b606de547613 |
class log_with(object): <NEW_LINE> <INDENT> ENTRY_MESSAGE = 'Entering {}' <NEW_LINE> EXIT_MESSAGE = 'Exiting {}' <NEW_LINE> def __init__(self, logger=None): <NEW_LINE> <INDENT> self.logger = logger <NEW_LINE> <DEDENT> def __call__(self, func): <NEW_LINE> <INDENT> if not self.logger: <NEW_LINE> <INDENT> logging.basicCon... | Logging decorator that allows you to log with a
specific logger. | 6259906245492302aabfdbbd |
class Vector(object): <NEW_LINE> <INDENT> def __init__(self,x=0.0,y=0.0,z=0.0): <NEW_LINE> <INDENT> self.coords=[x,y,z] <NEW_LINE> self.x=x <NEW_LINE> self.y=y <NEW_LINE> self.z=z <NEW_LINE> <DEDENT> def length(self): <NEW_LINE> <INDENT> dr = 0.0 <NEW_LINE> for x in self.coords: <NEW_LINE> <INDENT> dr = dr + x**2 <NEW_... | classdocs | 6259906229b78933be26ac35 |
class CheckDep(Command): <NEW_LINE> <INDENT> description = "Checks that the required dependencies are installed on the system" <NEW_LINE> user_options = [] <NEW_LINE> def initialize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def finalize_options(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def r... | Command to check that the required dependencies are installed on the system | 6259906232920d7e50bc7729 |
class ImageSelectionCreateView(CreateView): <NEW_LINE> <INDENT> model = ImageSelection <NEW_LINE> form_class = ImageSelectionCreateForm <NEW_LINE> template_name = 'lumina/base_create_update_form.html' <NEW_LINE> def get_initial(self): <NEW_LINE> <INDENT> initial = super(ImageSelectionCreateView, self).get_initial() <NE... | With this view, the photographer creates a request
to the customer. | 625990623539df3088ecd980 |
class UserProfile(FacebookProfile): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> proxy = True <NEW_LINE> <DEDENT> def get_avatar(self): <NEW_LINE> <INDENT> return get_thumbnail('http://graph.facebook.com/%s/picture' % self.facebook_id, '50') | User Profile Wrapper. TODO: migrate to social_auth. | 6259906292d797404e3896cf |
class Mimetype(CustomRule): <NEW_LINE> <INDENT> priority = POST_PROCESS <NEW_LINE> dependency = Processors <NEW_LINE> def when(self, matches, context): <NEW_LINE> <INDENT> mime, _ = mimetypes.guess_type(matches.input_string, strict=False) <NEW_LINE> return mime <NEW_LINE> <DEDENT> def then(self, matches, when_response,... | Mimetype post processor
:param matches:
:type matches:
:return:
:rtype: | 625990620c0af96317c578d0 |
class MultiInputPolicy(DQNPolicy): <NEW_LINE> <INDENT> def __init__( self, observation_space: gym.spaces.Dict, action_space: gym.spaces.Space, lr_schedule: Schedule, net_arch: Optional[List[int]] = None, activation_fn: Type[nn.Module] = nn.ReLU, features_extractor_class: Type[BaseFeaturesExtractor] = CombinedExtractor,... | Policy class for DQN when using dict observations as input.
:param observation_space: Observation space
:param action_space: Action space
:param lr_schedule: Learning rate schedule (could be constant)
:param net_arch: The specification of the policy and value networks.
:param activation_fn: Activation function
:param ... | 625990628e71fb1e983bd1ae |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.