code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class APIError(OutlookError): <NEW_LINE> <INDENT> pass | Any error received from the Outlook API | 62598ee71f037a2d8b9e27d3 |
class Cipher(object): <NEW_LINE> <INDENT> def __init__(self, key=None): <NEW_LINE> <INDENT> if not key: <NEW_LINE> <INDENT> key = ''.join([choice(ascii_lowercase) for _ in range(100)]) <NEW_LINE> <DEDENT> elif not key.isalpha() or not key.islower(): <NEW_LINE> <INDENT> raise ValueError("Key needs to be lower case lette... | Implementation of a key shift cipher | 62598ee79c8ee8231303f4be |
class RelativeLinkTest2(DemoBuildTest): <NEW_LINE> <INDENT> def patch_site(self): <NEW_LINE> <INDENT> conf_path = os.path.join(self.target_dir, "conf.py") <NEW_LINE> with codecs.open(conf_path, "rb", "utf-8") as inf: <NEW_LINE> <INDENT> data = inf.read() <NEW_LINE> data = data.replace('("stories/*.txt", "stories", "sto... | Check that dropping stories to the root doesn't break links. | 62598ee74f6381625f198821 |
class DeviceBase(object): <NEW_LINE> <INDENT> STATUS_LED_COLOR_GREEN = "green" <NEW_LINE> STATUS_LED_COLOR_AMBER = "amber" <NEW_LINE> STATUS_LED_COLOR_RED = "red" <NEW_LINE> STATUS_LED_COLOR_OFF = "off" <NEW_LINE> def get_name(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def get_presence(sel... | Abstract base class for interfacing with a generic type of platform
peripheral device | 62598ee74c342835776189ae |
class TemporaryDirectoryInDirectory(fixtures.Fixture): <NEW_LINE> <INDENT> def __init__(self, parent_directory): <NEW_LINE> <INDENT> super(TemporaryDirectoryInDirectory, self).__init__() <NEW_LINE> self.parent_directory = parent_directory <NEW_LINE> <DEDENT> def setUp(self): <NEW_LINE> <INDENT> super(TemporaryDirectory... | Create a temporary directory in a specified directory. | 62598ee721bff66bcd72131e |
class ServiceManager(SyncManager): <NEW_LINE> <INDENT> def __init__(self, subscriber=None, pusher=None, puller=None, kill_switch=None, port=50000): <NEW_LINE> <INDENT> super().__init__(address=('127.0.0.1', port), authkey=b'gotem') <NEW_LINE> self.logger = multiprocessing.get_logger() <NEW_LINE> self.logger.handlers[0]... | Manages The Pipeline
Publisher -> Subscriber -> Pusher -> Puller -> Workers | 62598ee77d847024c075aa99 |
class AllSkyException(Exception): <NEW_LINE> <INDENT> pass | Specific exception class for errors from this code | 62598ee745492302aabfab79 |
class ProviderMachineViewSet(MultipleFieldLookup, OwnerUpdateViewSet): <NEW_LINE> <INDENT> lookup_fields = ("id", "instance_source__identifier") <NEW_LINE> queryset = ProviderMachine.objects.none() <NEW_LINE> serializer_class = ProviderMachineSerializer <NEW_LINE> search_fields = ( 'application_version__id', 'applicati... | API endpoint that allows instance actions to be viewed or edited. | 62598ee7fff4ab517ebcbea3 |
class CustomTableModel(QAbstractTableModel): <NEW_LINE> <INDENT> def __init__(self, data_table=None): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self._headers = None <NEW_LINE> self._data = None <NEW_LINE> self._display_precision = None <NEW_LINE> self.load_data(data_table) <NEW_LINE> if self._headers is not Non... | TODO: Put class docstring HERE.
| 62598ee8d7e4931a7ef3a76b |
class InMemoryCacheKey(typing.NamedTuple): <NEW_LINE> <INDENT> hash_fn: str <NEW_LINE> path: str | An in-memory cache which is optionally shared amongst all HashCache
instances. The in-memory cache omits timestamps from records. | 62598ee810dbd63aa1c6f23f |
class Solution(object): <NEW_LINE> <INDENT> def maxDepth(self, root): <NEW_LINE> <INDENT> if root is None: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> left = self.maxDepth(root.left) <NEW_LINE> right = self.maxDepth(root.right) <NEW_LINE> return max(left, right) + 1 | Time: N
Space: h where h is height | 62598ee863d6d428bbee0e99 |
class Session(object): <NEW_LINE> <INDENT> def __init__(self, bindings=None): <NEW_LINE> <INDENT> self._bindings = dict(bindings or {}) <NEW_LINE> <DEDENT> def evaluate(self, expr): <NEW_LINE> <INDENT> if expr not in self._bindings: <NEW_LINE> <INDENT> self._bindings[expr] = expr.evaluate_at(self) <NEW_LINE> <DEDENT> r... | A session represents a mapping of expressions to concrete values.
The bindings typically include required placeholders, but may be any
intermediate expression as well. | 62598ee8e1aae11d1e7cdba5 |
class RAM(models.Model): <NEW_LINE> <INDENT> asset = models.ForeignKey('Asset', on_delete=models.CASCADE) <NEW_LINE> sn = models.CharField('SN号', max_length=128, blank=True, null=True) <NEW_LINE> model = models.CharField('内存型号', max_length=128, blank=True, null=True) <NEW_LINE> manufacturer = models.CharField('内存制造商', ... | 内存组件 | 62598ee830dc7b766599df54 |
class commentType (pyxb.binding.basis.complexTypeDefinition): <NEW_LINE> <INDENT> _TypeDefinition = pyxb.binding.datatypes.token <NEW_LINE> _ContentTypeTag = pyxb.binding.basis.complexTypeDefinition._CT_SIMPLE <NEW_LINE> _Abstract = False <NEW_LINE> _ExpandedName = pyxb.namespace.ExpandedName(Namespace, 'commentType') ... | Kommentar: Enthält einen Kommentar. Die Sprache kann im Attribut angegeben werden. | 62598ee816aa5153ce3febca |
class Floating(Ast): <NEW_LINE> <INDENT> def __init__(self, num, col=None): <NEW_LINE> <INDENT> self.num = float(num) <NEW_LINE> self.col = col <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return "Floating({0})".format(repr(self.num)) <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return str(... | AST for a floating-point number. | 62598ee892d797404e387ee1 |
class TestMode: <NEW_LINE> <INDENT> ALL = 'all' <NEW_LINE> MEDICAL ='medical' <NEW_LINE> INTERACTIVE = 'interactive' <NEW_LINE> DAEMON = 'daemon' | Simple structure representing the different testing modes
| 62598ee826068e7796d4b029 |
class SealUserInfo: <NEW_LINE> <INDENT> def __init__( self, user_name, identification_type, identification_no, phone="", seal_location="", seal_reason="", ): <NEW_LINE> <INDENT> self.user_name = user_name <NEW_LINE> self.identification_type = identification_type <NEW_LINE> self.identification_no = identification_no <NE... | 签章的用户信息类 | 62598ee83539df3088eca97f |
class BaseEncryptedField(models.Field): <NEW_LINE> <INDENT> description = _("An encrypted string") <NEW_LINE> __metaclass__ = models.SubfieldBase <NEW_LINE> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.prefix = kwargs.pop('prefix', '_') <NEW_LINE> max_length = kwargs.get('max_length', 40) <NEW_LINE> mo... | an encrypted string field for password or security key | 62598ee8d486a94d0ba2a69a |
class Flags(BitField): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super(Flags, self).__init__( ('empty', Bits(value=0, maxlen=6)), ('acfe', Bits(maxlen=1)), ('chsfe', Bits(maxlen=1)), *args, **kwargs ) | EGTS_SR_COMMAND_DATA Flags | 62598ee84428ac0f6e656c1e |
@game_mode("classic", minp = 4, maxp = 21, likelihood = 0) <NEW_LINE> class ClassicMode(GameMode): <NEW_LINE> <INDENT> def __init__(self, arg=""): <NEW_LINE> <INDENT> super().__init__(arg) <NEW_LINE> self.ABSTAIN_ENABLED = False <NEW_LINE> self.ROLE_INDEX = ( 4 , 6 , 8 , 10 , 12 , 15 , 17 ... | Classic game mode from before all the changes. | 62598ee899cbb53fe682f57e |
class NumpyPlot(PandasPlot): <NEW_LINE> <INDENT> def __init__(self, data, **kwargs): <NEW_LINE> <INDENT> if 'labels' in kwargs: <NEW_LINE> <INDENT> labels = kwargs.pop('labels') <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT> labels = ['Ch %d' %(x) for x in range(data.shape[0])] <NEW_LINE> <DEDENT> data = np.transpose(da... | Plot a [channels x samples] Numpy matrix.
Creates a DataFrame with the supplied matrix and
an optional list of channel labels, then initializes
a PandasPlot.
Args:
data: [channels x samples] Numpy matrix
**kwargs: Arbitrary keyword arguments. | 62598ee838b623060ffa7765 |
class Solution: <NEW_LINE> <INDENT> def removeDuplicates(self, nums): <NEW_LINE> <INDENT> tmp = None <NEW_LINE> count = 1 <NEW_LINE> for i in range(len(nums), 0, -1): <NEW_LINE> <INDENT> if tmp == nums[i - 1]: <NEW_LINE> <INDENT> if count < 2: <NEW_LINE> <INDENT> count += 1 <NEW_LINE> <DEDENT> else: <NEW_LINE> <INDENT>... | @param: nums: An ineger array
@return: An integer | 62598ee8cc0a2c11144796d0 |
class PingPongProtocol(NodeProtocol): <NEW_LINE> <INDENT> def __init__(self, node, observable, qubit=None): <NEW_LINE> <INDENT> super().__init__(node) <NEW_LINE> self.observable = observable <NEW_LINE> self.qubit = qubit <NEW_LINE> self.basis = ["|0>", "|1>"] if observable == ns.Z else ["|+>", "|->"] <NEW_LINE> <DEDENT... | Protocol that runs on one node which can be used for a game of PingPong.
Parameters
----------
node : :class:`~netsquid.nodes.node.Node` or None
Node this protocol runs on. If None, a node should be set later before starting
this protocol.
observable : :obj:`~netsquid.qubits.operators.Operator`
Hermitian o... | 62598ee82ae34c7f260a97b4 |
class Spring: <NEW_LINE> <INDENT> def __init__(self, config): <NEW_LINE> <INDENT> self.r_w = config['rest_weak'] <NEW_LINE> self.r_s = config['rest_strong'] <NEW_LINE> self.k_w = config['konstant_weak'] <NEW_LINE> self.k_s = config['konstant_strong'] <NEW_LINE> k_t = 1.381*10**-23 * 288 * 10**21 <NEW_LINE> self.normali... | A generic spring, from which we make the myosin heads | 62598ee8be8e80087fbbd71b |
class _ForwardingConsumer(_PropagatingConsumer): <NEW_LINE> <INDENT> def _consume(self, products, producer): <NEW_LINE> <INDENT> if self._producer() is not None: <NEW_LINE> <INDENT> for product in products: <NEW_LINE> <INDENT> self._producer().postProduct(product) | A :class:`_ForwardingConsumer` is a
:class:`_PropagatingConsumer` that requires its associated
producer to forward all the products it receives. | 62598ee82eb69b55b15a06f0 |
class WriteBatch(object): <NEW_LINE> <INDENT> def __init__(self, client): <NEW_LINE> <INDENT> self._client = client <NEW_LINE> self._write_pbs = [] <NEW_LINE> <DEDENT> def _add_write_pbs(self, write_pbs): <NEW_LINE> <INDENT> self._write_pbs.extend(write_pbs) <NEW_LINE> <DEDENT> def create(self, reference, document_data... | Accumulate write operations to be sent in a batch.
This has the same set of methods for write operations that
:class:`~.firestore_v1beta1.document.DocumentReference` does,
e.g. :meth:`~.firestore_v1beta1.document.DocumentReference.create`.
Args:
client (~.firestore_v1beta1.client.Client): The client that
... | 62598ee832920d7e50bc46f8 |
class TransactionSerializer(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._simplifier_cls = serializers.get_serializer("python") <NEW_LINE> <DEDENT> def to_json(self, transactions): <NEW_LINE> <INDENT> simplifier = self._simplifier_cls() <NEW_LINE> return (json.dumps(t, cls=JSONEncoder) for ... | Helper for serializing transaction objects to JSON. | 62598ee899fddb7c1ca6216b |
class TTLDecrementedTestCase(ComplianceTestCase): <NEW_LINE> <INDENT> def run(self): <NEW_LINE> <INDENT> self.logger.info("Sending ICMP Echo Request from TN4 to TN2, via 4in6 tunnel...") <NEW_LINE> self.node(4).send( IP(src=str(self.node(4).ip(type="v4")), dst=str(self.node(2).ip(type="v4")), ttl=64)/ ICMP(seq=self.nex... | TTL Decremented
Verifies that the TTL on an IPv4 packet is decremented by 1 when it
is sent through a 4in6 tunnel.
@private
Source: RFC 2473 Section 3.1 | 62598ee8460517430c430b55 |
class EpsilonGreedyPolicy(ExplorationPolicy): <NEW_LINE> <INDENT> def __init__(self, epsilon_initial, epsilon_final, epsilon_steps): <NEW_LINE> <INDENT> self.epsilon_initial = epsilon_initial <NEW_LINE> self.epsilon_final = epsilon_final <NEW_LINE> self.epsilon_steps = epsilon_steps <NEW_LINE> <DEDENT> def select_actio... | Epsilon greedy policy chooses random action with epsilon probability and
the best action with 1 - epsilon probability. | 62598ee8236d856c2adc877b |
class Quote(BaseModel): <NEW_LINE> <INDENT> user = peewee.CharField(index=True) <NEW_LINE> channel = peewee.CharField() <NEW_LINE> time = peewee.DateTimeField() <NEW_LINE> text = peewee.TextField() | Database Quote Table. | 62598ee80a50d4780f703a79 |
class FontDescriptor(object): <NEW_LINE> <INDENT> def __init__(self, font_name, family, category, variants, version, mtime): <NEW_LINE> <INDENT> self.backend = None <NEW_LINE> self.font_name = font_name <NEW_LINE> self.family = family <NEW_LINE> self.category = category <NEW_LINE> self.variants = variants <NEW_LINE> se... | Describes any given font containing all information that is required by
the system in order to use custom web fonts. | 62598ee821bff66bcd721320 |
class _baseFunctionFit(object): <NEW_LINE> <INDENT> def __init__(self, xx, yy, sems=1.0, guess=None, display=1, expectedMin=0.5, optimize_kws=None): <NEW_LINE> <INDENT> super(_baseFunctionFit, self).__init__() <NEW_LINE> self.xx = np.array(xx) <NEW_LINE> self.yy = np.array(yy) <NEW_LINE> self.sems = np.array(sems) <NEW... | Not needed by most users except as a superclass for developing
your own functions
Derived classes must have _eval and _inverse methods with @staticmethods | 62598ee856b00c62f0fb0f9d |
class Node(object): <NEW_LINE> <INDENT> def __init__(self, name, cons=None): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.parent = None <NEW_LINE> self.rank = 0 <NEW_LINE> self.outlinks = {} <NEW_LINE> self.table = None <NEW_LINE> if cons != None: <NEW_LINE> <INDENT> for con in cons: <NEW_LINE> <INDENT> self.ou... | class encapsulate node to represent a table on schema graph | 62598ee844b2445a339b5ccf |
class FullRank_Markov(Markov): <NEW_LINE> <INDENT> def __init__(self, y, fill_empty_classes=False, summary=True): <NEW_LINE> <INDENT> y = np.asarray(y) <NEW_LINE> r_asc = np.array([rankdata(col, method="ordinal") for col in y.T]).T <NEW_LINE> self.ranks = r_asc.shape[0] - r_asc + 1 <NEW_LINE> super(FullRank_Markov, sel... | Full Rank Markov in which ranks are considered as Markov states rather
than quantiles or other discretized classes. This is one way to avoid
issues associated with discretization.
Parameters
----------
y : array
(n, t) with t>>n, one row per observation (n total),
one column re... | 62598ee87d847024c075aa9b |
class City(DataClayObject): <NEW_LINE> <INDENT> @dclayMethod() <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.events = list() <NEW_LINE> self.aggregation = AggregatedEvents() <NEW_LINE> <DEDENT> @dclayMethod(new_events="list<CityNS.classes.Event>") <NEW_LINE> def add_all_events(self, new_events): <NEW_LINE> <I... | @ClassField events list<CityNS.classes.Event>
@ClassField aggregation CityNS.classes.AggregatedEvents | 62598ee867a9b606de54469c |
class DataUploadView(APIView): <NEW_LINE> <INDENT> parser_classes = (MultiPartParser,FormParser, ) <NEW_LINE> def post(self, request, format=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> metatable = request.data.get('metatable') <NEW_LINE> idd = request.data.get('datasetid') <NEW_LINE> lat = request.data.get('lat... | Upload the actual data to the database. Post parameters include the "metatable" (yield,soil,canopy,sensor), the "datasetid" of
the dataset (from the "metatable"), the mapping for "lat", "lon", "value1", the optional mapping for "row" and the additional value2,3,4,5,6, the
"folderID", the "filename" (note, for shpefil... | 62598ee8d58c6744b42db61d |
class Office: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.simplyRetsTypes = { 'contact': 'ContactInformation', 'name': 'str', 'servingName': 'str', 'brokerid': 'str' } <NEW_LINE> self.contact = None <NEW_LINE> self.name = None <NEW_LINE> self.servingName = None <NEW_LINE> self.brokerid = None | NOTE: This class is auto generated by the SimplyRets code
generator program. Do not edit the class manually. | 62598ee8d7e4931a7ef3a76d |
class Locality(IntEnum): <NEW_LINE> <INDENT> SYSTEM = 0 <NEW_LINE> USER = 1 <NEW_LINE> APPLICATION = 2 <NEW_LINE> ENVIRONMENT = 3 | Enumeration of localities defined by confidence, ranging from system-wide
locations for configurations (e.g. ``/etc/name.yaml``) to environment
variables. | 62598ee88a43f66fc4bf0840 |
class UCQMWorker(ModuleLVAPPWorker): <NEW_LINE> <INDENT> pass | User channel quality map worker. | 62598ee84f88993c371ef84d |
class Event(db.Model): <NEW_LINE> <INDENT> __tablename__ = 'Event' <NEW_LINE> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String) <NEW_LINE> start_time = db.Column(db.String) <NEW_LINE> end_time = db.Column(db.String) <NEW_LINE> start_date = db.Column(db.DateTime) <NEW_LINE> end_date = d... | Model representing Events happening in Sheffield. The data we're storing
here is currently collected from EventSheffield. The fields we're storing are
limited due to this. However we expect to extend this API. | 62598ee8cad5886f8bdc39d0 |
class SshPublicKey(_messages.Message): <NEW_LINE> <INDENT> expirationTimeUsec = _messages.IntegerField(1) <NEW_LINE> fingerprint = _messages.StringField(2) <NEW_LINE> key = _messages.StringField(3) | The SSH public key information associated with a Directory API User.
Fields:
expirationTimeUsec: An expiration time in microseconds since epoch.
fingerprint: [Output Only] The SHA-256 fingerprint of the SSH public key.
key: Public key text in SSH format, defined by <a
href="https://www.ietf.org/rfc/rfc4253.t... | 62598ee83539df3088eca980 |
class SimpleEnumerationDomain(ditagen.dita.Domain): <NEW_LINE> <INDENT> id = u"d4p_simpleEnumeration-d" <NEW_LINE> si_module = u"d4p_simpleEnumeration.mod" <NEW_LINE> si_entity = u"d4p_simpleEnumeration.ent" <NEW_LINE> pi_module = u"urn:pubid:dita4publishers.sourceforge.net:modules:dita:modules:d4p_simpleEnumerationDom... | DITA For Publishers Simple Enumeration Domain. | 62598ee8aad79263cf42ced8 |
class HostConnectionError(Exception): <NEW_LINE> <INDENT> pass | This error is thrown whenever the master server is disconnected
| 62598ee8cb5e8a47e493b4e0 |
class RbPolygon(RbFeature): <NEW_LINE> <INDENT> def __init__(self, qgs_feature): <NEW_LINE> <INDENT> super().__init__(qgs_feature) <NEW_LINE> if self.qgs_geom.wkbType() != QgsWkbTypes.Polygon: <NEW_LINE> <INDENT> self.qgs_geom = self.qgs_geom.coerceToType(QgsWkbTypes.Polygon) <NEW_LINE> <DEDENT> self.qgs_geom = self.qg... | Class description for RbPolygon | 62598ee8d486a94d0ba2a69c |
class EditPost(Handler): <NEW_LINE> <INDENT> def get(self, post_id): <NEW_LINE> <INDENT> if not self.user: <NEW_LINE> <INDENT> self.redirect("/login") <NEW_LINE> return <NEW_LINE> <DEDENT> """Blog post""" <NEW_LINE> key = db.Key.from_path('Post', int(post_id), parent=blog_key()) <NEW_LINE> post = db.get(key) <NEW_LINE>... | View single post page handler | 62598ee83539df3088eca981 |
class OtherSiteTestCase(SiteDetectionTestCase): <NEW_LINE> <INDENT> def test_musicbrainz(self): <NEW_LINE> <INDENT> self.assertNoSite('http://musicbrainz.org/doc/$1') | Test other non-MediaWiki sites. | 62598ee8442bda511e95ab30 |
class UpResnetBlock(nn.Module): <NEW_LINE> <INDENT> def __init__(self, dim, padding_type, norm_layer, use_bias, nz=6, type_up='nearest', type_norm='batch'): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> p = 0 <NEW_LINE> if padding_type == 'reflect': <NEW_LINE> <INDENT> self.replication_pad = nn.ReflectionPad2d(1) <... | Define a Resnet block | 62598ee8460517430c430b57 |
class Legendre (CoeffPolynomial): <NEW_LINE> <INDENT> def full_model(self, points, *params): <NEW_LINE> <INDENT> return legval2d(points[:, 0], points[:, 1], self.params_to_coeff(params)) <NEW_LINE> <DEDENT> def vandermonde(self, points): <NEW_LINE> <INDENT> vander = legvander2d(points[:, 0], points[:, 1], [self.degree,... | Concrete implementation of :class:`Polynomial`. | 62598ee8a8370b77170eeab3 |
class Animal(object): <NEW_LINE> <INDENT> population = 0 <NEW_LINE> @classmethod <NEW_LINE> def populationCount(cls): <NEW_LINE> <INDENT> return Animal.population <NEW_LINE> <DEDENT> def __init__(self, name, favFood): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.favFood = favFood <NEW_LINE> Animal.population +=... | Animal class class that increments of all animal instances. | 62598ee866673b3332c2ea77 |
class CollectionRightsModel(base_models.VersionedModel): <NEW_LINE> <INDENT> SNAPSHOT_METADATA_CLASS = CollectionRightsSnapshotMetadataModel <NEW_LINE> SNAPSHOT_CONTENT_CLASS = CollectionRightsSnapshotContentModel <NEW_LINE> ALLOW_REVERT = False <NEW_LINE> owner_ids = ndb.StringProperty(indexed=True, repeated=True) <NE... | Storage model for rights related to a collection.
The id of each instance is the id of the corresponding collection. | 62598ee87d847024c075aa9d |
class ReflexCaptureAgent(CaptureAgent): <NEW_LINE> <INDENT> def registerInitialState(self, gameState): <NEW_LINE> <INDENT> self.start = gameState.getAgentPosition(self.index) <NEW_LINE> self.foodOnHand = 0 <NEW_LINE> self.applyedActions = [] <NEW_LINE> self.gotScore = 0 <NEW_LINE> CaptureAgent.registerInitialState(self... | A base class for reflex agents that chooses score-maximizing actions | 62598ee84e4d562566370ae9 |
class PrimitiveFunction(PartFunction): <NEW_LINE> <INDENT> def __init__(self, name): <NEW_LINE> <INDENT> PartFunction.__init__(self, name) <NEW_LINE> <DEDENT> def call(self, model, *args): <NEW_LINE> <INDENT> coords = [] <NEW_LINE> if (len(args) == (self.num_vertices + 1)): <NEW_LINE> <INDENT> color = args[-1] <NEW_LIN... | Base class for primitives like line, triangle, etc. | 62598ee832920d7e50bc46fb |
class MsgBootloaderHandshake(SBP): <NEW_LINE> <INDENT> _parser = Struct("MsgBootloaderHandshake", ULInt8('handshake'),) <NEW_LINE> def __init__(self, sbp): <NEW_LINE> <INDENT> self.__dict__.update(sbp.__dict__) <NEW_LINE> self.from_binary(sbp.payload) <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return f... | SBP class for message MSG_BOOTLOADER_HANDSHAKE (0x00B0).
The bootloader continually sends a handshake message to the host
for a short period of time, and then jumps to the firmware if it
doesn't receive a handshake from the host. If the host replies
with a handshake the bootloader doesn't jump to the firmware and
... | 62598ee867a9b606de54469e |
class ApiAiHandler(Handler): <NEW_LINE> <INDENT> def __init__(self, callback, intent, min_score=0.0, follow_up=False): <NEW_LINE> <INDENT> super().__init__(callback) <NEW_LINE> self.intent = intent <NEW_LINE> self.min_score = min_score <NEW_LINE> self.follow_up = follow_up <NEW_LINE> self.follow_up_pattern = re.compile... | Handler class to handle api.ai NLP processed messages.
Attributes:
callback (:obj:`callable`): The callback function for this handler.
entities (:obj:`list[str]`): A list of JSON keys that must be present in the NLP entities
Args:
callback (:obj:`callable`): A function that takes ``event, **kwargs`` as ar... | 62598ee8d7e4931a7ef3a76f |
class CompileOneShot(Deploy): <NEW_LINE> <INDENT> target = "build" <NEW_LINE> def __init__(self, build_mode, sim_cfg): <NEW_LINE> <INDENT> self.build_mode_obj = build_mode <NEW_LINE> super().__init__(sim_cfg) <NEW_LINE> <DEDENT> def _define_attrs(self): <NEW_LINE> <INDENT> super()._define_attrs() <NEW_LINE> self.mandat... | Abstraction for building the design (used by non-DV flows). | 62598ee8d58c6744b42db61e |
class MNISTModel(nn.Module): <NEW_LINE> <INDENT> def __init__(self, in_size, hidden_size, out_size): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.linear1 = nn.Linear(in_size, hidden_size) <NEW_LINE> self.linear2 = nn.Linear(hidden_size, out_size) <NEW_LINE> <DEDENT> def forward(self, xb): <NEW_LINE> <INDENT> ... | Feedfoward neural network with 1 hidden layer | 62598ee810dbd63aa1c6f243 |
class FrontEndTestCase(TestCase): <NEW_LINE> <INDENT> fixtures = [ "blogging_test_fixture.json", ] <NEW_LINE> def setUp(self): <NEW_LINE> <INDENT> self.now = datetime.datetime.utcnow().replace(tzinfo=utc) <NEW_LINE> self.timedelta = datetime.timedelta(15) <NEW_LINE> author = User.objects.get(pk=1) <NEW_LINE> for count ... | test views provided in the front-end | 62598ee8167d2b6e312b566a |
class Validatable: <NEW_LINE> <INDENT> def __init__(self, validator_map: dict, attributes: List[str] = None): <NEW_LINE> <INDENT> self._validate_attributes = attributes or [] <NEW_LINE> self._validator_map = validator_map <NEW_LINE> self._validation_errors = [] <NEW_LINE> <DEDENT> def validate(self) -> bool: <NEW_LINE>... | A validatable node | 62598ee86aa9bd52df0d3581 |
class PrettyTable(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.columns = [] <NEW_LINE> <DEDENT> def add_column(self, width, label="", just='l'): <NEW_LINE> <INDENT> self.columns.append((width, label, just)) <NEW_LINE> <DEDENT> def make_header(self): <NEW_LINE> <INDENT> label_parts = [] <NEW... | Creates an ASCII art table
Example:
ID Name Size Hits
--- ----------------- ------------ -----
122 image 22 0 | 62598ee8f7d966606f7466c1 |
class DownloadAskActionDialog(QDialog, Ui_DownloadAskActionDialog): <NEW_LINE> <INDENT> def __init__(self, fileName, mimeType, baseUrl, parent=None): <NEW_LINE> <INDENT> super(DownloadAskActionDialog, self).__init__(parent) <NEW_LINE> self.setupUi(self) <NEW_LINE> self.infoLabel.setText("<b>{0}</b>".format(fileName)) <... | Class implementing a dialog to ask for a download action. | 62598ee8dd821e528d6d7615 |
class NullableInfoFeatureTypeError(BaseOverhaveSynchronizerException): <NEW_LINE> <INDENT> pass | Exception for situation without feature info type. | 62598ee8a8370b77170eeab4 |
class ForciblyFinalizeConfirmForm(DangerousForm): <NEW_LINE> <INDENT> def __init__(self, request: "CamcopsRequest", **kwargs) -> None: <NEW_LINE> <INDENT> _ = request.gettext <NEW_LINE> super().__init__(schema_class=ForciblyFinalizeConfirmSchema, submit_action=FormAction.FINALIZE, submit_title=_("Forcibly finalize"), r... | Form to confirm force-finalizing of a device. | 62598ee8be383301e0251eaa |
class MyUndefined(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> pass <NEW_LINE> <DEDENT> def __getattr__(self, name): <NEW_LINE> <INDENT> if name[:2] == '__': <NEW_LINE> <INDENT> raise AttributeError(name) <NEW_LINE> <DEDENT> return None <NEW_LINE> <DEDENT> def __str__(self): <NE... | 把未定义变量处理为None | 62598ee8baa26c4b54d4d99f |
class PILToNumpyConvertor(NumpyPILConvertor): <NEW_LINE> <INDENT> def __call__(self, img): <NEW_LINE> <INDENT> return self.pil2numpy(img) | ===================
PILToNumpyConvertor
===================
A PIL image to numpy convertor | 62598ee8cc0a2c11144796d4 |
class Numberz(object): <NEW_LINE> <INDENT> ONE = 1 <NEW_LINE> TWO = 2 <NEW_LINE> THREE = 3 <NEW_LINE> FIVE = 5 <NEW_LINE> SIX = 6 <NEW_LINE> EIGHT = 8 <NEW_LINE> _VALUES_TO_NAMES = { 1: "ONE", 2: "TWO", 3: "THREE", 5: "FIVE", 6: "SIX", 8: "EIGHT", } <NEW_LINE> _NAMES_TO_VALUES = { "ONE": 1, "TWO": 2, "THREE": 3, "FIVE"... | Docstring! | 62598ee82ae34c7f260a97b8 |
class EventHubCreateOrUpdateParameters(msrest.serialization.Model): <NEW_LINE> <INDENT> _validation = { 'location': {'required': True}, 'created_at': {'readonly': True}, 'partition_ids': {'readonly': True}, 'updated_at': {'readonly': True}, } <NEW_LINE> _attribute_map = { 'location': {'key': 'location', 'type': 'str'},... | Parameters supplied to the Create Or Update Event Hub operation.
Variables are only populated by the server, and will be ignored when sending a request.
All required parameters must be populated in order to send to Azure.
:param location: Required. Location of the resource.
:type location: str
:param type: ARM type ... | 62598ee8be8e80087fbbd71f |
class Junos(Switch): <NEW_LINE> <INDENT> def __init__(self, host, user, pwd, port=830): <NEW_LINE> <INDENT> super().__init__(host, user, pwd, port) <NEW_LINE> self.os = "junos" <NEW_LINE> <DEDENT> def connect(self): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> with Device(host=self.host, user=self.user, password=self.p... | Definition de la classe junos
parametres de la classe
- host : IP de l'equipement
- username
- pasword
- port
fonctions de la classe:
- connect | 62598ee8bd1bec0571e14433 |
class CustomUserManager(BaseUserManager): <NEW_LINE> <INDENT> def create_user(self, email, password, phone, department_id, name_surname, **extra_fields): <NEW_LINE> <INDENT> if not email: <NEW_LINE> <INDENT> raise ValueError(_('The Email must be set')) <NEW_LINE> <DEDENT> if not name_surname: <NEW_LINE> <INDENT> raise ... | Custom user model manager where email is the unique identifiers
for authentication instead of username. | 62598ee801c39578d7f1147a |
class cd: <NEW_LINE> <INDENT> def __init__(self, newPath): <NEW_LINE> <INDENT> self.newPath = newPath <NEW_LINE> <DEDENT> def __enter__(self): <NEW_LINE> <INDENT> self.savedPath = os.getcwd() <NEW_LINE> os.chdir(self.newPath) <NEW_LINE> <DEDENT> def __exit__(self, etype, value, traceback): <NEW_LINE> <INDENT> os.chdir(... | Context manager for changing the current working directory | 62598ee89c8ee8231303f4c1 |
class CourseRoleConverter(RoleConverter): <NEW_LINE> <INDENT> def __ignore_dash_case(self, argument: str) -> str: <NEW_LINE> <INDENT> return " ".join(argument.split("-")).lower().strip() <NEW_LINE> <DEDENT> async def convert(self, ctx: commands.Context, argument: str) -> discord.Role: <NEW_LINE> <INDENT> try: <NEW_LINE... | Converts to a `discord.Role` with some leeway for courses.
All lookups are via the local guild. If in a DM context, then the lookup
is done by the global cache.
The lookup strategy is as follows (in order):
1. Lookup by ID.
2. Lookup by mention.
3. Lookup by name
4. Lookup by name (case-insensitive and ignoring dash... | 62598ee8460517430c430b59 |
class Mem: <NEW_LINE> <INDENT> instance_id = "" | Global Class Pattern:
Declare globals here. | 62598ee80a50d4780f703a7c |
class Arguments(Parameters): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> super().__init__(*args, **kwargs) <NEW_LINE> self.optional = False | TODO: write some stuff about Arguments. | 62598ee8925a0f43d25e66ff |
class RstDtException(Exception): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> super(RstDtException, self).__init__(msg) | Exceptions related to conversion between RST and DT trees.
The general expectation is that we only raise these on bad
input, but in practice, you may see them more in cases of
implementation error somewhere in the conversion process. | 62598ee88e7ae83300ee7760 |
class ImportGraph(): <NEW_LINE> <INDENT> def __init__(self, loc): <NEW_LINE> <INDENT> self.graph = tf.Graph() <NEW_LINE> self.sess = tf.Session(graph=self.graph) <NEW_LINE> with self.graph.as_default(): <NEW_LINE> <INDENT> saver = tf.train.import_meta_graph(loc + '.meta', clear_devices=True) <NEW_LINE> saver.restore(se... | Import and run isolated TF graph.
Args:
loc (str): Path to TF graph.
Attributes:
graph: TF graph.
sess: TF session.
activation: Get collection of TF saved variables.
Use:
data = 50 # random data
model = ImportGraph('models/model_name')
result = model.run(data)
print(re... | 62598ee84e4d562566370aeb |
class BgpExc(Exception): <NEW_LINE> <INDENT> CODE = 0 <NEW_LINE> SUB_CODE = 0 <NEW_LINE> SEND_ERROR = True <NEW_LINE> def __init__(self, data=''): <NEW_LINE> <INDENT> super(BgpExc, self).__init__() <NEW_LINE> self.data = data <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return '<%s %r>' % (self.__class__.... | Base bgp exception. | 62598ee84428ac0f6e656c23 |
class JobApiKey(APIKey): <NEW_LINE> <INDENT> key_type = 'job' <NEW_LINE> @classmethod <NEW_LINE> def generate(cls, uid, job_id): <NEW_LINE> <INDENT> job_id = str(job_id) <NEW_LINE> existing_key = config.db.apikeys.find_one({ 'uid': uid, 'job': job_id, }) <NEW_LINE> if existing_key is not None: <NEW_LINE> <INDENT> retur... | API key that grants API access as a specified user during execution of a job
Job must be in 'running' state to user API key | 62598ee87047854f4633daa6 |
@pytest.mark.parametrize("ste", ["file-->folder"], indirect=True) <NEW_LINE> class TestConversionFileFolder: <NEW_LINE> <INDENT> @pytest.mark.parametrize("opt_format", ["mp3", "ogg", ".ogg"]) <NEW_LINE> def test_option_format(self, ste, opt_format): <NEW_LINE> <INDENT> _assert_run_mmusicc( "--only-files", "-s", ste.pat... | Test convert file to folder operation and options | 62598ee8090684286d592a49 |
class CeleryTestSuiteRunner(DiscoverRunner): <NEW_LINE> <INDENT> def setup_test_environment(self, **kwargs): <NEW_LINE> <INDENT> _set_eager() <NEW_LINE> super(CeleryTestSuiteRunner, self).setup_test_environment(**kwargs) | Django test runner allowing testing of celery delayed tasks.
All tasks are run locally, not in a worker.
To use this runner set ``settings.TEST_RUNNER``::
TEST_RUNNER = 'djcelery.contrib.test_runner.CeleryTestSuiteRunner' | 62598ee8dd821e528d6d7616 |
@dataclass <NEW_LINE> class TargetConfig(): <NEW_LINE> <INDENT> path: str <NEW_LINE> size: Size <NEW_LINE> sources: List[str] <NEW_LINE> allow_nsfw: bool = True | Holds information about a save target | 62598ee8e1aae11d1e7cdba8 |
class AcceptConditionFormPlugin(DialogFormPluginBase): <NEW_LINE> <INDENT> name = _("Accept Condition") <NEW_LINE> form_class = 'shop.forms.checkout.AcceptConditionForm' <NEW_LINE> template_leaf_name = 'accept-condition.html' <NEW_LINE> html_parser = HTMLParser() <NEW_LINE> change_form_template = 'cascade/admin/text_pl... | Provides the form to accept any condition. | 62598ee8f548e778e5969c5d |
class NodePreinstalledModule(NodeModule): <NEW_LINE> <INDENT> def __init__(self, dependencies_archive_url=None, sources=None, address=None, payload=None, **kwargs): <NEW_LINE> <INDENT> payload = payload or Payload() <NEW_LINE> payload.add_fields({ 'dependencies_archive_url': PrimitiveField(dependencies_archive_url), })... | A NodeModule which resolves deps by downloading an archived node_modules directory.
This is basically an example, to demonstrate how additional types of NodeModule targets with
their own resolvers (in this case NodePreinstalledModuleResolver), which still work with
NodeTest, can be registered. To be generallly correct... | 62598ee86e29344779afed04 |
class PageVisibilityError(Exception): <NEW_LINE> <INDENT> pass | Base class for all of the exceptions we raise | 62598ee8b7558d5895461d17 |
class FakeAIAlgorithmTest(AIAlgorithmTest): <NEW_LINE> <INDENT> ALGORITHM_CLASS = FakeAIAlgorithm <NEW_LINE> def test_train_and_score(self): <NEW_LINE> <INDENT> classifier = self.algorithm.train_classifier(EXAMPLES) <NEW_LINE> expected_scores = [2, 0, 0, 0, 4, 2, 4] <NEW_LINE> scores = self._scores(classifier, INPUT_ES... | Test for the fake AI algorithm implementation. | 62598ee8627d3e7fe0e0555b |
class BlobFile(file): <NEW_LINE> <INDENT> def __init__(self, name, mode, blob): <NEW_LINE> <INDENT> super(BlobFile, self).__init__(name, mode+'b') <NEW_LINE> self.blob = blob <NEW_LINE> <DEDENT> def close(self): <NEW_LINE> <INDENT> self.blob.closed(self) <NEW_LINE> file.close(self) | A BlobFile that holds a file handle to actual blob data.
It is a file that can be used within a transaction boundary; a BlobFile is
just a Python file object, we only override methods which cause a change to
blob data in order to call methods on our 'parent' persistent blob object
signifying that the change happened. | 62598ee8167d2b6e312b566c |
class sync_get_args(object): <NEW_LINE> <INDENT> thrift_spec = ( None, (1, TType.I64, 'latest_timestamp', None, None, ), ) <NEW_LINE> def __init__(self, latest_timestamp=None,): <NEW_LINE> <INDENT> self.latest_timestamp = latest_timestamp <NEW_LINE> <DEDENT> def read(self, iprot): <NEW_LINE> <INDENT> if iprot.__class__... | Attributes:
- latest_timestamp | 62598ee8f7d966606f7466c3 |
class DynamicPixbuf: <NEW_LINE> <INDENT> def __init__(self, filepath): <NEW_LINE> <INDENT> self.updatePath(filepath) <NEW_LINE> <DEDENT> def updatePath(self, filepath): <NEW_LINE> <INDENT> self.pixbuf = gtk.gdk.pixbuf_new_from_file(filepath) <NEW_LINE> <DEDENT> def getPixbuf(self): <NEW_LINE> <INDENT> return self.pixbu... | Dynamic pixbuf. | 62598ee84a966d76dd5ed5b7 |
class Definition(collections.MutableMapping): <NEW_LINE> <INDENT> def __init__(self, fax): <NEW_LINE> <INDENT> self.data_ext = None <NEW_LINE> self._fax = fax <NEW_LINE> self.__modules = [] <NEW_LINE> self.__def = {} <NEW_LINE> <DEDENT> def _load(self): <NEW_LINE> <INDENT> fax = self._fax <NEW_LINE> for each in self.de... | Package and instance definition only, no state info | 62598ee8d6c5a102081e0803 |
class ComparisonTestFramework(KoriTestFramework): <NEW_LINE> <INDENT> def set_test_params(self): <NEW_LINE> <INDENT> self.num_nodes = 2 <NEW_LINE> self.setup_clean_chain = True <NEW_LINE> <DEDENT> def add_options(self, parser): <NEW_LINE> <INDENT> parser.add_option("--testbinary", dest="testbinary", default=os.getenv("... | Test framework for doing p2p comparison testing
Sets up some korid binaries:
- 1 binary: test binary
- 2 binaries: 1 test binary, 1 ref binary
- n>2 binaries: 1 test binary, n-1 ref binaries | 62598ee8d486a94d0ba2a6a0 |
class SaveHtml: <NEW_LINE> <INDENT> save_path ='' <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> self.save_path = './' + GlobalVal.username <NEW_LINE> if os.path.exists(self.save_path) == False: <NEW_LINE> <INDENT> os.makedirs(self.save_path) <NEW_LINE> <DEDENT> <DEDENT> def save_as_score(self,html): <NEW_LINE> <IN... | 保存原则:
相对路径为"学号/学期/文件名.html"
- 初始化获取学号
- 根据需要获取学期
- 文件名在函数内部赋予 | 62598ee8a17c0f6771d5a926 |
class NST: <NEW_LINE> <INDENT> style_layers = ['block1_conv1', 'block2_conv1', 'block3_conv1', 'block4_conv1', 'block5_conv1'] <NEW_LINE> content_layer = 'block5_conv2' <NEW_LINE> def __init__(self, style_image, content_image, alpha=1e4, beta=1): <NEW_LINE> <INDENT> if (not isinstance(style_image, np.ndarray) or len(st... | class NTS | 62598ee8cb5e8a47e493b4e2 |
class BaseMemoryStore(object): <NEW_LINE> <INDENT> TIMEOUT = 10 <NEW_LINE> DEFAULT_FACTORY = dict <NEW_LINE> def __init__(self, path, memory_size): <NEW_LINE> <INDENT> self.memory_size = memory_size <NEW_LINE> self.path = path <NEW_LINE> self.semaphore = posix_ipc.Semaphore(path, flags=posix_ipc.O_CREAT, initial_value=... | Implements the base of shared memory stores, providing an mmap-ed shared
memory area, a semaphore for controlling access to it, and common logic
to mutate a pickled value in that memory area atomically.
POSIX IPC Message Queues are not used as their default limits under most
kernels are too small (8KB messages and 256... | 62598ee87cff6e4e811b40c0 |
class InterruptReader(object): <NEW_LINE> <INDENT> def __init__(self, fileobj, transfer_coordinator): <NEW_LINE> <INDENT> self._fileobj = fileobj <NEW_LINE> self._transfer_coordinator = transfer_coordinator <NEW_LINE> <DEDENT> def read(self, amount=None): <NEW_LINE> <INDENT> if self._transfer_coordinator.exception: <NE... | Wrapper that can interrupt reading using an error
It uses a transfer coordinator to propagate an error if it notices
that a read is being made while the file is being read from.
:type fileobj: file-like obj
:param fileobj: The file-like object to read from
:type transfer_coordinator: ibm_s3transfer.futures.TransferC... | 62598ee8be383301e0251eac |
class Services: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.services = { "domain": { "name": "Domain", }, "project": { "name": "Project", "displaytext": "Test project", }, "account": { "email": "administrator@clogeny.com", "firstname": "Test", "lastname": "User", "username": "test", "password": "fr... | Test Resource creation Services
| 62598ee8435de62698e9a4a9 |
class OrderColorViewSet(viewsets.ModelViewSet): <NEW_LINE> <INDENT> queryset = OrderColor.objects.all() <NEW_LINE> serializer_class = OrderColorSerializer <NEW_LINE> permission_classes = [IsAuthenticated, ReadOnly] <NEW_LINE> filter_backends = [DjangoFilterBackend] <NEW_LINE> filterset_class = OrderColorFilter <NEW_LIN... | A simple ViewSet for viewing colors, | 62598ee838b623060ffa776c |
class TokenStore(object): <NEW_LINE> <INDENT> def __init__(self, mc): <NEW_LINE> <INDENT> self.memc = mc <NEW_LINE> <DEDENT> @staticmethod <NEW_LINE> def __get_hash(key): <NEW_LINE> <INDENT> return str(hashlib.sha512(key).hexdigest()) <NEW_LINE> <DEDENT> def set(self, key, value, expiration=None): <NEW_LINE> <INDENT> h... | Layer that takes keystone auth tokens and values for superglobal
store | 62598ee863b5f9789fe83830 |
class CurvePoly2d(Operator): <NEW_LINE> <INDENT> bl_description = "Create 2D Poly Vector Mask" <NEW_LINE> bl_idname = "ez_draw.curve_2dpoly" <NEW_LINE> bl_label = "Create 2D Bezier Vector Mask" <NEW_LINE> bl_options = {'REGISTER','UNDO'} <NEW_LINE> @classmethod <NEW_LINE> def poll(self, context): <NEW_LINE> <INDENT> A ... | Curve added and made poly 2d Macro | 62598ee832920d7e50bc46fe |
class WTNoisyOracle(NoisyOracle): <NEW_LINE> <INDENT> def __init__(self, prob): <NEW_LINE> <INDENT> super(WTNoisyOracle, self).__init__(prob) <NEW_LINE> self._promote = 1.1 <NEW_LINE> self._weight = 1 <NEW_LINE> <DEDENT> def update_weight(self, performance): <NEW_LINE> <INDENT> self._weight *= self._promote**(2 * perfo... | The noisy oracle used in the Weighted method.
The noisy oracle keeps a weight based on the history of its predication against the majority. | 62598ee8236d856c2adc877e |
class Topic: <NEW_LINE> <INDENT> def __init__(self, id, name): <NEW_LINE> <INDENT> self.id = id <NEW_LINE> self.name = name | Common base class for all topics | 62598ee84e4d562566370aec |
class MachineInterfacePair(tuple): <NEW_LINE> <INDENT> pass | Encapsulates a (machine, selected interface) pair | 62598ee8adb09d7d5dc08c9b |
class Solution: <NEW_LINE> <INDENT> def searchMatrix(self, matrix, target): <NEW_LINE> <INDENT> if matrix is None or len(matrix) == 0: <NEW_LINE> <INDENT> return 0 <NEW_LINE> <DEDENT> column_index = 0 <NEW_LINE> counts = 0 <NEW_LINE> columns = len(matrix) <NEW_LINE> while column_index < columns and matrix[column_index]... | @param matrix: a list of listed of sorted integers.
[
[a1, a2, a3, ... an],
[b1, b2, b3, ... bn],
[c1, c2, c3, ... cn]
]
a1 <= a2 <= a3 ... <= an
a1 <= b1 <= c1 <= m1
@param target: an integer to ... | 62598ee866673b3332c2ea7b |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.