code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class Page: <NEW_LINE> <INDENT> EXPLICIT_WAIT_TIME = 10 <NEW_LINE> def __init__(self, driver): <NEW_LINE> <INDENT> self._driver = driver <NEW_LINE> self._driver.set_explicit_wait_time(self.EXPLICIT_WAIT_TIME) | This class contains the basic actions for all the pages. | 62598f1497e22403b3839b59 |
class GraphIndependent(_base.AbstractModule): <NEW_LINE> <INDENT> def __init__(self, edge_model_fn=None, node_model_fn=None, global_model_fn=None, name="graph_independent"): <NEW_LINE> <INDENT> super(GraphIndependent, self).__init__(name=name) <NEW_LINE> with self._enter_variable_scope(): <NEW_LINE> <INDENT> if edge_mo... | A graph block that applies models to the graph elements independently.
The inputs and outputs are graphs. The corresponding models are applied to
each element of the graph (edges, nodes and globals) in parallel and
independently of the other elements. It can be used to encode or
decode the elements of a graph. | 62598f143617ad0b5ee04da5 |
class BusquedaView(View): <NEW_LINE> <INDENT> template_name = 'busqueda.html' <NEW_LINE> def get(self, request, *args, **kwargs): <NEW_LINE> <INDENT> busqueda = request.GET.get('busqueda', '') <NEW_LINE> if busqueda == '': <NEW_LINE> <INDENT> pacientes = Paciente.objects.all() <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDE... | Clase Vista que permite consultar pacientes.
template_name: Nombre de la plantilla. | 62598f1431939e2706ed109d |
class AuthorHyperlinkedViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = Author.objects.all() <NEW_LINE> serializer_class = AuthorHyperlinkedSerializer | This viewset automatically provides `list` and `detail` actions. | 62598f14d8ef3951e32c7490 |
class CanvasServer: <NEW_LINE> <INDENT> def __init__(self, file: Optional[str], host: str, port: int): <NEW_LINE> <INDENT> self._canvases: Dict[str, Canvas] = {} <NEW_LINE> file_handler = None <NEW_LINE> if file is None: <NEW_LINE> <INDENT> file_handler = absolute_file_handler( ospath.abspath(ospath.dirname(__file__)),... | A local HTTP server using WebSockets to transmit data. | 62598f14a219f33f346c54a2 |
class OperationLog(models.Model): <NEW_LINE> <INDENT> HTTP_METHODS = ( (0, 'GET'), (1, 'POST'), (2, 'PUT'), (3, 'PATCH'), (4, 'DELETE'), (5, 'HEAD'), (6, 'OPTIONS'), (7, 'TRACE'), ) <NEW_LINE> HTTP_METHODS_DICT = {method_name: method_val for method_val, method_name in HTTP_METHODS} <NEW_LINE> class Meta: <NEW_LINE> <IN... | OperationLog holds details about critical operations. | 62598f148a349b6b43684ebd |
@unique <NEW_LINE> class Continent(Enum): <NEW_LINE> <INDENT> AF = 'Africa' <NEW_LINE> NA = 'North America' <NEW_LINE> OC = 'Oceania' <NEW_LINE> AN = 'Antartica' <NEW_LINE> AS = 'Asia' <NEW_LINE> EU = 'Europe' <NEW_LINE> SA = 'South America' | Continent codes.
From `Data hub <https://datahub.io/core/continent-codes#data>`_. | 62598f149f28863672817472 |
class RZlibError(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return self.msg <NEW_LINE> <DEDENT> def fromstream(stream, err, while_doing): <NEW_LINE> <INDENT> if stream.c_msg: <NEW_LINE> <INDENT> reason = rffi.cha... | Exception raised by failing operations in rpython.rlib.rzlib. | 62598f15656771135c488305 |
class Message(object): <NEW_LINE> <INDENT> key = None <NEW_LINE> sequence = 0 <NEW_LINE> body = None <NEW_LINE> def __init__(self, sequence, key=None, body=None): <NEW_LINE> <INDENT> assert isinstance(sequence, int) <NEW_LINE> self.sequence = sequence <NEW_LINE> self.key = key <NEW_LINE> self.body = body <NEW_LINE> <DE... | Message is formatted on wire as 3 frames:
frame 0: key (0MQ string)
frame 1: sequence (8 bytes, network order)
frame 2: body (blob) | 62598f159f28863672817474 |
class WSGIServer(object): <NEW_LINE> <INDENT> def __init__(self, port, app, static_path): <NEW_LINE> <INDENT> self.application = app <NEW_LINE> self.static_path = static_path <NEW_LINE> self.tcp_server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) <NEW_LINE> self.tcp_server_socket.setsockopt(socket.SOL_SOC... | WSGI服务器类 | 62598f15d8ef3951e32c7492 |
class ServiceLocator(object): <NEW_LINE> <INDENT> def __init__(self, services=None): <NEW_LINE> <INDENT> self.__services = services if services else {} <NEW_LINE> <DEDENT> def get_service(self, name): <NEW_LINE> <INDENT> return self.__services.get(name) <NEW_LINE> <DEDENT> def get_availables_services(self): <NEW_LINE> ... | Hold the services and allows the interaction between NINJA-IDE and plugins | 62598f15ad47b63b2c5a648b |
class DoubleSubclass(Subclass): <NEW_LINE> <INDENT> with namespace() as namespace_: <NEW_LINE> <INDENT> barter = 1 | A throwaway test class, for testing advanced shadowing. | 62598f1560cbc95b06362fae |
class ThrowerAnt(Ant): <NEW_LINE> <INDENT> name = 'Thrower' <NEW_LINE> implemented = True <NEW_LINE> food_cost=4 <NEW_LINE> damage = 1 <NEW_LINE> min_range=0 <NEW_LINE> max_range=10 <NEW_LINE> def nearest_bee(self, hive): <NEW_LINE> <INDENT> p=self.place <NEW_LINE> currpos=0 <NEW_LINE> while p!= hive: <NEW_LINE> <INDEN... | ThrowerAnt throws a leaf each turn at the nearest Bee in its range. | 62598f15ad47b63b2c5a648c |
class TestReviewGraphWithASampleGraph(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> self.graph = ReviewGraph(0.1) <NEW_LINE> self.reviewers = [ self.graph.new_reviewer("reviewer-{0}".format(i)) for i in range(2) ] <NEW_LINE> self.products = [ self.graph.new_product("product-{0}".format(i)... | Test case for retriving methods and update method in ReviewGraph.
This class sets up a small sample graph and uses it to all tests. | 62598f15ad47b63b2c5a648d |
class CacheAnonymousOnly(object): <NEW_LINE> <INDENT> def process_response(self, request, response): <NEW_LINE> <INDENT> if hasattr(request, 'user') and request.user.is_authenticated(): <NEW_LINE> <INDENT> add_never_cache_headers(response) <NEW_LINE> <DEDENT> return response | Imitate the deprecated `CACHE_MIDDLEWARE_ANONYMOUS_ONLY` behavior. | 62598f15ab23a570cc2d43ab |
class Undirected_graph: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.graph = {} <NEW_LINE> <DEDENT> def add_node(self, node): <NEW_LINE> <INDENT> if node not in self.graph: <NEW_LINE> <INDENT> self.graph[node] = {} <NEW_LINE> <DEDENT> <DEDENT> def add_edge(self, first_node, second_node, weight): <NE... | Class for the directed graph data structure | 62598f1550812a4eaa62022b |
class ConfigurationException(Exception): <NEW_LINE> <INDENT> pass | Thrown when not enough configuration is passed to a Transport | 62598f15656771135c488309 |
class MetOfficeCurrentSensor(CoordinatorEntity, SensorEntity): <NEW_LINE> <INDENT> def __init__( self, coordinator, hass_data, use_3hourly, description: SensorEntityDescription, ): <NEW_LINE> <INDENT> super().__init__(coordinator) <NEW_LINE> self.entity_description = description <NEW_LINE> mode_label = MODE_3HOURLY_LAB... | Implementation of a Met Office current weather condition sensor. | 62598f15187af65679d29244 |
class ColorMap(ACMEClass): <NEW_LINE> <INDENT> def __init__(self, cdata='parula', cres=64, caxis=None, name='ColorMap', device='cuda:0'): <NEW_LINE> <INDENT> super(ColorMap, self).__init__() <NEW_LINE> if isstring(cdata): <NEW_LINE> <INDENT> self.cdata = palette(cdata, device=device) <NEW_LINE> <DEDENT> else: <NEW_LINE... | A class representing a color map
Attributes
----------
cdata : Tensor
the color data
name : str
the name of the color map
device : str or torch.device
the device to store the tensors to
Methods
-------
fetch(tensor, cres, casix)
returns the colors for the given input data
real_map()
returns the re... | 62598f1597e22403b3839b61 |
class CombinedToken(RuleToken): <NEW_LINE> <INDENT> def __init__(self, original_tokens: List[Token], value: Decimal, glue: str): <NEW_LINE> <INDENT> super().__init__(original_tokens) <NEW_LINE> self._value = value <NEW_LINE> self.glue = glue <NEW_LINE> self.type = WordType.REPLACED <NEW_LINE> <DEDENT> def __repr__(self... | Special token type which is used by the CombinationRule. | 62598f15283ffb24f3cf2525 |
class DSNNConvOnlyHeb(BaseModel): <NEW_LINE> <INDENT> log_attrs = [ "pruning_iterations", "kept_frac", "prune_mask_sparsity", "keep_mask_sparsity", "weight_sparsity", "last_coactivations", ] <NEW_LINE> def is_sparse(self, module): <NEW_LINE> <INDENT> if isinstance(module, DSConv2d): <NEW_LINE> <INDENT> return "sparse_c... | Similar to other sparse models, but the focus here is on convolutional layers as
opposed to dense layers. | 62598f1550812a4eaa62022c |
class AbslNodeHashSetPrinter(AbslHashSetPrinterBase): <NEW_LINE> <INDENT> def __init__(self, val): <NEW_LINE> <INDENT> AbslHashSetPrinterBase.__init__(self, val, "node") <NEW_LINE> <DEDENT> def children(self): <NEW_LINE> <INDENT> count = 0 <NEW_LINE> for val in absl_get_nodes(self.val): <NEW_LINE> <INDENT> yield (str(c... | Pretty-printer for absl::node_hash_set<>. | 62598f15ec188e330fdf7537 |
class CreateProjectForm(forms.ModelForm, BootstrapBaseForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = SocialProject <NEW_LINE> fields = ('name', 'description', 'creator', 'location', ) <NEW_LINE> widgets = { 'name': forms.TextInput(attrs={'class': 'form-control'}), 'description': forms.Textarea( attr... | Creation of new projects, part of the data is autocompleted. | 62598f15377c676e912f63a6 |
class DirectServeHtmlResource(_AsyncResource): <NEW_LINE> <INDENT> ERROR_TEMPLATE = HTML_ERROR_TEMPLATE <NEW_LINE> def _send_response( self, request: SynapseRequest, code: int, response_object: Any, ) -> None: <NEW_LINE> <INDENT> assert isinstance(response_object, bytes) <NEW_LINE> html_bytes = response_object <NEW_LIN... | A resource that will call `self._async_on_<METHOD>` on new requests,
formatting responses and errors as HTML. | 62598f153617ad0b5ee04daf |
class InvalidCommandLineError(RdmcError): <NEW_LINE> <INDENT> pass | Raised when user enter incorrect command line arguments | 62598f15956e5f7376df4cbd |
class JumpRange(commands.Cog): <NEW_LINE> <INDENT> @commands.command() <NEW_LINE> @checks.spam_check() <NEW_LINE> @checks.is_whitelist() <NEW_LINE> async def range(self, ctx, system, ship: str.title, jdc_level: int = 5): <NEW_LINE> <INDENT> async with ctx.typing(): <NEW_LINE> <INDENT> log.info(f'JumpRange - {ctx.messag... | This extension handles the time commands. | 62598f15d8ef3951e32c7495 |
class TestCumsum(unittest.TestCase): <NEW_LINE> <INDENT> def test_cumsum(self): <NEW_LINE> <INDENT> case = [5, 8, 3, 3, 7] <NEW_LINE> expected = [5, 13, 16, 19, 26] <NEW_LINE> result = list(utils.cumsum(case)) <NEW_LINE> self.assertEqual(result, expected) <NEW_LINE> <DEDENT> def test_no_items(self): <NEW_LINE> <INDENT>... | Tests for cumsum() | 62598f15187af65679d29246 |
class ControlServiceLocatorTests(SynchronousTestCase): <NEW_LINE> <INDENT> @validate_logging(None) <NEW_LINE> def test_logger(self, logger): <NEW_LINE> <INDENT> fake_control_amp_service = build_control_amp_service(self) <NEW_LINE> self.patch(fake_control_amp_service, 'logger', logger) <NEW_LINE> locator = ControlServic... | Tests for ``ControlServiceLocator``. | 62598f15fbf16365ca792d22 |
class UC(BitBang, I2C, OneWire, RawWire, SPI, UART): <NEW_LINE> <INDENT> pass | This class brings together all of the modules under a single class, allowing you to switch
to other modules, do a function, and then switch back transparently. The class will keep track
of where you are and raise an Error if you do something wrong.
The variables bp_port, bp_dir, and bp_config store the values that it... | 62598f159f2886367281747b |
class ChoiceEnum(IntEnum, metaclass=ChoiceEnumMetaClass): <NEW_LINE> <INDENT> def __new__(cls, label): <NEW_LINE> <INDENT> value = len(cls.__members__) + 1 <NEW_LINE> obj = int.__new__(cls) <NEW_LINE> obj._value_ = value <NEW_LINE> obj._label_ = label <NEW_LINE> return obj <NEW_LINE> <DEDENT> @DynamicClassAttribute <NE... | This class implements integer enumerants with labels.
>>> class Color(ChoiceEnum):
red = ('red colour')
green = ('green colour')
blue = ('blue colour')
>>> Color.red.name
'red'
>>> Color.red.value
1
>>> Color.red.label
'red colour'
>>> Color.to_list()
[(1, 'red colour'), (2, 'green colour'), (... | 62598f158a349b6b43684ec7 |
class LazyStream(six.Iterator): <NEW_LINE> <INDENT> def __init__(self, producer, length=None): <NEW_LINE> <INDENT> self._producer = producer <NEW_LINE> self._empty = False <NEW_LINE> self._leftover = b'' <NEW_LINE> self.length = length <NEW_LINE> self.position = 0 <NEW_LINE> self._remaining = length <NEW_LINE> self._un... | The LazyStream wrapper allows one to get and "unget" bytes from a stream.
Given a producer object (an iterator that yields bytestrings), the
LazyStream object will support iteration, reading, and keeping a "look-back"
variable in case you need to "unget" some bytes. | 62598f153617ad0b5ee04db1 |
class ParameterName(tuple): <NEW_LINE> <INDENT> def __str__(self): <NEW_LINE> <INDENT> return '/'.join(self) <NEW_LINE> <DEDENT> def get_attr_name(self): <NEW_LINE> <INDENT> return '_'.join(name.replace('.', '_').lower() for name in self) <NEW_LINE> <DEDENT> def get_flag_str(self): <NEW_LINE> <INDENT> return '--%s' % s... | Represent the fully-qualified name of a parameter. | 62598f1560cbc95b06362fb4 |
class DoctorContactAvailabilityExceptionSerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = DoctorContactAvailabilityException <NEW_LINE> fields = ('id', 'doctor_contact', 'date',) | Doctor Contact Availability Exception serializer | 62598f159f2886367281747c |
class AptSigningRepositoriesAttributes(object): <NEW_LINE> <INDENT> openapi_types = { 'keypair': 'str', 'passphrase': 'str' } <NEW_LINE> attribute_map = { 'keypair': 'keypair', 'passphrase': 'passphrase' } <NEW_LINE> def __init__(self, keypair=None, passphrase=None, local_vars_configuration=None): <NEW_LINE> <INDENT> i... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f15ab23a570cc2d43ae |
class BaseV2ComputeAdminTest(BaseV2ComputeTest): <NEW_LINE> <INDENT> credentials = ['primary', 'admin'] <NEW_LINE> @classmethod <NEW_LINE> def setup_clients(cls): <NEW_LINE> <INDENT> super(BaseV2ComputeAdminTest, cls).setup_clients() <NEW_LINE> cls.availability_zone_admin_client = ( cls.os_admin.availability_zone_clien... | Base test case class for Compute Admin API tests. | 62598f15187af65679d29247 |
class ZooError(namedtuple('ZooError', ('when', 'exception', 'allow'))): <NEW_LINE> <INDENT> pass | A Zookeeper Error to throw instead of or in addition to executing the
Zookeeper command
Since the :class:`KazooClient` implements most of the zookeeper commands
using the async calls, the exception could occur during the call itself
(which is rare), or on the completion.
.. attribute:: when
When the exception sh... | 62598f15a219f33f346c54ae |
class SyntheticSDFAsSource(beam.DoFn): <NEW_LINE> <INDENT> def process( self, element, restriction_tracker=beam.DoFn.RestrictionParam( SyntheticSDFSourceRestrictionProvider())): <NEW_LINE> <INDENT> cur = restriction_tracker.current_restriction().start <NEW_LINE> while restriction_tracker.try_claim(cur): <NEW_LINE> <IND... | A SDF that generates records like a source.
This SDF accepts a PCollection of record-based source description.
A typical description is like:
{
'key_size': 1,
'value_size': 1,
'initial_splitting_num_bundles': 8,
'initial_splitting_desired_bundle_size': 2,
'sleep_per_input_record_sec': 0,
'in... | 62598f157cff6e4e811b4670 |
class Subject: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._observers = set() <NEW_LINE> self._subject_state = None <NEW_LINE> <DEDENT> def attach(self, observer): <NEW_LINE> <INDENT> observer._subject = self <NEW_LINE> self._observers.add(observer) <NEW_LINE> <DEDENT> def detach(self, observer): <... | Know its observers. Any number of Observer objects may observe a subject.
Send a notification to its observers when its state changes. | 62598f1526238365f5fab80f |
class Config(dict): <NEW_LINE> <INDENT> CONFIG_FILE_NAME = '.juju-persistent-config' <NEW_LINE> def __init__(self, *args, **kw): <NEW_LINE> <INDENT> super(Config, self).__init__(*args, **kw) <NEW_LINE> self.implicit_save = True <NEW_LINE> self._prev_dict = None <NEW_LINE> self.path = os.path.join(charm_dir(), Config.CO... | A dictionary representation of the charm's config.yaml, with some
extra features:
- See which values in the dictionary have changed since the previous hook.
- For values that have changed, see what the previous value was.
- Store arbitrary data for use in a later hook.
NOTE: Do not instantiate this object directly - ... | 62598f1531939e2706ed10a4 |
class listOperations(object): <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def checkList(self, givenList): <NEW_LINE> <INDENT> if not isinstance(givenList, list): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> for i in givenList: <NEW_LINE> <INDENT> if i not in range(10): <NEW_LINE> <INDENT> return False <NEW_LIN... | contains the necessary operations to interpret and convert the input list in a matrix for the later animation | 62598f15bf627c535bcb00fd |
class DeleteReadOnlyGroupRequest(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.ReadOnlyGroupId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> self.ReadOnlyGroupId = params.get("ReadOnlyGroupId") <NEW_LINE> memeber_set = set(params.keys()) <NEW_LINE> for... | DeleteReadOnlyGroup请求参数结构体
| 62598f15187af65679d29248 |
class PointcloudProcess: <NEW_LINE> <INDENT> def __init__(self, points_sub_topic, image_sub_topic, cam_info_topic, points_pub_topic): <NEW_LINE> <INDENT> self.num_steps = 0 <NEW_LINE> self.messages = deque([], 5) <NEW_LINE> self.pointcloud_frame = None <NEW_LINE> points_sub = message_filters.Subscriber(points_sub_topic... | Wraps the processing of a pointcloud from an input ros topic and publishing
to another PointCloud2 topic. | 62598f159f2886367281747f |
class TestBasicPathLike(unittest.TestCase): <NEW_LINE> <INDENT> def test_DMatrix_init_from_path(self): <NEW_LINE> <INDENT> dpath = Path('demo/data') <NEW_LINE> dtrain = xgb.DMatrix(dpath / 'agaricus.txt.train') <NEW_LINE> assert dtrain.num_row() == 6513 <NEW_LINE> assert dtrain.num_col() == 127 <NEW_LINE> <DEDENT> def ... | Unit tests using pathlib.Path for file interaction. | 62598f158a349b6b43684ecb |
class Dice: <NEW_LINE> <INDENT> def loss(self, y_true, y_pred): <NEW_LINE> <INDENT> ndims = len(y_pred.get_shape().as_list()) - 2 <NEW_LINE> vol_axes = list(range(1, ndims+1)) <NEW_LINE> top = 2 * tf.reduce_sum(y_true * y_pred, vol_axes) <NEW_LINE> bottom = tf.reduce_sum(y_true + y_pred, vol_axes) <NEW_LINE> dice = tf.... | N-D dice for segmentation | 62598f153617ad0b5ee04db5 |
class Dog(ndb.Model): <NEW_LINE> <INDENT> name = ndb.StringProperty() <NEW_LINE> processed = ndb.BooleanProperty(default=False) | Another sample class | 62598f15ad47b63b2c5a6496 |
class FilterOtuAgent(Agent): <NEW_LINE> <INDENT> def __init__(self, parent): <NEW_LINE> <INDENT> super(FilterOtuAgent, self).__init__(parent) <NEW_LINE> options = [ {"name": "in_otu_table", "type": "infile", "format": "meta.otu.otu_table"}, {"name": "filter_json", "type": "string", "default": ""}, {"name": "out_otu_tab... | 根据传入的json,对一张OTU表进行过滤,过滤的条件有三种:
species_filter: 物种过滤,用于保留或者滤去特定的物种
sample_filter: 用于滤去在x个样本中序列数小于y的OTU
reads_filter: 用于滤去序列数小于x的OTU | 62598f15ab23a570cc2d43b0 |
class ServerDetail(generics.RetrieveUpdateDestroyAPIView): <NEW_LINE> <INDENT> model = Server <NEW_LINE> serializer_class = ServerSerializer <NEW_LINE> renderer_classes = [ServerProfileRenderer, BrowsableAPIRenderer] | **Media type:** [`application/json;
profile="http://confine-project.eu/schema/registry/v1/server"`](
http://wiki.confine-project.eu/arch:rest-api#server_at_registry)
This resource describes the testbed server (controller). | 62598f1555399d3f056251ad |
class ApplicationGatewayRewriteRuleActionSet(msrest.serialization.Model): <NEW_LINE> <INDENT> _attribute_map = { 'request_header_configurations': {'key': 'requestHeaderConfigurations', 'type': '[ApplicationGatewayHeaderConfiguration]'}, 'response_header_configurations': {'key': 'responseHeaderConfigurations', 'type': '... | Set of actions in the Rewrite Rule in Application Gateway.
:param request_header_configurations: Request Header Actions in the Action Set.
:type request_header_configurations:
list[~azure.mgmt.network.v2020_05_01.models.ApplicationGatewayHeaderConfiguration]
:param response_header_configurations: Response Header Acti... | 62598f1597e22403b3839b6b |
class ConveyorBeltEnvironment(safety_game.SafetyEnvironment): <NEW_LINE> <INDENT> def __init__(self, variant='vase', noops=False): <NEW_LINE> <INDENT> value_mapping = { WALL_CHR: 0.0, ' ': 1.0, AGENT_CHR: 2.0, OBJECT_CHR: 3.0, END_CHR: 4.0, BELT_CHR: 5.0, GOAL_CHR: 6.0, } <NEW_LINE> if noops: <NEW_LINE> <INDENT> action... | Python environment for the conveyor belt environment. | 62598f158a349b6b43684ecd |
class RedisPubsubMixin(object): <NEW_LINE> <INDENT> def listen(self, event, callback=None): <NEW_LINE> <INDENT> if callback is None: <NEW_LINE> <INDENT> callback = 'on-' + self.event <NEW_LINE> <DEDENT> if type(callback) in types.StringTypes: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> callback = self.__getattribute__... | this module defines some event passing for redis-based datatypes with pubsub
..
class Song(RedisHash, RedisPubsubMixin):
def on_change(self):
pass
def listen_all(self):
channels = ['change']
return [self.listen(cnl) for cnl in channels]
| 62598f153617ad0b5ee04db7 |
class DataHandler(webapp2.RequestHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> self.Handle(self.DoGet) <NEW_LINE> <DEDENT> def post(self): <NEW_LINE> <INDENT> self.Handle(self.DoPost) <NEW_LINE> <DEDENT> def DoGet(self): <NEW_LINE> <INDENT> raise NotImplementedError() <NEW_LINE> <DEDENT> def DoPost(s... | A servlet base class for responding to data queries.
We use this base class to wrap our web request handlers with try/except
blocks and set per-thread values (e.g. URL_FETCH_TIMEOUT). | 62598f15bf627c535bcb0101 |
class FilesystemError(HalogenError): <NEW_LINE> <INDENT> pass | An error that occurred while mucking about with the filesystem | 62598f15a219f33f346c54b5 |
class NotConverged(Exception): <NEW_LINE> <INDENT> pass | An exception raised when the perceptron training isn't converging. | 62598f15fbf16365ca792d2a |
class Solution(object): <NEW_LINE> <INDENT> def maxProfit(self, prices): <NEW_LINE> <INDENT> if not prices: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> max_profit = 0 <NEW_LINE> min_buy = prices[0] <NEW_LINE> for price in prices: <NEW_LINE> <INDENT> min_buy = min(price, min_buy) <NEW_LINE> max_profit = max(price -... | Same as "max subarray problem" using Kadane's Algorithm.
Just need one scan through the array values,
computing at each position the max profit ending at that position.
https://en.wikipedia.org/wiki/Maximum_subarray_problem | 62598f15ec188e330fdf7541 |
class StructureView(LoginRequiredMixin, View): <NEW_LINE> <INDENT> def get(self, request): <NEW_LINE> <INDENT> ret = Menu.getMenuByRequestUrl(url=request.path_info) <NEW_LINE> ret.update(SystemSetup.getSystemSetupLastData()) <NEW_LINE> return render(request, 'system/structure/structure-list.html', ret) | 组织架构管理 | 62598f159f28863672817483 |
@view_config( context=ApplicationsModule, wrapper=ptah.wrap_layout(), renderer='ptah.manage:templates/apps.pt') <NEW_LINE> class ApplicationsModuleView(ptah.View): <NEW_LINE> <INDENT> def update(self): <NEW_LINE> <INDENT> factories = [] <NEW_LINE> for factory in cms.get_app_factories().values(): <NEW_LINE> <INDENT> fac... | Applications module default view | 62598f1531939e2706ed10a7 |
class Tree(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.root = None <NEW_LINE> <DEDENT> def add(self, item): <NEW_LINE> <INDENT> node = Node(item) <NEW_LINE> queue = list() <NEW_LINE> queue.append(self.root) <NEW_LINE> if self.root is None: <NEW_LINE> <INDENT> self.root = node <NEW_LINE> re... | 二叉树 | 62598f15ad47b63b2c5a649b |
class ICHeadBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, num_classes): <NEW_LINE> <INDENT> super(ICHeadBlock, self).__init__() <NEW_LINE> self.cff_12 = CFFBlock( in_channels_low=128, in_channels_high=64, out_channels=128, num_classes=num_classes) <NEW_LINE> self.cff_24 = CFFBlock( in_channels_low=256, in_ch... | ICNet head block.
Parameters:
----------
num_classes : int
Number of classification classes. | 62598f1597e22403b3839b6f |
class TestChange(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 testChange(self): <NEW_LINE> <INDENT> pass | Change unit test stubs | 62598f15283ffb24f3cf2533 |
class CustomReport(Report): <NEW_LINE> <INDENT> def execute(self, collector): <NEW_LINE> <INDENT> template = self.config.get( 'format', '{filename}:{line}:{character}:{tool}:{code}:{message}', ) <NEW_LINE> try: <NEW_LINE> <INDENT> template.format( filename='', full_filename='', line=1, character=1, code='', tool='', me... | Prints output to the console according to a user-defined template. | 62598f15d8ef3951e32c749b |
class GenerateWarcStatsIndirect(luigi.contrib.hadoop.JobTask): <NEW_LINE> <INDENT> input_file = luigi.Parameter() <NEW_LINE> def output(self): <NEW_LINE> <INDENT> out_name = "%s-stats.tsv" % os.path.splitext(self.input_file)[0] <NEW_LINE> return luigi.contrib.hdfs.HdfsTarget(out_name, format=luigi.contrib.hdfs.PlainDir... | Generates the WARC stats by reading each file in turn. Data is therefore no-local.
Parameters:
input_file: The file (on HDFS) that contains the list of WARC files to process | 62598f1560cbc95b06362fbf |
class MastiffPlugin(IPlugin): <NEW_LINE> <INDENT> def __init__(self, name=None): <NEW_LINE> <INDENT> IPlugin.__init__(self) <NEW_LINE> self.name = name <NEW_LINE> self.prereq = None <NEW_LINE> self.yara_filetype = None <NEW_LINE> self.page_data = output.page() <NEW_LINE> self.page_data.meta['filename'] = 'CHANGEME' <NE... | The base plugin class every category class should inherit. | 62598f15bf627c535bcb0105 |
class Gxz(Potential): <NEW_LINE> <INDENT> def __init__(self, x, y, z, data, weights=1., meshtype='prism'): <NEW_LINE> <INDENT> Potential.__init__(self, x, y, z, data, weights, meshtype) <NEW_LINE> self.effectfunc = self.engine.gxz | A container for data of the xz (north-vertical) component of the gravity
gradient tensor.
Coordinate system used: x->North y->East z->Down
Parameters:
* x, y, z : 1D arrays
Arrays with the x, y, z coordinates of the data points
* data : 1D array
The values of the data at the observation points
* weight : f... | 62598f15656771135c488319 |
class FeedbackPoint(ConductorParameter): <NEW_LINE> <INDENT> locks = {} <NEW_LINE> priority = 18 <NEW_LINE> autostart = False <NEW_LINE> value_type = 'list' <NEW_LINE> def initialize(self, config): <NEW_LINE> <INDENT> super(FeedbackPoint, self).initialize(config) <NEW_LINE> self.connect_to_labrad() <NEW_LINE> for name,... | example_config = {
'locks': {
'+9/2': {
'type': 'PID',
'prop_gain': 1,
...
},
'-9/2': {
'type': 'PID',
'prop_gain': 1,
...
},
},
} | 62598f15091ae35668703897 |
class test_Axis(ut.TestCase): <NEW_LINE> <INDENT> def test_label(self): <NEW_LINE> <INDENT> a = Axis('x') <NEW_LINE> l = a._label <NEW_LINE> self.assertRaises(ValueError, l.set, not_an_attribute="label") <NEW_LINE> l.set(s=r"\Gamma") <NEW_LINE> self.assertEqual(r"\Gamma", l.label) <NEW_LINE> <DEDENT> def test_ticklabel... | test Axix functionality | 62598f15377c676e912f63ad |
class prim: <NEW_LINE> <INDENT> def __init__(self,name,f,**kwargs): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.fn = f <NEW_LINE> self.extended = kwargs['extended'] if 'extended' in kwargs else False <NEW_LINE> if 'exact' in kwargs: <NEW_LINE> <INDENT> self.minargs = kwargs['exact'] <NEW_LINE> self.maxargs = k... | each 'primitive' is an instance of this class, or its active subclass
mathprim | 62598f15283ffb24f3cf2535 |
class SettingBackend(object): <NEW_LINE> <INDENT> def authenticate(self, username=None, password=None): <NEW_LINE> <INDENT> pdb = pwchk.CheckUser() <NEW_LINE> if pdb.login_check(username, password): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> user = User.objects.get(username=username) <NEW_LINE> <DEDENT> except User.D... | customized AUTHENTICATION_BACKENDS class object
used in ocatsite/settings.py | 62598f15656771135c48831b |
class BootstrapAggregatingClassification(BootstrapAggregating, ClassificationModel): <NEW_LINE> <INDENT> def __init__(self, base_model, number_of_models, sample_size_function=None, number_of_processes=mp.cpu_count(), seed_range=1000000): <NEW_LINE> <INDENT> if not isinstance(base_model, ClassificationModel): <NEW_LINE>... | A bootstrap aggregating classification meta model. | 62598f15187af65679d2924d |
class Contact(models.Model): <NEW_LINE> <INDENT> contact_name = models.CharField(max_length=50) <NEW_LINE> contact_email = models.CharField(max_length=50) <NEW_LINE> message_title = models.CharField(max_length=50) <NEW_LINE> message_context = RichTextField() <NEW_LINE> timestamp = models.DateField() <NEW_LINE> def __un... | Model class for authors | 62598f153617ad0b5ee04dbf |
class WaptEvent(object): <NEW_LINE> <INDENT> DEFAULT_TTL = 20 * 60 <NEW_LINE> def __init__(self,topic,subject,data=None,runstatus = ''): <NEW_LINE> <INDENT> self.topic = topic <NEW_LINE> self.subject = subject <NEW_LINE> self.data = copy.deepcopy(data) <NEW_LINE> self.runstatus = runstatus <NEW_LINE> self.id = None <NE... | Store single event with list of subscribers | 62598f158a349b6b43684ed5 |
class SumVisitor(object): <NEW_LINE> <INDENT> def __init__(self, field): <NEW_LINE> <INDENT> self.total = 0 <NEW_LINE> self.field = field <NEW_LINE> <DEDENT> def visit(self, item): <NEW_LINE> <INDENT> self.total = self.total + item[self.field] <NEW_LINE> <DEDENT> def value(self): <NEW_LINE> <INDENT> return self.total | Visitor that calculates sum from field values. | 62598f15ad47b63b2c5a64a0 |
class Or(CompositionRule): <NEW_LINE> <INDENT> def satisfied(self, what, inquiry=None): <NEW_LINE> <INDENT> for rule in self.rules: <NEW_LINE> <INDENT> if rule.satisfied(what, inquiry): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> <DEDENT> return False | Rule that is satisfied when at least one of the rules it's composed of is satisfied.
Uses short-circuit evaluation.
For example: subjects=[{'stars': Or(Greater(50), Less(120)), 'name': Eq('Jimmy')}] | 62598f1560cbc95b06362fc3 |
class MultiHeadedSpatialAttention(nn.Module): <NEW_LINE> <INDENT> def __init__( self, in_channels, out_channels, kernel_size, padding=0, stride=1, dilation=1, groups=1, bias=True, padding_mode='zeros', position=True ): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.in_channels = in_channels <NEW_LINE> self.mid_... | Implementation of the multi-headed spatial attention mechanism for computer vision.
Note that the `groups` parameter plays the role of the number of heads. | 62598f15ab23a570cc2d43b5 |
class ClickDatetime(click.ParamType): <NEW_LINE> <INDENT> name = "date" <NEW_LINE> def convert(self, value, param, ctx): <NEW_LINE> <INDENT> if value is None: <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> if isinstance(value, datetime): <NEW_LINE> <INDENT> return value <NEW_LINE> <DEDENT> try: <NEW_LINE> <INDENT... | Take a datetime parameter, supporting any ISO8601 date/time/timezone combination. | 62598f15187af65679d2924e |
class IllegalMovementException(RuntimeError): <NEW_LINE> <INDENT> def __init__(self, init_pos, new_pos): <NEW_LINE> <INDENT> self._init_pos = init_pos <NEW_LINE> self._new_pos = new_pos <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return 'Illegal movement from {} to {}'.format(self._init_pos, self._new_po... | An exception type to be raised on an illegal movement. | 62598f15fbf16365ca792d32 |
class CreateAppendCommand(AppendGadgetCommand): <NEW_LINE> <INDENT> def __init__(self, source_gadget, box, pos): <NEW_LINE> <INDENT> description = _("Create - extend") <NEW_LINE> AppendGadgetCommand.__init__(self, source_gadget, box, pos, description) <NEW_LINE> self._undo = False <NEW_LINE> <DEDENT> def execute(self):... | Append a newly created widget to a box. | 62598f159f2886367281748b |
class Time(models.Model): <NEW_LINE> <INDENT> WEEKS = ( ("Sun", u"星期日"), ("Mon", u"星期一"), ("Tue", u"星期二"), ("Wed", u"星期三"), ("Thu", u"星期四"), ("Fri", u"星期五"), ("Sat", u"星期六"), ) <NEW_LINE> REPEAT_TYPES = ( (u"单周", u"单周"), (u"双周", u"双周"), (u"每周", u"每周"), ) <NEW_LINE> start_week = models.PositiveIntegerField() <NEW_LINE> ... | docstring for Time | 62598f1555399d3f056251b7 |
class DummyEl(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> for name in _dummy_names: <NEW_LINE> <INDENT> setattr(self, name, dummy_fun) <NEW_LINE> <DEDENT> self.getTrackerVersion = lambda: 'Dummy' <NEW_LINE> self.getDummyMode = lambda: True <NEW_LINE> self.getCurrentMode = lambda: IN_RECORD_MODE... | Dummy EyeLink controller. | 62598f1597e22403b3839b75 |
class Comma(BaseToken): <NEW_LINE> <INDENT> subclasses = [] <NEW_LINE> pat = r'^,$' | Match and represent a common in the date/time phrase | 62598f150fa83653e46f3b79 |
class CompanyPhoneForm(forms.ModelForm): <NEW_LINE> <INDENT> class Meta: <NEW_LINE> <INDENT> model = Phone <NEW_LINE> fields = '__all__' | Form for create company phone. | 62598f15099cdd3c63674a20 |
class AccountsDataProcessor(): <NEW_LINE> <INDENT> def __init__(self, rawdata: dict): <NEW_LINE> <INDENT> self.data = AccountsDataProcessor._process(rawdata) <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def _process(rawdata: dict) -> pd.DataFrame: <NEW_LINE> <INDENT> df = pd.DataFrame(rawdata) <NEW_LINE> df = df[[ 'id'... | Takes in the raw dict as received from mintapi.get_accounts()
Only the processed dataframe is cached. The summary is recomputed for every call | 62598f15ab23a570cc2d43b6 |
class Topic(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.id = None <NEW_LINE> self.name = None <NEW_LINE> self.slug = None <NEW_LINE> self.url = None <NEW_LINE> self.message_count = None <NEW_LINE> self.unread = None <NEW_LINE> self.date_created = None <NEW_LINE> self.date_latest_message = ... | Convore topic object | 62598f15fbf16365ca792d34 |
class Cell_new_dataset(dataset_utils): <NEW_LINE> <INDENT> def __init__(self, data_dir=None, transform=None, data_aug=None, seed=123, mode = 'train', sum_path = './' ): <NEW_LINE> <INDENT> super(Cell_new_dataset, self).__init__() <NEW_LINE> np.random.seed(seed) <NEW_LINE> self.mode = mode <NEW_LINE> self.transform = tr... | get Cell images from '/data1/tct_workspace/data_tct/data_annos/LCT_TCT_cell_annotation_new' | 62598f15377c676e912f63b0 |
class TempdirManager(object): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> super().setUp() <NEW_LINE> self.old_cwd = os.getcwd() <NEW_LINE> self.tempdirs = [] <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> os.chdir(self.old_cwd) <NEW_LINE> super().tearDown() <NEW_LINE> while self.tempdirs: <NEW... | Mix-in class that handles temporary directories for test cases.
This is intended to be used with unittest.TestCase. | 62598f158a349b6b43684ed9 |
class BatchIndexer: <NEW_LINE> <INDENT> def __init__(self, client, chunk_size=1000): <NEW_LINE> <INDENT> self.client = client <NEW_LINE> self.execute_command = client.execute_command <NEW_LINE> self._pipeline = client.pipeline(transaction=False, shard_hint=None) <NEW_LINE> self.total = 0 <NEW_LINE> self.chunk_size = ch... | A batch indexer allows you to automatically batch
document indexing in pipelines, flushing it every N documents. | 62598f15bf627c535bcb010d |
class IterableHint(CompositeTypeHint): <NEW_LINE> <INDENT> class IterableTypeConstraint(SequenceTypeConstraint): <NEW_LINE> <INDENT> def __init__(self, iter_type): <NEW_LINE> <INDENT> super(IterableHint.IterableTypeConstraint, self).__init__( iter_type, collections.Iterable) <NEW_LINE> <DEDENT> def __repr__(self): <NEW... | An Iterable type-hint.
Iterable[X] defines a type-hint for an object implementing an '__iter__'
method which yields objects which are all of the same type. | 62598f15fbf16365ca792d36 |
class WorkerInfoAccessor(object): <NEW_LINE> <INDENT> def __init__(self, model, worker_model, timeout_seconds): <NEW_LINE> <INDENT> self._model = model <NEW_LINE> self._worker_model = worker_model <NEW_LINE> self._timeout_seconds = timeout_seconds <NEW_LINE> self._last_fetch = None <NEW_LINE> self._fetch_workers() <NEW... | Helps with accessing the list of workers returned by the worker model. | 62598f15ad47b63b2c5a64a6 |
class LabelNode: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.classifier = LogisticRegression(dual=True, solver='liblinear', max_iter=20) <NEW_LINE> self.labels_classifiers = dict() <NEW_LINE> self.labels = None <NEW_LINE> self.left_child = None <NEW_LINE> self.right_child = None <NEW_LINE> self.par... | An internal or leaf node of a LabelTree. | 62598f15956e5f7376df4cc8 |
class UserForm(Form): <NEW_LINE> <INDENT> name = TextField('Name', validators=[required()], description="Public display name (Unique)") <NEW_LINE> email = EmailField('Email', validators=[optional(), email()]) <NEW_LINE> twitter = TextField('Twitter Username', validators=[optional()]) <NEW_LINE> def validate(self):... | Form to edit the user
Used only on editing, not creation
TODO: Combine this and the form below
TODO: This is not DRY | 62598f15ab23a570cc2d43b8 |
class AddResourceMemberRequestBody(object): <NEW_LINE> <INDENT> openapi_types = { 'id': 'str', 'name': 'str' } <NEW_LINE> attribute_map = { 'id': 'id', 'name': 'name' } <NEW_LINE> def __init__(self, id=None, name=None): <NEW_LINE> <INDENT> self._id = None <NEW_LINE> self._name = None <NEW_LINE> self.discriminator = Non... | NOTE: This class is auto generated by OpenAPI Generator.
Ref: https://openapi-generator.tech
Do not edit the class manually. | 62598f1560cbc95b06362fc9 |
class WQSymBases(Category_realization_of_parent): <NEW_LINE> <INDENT> r <NEW_LINE> def __init__(self, base, graded): <NEW_LINE> <INDENT> self._graded = graded <NEW_LINE> Category_realization_of_parent.__init__(self, base) <NEW_LINE> <DEDENT> def _repr_(self): <NEW_LINE> <INDENT> if self._graded: <NEW_LINE> <INDENT> typ... | The category of bases of `W QSym`. | 62598f1526238365f5fab822 |
class ApplicationGatewayIPConfiguration(SubResource): <NEW_LINE> <INDENT> _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'etag': {'... | IP configuration of an application gateway. Currently 1 public and 1
private IP configuration is allowed.
:param id: Resource ID.
:type id: str
:param subnet: Reference of the subnet resource. A subnet from where
application gateway gets its private address.
:type subnet: ~azure.mgmt.network.v2018_02_01.models.SubRes... | 62598f15adb09d7d5dc0923f |
class OfflineControllerWithSmallRotationEvent: <NEW_LINE> <INDENT> def __init__(self, last_action_success, scene_name, state=None, frame=None, score=None): <NEW_LINE> <INDENT> self.metadata = { "lastActionSuccess": last_action_success, "sceneName": scene_name, } <NEW_LINE> if state is not None: <NEW_LINE> <INDENT> self... | A stripped down version of an event. Only contains lastActionSuccess, sceneName,
and optionally state and frame. Does not contain the rest of the metadata. | 62598f1531939e2706ed10ae |
class KBpatch(): <NEW_LINE> <INDENT> def __init__(self, kb_id, date = None, description = None, rate = None): <NEW_LINE> <INDENT> self.id = kb_id <NEW_LINE> self.date = date <NEW_LINE> self.description = description <NEW_LINE> self.rate = rate <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> if self.date is n... | Definition of what is a KB patch (Knowledge base)
@param id : (Unique) ID of the KB
@param date : Date of the patch
@param description : Short description of what is the content. | 62598f15956e5f7376df4cc9 |
class TesHelpers(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> app.config['TESTING'] = True <NEW_LINE> self.app = app.test_client() <NEW_LINE> <DEDENT> def tearDown(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def test_valid_issue_request(self): <NEW_LINE> <INDENT> self.assertTrue(... | Module for testing the helpers module. | 62598f1560cbc95b06362fcb |
class IDAPythonStdOut: <NEW_LINE> <INDENT> encoding = "UTF-8" <NEW_LINE> def write(self, text): <NEW_LINE> <INDENT> ida_kernwin.msg(text) <NEW_LINE> <DEDENT> def flush(self): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def isatty(self): <NEW_LINE> <INDENT> return False | Dummy file-like class that receives stout and stderr | 62598f16ec188e330fdf7551 |
class UserErrorHandler(object): <NEW_LINE> <INDENT> def __init__(self, error, name, libname=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.libname = libname <NEW_LINE> self.error = error <NEW_LINE> self.source = None <NEW_LINE> self.lineno = -1 <NEW_LINE> self.arguments = ArgumentSpec() <NEW_LINE> self.tim... | Created if creating handlers fail -- running raises DataError.
The idea is not to raise DataError at processing time and prevent all
tests in affected test case file from executing. Instead UserErrorHandler
is created and if it is ever run DataError is raised then. | 62598f168a349b6b43684edf |
class Meta: <NEW_LINE> <INDENT> model = Trip <NEW_LINE> fields = ('name', 'description', 'start', 'end') | Define the meta data and the fields that are to be showed in this
form. | 62598f16d8ef3951e32c74a2 |
class DndHandler(object): <NEW_LINE> <INDENT> root = None <NEW_LINE> def __init__(self, source, event): <NEW_LINE> <INDENT> if event.num > 5: <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> root = event.widget._root() <NEW_LINE> if hasattr(root, '__dnd'): <NEW_LINE> <INDENT> return <NEW_LINE> <DEDENT> root.__dnd = self ... | The drag and drop machinery. | 62598f16956e5f7376df4cca |
class UserMeanPredictor(Predictor): <NEW_LINE> <INDENT> def __init__(self, user_ids, item_ids, scores, params_dict={}): <NEW_LINE> <INDENT> Predictor.__init__(self, user_ids, item_ids, scores, params_dict) <NEW_LINE> self.global_mean = None <NEW_LINE> <DEDENT> def train(self): <NEW_LINE> <INDENT> self.global_mean = np.... | UserMedianPredictor, predicts mean of ratings for given user, if new user is asked predicts global mean | 62598f16ab23a570cc2d43ba |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.