query
stringlengths
9
9.05k
document
stringlengths
10
222k
metadata
dict
negatives
listlengths
30
30
negative_scores
listlengths
30
30
document_score
stringlengths
4
10
document_rank
stringclasses
2 values
Creates and initializes sample node
def __init__(self, size = 1000, discard_sample = False, method = 'first'): super(SampleNode, self).__init__() self.size = size self.discard_sample = discard_sample self.method = method # random nodes need a stack to hold intermediate records if method == "random": ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_samples(self):\n self._samples = self.load_samples()\n self.modify_samples()", "def sample(self):\n # This method is set in __init__.\n pass", "def __init__(self, samples):\n self.samples = samples", "def test_init_node():\n from dll import Node\n new_node ...
[ "0.66691697", "0.63650256", "0.6305994", "0.6236223", "0.61822116", "0.6144689", "0.60762167", "0.6021695", "0.6018056", "0.60071146", "0.5990444", "0.5934135", "0.5927976", "0.5907521", "0.58858216", "0.5863495", "0.5825628", "0.5798176", "0.57928085", "0.5752973", "0.574046...
0.643904
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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 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
Get historical candle data fro a given time period.
def historical_candles(self, symbol, interval, start_time, end_time, **kwargs): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history(self, t_minus=0):\n data = self.ohlcv_df[self.ohlcv_df.index <= utc_to_epoch(\n self.prior_time)]\n return OHLCVData(data[-t_minus:])", "def get_candles(self, exchange: str, symbol: str, timeframe: str) -> np.ndarray:\n return store.candles.get_candles(exchange, symbol...
[ "0.6971255", "0.6928205", "0.69048023", "0.68139064", "0.6760691", "0.6760632", "0.6622193", "0.65805143", "0.6545956", "0.6524185", "0.6452969", "0.64112544", "0.6368604", "0.6332906", "0.62834126", "0.6267579", "0.62272704", "0.62151915", "0.6207075", "0.6167549", "0.616567...
0.7047711
0
Sets the dimention of the stokes vector.
def set_stokes_dim(self, stokes_dim): if stokes_dim not in [1, 2, 3, 4]: raise ValueError( "The dimention of the stokes vector can only be 1, 2, 3 or 4" ) self.stokes_dim = stokes_dim
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setidd(self, iddinfo, iddindex, block, idd_version):\n self.idd_info = iddinfo\n self.block = block\n self.idd_index = iddindex\n self.idd_version = idd_version", "def duns(self, duns: str):\n\n self._duns = duns", "def set_stdeviations(self, sigma):\n stdeviations...
[ "0.632355", "0.6193907", "0.5888917", "0.5645816", "0.5536929", "0.55124253", "0.5478698", "0.544167", "0.5424394", "0.54221827", "0.53855914", "0.5377502", "0.5362815", "0.53419864", "0.53410035", "0.53191084", "0.53157526", "0.5282019", "0.52759916", "0.5262627", "0.5243309...
0.6994929
0
Set the scattering type for the model Options are scattering with an constant scattering cross section and a phasefunction based on Henyey Greenstein (0) and rayleigh scattering with an wavelength dependent cross section (1). For full polarimetric simulation (stokes_dim > 1) rayleigh scattering will be used.
def set_scattering_type(self, scattering_type): if scattering_type == "rayleigh": scattering_type = 1 elif scattering_type == "henyey_greenstein": scattering_type = 0 if scattering_type not in [0, 1]: raise ValueError( 'Only "henyey_greenstein"...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def toggle_scattering(self, setting=1):\n if setting not in [0, 1, \"on\", \"off\"]:\n raise ValueError(\n \"The input for the toggle the us of scattering \"\n 'in the model must \"on\" (1) or \"off\" (0)'\n )\n self.use_scat = 1 if setting == \"on\...
[ "0.66796225", "0.62938654", "0.58174783", "0.5719786", "0.56479996", "0.54444414", "0.523036", "0.52157414", "0.5163354", "0.5094794", "0.50772446", "0.50407004", "0.50305027", "0.49877325", "0.49587128", "0.4926275", "0.4912892", "0.48998433", "0.48370242", "0.48196423", "0....
0.81008196
0
Toggle the use of planck radiation in the model. The default is on (1).
def toggle_planck_radiation(self, setting=1): if setting not in [0, 1, "on", "off"]: raise ValueError( "The setting for the toggle the use of planck " 'Radiation must "on" (1) or "off" (0)' ) self.use_planck = 1 if setting == "on" else 0 if setting...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def configOperationMode(self):\n\n if self.ui.checkShowAlignStar.isChecked():\n self.ui.checkPolarAlignment.setEnabled(True)\n else:\n self.ui.checkPolarAlignment.setEnabled(False)\n if self.ui.checkPolarAlignment.isChecked():\n self.ui.checkEditNone.se...
[ "0.62344855", "0.62020314", "0.6173377", "0.6023187", "0.6016536", "0.5940673", "0.5907294", "0.5877835", "0.58360946", "0.58043313", "0.57058173", "0.56724185", "0.56472945", "0.56395024", "0.5592563", "0.55920243", "0.55766785", "0.5559038", "0.55545807", "0.5543908", "0.55...
0.79669845
0
Toggle the use of scattering in the model. (So k = abs_coef) The default is on (1).
def toggle_scattering(self, setting=1): if setting not in [0, 1, "on", "off"]: raise ValueError( "The input for the toggle the us of scattering " 'in the model must "on" (1) or "off" (0)' ) self.use_scat = 1 if setting == "on" else 0 if setting == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clicked_checkbox_model_smoothing(self):\n if self.checkbox_model_smoothing.isChecked():\n self._get_selected_model().metadata[\"smoothing_kernel\"] = True\n self.edit_manual_smoothing.setEnabled(False)\n else:\n self._get_selected_model().metadata[\"smoothing_kern...
[ "0.52622956", "0.52451706", "0.51579946", "0.5096683", "0.5060119", "0.50167304", "0.49783123", "0.49736682", "0.49626586", "0.4955168", "0.49531534", "0.4933673", "0.49187443", "0.49177575", "0.4909981", "0.4859031", "0.48441973", "0.48347628", "0.47741818", "0.4743281", "0....
0.6945123
0
Sets the wavelength for the model instance. This is needed for the scattering cross section as well as the incoming sun intensity.
def set_wavelenth(self, wavelength): if wavelength < 0: raise ValueError("The wavelength cannot be negative") self.wavelength = wavelength RT_model_1D.set_scattering_cross_sec(self) RT_model_1D.get_atmoshperic_profiles(self) self.sun_intensity = f.sun_init_intensity(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setUpWavelength(self,wavelength):\n if wavelength == None:\n self.wavelength = getDefaultWavelength()\n else:\n self.wavelength = wavelength\n return self", "def set_wavelength(self, wavelength: float) -> None:\n\n assert isinstance(wavelength, float), \"Inco...
[ "0.7543897", "0.7506083", "0.7441443", "0.72564566", "0.6959144", "0.6959144", "0.6941237", "0.664906", "0.6635105", "0.65459937", "0.64332366", "0.62733537", "0.62157166", "0.61628973", "0.60751235", "0.6061872", "0.6035115", "0.6034717", "0.6006406", "0.59973127", "0.593761...
0.80278105
0
Sets the scattering cross section according to the wavelength of the model instance.
def set_scattering_cross_sec(self): if self.scat_type == 1: sigma = f.calc_rayleigh_scattering_cross_section(self.wavelength) self.scattering_cross_sec = sigma elif self.scat_type == 0: self.scattering_cross_sec = self.SCATTERING_CROSS_SEC_HENYEY
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fun_set(self):\n\n self.type.set(self.xtl._scattering_type)\n # self.energy_kev.set(8)\n self.theta_offset.set(self.xtl._scattering_theta_offset)\n self.theta_min.set(self.xtl._scattering_min_theta)\n self.theta_max.set(self.xtl._scattering_max_theta)\n self.twotheta_m...
[ "0.5799355", "0.57958126", "0.5480301", "0.52612436", "0.5250689", "0.5242964", "0.51150775", "0.5089051", "0.50533265", "0.50456446", "0.49918267", "0.49321675", "0.49295756", "0.49250093", "0.4916542", "0.49130252", "0.48921743", "0.48824984", "0.48434013", "0.48340112", "0...
0.6786386
0
Set the reflection type for the model Options are lambert (0) and specular (1) and a linear combination of those two.
def set_reflection_type(self, reflection_type=0): if reflection_type < 0 or reflection_type > 1: raise ValueError("Must be 0, 1 or inbetween") self.reflection_type = reflection_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(self,number):\n if number == 0:\n self.Goblin()\n \n if number == 1:\n self.Ork()\n\n if number == 2:\n self.Skeleton()\n\n if number == 3:\n self.Troll()", "def set_type_smart(self):\n self.update(type=\"smart\")"...
[ "0.52875787", "0.52531016", "0.5250906", "0.5228072", "0.5163002", "0.5162343", "0.50840604", "0.50517833", "0.5041647", "0.50235975", "0.5020327", "0.4987726", "0.49623233", "0.49217913", "0.49075902", "0.4863573", "0.48560688", "0.4852885", "0.48483944", "0.48453522", "0.48...
0.5811174
0
Sets the elevation and azimuth angle of the sun and the intensity. The function converts the angle into the radiation transport direction.
def set_sun_position(self, elevation, azimuth, intensity=None): if elevation < 0 or elevation >= 90: raise ValueError("The elevation cannot be negative or >= 90") if azimuth < 0 or azimuth >= 360: raise ValueError("The azimuth cannot be negative or >= 360") if intensity ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_azimuth(self):\n self.azimuth = self.Calculations.convert_to_azimuth( self.declination, self.right_ascension, self.Latitude, self.LHA)\n if self.azimuth < 0:\n self.azimuth = self.azimuth + 360.0\n return self.azimuth\n else:\n pass\n return self...
[ "0.62218684", "0.6024862", "0.60163593", "0.5670285", "0.5291753", "0.5291011", "0.52647144", "0.5253364", "0.51982725", "0.5173323", "0.5167679", "0.51630104", "0.51583445", "0.5147184", "0.51196414", "0.511552", "0.51055723", "0.5090999", "0.5079181", "0.506311", "0.5036682...
0.7400268
0
Calculates the intensity of the suns beam at the given height with just extinction. This is needed for the Scattering source term.
def calc_direct_beam_intensity(self, height): if height < 0: raise ValueError("The height cannot be negative") idx, height = f.argclosest(height, self.height_array, return_value=True) angle, _ = f.convert_direction(self.sun_elevation, self.sun_azimuth) tau = np.zeros((self....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def beam(xb,yb,zb,wx,wy,wavelen):\n\n zRx = np.pi * wx**2 / wavelen\n zRy = np.pi * wy**2 / wavelen \n \n sqrtX = np.sqrt( 1 + np.power(zb/zRx,2) ) \n sqrtY = np.sqrt( 1 + np.power(zb/zRy,2) ) \n intensity = np.exp( -2.*( np.power(xb/(wx*sqrtX ),2) \\\n + np.power(yb/(w...
[ "0.5935863", "0.5868439", "0.5751317", "0.54317284", "0.535781", "0.53225744", "0.5312339", "0.5210378", "0.5191353", "0.5132932", "0.5099186", "0.50963634", "0.5054381", "0.50518787", "0.5045105", "0.50375617", "0.5034523", "0.50232214", "0.501657", "0.50001836", "0.4996118"...
0.72599554
0
Clalculates the extinction term based on the given intensity and the absorbtion and scattering coefficent at the given height.
def extinction_term(self, intensity, height): id = f.argclosest(height, self.height_array) k = ( self.absorption_coeff_field[id] + self.use_scat * self.scattering_coeff_field[id] ) # np.exp calculates element wise not the matricexponential! # but for diag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extinction(pyrat):\n # Load parameters for that molecular species (in future pyrat.cond.names for condensate species) \n species = 'H2O'\n pyrat.haze.cloudBenneke.readVP(species) # do this outside once in beginning of code and call it??\n # Fill in Cloud Base Pressure and Temperature\n pyrat.h...
[ "0.5243953", "0.5232212", "0.52192557", "0.52076006", "0.5106173", "0.5002402", "0.49990737", "0.497829", "0.49478427", "0.49193546", "0.49118948", "0.487345", "0.48102024", "0.4802348", "0.47917363", "0.47859445", "0.477885", "0.47580746", "0.47495157", "0.47404954", "0.4739...
0.74419826
0
Extracts MFCCs from music dataset and saves them into a json file along witgh genre labels.
def save_mfcc(dataset_path, json_path, num_mfcc=13, n_fft=2048, hop_length=512, num_segments=5): # dictionary to store mapping, labels, and MFCCs data = { "mapping": [], "labels": [], "mfcc": [] } samples_per_segment = int(SAMPLES_PER_TRACK / num_segments) num_mfcc_vectors_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_all_features(mp3_file):\n # Decode and read mp3\n audio, _ = librosa.load(mp3_file, sr=SR)\n\n # Compute mels\n mel = compute_melspecs(audio)\n\n # Save\n out_file = os.path.join(\n OUTPUT_DIR, os.path.basename(mp3_file).replace(\".mp3\", \"-mel.npy\"))\n np.save(out_file, m...
[ "0.5844222", "0.5784501", "0.569305", "0.5653748", "0.56458896", "0.5638793", "0.55832857", "0.55445707", "0.55068433", "0.55017704", "0.5487365", "0.5436023", "0.53990126", "0.53845435", "0.53288573", "0.53150344", "0.53050363", "0.53041786", "0.52813184", "0.5267655", "0.52...
0.77331597
0
getArchive(conf=...) Fetch an Archive instance. If conf is passed will be used instead of the default configuration. Returns a Deferred which will fire with the Archive instance.
def getArchive(conf): url = conf.get('url') maxreq = conf.getint('maxrequests', 10) maxq = conf.getint('maxquery') proxy=Proxy(url, limit=maxreq, qlimit=maxq) proxy.connectTimeout=3.0 info = proxy.callRemote('archiver.info').addErrback(_connerror) archs= proxy.callRemote('archiver.arch...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_archive(*args, **kwargs):\n return get_archive_async(*args, **kwargs).get_result()", "def get_archive_async(\n hostname, project, treeish, dir_path=None, **fetch_kwargs):\n _validate_args(hostname, project, treeish, dir_path)\n dir_path = (dir_path or '').strip('/')\n if dir_path:\n dir_path = ...
[ "0.69059646", "0.58675325", "0.57660156", "0.53493696", "0.53290415", "0.53190356", "0.5217525", "0.51383114", "0.50821906", "0.5054611", "0.48578238", "0.48038158", "0.47682074", "0.47294822", "0.4705755", "0.46751308", "0.46295667", "0.46268368", "0.46169835", "0.4615044", ...
0.7841836
0
Search for PV names matching the given pattern. If archs is None then all archives are searched. Otherwise archs must be a list of strings or integers specifing archive names or keys. Returns a Deferred which fires with a dictionary. If breakDown is False (the default) then the result is
def search(self, exact=None, pattern=None, archs=None, breakDown=False, rawTime=False): if exact is None and pattern is None: raise TypeError("Must provide 'exact' or 'pattern'") if exact is not None: pattern = '^%s$'%re.escape(exact) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search(regex, paths, args, ignore_case=False, verbose=False):\n printer = MultiLinePrinter()\n for path in paths:\n if os.path.isdir(path):\n for dirname, subdirs, files in os.walk(path):\n for filename in files:\n if not KNOWN_TYPES or any([filename.en...
[ "0.47382924", "0.45816582", "0.45443344", "0.45098388", "0.4450674", "0.43616328", "0.43554297", "0.42992774", "0.42957407", "0.42762348", "0.42538893", "0.42345315", "0.42316225", "0.42286372", "0.4218467", "0.4217593", "0.42083153", "0.41941893", "0.41695234", "0.41633487", ...
0.66993964
0
Fetch raw data for the given PV. Results are passed to the given callback as they arrive.
def fetchraw(self, pv, callback, cbArgs=(), cbKWs={}, T0=None, Tend=None, count=None, chunkSize=None, archs=None, breakDown=None, enumAsInt=False, displayMeta=False, rawTimes=False): if breakDown is None: breakDown ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def fetch_data(self) -> T:", "def fetchplot(self, pv, callback,\n cbArgs=(), cbKWs={},\n T0=None, Tend=None,\n count=None, chunkSize=None,\n archs=None, breakDown=None,\n enumAsInt=False):\n\n delta = total_seconds(Tend-...
[ "0.55016786", "0.5248723", "0.52326065", "0.50593275", "0.493895", "0.48849452", "0.48460248", "0.4819368", "0.4760639", "0.47135985", "0.46557218", "0.46315485", "0.46160027", "0.46151036", "0.4607112", "0.45550036", "0.45491877", "0.45421728", "0.4500722", "0.44971785", "0....
0.58612335
0
Is True if data can be written to the NDEF tag.
def writeable(self): return self._cc[14] == 0
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_data(self) -> bool:\n raise NotImplementedError", "def can_insert(data):\n return hasattr(data, 'read')", "def XPLMCanWriteDataRef(inDataRef):\n return bool", "def has_data_appended(self):\n return self._incompat_flags[0] & 0x1", "def has_data(self) -> bool:\n return ...
[ "0.6688601", "0.6649141", "0.6635758", "0.6589478", "0.65562564", "0.65354025", "0.65251344", "0.6313288", "0.62992036", "0.6082002", "0.60768175", "0.6073173", "0.6066335", "0.6025633", "0.5993792", "0.5966116", "0.5966116", "0.59162486", "0.58527404", "0.58494073", "0.58494...
0.6650295
1
An NDEF message object (an empty record message if tag is empty).
def message(self): try: return nfc.ndef.Message(str(self.data)) except nfc.ndef.parser_error: pass return nfc.ndef.Message(nfc.ndef.Record())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_deserialize_empty(self):\n # Completely empty\n out = self.instance.deserialize(self._empty_msg)\n self.assert_result_equal(out[0], self.instance._empty_msg)\n self.assert_equal(out[1], dict(size=0, incomplete=False))\n # Empty metadata and message\n out = self.in...
[ "0.6054486", "0.5856007", "0.5810143", "0.5708189", "0.565236", "0.56506103", "0.55909777", "0.5566611", "0.55424976", "0.5519104", "0.54985887", "0.54669297", "0.54646397", "0.5444558", "0.54414916", "0.5432448", "0.5428145", "0.5423365", "0.5419152", "0.54155207", "0.541419...
0.72136223
0
Overload of the update method of plane for the Grapher class in order to print the functions, takes window in parameter.
def showFunctions(self,window): wsx,wsy=window.size for i,function in enumerate(self.functions): self.showGraph(function,window,self.colors[i]) window.print(str(function),[wsx-wsx/5,wsy-wsy/20*(i+2)],color=self.colors[i],size=25)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plane_update(self):\n self.plane.update()", "def update_output_window(self):\n\n self.output_window.refresh(self.coordinate_dict['output_y'], 0, 0,\n self.coordinate_dict['output_x'] + 1,\n self.full_height_out - 1,\n ...
[ "0.6443978", "0.58718014", "0.5847557", "0.57163036", "0.5636099", "0.55257374", "0.55098563", "0.55029905", "0.5498726", "0.5497915", "0.54791474", "0.5451501", "0.5445614", "0.54443544", "0.54111737", "0.53994507", "0.53977495", "0.53960454", "0.5395982", "0.5382329", "0.53...
0.61533886
1
Show the graph of a function on screen using the function, the window and an optional color.
def showGraph(self,function,window,color=None): if not color: color=window.randomColor() wsx,wsy=window.size points=[] for X in range(0,wsx): x,y=self.getFromScreen([X,0],window) X,Y=self.getToScreen([x,function(x)],window) points.append((X,Y)) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showFunctions(self,window):\n wsx,wsy=window.size\n for i,function in enumerate(self.functions):\n self.showGraph(function,window,self.colors[i])\n window.print(str(function),[wsx-wsx/5,wsy-wsy/20*(i+2)],color=self.colors[i],size=25)", "def show(self, window, color=None, m...
[ "0.7177986", "0.6613471", "0.64047915", "0.6390181", "0.62344164", "0.62344164", "0.62344164", "0.62308174", "0.62073886", "0.6182668", "0.6156551", "0.6082728", "0.60510904", "0.59882784", "0.59148264", "0.58654755", "0.58518666", "0.5824023", "0.5760816", "0.57189447", "0.5...
0.8408193
0
Set the list of matched entries and the dictionary holding the number of matches. They need to be defined as globals to this module. Return True on error. Also searches the PDB and BMRB databases itself.
def searchPdbEntries(self, redo = False): # modification_time = os.path.getmtime("/Users/jd/.cshrc") # self.match.d[ "1brv" ] = EntryInfo(time=modification_time) # nTmessage("Looking for entries in the different preparation stages.") # for i, phaseData in enumerate(self.phaseDataList): # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def number_matches():\n ALL_FIXED_q = \"all_fixed_queries\" + str(17)\n ALL_FIXED_dbs = \"all_fixed_dbs\" + str(17)\n try:\n with open(\"matches\", \"rb\") as file_h:\n db_length = pickle.load(file_h)\n except:\n print \"reading files..\"\n t = time.time()\n \"\"\...
[ "0.58386177", "0.5780435", "0.5727033", "0.56841534", "0.5484644", "0.53357863", "0.53213334", "0.5216295", "0.51756287", "0.5151685", "0.5096588", "0.4999635", "0.4946475", "0.4941619", "0.49411833", "0.49349916", "0.49349916", "0.49349374", "0.49326298", "0.49273935", "0.48...
0.64668524
0
Update the plots on the front page except the pretty plot webpages. Return True on error.
def updateFrontPagePlots(self): crdb = NrgCingRdb(schema=self.schema_id) # Make sure to close it. if not crdb: nTerror("In %s RDB connection was not opened" % getCallerName()) return True # end if for trending in [ 1, 0 ]: # DEFAULT: 1,0 # for trend...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateFrontPagePrettyPlots(self):\n for trending in [ 1, 0 ]: # DEFAULT: 1,0\n# for trending in [ 0 ]:\n inputDir = os.path.join(self.results_dir, PLOT_STR )\n outputDir = os.path.join(self.results_dir, PPLOT_STR )\n if trending:\n inputDir = os.pat...
[ "0.7287471", "0.6297854", "0.6288511", "0.604255", "0.58940005", "0.5868938", "0.5679945", "0.562785", "0.5612468", "0.5590711", "0.5510018", "0.5443478", "0.5443478", "0.5443478", "0.5443478", "0.5443478", "0.5441277", "0.54403853", "0.5436331", "0.5414991", "0.5399666", "...
0.7332676
0
Get a list of dates that contain memories for a user.
def list_memories(self, user_id, start_date=None, end_date=None): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_memos():\n records = []\n for record in collection.find({\"type\": \"dated_memo\"}):\n record['date'] = arrow.get(record['date']).isoformat()\n del record['_id']\n records.append(record)\n # sorted() function use taken from Rob Murray:\n # https://stackoverflow.com/question...
[ "0.62519693", "0.589958", "0.5861902", "0.5788278", "0.5683896", "0.5669883", "0.5618058", "0.5612521", "0.5612506", "0.55803084", "0.55629635", "0.5521892", "0.5515748", "0.54657376", "0.5464114", "0.54432034", "0.54235256", "0.5418274", "0.54057574", "0.5374128", "0.5370449...
0.7138492
0
Return whether a memory exists for a user at a date.
def has_memory(self, user_id, memory_date): raise NotImplementedError()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record_exists(self, date):\n for record in self.records:\n if self.date_str == record[\"date\"]:\n return True\n return False", "def alreadyStored(self, date_):\r\n for day in self._repo:\r\n if day.date == date_:\r\n return True\r\n ...
[ "0.64419144", "0.5881912", "0.5841056", "0.5658975", "0.56083417", "0.56036156", "0.5585815", "0.5566384", "0.5522872", "0.55008674", "0.53935784", "0.53619343", "0.5356803", "0.52772665", "0.5258884", "0.5247556", "0.52393395", "0.5212584", "0.5209245", "0.51901716", "0.5186...
0.8038259
0
check to see if a site is live
def is_alive(self, site): try: return requests.get(site).status_code == 200 except Exception: pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_website_online(host):\n try:\n socket.gethostbyname(host)\n except socket.gaierror:\n return False\n else:\n return True", "def isonline():\n\n conn = httplib.HTTPConnection(\"www.google.com\", timeout=5)\n try:\n conn.request(\"HEAD\", \"/\")\n conn.close...
[ "0.7184357", "0.6925616", "0.69226384", "0.6872171", "0.68130124", "0.680132", "0.65696245", "0.64950216", "0.6441501", "0.64284706", "0.6418446", "0.6374213", "0.63635945", "0.6330601", "0.6329618", "0.6314663", "0.6310036", "0.6304025", "0.62810314", "0.62600166", "0.624670...
0.7745489
0
10 ms faster, than import uuid4
def uuid4(): b = ''.join('%x' % x for x in os.urandom(16)) return "%s-%s-%s-%s-%s" % (b[0:8], b[8:12], b[12:16], b[16:20], b[20:])
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def v4():\n return base64.urlsafe_b64encode(uuid.uuid4().bytes)[:-2] # Drop '==' padding", "def test_uuid():\n for _ in range(1000):\n uuid = uuid_generator()\n assert len(uuid) == 36\n assert uuid.count('-') == 4", "def _get_uuid():\n return str(uuid.uuid4())", "def generate_id...
[ "0.749502", "0.74192566", "0.73969394", "0.73628277", "0.72862285", "0.7247379", "0.7240885", "0.7184937", "0.7184937", "0.7184658", "0.717396", "0.71590453", "0.71353364", "0.711079", "0.70460355", "0.70416224", "0.7026545", "0.70200133", "0.69982344", "0.6930404", "0.692983...
0.7622199
0
Reads the discounts csv file & returns a dataframe
def read_discounts(self, file_name): discounts = pd.read_csv(f'{file_name}.csv') return discounts
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_extract(cryptocurrency):\n df = pd.read_csv(f'input_12mo/{cryptocurrency}.csv')\n df = df['Close'].copy()\n df = df[-183:].copy()\n return df", "def loan_data():\n return pd.read_csv(data_path / \"credit_data.csv\")", "def read_csv():", "def read_data(filepath):\n df = pd.read_...
[ "0.67762727", "0.66502154", "0.657781", "0.65579677", "0.65579677", "0.65579677", "0.6523957", "0.6514698", "0.64671755", "0.6462768", "0.6447732", "0.63911945", "0.63872385", "0.6359474", "0.6340352", "0.6323935", "0.6310876", "0.62966776", "0.6278205", "0.6277503", "0.62688...
0.7847184
0
Takes in the product volume dictionary & returns applicable discounts, any residuals (product codes) which doesnt have any offers
def get_applicable_discounts(self, actual_volume): applicable_discounts = [] residual = {} min_vol_criteria, product_vs_offer, base_product_vs_offer_product = self.get_product_vs_offer_and_volume(self.discounts) for basket_item, volume in actual_volume.items(): offer_on_pr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_basket_with_discounts(self, actual_volume, applicable_discounts, residual):\n\n # product_vs_min_volume, product_offer = self.get_product_vs_offer_and_volume(self.discounts)\n pr = Product('items')\n product_prices = pr.product_meta\n\n basket = []\n\n for discount in app...
[ "0.64345753", "0.6058145", "0.57161295", "0.5696214", "0.5675615", "0.56543845", "0.5502182", "0.54654807", "0.544653", "0.5391345", "0.5367731", "0.5360388", "0.53320503", "0.53056145", "0.5287403", "0.526012", "0.52296513", "0.52091134", "0.52077895", "0.5205086", "0.519474...
0.7132442
0
Computes all applicable offers if the offer type is Dicsount. Buy 1 get 1 or any other discounts
def get_basket_items_discount(self, offer_info, actual_volume, product_prices): prod_code = offer_info.base_prod_code base_prod_vol = actual_volume.get(prod_code.lower()) discount_basket = [] if base_prod_vol >= offer_info.min_vol: offer_on_prod = offer_info.offer_on ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _compute_offers_to_send(self) -> Dict[Tuple[float, float], float]:\n partial_asgt = self._neighbors_values.copy()\n offers = dict()\n\n for limited_asgt in generate_assignment_as_dict([self.variable, self._partner]):\n partial_asgt.update(limited_asgt)\n cost = self._...
[ "0.55473804", "0.5530387", "0.55122185", "0.5472553", "0.5421471", "0.5414957", "0.53732795", "0.53643686", "0.53457385", "0.5306167", "0.52392435", "0.523554", "0.52336174", "0.52059656", "0.5203071", "0.51802623", "0.51542354", "0.5132325", "0.5119246", "0.50583845", "0.505...
0.5732468
0
A partir de un diccionario que representa un punto P devuelve una estructura de C.
def PyC_Punto(P): C = CPunto() C.x[0] = P['x'][0] C.x[1] = P['x'][1] C.x[2] = P['x'][2] C.y[0] = P['y'][0] C.y[1] = P['y'][1] C.y[2] = P['y'][2] C.D = P['D'] C.n = P['n'] C.a, C.b, C.c = P['a'], P['b'], P['c'] C.d, C.e, C.f = P['d'], P['e'], P['f'] return C
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def CPy_Punto(C, P):\n \n P['x'][0] = C.x[0]\n P['x'][1] = C.x[1]\n P['x'][2] = C.x[2]\n\n P['y'][0] = C.y[0]\n P['y'][1] = C.y[1]\n P['y'][2] = C.y[2]\n\n P['D'] = C.D\n P['a'], P['b'], P['c'] = C.a, C.b, C.c\n P['d'], P['e'], P['f'] = C.d, C.e, C.f", "def findpc(self):\n u ...
[ "0.68054706", "0.63273036", "0.59791553", "0.58777106", "0.58699834", "0.5814331", "0.574379", "0.5730052", "0.57189286", "0.5685744", "0.5653829", "0.5597755", "0.55749863", "0.55708575", "0.5543975", "0.553301", "0.55071986", "0.5486988", "0.5479547", "0.54753065", "0.54649...
0.7179086
0
A partir de la estructura en C de un punto asigna los valores en el diccionario de python que representa un punto.
def CPy_Punto(C, P): P['x'][0] = C.x[0] P['x'][1] = C.x[1] P['x'][2] = C.x[2] P['y'][0] = C.y[0] P['y'][1] = C.y[1] P['y'][2] = C.y[2] P['D'] = C.D P['a'], P['b'], P['c'] = C.a, C.b, C.c P['d'], P['e'], P['f'] = C.d, C.e, C.f
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def init(self):\n # pC es un puntero a la imagen en C\n nP = len(self.puntos)\n self.pC = c_colision.malloc_tren(nP)\n # Estas magnitudes se inicializan en la imagen y\n # ya no se tocan desde python\n for i in range(nP):\n self.pC.contents.P[i]= pointer(PyC_Pun...
[ "0.55818385", "0.54350394", "0.5377207", "0.53720134", "0.53423417", "0.51250035", "0.508531", "0.508531", "0.508531", "0.508531", "0.508531", "0.50723153", "0.5046252", "0.5030646", "0.5010223", "0.5001038", "0.4996938", "0.49926582", "0.49638692", "0.49526796", "0.4942924",...
0.5662838
0
initialise Domain with cell vertices and sizes
def __init__( self, xh ): super( Domain, self ).__init__( xh ) self.dg = 0.5*self.dxh # cell jacobian return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initializeDomainBorder(self):\n #Read image of the structure\n if (self.PictureExistance == \"'yes'\"):\n self.__processImage()\n #re-define the domain size with the layers of boundaries and ghost points\n self.ny, self.nx = self.effectiveDomain.shape\n ...
[ "0.65595925", "0.6468736", "0.6450791", "0.6306958", "0.62393385", "0.6191882", "0.61890566", "0.6186516", "0.6183734", "0.61758626", "0.61507654", "0.6102445", "0.60795426", "0.60794216", "0.6060467", "0.60585374", "0.60388637", "0.60134053", "0.5997532", "0.59871835", "0.59...
0.65838295
0
set the expansion basis type and order, and the quadrature point type calculate the physical nodal points, cell jacobians and cell boundary extrapolation vectors
def set_expansion( self, order ): self.p = order q = polys.Legendre() self.zp = q.zeros[ order ] self.wp = q.weights[ order ] b = polys.Lagrange() b.interpolate( self.zp, np.ones( self.p ) ) self.Lm1 = np.zeros( self.nh*self.p ) #extrapolation to left cell...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculateElementQuadrature(self):\n #\n #get physical locations of quadrature points and jacobian information there\n #assume all components live on the same mesh\n #\n #mwf debug\n #import pdb\n #pdb.set_trace()\n self.u[0].femSpace.elementMaps.getValues...
[ "0.5704942", "0.5704799", "0.5604357", "0.54918164", "0.5463238", "0.54338795", "0.52082103", "0.52003396", "0.5145004", "0.51399213", "0.51352584", "0.5112741", "0.5099069", "0.5083901", "0.5081253", "0.5072265", "0.5071606", "0.50711", "0.5052168", "0.5050582", "0.50389147"...
0.6494705
0
initialise field with a name, mesh, and empty nodal value array
def __init__( self, name, mesh ): super( Field1D, self ).__init__( ) self.name = name self.mesh = mesh self.p = mesh.p self.bconds = [] self.val = np.zeros_like( self.mesh.xp ) return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, mesh: Mesh):\n self.mesh = mesh\n self.f = [0]*len(mesh.delaunay.simplices)", "def __init__(self):\n self.temperature = np.array([])\n self.salinity = np.array([])\n self.date = np.array([])\n self.temperatureQF = np.array([])\n self.salinityQF ...
[ "0.644951", "0.64103436", "0.6257394", "0.61790735", "0.6124536", "0.609891", "0.60961914", "0.6010147", "0.5938188", "0.59196675", "0.5910425", "0.58786947", "0.5766448", "0.576308", "0.575183", "0.5747807", "0.573995", "0.5739801", "0.5733518", "0.57318676", "0.57302076", ...
0.72849774
0
update the nodal values by the amount dval
def update( self, dval ): self.val[:] += dval[:] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_attr(self):\n\n # Retrieve all current values\n all_values = nx.get_node_attributes(self.G, 'value')\n\n new_values = {}\n\n # Loop over all nodes\n for i in range(self.n_v):\n\n # Obtain list of neighbors\n neighbors = list(nx.all_neighbors(self....
[ "0.66173327", "0.6386377", "0.63390785", "0.6290867", "0.61031574", "0.607318", "0.60284334", "0.59924954", "0.5955133", "0.58953375", "0.5832942", "0.57472765", "0.57249826", "0.5718284", "0.57078254", "0.57078254", "0.57078254", "0.57078254", "0.5679883", "0.56649834", "0.5...
0.6818316
0
returns a copy (separate instance) of the field with identical mesh, nodal values and boundary conditions
def copy( self ): g = type(self)( self.name, self.mesh ) g.set_field( self.val ) for bc in self.bconds: g.add_boundary_condition( bc ) return g
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy(self):\r\n return BasicMesh(self.gl_lists, list(self.pos),\r\n list(self.rotation), list(self.verts),\r\n self.scale, list(self.colorize))", "def copy(self):\n dyn = type(self)(self._hyperparams)\n dyn.Fm = np.copy(self.Fm)\n dy...
[ "0.646273", "0.6136491", "0.6136491", "0.6033814", "0.6033814", "0.6026285", "0.597527", "0.59729373", "0.5958256", "0.58507407", "0.58323413", "0.5791815", "0.57766306", "0.5762455", "0.57526517", "0.57449275", "0.573039", "0.5729646", "0.57285917", "0.5709468", "0.5665728",...
0.7353876
0
set the value of the field and start recording history
def set_field( self, data ): super( UnsteadyField1D, self ).set_field( data ) self.history[:] = self.val[:] return
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def record(self, step):", "def set_recording(self, recording):\r\n self.recording = recording", "def record(self, pop, off, dad, mom):\n if mom is not None:\n off.setInfo(0, str(self.field))\n else:\n off.setInfo(dad.info(self.field) + 1, self.field)\n...
[ "0.6511677", "0.61678815", "0.59728336", "0.591871", "0.5911478", "0.58802354", "0.58583605", "0.57788575", "0.5733154", "0.57327724", "0.5729399", "0.57100177", "0.5677953", "0.56552887", "0.56398624", "0.56385005", "0.56361896", "0.5626299", "0.5611821", "0.5608883", "0.558...
0.6801956
0
Returns the output of a native command on a give system.
def native_cmd(cmd, whitespace=False): result = subprocess.check_output(cmd, shell=True).decode() result = subprocess.run(cmd, stdout=subprocess.PIPE).stdout.decode('utf-8') return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_call(command):\n p = subprocess.Popen([command], stdout=subprocess.PIPE, shell=True)\n return p.stdout.read()", "def system_call(command):\n process = subprocess.Popen(command.split(), stdout=subprocess.PIPE)\n return process.communicate()[0]", "def output(cmd):\n return subpr...
[ "0.7396365", "0.7161807", "0.7143486", "0.7129648", "0.70993006", "0.7083398", "0.7071331", "0.69864917", "0.693033", "0.6849974", "0.6830674", "0.6825894", "0.67233115", "0.67181", "0.67122537", "0.669967", "0.6611063", "0.6568101", "0.6561279", "0.653629", "0.65305054", "...
0.73972946
0
Run a command with subprocess.check_output and send the output to the console and the specified logfile
def run_and_log_output(command: List[str], logfile: str, print_errors: bool=True): log_dir = os.path.dirname(logfile) if log_dir: os.makedirs(log_dir, exist_ok=True) with open(logfile, 'wb') as fh: print(f'Running command: {" ".join(command)}', flush=True) try: output = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _subprocess_check_log_output(cmd, cwd, logfile):\n _LOG.info(\"Execute (%s): %s\", cwd, cmd)\n cmd_base = cmd[0] if isinstance(cmd, (list, tuple)) else cmd.split(\" \", 1)[0]\n proc = subprocess.Popen(\n cmd,\n cwd=cwd,\n shell=True,\n bufsize=0,\n stdout=subprocess....
[ "0.732296", "0.7279438", "0.69670844", "0.68011194", "0.66960585", "0.6675629", "0.66571283", "0.66340595", "0.6601035", "0.6580322", "0.6577095", "0.6573328", "0.63622284", "0.6356524", "0.63254493", "0.631472", "0.63002706", "0.627858", "0.6268076", "0.6259961", "0.6221673"...
0.75880843
0
Default constructor jfile_path string with the path to the JSON input file yfile_path=None string with the path to the YAML output file. If none is given, a default path is built by replacing JSON's extension to YAML's.
def __init__(self, jfile_path, yfile_path=None): super(JSON2YAML, self).__init__() if not yfile_path: yfile_path = jfile_path.replace('.json', '.yml') self.jfile_path = jfile_path self.yfile_path = yfile_path self._l.debug(f"Converting JSON <{self.jfile_path}> to Y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, path, extension=\"yml\", expand=False, filename_field=None):\r\n self.path = path\r\n self.expand = expand\r\n self.filename_field = filename_field\r\n self.extension = extension", "def __init__ (self,\n path_to_json = None):\n self.default_p...
[ "0.5904695", "0.57020366", "0.5694569", "0.54628336", "0.5354753", "0.5232867", "0.51144755", "0.5109806", "0.5109366", "0.5074633", "0.50634974", "0.5014528", "0.5008866", "0.500834", "0.49745527", "0.49411646", "0.49310875", "0.49155352", "0.48995346", "0.48877087", "0.4879...
0.7463917
0
This method converts the loaded JSON file into a YAML file.
def _convert(self): json_data = xjson.loads(self.jfile_path) with io.open(self.yfile_path, 'w', encoding='utf8') as f: yaml.dump(json_data, f, default_flow_style=False, allow_unicode=True)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conversion_yaml():\r\n data ={\r\n 'name': 'george',\r\n 'age': 16,\r\n 'friends':\r\n [{'name': 'marry', 'age': 16}, {'name': 'jack', 'age': 17}]\r\n }\r\n yaml_data = yaml.dump(data)\r\n dirname = os.path.dirname(os.path.dirname(__file__))\r\n # data_dir = os.path.j...
[ "0.6950082", "0.65651673", "0.64373296", "0.6395889", "0.6372225", "0.63502705", "0.6332867", "0.6277105", "0.62494844", "0.62304705", "0.6180754", "0.61751336", "0.6173389", "0.6132995", "0.6115755", "0.61057806", "0.609142", "0.60893536", "0.6081999", "0.60774404", "0.60572...
0.7058134
0
Build with TPUEstimators for TPU usage
def _tpu_build(self): def _define_model(features, labels, mode, params): data_source = (features, labels) self.outputs = {} self.losses = {} self.otters = {} outputs, losses, others = self.define_model(data_source, mode) if mode == tf.esti...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_tpu_estimator(model_fn, feature_columns, params):\n\n tpu_cluster_resolver = tf.distribute.cluster_resolver.TPUClusterResolver(\n params[\"tpu\"],\n zone=params[\"tpu_zone\"],\n project=params[\"gcp_project\"],\n coordinator_name=\"coordinator\")\n\n config = tf_estimator.tpu.RunCo...
[ "0.6620379", "0.64619344", "0.6336337", "0.6044041", "0.6040361", "0.6033146", "0.5936819", "0.58590895", "0.5826569", "0.57875663", "0.5746748", "0.5682275", "0.5632957", "0.5593171", "0.5550863", "0.5521687", "0.5521416", "0.5520666", "0.5501502", "0.54913414", "0.54882205"...
0.8038507
0
Increment points of a user by a certain value. Check if the user reached legend in the process.
def increment_points(self, username, amount, bot): username = username.lower() viewer_id = self._get_user_id(username) points = int(self.get_points(username, new_entry=True)) rank = self.get_hs_rank(points) legend = "Legend" in rank points += amount sql_comman...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def gain_point(self, points):\n self.points += points\n print(f\"Yay! You have gained {points} point(s)! That means you now have {self.points} points!\")", "def increment_exit_points(self):\r\n self.exit_points = self.exit_points + 1", "def l_point(self):\n self.l_score += 1\n se...
[ "0.60321903", "0.57378536", "0.5700675", "0.5686679", "0.5621175", "0.5620957", "0.55799454", "0.5561892", "0.5448379", "0.54198337", "0.54027534", "0.5397142", "0.5385536", "0.5333786", "0.5329125", "0.5329125", "0.5329125", "0.5322965", "0.53009015", "0.5288273", "0.5273257...
0.70796514
0
Get the n top spammers.
def get_top_spammers(self, n): sql_command = "SELECT * FROM points ORDER BY amount DESC;" cursor, connection = self.execute_command_get_connection(sql_command, []) all = cursor.fetchall() return all[:n]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_by_num_of_ratings(self, n):\n return top_movies", "def test_top_n_counts():\n ngrams = NgramFrequencies()\n new_dic = {\n \"a\": 1,\n \"b\": 2,\n \"c\": 3,\n \"d\": 4\n }\n top_list = ngrams.top_n_counts(new_dic)\n assert top_list == [(\"d\", 4), (\"c...
[ "0.6869077", "0.6804007", "0.6788999", "0.6788999", "0.6694118", "0.6691008", "0.667423", "0.6663724", "0.66617", "0.66360414", "0.6616579", "0.6606422", "0.6540506", "0.6503402", "0.6503402", "0.64988184", "0.64909893", "0.6450828", "0.6448978", "0.64452827", "0.6418813", ...
0.8310816
0
Execute a command and return the cursor and connection. Use this if you need the output of the command, or need the cursor and connection. Since different threads will try to access this method, a connection has to be reopened everytime.
def execute_command_get_connection(self, sql_command, args): connection = sqlite3.connect(DATABASE_PATH.format(self.bot.root)) cursor = connection.cursor() cursor.execute(sql_command, args) connection.commit() return cursor, connection
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def execute(self, command, *args, **kw):\n conn, address = self.get_connection(command, args)\n if conn is not None:\n fut = conn.execute(command, *args, **kw)\n return self._check_result(fut, command, args, kw)\n else:\n coro = self._wait_execute(address, comm...
[ "0.6711291", "0.66315925", "0.65280336", "0.65198976", "0.6265124", "0.6210378", "0.6199773", "0.61896217", "0.61482316", "0.614579", "0.61115587", "0.6105831", "0.6026215", "0.60134554", "0.60089606", "0.5982857", "0.59786767", "0.59691954", "0.5958951", "0.5946281", "0.5945...
0.7270666
0
Execute an sql command and closes all connections. Does not return output.
def execute_command(self, sql_command, args): cursor, connection = self.execute_command_get_connection(sql_command, args) cursor.close() connection.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_sql_call(self):\n c_data = {'db_host': self.server,\n 'db_user': self.user,\n 'db_password': self.password,\n 'db_database': self.database}\n db_conn = self.SH.sql.helper.sql_conn_obj(c_data)\n result, detail = db_conn.connect()\n self.print_to_...
[ "0.67657375", "0.6543867", "0.65374744", "0.65250635", "0.64901483", "0.6467374", "0.645544", "0.64353216", "0.6412571", "0.63929516", "0.6277691", "0.6272989", "0.6255919", "0.61555314", "0.6154794", "0.61303073", "0.6090869", "0.6063971", "0.6056591", "0.6034455", "0.603163...
0.8129482
0
Grouping sequences by names. All big sequences (genomes) with minsog <= size <= maxsog form separate group 'cds'
def grouping(filename, outdir, minsog, maxsog): records = Records(Extractor.extract_records(filename)) groups = records.group(minsog, maxsog) for key in groups: rw = RecordsWriter(groups[key]) rw.write_to_dir(key + ".fasta", outdir)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def matched_gc_bedfile(bedfile, matchfile, genome, number, size=None, min_bin_size=100):\n g = Genome(genome)\n genome_fa = g.filename\n try:\n fa = Fasta(matchfile)\n gc = [\n (seq.upper().count(\"C\") + seq.upper().count(\"G\")) / len(seq)\n for seq in fa.seqs\n ...
[ "0.5756112", "0.56828934", "0.56537175", "0.5610272", "0.55583954", "0.5548302", "0.55069", "0.5499959", "0.5468516", "0.5450044", "0.5367102", "0.5361176", "0.53204", "0.52715933", "0.5266514", "0.52597445", "0.52575517", "0.5232715", "0.5223918", "0.52147275", "0.5207131", ...
0.667695
0
Returns the shortest path from current to destination >>> find_shortest_path(graph, 'A', 'D') ['A', 'C', 'D']
def find_shortest_path(graph, current, destination, path=[]): # create a new list so not to mess up the old ones in the stack path = path + [current] # base case: reached destination if current == destination: return path # base case: dead end if current not in graph: reutrn ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_shortest_path(graph, origin, destination):\n visited, paths = dijkstra(graph, origin)\n full_path = deque()\n if destination in paths: \n _destination = paths[destination]\n \n while _destination != origin:\n full_path.appendleft(_destination)\n _destinat...
[ "0.795193", "0.78015375", "0.7790324", "0.77879363", "0.7745128", "0.74809974", "0.7458702", "0.7440121", "0.74135613", "0.7371713", "0.7323594", "0.72594124", "0.72040826", "0.71902996", "0.7157731", "0.71473294", "0.71439856", "0.71418667", "0.7102424", "0.709848", "0.70925...
0.8252375
0
Read CSV of real values, discard header, and return np.array.
def read_csv(path): rows = [] with open(path) as csv_file: reader = csv.reader(csv_file) header = reader.next() if header[0].isdigit(): print "Warning: Discarding header that looks like numbers." for line in reader: rows.append(map(float, line)) return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_csv(fn):\n def iter_func():\n with open(fn, 'r') as infile:\n for line in infile:\n line = line.rstrip().split(',')\n for item in line:\n yield float(item)\n load_csv.rowlength = len(line)\n data = np.fromiter(iter_func(), dty...
[ "0.74260634", "0.73615754", "0.73608273", "0.7234256", "0.71963465", "0.71692055", "0.7078709", "0.7071126", "0.70160156", "0.69875634", "0.6977693", "0.69723463", "0.6876044", "0.6843938", "0.68314666", "0.6830467", "0.6777699", "0.67618006", "0.67560637", "0.674022", "0.672...
0.7816146
0
Sets the folder where the files to serve are located.
def set_folder(self, folder): self.folder = folder self.templates.directories[0] = folder self.app.root_path = folder
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_source_path(self, folder):\n self.source_path = folder", "def set_path(self, directory):\n self.directory = directory", "def set_folders(self):\n self._tst_dir = self._val_dir = self._trn_dir = self._ds_root\n self._lbl_dir = f\"{self._ds_root}/flow\"\n self._pred_lbl...
[ "0.66856587", "0.655048", "0.63288397", "0.62536454", "0.61302406", "0.6127417", "0.6106902", "0.6060303", "0.6058627", "0.602844", "0.5978206", "0.5976438", "0.5973507", "0.5962767", "0.59565043", "0.5955999", "0.594277", "0.59424734", "0.59265566", "0.59138876", "0.5892181"...
0.75043386
0
Generates a complete static version of the web site. It will stored in output_folder.
def gen_static(self, output_folder): files = [] for l in self.file_listers: files += l() for f in files: _logger.info("generating %s" % f) content = self.get(f) loc = os.path.join(output_folder, f) d = os.path.dirname(loc) i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_static_site(self, output_root=None, extra_context=None):\n self.app.config['BUILD_PATH'] = output_root\n\n # use this hook for registering URLs to freeze\n self.call_hook(\"generate\", self, output_root, extra_context)\n\n if output_root is not None:\n # realpath...
[ "0.75036", "0.6963644", "0.6765069", "0.65228844", "0.6497136", "0.6364944", "0.62506604", "0.604287", "0.603249", "0.60303116", "0.5984128", "0.5968583", "0.59599876", "0.5941046", "0.592738", "0.59084713", "0.58983976", "0.5872566", "0.58616793", "0.58607596", "0.5845612", ...
0.72529495
1
Retrieve an HTML page from plans.
def _get_page(self, name, get=None, post=None): method = 'GET' if post is None else 'POST' url = '/'.join((self.base_url, name)) req = requests.Request(method, url, params=get, data=post) prepped = self.session.prepare_request(req) try: handle = self.session.send(prep...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_page(self):\n self.browser.get(self.url)", "def request_html_page(self):\n try:\n response = requests.get('http://www.indeed.com/jobs?', params=self.payload)\n except:\n print \"got error for \", self.payload\n self.page = response.content", "def read_p...
[ "0.67057174", "0.6517088", "0.6384331", "0.62347746", "0.6232917", "0.61664104", "0.61631536", "0.6113468", "0.60962486", "0.60706925", "0.6066584", "0.60514754", "0.6013905", "0.600338", "0.600326", "0.5969021", "0.595881", "0.5953506", "0.5936332", "0.59244865", "0.5920143"...
0.66219044
1
Scrape details from an infomessage or alertmessage div. Returns a dictionary of the message parameters.
def _parse_message(self, soup): kind, = soup.attrs[u'class'] title = soup.findChild().text body = ''.join(t.text for t in soup.findChildren()[1:]) message = dict(kind=kind, title=title, body=body) for val in message.values(): assert type(val) == str return mes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_information(self):\n info_dict = {}\n table = self._tab.find('table', class_='details')\n for row in table.find_all('tr'):\n row_key, row_value = row.find(class_='key'), row.find(class_='value')\n key_with_emoji, value = self._get_key(row_key), self._get_value(ro...
[ "0.58449465", "0.5690405", "0.5635112", "0.5574967", "0.5535075", "0.55201256", "0.54977244", "0.54909134", "0.54823315", "0.5447042", "0.53833103", "0.53693163", "0.5342092", "0.5276265", "0.52326083", "0.5221449", "0.5215469", "0.52002853", "0.51924163", "0.5170039", "0.515...
0.69118416
0
Modify reserialized plan text to match what was served. For consistency, we want to return plan text exactly how it is formatted when served. However, variants of certain tags (e.g. vs ) are syntactically equivalent in HTML, and may be interchanged when parsed and reserialized. This function manually changes the format...
def _canonicalize_plantext(self, plan): # Our parser will correct <hr> and <br> to self closing tags plan = plan.replace('<br/>', '<br>') plan = plan.replace('<hr/>', '<hr>') # put attributes in the right order because I have OCD plan = re.sub(r'<a class="([^\s]*)" href="([^\s]*)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _format_plan(plan, server_root=None):\n formatted_plan = {}\n \n formatted_plan['url'] = plan['details_link']\n \n # special emphasizing for some statuses\n if plan['status'] in [u'פרסום ההפקדה', u'פרסום בעיתונות להפקדה']:\n formatted_plan['status'] = u'»»%s««' % plan['status']\n ...
[ "0.58597666", "0.5456841", "0.54195154", "0.53886324", "0.5373414", "0.519596", "0.5175126", "0.51720506", "0.50811565", "0.50582194", "0.5008377", "0.49972737", "0.49566457", "0.49039185", "0.48758507", "0.48473752", "0.48365143", "0.483133", "0.48018774", "0.47815216", "0.4...
0.70790404
0
Log into plans. Returns True on success, False on failure. Leave username and password blank to check an existing login.
def plans_login(self, username='', password=''): # the provided username and password ONLY get checked # by the plans server if our cookie is expired. # hence, if we've logged in recently, this will return True even # if un/pw are not provided or are otherwise bad. login_info = {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def login(self, **kwargs):\n\tusername = kwargs.get('username', self.username)\n\tif not username:\n\t raise RuntimeError, 'no username provided'\n\n\tpassword = kwargs.get('password', self.password)\n\tif not password:\n\t raise RuntimeError, 'no password provided'\n\tself.call('login', username=username, p...
[ "0.7139568", "0.6889871", "0.67902976", "0.6775025", "0.6765618", "0.6733587", "0.67126477", "0.67060435", "0.66989684", "0.6696499", "0.6692889", "0.6689874", "0.66540337", "0.664666", "0.66113514", "0.6604015", "0.658291", "0.6582731", "0.65772784", "0.6559419", "0.65449303...
0.8137354
0
Retrieve contents of the edit plan field. Returns the edit_text of the plan and its md5 hash, as computed on the server side.
def get_edit_text(self): # grab edit page response = self._get_page('edit.php') html = response.text # parse out existing plan soup = bs4.BeautifulSoup(html, 'html5lib') plan = soup.find('textarea') if plan is None: raise PlansError("Couldn't get edit ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_edit_text(self, newtext, md5):\n # convert to CRLF line endings\n newtext = convert_endings(newtext, 'CRLF')\n newtext = newtext.encode('utf8')\n edit_info = {'plan': newtext,\n 'edit_text_md5': md5,\n 'submit': 'Change Plan'}\n res...
[ "0.6568089", "0.5453729", "0.54037726", "0.5280627", "0.5272245", "0.52441514", "0.52441514", "0.5230294", "0.52111316", "0.51553506", "0.5128909", "0.5118174", "0.5097198", "0.508127", "0.5076953", "0.50690055", "0.50560534", "0.5046793", "0.5027376", "0.5024969", "0.5024644...
0.8520785
0
Update plan with new content. To prevent errors, the server does a hash check on the existing plan before replacing it with the new one. We provide an md5 sum to confirm that yes, we really want to update the plan. Returns info message.
def set_edit_text(self, newtext, md5): # convert to CRLF line endings newtext = convert_endings(newtext, 'CRLF') newtext = newtext.encode('utf8') edit_info = {'plan': newtext, 'edit_text_md5': md5, 'submit': 'Change Plan'} response = self...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(cls, plan_id, **kwargs):\n return cls().requests.put(f\"plan/{plan_id}\", data=kwargs,)", "def put(self):\n request_data = request.get_json()\n plan = request_data[\"plan\"]\n\n user = get_authenticated_user()\n if not user.stripe_id:\n raise InvalidReques...
[ "0.6790178", "0.59503996", "0.59245706", "0.5458895", "0.5327665", "0.5283632", "0.5098079", "0.50921404", "0.50861126", "0.50642353", "0.504313", "0.5035372", "0.5021408", "0.4985128", "0.4948604", "0.4918588", "0.48822698", "0.48791012", "0.4851006", "0.4837955", "0.483735"...
0.66878754
1
Retrieve all levels of the autofinger (autoread) list. Returns a dictionary where the keys are the group names "Level 1", "Level 2", etc. and the values are a list of usernames waiting to be read.
def get_autofinger(self): # this actually doesn't scrape; there's a function for it # in the old JSON API. get = {'task': 'autofingerlist'} response = self._get_page('api/1/index.php', get=get) data = json.loads(response.text) # the returned JSON is crufty; clean it up ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_levels(self):\n return self.levels[self.game]", "def get_all_game_levels(self):\n\n self._katakana_database.create_katakana_database_connection()\n\n raw_game_levels = self._katakana_database.katakana_db.execute(\n \"\"\"SELECT game_level FROM Games\"\"\").fetchall()\n\n ...
[ "0.58031774", "0.57258826", "0.5678139", "0.5663194", "0.55516225", "0.5483187", "0.54111844", "0.53925604", "0.5388561", "0.53229", "0.5307335", "0.52984476", "0.5274611", "0.52675277", "0.52212065", "0.5218664", "0.52143294", "0.519101", "0.5178574", "0.51685023", "0.516397...
0.7340584
0
Retrieve the contents of the specified plan.
def read_plan(self, plan): get = {'searchname': plan} response = self._get_page('read.php', get=get) soup = bs4.BeautifulSoup(response.text, 'html5lib') header = soup.find('div', {'id': 'header'}) text = soup.find('div', {'class': 'plan_text'}) if text is None or header i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(cls, plan_id):\n return cls().requests.get(f\"plan/{plan_id}\")", "def get_plan(self):\n\t\tresponse = self.client.get(self._endpoint + \"/plan\")\n\t\tplan = response.json['plans']\n\t\tplan = list(plan.items())[0][1]\n\t\treturn Plan(plan['plan_id'],data=plan)", "def plan(self):\n retur...
[ "0.7595697", "0.68826216", "0.6555645", "0.6532035", "0.6414922", "0.6344742", "0.6237968", "0.6152344", "0.6084125", "0.58835685", "0.5860761", "0.5853679", "0.57456356", "0.57375413", "0.5712769", "0.5614542", "0.559101", "0.5515008", "0.547179", "0.54412735", "0.535815", ...
0.74009657
1
Search plans for the provided ``term``. If ``planlove`` is ``True``, ``term`` is a username, and the search will be for incidences of planlove for that user.
def search_plans(self, term, planlove=False): get = {'mysearch': term, 'planlove': int(bool(planlove))} response = self._get_page('search.php', get=get) soup = bs4.BeautifulSoup(response.text, 'html5lib') results = soup.find('ul', {'id': 'search_results'}) if resul...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_plan(self, plan_id, term=None):\n\t\tdata = {\"plan_id\":plan_id}\n\t\tif term:\n\t\t\tdata.update({\"term\":term})\n\t\tresponse = self.client.post(self._endpoint + \"/plan\", content=data)\n\t\treturn bool(response.json[\"success\"])", "def search(self, term):", "def find_by_plan_name(cls, name, exac...
[ "0.56900036", "0.54435796", "0.5083996", "0.5057897", "0.50346243", "0.50073344", "0.48131078", "0.48111796", "0.4802479", "0.47961777", "0.47269177", "0.47260118", "0.46963114", "0.46709058", "0.46331495", "0.45926642", "0.45773494", "0.45730287", "0.45207572", "0.44550562", ...
0.71705884
0
Return plans updated in the last ``hours`` hours. The result is a list of (username, timestamp) 2tuples.
def planwatch(self, hours=12): post = {'mytime': str(hours)} response = self._get_page('planwatch.php', post=post) soup = bs4.BeautifulSoup(response.text, 'html5lib') results = soup.find('ul', {'id': 'new_plan_list'}) new_plans = results.findAll('div', {'class': 'newplan'}) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_last_x_hours(*, db_session, hours: int = 24) -> List[Optional[Feedback]]:\n return (\n db_session.query(Feedback)\n .filter(Feedback.created_at >= datetime.utcnow() - timedelta(hours=hours))\n .all()\n )", "def wholasthr(sock, request):\n users = set()\n for s in hist...
[ "0.57179016", "0.55829984", "0.54386723", "0.5415785", "0.53141874", "0.5197795", "0.5095239", "0.5065263", "0.5055699", "0.5026268", "0.49488553", "0.49171332", "0.4909176", "0.48759073", "0.48730665", "0.485017", "0.4826249", "0.4817359", "0.47765937", "0.47737122", "0.4742...
0.6832343
0
Return the list of locations described by the given string.
def get_location_list(loc): if loc == 'all': return Locations.region_list elif loc == 'hhs': return Locations.hhs_list elif loc == 'cen': return Locations.cen_list elif loc in Locations.region_list: return [loc] else: raise UnknownLocationException('unknown location: %s' % str(loc))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def locations(self, text):\n\n response = self._send_request(\"locations\", dict(text=text))\n return response[self._layer]['locations']", "def __parse_uri_and_location(cls, uri_loc_str):\n # type: (str) -> List[str]\n split_uri_location = uri_loc_str.split('//') # type: List[str, st...
[ "0.7137194", "0.64971626", "0.61824524", "0.61119884", "0.6105019", "0.6089954", "0.60780364", "0.60548824", "0.60450953", "0.602286", "0.5991559", "0.5972784", "0.5936607", "0.5890959", "0.58109415", "0.5796555", "0.57864577", "0.5785032", "0.5761079", "0.57338774", "0.57248...
0.68343097
1