query stringlengths 9 3.4k | document stringlengths 9 87.4k | metadata dict | negatives listlengths 4 101 | negative_scores listlengths 4 101 | document_score stringlengths 3 10 | document_rank stringclasses 102
values |
|---|---|---|---|---|---|---|
Append data objects from inputs sequentially. | def run(self):
for pipe in self.inputs:
for row in pipe.rows():
self.put(row) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def collect_incoming_data(self, data):\n self.__input.append(data)",
"def add_inputs(self, inputs):\n self.inputs += inputs",
"def extend(self, inputs: Iterable[I]):\n for inp in inputs:\n self.append(inp)",
"def queue_inputs(self, iterable):\n self.input_queue.extend(ite... | [
"0.6698946",
"0.66694754",
"0.6579374",
"0.6272177",
"0.6267313",
"0.5941637",
"0.59247345",
"0.5784583",
"0.57808334",
"0.5775148",
"0.5749951",
"0.57222944",
"0.5669739",
"0.5658779",
"0.565531",
"0.56387484",
"0.56292886",
"0.56286275",
"0.5578917",
"0.55706185",
"0.549469... | 0.56872743 | 12 |
Only inner join is implemented | def run(self):
# First, read details, then master. )
for (tag, pipe) in self.detail_inputs:
detail = self._input_rows[tag]
key_indexes = self._kindexes[tag][0]
self._read_input(tag, pipe, key_indexes, detail)
rfilter = self._filters.get(self.master)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def join_where(self, table, one, operator, two, type='inner'):\n return self.join(table, one, operator, two, type, True)",
"def join(self, table: Union[str, sa.Table], left_where: Union[str, sa.Column, BinaryExpression], right_where: Union[str, sa.Column] = None, alias: str = None, method: str = 'join') -... | [
"0.6633557",
"0.6143612",
"0.6083737",
"0.60504377",
"0.5984987",
"0.5892873",
"0.58415437",
"0.58297783",
"0.57669604",
"0.5747228",
"0.574268",
"0.5723689",
"0.5596938",
"0.55145305",
"0.5498612",
"0.5478931",
"0.5381805",
"0.5364907",
"0.53329146",
"0.5328448",
"0.5295928"... | 0.0 | -1 |
Creates a node that will pass distinct records with given distinct fields. | def __init__(self, distinct_fields = None, discard = False):
super(DistinctNode, self).__init__()
if distinct_fields:
self.distinct_fields = distinct_fields
else:
self.distinct_fields = []
self.discard = discard | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_fields_unique(self, fields):\n ...",
"def distinct(self, *field_names):\n self._not_support_combined_queries(\"distinct\")\n if self.query.is_sliced:\n raise TypeError(\n \"Cannot create distinct fields once a slice has been taken.\"\n )\n ... | [
"0.62657416",
"0.5960841",
"0.58951247",
"0.56846285",
"0.559601",
"0.55211025",
"0.5494978",
"0.5398764",
"0.5379246",
"0.5301219",
"0.52859926",
"0.5199111",
"0.5154496",
"0.5083758",
"0.49042335",
"0.49042335",
"0.49039626",
"0.48952803",
"0.48540667",
"0.48486277",
"0.483... | 0.75348645 | 0 |
Add aggregation for `field` | def add_measure(self, field, aggregations = None):
self.aggregations[field] = aggregations
self.measures.append(field) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def aggregate(self, func, field_path=None):\n return self._collection.aggregate(func, field_path)",
"def aggregate_field_count(self, field, projection={\"parameter\": 1},\n match={\"parameter.observed_name\": \"Ki\"},\n unwind=None, group={\"$group... | [
"0.68597",
"0.6784906",
"0.61529094",
"0.614358",
"0.6142343",
"0.6108541",
"0.6031247",
"0.5965529",
"0.5880119",
"0.5793998",
"0.5786914",
"0.57853186",
"0.5766973",
"0.5678729",
"0.5678729",
"0.5673409",
"0.56380945",
"0.5582759",
"0.55765766",
"0.5563876",
"0.5534641",
... | 0.6453284 | 2 |
Creates and initializes selection node | def __init__(self, condition = None, discard = False):
super(SelectNode, self).__init__()
self.condition = condition
self.discard = discard | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_selection ( self ,\n tag , \n algotype ,\n inputs , \n *args ,\n **kwargs ) :\n sel_tag = '%s_Selection' % tag\n sel_name = 'Sel%sFor%s' % ( tag , se... | [
"0.6415432",
"0.63343894",
"0.6249176",
"0.6226033",
"0.62115824",
"0.60897166",
"0.60422593",
"0.5963724",
"0.594786",
"0.59226525",
"0.59112215",
"0.59006333",
"0.5898278",
"0.58723027",
"0.5850067",
"0.5836292",
"0.5806168",
"0.57722485",
"0.5756462",
"0.5751389",
"0.57174... | 0.58813524 | 13 |
Creates a node that will select records based on condition `function`. | def __init__(self, function = None, fields = None, discard = False, **kwargs):
super(FunctionSelectNode, self).__init__()
self.function = function
self.fields = fields
self.discard = discard
self.kwargs = kwargs | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_nodes_by_function(graph, func):\n return filter_nodes(graph, function_inclusion_filter_builder(func))",
"def select(cond, t, f):\n return _make.Select(convert(cond), convert(t), convert(f))",
"def filter(self, func):\r\n\r\n d = self.data\r\n f = []\r\n for i in d:\r\n ... | [
"0.59084475",
"0.57280093",
"0.5511907",
"0.53095645",
"0.529074",
"0.5126951",
"0.50930446",
"0.5059737",
"0.50539416",
"0.5031834",
"0.50153047",
"0.5005024",
"0.4990828",
"0.4956121",
"0.49319425",
"0.4918616",
"0.4918577",
"0.49061823",
"0.4904405",
"0.48626038",
"0.48110... | 0.62249774 | 0 |
Creates a node that will select records where `field` contains value from `value_set`. | def __init__(self, field = None, value_set = None, discard = False):
super(SetSelectNode, self).__init__()
self.field = field
self.value_set = value_set
self.discard = discard | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def contains(self, value, caseSensitive=False):\n newq = self.copy()\n newq.setOp(Query.Op.Contains)\n newq.setValue(value)\n newq.setCaseSensitive(caseSensitive)\n return newq",
"def find_tasks_by_field(field, field_value):\n if field == 'date':\n tasks = Task.select... | [
"0.61387366",
"0.5894773",
"0.58398205",
"0.56510174",
"0.56493205",
"0.56202406",
"0.5549655",
"0.55027217",
"0.5488821",
"0.54749596",
"0.54177004",
"0.5409625",
"0.5339753",
"0.53032535",
"0.52950317",
"0.5278579",
"0.5220621",
"0.51991963",
"0.5172268",
"0.516876",
"0.510... | 0.538276 | 12 |
Creates a field audit node. | def __init__(self, distinct_threshold = 10):
super(AuditNode, self).__init__()
self.distinct_threshold = distinct_threshold | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_field(self, field, dim_translation=None):\n raise NotImplementedError",
"def add(self, field_create_information):\n field = Field.create_field_from_type(self.context, field_create_information)\n self.add_child(field)\n qry = CreateEntityQuery(self, field, field)\n se... | [
"0.61039907",
"0.60001904",
"0.5926844",
"0.5816948",
"0.5778043",
"0.572895",
"0.56876665",
"0.5649683",
"0.56426156",
"0.5624844",
"0.55876154",
"0.55755234",
"0.55649936",
"0.5497538",
"0.5481441",
"0.5440322",
"0.5423611",
"0.54180145",
"0.53423524",
"0.5337482",
"0.53135... | 0.0 | -1 |
Flush remaining records and close the connection if necessary | def finalize(self):
self.stream.finalize() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _flush(self):\n tempbuf = self.databuffer\n self.databuffer = []\n self.database.runInteraction(self._executemany, tempbuf)",
"def flush(self):\n if self.access != AccessMode.WRITE:\n raise ValueError(\"Flush attempted on dataset opened in READ mode.\")\n\n # TOD... | [
"0.7203738",
"0.6876733",
"0.6783707",
"0.655504",
"0.6502718",
"0.6488432",
"0.6481538",
"0.6476949",
"0.6476949",
"0.6476949",
"0.6476949",
"0.6465502",
"0.64520025",
"0.64520025",
"0.64520025",
"0.64520025",
"0.64520025",
"0.64520025",
"0.6447329",
"0.6443338",
"0.6440787"... | 0.0 | -1 |
Creates a data source that will read data from scraperwiki scraper | def __init__(self, name):
self.scraper_name = name
self.stream = None
params = {
"name": self.scraper_name,
"format": "csv"
}
params_str = urllib.urlencode(params)
data_url = SWIKI_BASEURL + "?" + params_str
super(Scr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def page_data():\n return scrape()",
"def get_basic_data(self):\n\n db = DataBase().clear_table()\n\n data = self.scraper.scrape_top_250()\n for d in data:\n title = d.find(\"td\", class_=\"titleColumn\")\n title = title.find(\"a\")\n title = re.sub(\"<.*?... | [
"0.6020706",
"0.592123",
"0.589",
"0.575166",
"0.56928945",
"0.5640901",
"0.5631263",
"0.56175727",
"0.56119233",
"0.56099194",
"0.5600869",
"0.5596439",
"0.5586508",
"0.5566285",
"0.55568206",
"0.5551798",
"0.5531297",
"0.55278885",
"0.5502548",
"0.5502064",
"0.549026",
"0... | 0.6810211 | 0 |
Return storage type if there is only one. This should always return a type in relational databases, but does not have to in databases such as MongoDB. | def unique_storage_type(self):
if len(self.storage_types) == 1:
return list(self.storage_types)[0]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_storage_type(self):\r\n\r\n if len(self.storage_types) == 1:\r\n return list(self.storage_types)[0]\r\n return None",
"def storage_type(self) -> str:\n return pulumi.get(self, \"storage_type\")",
"def storage_type(self) -> Optional[pulumi.Input[str]]:\n return ... | [
"0.84219027",
"0.81767267",
"0.81212354",
"0.81212354",
"0.81212354",
"0.79251057",
"0.7713634",
"0.7288947",
"0.71342427",
"0.7114066",
"0.7114066",
"0.71074",
"0.7018581",
"0.6972723",
"0.6972723",
"0.6906787",
"0.6888426",
"0.67335147",
"0.6708264",
"0.6656682",
"0.6612755... | 0.84288293 | 0 |
Return storage type if there is only one. This should always return a type in relational databases, but does not have to in databases such as MongoDB. | def unique_storage_type(self):
if len(self.storage_types) == 1:
return list(self.storage_types)[0]
else:
return None | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unique_storage_type(self):\r\n\r\n if len(self.storage_types) == 1:\r\n return list(self.storage_types)[0]\r\n return None",
"def storage_type(self) -> str:\n return pulumi.get(self, \"storage_type\")",
"def storage_type(self) -> Optional[pulumi.Input[str]]:\n return ... | [
"0.8422102",
"0.8176501",
"0.81210995",
"0.81210995",
"0.81210995",
"0.7924676",
"0.77130455",
"0.7289685",
"0.71347797",
"0.71145844",
"0.71145844",
"0.710812",
"0.7017996",
"0.69726884",
"0.69726884",
"0.6906241",
"0.68885106",
"0.67330426",
"0.67083806",
"0.66560495",
"0.6... | 0.8429062 | 1 |
Create a stream from dictionary `desc`. | def stream_from_dict(desc):
stream = Stream()
stream.update(desc)
return stream | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_stream(\n d2h_streams: Dict[str, str], tensors: Dict[str, Variable], label: str\n) -> Dict[str, str]:\n d2h_streams[label] = popxl.d2h_stream(\n tensors[label]._pb_tensor.info.shape(),\n dtype.as_dtype(tensors[label]._pb_tensor.info.data_type_lcase()),\n name=f\"{label}_d2h_stre... | [
"0.6463326",
"0.5560627",
"0.54669464",
"0.5124788",
"0.51028615",
"0.5071144",
"0.49873245",
"0.49216458",
"0.49216458",
"0.48860496",
"0.48770916",
"0.48736376",
"0.48651212",
"0.48542532",
"0.48452538",
"0.48278058",
"0.48255864",
"0.4816854",
"0.47937018",
"0.4781335",
"0... | 0.9202741 | 0 |
Get data objects from pipe as records (dict objects). This is convenience method with performance costs. Nodes are recommended to process rows instead. | def records(self):
if not self.fields:
raise Exception("Can not provide records: fields for pipe are not initialized.")
fields = self.fields.names()
for row in self.rows():
yield dict(zip(fields, row)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_data(self) -> List[BaseRecord]:\n pass",
"def extract(self) -> DatasetRecords:\n # get mapping to associate value to field in each record\n mapping = self.extract_mapping()\n fields = self.mapping\n records = DatasetRecords()\n l = len(self.data)\n # read... | [
"0.6174285",
"0.61521894",
"0.61278546",
"0.59345317",
"0.59140503",
"0.5621175",
"0.5613013",
"0.55877316",
"0.5578544",
"0.55742395",
"0.55429316",
"0.5535968",
"0.5470504",
"0.54635197",
"0.5462253",
"0.54532534",
"0.54337627",
"0.5416425",
"0.54119533",
"0.537414",
"0.537... | 0.7409104 | 0 |
Convenience method that will transform record into a row based on pipe fields. | def put_record(self, record):
row = [record.get(field) for field in self.fields.names()]
self.put(row) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Transform(self, record):\n pass",
"def preprocess_record(record):\n automatic_fields = ['created_at', 'modified_at']\n record = serialize_fields(filter_out_dict_keys(record, automatic_fields))\n\n return record",
"def records(self):\r\n if not self.fields:\r\n raise Exception(... | [
"0.5841695",
"0.57097834",
"0.5679778",
"0.55456334",
"0.5456463",
"0.5453595",
"0.54198575",
"0.53452915",
"0.5327631",
"0.5245802",
"0.52411306",
"0.5230406",
"0.5206248",
"0.51770735",
"0.51703346",
"0.5148323",
"0.5125691",
"0.5120784",
"0.510884",
"0.50931585",
"0.506901... | 0.49089068 | 46 |
Creates unidrectional data pipe for passing data between two threads in batches of size `buffer_size`. If receiving node is finished with source data and does not want anything any more, it should send ``done_receiving()`` to the pipe. In most cases, stream runner will send ``done_receiving()`` to all input pipes when ... | def __init__(self, buffer_size=1000):
super(Pipe, self).__init__()
self.buffer_size = buffer_size
# Should it be deque or array?
self.staging_buffer = []
self._ready_buffer = None
self._done_sending = False
self._done_receiving = False
self._... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _buffered_func(dataset, size):\n\n class _EndSignal(object):\n pass\n\n end = _EndSignal()\n\n def _read_worker(r, q):\n for d in r:\n q.put(d)\n q.put(end)\n\n def _data_reader():\n r = dataset()\n q = multiprocessing.Queue(maxsize=size)\n t = m... | [
"0.5646866",
"0.55742246",
"0.54859775",
"0.5298882",
"0.5270317",
"0.5211329",
"0.5204282",
"0.5186592",
"0.5163871",
"0.50456214",
"0.49710763",
"0.49637255",
"0.49567136",
"0.4948737",
"0.49344197",
"0.49174315",
"0.48128504",
"0.4808433",
"0.47987562",
"0.47859532",
"0.47... | 0.5666719 | 0 |
Put data object into the pipe buffer. When buffer is full it is enqueued and receiving node can get all buffered data objects. Puttin object into pipe is not thread safe. Only one thread sohuld write to the pipe. | def put(self, obj):
self.staging_buffer.append(obj)
if self.is_full():
self._flush() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write(self, data):\n self.buffer.append(data)\n while self.push():\n pass",
"def data(self, data):\n try:\n self.put_nowait(data)\n except Full:\n pass",
"def putpipe(self):\n task = None\n try:\n task = self._queuepop()\... | [
"0.69361013",
"0.6738249",
"0.6541541",
"0.648432",
"0.6437201",
"0.63732255",
"0.63363755",
"0.6334706",
"0.62826824",
"0.6259573",
"0.6215913",
"0.6195472",
"0.6138143",
"0.6111525",
"0.60908103",
"0.60879177",
"0.6083751",
"0.60479254",
"0.60049474",
"0.59914416",
"0.59879... | 0.6456014 | 4 |
Get data object from pipe. If there is no buffer ready, wait until source object sends some data. | def rows(self):
done_sending = False
while not done_sending:
self._note("C _not_empty acq?")
self.not_empty.acquire()
try:
self._note("C _not_empty wait ...")
while not self._ready_buffer and not self._closed:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wait_for_data(receiver):\n\n while not receiver.available(pipes[1]):\n time.sleep(0.01)",
"def _get_data(self, read_size):\n return self._pipe.recv_bytes()",
"def _get_data(self):\n while not (self.closed or self.ended):\n block = self.stream.read(8192)\n with ... | [
"0.69240636",
"0.6415472",
"0.6305186",
"0.6279885",
"0.6261415",
"0.62353796",
"0.6228134",
"0.62079155",
"0.608304",
"0.60410684",
"0.60184985",
"0.6015724",
"0.59974796",
"0.59178156",
"0.59147847",
"0.5896483",
"0.5895039",
"0.58770126",
"0.5866472",
"0.5813214",
"0.58106... | 0.0 | -1 |
Return ``True`` if pipe is closed not sending or not receiving data any more. | def closed(self):
return self._closed | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_an_incomming_message(self):\n return self.pipe_start.poll(1)",
"def eof(self):\n\t\tif not self._input: raise PlumberExceptions.PipeTypeException(self)\n\t\tresult = pservlet.pipe_eof(self._pipe_desc)\n\t\tif result > 0: return True\n\t\telif result == 0: return False\n\t\traise PlumberExceptions.... | [
"0.71016645",
"0.7028375",
"0.64808506",
"0.6400675",
"0.63379574",
"0.62882686",
"0.62628555",
"0.6261644",
"0.62444675",
"0.6197525",
"0.61421615",
"0.6135435",
"0.6133184",
"0.61037356",
"0.6057069",
"0.60515887",
"0.6049998",
"0.6022627",
"0.60066813",
"0.59947115",
"0.59... | 0.0 | -1 |
Close pipe from sender side | def done_sending(self):
self._flush(True) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self):\n self.outfd.close()",
"def closeEvent(self, event=None):\n log.debug(\"Cleanup close, %s\", event)\n result = self.dev.close_pipe()\n log.info(\"Close pipe result: %s\", result)\n self.data_timer.stop()\n self.close()",
"def close(self):\n self... | [
"0.6641398",
"0.6577572",
"0.65141934",
"0.6505667",
"0.64792854",
"0.6464279",
"0.64275813",
"0.64251226",
"0.63766694",
"0.6329873",
"0.6317909",
"0.63060653",
"0.6304388",
"0.6301472",
"0.6261242",
"0.6254091",
"0.6237683",
"0.6226078",
"0.61921823",
"0.6159412",
"0.614939... | 0.0 | -1 |
Close pipe from either side | def done_receiving(self):
self._note("C not_empty acq? r")
self.not_empty.acquire()
self._note("C closing")
self._closed = True
self._note("C notif close")
self.not_full.notify()
self.not_empty.release()
self._note("C not_empty rel! r") | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def close(self):\n if self._fd_out is not None:\n os.close(self._fd_out)\n self._fd_out = None\n if self._fd_in is not None:\n os.close(self._fd_in)\n self._fd_in = None",
"def close(self):\n self.outfd.close()",
"def close(self):\n self.p... | [
"0.6912441",
"0.65838164",
"0.6408325",
"0.6312077",
"0.6312077",
"0.6312077",
"0.621154",
"0.61605823",
"0.61605823",
"0.61605823",
"0.61605823",
"0.61605823",
"0.6155044",
"0.61389285",
"0.6133939",
"0.6091149",
"0.60821414",
"0.60353094",
"0.601051",
"0.59416085",
"0.59252... | 0.0 | -1 |
Creates a data stream. | def __init__(self, nodes=None, connections=None):
super(Stream, self).__init__(nodes, connections)
self.logger = get_logger()
self.exceptions = [] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_stream(self):\n pass",
"def prepare_datastream(data_name,\n batch_size):\n train_set = H5PYDataset(data_name, which_sets=(\n \"train\",), load_in_memory=True)\n test_set = H5PYDataset(data_name, which_sets=(\n \"test\", ), load_in_memory=True)\n\n tr... | [
"0.73912555",
"0.6362388",
"0.62601936",
"0.62141794",
"0.6199934",
"0.6097413",
"0.60756725",
"0.6031492",
"0.6018141",
"0.5926394",
"0.5868765",
"0.5868765",
"0.5866832",
"0.5855899",
"0.58409405",
"0.5771305",
"0.5769093",
"0.5725984",
"0.5708135",
"0.5700377",
"0.56977457... | 0.0 | -1 |
Creates a construction fork of the stream. Used for constructing streams in functional | def fork(self):
return _StreamFork(self) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_builder():\r\n stream = Stream()\r\n return stream.fork()",
"def fork(self):\r\n fork = _StreamFork(self.stream, self.node)\r\n return fork",
"def __init__(self, stream, node=None):\r\n super(_StreamFork, self).__init__()\r\n self.stream = stream\r\n self.nod... | [
"0.7790038",
"0.7604321",
"0.67522705",
"0.5790387",
"0.5745579",
"0.5641717",
"0.55454075",
"0.54387265",
"0.542654",
"0.5371548",
"0.5251578",
"0.52079374",
"0.51959777",
"0.51805174",
"0.5159107",
"0.51526403",
"0.51526403",
"0.5149615",
"0.5144434",
"0.5141896",
"0.513764... | 0.75973916 | 2 |
Adds nodes and connections specified in the dictionary. Dictionary might contain node names instead of real classes. You can use this method for creating stream from a dictionary that was created from a JSON file, for example. | def update(self, nodes = None, connections = None):
node_dict = node_dictionary()
# FIXME: use either node type identifier or fully initialized node, not
# node class (Warning: might break some existing code,
# depreciate it first
nodes = nodes or {}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def from_config(dictionary):\n nodes = {}\n\n for node_name in dictionary:\n nodes[node_name] = Node(node_name)\n for node_name in dictionary:\n for second_node_data in dictionary[node_name]:\n connect_one_way(nodes[node_name], nodes[second_node_data[0]], s... | [
"0.6551548",
"0.6204741",
"0.5942039",
"0.5785287",
"0.569912",
"0.56979525",
"0.5614306",
"0.5567454",
"0.5562025",
"0.5539471",
"0.5481054",
"0.54264146",
"0.54264146",
"0.5343204",
"0.530966",
"0.5309577",
"0.52700424",
"0.5224363",
"0.5203682",
"0.5201093",
"0.5183231",
... | 0.61229354 | 2 |
Configure node properties based on configuration. Only named nodes can be configured at the moment. | def configure(self, config=None):
# FIXME: this is wrong, it should be a single dict per node (or not?)
# List of attributes:
# * can reflect a form for configuring whole stream
# * can have attribute order regardless of their node ownership
# List of nodes:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_set_node_properties(self):\n\n pass",
"def set_nodeprops(self, nodeprops):\n assert isinstance(nodeprops, dict), \"nodeprops must be a dictionary, even if empty\"\n self.nodeprops = nodeprops",
"def test_node_config() -> None:\n node = MyNode()\n node.configure(\n MyC... | [
"0.7296004",
"0.649793",
"0.6400615",
"0.6314638",
"0.626299",
"0.6013483",
"0.59373397",
"0.59296864",
"0.592624",
"0.59212375",
"0.5897486",
"0.5877193",
"0.5766769",
"0.5756369",
"0.5756318",
"0.5720249",
"0.5624602",
"0.561435",
"0.56078106",
"0.557835",
"0.55589175",
"... | 0.7297614 | 0 |
Run all nodes in the stream. Each node is being wrapped and run in a separate thread. When an exception occurs, the stream is stopped and all catched exceptions are stored in attribute `exceptions`. | def run(self):
self._initialize()
# FIXME: do better exception handling here: what if both will raise exception?
try:
self._run()
finally:
self._finalize() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self):\n node_runs = [\n (node, node.run())\n for node in self.nodes\n if node.loaded\n ]\n\n while True:\n for node, node_run in node_runs:\n if node in self.buffered_input and node.mode == Node.READ:\n for ... | [
"0.64663935",
"0.6268519",
"0.587672",
"0.5744616",
"0.5570868",
"0.5567952",
"0.5527181",
"0.5508824",
"0.5490534",
"0.54836345",
"0.54567385",
"0.54542106",
"0.54394495",
"0.5436102",
"0.537408",
"0.5338588",
"0.53299564",
"0.5294572",
"0.528762",
"0.52728504",
"0.52522546"... | 0.0 | -1 |
Create a StreamRuntimeError exception object and fill attributes with all necessary values. | def _add_thread_exception(self, thread):
node = thread.node
exception = StreamRuntimeError(node=node, exception=thread.exception)
exception.traceback = thread.traceback
exception.inputs = [pipe.fields for pipe in node.inputs]
if not isinstance(node, TargetNode):
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_exception(self, msg: str):",
"def unexpected_error(self, exception):",
"def __init__(self, error_msg):\n super(SdkException, self).__init__()\n self.error_msg = error_msg",
"def __init__(self, exception):\n self.wrapped_exc = exception\n self.status_int = exception.stat... | [
"0.6469938",
"0.58988583",
"0.5814184",
"0.5809098",
"0.5792198",
"0.57632416",
"0.5751069",
"0.57498246",
"0.5724973",
"0.5707641",
"0.5689362",
"0.5687576",
"0.5666823",
"0.55951005",
"0.55933505",
"0.5584562",
"0.5560765",
"0.5556301",
"0.552704",
"0.551663",
"0.55102575",... | 0.6289194 | 1 |
Creates a stream node thread. | def __init__(self, node):
super(_StreamNodeThread, self).__init__()
self.node = node
self.exception = None
self.traceback = None
self.logger = get_logger() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self, stream, node=None):\r\n super(_StreamFork, self).__init__()\r\n self.stream = stream\r\n self.node = node",
"def __init__(self, stream):\n self.stream = stream\n self.queue = Queue()\n self.start_thread()",
"def create_stream(self):\n pass",
... | [
"0.6887921",
"0.6792823",
"0.63424593",
"0.631812",
"0.61759686",
"0.6152072",
"0.6151063",
"0.6103339",
"0.6001259",
"0.5925422",
"0.5837476",
"0.57705367",
"0.5750346",
"0.57065403",
"0.56630534",
"0.5660386",
"0.5655959",
"0.5633656",
"0.5633656",
"0.5628655",
"0.5594017",... | 0.6724923 | 2 |
Wrapper method for running a node | def run(self):
label = node_label(self.node)
self.logger.debug("%s: start" % label)
try:
self.node.run()
except NodeFinished:
self.logger.info("node %s finished" % label)
except Exception as e:
tb = sys.exc_info()[2]
self... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def run(self):\r\n\r\n raise NotImplementedError(\"Subclasses of Node should implement the run() method\")",
"def runnode(self, node, pynode=False):\n if pynode:\n process = coreinterface.PythonNode(node, self)\n else:\n process = coreinterface.ExecutableNode(node, self... | [
"0.7047739",
"0.6966116",
"0.68796206",
"0.6753881",
"0.653272",
"0.6469235",
"0.6457536",
"0.63082105",
"0.6300632",
"0.6287415",
"0.6274681",
"0.6209584",
"0.6184494",
"0.61608154",
"0.61410666",
"0.6126079",
"0.61055475",
"0.61005914",
"0.60538524",
"0.60506934",
"0.600796... | 0.6300205 | 9 |
Creates a stream fork class for building streams. | def __init__(self, stream, node=None):
super(_StreamFork, self).__init__()
self.stream = stream
self.node = node | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fork(self):\r\n\r\n return _StreamFork(self)",
"def fork(self):\r\n fork = _StreamFork(self.stream, self.node)\r\n return fork",
"def create_builder():\r\n stream = Stream()\r\n return stream.fork()",
"def __init__(self, stream):\n self.stream = stream",
"def __init__(... | [
"0.7908262",
"0.7693114",
"0.72402364",
"0.6364559",
"0.6364559",
"0.6268753",
"0.6175708",
"0.6035641",
"0.592607",
"0.58307284",
"0.58307284",
"0.58241636",
"0.58028543",
"0.57765394",
"0.57472104",
"0.5746039",
"0.5712102",
"0.5689832",
"0.5654526",
"0.5619931",
"0.5612452... | 0.7602199 | 2 |
Appends a node to the actual stream. The new node becomes actual node of the for. | def __iadd__(self, node):
self.stream.add(node)
if self.node:
self.stream.connect(self.node, node)
self.node = node
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_node(self, node):",
"def append(self, node):\n if not isinstance(node, Stochastic):\n raise TypeError(\"Argument node must be an instance of\"\n \"probtorch.Stochastic\")\n # construct a new node name\n if isinstance(node, RandomVariable):\n ... | [
"0.6498101",
"0.64582515",
"0.64156073",
"0.64039135",
"0.63480693",
"0.6284242",
"0.6262796",
"0.61897963",
"0.61726254",
"0.61394435",
"0.6137474",
"0.6061179",
"0.60576475",
"0.603926",
"0.603926",
"0.6032615",
"0.6012747",
"0.5980207",
"0.59731466",
"0.59656024",
"0.59500... | 0.76108927 | 0 |
Sets name of current node. | def set_name(self, name):
self.stream.set_node_name(self.node, name) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_name(self, name):\n\t\tself.name_ = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n self.name = name",
"def set_name(self, name):\n ... | [
"0.79930604",
"0.79815876",
"0.79815876",
"0.79815876",
"0.79815876",
"0.79815876",
"0.7972499",
"0.7959629",
"0.7959629",
"0.7954432",
"0.79386765",
"0.7903524",
"0.79033303",
"0.79033303",
"0.79007787",
"0.78796196",
"0.78541315",
"0.7770957",
"0.77659255",
"0.77659255",
"0... | 0.88172925 | 0 |
Forks current fork. Returns a new fork with same actual node as the fork being forked. | def fork(self):
fork = _StreamFork(self.stream, self.node)
return fork | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fork():\n\tpass",
"def fork(self):\r\n\r\n return _StreamFork(self)",
"def patched_fork(self):\n pid = self.original_os_fork()\n if not pid:\n _LOG('Fork detected. Reinstalling Manhole.')\n self.reinstall()\n return pid",
"def fork_node(node: saldag.Conca... | [
"0.66765285",
"0.62729377",
"0.6210284",
"0.6172251",
"0.6120093",
"0.6087477",
"0.59392285",
"0.5722189",
"0.55935335",
"0.555195",
"0.55280256",
"0.5520292",
"0.5506794",
"0.54130423",
"0.53674704",
"0.5366471",
"0.533206",
"0.5319437",
"0.53059626",
"0.5260359",
"0.5250594... | 0.69784635 | 0 |
Joins two streams using the MergeNode (please refer to the node documentaton for more information). `obj` is a fork or a node to be merged. `kwargs` are MergeNode configuration arguments, such as `joins`. | def merge(self, obj, **kwargs):
raise NotImplementedError
# if type(obj) == StreamFork:
# node = obj.node
# else:
# node = obj
#
# self.stream.append(node)
#
# merge = MergeNode(**kwargs)
# self.stream.append(merge)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge(self, obj):\n pass",
"def join(left, right, max_size=128):\n new_stream = Stream()\n joiner = Joiner(\n left=left,\n right=right,\n target=new_stream,\n max_size=max_size)\n left.append(joiner)\n right.append(joiner)\n new_stream.append(... | [
"0.56683445",
"0.53135544",
"0.52753705",
"0.5272677",
"0.5070449",
"0.4877844",
"0.48352113",
"0.48285025",
"0.48088157",
"0.47568852",
"0.47396386",
"0.46540833",
"0.45993406",
"0.4589769",
"0.45721373",
"0.45686302",
"0.45607427",
"0.45594376",
"0.4554228",
"0.45383862",
"... | 0.78845084 | 0 |
Appends data from nodes using AppendNode | def append(self, obj):
raise NotImplementedError | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_node(self, new_data):\n\n #create a new node and put new data.\n new_node = Node(new_data)\n\n if self.head is None:\n self.head = new_node\n return\n\n end = self.head\n while end.next:\n end = end.next\n\n end.next = new_node",
"def add_node(self, node_data):\n ... | [
"0.69649816",
"0.6891024",
"0.68294185",
"0.674862",
"0.6690884",
"0.66476196",
"0.658736",
"0.65730745",
"0.6572211",
"0.6564506",
"0.6539114",
"0.6539114",
"0.63788164",
"0.6287055",
"0.6219256",
"0.619874",
"0.6197199",
"0.61558175",
"0.6147346",
"0.6139895",
"0.6138313",
... | 0.0 | -1 |
Creates a stream builder for incremental stream building. | def create_builder():
stream = Stream()
return stream.fork() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stream(self, **stream_options):\n return stream_generator(self.new, **stream_options)",
"def getBuilder():\n if (MinicapStream.__instance == None):\n MinicapStream.__mutex.acquire()\n if (MinicapStream.__instance == None):\n MinicapStream.__instance = Minica... | [
"0.60825986",
"0.582614",
"0.5661738",
"0.56157386",
"0.5477672",
"0.5288884",
"0.5188975",
"0.518337",
"0.5168984",
"0.5009743",
"0.496311",
"0.49488583",
"0.4939058",
"0.49365848",
"0.49118626",
"0.48932028",
"0.48864427",
"0.48724777",
"0.48332754",
"0.4824053",
"0.4812392... | 0.7120029 | 0 |
Get brewery default logger | def get_logger():
global logger
if logger:
return logger
else:
return create_logger() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_logger():\n return logging.getLogger(__name__)",
"def _get_logger():\n return logging.Logger(__name__)",
"def logger():\n return logging.getLogger(__name__)",
"def logger() -> logging.Logger:\n return logging.getLogger(__name__)",
"def getLogger():\n return GlobalLogger.logger",
... | [
"0.7883286",
"0.7880604",
"0.7709511",
"0.76633376",
"0.75743204",
"0.74368244",
"0.7338914",
"0.73352414",
"0.7317689",
"0.7307891",
"0.72759336",
"0.727547",
"0.72745275",
"0.72511196",
"0.72511196",
"0.72487134",
"0.72386825",
"0.72350615",
"0.723489",
"0.72267973",
"0.722... | 0.740682 | 6 |
Create a default logger | def create_logger():
global logger
logger = logging.getLogger(logger_name)
formatter = logging.Formatter(fmt='%(asctime)s %(levelname)s %(message)s')
handler = logging.StreamHandler()
handler.setFormatter(formatter)
logger.addHandler(handler)
return logger | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def default_logger_creator(config):\n return UnifiedLogger(config, logdir, loggers=None)",
"def create_logger() -> logging.Logger:\n pass # TODO: Replace with implementation!",
"def create_logger():\n logging.basicConfig(level = logging.INFO, filename='logging', filemode='w')\n log... | [
"0.809169",
"0.7998874",
"0.774856",
"0.7713438",
"0.7710585",
"0.7466199",
"0.74572444",
"0.7447276",
"0.74315107",
"0.7409398",
"0.74037707",
"0.73186123",
"0.7294232",
"0.7293659",
"0.72897285",
"0.72745645",
"0.72398216",
"0.72253305",
"0.71935004",
"0.7160885",
"0.715393... | 0.7786755 | 2 |
Set value in a dictionary if value is not null | def setnoempty(self, key, value):
if value:
self[key] = value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_if_set(dct, key, value):\r\n if value is not UNSET:\r\n dct[key] = value",
"def convert_nulls(dic, null_value):\n for key in dic.iterkeys():\n if dic[key] is None:\n dic[key] = null_value",
"def set_if_not_none_or_empty(dst, key, value):\n if value is not None and (typ... | [
"0.71802783",
"0.70974284",
"0.7074862",
"0.69197136",
"0.6756446",
"0.6756446",
"0.6674433",
"0.6395401",
"0.6330659",
"0.6303298",
"0.6200661",
"0.6190946",
"0.617421",
"0.60928315",
"0.59494317",
"0.59468156",
"0.58769584",
"0.5819526",
"0.57919705",
"0.5791826",
"0.571386... | 0.6844343 | 4 |
Generator over all subclasses of a given class, in depth first order. | def subclass_iterator(cls, _seen=None):
if not isinstance(cls, type):
raise TypeError('_subclass_iterator must be called with '
'new-style classes, not %.100r' % cls)
_seen = _seen or set()
try:
subs = cls.__subclasses__()
except TypeError: # fails on... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def all_subclasses(cls):\n for subclass in cls.__subclasses__():\n yield subclass\n for subc in all_subclasses(subclass):\n yield subc",
"def class_hierarchy(clslist):\n for cls in clslist:\n subclass_list = cls.__subclasses__()\n if subclass_list:\n ... | [
"0.7962231",
"0.7943153",
"0.7784564",
"0.7563064",
"0.7522415",
"0.7415031",
"0.73414916",
"0.73381543",
"0.73268855",
"0.7237079",
"0.7028352",
"0.70265555",
"0.70090574",
"0.69635135",
"0.6907735",
"0.6889192",
"0.6881786",
"0.68299997",
"0.68015057",
"0.6777709",
"0.67390... | 0.7539626 | 4 |
Set the Group ID for the service to be registered. | def setGroupId(self, groupId):
internals.blpapi_ServiceRegistrationOptions_setGroupId(
self.__handle, groupId.encode('utf-8'))
# NOTE: we should convert groupId to bytes here because
# otherwise we'll get an error in SWIG wrapper. | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def group_id(self, group_id):\n\n self._group_id = group_id",
"def group_id(self, group_id):\n\n self._group_id = group_id",
"def group_id(self, group_id):\n\n self._group_id = group_id",
"def group_id(self, group_id):\n\n self._group_id = group_id",
"def group_id(self, group_id... | [
"0.7257652",
"0.7257652",
"0.7257652",
"0.7257652",
"0.7257652",
"0.7257652",
"0.6927829",
"0.6887743",
"0.67472553",
"0.6733823",
"0.6626543",
"0.66177475",
"0.6609379",
"0.6551552",
"0.6538167",
"0.64768946",
"0.6458963",
"0.6439793",
"0.6335913",
"0.6293197",
"0.62830555",... | 0.76897526 | 0 |
Set the priority with which a subscription service will be registered. | def setServicePriority(self, priority):
return internals.blpapi_ServiceRegistrationOptions_setServicePriority(
self.__handle,
priority) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setPriority(self, p):\n self.priority = p",
"def set_priority(self, priority):\n self.options[\"priority\"] = priority",
"def set_priority(self, priority):\n self.options['priority'] = priority",
"def set_priority(self, priority):\n self._priority = priority",
"def priority(self... | [
"0.7084604",
"0.7021725",
"0.6986204",
"0.6817361",
"0.6751302",
"0.66177356",
"0.66177356",
"0.66177356",
"0.641478",
"0.6355107",
"0.6314387",
"0.61654586",
"0.6125355",
"0.59795755",
"0.5964674",
"0.588441",
"0.58503735",
"0.58459353",
"0.5825406",
"0.5825406",
"0.5825406"... | 0.75942177 | 0 |
Remove all previously added subservice code ranges. | def removeAllActiveSubServiceCodeRanges(self):
internals.blpapi_ServiceRegistrationOptions_removeAllActiveSubServiceCodeRanges(
self.__handle) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_regions_from_codes(self, regions_to_remove):\n reduced_regions = []\n reduced_regions_indx = []\n for indx, r in enumerate(self.Rs):\n if r in regions_to_remove:\n pass\n else:\n reduced_regions_indx.append(indx)\n r... | [
"0.55606467",
"0.54926443",
"0.54046816",
"0.5264299",
"0.52446514",
"0.5191107",
"0.51758385",
"0.51736784",
"0.5172029",
"0.51689976",
"0.51425195",
"0.5129304",
"0.5094369",
"0.5075877",
"0.5039329",
"0.5035514",
"0.50293577",
"0.50143325",
"0.5007462",
"0.4986069",
"0.498... | 0.78100973 | 0 |
Set the parts of the service to be registered. | def setPartsToRegister(self, parts):
internals.blpapi_ServiceRegistrationOptions_setPartsToRegister(
self.__handle, parts) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def services(self, services):\n\n self._services = services",
"def services(self, services):\n\n self._services = services",
"def set_service(self):\n\n if self.service:\n self.service = self.service(\n json=self.json,\n google_user=self.google_user... | [
"0.68223244",
"0.68223244",
"0.6184817",
"0.60817534",
"0.6025237",
"0.59323543",
"0.58549976",
"0.5806523",
"0.57990515",
"0.5776107",
"0.5701313",
"0.5692304",
"0.55918634",
"0.5571113",
"0.5562481",
"0.5540196",
"0.549618",
"0.5495206",
"0.5490346",
"0.54844123",
"0.547141... | 0.7994799 | 0 |
Return the internal implementation. | def _handle(self):
return self.__handle | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_impl(self):",
"def _build_impl(self):",
"def get_implementation(self):\n return self.__capabilities[\"IMPLEMENTATION\"]",
"def _select_implementation(self):\n return",
"def _select_implementation(self):\n return",
"def get_implementation(cls):\n\n return get_implem... | [
"0.7107441",
"0.6956048",
"0.6800998",
"0.6771021",
"0.6771021",
"0.6337738",
"0.63159007",
"0.62647194",
"0.62413657",
"0.62244004",
"0.620911",
"0.6206774",
"0.6194508",
"0.6186584",
"0.618439",
"0.61818457",
"0.61628395",
"0.61559534",
"0.61113584",
"0.60820746",
"0.606710... | 0.0 | -1 |
Use sessions ref to dispatch an event | def __dispatchEvent(sessionRef, eventHandle):
try:
session = sessionRef()
if session is not None:
event = Event(eventHandle, session)
session.__handler(event, session)
except:
print("Exception in event handler:", file=sys.stderr)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dispatch(self, sender, event, *args, **kwargs):\n pass # pragma: no cover",
"def react_to_event(self):\n raise NotImplementedError()",
"def on_session_ended(session_ended_request, session):",
"def dispatch(self, event):\n self.queue.put(event)",
"def __action_connect_session_bus_c... | [
"0.5783302",
"0.5750696",
"0.5669775",
"0.5600043",
"0.55553705",
"0.5541075",
"0.5525612",
"0.54949385",
"0.5483773",
"0.5483773",
"0.54795504",
"0.54787606",
"0.5471519",
"0.54557",
"0.54557",
"0.54490024",
"0.5412131",
"0.5360131",
"0.5360131",
"0.53503275",
"0.5348855",
... | 0.66317356 | 0 |
Wait at most ``timeoutMsecs`` milliseconds for all the published events to be sent through the underlying channel. | def flushPublishedEvents(self, timeoutMsecs):
err_code, allFlushed = internals.blpapi_ProviderSession_flushPublishedEvents(self.__handle, timeoutMsecs)
if err_code != 0:
raise RuntimeError("Flush published events failed")
return allFlushed != 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sleep(cls, timeout):\n sleep_channel = Channel()\n try:\n sleep_channel.receive(timeout)\n except TimeoutError:\n pass #expected to happen after timeout",
"def wait_send(self, timeout = None):\n\t\tself._send_queue_cleared.clear()\n\t\tself._send_queue_cleared.wait(... | [
"0.64753467",
"0.64180535",
"0.5909847",
"0.5884422",
"0.5806082",
"0.57731724",
"0.5729446",
"0.5720981",
"0.57073236",
"0.5593402",
"0.5593397",
"0.553588",
"0.55332994",
"0.55326265",
"0.54545015",
"0.5433028",
"0.5392107",
"0.53666085",
"0.53609353",
"0.53418565",
"0.5300... | 0.68683976 | 0 |
Begin the process to stop this Session and return immediately. | def stopAsync(self):
return internals.blpapi_ProviderSession_stopAsync(self.__handle) == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stop(self):\n if self.session.status != Session.SessionStatus.RUNNING:\n return\n self.container.stop()\n self.session.status = Session.SessionStatus.NOTRUNNING\n self.session.save()",
"def stop(self):\n return self.rpc.call(MsfRpcMethod.SessionStop, [self.sid])"... | [
"0.79328895",
"0.77182347",
"0.72879684",
"0.7140856",
"0.7102884",
"0.707782",
"0.707782",
"0.70711315",
"0.7069144",
"0.7023167",
"0.7023167",
"0.7023167",
"0.7023167",
"0.7023167",
"0.7003355",
"0.70014685",
"0.6985513",
"0.6979471",
"0.6956585",
"0.6956585",
"0.6948406",
... | 0.67270494 | 64 |
Attempt to register the service and block until it is done. | def registerService(self, uri, identity=None, options=None):
if options is None:
options = ServiceRegistrationOptions()
if internals.blpapi_ProviderSession_registerService(
self.__handle, uri,
get_handle(identity),
get_handle(options)) == 0:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _async_register(service, notifier):\n\n proc = multiprocessing.Process(\n name='Async Registration {}'.format(service.iden),\n target=_register, args=(service, notifier))\n proc.start()",
"def _register(service, notifier=None):\n\n full_name = service.iden\n slot = service_store[ful... | [
"0.7155547",
"0.65681595",
"0.6471639",
"0.6361515",
"0.6349468",
"0.6190628",
"0.60737556",
"0.6070934",
"0.6007178",
"0.5976975",
"0.5856147",
"0.58021986",
"0.5763768",
"0.5762859",
"0.5646861",
"0.5639948",
"0.56325424",
"0.5620549",
"0.5614935",
"0.5588944",
"0.55819166"... | 0.5529923 | 25 |
Begin the process of registering the service immediately. | def registerServiceAsync(self, uri, identity=None, correlationId=None,
options=None):
if correlationId is None:
correlationId = CorrelationId()
if options is None:
options = ServiceRegistrationOptions()
_ExceptionUtil.raiseOnError(
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def start(self):\n if self._started:\n return\n\n self._register()\n self._started = True",
"def registration_started(self):\n pass",
"def _async_register(service, notifier):\n\n proc = multiprocessing.Process(\n name='Async Registration {}'.format(service.iden)... | [
"0.7576622",
"0.7340003",
"0.71156865",
"0.67406386",
"0.6682559",
"0.6665912",
"0.65446526",
"0.64647675",
"0.64121807",
"0.63937503",
"0.6361033",
"0.6273308",
"0.6247205",
"0.620185",
"0.61441815",
"0.612163",
"0.60982096",
"0.60982096",
"0.6090877",
"0.6088648",
"0.607837... | 0.0 | -1 |
Resolve the topics in the specified ``resolutionList``. | def resolve(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES,
identity=None):
resolutionList._addSession(self)
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_resolve(
self.__handle,
get_handle(resolutionList),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def resolve_topics(self, info, **kwargs):\n return Topic.objects.all()",
"def createTopics(self, topicList,\n resolveMode=DONT_REGISTER_SERVICES,\n identity=None):\n topicList._addSession(self)\n _ExceptionUtil.raiseOnError(\n internals.blpa... | [
"0.5619471",
"0.50278556",
"0.4895688",
"0.48788896",
"0.48721614",
"0.4852064",
"0.47675407",
"0.4763402",
"0.47606546",
"0.47463417",
"0.47000504",
"0.46599317",
"0.46540555",
"0.45616102",
"0.4532032",
"0.45273298",
"0.45189622",
"0.44968197",
"0.4476527",
"0.44746542",
"0... | 0.49986762 | 2 |
Begin the resolution of the topics in the specified list. | def resolveAsync(self, resolutionList, resolveMode=DONT_REGISTER_SERVICES,
identity=None):
resolutionList._addSession(self)
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_resolveAsync(
self.__handle,
get_handle(resolutionLis... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topics(ctx):\n pass",
"def requestTopics(self):\n self.port.flushInput()\n # request topic sync\n self.port.write(\"\\xff\\xff\\x00\\x00\\x00\\x00\\xff\")",
"def createTopics(self, topicList,\n resolveMode=DONT_REGISTER_SERVICES,\n identity=No... | [
"0.5917889",
"0.5593826",
"0.5521185",
"0.55147785",
"0.5486879",
"0.5341535",
"0.5319744",
"0.5261397",
"0.5249089",
"0.5214205",
"0.51704174",
"0.515585",
"0.51186335",
"0.5085197",
"0.50805545",
"0.5071895",
"0.5035799",
"0.5029047",
"0.50163144",
"0.5014823",
"0.50066483"... | 0.0 | -1 |
Publish the specified ``event``. | def publish(self, event):
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_publish(
self.__handle,
get_handle(event))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def publish(self, event):\n self.pubsub_router.send(event)",
"def publish_event(self, event):\n self.channel.basic_publish(exchange='', routing_key='peripheral_event', body=json.dumps({self.name: dict(event)}))",
"def publish_event(self, topic):\n topic = \"{}/{}\".format(self._base_topic,... | [
"0.8518344",
"0.7714734",
"0.73885673",
"0.72817546",
"0.7243826",
"0.70978737",
"0.70274615",
"0.700919",
"0.6955547",
"0.692509",
"0.68137175",
"0.67673993",
"0.67483884",
"0.6654256",
"0.6640527",
"0.65918684",
"0.6559614",
"0.6488675",
"0.6479703",
"0.6479703",
"0.6479703... | 0.710338 | 5 |
Send the response event for previously received request. | def sendResponse(self, event, isPartialResponse=False):
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_sendResponse(
self.__handle,
get_handle(event),
isPartialResponse)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_response(self, response):\n if log.isEnabledFor(logging.DEBUG):\n log.debug(\n 'RESPONSE MESSAGE RECEIVED %s %s',\n repr(self),\n response,\n )\n\n self.response_queue.put(response)",
"def on_response(self, response):\n ... | [
"0.75305325",
"0.71966314",
"0.7189018",
"0.7137223",
"0.70402",
"0.69862324",
"0.68805486",
"0.67946136",
"0.66345596",
"0.6630908",
"0.66286093",
"0.6616558",
"0.6548367",
"0.64903384",
"0.63625515",
"0.6342741",
"0.6317491",
"0.62772006",
"0.6276734",
"0.62728757",
"0.6272... | 0.60526663 | 45 |
Create the topics in the specified ``topicList``. | def createTopics(self, topicList,
resolveMode=DONT_REGISTER_SERVICES,
identity=None):
topicList._addSession(self)
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_createTopics(
self.__handle,
get_handle(to... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_topic_names_dict(self, topic_names_list):\n for item in topic_names_list:\n self.topic_names[int(item[0])] = item[1]",
"def createTopicsAsync(self, topicList,\n resolveMode=DONT_REGISTER_SERVICES,\n identity=None):\n topicList.... | [
"0.68706167",
"0.66377854",
"0.6569275",
"0.6432124",
"0.64199543",
"0.6244145",
"0.59628356",
"0.59509295",
"0.585456",
"0.5837771",
"0.57457966",
"0.56597006",
"0.56432146",
"0.5617375",
"0.55305535",
"0.5503898",
"0.5488538",
"0.54264396",
"0.54223734",
"0.5395152",
"0.539... | 0.76558036 | 0 |
Create the topics in the specified ``topicList``. | def createTopicsAsync(self, topicList,
resolveMode=DONT_REGISTER_SERVICES,
identity=None):
topicList._addSession(self)
_ExceptionUtil.raiseOnError(
internals.blpapi_ProviderSession_createTopicsAsync(
self.__handle,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def createTopics(self, topicList,\n resolveMode=DONT_REGISTER_SERVICES,\n identity=None):\n topicList._addSession(self)\n _ExceptionUtil.raiseOnError(\n internals.blpapi_ProviderSession_createTopics(\n self.__handle,\n g... | [
"0.7656953",
"0.68702185",
"0.6569279",
"0.6432065",
"0.6418178",
"0.6242694",
"0.5960849",
"0.59512323",
"0.5854931",
"0.5836647",
"0.5743841",
"0.5659083",
"0.56425685",
"0.5620017",
"0.5530186",
"0.55066496",
"0.5488248",
"0.5426387",
"0.54224586",
"0.53928924",
"0.5390738... | 0.66389954 | 2 |
Deregister the service, including all registered parts. | def deregisterService(self, serviceName):
res = internals.blpapi_ProviderSession_deregisterService(
self.__handle, serviceName)
return res == 0 | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unregister_service(self, name):\n self._services.remove(name)",
"def deregister(self, service_id):\n return self.agent.http.get(\n lambda x: x.code == 200,\n '/v1/agent/service/deregister/%s' % service_id)",
"def unregister(self, service_name, ser... | [
"0.6898455",
"0.6793227",
"0.6761356",
"0.6724239",
"0.66094935",
"0.65224636",
"0.6261973",
"0.62529373",
"0.6212113",
"0.61316",
"0.61163074",
"0.61018157",
"0.59919775",
"0.5936518",
"0.5924734",
"0.592175",
"0.59013414",
"0.5892272",
"0.5868427",
"0.58223814",
"0.5805206"... | 0.62330127 | 8 |
Terminate subscriptions on the specified ``topics``. | def terminateSubscriptionsOnTopics(self, topics, message=None):
if not topics:
return
topicsCArraySize = len(topics)
topicsCArray = internals.new_topicPtrArray(topicsCArraySize)
try:
for i, topic in enumerate(topics):
internals.topicPtrArray_setite... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def unsubscribe_topics(self) -> None:\n self._sub_state = await self._mqtt_client.unsubscribe(self._sub_state)",
"def deleteTopics(self, topics):\n if not topics:\n return\n topicsCArraySize = len(topics)\n topicsCArray = internals.new_topicPtrArray(topicsCArraySize)\... | [
"0.7062804",
"0.66444796",
"0.60514265",
"0.5954148",
"0.5819437",
"0.57737565",
"0.567703",
"0.5660423",
"0.56201565",
"0.55809814",
"0.55689555",
"0.5478383",
"0.5442872",
"0.54271483",
"0.5399705",
"0.53882545",
"0.53676486",
"0.5340907",
"0.5332689",
"0.52976173",
"0.5290... | 0.8017389 | 0 |
Remove one reference from the specified 'topic'. | def deleteTopic(self, topic):
self.deleteTopics((topic,)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def remove_topic ( topics , level = ROOT.RooFit.INFO , stream = -1 ) :\n return Ostap.Utils.RemoveTopic ( topics , level , stream )",
"def remove(cls, callback, topic):\n\t\tkey_name = cls.create_key_name(callback, topic)\n\t\tdef txn():\n\t\t\tsub = cls.get_by_key_name(key_name)\n\t\t\tif sub is not None:\n... | [
"0.7058153",
"0.6934767",
"0.6645066",
"0.6582312",
"0.652157",
"0.65165186",
"0.64784384",
"0.6373137",
"0.632368",
"0.62931633",
"0.625652",
"0.6251144",
"0.6213364",
"0.6190754",
"0.6175188",
"0.6086484",
"0.60689",
"0.60646945",
"0.5991927",
"0.5930228",
"0.5906189",
"0... | 0.7626376 | 0 |
Delete each topic in the specified ``topics`` container. | def deleteTopics(self, topics):
if not topics:
return
topicsCArraySize = len(topics)
topicsCArray = internals.new_topicPtrArray(topicsCArraySize)
try:
for i, topic in enumerate(topics):
internals.topicPtrArray_setitem(topicsCArray,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def clean_test_topics(prefix=TEST_NAME_PREFIX, region_name=None):\n sns = boto3.resource('sns', region_name=region_name)\n num_topics = 0\n try:\n for topic in sns.topics.all():\n if re.match(r'.+%s\\d+' % TEST_NAME_PREFIX, topic.arn):\n topic.delete()\n num... | [
"0.6717117",
"0.6531725",
"0.6491686",
"0.6416371",
"0.639682",
"0.63144183",
"0.6268001",
"0.6214793",
"0.62056506",
"0.618058",
"0.6148262",
"0.6107258",
"0.60799146",
"0.60265",
"0.60068816",
"0.5981595",
"0.58847314",
"0.58663905",
"0.5746704",
"0.5730346",
"0.57193273",
... | 0.7512198 | 0 |
Return the internal implementation. | def _handle(self):
return self.__handle | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _create_impl(self):",
"def _build_impl(self):",
"def get_implementation(self):\n return self.__capabilities[\"IMPLEMENTATION\"]",
"def _select_implementation(self):\n return",
"def _select_implementation(self):\n return",
"def get_implementation(cls):\n\n return get_implem... | [
"0.7107441",
"0.6956048",
"0.6800998",
"0.6771021",
"0.6771021",
"0.6337738",
"0.63159007",
"0.62647194",
"0.62413657",
"0.62244004",
"0.620911",
"0.6206774",
"0.6194508",
"0.6186584",
"0.618439",
"0.61818457",
"0.61628395",
"0.61559534",
"0.61113584",
"0.60820746",
"0.606710... | 0.0 | -1 |
Returns nearby discovered lights. | def discover(timeout=10):
_LOGGER.info("Starting scan for local devices")
import pygatt
adapter = pygatt.GATTToolBackend()
lights = []
try:
adapter.start(reset_on_start=False)
for device in adapter.scan(timeout=timeout):
# Improvements welcome
if device['nam... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lights(self):\n return list(self.GetLights())",
"def getNear(self):\n return self.light.node().getLens().getNear()",
"def lights(self) -> List[dict]:\n return self.items_by_domain(\"light\")",
"def get_nrof_lights(self):\n lights = 0\n for l in self.light_array:\n ... | [
"0.67438024",
"0.66029465",
"0.64719933",
"0.6391543",
"0.6388994",
"0.6142253",
"0.6042641",
"0.6042641",
"0.6042641",
"0.6042641",
"0.5968128",
"0.58769757",
"0.5811524",
"0.57750624",
"0.57324576",
"0.5696062",
"0.5689222",
"0.56584287",
"0.56221586",
"0.5621374",
"0.56127... | 0.5703319 | 15 |
test the return number | def test01getNumber(self):
self.assertEqual( calc.getNumber(), 1234 ) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_num_buses_5(self):\n actual = a1.num_buses(1001)\n expected = 21\n self.assertEqual(actual,expected)",
"def test_result(self):\n result = compute()\n self.assertEqual(result, '4782')\n print(\"eulpy25Test passed\")",
"def check_for_int(check):",
"def test_ca... | [
"0.6635828",
"0.6630164",
"0.66138774",
"0.65320885",
"0.65078735",
"0.65070564",
"0.64652544",
"0.64387274",
"0.6383702",
"0.6378187",
"0.6359872",
"0.63548714",
"0.6310623",
"0.63097364",
"0.63067204",
"0.62865865",
"0.6272749",
"0.6271618",
"0.6259138",
"0.62460345",
"0.62... | 0.68817997 | 0 |
check if service return proper dict | def test01getNumber(self):
self.assertEqual( views.getNumber({}), {'number': 1234}) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_for_dict(check):",
"def _make_dict(self, service):\n\n if service['ServiceAddress']:\n host = service['ServiceAddress']\n else:\n host = service['Address']\n \n\n info = {\n 'host': host,\n 'port': service['ServicePort']\... | [
"0.6672359",
"0.6606568",
"0.645104",
"0.6226241",
"0.60939014",
"0.6078599",
"0.60437316",
"0.6040296",
"0.6007319",
"0.59785926",
"0.5930077",
"0.5870959",
"0.5859909",
"0.58553386",
"0.58517325",
"0.5843189",
"0.58167195",
"0.57874876",
"0.57684463",
"0.57635343",
"0.57580... | 0.0 | -1 |
Affiche le formulaire de login LDAP et redirige vers la bonne page | def Login_LDAP(request):
request.session['LDAP'] = True
if request.method == "POST":
form = AuthenticationForm(request, data=request.POST)
if form.is_valid():
auth_login(request, form.get_user())
request.session['uid_client'] = str(request.user.username)
ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ldap_login():\n if not current_app.config[\"USE_LDAP\"]:\n return redirect(url_for(\"auth.login\"))\n login_form = BasicLoginForm()\n if request.method == \"POST\":\n email = request.form[\"email\"]\n password = request.form[\"password\"]\n\n user = find_user_by_email(email... | [
"0.67161715",
"0.6500939",
"0.6500939",
"0.6326267",
"0.6275793",
"0.62278825",
"0.61198694",
"0.5962143",
"0.5959095",
"0.5932996",
"0.592137",
"0.5918865",
"0.59158325",
"0.58910817",
"0.5848556",
"0.58342665",
"0.5755914",
"0.57493055",
"0.57470804",
"0.5729529",
"0.572502... | 0.7063932 | 0 |
Affiche un formulaire de contact | def Contact(request):
if request.method == 'POST':
form = ContactForm(request.POST)
if form.is_valid():
nom = form.cleaned_data['nom'].encode("utf-8")
prenom = form.cleaned_data['prenom'].encode("utf-8")
mail = form.cleaned_data['mail']
batiment = fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calculDeFraisPortuaire():\n TARIFMENSUEL1 = 100\n TARIFMENSUEL2 = 200\n TARIFMENSUEL3 = 400\n TARIFMENSUEL4 = 600\n TAXESPECIALEANNUELLEVOILIERCATEGORIE1 = 100\n TAXESPECIALEANNUELLEVOILIERCATEGORIE2 = 150\n TAXESPECIALEANNUELLEVOILIERCATEGORIE3 = 250\n \n coutMensuel = 0\n coutAn... | [
"0.5708105",
"0.5696402",
"0.5677031",
"0.55674106",
"0.54881096",
"0.5390515",
"0.5318719",
"0.52981067",
"0.5290656",
"0.5277363",
"0.5246352",
"0.5224843",
"0.5210191",
"0.5205192",
"0.51813877",
"0.51658773",
"0.5158325",
"0.50863665",
"0.5069612",
"0.50613564",
"0.505240... | 0.0 | -1 |
''Serializes an instance of a generated class to JSON. | def to_json(obj):
return json.dumps(obj, indent=2, default=_generated_class_serializer) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cls2json(self):\n return json.dumps(self.__dict__)",
"def cls2json(self):\n return json.dumps(self.__dict__)",
"def to_json(self):\n obj_dict = self.__dict__\n obj_dict[\"_class_\"] = self.__class__.__name__\n return obj_dict",
"def class_to_json(obj):\n return obj._... | [
"0.7412557",
"0.7412557",
"0.69891614",
"0.687196",
"0.687196",
"0.687196",
"0.687196",
"0.687196",
"0.687196",
"0.687196",
"0.6702202",
"0.6702202",
"0.66765434",
"0.6628387",
"0.66215885",
"0.6530242",
"0.6490399",
"0.6457447",
"0.6442986",
"0.6425356",
"0.6415279",
"0.64... | 0.660348 | 15 |
3x3 convolution with padding | def conv3x3(in_planes, out_planes, stride=1):
return nn.Conv2d(in_planes, out_planes, kernel_size=3, stride=stride,
padding=1, bias=False) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def conv3x3(in_planes, out_planes, stride=1, dilation=1, padding=1):\n return nn.Conv2d(in_planes,\n out_planes,\n kernel_size=3,\n stride=stride,\n padding=padding,\n dilation=dilation,\n bia... | [
"0.7547292",
"0.737608",
"0.7322968",
"0.7298931",
"0.7279593",
"0.72755706",
"0.72495335",
"0.72347564",
"0.7228567",
"0.72234154",
"0.7184916",
"0.7177543",
"0.7163412",
"0.7163412",
"0.7163412",
"0.71573323",
"0.7155279",
"0.7155279",
"0.7155279",
"0.7155279",
"0.7155279",... | 0.707965 | 75 |
Run the body of the included modules in order, using the current variables and imports | def build(self): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def modules():",
"def run_before(self):\n\n for path in self.hooks.get('before', []):\n self.run_module(path)",
"def process_module_list(self, modules):",
"def run_modules():\n pool = Pool()\n if module_inc_opts != ['']:\n runmods = gen_runlist(module_inc_opts, available_mods)\... | [
"0.62045574",
"0.605785",
"0.5979435",
"0.5802352",
"0.57793653",
"0.5740892",
"0.5733469",
"0.5639204",
"0.55996436",
"0.5582995",
"0.5564289",
"0.5558456",
"0.55579025",
"0.5551452",
"0.55438364",
"0.55438364",
"0.54109544",
"0.5398906",
"0.5385057",
"0.5346258",
"0.5331608... | 0.0 | -1 |
This redefines the symbols in the kwargs | def include(self, symbolic_module, name=None):
if name is None:
name = symbolic_module.name | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_kwargs(self, kwargs):\n accept = {\"command\" : None,\n \"clicked\" : False,\n \"unclick\" : False,\n \"active\" : True,\n \"key_bindings\" : []}\n for kwarg in kwargs:\n if kwarg in accept:\n accept... | [
"0.6536205",
"0.6364414",
"0.61146927",
"0.60841",
"0.60122573",
"0.600601",
"0.59885365",
"0.58887017",
"0.5882431",
"0.587605",
"0.58730656",
"0.5862508",
"0.5850115",
"0.58374035",
"0.5810474",
"0.5787549",
"0.575221",
"0.573789",
"0.5713887",
"0.5707728",
"0.5687643",
"... | 0.0 | -1 |
A constructor fn builds a graph on top of the variable table, and compilable methods. | def __init__(self, constructor_fn=None): | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __init__(self):\n\n # Initialize the fields that all formulae have\n self.nvars = 0\n self.nclauses = 0\n self.base_clauses = []\n self.aux_clauses = []\n\n # Create variable meaning table\n #\n # Variable meaning is a table which maps boolean varibles to... | [
"0.6674163",
"0.65501994",
"0.6499824",
"0.64810723",
"0.6445334",
"0.6402362",
"0.62710416",
"0.6217595",
"0.6215214",
"0.6195523",
"0.61620176",
"0.6110061",
"0.610798",
"0.6102461",
"0.60655427",
"0.60396594",
"0.60178953",
"0.6004119",
"0.5977108",
"0.5973491",
"0.5973247... | 0.610699 | 14 |
Saves all nontrivial attributes from an object. skip_at_save can be a list of names of attributes to skip at saving. | def save_contents(custom_object, upperfolder=None, label=None, remove_existing=True, skip_at_save=[], verbose=0, label_seperate_folder=True):
verboseprint = print if verbose else lambda *a, **k: None
if hasattr(custom_object, 'label'):
label = custom_object.label
assert label, 'No valid label f... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _save(self):\n for attrib in self.attribs:\n setattr(self, attrib, getattr(self.obj, attrib))",
"def DisableSaving(self):\n\n self._doSave = False",
"def save_observations(self, observations):\n Observation.objects.bulk_create(\n [v['observation'] for v in observa... | [
"0.5693133",
"0.517256",
"0.5054588",
"0.5017016",
"0.50055116",
"0.49502096",
"0.49405536",
"0.4871305",
"0.48296395",
"0.4822592",
"0.4819533",
"0.477185",
"0.4761645",
"0.47224668",
"0.47205883",
"0.47032884",
"0.46475852",
"0.46357793",
"0.46288475",
"0.46248075",
"0.4603... | 0.47314942 | 13 |
Loads all data from a folder into the 'empty object' | def load_contents(empty_object, upperfolder=None, label=None, skip_at_load=[], verbose=0, label_seperate_folder=True, attributes=None):
skip_at_load.append('type')
verboseprint = print if verbose else lambda *a, **k: None
if hasattr(empty_object, 'label'):
label = empty_object.label
assert ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _load(self, directory):\n pass",
"def load_all_files(self):\n\t\tself.get_rankings()\n\t\tself.get_partition()\n\t\tself.__load_factors()\n\t\tself.get_document_associations()\n\t\tself.get_term_associations()",
"def file_loader(self):\n\n for folder in self.config[\"data_folders\"]:\n ... | [
"0.7066367",
"0.6852099",
"0.68487805",
"0.67659545",
"0.6613639",
"0.65754616",
"0.655142",
"0.6461715",
"0.6432239",
"0.63988084",
"0.63822037",
"0.63684434",
"0.63396263",
"0.63260627",
"0.63097847",
"0.6272564",
"0.6267147",
"0.6267026",
"0.62524575",
"0.62478393",
"0.623... | 0.623836 | 20 |
Creates a subset of the dictionary where the simulation is in the selection. | def select_simulations(simulations, selection):
if not selection:
return simulations
selection = list(product(*selection))
selected = {}
for key, simulation in zip(simulations, simulations.values()):
strategy = simulation.strategy
features = (type(strategy), strategy.build_r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def dict_subset(self, workspace_unique_id=None, subset_unique_id=None, request=None):\n workspace_object = self._get_workspace_object(unique_id=workspace_unique_id)\n \n subset_dict = {'alias': None,\n 'uuid': None,\n 'status': None,\n ... | [
"0.6019636",
"0.5979485",
"0.5731181",
"0.5716021",
"0.5648026",
"0.54815924",
"0.54749",
"0.54577816",
"0.5456529",
"0.5417815",
"0.53983194",
"0.53935695",
"0.5373298",
"0.5318357",
"0.52873677",
"0.52844536",
"0.52688044",
"0.5265663",
"0.5255866",
"0.52456415",
"0.5158022... | 0.65642875 | 0 |
Indent list of script with specfied number of spaces | def _add_indent(script, indent=2):
if not isinstance(script, list):
script = [script]
indent = ' ' * indent
return [indent + s for s in script] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def Indent(indents):\n return ' ' * (2 * indents)",
"def block_indent(text, spaces=4):\n return '\\n'.join([(' ' * spaces) + l for l in pprint.pformat(text).splitlines()])",
"def indent(text, first_line=True, n=1, width=4):\n lines = text.split(\"\\n\")\n if not first_line:\n first = lines[0]\... | [
"0.678004",
"0.65462357",
"0.63632685",
"0.6348854",
"0.6317167",
"0.6316129",
"0.6261402",
"0.6259297",
"0.6214909",
"0.61949044",
"0.618525",
"0.61478776",
"0.61204535",
"0.6078298",
"0.60121745",
"0.60079765",
"0.59912515",
"0.5990122",
"0.5940539",
"0.5938867",
"0.5938867... | 0.7203517 | 0 |
Make turtle t draw a Koch fractal of 'order' and 'size'. Leave the turtle facing the same direction. | def koch(t, order, size):
if order == 0:
t.forward(size)
return
for turn in (60, -120, 60, 0):
koch(t, order - 1, size // 3)
t.left(turn) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def koch(order,size):\n if order ==0: #the base case is just a straight line\n forward(size)\n else:\n koch(order-1,size/3) #Go 1/3 of the way\n left(60)\n koch(order-1,size/3)\n right(120)\n koch(order-1,size/3)\n left(60)\n koch(order-1,size/3)",
... | [
"0.75740767",
"0.7546782",
"0.69767153",
"0.6492877",
"0.586736",
"0.56975794",
"0.5681211",
"0.5602686",
"0.558817",
"0.55759645",
"0.54683185",
"0.54251844",
"0.5404782",
"0.53933793",
"0.53776085",
"0.5367114",
"0.5341869",
"0.5329268",
"0.5312794",
"0.5304687",
"0.5294547... | 0.7200291 | 2 |
Make turtle t draw a Koch fractal snowflake of 'order' and 'size'. | def koch_snowflake(t, order, size):
for i in range(3):
koch(t, order, size)
t.right(120) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def koch(order,size):\n if order ==0: #the base case is just a straight line\n forward(size)\n else:\n koch(order-1,size/3) #Go 1/3 of the way\n left(60)\n koch(order-1,size/3)\n right(120)\n koch(order-1,size/3)\n left(60)\n koch(order-1,size/3)",
... | [
"0.7422366",
"0.7169986",
"0.6955472",
"0.60553676",
"0.59529525",
"0.59273285",
"0.5921978",
"0.587796",
"0.58492124",
"0.58330137",
"0.5767728",
"0.5758325",
"0.57564807",
"0.57235664",
"0.5720436",
"0.5711503",
"0.5667234",
"0.56353366",
"0.56094295",
"0.55643004",
"0.5550... | 0.75143373 | 0 |
Change location and remove holdinds infos | def item_change_location(item,location,call):
mms_id, holding_id, pid = item.find(".//mms_id").text, item.find(".//holding_id").text, item.find(".//pid").text
item.find(".//item_data/location").text = location
# On nettoie la cote présente au niveau de l'exemplaire
item.find(".//item_data/alternative_ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def on_scrub_geo(self, notice):\n log.debug(\"Received location deletion notice: %s\", notice)",
"def __location_del(self):\n self.db_location = None\n self.save(update_fields=[\"db_location\"])",
"def location(self):\n del self._location",
"def clear_location(self, obj):\n ... | [
"0.6311966",
"0.6283962",
"0.62427586",
"0.6127258",
"0.58821946",
"0.5847065",
"0.5791541",
"0.57191086",
"0.57091355",
"0.5702723",
"0.56495506",
"0.563996",
"0.55591315",
"0.5555923",
"0.5540123",
"0.5538754",
"0.5511241",
"0.55010915",
"0.54988086",
"0.5493352",
"0.547322... | 0.6305883 | 1 |
Change call (852$$h) and reset call type (852 fiest indicator) | def update_holding_data(holding,new_call):
holding_data = ET.fromstring(holding)
location_field =holding_data.find(".//datafield[@tag='852']")
location_field.set('ind1', ' ')
call_subfield = holding_data.find(".//datafield[@tag='852']/subfield[@code='h']")
call_subfield.text = new_call
return ET... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def toggle_call(self) -> None:",
"def event_m20_11_3010():\n \"\"\"State 0,3: [Preset] Voice frog singing voice_SubState\"\"\"\n call = event_m20_11_x97(z32=211000081, z33=201120002, z34=802, z35=301000, z36=301001, z37=301010,\n z38=301011)\n if call.Get() == 0:\n \"\"... | [
"0.5732954",
"0.53335285",
"0.52655077",
"0.52545184",
"0.5210084",
"0.5201718",
"0.51693034",
"0.50943756",
"0.5075522",
"0.5037217",
"0.5021539",
"0.50171703",
"0.49897885",
"0.4987933",
"0.49767253",
"0.4971139",
"0.49524513",
"0.49284253",
"0.4924097",
"0.49138236",
"0.49... | 0.46118465 | 82 |
Overwriting the call function from the BasicLSTMCell. | def __call__(self, inputs, state):
output, next_state = super(BinaryLSTM, self).__call__(inputs, state)
with tf.variable_scope(self._cell_name):
binary_cell_state = Bsn_layer.bsn_layer(next_state[0],
stochastic_method=self.stochastic_meth... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lstm_cell(input, cx):\n return FunctionLib.apply('LSTMCell', input.device, [input, cx])",
"def lstm_cell(inputs, **kwargs):\n if context.executing_eagerly():\n return OpLib.execute('LSTMCell', inputs, outputs=[None, None])\n return OpLib.add('LSTMCell', num_outputs=2, **kwargs)",
"def lstm_... | [
"0.6992843",
"0.6428267",
"0.62015283",
"0.6131307",
"0.59583795",
"0.595212",
"0.5930718",
"0.5896965",
"0.5872551",
"0.5852127",
"0.5784375",
"0.5783825",
"0.57828707",
"0.577523",
"0.57634664",
"0.5735126",
"0.5723888",
"0.5719531",
"0.56887203",
"0.56464297",
"0.5638077",... | 0.61635554 | 3 |
Returns global coordinates from pixel x, y coords | def pixel2coord(x, y,a,b,xoff,yoff,d,e):
xp = a * x + b * y + xoff
yp = d * x + e * y + yoff
return(xp, yp) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def pixel2coords(self, x, y):\n xoff, a, b, yoff, d, e = self.geotransform()\n\n xp = a * x + b * y + xoff\n yp = d * x + e * y + yoff\n return (xp, yp)",
"def pixel_to_coords(self, x, y):\n rx, ry = self.size\n nx = (x / rx - 0.5) * self.scale + self.center[0]\n ... | [
"0.75387365",
"0.73459256",
"0.7331016",
"0.7242879",
"0.71819633",
"0.7120852",
"0.7101396",
"0.7093473",
"0.6956462",
"0.6861923",
"0.68123055",
"0.67904943",
"0.67734706",
"0.6719065",
"0.6695873",
"0.6670607",
"0.6594301",
"0.6570155",
"0.65697646",
"0.6564227",
"0.655977... | 0.73163605 | 3 |
Shows basic usage of the Sheets API. Prints values from a sample spreadsheet. | def main(dayName):
# The file token.json stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
store = file.Storage('token.json')
creds = store.get()
if not creds or creds.invalid:
flow = client.flow_from_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def main():\n credentials = service_account.Credentials.from_service_account_file(\n CREDENTIALS_FILE,\n scopes=SCOPES,\n subject=SUBJECT)\n service = build('sheets', 'v4', credentials=credentials)\n\n # Call the Sheets API\n sheet = service.spreadsheets()\n result = sheet.value... | [
"0.7996524",
"0.61316925",
"0.60968316",
"0.5815157",
"0.58086216",
"0.5730579",
"0.5676201",
"0.5607216",
"0.5522882",
"0.5494013",
"0.5455875",
"0.5395879",
"0.53955066",
"0.53686666",
"0.53137815",
"0.5256192",
"0.5251957",
"0.5244902",
"0.5224134",
"0.52138925",
"0.519713... | 0.44600764 | 98 |
Return first action available. | def action(self, gstate, actions):
self.log.debug("Picking among actions %s" % actions)
return actions[0] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_next_action(self):\n chosen_action = None\n while chosen_action is None:\n choice = input('Action: ')\n chosen_action = KEY_MAP.get(choice)\n\n return chosen_action",
"def act(self):\n action = self.best_action()\n return action",
"def obtain_act... | [
"0.7558568",
"0.72400796",
"0.7225529",
"0.71959597",
"0.70714104",
"0.70577955",
"0.7025846",
"0.7017938",
"0.70066786",
"0.70066786",
"0.69818544",
"0.697815",
"0.6907613",
"0.68857753",
"0.68663526",
"0.68656856",
"0.68561196",
"0.68401617",
"0.68360764",
"0.6825376",
"0.6... | 0.6904398 | 13 |
Retrieve random item from a specific user | def read_random_item(user_id: int, db: Session = Depends(get_db)):
# Call function to retrieve a random item of a given user
return crud.get_random_item(user_id, db) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_random_user():\n return random.choice(User.query.all())",
"def random_item(self):\n if self.sample_negative_items_empirically:\n # just pick something someone rated!\n # TODO: choose a user randomly\n u = self.uniform_user()\n i = random.choice(self.... | [
"0.7474558",
"0.7125966",
"0.7118969",
"0.7068893",
"0.6669621",
"0.66101635",
"0.6560288",
"0.6541061",
"0.63898385",
"0.6346477",
"0.6323449",
"0.62743485",
"0.6265992",
"0.6253394",
"0.6202236",
"0.6174827",
"0.6160766",
"0.61526877",
"0.6136936",
"0.6134017",
"0.60037136"... | 0.8279984 | 0 |
Update the status user_have of an item from a specific user | def update_user_has_item(user_id: int, item: schemas.UserGotItem, db: Session = Depends(get_db)):
# Call function to update status of user_have
return crud.update_user_got_item(db, item, user_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_item(self, id: str, user: User, **kwargs) -> None:",
"def update(self, user: U) -> None:\n ...",
"def update_user(self, user):\n query = TABELLE['id_users']['update']\n return self.execute(query,\n (user['admin'], user['tester'], user['loot_user'], use... | [
"0.68695474",
"0.65586406",
"0.6425909",
"0.63877845",
"0.6239298",
"0.61995554",
"0.6113544",
"0.6012988",
"0.5979058",
"0.5944657",
"0.5937036",
"0.593273",
"0.58492756",
"0.5836475",
"0.5824219",
"0.58052033",
"0.5803511",
"0.5794394",
"0.5766496",
"0.5749233",
"0.572701",... | 0.8608332 | 0 |
Retrieve details of a specific User | def read_user(user_id: int, db: Session = Depends(get_db)):
# Call function to retrieve the details of a given User
return crud.get_user(db, user_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def user_info(user_id):\n return User.query.filter_by(id=user_id).first()",
"def get_user_details():\n rv = query_db('select * from user')\n return rv[0] if rv else None",
"def getUserInfo(user_id):\r\n user = session.query(User_info).filter_by(id=user_id).one()\r\n return user",
"def getUserI... | [
"0.7921817",
"0.77405167",
"0.76177275",
"0.7592544",
"0.75683784",
"0.75683784",
"0.75674504",
"0.75674504",
"0.75625336",
"0.75149286",
"0.74981135",
"0.73685753",
"0.73581505",
"0.7350817",
"0.7317882",
"0.73140717",
"0.7302578",
"0.72983754",
"0.72708255",
"0.7264622",
"0... | 0.7598861 | 3 |
Create a REST client object. | def __init__(self, uri, api_version=None, key=None, secret=None, key_file=None,
timeout=5, log=logging.getLogger('RESTClientAPILogger')):
self._key = key
self._secret = secret
if key_file:
self._load_key(key_file)
self.authenticated = False
self._uri ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_client(self) -> None:\n pass",
"def make_client(self, context):\n return Client(self.settings['client_routing'], context=context)",
"def new(\n host: str = \"localhost\",\n port: int = 4110,\n user: str = \"pyserval\",\n passwd: str = \"pyserval\",\n ):\n ... | [
"0.71850127",
"0.7113421",
"0.708544",
"0.6857369",
"0.66742724",
"0.6606417",
"0.6587235",
"0.6575789",
"0.65249735",
"0.65173286",
"0.6511362",
"0.6439651",
"0.64289254",
"0.63235945",
"0.63203",
"0.6259095",
"0.6193629",
"0.61685336",
"0.6162891",
"0.61568725",
"0.6121456"... | 0.6167761 | 18 |
Return the name of the exchange. This is used by the RESTClientFactory and is NOT the name of the class, but is defined by the class implementation. | def name():
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_exchange_name(self):\n LOGGER.info('Getting the exchange name')\n if self._exchange is None:\n raise ExchangeNotDefinedYet('The exchange is not defined')\n return self._exchange",
"def get_name(cls):\n return cls.__name__",
"def name(self):\n\n return self.... | [
"0.8098211",
"0.6656022",
"0.66340804",
"0.662712",
"0.6609683",
"0.6591373",
"0.6591373",
"0.6591373",
"0.6591373",
"0.6591373",
"0.65405357",
"0.653918",
"0.653918",
"0.6534172",
"0.65311414",
"0.64898247",
"0.6486621",
"0.6480957",
"0.6480957",
"0.6480957",
"0.6454231",
... | 0.0 | -1 |
Creates a Nonce value for signature generation | def _nonce():
return str(round(100000 * time.time()) * 2) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_nonce():\n default_seed = 'ifh2847fhsn\"lqOEYd@#Djh(&'\n hash = sha.new(default_seed)\n hash.update(str(datetime.utcnow()))\n return hash.hexdigest()",
"def generate_nonce():\n return str(int(round(time.time() * 1000)))",
"def generate_nonce():\n return uuid4().hex",
"def _genera... | [
"0.7800538",
"0.75630814",
"0.75570804",
"0.73328894",
"0.72468144",
"0.7182909",
"0.7182909",
"0.7068418",
"0.6973466",
"0.6931927",
"0.6827415",
"0.68171847",
"0.6767279",
"0.6691431",
"0.66875285",
"0.664408",
"0.66286474",
"0.6607481",
"0.6607481",
"0.6575023",
"0.6567677... | 0.7053242 | 8 |
Wrapper which converts a requests.Response into our custom APIResponse object. | def _api_request(*args, **kwargs):
response = requests.request(*args, **kwargs)
return APIResponse(response) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wrap(cls, response):\n response.__class__ = cls\n return response",
"def adapt_response(self, response):\n return response",
"def adapt_response(self, response):\n return response",
"def __call__(self, rv):\n raise NotImplementedError(\"You must subclass from ApiRespons... | [
"0.7092987",
"0.69335306",
"0.69335306",
"0.67178637",
"0.6642121",
"0.65746474",
"0.654675",
"0.65157187",
"0.64544624",
"0.6355239",
"0.6330922",
"0.6329601",
"0.630538",
"0.6299199",
"0.62914807",
"0.6281996",
"0.6274543",
"0.625079",
"0.62301445",
"0.6228156",
"0.6217798"... | 0.56495196 | 76 |
Load key and secret from file. | def _load_key(self, path):
with open(path, 'r') as f:
self._key = f.readline().strip()
self._secret = f.readline().strip() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_key():\n return open(\"secret.key\", \"rb\").read()",
"def load_key():\n return open(\"Secret.key\",\"rb\").read()",
"def load_key():\n return open(\"pass.key\", \"rb\").read()",
"def import_secrets_file(path_to_file) -> dict:\n if not os.path.exists(path_to_file):\n raise... | [
"0.8180709",
"0.80317634",
"0.74399465",
"0.71306133",
"0.69129366",
"0.69021285",
"0.68550664",
"0.68440795",
"0.6790363",
"0.6718948",
"0.67165995",
"0.6698039",
"0.66960686",
"0.6663742",
"0.65302885",
"0.65072817",
"0.6456602",
"0.64125156",
"0.63851964",
"0.6383637",
"0.... | 0.84370255 | 0 |
Makes a query to an exchange. Defaults to unauthenticated query. | def _query(self, request_method, endpoint, authenticate=False, *args, **kwargs):
if self._version:
endpoint_path = join(self._version, endpoint)
else:
endpoint_path = endpoint
url = urljoin(self._uri, endpoint_path)
if authenticate:
# sign off kwargs ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_exchange(self, exchange_name, alt_exchange_name=None):\n return self._query(exchange_name, \"exchange\", \"org.apache.qpid.broker\", alt_exchange_name)",
"def _query(self, url, payload=None, action='GET'):\r\n full_url = self._base + url\r\n\r\n headers = {\r\n 'Content-... | [
"0.60968786",
"0.5607839",
"0.55039805",
"0.5417188",
"0.5373888",
"0.531113",
"0.52916044",
"0.52830875",
"0.52299416",
"0.5223504",
"0.5196868",
"0.5188451",
"0.51836115",
"0.5167681",
"0.5158363",
"0.51481956",
"0.5084479",
"0.50843745",
"0.50725526",
"0.5055081",
"0.50359... | 0.6131428 | 0 |
Dummy Signature creation method. Override this in child. | def _sign(self, url, endpoint, endpoint_path, method_verb, *args, **kwargs):
url = self._uri
return url, {'params': {'test_param': "authenticated_test_user"}} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def signature(cls):\n raise NotImplementedError(\"%s.signature()\" % cls)",
"def handle_signature(self, sig, signode):\n raise NotImplementedError",
"def signature(self, p_int): # real signature unknown; restored from __doc__\n return \"\"",
"def reconstruct_signature(self):\n rai... | [
"0.7274563",
"0.7132262",
"0.68580836",
"0.68464196",
"0.6711416",
"0.6667368",
"0.6509589",
"0.6449681",
"0.6354632",
"0.6350934",
"0.63381666",
"0.63031155",
"0.6262267",
"0.6215261",
"0.61956644",
"0.6192647",
"0.61358804",
"0.6132519",
"0.61241364",
"0.60555",
"0.6023259"... | 0.0 | -1 |
Get a list of base (quote) currencies. | def quote_currencies(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def currencies():\n return _CURRENCIES",
"def get_currencies(self) -> list:\n return self.client.currencies.get_all()",
"def getCurrencies():",
"def get_currencies(self):\n return self.__call__('currencies', 'getcurrencies')",
"def get_currencies():\n url = '{}/v1/finance/currencies'.fo... | [
"0.77923894",
"0.77496535",
"0.76445425",
"0.75913256",
"0.7576912",
"0.7497801",
"0.74583507",
"0.73620987",
"0.72927326",
"0.72746956",
"0.70418644",
"0.6945214",
"0.69265485",
"0.68949586",
"0.6864967",
"0.67317426",
"0.6709419",
"0.6701316",
"0.665616",
"0.6541852",
"0.63... | 0.67654127 | 15 |
Get a list of all the symbols supported by an exchange. | def symbols(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _get_symbols(exchange_code: str, token: str) -> List[mtypes.Symbol]:\n _LOG.info(\"Getting symbols list for exchange: '%s'\", exchange_code)\n response = get_client().service.SymbolList(\n Token=token, Exchange=exchange_code\n )\n\n if response.SYMBOLS is None:\n _LOG.error(\"No symbo... | [
"0.73797035",
"0.7000617",
"0.6983134",
"0.68795425",
"0.6838933",
"0.66596204",
"0.6641768",
"0.64660376",
"0.64614564",
"0.639563",
"0.6366333",
"0.63268703",
"0.6178708",
"0.61759555",
"0.61080074",
"0.6098974",
"0.59878904",
"0.5957313",
"0.5948926",
"0.5877081",
"0.58261... | 0.55831635 | 37 |
Get info about symbols. | def symbols_details(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_symbols(self):\n uri = \"/v3/spot/symbols\"\n success, error = await self.request(\"GET\", uri)\n return success, error",
"def get_symbols(self):\n\n raise NotImplementedError('''\n Must implement get_symbols. Call help() for details.\n ''')",
"def ge... | [
"0.7484498",
"0.7385139",
"0.69960177",
"0.69073164",
"0.6904801",
"0.68360484",
"0.68151563",
"0.67703456",
"0.6584045",
"0.6495443",
"0.64943147",
"0.6391442",
"0.6371202",
"0.63569576",
"0.6345548",
"0.63006157",
"0.62910974",
"0.62232727",
"0.6211335",
"0.61671656",
"0.61... | 0.73987716 | 1 |
Get the list of valid candle intervals (exchange specific). | def candle_intervals(self):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_intervals(self, account):\n buckets = []\n for monitor in self.get_watchauditors(account):\n interval = monitor.watcher.get_interval()\n if not interval in buckets:\n buckets.append(interval)\n return buckets",
"def calculate_intervals(tick_times:... | [
"0.6340812",
"0.63123465",
"0.6303981",
"0.6293205",
"0.62897766",
"0.6106531",
"0.6089314",
"0.60742784",
"0.6056386",
"0.60471463",
"0.5974646",
"0.5887091",
"0.5841532",
"0.576591",
"0.5762848",
"0.5738798",
"0.56885105",
"0.56869256",
"0.5673144",
"0.5598547",
"0.5549075"... | 0.76367754 | 0 |
Get a ticker for a given symbol. | def ticker(self, symbol, **kwargs):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_ticker(self, ticker_symbol):\n return",
"async def fetch_ticker(self, symbol: str, params={}):\n await self.load_markets()\n market = self.market(symbol)\n request = {\n 'symbol': market['id'],\n }\n response = await self.publicGetInstrument(self.exten... | [
"0.8526692",
"0.8007852",
"0.79738283",
"0.77877426",
"0.77595145",
"0.7658902",
"0.7647288",
"0.74181074",
"0.7413044",
"0.73074657",
"0.73002267",
"0.72216076",
"0.7210143",
"0.7170841",
"0.71464074",
"0.71259433",
"0.7083608",
"0.69574374",
"0.68109745",
"0.67262286",
"0.6... | 0.725306 | 11 |
Get the recen ttrades for a given symbol. | def trades(self, symbol, **kwargs):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def get_trades(self, symbol, limit=100):\n uri = \"/v3/trades\"\n params = {\n \"symbol\": symbol,\n \"limit\": limit\n }\n success, error = await self.request(\"GET\", uri, params)\n return success, error",
"def fetch_mytrades(self, symbol):\r\n ... | [
"0.6715415",
"0.62551725",
"0.60577923",
"0.5863465",
"0.58529305",
"0.5849688",
"0.57926756",
"0.5714214",
"0.5705128",
"0.5703442",
"0.5686659",
"0.56796104",
"0.5678938",
"0.56213707",
"0.5576611",
"0.55713135",
"0.55360305",
"0.5535824",
"0.5391745",
"0.5361238",
"0.53324... | 0.5838836 | 6 |
Get candle data for a given symbol and specified candle interval. | def candles(self, symbol, interval='1m', **kwargs):
pass | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def historical_candles(self, symbol, interval, start_time, end_time, **kwargs):\n pass",
"def create_get_candles_request(self, symbol: str,\n interval: CandleInterval,\n start_time: Optional[int] = None,\n ... | [
"0.7027467",
"0.69658256",
"0.6760748",
"0.6606465",
"0.6411149",
"0.63986117",
"0.63411564",
"0.6280943",
"0.625711",
"0.6228116",
"0.6205629",
"0.6192808",
"0.61234635",
"0.5985405",
"0.5956331",
"0.59532964",
"0.58683693",
"0.5837964",
"0.58355016",
"0.5832601",
"0.5791304... | 0.7928721 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.