code stringlengths 4 4.48k | docstring stringlengths 1 6.45k | _id stringlengths 24 24 |
|---|---|---|
class CreateServerResultSet(ResultSet): <NEW_LINE> <INDENT> def getJSONFromString(self, str): <NEW_LINE> <INDENT> return json.loads(str) <NEW_LINE> <DEDENT> def get_Response(self): <NEW_LINE> <INDENT> return self._output.get('Response', None) | A ResultSet with methods tailored to the values returned by the CreateServer Choreo.
The ResultSet object is used to retrieve the results of a Choreo execution. | 62599087aad79263cf43035d |
@dataclass(frozen=True) <NEW_LINE> class Task: <NEW_LINE> <INDENT> text: str <NEW_LINE> aspects: List[str] <NEW_LINE> subtasks: OrderedDict[str, SubTask] <NEW_LINE> @property <NEW_LINE> def indices(self) -> List[Tuple[int, int]]: <NEW_LINE> <INDENT> indices = [] <NEW_LINE> start, end = 0, 0 <NEW_LINE> for subtask in se... | The task keeps text and aspects in the form of
well-prepared tokenized example. The task is to classify
the sentiment of a potentially long text for several aspects.
Even some research presents how to predict several aspects
at once, we process aspects independently. We split the task
into subtasks, where each subtask ... | 625990874c3428357761be5d |
class Tzid(Property): <NEW_LINE> <INDENT> name = 'TZID' <NEW_LINE> valuetype = value.Text() | RFC 5545: Time Zone Identifier
| 6259908771ff763f4b5e9350 |
class FakeConnection(object): <NEW_LINE> <INDENT> def __init__(self, to_recv): <NEW_LINE> <INDENT> self.to_recv = to_recv <NEW_LINE> self.sent = "" <NEW_LINE> self.is_closed = False <NEW_LINE> <DEDENT> def recv(self, number): <NEW_LINE> <INDENT> if number > len(self.to_recv): <NEW_LINE> <INDENT> recv = self.to_recv <NE... | A fake connection class that mimics a real TCP socket for the purpose
of testing socket I/O. | 625990877b180e01f3e49e36 |
class Proyecto(models.Model): <NEW_LINE> <INDENT> nombre= models.CharField(max_length=50, verbose_name='Nombre',unique=True) <NEW_LINE> nombreCorto= models.CharField(max_length=20, verbose_name='Nombre corto',unique=True) <NEW_LINE> descripcion= models.TextField(verbose_name='Descripcion') <NEW_LINE> fecha_ini=models.D... | Clase del Modelo que representa al proyecto con sus atributos.
@cvar nombre: Cadena de caracteres
@cvar siglas: siglas del nombre del proyecto
@cvar descripcion: Un campo de texto
@cvar fecha_ini: Fecha que indica el inicio de un proyecto
@cvar fecha_fin: Fecha que indica el fin estimado de un proyecto
@cvar estado: E... | 62599087283ffb24f3cf5443 |
class VerifyKillActiveVM(pending_action.PendingAction): <NEW_LINE> <INDENT> def retry(self): <NEW_LINE> <INDENT> if (not self._target['id'] in self._state.get_machines().keys()): <NEW_LINE> <INDENT> return False <NEW_LINE> <DEDENT> time_diff = time.time() - self._start_time <NEW_LINE> if time_diff > self._timeout: <NEW... | Verify that server was destroyed | 625990875fc7496912d4903c |
class SwathDefinition(CoordinateDefinition): <NEW_LINE> <INDENT> def __init__(self, lons, lats, nprocs=1): <NEW_LINE> <INDENT> if lons.shape != lats.shape: <NEW_LINE> <INDENT> raise ValueError('lon and lat arrays must have same shape') <NEW_LINE> <DEDENT> elif lons.ndim > 2: <NEW_LINE> <INDENT> raise ValueError('Only 1... | Swath defined by lons and lats
:Parameters:
lons : numpy array
lats : numpy array
nprocs : int, optional
Number of processor cores to be used for calculations.
:Attributes:
shape : tuple
Swath shape
size : int
Number of elements in swath
ndims : int
Swath dimensions
Properties:
lons : object
Swat... | 62599087a8370b77170f1f6f |
class MockRequestResponse: <NEW_LINE> <INDENT> status_code = 200 <NEW_LINE> def raise_for_status(self): <NEW_LINE> <INDENT> return requests.HTTPError <NEW_LINE> <DEDENT> def json(self): <NEW_LINE> <INDENT> return {'query': {'geosearch': [{'pageid': 5611974}]}} | Class to mock a response | 62599087adb09d7d5dc0c0fd |
class Bus_params(Params): <NEW_LINE> <INDENT> def __init__(self,origin, key): <NEW_LINE> <INDENT> Params.__init__(self) <NEW_LINE> self.update_origin(origin) <NEW_LINE> self.update_key(key) <NEW_LINE> <DEDENT> def update_city(self, city): <NEW_LINE> <INDENT> if isinstance(city,dict) and city.__contains__('city'): <NEW_... | 公交参数 | 6259908799fddb7c1ca63bad |
class TestReport: <NEW_LINE> <INDENT> def test_get(self, api_env): <NEW_LINE> <INDENT> client, ihandler = api_env <NEW_LINE> json_report = ihandler.report.shallow_serialize() <NEW_LINE> rsp = client.get("/api/v1/interactive/report") <NEW_LINE> assert rsp.status_code == 200 <NEW_LINE> json_rsp = rsp.get_json() <NEW_LINE... | Test the Report resource. | 625990873346ee7daa338434 |
class WmtTranslate(tfds.core.GeneratorBasedBuilder): <NEW_LINE> <INDENT> _URL = "http://www.statmt.org/wmt18/" <NEW_LINE> @abc.abstractproperty <NEW_LINE> def translate_datasets(self): <NEW_LINE> <INDENT> raise NotImplementedError <NEW_LINE> <DEDENT> def _info(self): <NEW_LINE> <INDENT> src, target = self.builder_confi... | WMT translation dataset. | 62599087e1aae11d1e7cf5e5 |
class SearchTree(AndOrSearchTreeBase): <NEW_LINE> <INDENT> def __init__(self, config: Configuration, root_smiles: str = None) -> None: <NEW_LINE> <INDENT> super().__init__(config, root_smiles) <NEW_LINE> self._mol_nodes: List[MoleculeNode] = [] <NEW_LINE> self._logger = logger() <NEW_LINE> self._root_smiles = root_smil... | Encapsulation of the Depth-First Proof-Number (DFPN) search algorithm.
This algorithm does not support:
1. Filter policy
2. Serialization and deserialization
:ivar config: settings of the tree search algorithm
:ivar root: the root node
:param config: settings of the tree search algorithm
:param root_smiles: ... | 625990878a349b6b43687e02 |
class FuncBose(Func): <NEW_LINE> <INDENT> def eval(self, x): <NEW_LINE> <INDENT> return 1/(exp(x)-1) | Bose function. | 625990874a966d76dd5f0a8a |
class RawCode(RawParagraph): <NEW_LINE> <INDENT> def __init__(self, first_token, text=RawText(), extension='.txt'): <NEW_LINE> <INDENT> RawParagraph.__init__(self, first_token, text) <NEW_LINE> self.extension = extension <NEW_LINE> <DEDENT> def getType(self): <NEW_LINE> <INDENT> return 'code' <NEW_LINE> <DEDENT> def __... | A special paragraph that is rendered as code.
@ivar extension The extension identifying the language. | 625990873317a56b869bf316 |
class SBSPKError(Exception): <NEW_LINE> <INDENT> pass | Exception raised by SBSPK code.
Custom exception allows to differentiate bettewen those intentionaly
raised from SBSPK with raise statement and other errors. This
exception is exposed at module level for convenience, so you can
import it with:
>>> from sbspk import SBSPKError | 625990874c3428357761be5f |
class TestRGB_to_HSV(unittest.TestCase): <NEW_LINE> <INDENT> def test_RGB_to_HSV(self): <NEW_LINE> <INDENT> np.testing.assert_almost_equal( RGB_to_HSV(np.array([0.25000000, 0.60000000, 0.05000000])), np.array([0.27272727, 0.91666667, 0.6]), decimal=7) <NEW_LINE> np.testing.assert_almost_equal( RGB_to_HSV(np.array([0.00... | Defines :func:`colour.models.deprecated.RGB_to_HSV` definition unit tests
methods. | 6259908760cbc95b06365b3e |
class PhotographersHandler(base.APIBaseHandler): <NEW_LINE> <INDENT> def get(self): <NEW_LINE> <INDENT> args = dict() <NEW_LINE> for key, value in self.request.arguments.items(): <NEW_LINE> <INDENT> if key in ('schools', 'themes', 'styles', 'categories'): <NEW_LINE> <INDENT> args[key] = [value] <NEW_LINE> <DEDENT> else... | URL: /photographer
Allowed methods: GET | 625990873346ee7daa338435 |
class EmailLexer(DelegatingLexer): <NEW_LINE> <INDENT> name = "E-mail" <NEW_LINE> aliases = ["email", "eml"] <NEW_LINE> filenames = ["*.eml"] <NEW_LINE> mimetypes = ["message/rfc822"] <NEW_LINE> def __init__(self, **options): <NEW_LINE> <INDENT> super().__init__(EmailHeaderLexer, MIMELexer, Comment, **options) | Lexer for raw E-mail.
Additional options accepted:
`highlight-X-header`
Highlight the fields of ``X-`` user-defined email header. (default:
``False``).
.. versionadded:: 2.5 | 62599087656771135c48ae03 |
class Triangle(Reference): <NEW_LINE> <INDENT> def __init__(self, vertices=((0, 0), (1, 0), (0, 1))): <NEW_LINE> <INDENT> self.tdim = 2 <NEW_LINE> self.name = "triangle" <NEW_LINE> self.origin = vertices[0] <NEW_LINE> self.axes = (vsub(vertices[1], vertices[0]), vsub(vertices[2], vertices[0])) <NEW_LINE> self.reference... | A triangle. | 6259908723849d37ff852c61 |
class DHCPAttacker: <NEW_LINE> <INDENT> def attack(self, dhcp_server_ip): <NEW_LINE> <INDENT> while True: <NEW_LINE> <INDENT> xid_random = random.randint(1, 900000000) <NEW_LINE> mac_random = str(RandMAC()) <NEW_LINE> ether_layer = Ether(src=mac_random, dst='ff:ff:ff:ff:ff:ff') <NEW_LINE> ip_layer = IP(src='0.0.0.0', d... | DHCP Attack
This class supposes that attacker knows the DHCP server address
The sniffing function of the DHCP server address will be added later | 625990875fc7496912d4903e |
class Tag(db.Model): <NEW_LINE> <INDENT> __tablename__ = "tags" <NEW_LINE> id = db.Column(db.Integer, primary_key=True, autoincrement=True) <NEW_LINE> name = db.Column(db.String(50), nullable=False, unique=True) <NEW_LINE> posttags = db.relationship('PostTag', backref='tag', cascade="all, delete", passive_deletes=True)... | Tag. | 625990873346ee7daa338436 |
class BERTEncoder(nn.Block): <NEW_LINE> <INDENT> def __init__(self, vocab_size, num_hiddens, ffn_num_hiddens, num_heads, num_layers, dropout, max_len=1000, **kwargs): <NEW_LINE> <INDENT> super(BERTEncoder, self).__init__(**kwargs) <NEW_LINE> self.token_embedding = nn.Embedding(vocab_size, num_hiddens) <NEW_LINE> self.s... | BERT encoder.
Defined in :numref:`subsec_bert_input_rep` | 62599087283ffb24f3cf5448 |
class StepFcSummary(WizardStep, FORM_CLASS): <NEW_LINE> <INDENT> if_params = None <NEW_LINE> def is_ready_to_next_step(self): <NEW_LINE> <INDENT> return True <NEW_LINE> <DEDENT> def get_next_step(self): <NEW_LINE> <INDENT> new_step = self.parent.step_fc_analysis <NEW_LINE> return new_step <NEW_LINE> <DEDENT> def set_wi... | InaSAFE Wizard Analysis Summary step. | 625990872c8b7c6e89bd538e |
class Canvas(object): <NEW_LINE> <INDENT> def __init__(self, height=None, width=None): <NEW_LINE> <INDENT> self.tag = 'canvas' <NEW_LINE> validate_string_attribute(tag=self.tag, attribute_name='height', attribute_value=height) <NEW_LINE> validate_string_attribute(tag=self.tag, attribute_name='width', attribute_value=wi... | Class for constructing canvas tag.
Args:
height (str): Specifies the height of the canvas.
width (str): Specifies the width of the canvas.
.. versionadded:: 0.1.0
.. versionchanged:: 0.2.0
Renamed the method construct_tag to construct. | 625990874c3428357761be63 |
class ShopCartCommoditySerializer(serializers.ModelSerializer): <NEW_LINE> <INDENT> store = ShopCartStoreSerializer() <NEW_LINE> class Meta: <NEW_LINE> <INDENT> model = Commodity <NEW_LINE> fields = ('id', 'commodity_name', 'price', 'favourable_price', 'intro', 'status', 'little_image', 'store') | 购物车商品序列化器 | 625990877cff6e4e811b75eb |
class ArticleListResource(Resource): <NEW_LINE> <INDENT> method_decorators = [set_db_to_read, validate_token_if_using] <NEW_LINE> def _feed_articles(self, channel_id, feed_count): <NEW_LINE> <INDENT> req = user_reco_pb2.User() <NEW_LINE> if g.user_id: <NEW_LINE> <INDENT> req.user_id = str(g.user_id) <NEW_LINE> <DEDENT>... | 获取推荐文章列表数据 | 6259908763b5f9789fe86d12 |
class Session(requests.Session): <NEW_LINE> <INDENT> def __init__(self, timeout=30, max_retries=1): <NEW_LINE> <INDENT> requests.Session.__init__(self) <NEW_LINE> self.timeout = timeout <NEW_LINE> self.stream = True <NEW_LINE> self.adapters['http://'].max_retries = max_retries <NEW_LINE> self.domain_delay = {} <NEW_LIN... | Subclass of requests Session class which defines some of our own defaults, records unresponsive sites,
and raises errors by default. | 6259908771ff763f4b5e9356 |
class Student(): <NEW_LINE> <INDENT> def __init__(self, firstName, lastName): <NEW_LINE> <INDENT> self.firstName = firstName <NEW_LINE> self.lastName = lastName <NEW_LINE> print("student created:" + self.fullName,self.email) <NEW_LINE> <DEDENT> @property <NEW_LINE> def fullName(self): <NEW_LINE> <INDENT> return f'{self... | A Sample Student class | 6259908723849d37ff852c63 |
class ListTopicPolicyResponse(AbstractModel): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.Topics = None <NEW_LINE> self.RequestId = None <NEW_LINE> <DEDENT> def _deserialize(self, params): <NEW_LINE> <INDENT> if params.get("Topics") is not None: <NEW_LINE> <INDENT> self.Topics = [] <NEW_LINE> for i... | ListTopicPolicy返回参数结构体
| 62599087fff4ab517ebcf3bf |
class CheckACL(Check): <NEW_LINE> <INDENT> def __init__(self, query, ressources, sources, acl, sha1check=True, ipcheck=True): <NEW_LINE> <INDENT> self.sources = sources <NEW_LINE> self.acl = acl <NEW_LINE> self.source = query.source <NEW_LINE> self.ressource = query.ressource <NEW_LINE> self.method = query.method <NEW_... | Checks method and ressources allowances. ACLs are defined
in the acl.yml file.
Right now, if we want to be enable requests that parse all sources,
acl verification MUST be disabled when the source does not match any entry
in the acl file.
Yet, checking methods availability is a good principle.
An equivalent of this che... | 625990875fcc89381b266f32 |
class AudioMessage(DocumentMessage): <NEW_LINE> <INDENT> def __init__( self, file_id=None, file_path=None, file_url=None, file_content=None, file_mime=None, caption=None, receiver=None, reply_id=DEFAULT_MESSAGE_ID, reply_markup=None, disable_notification=False ): <NEW_LINE> <INDENT> super().__init__( file_id=file_id, f... | send an audio file | 6259908797e22403b383caa2 |
class AgentModule(ModuleBase): <NEW_LINE> <INDENT> CONFIG_SCHEMA = Schema({ 'module': 'six_dns_discover', 'delay': int }) <NEW_LINE> def __init__(self): <NEW_LINE> <INDENT> super().__init__() <NEW_LINE> self.loop = True <NEW_LINE> <DEDENT> def run(self, assignment): <NEW_LINE> <INDENT> super().run(assignment) <NEW_LINE... | dns based ipv6 from ipv4 address discover
## target specification
target = IPv4Address | 6259908763b5f9789fe86d14 |
class Response: <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.status = "200 OK" <NEW_LINE> self.headers = HeaderDict({"content-type": "text/html; charset=UTF-8"}) <NEW_LINE> self.cookies = SimpleCookie() <NEW_LINE> <DEDENT> def set_content_type(self, type_): <NEW_LINE> <INDENT> self.headers["content-... | Describes an HTTP response. Currently very simple since the actual body
of the request is handled separately. | 625990877b180e01f3e49e3a |
class FixedFilterAction(FilterAction): <NEW_LINE> <INDENT> def __init__(self, **kwargs): <NEW_LINE> <INDENT> super().__init__(**kwargs) <NEW_LINE> self.filter_type = kwargs.get('filter_type', "fixed") <NEW_LINE> self.needs_preloading = kwargs.get('needs_preloading', True) <NEW_LINE> self.fixed_buttons = self.get_fixed_... | A filter action with fixed buttons. | 62599087adb09d7d5dc0c105 |
class TestGeneticAlgorithm(unittest.TestCase): <NEW_LINE> <INDENT> def test_yields_starting_population(self): <NEW_LINE> <INDENT> start_pop = [3, 2, 1] <NEW_LINE> ga = genetic_algorithm(start_pop, None, None, None) <NEW_LINE> self.assertEqual(ga.next(), start_pop, "Starting population not yielded as first result.") <NE... | Ensures the genetic_algorithm generator function works as expected. | 62599087099cdd3c636761d0 |
class AbstractJoke: <NEW_LINE> <INDENT> def __init__(self, idnum=0, label='', avRating=0, text=''): <NEW_LINE> <INDENT> self._idnum = idnum <NEW_LINE> self._label = label <NEW_LINE> self._avRating = avRating <NEW_LINE> self._text = text <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> return "Joke ID: {0}\nCa... | This class is for a representation of a basic joke | 62599087656771135c48ae06 |
class BoundedDummy(Parser): <NEW_LINE> <INDENT> def parse(self, reader): <NEW_LINE> <INDENT> self.parseending(reader, lambda: reader.nextline()) <NEW_LINE> reader.nextline() <NEW_LINE> return [] | A bound parser that ignores everything | 62599088167d2b6e312b836d |
class RidgeRegression(BaseEstimator, RegressorMixin): <NEW_LINE> <INDENT> def __init__(self, l2_reg=1, step_size=.005, max_num_epochs = 5000): <NEW_LINE> <INDENT> self.max_num_epochs = max_num_epochs <NEW_LINE> self.step_size = step_size <NEW_LINE> self.l2_reg=l2_reg <NEW_LINE> self.x = nodes.ValueNode(node_name="x") ... | Ridge regression with computation graph | 625990883617ad0b5ee07cfd |
class Customer(Process): <NEW_LINE> <INDENT> def visit(self, timeInBank): <NEW_LINE> <INDENT> print("%8.4f %s: Arrived " % (now(), self.name)) <NEW_LINE> yield request, self, counter <NEW_LINE> print("%8.4f %s: Got counter " % (now(), self.name)) <NEW_LINE> tib = expovariate(1.0 / timeInBank) <NEW_LINE> yield hold,... | Customer arrives, is served and leaves | 625990883317a56b869bf31a |
class Address(models.Model): <NEW_LINE> <INDENT> addr = models.CharField(max_length=40, blank=True) <NEW_LINE> macaddr = models.CharField(max_length=17, blank=True) <NEW_LINE> allocated = models.BooleanField(default=False) <NEW_LINE> pool = models.ForeignKey(Pool, blank=True, null=True) <NEW_LINE> host = models.Foreign... | Represent a network address. | 6259908897e22403b383caa4 |
class InventoryWindow(pgu.gui.Container): <NEW_LINE> <INDENT> def __init__(self, application, surface_manager, **params): <NEW_LINE> <INDENT> super(InventoryWindow, self).__init__(**params) <NEW_LINE> self.running = 1 <NEW_LINE> self.selection = 0 <NEW_LINE> self.application = application <NEW_LINE> self.surface_manag... | Inventory window
.. versionadded:: 0.4 | 6259908826068e7796d4e4ee |
class RequestHandler: <NEW_LINE> <INDENT> def __init__(self, header:dict, targetUrl:str, filterTag:str, httpHandler:httplib2.Http, httpRequestType:str, debugPrint:bool): <NEW_LINE> <INDENT> self.header=header <NEW_LINE> self.targetUrl=targetUrl <NEW_LINE> self.filterTag=filterTag.strip() <NEW_LINE> self.requestType=htt... | classdocs
This class does not do any I/O operations
It does not create a html file output. This can be done somewhere else
It's focus is on request handling
it's also designed to handle multiple request to the same target.
This can be defined in the "run" method. | 6259908871ff763f4b5e935a |
class InvalidParse(Exception): <NEW_LINE> <INDENT> pass | Superclass for all parsing errors | 62599088dc8b845886d55166 |
class AccountStockAngloSaxonTestCase(unittest.TestCase): <NEW_LINE> <INDENT> def setUp(self): <NEW_LINE> <INDENT> trytond.tests.test_tryton.install_module('account_stock_anglo_saxon') <NEW_LINE> <DEDENT> def test0005views(self): <NEW_LINE> <INDENT> test_view('account_stock_anglo_saxon') <NEW_LINE> <DEDENT> def test0006... | Test Account Stock Anglo Saxon module. | 62599088283ffb24f3cf544d |
class user_device_debug(object): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined") <NEW_LINE> __repr__ = _swig_repr <NEW_LINE> def make(*args, **kwargs... | <+description of block+> | 625990885fc7496912d49041 |
class broadcast(object): <NEW_LINE> <INDENT> def __init__(self, *arrays): <NEW_LINE> <INDENT> ndarray = cupy.ndarray <NEW_LINE> rev = slice(None, None, -1) <NEW_LINE> shape_arr = [a._shape[rev] for a in arrays if isinstance(a, ndarray)] <NEW_LINE> r_shape = [max(ss) for ss in zip_longest(*shape_arr, fillvalue=0)] <NEW_... | Object that performs broadcasting.
CuPy actually uses this class to support broadcasting in various
operations. Note that this class does not provide an iterator.
Args:
arrays (tuple of arrays): Arrays to be broadcasted.
Attributes:
shape (tuple of ints): The broadcasted shape.
nd (int): Number of dimens... | 62599088bf627c535bcb3081 |
class ZeroConfService: <NEW_LINE> <INDENT> def __init__(self, name, port, stype="_http._tcp", domain="", host="", text=""): <NEW_LINE> <INDENT> self.name = name <NEW_LINE> self.stype = stype <NEW_LINE> self.domain = domain <NEW_LINE> self.host = host <NEW_LINE> self.port = port <NEW_LINE> self.text = text <NEW_LINE> <D... | A simple class to publish a network service with zeroconf using
avahi.
Shamelessly stolen from http://stackp.online.fr/?p=35 | 62599088aad79263cf430368 |
@skip_doctest <NEW_LINE> class link(object): <NEW_LINE> <INDENT> updating = False <NEW_LINE> def __init__(self, *args): <NEW_LINE> <INDENT> if len(args) < 2: <NEW_LINE> <INDENT> raise TypeError('At least two traitlets must be provided.') <NEW_LINE> <DEDENT> self.objects = {} <NEW_LINE> initial = getattr(args[0][0], arg... | Link traits from different objects together so they remain in sync.
Parameters
----------
obj : pairs of objects/attributes
Examples
--------
>>> c = link((obj1, 'value'), (obj2, 'value'), (obj3, 'value'))
>>> obj1.value = 5 # updates other objects as well | 625990883317a56b869bf31b |
class StructTest2(StructTestFunction): <NEW_LINE> <INDENT> def f(self, x): <NEW_LINE> <INDENT> return (x - 30) * numpy.sin(x) <NEW_LINE> <DEDENT> def g(x): <NEW_LINE> <INDENT> return 58 - numpy.sum(x, axis=0) <NEW_LINE> <DEDENT> cons = wrap_constraints(g) | Scalar function with several minima to test all minimizer retrievals | 62599088d486a94d0ba2db64 |
class UploadWidget(TypesWidget): <NEW_LINE> <INDENT> _properties = TypesWidget._properties.copy() <NEW_LINE> _properties.update({ 'macro': "upload_widget", 'helper_js': ( '++resource++cs.pfg.multifile.jqueryfiler/js/jquery.filer.min.js', ), 'helper_css': ( '++resource++cs.pfg.multifile.jqueryfiler/css/jquery.filer.css'... | Quick Upload Widget via drag&drop.
Custom properties:
mediaupload -- Allowed file extensions e.g.: '*.gif; *.tif; *.jpg',
empty for all.
Default: '*.txt; *.csv; *.tsv; *.tab' | 6259908855399d3f056280c3 |
class GephiGraphMLWriter(GraphMLWriter): <NEW_LINE> <INDENT> def get_key(self, name, attr_type, scope, default): <NEW_LINE> <INDENT> keys_key = (name, attr_type, scope) <NEW_LINE> try: <NEW_LINE> <INDENT> return self.keys[keys_key] <NEW_LINE> <DEDENT> except KeyError: <NEW_LINE> <INDENT> if name in NAMED_ATTR: <NEW_LIN... | Customized GraphML writer for gephi compatibility | 62599088091ae356687067f1 |
class RouteGuideServicer(route_guide_pb2_grpc.RouteGuideServicer): <NEW_LINE> <INDENT> routes = [] <NEW_LINE> 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,... | Provides methods that implement functionality of route guide server. | 62599088a8370b77170f1f7b |
class itkHausdorffDistanceImageFilterIF2IF2(itkImageToImageFilterAPython.itkImageToImageFilterIF2IF2): <NEW_LINE> <INDENT> thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag') <NEW_LINE> def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined"... | Proxy of C++ itkHausdorffDistanceImageFilterIF2IF2 class | 62599088a05bb46b3848befe |
class BadReturn(Exception): <NEW_LINE> <INDENT> pass | Bad return from subprocess. | 625990887047854f46340f65 |
class TxCoat(Coat): <NEW_LINE> <INDENT> def pack(self): <NEW_LINE> <INDENT> self.packed = '' <NEW_LINE> ck = self.packet.data['ck'] <NEW_LINE> if ck == raeting.coatKinds.nacl: <NEW_LINE> <INDENT> msg = self.packet.body.packed <NEW_LINE> if msg: <NEW_LINE> <INDENT> cipher, nonce = self.packet.encrypt(msg) <NEW_LINE> sel... | RAET protocol tx packet coat class | 625990888a349b6b43687e0e |
class StatusMixin: <NEW_LINE> <INDENT> id = sa.Column(sa.Integer, primary_key=True) <NEW_LINE> status = sa.Column(sa.String(40), nullable=False) <NEW_LINE> timestamp = sa.Column(sa.DateTime, nullable=False, default=datetime.datetime.utcnow) <NEW_LINE> comment = sa.Column(sa.Text) <NEW_LINE> @declared_attr <NEW_LINE> de... | Generic mixin to create status relations for stateful records. | 625990884a966d76dd5f0a96 |
class WebhookFlowHandler(config_entries.ConfigFlow): <NEW_LINE> <INDENT> VERSION = 1 <NEW_LINE> def __init__( self, domain: str, title: str, description_placeholder: dict, allow_multiple: bool, ) -> None: <NEW_LINE> <INDENT> self._domain = domain <NEW_LINE> self._title = title <NEW_LINE> self._description_placeholder =... | Handle a webhook config flow. | 625990883317a56b869bf31c |
class TestHdfsInotifySettings(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 testHdfsInotifySettings(self): <NEW_LINE> <INDENT> pass | HdfsInotifySettings unit test stubs | 6259908897e22403b383caa7 |
class Ingredient(models.Model): <NEW_LINE> <INDENT> name = models.CharField(max_length=255) <NEW_LINE> user = models.ForeignKey( settings.AUTH_USER_MODEL, on_delete=models.CASCADE ) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | Ingredient to be userd in a recipe | 62599088a05bb46b3848beff |
class CIDARProduct(modules.Product): <NEW_LINE> <INDENT> cutter = BbsI | A CIDAR MoClo product.
| 62599088099cdd3c636761d3 |
class DeleteRecordingInputSet(InputSet): <NEW_LINE> <INDENT> def set_AccountSID(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AccountSID', value) <NEW_LINE> <DEDENT> def set_AuthToken(self, value): <NEW_LINE> <INDENT> InputSet._set_input(self, 'AuthToken', value) <NEW_LINE> <DEDENT> def set_RecordingSID(... | An InputSet with methods appropriate for specifying the inputs to the DeleteRecording
Choreo. The InputSet object is used to specify input parameters when executing this Choreo. | 62599088aad79263cf43036c |
class GameScoreboard(object): <NEW_LINE> <INDENT> def __init__(self, data): <NEW_LINE> <INDENT> for x in data: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> setattr(self, x, int(data[x])) <NEW_LINE> <DEDENT> except ValueError: <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> setattr(self, x, float(data[x])) <NEW_LINE> <DEDE... | Object to hold scoreboard information about a certain game.
Properties:
away_team
away_team_errors
away_team_hits
away_team_runs
date
game_id
game_league
game_start_time
game_status
game_tag
home_team
home_team_errors
home_team_hits
home_team_runs
l_pitcher
... | 625990888a349b6b43687e10 |
class GroupsRenameRequest(ChannelsRenameRequest): <NEW_LINE> <INDENT> pass | Request for :meth:`~aioslackbot.GroupsModule.rename`. | 625990887cff6e4e811b75f5 |
class WqmAuthority(WqmLocation): <NEW_LINE> <INDENT> domain = models.OneToOneField('domain.Domain', unique=True) <NEW_LINE> dialing_code = models.CharField(max_length=5) <NEW_LINE> gmt_offset = models.IntegerField(default=0) <NEW_LINE> def __unicode__(self): <NEW_LINE> <INDENT> return self.domain.name | E.g. a district | 6259908871ff763f4b5e9360 |
class WeightedIntegerVectors_all(DisjointUnionEnumeratedSets): <NEW_LINE> <INDENT> def __init__(self, weights): <NEW_LINE> <INDENT> self._weights = weights <NEW_LINE> from sage.sets.all import Family, NonNegativeIntegers <NEW_LINE> from functools import partial <NEW_LINE> F = Family(NonNegativeIntegers(), partial(Weigh... | Set of weighted integer vectors.
EXAMPLES::
sage: W = WeightedIntegerVectors([3,1,1,2,1]); W
Integer vectors weighted by [3, 1, 1, 2, 1]
sage: W.cardinality()
+Infinity
sage: W12 = W.graded_component(12)
sage: W12.an_element()
[4, 0, 0, 0, 0]
sage: W12.last()
[0, 12, 0, 0, 0]
... | 625990885fc7496912d49044 |
class VirtualMachineScaleSetManagedDiskParameters(Model): <NEW_LINE> <INDENT> _attribute_map = { 'storage_account_type': {'key': 'storageAccountType', 'type': 'StorageAccountTypes'}, } <NEW_LINE> def __init__(self, storage_account_type=None): <NEW_LINE> <INDENT> super(VirtualMachineScaleSetManagedDiskParameters, self).... | Describes the parameters of a ScaleSet managed disk.
:param storage_account_type: Specifies the storage account type for the
managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible
values include: 'Standard_LRS', 'Premium_LRS'
:type storage_account_type: str or
~azure.mgmt.compute.v2017_12_01.model... | 625990887b180e01f3e49e3e |
class PycodestyleTool(BaseTool): <NEW_LINE> <INDENT> name = 'pycodestyle' <NEW_LINE> version = '1.0' <NEW_LINE> description = 'Checks Python code for style errors.' <NEW_LINE> timeout = 30 <NEW_LINE> exe_dependencies = ['pycodestyle'] <NEW_LINE> file_patterns = ['*.py'] <NEW_LINE> options = [ { 'name': 'max_line_length... | Review Bot tool to run pycodestyle. | 625990883346ee7daa33843c |
class PrimaryKey(Property): <NEW_LINE> <INDENT> def __init__(self, transform=None, name='id', attr_name=None): <NEW_LINE> <INDENT> super(PrimaryKey, self).__init__(name=name, attr_name=attr_name) <NEW_LINE> self.transform = transform or transform_for('string') | Represents an identifier of a resource. | 62599088656771135c48ae0a |
class Category(models.Model): <NEW_LINE> <INDENT> name = models.CharField('类型', max_length=20) <NEW_LINE> created_time = models.DateTimeField('创建时间', auto_now_add=True) <NEW_LINE> last_modified_time = models.DateTimeField('修改时间', auto_now=True) <NEW_LINE> def __str__(self): <NEW_LINE> <INDENT> return self.name | 文章类型 | 6259908892d797404e389936 |
class DjrillApiMixin(object): <NEW_LINE> <INDENT> def __init__(self, *args, **kwargs): <NEW_LINE> <INDENT> self.api_key = getattr(settings, "MANDRILL_API_KEY", None) <NEW_LINE> self.api_url = getattr(settings, "MANDRILL_API_URL", None) <NEW_LINE> if not self.api_key: <NEW_LINE> <INDENT> raise ImproperlyConfigured("You ... | Simple Mixin to grab the api info from the settings file. | 625990883617ad0b5ee07d05 |
class RemoteUserPolicy(IdentityBasedPolicy): <NEW_LINE> <INDENT> def identity(self, request): <NEW_LINE> <INDENT> user_id = request.environ.get("HTTP_X_FORWARDED_USER") <NEW_LINE> if not user_id: <NEW_LINE> <INDENT> return None <NEW_LINE> <DEDENT> user = request.find_service(name="user").fetch(user_id) <NEW_LINE> if us... | An authentication policy which blindly trusts a header.
This is enabled by setting `h.proxy_auth` in the config as described in
`h.security`. | 6259908826068e7796d4e4f6 |
class Rectangle: <NEW_LINE> <INDENT> pass | function that create empty class | 62599088a8370b77170f1f81 |
class Crawler(): <NEW_LINE> <INDENT> def __init__(self, que, visited, news, rlock): <NEW_LINE> <INDENT> self.que = que <NEW_LINE> self.visited = visited <NEW_LINE> self.rlock = rlock <NEW_LINE> self.news = news <NEW_LINE> <DEDENT> def get_re_string(self): <NEW_LINE> <INDENT> date_string = time.strftime("/%y/%m%d/") <NE... | the Crawler | 62599088283ffb24f3cf5455 |
class Term(object): <NEW_LINE> <INDENT> def __init__(self, *, a=0, b=0, c=0, output_queue=""): <NEW_LINE> <INDENT> self.a = a <NEW_LINE> self.b = b <NEW_LINE> self.c = c <NEW_LINE> self.output_queue = output_queue <NEW_LINE> <DEDENT> def calculate(self, x): <NEW_LINE> <INDENT> return self.a * x ** 2 + self.b * x + self... | The actual calculation | 62599088adb09d7d5dc0c10f |
class Downloader: <NEW_LINE> <INDENT> def _download_file(self, url: str, filename: str) -> None: <NEW_LINE> <INDENT> with requests.get(url, stream=True) as response: <NEW_LINE> <INDENT> response.raise_for_status() <NEW_LINE> with open(filename, "wb") as json_file: <NEW_LINE> <INDENT> for chunk in response.iter_content(... | Download files needed for this application to run properly. | 625990885fdd1c0f98e5fb2f |
class ItemDetail(APIView): <NEW_LINE> <INDENT> authentication_classes = (BasicAuthentication,) <NEW_LINE> permission_classes = (IsAuthenticated,) <NEW_LINE> parser_classes = (JSONParser,) <NEW_LINE> def get_object(self, pk): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> return Item.objects.get(pk=pk) <NEW_LINE> <DEDENT>... | Retrieve, update or delete a item instance. | 625990884c3428357761be71 |
class DeleteTest(storage_test.BaseRenewableCertTest): <NEW_LINE> <INDENT> def _call(self): <NEW_LINE> <INDENT> from certbot._internal import cert_manager <NEW_LINE> cert_manager.delete(self.config) <NEW_LINE> <DEDENT> @test_util.patch_get_utility() <NEW_LINE> @mock.patch('certbot._internal.cert_manager.lineage_for_cert... | Tests for certbot._internal.cert_manager.delete
| 6259908863b5f9789fe86d1f |
class GateSetupService(Service): <NEW_LINE> <INDENT> def __init__(self, bus): <NEW_LINE> <INDENT> Service.__init__(self, bus, UUID_GATESETUP_SERVICE) <NEW_LINE> self.add_characteristic(InternetConnectedCharacteristic(self)) <NEW_LINE> self.add_characteristic(SSIDsCharacteristic(self)) <NEW_LINE> self.add_characteristic... | Service that exposes Gate Device Information and allows for the Setup | 625990883617ad0b5ee07d07 |
class Event(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self._value = False <NEW_LINE> self._waiters = set() <NEW_LINE> <DEDENT> def __repr__(self): <NEW_LINE> <INDENT> return '<%s %s>' % ( self.__class__.__name__, 'set' if self.is_set() else 'clear') <NEW_LINE> <DEDENT> def is_set(self): <NEW_... | An event blocks coroutines until its internal flag is set to True.
Similar to `threading.Event`.
A coroutine can wait for an event to be set. Once it is set, calls to
``yield event.wait()`` will not block unless the event has been cleared:
.. testcode::
from tornado import gen
from tornado.ioloop import IOL... | 6259908823849d37ff852c71 |
class CameraDownloader(object): <NEW_LINE> <INDENT> def __init__(self, dir=None): <NEW_LINE> <INDENT> self.dir = dir or os.path.join(os.path.expanduser("~"), "photopoof") <NEW_LINE> print("Saving new photos to {}".format(self.dir)) <NEW_LINE> self.camera = gp.Camera() <NEW_LINE> try: <NEW_LINE> <INDENT> self.camera.ini... | Watches for photos taken and downloads image | 625990887c178a314d78e9c5 |
class LocaleSettings(threading.local): <NEW_LINE> <INDENT> locale = None <NEW_LINE> localizer = None | Language resolution.
| 62599088091ae356687067f9 |
class TestConfig(EnvironmentConfig): <NEW_LINE> <INDENT> def __init__(self, args, command): <NEW_LINE> <INDENT> super().__init__(args, command) <NEW_LINE> self.coverage = args.coverage <NEW_LINE> self.coverage_check = args.coverage_check <NEW_LINE> self.include = args.include or [] <NEW_LINE> self.exclude = args.exclud... | Configuration common to all test commands. | 62599088fff4ab517ebcf3cd |
class School(db.Model): <NEW_LINE> <INDENT> id = db.Column(db.Integer, primary_key=True) <NEW_LINE> name = db.Column(db.String(32), index=True, unique=True) <NEW_LINE> level = db.Column(db.String(32)) <NEW_LINE> start_date = db.Column(db.DateTime) <NEW_LINE> end_date = db.Column(db.DateTime) <NEW_LINE> attending = db.C... | A School is a single institution.
Schools are many-to-many with Users.
Schools are one-to-one with Addresses.
Schools are one-to-many with Courses. | 625990887b180e01f3e49e40 |
class Solution45: <NEW_LINE> <INDENT> @staticmethod <NEW_LINE> def jump(nums: List[int]) -> int: <NEW_LINE> <INDENT> n = len(nums) <NEW_LINE> max_pos, end, step = 0, 0, 0 <NEW_LINE> for i in range(n - 1): <NEW_LINE> <INDENT> if max_pos >= i: <NEW_LINE> <INDENT> max_pos = max(max_pos, i + nums[i]) <NEW_LINE> if i == end... | 45. 跳跃游戏 II
https://leetcode-cn.com/problems/jump-game-ii/
给你一个非负整数数组 nums ,你最初位于数组的第一个位置。
数组中的每个元素代表你在该位置可以跳跃的最大长度。
你的目标是使用最少的跳跃次数到达数组的最后一个位置。
假设你总是可以到达数组的最后一个位置。
nums = [2,3,1,1,4]
跳到最后一个位置的最小跳跃数是 2。
从下标为 0 跳到下标为 1 的位置,跳 1 步,然后跳 3 步到达数组的最后一个位置。 | 62599088bf627c535bcb308b |
class TVMArray(ctypes.Structure): <NEW_LINE> <INDENT> _fields_ = [("data", ctypes.c_void_p), ("ctx", TVMContext), ("ndim", ctypes.c_int), ("dtype", TVMType), ("shape", ctypes.POINTER(tvm_shape_index_t)), ("strides", ctypes.POINTER(tvm_shape_index_t)), ("byte_offset", ctypes.c_uint64), ("time_stamp", ctypes.c_uint64)] | TVMValue in C API | 625990885fdd1c0f98e5fb31 |
class TestGlueJob(unittest.TestCase): <NEW_LINE> <INDENT> @classmethod <NEW_LINE> def setUpClass(cls): <NEW_LINE> <INDENT> S3_MOCK_ENDPOINT = "http://127.0.0.1:5000" <NEW_LINE> cls.process = subprocess.Popen( ['moto_server', 's3'], stdout=subprocess.PIPE, shell=True, creationflags=subprocess.CREATE_NEW_PROCESS_GROUP ) ... | This test class setup a test environment to test our glue job,
runs the glue job and checks the result. | 62599088ec188e330fdfa465 |
class IDManager: <NEW_LINE> <INDENT> title = "url" <NEW_LINE> extract = lambda url : int( url.split('/')[-1] ) <NEW_LINE> reconstruct = lambda n : 'http://X/view_record/' + str(n) | define some behaviour to be applied over the table uid | 6259908892d797404e389938 |
class CmdPose(COMMAND_DEFAULT_CLASS): <NEW_LINE> <INDENT> key = "pose" <NEW_LINE> aliases = [":", "emote"] <NEW_LINE> locks = "cmd:all()" <NEW_LINE> def parse(self): <NEW_LINE> <INDENT> args = self.args <NEW_LINE> if args and not args[0] in ["'", ",", ":"]: <NEW_LINE> <INDENT> args = " %s" % args.strip() <NEW_LINE> <DE... | strike a pose
Usage:
pose <pose text>
pose's <pose text>
Example:
pose is standing by the wall, smiling.
-> others will see:
Tom is standing by the wall, smiling.
Describe an action being taken. The pose text will
automatically begin with your name. | 625990888a349b6b43687e16 |
class AuditedModel(models.Model): <NEW_LINE> <INDENT> create_at = models.DateTimeField(auto_now_add=True) <NEW_LINE> create_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.PROTECT, related_name='%(class)s_create', null=True, blank=True) <NEW_LINE> update_at = models.DateTimeField(auto_now=True) <NEW_L... | CHECK IF THIS IS TRUE
CAVEAT 1:
If using a custom user model, add the following line to the top:
from api.models.user_profile import User # noqa: F401
It's needed for get_model in settings.
CAVEAT 2:
All api calls that add or edit a line to your database should be Authenticated.
If you're not doing that then you are ... | 62599088091ae356687067fb |
class QuizDetailView(APIView): <NEW_LINE> <INDENT> def get(self, request, quiz_id, format=None): <NEW_LINE> <INDENT> try: <NEW_LINE> <INDENT> quiz = Quiz.objects.get(pk=quiz_id) <NEW_LINE> <DEDENT> except Quiz.DoesNotExist: <NEW_LINE> <INDENT> raise Http404 <NEW_LINE> <DEDENT> serializer = serializers.QuizSerializer(qu... | GET, POST and PUT APIs for individual quizzes | 625990887b180e01f3e49e41 |
class EpisodeCountQuestion(QuestionTemplate): <NEW_LINE> <INDENT> regex = ((Lemmas("how many episode do") + TvShow() + Lemma("have")) | (Lemma("number") + Pos("IN") + Lemma("episode") + Pos("IN") + TvShow())) + Question(Pos(".")) <NEW_LINE> def interpret(self, match): <NEW_LINE> <INDENT> number_of_episodes =... | Ex: "How many episodes does Seinfeld have?"
"Number of episodes of Seinfeld" | 625990885fcc89381b266f3a |
class EC2APSENodeDriver(EC2NodeDriver): <NEW_LINE> <INDENT> _datacenter = 'ap-southeast-1' | Driver class for EC2 in the Southeast Asia Pacific Region. | 625990885fdd1c0f98e5fb33 |
class Message(object): <NEW_LINE> <INDENT> def __init__(self, subject, recipients=None, body=None, html=None, sender=None, cc=None, bcc=None, attachments=None, reply_to=None): <NEW_LINE> <INDENT> if sender is None: <NEW_LINE> <INDENT> app = _request_ctx_stack.top.app <NEW_LINE> sender = app.config.get("DEFAULT_MAIL_SEN... | Encapsulates an email message.
:param subject: email subject header
:param recipients: list of email addresses
:param body: plain text message
:param html: HTML message
:param sender: email sender address, or **DEFAULT_MAIL_SENDER** by default
:param cc: CC list
:param bcc: BCC list
:param attachments: list of Attachm... | 62599088167d2b6e312b8374 |
class Application(Frame): <NEW_LINE> <INDENT> def __init__(self, master): <NEW_LINE> <INDENT> super(Application, self).__init__(master) <NEW_LINE> self.grid() <NEW_LINE> self.create_widgets() <NEW_LINE> <DEDENT> def create_widgets(self): <NEW_LINE> <INDENT> self.label = Label(self, text="To view the secret: enter the p... | GUI application that reveals the secret to longevity. | 6259908826068e7796d4e4fc |
class Mouse(Point): <NEW_LINE> <INDENT> def __init__(self, canvas, x=0, y=0): <NEW_LINE> <INDENT> Point.__init__(self, x, y) <NEW_LINE> self._canvas = canvas <NEW_LINE> self._cursor = DEFAULT <NEW_LINE> self._button = None <NEW_LINE> self.modifiers = [] <NEW_LINE> self.pressed = False <NEW_LINE> self.dragged = False <N... | Keeps track of the mouse position on the canvas, buttons pressed and the cursor icon.
| 62599088be7bc26dc9252c33 |
class AxisCalibrationWidget(QtWidgets.QWidget): <NEW_LINE> <INDENT> def __init__(self, parent=None): <NEW_LINE> <INDENT> QtWidgets.QWidget.__init__(self, parent) <NEW_LINE> self.main_layout = QtWidgets.QGridLayout(self) <NEW_LINE> self.limits = [0, 0, 0] <NEW_LINE> self.slider = QtWidgets.QProgressBar() <NEW_LINE> self... | Widget displaying calibration information about a single axis. | 6259908871ff763f4b5e9368 |
class TestFindCustomFieldByLabel(object): <NEW_LINE> <INDENT> def test_happy_path(self, single_fail_xml, mocker): <NEW_LINE> <INDENT> mock_field_resp = mocker.Mock(spec=swagger_client.FieldResource) <NEW_LINE> mock_field_resp.id = 12345 <NEW_LINE> mock_field_resp.label = 'Failure Output' <NEW_LINE> mocker.patch('swagge... | Test cases for find_custom_field_by_label() | 62599088ad47b63b2c5a940e |
class DoctorUserForm(forms.ModelForm): <NEW_LINE> <INDENT> password = forms.CharField(widget=forms.PasswordInput(render_value = True)) <NEW_LINE> def clean_username(self): <NEW_LINE> <INDENT> username = self.cleaned_data['username'] <NEW_LINE> if User.objects.exclude(pk=self.instance.pk).filter(username=username).exist... | Doctor form used for the updating the doctors user information | 625990888a349b6b43687e1a |
class ObjectOriented(object): <NEW_LINE> <INDENT> def __init__(self): <NEW_LINE> <INDENT> self.edges = [] <NEW_LINE> self.nodes = [] <NEW_LINE> <DEDENT> def neighbors(self, node): <NEW_LINE> <INDENT> neighbor = [] <NEW_LINE> for edge in self.edges: <NEW_LINE> <INDENT> if node['id'] is edge.from_node['id']: <NEW_LINE> <... | ObjectOriented defines the edges and nodes as both list | 625990884c3428357761be77 |
class ErroSemantico(Error): <NEW_LINE> <INDENT> def __init__(self, msg): <NEW_LINE> <INDENT> self.msg = msg <NEW_LINE> <DEDENT> def __str__(self): <NEW_LINE> <INDENT> vermelho = '\033[31m' <NEW_LINE> original = '\033[0;0m' <NEW_LINE> erro = vermelho + "Erro Semantico: " <NEW_LINE> erro += original <NEW_LINE> erro += '\... | Exceções levantadas por error semanticos
tpl -- tupla com linha e coluna onde ocorreu o erro
msg -- explicação do erro | 62599088aad79263cf430377 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.