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
This module uses the notion of TransferLearning I found VGG16 model to perform the best and nearly as good as mine This function configures our model, freezes the VGG 16 and adds a small module on top of it
def build_model(): pretrained_model = VGG16(input_shape=(fixed_size[0], fixed_size[1], 3), weights='imagenet', include_top=False) # We will not train the layers imported. for layer in pretrained_model.layers: layer.trainable = False transfer_learning_model = Sequential() transfer_learning_mo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self):\n\t\tsuper(Vgg16, self).__init__()\n\t\tv = vgg16(pretrained= True)\n\t\t# Copy modules of vgg16\n\t\tfeatures = list(v.features)\n\t\tavgpool = v.avgpool\n\t\tsequentials = list(v.classifier)\n\t\tself.features = nn.ModuleList(features).eval() \n\t\tself.avgpool = avgpool\n\t\tself.sequentials...
[ "0.7378551", "0.7140043", "0.7088726", "0.70860106", "0.7069082", "0.7028083", "0.69971085", "0.6835972", "0.6807089", "0.68023854", "0.67977124", "0.67328876", "0.666724", "0.6654282", "0.6629273", "0.66262287", "0.6624668", "0.66023797", "0.6547663", "0.6541805", "0.6531674...
0.72276556
1
Trains the model, requires train/val generators. A model with best accuracy will be stored as a file separately in the saved_files folder
def train_model(train_generator, validation_generator): # we build a test generator to benchmark the model on unseen data test_datagen = ImageDataGenerator(rescale=1. / 255) test_generator = test_datagen.flow_from_directory( test_path, target_size=(200, 200), color_mode="rgb", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def train(self):\n # setup model\n self.createModel()\n self.setGenerators()\n self.buildCallbacks()\n self.printParameters()\n \n # train model\n _ = self.model.fit_generator(\n generator = self.trainGen,\n validation_da...
[ "0.7413885", "0.7370952", "0.7358529", "0.7332709", "0.72302955", "0.71722466", "0.71367407", "0.71323115", "0.7070622", "0.70504934", "0.70343286", "0.7025165", "0.7010369", "0.69924694", "0.6975391", "0.6946733", "0.69207597", "0.68895227", "0.6884179", "0.6879531", "0.6879...
0.75909585
0
Send connection request to node
def send_request_to_node(signed_request, live_pv=False): if live_pv: node_address = format_address( ip_address='64.225.47.205', port=None, protocol='http' ) else: node_address = format_address( ip_address='192.168.1.75', port=8...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send(self):\n url = \"{}:{}\".format(self.url, self.port)\n headers = dict(self.request.get_headers())\n body = self.request.get_body()\n self.response = requests.post(url, data=body, headers=headers)", "def request( key, server, node, netrc=os.getenv('NETRC', os.path.join(os.path...
[ "0.67013323", "0.65425026", "0.63913494", "0.63773566", "0.62579113", "0.62430686", "0.6238563", "0.6232214", "0.6227512", "0.62108177", "0.6207686", "0.6198674", "0.6164171", "0.6092099", "0.6058228", "0.60388625", "0.6024347", "0.60176617", "0.5993292", "0.5990137", "0.5959...
0.6933859
0
OS type of the initiator group
def initiator_group_os_type(self): return self._initiator_group_os_type
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def vm_os_type(self, name_of_vm):\n # import pdb;pdb.set_trace()\n vm_obj = self.get_dc_object([vim.VirtualMachine], name_of_vm)\n os_type = vm_obj.config.guestFullName\n if \"CentOS\" in os_type:\n ostype = \"Centos\"\n return ostype\n elif \"Windows\" in o...
[ "0.6599497", "0.6537872", "0.6537872", "0.64941204", "0.6436012", "0.6405716", "0.6388427", "0.6381176", "0.6328218", "0.6060839", "0.593102", "0.5916251", "0.5864186", "0.58522826", "0.5835022", "0.5826933", "0.58022773", "0.57971287", "0.578821", "0.57809365", "0.5758621", ...
0.8475742
0
Name of this initiator group.
def initiator_group_name(self): return self._initiator_group_name
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_name(self) -> str:\n return pulumi.get(self, \"group_name\")", "def group_name(self):\n\n return self._group_name", "def name(self):\n return f\"{self._group.friendly_name} {GROUP_SUFFIX}\"", "def getName(self):\n return _libsbml.Group_getName(self)", "def get_group_na...
[ "0.803714", "0.77505535", "0.7715831", "0.7704881", "0.7635519", "0.7535615", "0.75039047", "0.75039047", "0.7350636", "0.7316486", "0.73029464", "0.72832215", "0.72797227", "0.72797227", "0.72797227", "0.72797227", "0.7264888", "0.7243955", "0.72344804", "0.72338426", "0.723...
0.819768
0
Iterate the devices RemoteValue classes.
def _iter_remote_values(self): yield self.scene_value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async def values(cls):\n result = []\n for key in await ProxyMethod.channel.call_remote(\n \"%s.values\" % (cls.__namespace__,),\n ):\n result.append(cls(key=key))\n return result", "def YieldAllDevices(self):\n\n for deviceManagedObject in self.managedObjec...
[ "0.6106581", "0.5926113", "0.58487874", "0.5820672", "0.5820672", "0.5820672", "0.5820672", "0.58051544", "0.578519", "0.5724099", "0.5589973", "0.55367506", "0.5482901", "0.54672277", "0.5437712", "0.54305726", "0.54215163", "0.5420586", "0.5414509", "0.540064", "0.54004484"...
0.6276525
0
Expand a flat JSON back into a JSON object. This is the inverse operation of flatten(). If there are duplicated values under the same key, a random one is kept
def expand( flat_json: FlatJSON, *, array_as_dict: bool = False, sort: bool = True ) -> JSONObject: return _expand(flat_json, array_as_dict, sort, tuple())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _expand(flat_json: FlatJSON, array_as_dict: bool, sort: bool, pre_keys: FlatKey):\n # Group value by the upper-most key\n groups = {}\n for keys, value in flat_json.items():\n if keys[1:]:\n groups.setdefault(keys[0], {})[keys[1:]] = value\n elif keys[0] in groups:\n ...
[ "0.7105315", "0.69590145", "0.6819908", "0.66906464", "0.66727316", "0.6496263", "0.6201557", "0.61406755", "0.6140352", "0.6123596", "0.6048289", "0.6046546", "0.6042851", "0.5904282", "0.58428866", "0.5718092", "0.5700255", "0.56901073", "0.5685949", "0.5682928", "0.5671775...
0.7022221
1
Retrieve a value on a JSON array or object. Return ``default`` if it was provided and ``key`` is missing
def get( obj: Union[JSONArray, JSONObject], # pylint: disable=unsubscriptable-object key: Union[int, str, FlatKey], # pylint: disable=unsubscriptable-object default=MISSING, ) -> JSONType: if isinstance(key, Iterable) and not isinstance(key, str): key = tuple(key) else: key = (key,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, key, default=None):\n try:\n val = self[key]\n except KeyError:\n return default\n if val == []:\n return default\n return val", "def get(self, key: str, default=None) -> Any:\n try:\n return self[key][0]\n except...
[ "0.78692454", "0.76011103", "0.7557323", "0.7466338", "0.7441983", "0.7435013", "0.73497385", "0.726725", "0.71433747", "0.7140719", "0.7140719", "0.7123778", "0.7117787", "0.7113324", "0.7069209", "0.70580953", "0.7040229", "0.7002631", "0.7000605", "0.69699365", "0.69337773...
0.82465583
0
Test if a JSON has the provided key Implemented by calling ``get(obj, key)`` and catching JSONKeyError
def has( obj: Union[JSONArray, JSONObject], # pylint: disable=unsubscriptable-object key: Union[int, str, FlatKey], # pylint: disable=unsubscriptable-object ): try: get(obj, key) return True except JSONKeyError: return False
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __is_key_in_json(self, key=str, json_dict=json):\n if key in json_dict:\n # noinspection PyUnresolvedReferences\n return json_dict[key]\n else:\n return self.NO_KEY_VALUE_FOR_ENTRY", "def contains_key(kv_json, key):\n if isinstance(kv_json, str):\n kv_...
[ "0.7763578", "0.72817534", "0.6362781", "0.62022686", "0.6141493", "0.6123055", "0.6074616", "0.60739374", "0.6048125", "0.6037219", "0.6022182", "0.6016747", "0.60100514", "0.5971459", "0.5967161", "0.5967006", "0.5958279", "0.5958279", "0.5958279", "0.59093434", "0.5899016"...
0.79096264
0
Opens the database with given name
def open_db(db_name: str = DB_NAME) -> DBConnection: return sqlite3.connect(db_name, cached_statements=STATEMENT_CACHE)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open_db(filepath) -> str:\r\n name = path.basename(filepath)\r\n db = QSqlDatabase.addDatabase(\"QSQLITE\", connectionName=name)\r\n db.setDatabaseName(filepath)\r\n if db.open():\r\n return name\r\n else:\r\n return ''", "def openDB(self, dbpath, updateOnIdle=True):\n\t\tself.op...
[ "0.77788407", "0.717973", "0.70709807", "0.7044457", "0.70142776", "0.6968675", "0.6928537", "0.69270325", "0.69016486", "0.684912", "0.6767917", "0.67338246", "0.6707789", "0.6666126", "0.6664044", "0.6591525", "0.6562715", "0.655302", "0.65102965", "0.6497374", "0.648993", ...
0.75093246
1
Inserts all documents into the docs table
def insert_documents(connection: DBConnection, documents: Sequence[Document]) -> None: max_ = len(documents) current = 0 print() # print an extra line, because we will delete lines with printing \r for chunk in chunks(documents): connection.execute("BEGIN TRANSACTION") for doc in chunk:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_tfs(connection: DBConnection, documents: Sequence[Document]) -> None:\n max_ = len(documents)\n current = 0\n print() # print an extra line, because we will delete lines with printing \\r\n for chunk in chunks(documents):\n rows = (d.get_tfs_rows() for d in chunk)\n connection...
[ "0.6916915", "0.69153225", "0.68849826", "0.6802458", "0.678761", "0.67752117", "0.67542636", "0.67506325", "0.66094494", "0.6605673", "0.6532589", "0.64568657", "0.6404822", "0.6397804", "0.6383192", "0.63431865", "0.6333661", "0.62561625", "0.6236792", "0.62283325", "0.6207...
0.7491894
0
Retrieves the headline of a article in the db
def get_headline(connection: DBConnection, did: int): return connection.execute("SELECT title FROM docs WHERE did=:did", (did,)).fetchone()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_headline(id_headline):\n try:\n item = db.get_item(id_headline)[0]\n return item\n except (ValueError, IndexError):\n return \"Not found\", 404, {\"x-error\": \"not found\"}", "def headline(self):\n \n return self._headline", "def headline(self):\r\n retu...
[ "0.75186217", "0.7011888", "0.66863215", "0.64625335", "0.63958013", "0.6395238", "0.62655526", "0.62254727", "0.6132763", "0.6021352", "0.6017782", "0.6007114", "0.5950164", "0.59471375", "0.5936956", "0.59344417", "0.5880116", "0.5864753", "0.58132076", "0.5797231", "0.5780...
0.799914
0
Retrieves the maximum page of a article in the db
def get_max_page(connection: DBConnection) -> int: return connection.execute("SELECT max_page FROM max_page").fetchone()[0]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_latest(self):\n self.cprint(\"##\\tGetting max page number...\\n\", log=True)\n return 1", "def get_max_page(self, bs):\n max_page = None\n stuff = bs.select_one('.el_paginate > .signature')\n if stuff:\n stuff = re.search(r'^Страница: [0-9]+ из ([0-9]+)$', s...
[ "0.73440886", "0.6960303", "0.68972707", "0.66657054", "0.6646483", "0.65970385", "0.65923643", "0.6590306", "0.65035665", "0.63250923", "0.62260634", "0.61368084", "0.6075879", "0.6066796", "0.6066796", "0.60048246", "0.6001465", "0.5982958", "0.5942587", "0.5940255", "0.592...
0.786069
0
Decorator Function to mark a function as computing statistics.
def collection_statistic(func: Callable) -> Callable: STATS_FUNCS[func.__name__] = func return func
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def register_statistic(self, func=None, shape=(-1,)):\n if func is not None:\n return self.register_statistic()(func)\n\n def decorator(func):\n\n name = func.__name__\n\n def _wrapper(cluster):\n out = func(cluster)\n self.store.memory_s...
[ "0.7294914", "0.6746682", "0.66677976", "0.663993", "0.65325564", "0.64892924", "0.64695793", "0.64232683", "0.6401159", "0.62703764", "0.6240248", "0.6235602", "0.61766773", "0.6167704", "0.6165759", "0.6122299", "0.6074278", "0.60715395", "0.60648876", "0.60631764", "0.6053...
0.7082828
1
Creates and fills the table dls with document ids and the length of the document
def create_and_insert_dls(connection: DBConnection) -> None: print("\n[-] creating table dls", end="") connection.execute(""" CREATE TABLE dls AS SELECT did, SUM(tf) AS len FROM tfs GROUP BY did """) print("\r[+] creating table dls")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_and_insert_d(connection: DBConnection) -> None:\n print(\"\\n[-] creating table d\", end=\"\")\n connection.execute(\"\"\"\n CREATE TABLE d AS\n SELECT COUNT(DISTINCT did) AS size FROM tfs\n \"\"\")\n print(\"\\r[+] creating table d\")", "def build_DB(self, doc_files):\n\t\tc...
[ "0.6226787", "0.61848944", "0.6102662", "0.5985762", "0.5882469", "0.5878974", "0.58279216", "0.5772584", "0.5767882", "0.57118165", "0.56822664", "0.56790006", "0.5665106", "0.56556225", "0.56497467", "0.5645398", "0.56384826", "0.5636378", "0.56256986", "0.56222427", "0.561...
0.6696293
0
Create and fills the table max_page with the maximum page number in the collection
def create_and_insert_max_page(connection: DBConnection) -> None: print("\n[-] creating table max_page", end="") connection.execute(""" CREATE TABLE max_page AS SELECT MAX(page) AS max_page from boost""") print("\r[+] creating table max_page")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_max_per_page(self, max_per_page):\n if max_per_page > 0:\n self.max_per_page = max_per_page\n if self.page == 0:\n self.page = 1\n elif max_per_page == 0:\n self.max_per_page = 0\n self.page = 0\n else:\n self.max_pe...
[ "0.65806496", "0.64545554", "0.62837803", "0.5855304", "0.5809302", "0.57609296", "0.5717428", "0.57023317", "0.5653325", "0.56266433", "0.56158954", "0.5523208", "0.5511269", "0.5484128", "0.54678166", "0.54474217", "0.54080516", "0.5386392", "0.53737485", "0.5360691", "0.53...
0.79995483
0
Mocked main.authenticator. This is only to show how we can manually replace a decorator. This mocked decorator basically does the same, but it doesn't have any conditions or exceptions, it's just calling and returning the function it decorates.
def mocked_authenticator(f): def internal(name): return f(name) return internal
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decorate(func, *args, **kws):\n def do_authenticate():\n \"\"\"\n A function to perform authentication\n every time decorated function is called.\n \"\"\"\n #try:\n if 1:\n if 'referer' n...
[ "0.63512194", "0.6246804", "0.6164939", "0.6088463", "0.5992738", "0.59843826", "0.5943376", "0.59180933", "0.5896649", "0.5813473", "0.5807556", "0.57782924", "0.5765671", "0.5748399", "0.57367116", "0.57280177", "0.5712885", "0.56736964", "0.5622528", "0.5619826", "0.559378...
0.79844385
0
get_num_procs() should be able to handle attributes set to ClassAd expressions
def test_proc_expr(self): for attr in condor_meter.PROC_ATTRS: jobad = classad.ClassAd() jobad[attr] = classad.ExprTree('2 + 2') procs = condor_meter.get_num_procs(jobad) self.assertEqual(procs, 4)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_proc_attr_order(self):\n jobad = classad.ClassAd()\n for attr, val in [(x, condor_meter.PROC_ATTRS.index(x)) for x in reversed(condor_meter.PROC_ATTRS)]:\n jobad[attr] = val\n self.assertEqual(condor_meter.get_num_procs(jobad), val)", "def test_proc_int(self):\n ...
[ "0.6800981", "0.6564942", "0.6124325", "0.60507804", "0.5906777", "0.54813504", "0.54113394", "0.53842336", "0.53582615", "0.53454304", "0.5321942", "0.5308282", "0.52417046", "0.5236245", "0.5215648", "0.5202292", "0.5175701", "0.5174391", "0.51738656", "0.5106141", "0.50960...
0.7117242
0
Update any meta estimator's parameters. For now, we first delete the old version of the meta estimator in the 'self.clf' dictionary, then attempt to replace it with a new version. If update fails, we fall back to the old version again, and throw a warning.
def update(self, name, params): if not len(params)>0: raise ValueError("'params' cannot be empty.") if not name in self.names: raise ValueError("'name' not a valid name: see 'self.names'.") mod_name, meta_estimator = self._mapper...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def updateData(self, *args):\n # if self.move_next_option == \"R\":\n # self.restSampling()\n # elif self.move_next_option == \"A\":\n # self.addExtra()\n # else:\n # self.continueReview()\n for name, value in self.parameter_inputs.items():\n ...
[ "0.65816754", "0.62721175", "0.6128515", "0.6121827", "0.6019953", "0.6019953", "0.5924496", "0.5847686", "0.56630135", "0.5602847", "0.55983543", "0.5583155", "0.5583155", "0.5545301", "0.55164135", "0.54962695", "0.5451385", "0.54158777", "0.53923094", "0.53835976", "0.5371...
0.75532734
0
This method is a wrapper to cross validation using RandomizedSearchCV from scikitlearn wherein we optimize each defined algorithm. Default behavior is to optimize all parameters available to each algorithm, but it is possible to sample (randomly) a subset of them to optimize (sample_params=True) or to choose a set of p...
def rand_optimize(self, X, y, n_iter=12, scoring='accuracy', cv=10, n_jobs=1, sample_params=False, min_params=2, get_params=False, random_state=None): get_key = (lambda name, i: name if i<2 else name+str(i-1)) def search(clf, params): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def optimization_parameters():\n param_distributions = {\n \"n_estimators\": list(range(50, 300, 50)),\n \"max_features\": [\"auto\", \"log2\"],\n \"max_depth\": list(range(1, 21, 2)),\n \"min_samples_leaf\": list(range(4, 22, 2)),\n \"min_samples_split\": list(range(5, 30, 5)...
[ "0.6978539", "0.68491685", "0.6817141", "0.6810698", "0.6791853", "0.6783074", "0.67829084", "0.66795504", "0.663065", "0.66278654", "0.6627825", "0.66133183", "0.6608392", "0.65975446", "0.65966845", "0.6552215", "0.6512887", "0.64904135", "0.6417809", "0.63920224", "0.63880...
0.7428222
0
Carve and decompress SWF streams
def carve(self, payload, **kwargs): results = None # Let's make this a file object to simplify our seeks payload = BytesIO(payload) payload.seek(0) for start, end in self.carve_payload(self.headers, payload): swf = self.decompress(payload, start) if swf...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decompress_stream(src, dst):\n with gzip.GzipFile(fileobj=src, mode='rb') as gz:\n for block in iterfile(gz):\n dst.write(block)", "def fullunzip_output(self: object, controller: FullDecoder) -> Iterator[str]:\n yield controller.huff_decoder.seq.read()\n yield controller.hu...
[ "0.62041116", "0.5703585", "0.56586635", "0.55899376", "0.543132", "0.5431001", "0.53853", "0.5366264", "0.53655446", "0.5347371", "0.5264423", "0.5263041", "0.5237696", "0.5230929", "0.5208397", "0.5170824", "0.5170556", "0.514627", "0.51317793", "0.5118476", "0.51127446", ...
0.6616005
0
Will give the status of the last sis Import
def sis_import_status(): # Get status of last SIS imports path = 'v1/accounts/{account_id}/sis_imports' url = config.Canvas_base_api_url_write + path.format(account_id=config.Canvas_account_id) headers = {'Authorization': 'Bearer {token}'.format(token=config.CanvasSISImportToken)} r = requests.get(u...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_import_status(self):\n return AsyncResult(self.import_task_id).state", "def getStatus():", "def status(self):", "def status(self):\n pass", "def status(self):\n pass", "def status(self):\n\t\treturn self._status", "def status(self):\n return None", "def get_status(...
[ "0.69668514", "0.6730247", "0.65556085", "0.65464914", "0.65464914", "0.63435256", "0.63200384", "0.620858", "0.6144266", "0.61195827", "0.61140776", "0.61029905", "0.61029905", "0.61017865", "0.6097921", "0.6094401", "0.6094401", "0.6030535", "0.6027439", "0.6024591", "0.601...
0.80363405
0
Queries by administrative users will search on SIS ID, name, or email address; non administrative queries will only be compared against name. Used to return the sis_user_id. In most cases, the search_term will be the login_id.
def find_sis_user_id(search_term): path = 'v1/accounts/1/users' url = config.Canvas_base_api_url + path.format( account_id=config.Canvas_account_id) + '?search_term={search_term}'.format(search_term=search_term) headers = {'Authorization': 'Bearer {token}'.format(token=config.CanvasSISImportToken)} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def searchUsers(self,conds,_from,to,order_by,desc,admin_obj):\n self.__searchUsersCheckInput(conds,_from,to,order_by,desc,admin_obj)\n search_helper=user_main.getAttributeManager().runAttrSearchers(conds,admin_obj)\n return search_helper.getUserIDs(_from,to,order_by,desc)", "def search_syste...
[ "0.5700071", "0.55735314", "0.5534683", "0.552157", "0.5514016", "0.5435103", "0.53701705", "0.53647137", "0.5350733", "0.53201866", "0.52972925", "0.5281827", "0.52600163", "0.52509713", "0.5187289", "0.51849455", "0.51415837", "0.51415837", "0.51415837", "0.51334435", "0.50...
0.6530413
0
Parses the input file and returns the path of hidden states, the available states, and the transition matrix of probabilities
def parseInput(toParse): splitified = toParse.split('--------') statesPath = splitified[0].rstrip().strip() availableStates = len(splitified[1].rstrip().strip().split()) probMatrix = splitified[2].rstrip().strip().splitlines() return(probMatrix, statesPath, availableStates)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_input(filename: str) -> list:\n\n text_stream = io.open(filename, 'r', encoding='utf-8', errors='ignore', newline='\\n')\n \"\"\" Calls Python's io function to read the file with the specified name.\"\"\"\n\n initial_state = []\n for i in range(0, 4):\n initial_state.append(list(map(int...
[ "0.62794125", "0.60357046", "0.5905535", "0.58000654", "0.57542473", "0.56629896", "0.56211025", "0.5603078", "0.56018066", "0.55909824", "0.55760443", "0.55754703", "0.55658996", "0.5511852", "0.5490431", "0.5483487", "0.5455659", "0.5448798", "0.5427601", "0.5427573", "0.54...
0.6321272
0
Builds a dictionary of transition probabilities based on the transition matrix provided
def getTransitionDict(self, probMatrix): line = 0 transitionDict = {} for prob in probMatrix: prob = prob.split() if line == 0: orderedStates = prob else: state1 = prob.pop(0) for i in range(len(orderedStates)): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def estimate_transition_params(symbol_symbol_counts, symbol_counts):\n\n transition_probabilities = {}\n for symbol1 in symbol_symbol_counts:\n transition_probabilities[symbol1] = {}\n for symbol2 in symbol_symbol_counts[symbol1]:\n if symbol_counts[symbol1] == 0:\n tr...
[ "0.6934553", "0.69232607", "0.6802361", "0.6799978", "0.6776263", "0.67528754", "0.6515377", "0.6503238", "0.6460577", "0.64418465", "0.6350844", "0.6329724", "0.6300354", "0.62308633", "0.61856866", "0.61784756", "0.6168638", "0.61442333", "0.61436385", "0.61251456", "0.6118...
0.7817806
0
Uses the knonw hidden path of states and the dictionary of transition probabilities to calculate the probability of the path
def calcProbStatePath(self, statesPath, transitionDict, availableStates): stateCount = 0 for state in statesPath: if stateCount == 0: prevState = state stateCount += 1 continue transition = str(prevState) + str(state) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pathProb(self, path):\n # Establish initial state distribution.\n estState = []\n for s in range(self.P):\n estState.append(self.initial(path[0][0], s))\n logProb = 0\n for step in range(1, len(path)):\n # Calculate a softmax probability that the agent u...
[ "0.6943489", "0.6446359", "0.63562226", "0.6247837", "0.61047006", "0.6098608", "0.6095511", "0.6083112", "0.60418123", "0.6027082", "0.5972537", "0.5898897", "0.5895798", "0.58440006", "0.5842027", "0.5832881", "0.5794739", "0.5793149", "0.5791423", "0.57638", "0.5759445", ...
0.7105391
0
Move a file image to dest
def moveImage(image, dest): if not os.path.exists(dest): os.mkdir(dest) move(image, dest)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_file(source, destination):\n shutil.move(source, destination)", "def moveFile(source, dest):\n try:\n shutil.move(source, dest) \n except IOError as e:\n print (\"Unable to move file. %s\" %(e))", "def move_file(self, path: PathLike, dest: PathLike, force: bool = False):", "de...
[ "0.7409731", "0.727082", "0.6976611", "0.69527394", "0.68032056", "0.6777381", "0.6752211", "0.6710244", "0.670858", "0.66909623", "0.6647615", "0.66437304", "0.6637402", "0.6626916", "0.6587693", "0.6578515", "0.6555362", "0.65325975", "0.6487247", "0.64469457", "0.64408624"...
0.75593233
0
Look in the database to see if we have a reference image for this particular field, telescope and filter combination If a previous image is found, the user is prompted to disable this file in preparation for submitting the new reference image in the next step.
def checkForPreviousRefImage(field, telescope, filt): qry_args = (field, telescope, filt, tnow(), ) qry = """ SELECT ref_id, field, telescope, ref_image, filter, valid_from, valid_until FROM autoguider_ref WHERE field=%s AND telescope=%s AND filter=%s ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disableRefImage(ref_id, field, telescope, ref_image, filt):\n qry_args = (tnow(), ref_id, field, telescope, ref_image, filt, )\n qry = \"\"\"\n UPDATE autoguider_ref\n SET valid_until=%s\n WHERE ref_id=%s\n AND field=%s\n AND telescope=%s\n AND ref_image=%s\n ...
[ "0.6599386", "0.5923102", "0.5676301", "0.5554952", "0.5532642", "0.5521263", "0.54802597", "0.54356307", "0.5430492", "0.5422384", "0.5389012", "0.53569466", "0.5332453", "0.5326622", "0.53233635", "0.53121096", "0.5306522", "0.5298879", "0.52846205", "0.5251696", "0.5240448...
0.7218289
0
Create a QoS Specification. For a full list of available parameters, please refer to the official
def create_qos(self, **kwargs): post_body = json.dumps({'qos_specs': kwargs}) resp, body = self.post('qos-specs', post_body) body = json.loads(body) self.validate_response(schema.show_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_qos(self, specs):\n aname = \"cinder_v%s.create_qos\" % self.version\n name = self.generate_random_name()\n\n with atomic.ActionTimer(self, aname):\n return self._get_client().qos_specs.create(name, specs)", "def _create_qos_specs(self, name, values=None):\n if v...
[ "0.686167", "0.67896867", "0.67133135", "0.65024567", "0.6364153", "0.62897444", "0.62006146", "0.6131882", "0.56785053", "0.5630256", "0.563019", "0.5527091", "0.55141985", "0.55135745", "0.54422367", "0.54124385", "0.5382331", "0.5316895", "0.5239837", "0.52316684", "0.5203...
0.7113166
0
Delete the specified QoS specification.
def delete_qos(self, qos_id, force=False): resp, body = self.delete( "qos-specs/%s?force=%s" % (qos_id, force)) self.validate_response(schema.delete_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qos_workload_delete(self, workload_name):\n return self.request( \"qos-workload-delete\", {\n 'workload_name': [ workload_name, 'workload-name', [ basestring, 'None' ], False ],\n }, {\n } )", "def delete_qos_policy(self, name_or_id):\n if not self._has_neutron_extensio...
[ "0.64176905", "0.6249143", "0.62179244", "0.6146937", "0.61116797", "0.60787046", "0.58547926", "0.5722869", "0.5720453", "0.5612197", "0.5491842", "0.54498994", "0.5423992", "0.53494656", "0.53045034", "0.5255026", "0.5255026", "0.52542764", "0.5228334", "0.5227104", "0.5224...
0.6654009
0
List all the QoS specifications created.
def list_qos(self): url = 'qos-specs' resp, body = self.get(url) body = json.loads(body) self.validate_response(schema.list_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_qos(self, search_opts=None):\n aname = \"cinder_v%s.list_qos\" % self.version\n with atomic.ActionTimer(self, aname):\n return self._get_client().qos_specs.list(search_opts)", "def create_qos(self, **kwargs):\n post_body = json.dumps({'qos_specs': kwargs})\n resp, ...
[ "0.67390376", "0.65757364", "0.65319103", "0.64933616", "0.6000424", "0.597016", "0.59578675", "0.5949403", "0.58467436", "0.58439744", "0.5838456", "0.5550228", "0.54971963", "0.5491561", "0.53447664", "0.5344072", "0.51313496", "0.5106537", "0.51012284", "0.50234056", "0.50...
0.7402834
0
Set the specified keys/values of QoS specification. For a full list of available parameters, please refer to the official
def set_qos_key(self, qos_id, **kwargs): put_body = json.dumps({"qos_specs": kwargs}) resp, body = self.put('qos-specs/%s' % qos_id, put_body) body = json.loads(body) self.validate_response(schema.set_qos_key, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_qos(self, qos_id, set_specs_args):\n aname = \"cinder_v%s.set_qos\" % self.version\n with atomic.ActionTimer(self, aname):\n return self._get_client().qos_specs.set_keys(qos_id,\n set_specs_args)", "def set_qos(self, qos, se...
[ "0.6861405", "0.6641188", "0.62184954", "0.5950843", "0.58835053", "0.5691892", "0.56309533", "0.56226534", "0.5605602", "0.5604423", "0.5594701", "0.555774", "0.5506906", "0.5271622", "0.523785", "0.52335745", "0.51633805", "0.51544476", "0.51381606", "0.5057488", "0.5043131...
0.6714785
1
Unset the specified keys of QoS specification.
def unset_qos_key(self, qos_id, keys): put_body = json.dumps({'keys': keys}) resp, body = self.put('qos-specs/%s/delete_keys' % qos_id, put_body) self.validate_response(schema.unset_qos_key, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def del_qos(self, qos_id):\n \n del self.qos_dict[qos_id]", "def del_psana_options(self, keys):\n try:\n for key in keys:\n self._data.psana_cfg_dict.pop(key, None)\n except:\n print 'Invalid keys to remove from psana options:', keys", "def remov...
[ "0.57452106", "0.5731151", "0.5670435", "0.5662857", "0.56020606", "0.5568831", "0.55685073", "0.55467397", "0.54943794", "0.54796493", "0.5431031", "0.54163265", "0.53874576", "0.53743917", "0.53007334", "0.5291999", "0.528608", "0.528608", "0.528608", "0.528608", "0.5146188...
0.71568114
0
Associate the specified QoS with specified volumetype.
def associate_qos(self, qos_id, vol_type_id): url = "qos-specs/%s/associate" % qos_id url += "?vol_type_id=%s" % vol_type_id resp, body = self.get(url) self.validate_response(schema.associate_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qos_associate_type(self, qos_specs, vol_type_id):\n aname = \"cinder_v%s.qos_associate_type\" % self.version\n with atomic.ActionTimer(self, aname):\n tuple_res = self._get_client().qos_specs.associate(qos_specs,\n vol_type_...
[ "0.6731862", "0.6464051", "0.625413", "0.5581072", "0.5410727", "0.52217406", "0.5057175", "0.5055254", "0.50099355", "0.4997287", "0.49895817", "0.49579874", "0.49121717", "0.4888058", "0.48680422", "0.4864405", "0.47797176", "0.4761732", "0.47521654", "0.4747894", "0.473808...
0.68561196
0
Get the association of the specified QoS specification.
def show_association_qos(self, qos_id): url = "qos-specs/%s/associations" % qos_id resp, body = self.get(url) body = json.loads(body) self.validate_response(schema.show_association_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAssociation(self, *args):\n return _libsbml.GeneProductAssociation_getAssociation(self, *args)", "def getAssociation(self, *args):\n return _libsbml.FbcOr_getAssociation(self, *args)", "def getAssociation(self, *args):\n return _libsbml.GeneAssociation_getAssociation(self, *args)", ...
[ "0.6263618", "0.6193483", "0.6128729", "0.58500904", "0.56355715", "0.54471433", "0.5368156", "0.5327578", "0.52952015", "0.52783805", "0.5216578", "0.5170039", "0.5107426", "0.50902504", "0.50902504", "0.50902504", "0.5033695", "0.5010923", "0.49869522", "0.489922", "0.48927...
0.6504925
0
Disassociate the specified QoS with specified volumetype.
def disassociate_qos(self, qos_id, vol_type_id): url = "qos-specs/%s/disassociate" % qos_id url += "?vol_type_id=%s" % vol_type_id resp, body = self.get(url) self.validate_response(schema.disassociate_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def qos_disassociate_type(self, qos_specs, vol_type_id):\n aname = \"cinder_v%s.qos_disassociate_type\" % self.version\n with atomic.ActionTimer(self, aname):\n tuple_res = self._get_client().qos_specs.disassociate(qos_specs,\n ...
[ "0.69562954", "0.6534271", "0.57658404", "0.5686869", "0.54859895", "0.53576124", "0.53398466", "0.5215228", "0.5078242", "0.5075516", "0.49736407", "0.49734533", "0.49644867", "0.49266326", "0.49042156", "0.48985457", "0.4833798", "0.4770522", "0.4769929", "0.47649917", "0.4...
0.7455541
0
Disassociate the specified QoS with all associations.
def disassociate_all_qos(self, qos_id): url = "qos-specs/%s/disassociate_all" % qos_id resp, body = self.get(url) self.validate_response(schema.disassociate_all_qos, resp, body) return rest_client.ResponseBody(resp, body)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def disassociate_qos(self, qos_id, vol_type_id):\n url = \"qos-specs/%s/disassociate\" % qos_id\n url += \"?vol_type_id=%s\" % vol_type_id\n resp, body = self.get(url)\n self.validate_response(schema.disassociate_qos, resp, body)\n return rest_client.ResponseBody(resp, body)", ...
[ "0.60279834", "0.5495347", "0.5492092", "0.5484957", "0.5411823", "0.539584", "0.5387482", "0.5348593", "0.53169453", "0.5166615", "0.51196355", "0.50415903", "0.49902722", "0.49338356", "0.49234805", "0.47899863", "0.4762773", "0.46255013", "0.45481902", "0.4542565", "0.4516...
0.6366214
0
Return downloaded model path, if model path does not exist and download is true, it will download and return the path
def _get_or_download_model(self, download: bool) -> Optional[str]: home_dir = home_directory() downloaded_models_dir = os.path.join(home_dir, MODELS_DIR) if not os.path.exists(downloaded_models_dir): os.makedirs(downloaded_models_dir) model_hashed_name = get_hashed_name(sel...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def download_model(name: str) -> str:\n model_name, model_type, model_url = ModelInfo.get_model_info(name)\n model_path = _create_dirs(model_name)\n if model_type == \"single\":\n model_path = _download_file(model_url, model_path)\n elif model_type == \"zip\":\n model_path = _download_zip...
[ "0.74831116", "0.73793954", "0.7352145", "0.72152346", "0.71942884", "0.71756595", "0.6994751", "0.6895224", "0.6861272", "0.68516624", "0.6817331", "0.67670095", "0.67599094", "0.6736649", "0.67351776", "0.6683081", "0.6617652", "0.6586547", "0.65616906", "0.65493286", "0.64...
0.85048527
0
Inverse a rigid body transform matrix (3x4 as [R|t]) [R'|R't; 0|1]
def inverse_rigid_trans(Tr): inv_Tr = np.zeros_like(Tr) # 3x4 inv_Tr[0:3,0:3] = np.transpose(Tr[0:3,0:3]) inv_Tr[0:3,3] = np.dot(-np.transpose(Tr[0:3,0:3]), Tr[0:3,3]) return inv_Tr
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inv(transform_matrix):\n\n r = transform_matrix[0:3, 0:3]\n t = transform_matrix[0:3, 3]\n t_inv = -1 * r.T.dot(t)\n transform_inv = np.eye(4)\n transform_inv[0:3, 0:3] = r.T\n transform_inv[0:3, 3] = t_inv\n\n return transform_inv", "def affine_transform_inverse(np_transform):\n rota...
[ "0.7992459", "0.73654085", "0.73455876", "0.7275773", "0.71793175", "0.71027493", "0.70824426", "0.70296335", "0.70186996", "0.6962239", "0.6892406", "0.68733126", "0.6845929", "0.6784235", "0.6768345", "0.6762228", "0.6750207", "0.67484945", "0.6731383", "0.6667329", "0.6660...
0.81755674
0
Performs one step of state transitions and returns the new cube state. If a cube is active and exactly 2 or 3 of its neighbors are also active, the cube remains active. Otherwise, the cube becomes inactive. If a cube is inactive but exactly 3 of its neighbors are active, the cube becomes active. Otherwise, the cube rem...
def transitionState(initialState: dict[P3, bool]) -> dict[P3, bool]: nextState = initialState.copy() for cube in initialState.keys(): # Determine the active adjacent cubes for each cube. adj = adjacentToP3(cube) active = 0 for a in adj: # Add inactive cube if not present. if not a in in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def computeNextState(self):\n aliveNeighbors = self.numOfLiveNeighbors()\n if aliveNeighbors < 2 or aliveNeighbors > 3:\n self.setNextToDead()\n\n if not self.isAlive() and aliveNeighbors == 3:\n self.setNextToAlive()", "def next(self):\n self.current_state = sel...
[ "0.6123962", "0.5760995", "0.57188153", "0.5610587", "0.5610587", "0.5568904", "0.5533228", "0.5461215", "0.54273623", "0.5403745", "0.5403745", "0.5377315", "0.536468", "0.5336476", "0.53206646", "0.53142345", "0.52967036", "0.5276811", "0.5252569", "0.5229503", "0.5226565",...
0.72574687
0
u"""a geometry method that iterate the four edges of each rectangle.
def iter_edges(self): yield self.upperleft, self.upperright yield self.upperright, self.bottomright yield self.bottomright, self.bottomleft yield self.bottomleft, self.upperleft
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(self):\n\t\tleftback = self.center + self.left*self.wr - self.forward*self.hr\n\t\tleftfront = self.center + self.left*self.wr + self.forward*self.hr\n\t\trightfront = self.center - self.left*self.wr + self.forward*self.hr\n\t\trightback = self.center - self.left*self.wr - self.forward*self.hr\n\t\tyield...
[ "0.6739373", "0.6116638", "0.6110527", "0.6033942", "0.59250385", "0.59039676", "0.5870451", "0.58211106", "0.5783347", "0.5771442", "0.5769444", "0.57066584", "0.56586593", "0.5625352", "0.56252295", "0.5607948", "0.56048244", "0.55932707", "0.5584458", "0.5561689", "0.55572...
0.6852751
0
u"""a geometry method that returns the result as true if each node or footprint overlapped with a resort, in a certain frame, where a resort is a group of footprints that represent a tracked tour of a firefly.
def is_overlappedResort(self, resort): for corner in resort.corners: if self.is_point_in(corner): return True for corner in self.corners: if resort.is_point_in(corner): return True if self.intersection_area(resort) > 0: return T...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_overlappedFootprint(self, footprint):\n if footprint.width == 0 or footprint.height == 0 or footprint.popularity <= 1:\n return False\n for corner in footprint.corners:\n if self.is_point_in(corner):\n return True\n for corner in self.corners:\n ...
[ "0.6543317", "0.618605", "0.61726284", "0.6157455", "0.61498356", "0.60966516", "0.6028612", "0.6011543", "0.59590167", "0.5923201", "0.5917814", "0.5903261", "0.58815926", "0.58540064", "0.5760587", "0.5756358", "0.57541883", "0.5750267", "0.56735206", "0.5663664", "0.566015...
0.63002485
1
u"""a geometry method that returns the overlapped area size of two footprints.
def intersection_area(self, footprint): dx = min(self.upperright[0], footprint.upperright[0]) - max(self.upperleft[0], footprint.upperleft[0]) dy = min(self.bottomright[1], footprint.bottomright[1]) - max(self.upperright[1], footprint.upperright[1]) #assert dx >= 0 #assert dy >= 0 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def intersectarea(p1,p2,size):\n x1, y1 = p1\n x2, y2 = p2\n ix1, iy1 = max(x1,x2), max(y1,y2)\n ix2, iy2 = min(x1+size,x2+size), min(y1+size,y2+size)\n iarea = abs(ix2-ix1)*abs(iy2-iy1)\n if iy2 < iy1 or ix2 < ix1: iarea = 0\n return iarea", "def overlap_area(a, b):\n return min(a[2] - b[0], b[2] - a[0]) * m...
[ "0.6626041", "0.653045", "0.64625585", "0.6312777", "0.6172353", "0.61613196", "0.6154281", "0.6111627", "0.6093945", "0.6074289", "0.60740083", "0.60280305", "0.6022227", "0.6022227", "0.6015363", "0.60119534", "0.59772784", "0.59644353", "0.5922487", "0.5906591", "0.5877896...
0.6602258
1
u"""a geometry method that returns the shortest distance from a single footprint to a resort.
def distance_from_resort(self, resort): if self.is_overlappedResort(resort): return 0 if self.center == resort.center: return 0 if self._isLine(): return 0 line = (self.center, resort.center) edge1 = None edge2 = None if self._...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def shortest_distance_to(self, pt):\n return self._nearest_to_point(pt)[0]", "def shortest_distance(self, begin, end):\n\n begin_index = self._cell_indexes[begin]\n end_index = self._cell_indexes[end]\n\n distance = self._distance_mat[begin_index, end_index]\n # distance *= pq....
[ "0.6115771", "0.56596416", "0.5634452", "0.5590653", "0.55900955", "0.55645114", "0.5542581", "0.54565066", "0.54423124", "0.54352593", "0.5422234", "0.54141176", "0.53989816", "0.5350227", "0.53444254", "0.53398824", "0.53291106", "0.5319662", "0.53177917", "0.5287227", "0.5...
0.5722825
1
u"""a geometry method that returns true if a footprint is in a line.
def _isLine(self): return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_line_on_line(feature_1: Sequence, feature_2: Sequence) -> bool:\n\n line_on_line = False\n\n for coords in feature_1:\n\n line_on_line = boolean_point_on_line(coords, feature_2)\n if not line_on_line:\n break\n\n return line_on_line", "def is_line_on_multiline(feature_1: ...
[ "0.6780257", "0.6633728", "0.65686494", "0.6508057", "0.6508057", "0.6468665", "0.64110076", "0.63063616", "0.6295855", "0.6294679", "0.628508", "0.6276145", "0.6262514", "0.6249706", "0.6200294", "0.61792415", "0.6177411", "0.6134845", "0.6126966", "0.6080587", "0.6034201", ...
0.7168812
0
u"""a geometry method that returns true if a footprint is a single point.
def _isPoint(self): return (self.width == 0 and self.height == 1) or (self.height == 0 and self.width == 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ispoint(x):\n if isvect(x) and x[3] > 0.0:\n return True\n return False", "def is_simple(geometry, **kwargs):\n return lib.is_simple(geometry, **kwargs)", "def HasPoint(self, vtkAMRBox, , , p_float_6, p_float_7, p_float_8):\n ...", "def isSinglePiece(self):\n return isinstan...
[ "0.67384344", "0.6545368", "0.65386426", "0.6509094", "0.6455047", "0.6444787", "0.6406779", "0.63096744", "0.6303305", "0.6288368", "0.6267545", "0.6254299", "0.6242142", "0.6209652", "0.6201518", "0.61916465", "0.6180907", "0.6176551", "0.61427265", "0.6122693", "0.61013955...
0.7222118
0
u"""a geometry method that returns true if two lines intersect.
def _lines_intersect(self, line1, line2): return self._lines_overlap_on_x_axis(line1, line2) and self._lines_overlap_on_y_axis(line1, line2)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_does_intersect() -> None:\n line_1 = Line(k=1, n=0)\n line_2 = Line(k=2.5, n=1)\n line_3 = Line(k=2.5, n=3)\n\n assert line_1.does_intersect(line_1) == True\n assert line_1.does_intersect(line_2) == True\n assert line_2.does_intersect(line_3) == False", "def lines_intersect(x1, y1, x2,...
[ "0.79638934", "0.79054546", "0.7782395", "0.76920307", "0.7546205", "0.7492017", "0.7469466", "0.7446669", "0.73084617", "0.7301949", "0.7270011", "0.72583646", "0.7258321", "0.7256644", "0.7224812", "0.72058594", "0.71913975", "0.71896297", "0.7099", "0.70612097", "0.7058547...
0.83235073
0
u"""a geometry method that returns true if two lines ovelap on X axis.
def _lines_overlap_on_x_axis(self, line1, line2): x1, x2, = line1[0][0], line1[1][0] x3, x4, = line2[0][0], line2[1][0] e1_left, e1_right = min(x1, x2), max(x1, x2) e2_left, e2_right = min(x3, x4), max(x3, x4) return (e1_left >= e2_left and e1_left <= e2_right) or (e1_right >= e2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _isLine(self):\n return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)", "def _isLine(self):\n return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)", "def is_horizontal(self):\n return self.start.x == self.end.x", "def ...
[ "0.682653", "0.682653", "0.65629226", "0.64580953", "0.64573747", "0.6404881", "0.6225626", "0.6126008", "0.6122892", "0.6084595", "0.60699165", "0.60695654", "0.59757805", "0.59720397", "0.5970879", "0.59596765", "0.59415525", "0.5918198", "0.5907161", "0.5898881", "0.588687...
0.7135966
0
u"""a geometry method that returns true if two lines ovelap on Y axis.
def _lines_overlap_on_y_axis(self, line1, line2): y1, y2, = line1[0][1], line1[1][1] y3, y4, = line2[0][1], line2[1][1] e1_top, e1_bot = min(y1, y2), max(y1, y2) e2_top, e2_bot = min(y3, y4), max(y3, y4) return (e1_top >= e2_top and e1_top <= e2_bot) or (e1_bot >= e2_top and e1_b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_vertical(self):\n return self.start.y == self.end.y", "def has_y(self):\n return any(map(lambda s: s.is_y, self))", "def _is_max(self, y0, y1, y2):\n return True if (y1 - y0 > 0) and (y2 - y1 < 0) else False", "def _isLine(self):\n return (self.width == 0 and self.height > ...
[ "0.6797029", "0.6630329", "0.66237146", "0.65143883", "0.65143883", "0.6334313", "0.6316053", "0.6232823", "0.6209444", "0.61563563", "0.6154035", "0.60981345", "0.60970944", "0.6096418", "0.60744244", "0.6051291", "0.6035252", "0.6031947", "0.6030773", "0.60134363", "0.59459...
0.7338519
0
u"""a geometry method that returns true if a single point is facing an edge.
def _point_faces_edge(self, edge, point): a = sqrt((edge[0][0] - edge[1][0]) ** 2 + (edge[0][1] - edge[1][1]) ** 2) b = sqrt((edge[0][0] - point[0]) ** 2 + (edge[0][1] - point[1]) ** 2) c = sqrt((edge[1][0] - point[0]) ** 2 + (edge[1][1] - point[1]) ** 2) ang1, ang2 = self._angle(b, a, c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def isEdge(self,x,y):\r\n return self.matr[x][y]", "def isEdge(self,x,y):\n\t\treturn self._matr[x][y]", "def is_edge(self):\n if self._row == 0 or self._row == 9 or self._column == 0 or self._column == 9:\n # check that the edge is not actually a corner square\n if not self...
[ "0.7213712", "0.7184389", "0.6948606", "0.6931671", "0.69004", "0.68743634", "0.6871175", "0.6673136", "0.66165024", "0.656469", "0.646561", "0.6457592", "0.6428723", "0.6394784", "0.63617504", "0.63297075", "0.6313382", "0.62736875", "0.6268916", "0.6210656", "0.61989725", ...
0.74381036
0
u"""a geometry method that iterate the four edges of each rectangle.
def iter_edges(self): yield self.upperleft, self.upperright yield self.upperright, self.bottomright yield self.bottomright, self.bottomleft yield self.bottomleft, self.upperleft
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def edges(self):\n\t\tleftback = self.center + self.left*self.wr - self.forward*self.hr\n\t\tleftfront = self.center + self.left*self.wr + self.forward*self.hr\n\t\trightfront = self.center - self.left*self.wr + self.forward*self.hr\n\t\trightback = self.center - self.left*self.wr - self.forward*self.hr\n\t\tyield...
[ "0.6739373", "0.6116638", "0.6110527", "0.6033942", "0.59250385", "0.59039676", "0.5870451", "0.58211106", "0.5783347", "0.5771442", "0.5769444", "0.57066584", "0.56586593", "0.5625352", "0.56252295", "0.5607948", "0.56048244", "0.55932707", "0.5584458", "0.5561689", "0.55572...
0.6852751
1
u"""Add a footprint to the resort.
def addFootprint(self, footprint): self.footprints.append(footprint)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def footprint(dynamic_footprint_modifier=0.):", "def addFP(self, num=1):\n self.fp += num", "def add_footprint(self, config):\n logging.debug(\"add_footprint entered\")\n notify(\"Adding footprint...\")\n container = cf.get_container(self.container_name)\n try:\n i...
[ "0.66669506", "0.55094486", "0.52772737", "0.52102876", "0.52102876", "0.51091766", "0.5074373", "0.5063616", "0.50528634", "0.5044987", "0.5037577", "0.5008883", "0.49585447", "0.49389932", "0.49110746", "0.4880826", "0.4850525", "0.484815", "0.48459372", "0.48451495", "0.48...
0.7554015
0
u"""Returns the latest footprint in the timeline.
def getLastFootprint(self): if self.footprints is None: return return self.footprints[-1]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def latest(self):\n return self.journal_data[self.latest_id]", "def get_latest(self):\n if len(self.points) == 0:\n return None\n return self.points[-1]", "def latest(self):\n return self.series.tail(1)[0]", "def get_last_update(self):\n return self.ticker.all()....
[ "0.63570744", "0.63446546", "0.63168794", "0.61486316", "0.61393666", "0.6082738", "0.60559195", "0.60071945", "0.5897552", "0.5897552", "0.58843595", "0.5876215", "0.58123964", "0.5804617", "0.5804571", "0.5740019", "0.5687553", "0.5674964", "0.5673881", "0.5668277", "0.5641...
0.7714971
0
u"""a geometry method that returns true if a group of footprints or a resort is in a line.
def _isLine(self): return (self.width == 0 and self.height > 1) or (self.height == 0 and self.width > 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_line_in_multipoly(feature_1: Sequence, feature_2: Sequence) -> bool:\n\n return any(is_line_in_poly(feature_1, coords_2) for coords_2 in feature_2)", "def belongsToLine(self, index, direction, line): \n first_point = 1 \n if direction == 'Horizontal': # Check if index's y coordina...
[ "0.63367033", "0.6273117", "0.62297666", "0.6196147", "0.6194339", "0.6129758", "0.60498136", "0.6033815", "0.59298456", "0.59017956", "0.5897748", "0.58524024", "0.58368576", "0.58262783", "0.58209234", "0.57898647", "0.5786185", "0.57754904", "0.57718587", "0.5744138", "0.5...
0.66455185
1
u"""a geometry method that returns true if a group of footprints or a resort is a single point.
def _isPoint(self): return (self.width == 0 and self.height == 1) or (self.height == 0 and self.width == 1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __contains__(self, point): \n corners = self.corners\n\n if isinstance(point, tuple):\n from pyresample.spherical_geometry import Coordinate\n retval = planar_point_inside(Coordinate(*point), corners)\n else:\n retval = planar_point_inside(point, corners)\n...
[ "0.6719346", "0.64706874", "0.6413672", "0.63530207", "0.62865037", "0.6283852", "0.62692606", "0.61568344", "0.61236125", "0.61017543", "0.60962677", "0.6090226", "0.60871094", "0.6068841", "0.60536724", "0.60433745", "0.59964705", "0.59964705", "0.5990866", "0.59834594", "0...
0.6768994
0
u"""Return the id list of all the footprints.
def getFootprintId(self): idList = [] for v in self.V: idList.append(v.uid) return idList
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getIDs():", "def get_ids(self) -> List[str]:", "def print_ids(self):\n ids = [self.data[x][DATA_ID_INDEX] for x in self.index_list]\n print(ids)", "def all_id() -> list:\n return [str(i[\"id\"]) for i in Blogs_Manager.TablePost.all_query()]", "def get_identifiers(self) -> list[...
[ "0.6142729", "0.5798519", "0.5783443", "0.5556579", "0.55464196", "0.54756653", "0.54246366", "0.54216796", "0.53245616", "0.5309829", "0.52801085", "0.5262143", "0.5244696", "0.5227384", "0.51829934", "0.5152602", "0.51418626", "0.51342815", "0.5109991", "0.51017064", "0.507...
0.7388867
0
u"""Returns a class of a subset of the Cruise, or a sub graph. Each sub cruise represents a group of resorts where fireflies have toured.
def subCruise(self, footprints): sub = Cruise() sub.V = [v for v in self.V if v.uid in footprints] sub.E = [] sub.neighbours = {} sub.resorts = {} for key, value in self.neighbours.items(): sub.neighbours[key] = [] if key in footprints: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _split_class_to_subclasses(self, l_ts_c):\n # get the criteria time series\n criteria_ts = self._get_criteria_ts(l_ts_c)\n\n l_dists = self._get_ordered_ed_to_criteria(l_ts_c, criteria_ts)\n l_adj_discr = self._calc_adjacent_discrepancies(l_dists[1:])\n split_points = self._g...
[ "0.5360419", "0.524145", "0.5106659", "0.49698442", "0.49622428", "0.4888923", "0.48741513", "0.48441327", "0.4826185", "0.47796243", "0.47677684", "0.476544", "0.47593224", "0.47523585", "0.4685852", "0.46683934", "0.46300137", "0.46129906", "0.4582342", "0.4551012", "0.4550...
0.60929304
0
Parses input files (filename is path to input parameters or param_list file) params_flag toggles between input_params vs param_list
def input_parse(filename,params_flag=False): input_parameters ={} with open(filename, 'r') as f: count = 0 for line in f: line=line.strip() if line: if line.find('#') == -1: if not params_flag: var_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_parse_file(params):\n\tparam_names = []\n\tparam_options = []\n\tif not os.path.isfile(params.parse_file):\n\t\tprint(\"parse file does not exist! ({})\".format(params.parse_file))\n\t\tsys.exit(NO_PARSE)\n\twith open(params.parse_file, 'r') as pf:\n\t\t# first line should be iteration regex\n\t\tsetattr(...
[ "0.6704902", "0.6357512", "0.62658215", "0.6262145", "0.6238664", "0.6186991", "0.61327845", "0.6062339", "0.6060539", "0.60356957", "0.60318494", "0.59533834", "0.5932915", "0.59022", "0.5889658", "0.5864437", "0.58620644", "0.5803648", "0.57590437", "0.5745036", "0.5691499"...
0.7094989
0
write_input_params writes all the input information from input_params into file_output in the same syntax
def write_input_params(file_output,input_params): with open(file_output,'w+') as f: for key in input_params.keys(): f.write( ''.join(key)+','+str(input_params[key])+'\n') f.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_initparams(params, outdir, padding_var=7, paramsfn='parameters', skiplat=False, skipglat=False):\n paramfile = outdir + paramsfn + '.txt'\n with open(paramfile, 'w') as myfile:\n myfile.write('# Parameters\\n')\n\n dio.ensure_dir(outdir)\n for key in params:\n if key == 'reg1' o...
[ "0.62177896", "0.619383", "0.6179168", "0.614676", "0.61082816", "0.6016456", "0.5996464", "0.59929276", "0.59495217", "0.5901869", "0.58623403", "0.5851739", "0.5813029", "0.5738777", "0.57324725", "0.56804466", "0.56642014", "0.5662713", "0.5631869", "0.5545436", "0.5529248...
0.82052577
0
Gets the coordinates from the locations of each entry in the given table. If `describe` is true, will also append the location name. If `merge` is true, will combine entries of the location and append the count.
def get_coordinate_info(table, describe=False, merge=False): entries = table.query.all() counts = dict() # first get all info - coordinates, names, and counts for entry in entries: try: lat, lng = LocationCoordinates.get(entry.city, entry.state, False) name = f"{entry.cit...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAllLocation(table):\n\tlocs = []\n\n\tnum = len(table)\n\n\tfor i in range(num):\n\t\t# first field is the name\n\t\tloc = getLatAndLong(table[i][1])\n\n\t\tlocs.append(loc)\n\n\treturn locs", "def describe_locations():\n pass", "def get_all_locations(self):", "def test_fetchlocation(self):\n ...
[ "0.6484925", "0.5957219", "0.5379994", "0.53599244", "0.51244", "0.5034708", "0.5020236", "0.49948764", "0.498416", "0.49480277", "0.4930818", "0.49095047", "0.48898584", "0.48659718", "0.48610452", "0.48434463", "0.47998765", "0.4789692", "0.47363678", "0.47228205", "0.47058...
0.7677206
0
Test an AttyDict update works just the same as a dict update
def test_update(inp): atty = AttyDict(a={'aa': 1, 'ab': 2}) regular = dict(a={'aa': 1, 'ab': 2}) atty.update(**inp) assert valid_values(atty) regular.update(**inp) assert dict(atty) == regular
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_dictionary_update(self):\r\n vm = Dictionary.value_manager(None, None, {1:2, 3:4})\r\n assert not vm.changed\r\n vm.value = {4:5}\r\n assert vm.changed", "def test_dictionary_inplace_update(self):\r\n vm = Dictionary.value_manager(None, None, {1:2, 3:4})\r\n ass...
[ "0.76578087", "0.7539282", "0.75262237", "0.7419134", "0.72514987", "0.71413904", "0.70434964", "0.6931481", "0.692064", "0.68900126", "0.68850255", "0.682789", "0.6807966", "0.67872274", "0.67084026", "0.6682749", "0.6586007", "0.6571565", "0.65667784", "0.654758", "0.653848...
0.8602495
0
Returns a generated an email using GPT3 with a certain prompt and starting sentence
def generate_email(self, userPrompt ="Write me a professionally sounding email", start="Dear"): response = openai.Completion.create( engine="davinci", prompt=userPrompt + "\n\n" + start, temperature=0.71, max_tokens=150, top_p=1, frequency_penalty=0.36, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def generate_message(ctx, question, answer):\n return preamble.format(channel=rules_channel(ctx).id) + question + answer", "def get_intro_message() -> str:\n return \"\"\"You are about to begin a new record.\nType the text sample you want to record.\nThis first sample MUST be typed by the real user (no imp...
[ "0.636971", "0.6133606", "0.6104661", "0.60002065", "0.5847313", "0.5846357", "0.57994175", "0.57427454", "0.5715885", "0.5657244", "0.5648353", "0.5638538", "0.5510387", "0.5496268", "0.5483316", "0.5482809", "0.5482642", "0.5479274", "0.5459029", "0.544537", "0.5434967", ...
0.7827507
0
Softcopy parameters of a link to another link.
def soft_copy_param(target_link, source_link, tau): target_params = dict(target_link.namedparams()) for param_name, param in source_link.namedparams(): if target_params[param_name].data is None: raise TypeError( 'target_link parameter {} is None. Maybe the model params are ' ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def copy_params(source, target):\n for target_param, param in zip(target.parameters(), source.parameters()):\n target_param.data.copy_(param.data)", "def hard_update(self,target, source):\n\t\tfor target_param, param in zip(target.parameters(), source.parameters()):\n\t\t\t\ttarget_param.data.copy_(par...
[ "0.6300346", "0.6092019", "0.6062073", "0.60575545", "0.6056579", "0.59935737", "0.58518296", "0.58357877", "0.577225", "0.56902206", "0.5581823", "0.5577353", "0.5543392", "0.55217797", "0.5510422", "0.54779506", "0.53728247", "0.5335812", "0.53293306", "0.53293306", "0.5329...
0.72617334
0
Initial checkpointed timestamp writes checkpoint file if and only if it's a retrospective timestamp.
def test_initial_timestamp_checkpoint_file(self, get_pipe_manager, retrospective): pm = get_pipe_manager(name="init-timestamp-file") stage_name = "align_reads" pm.timestamp(checkpoint=stage_name, finished=retrospective) check_fpath = checkpoint_filepath(stage_name, pm) if retrosp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def checkpoint():", "def checkpoint(name, first = False):\n global DEBUG\n if DEBUG:\n if name != 'first':\n print 'checkpoint %15s: %f' % ((time.time() - SCRIPT_START) if not first else name, (time.time() - checkpoint.start))\n checkpoint.start = time.time()", "def checkpoint(self, timestamp=0.0,...
[ "0.7094185", "0.69855446", "0.66329503", "0.6602398", "0.65057665", "0.6434167", "0.6352898", "0.63001424", "0.6265463", "0.6221535", "0.62178683", "0.6189934", "0.6144929", "0.61392885", "0.6121797", "0.6116467", "0.60995907", "0.60542226", "0.6027266", "0.6010495", "0.59903...
0.77371997
0
Test retrospective timestamp followed by prospective one.
def test_retrospective_the_prospective_checkpointed_timestamps( self, test_type, stage_pair, pm ): stage1, stage2 = stage_pair pm.timestamp(checkpoint=stage1, finished=True) assert stage1 == pm.prev_checkpoint assert pm.curr_checkpoint is None pm.timestamp(checkpoint...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_timestamp_and_datetime_extraction():\n test_datetime = datetime.datetime(2017, 1, 15)\n test_timestamp = (test_datetime - datetime.datetime(1970, 1, 1)).total_seconds() * 1000.0\n\n # valid timestamp in the form kafka would send it if SET\n mock_message.timestamp = Mock(return_value=(1, test_t...
[ "0.66549206", "0.651491", "0.6475255", "0.6385306", "0.63828415", "0.63769156", "0.6375279", "0.63743174", "0.633521", "0.6309993", "0.62100226", "0.6186637", "0.6183479", "0.61688817", "0.6168832", "0.61628336", "0.6162807", "0.60656285", "0.60608375", "0.60238093", "0.60229...
0.6522792
1
Reveals a position if not flagged. Returns False if the position was a bomb, True otherwise.
def reveal(self, position): if position not in self.flags: x, y = position if self.mine_map[y][x]: return False self.revealed.append(position) self.autoreveal_empty_spaces(position) return True
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def position_is_bomb(bombs, position):\n for bomb in bombs:\n if position == bomb.position:\n return True\n return False", "def inSmallBlindPosition(self):\n return len(self.in_game) > 0 and ((self.dealer + 1) % len(self.in_game)) == self.position", "def check_position_free(self,...
[ "0.6689314", "0.6350156", "0.6229879", "0.61965734", "0.61816436", "0.61278343", "0.61034095", "0.6090255", "0.6028748", "0.59984887", "0.5990478", "0.59890753", "0.59868366", "0.5984691", "0.5951825", "0.59470206", "0.5945296", "0.5930022", "0.59292525", "0.59259754", "0.592...
0.68616563
0
Finds the number of mines around a position.
def get_num_mines_around_position(self, x, y): mines = 0 for row in range(y-1, y+2): for col in range(x-1, x+2): if row >= 0 and col >= 0 and row < len(self.mine_map) and col < len(self.mine_map[row]): # Don't check spaces that are outside of the array if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_neighbour_mines(self, x, y):\n neighbour_mines = 0\n for _x in range(x - 1, x + 2):\n for _y in range(y - 1, y + 2):\n if is_valid(_x, _y):\n if is_mine(self.board, _x, _y):\n neighbour_mines += 1\n return neighbour_...
[ "0.6630397", "0.6630397", "0.662239", "0.6609827", "0.6609827", "0.6609827", "0.6609827", "0.6609827", "0.6609827", "0.66069686", "0.65004283", "0.6456882", "0.63458717", "0.63235474", "0.63041794", "0.61740816", "0.61679006", "0.61187834", "0.60969895", "0.6045964", "0.60286...
0.7636701
0
Tune the contour so that there is no back and forth in the contour pixels
def tuneEdge(contour, imshape): r_contour = [] upedge = 100 leftedge = 30 n_r, n_c = imshape for i in range(contour.shape[0] -1): # remove top effect if contour[i,0] < upedge: continue # remove bottom effect if contour[i,1] < contour[i+1,1] and co...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_to_00(contour):\n assert isinstance(contour, np.ndarray)\n assert len(contour.shape) == 2\n assert contour.shape[1] == 2\n\n minx, miny = min(contour[:, 0]), min(contour[:, 1])\n contour -= np.array([minx, miny])\n return contour", "def remove_all(self):\n self.initial = None\n ...
[ "0.63491344", "0.6011234", "0.59444624", "0.5924053", "0.57499874", "0.56713206", "0.56240505", "0.5569322", "0.5563882", "0.55621535", "0.5547519", "0.55105853", "0.54704344", "0.5467177", "0.54588485", "0.545146", "0.54170626", "0.5390239", "0.538939", "0.5372614", "0.53676...
0.64015335
0
Sampling from the contour with given parameters
def contour_sampling(contour, num,delta = 5): samples = [] step = len(contour)/num lefte = 0 for i in range(num): #for i in range(5): samples.append(contour[i*step - i*delta]) samples.append((contour[i*step - i*delta][0],lefte)) #samples.append(contour[len(contour) -...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _sample(self, points: Iterable[float]) -> np.array:\n pass", "def sample(self):\n ndim = len(self.lower_bounds)\n pts = numpy.zeros(ndim)\n for j in range(ndim):\n lb = self.lower_bounds[j]\n ub = self.upper_bounds[j]\n pts[j] = numpy.random.unifor...
[ "0.5975604", "0.57691693", "0.56697077", "0.56589264", "0.56516016", "0.5633421", "0.5558074", "0.5557224", "0.55391985", "0.5518477", "0.5507375", "0.54954773", "0.5488985", "0.54603803", "0.5456767", "0.5439736", "0.5436038", "0.5424675", "0.5415488", "0.5399298", "0.537302...
0.70283747
0
Extracts userdefinedfunction from the proto representation of a
def extract_user_defined_function(user_defined_function_proto, pandas_udaf=False)\ -> Tuple[str, Dict, List]: def _next_func_num(): global _func_num _func_num = _func_num + 1 return _func_num def _extract_input(args) -> Tuple[str, Dict, List]: local_variable_dict = {} ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_function(proto_string):\n _, parsed_features = tf.parse_single_sequence_example(\n proto_string, sequence_features=_parsing_spec(input_size))\n lengths = tf.shape(parsed_features['inputs'])[0]\n # Type int32 is not supported by parsing spec, but int64 is not supported by\n # XLA. Here...
[ "0.56531227", "0.5495012", "0.54619503", "0.5433127", "0.5419678", "0.531842", "0.53180313", "0.5299572", "0.52984077", "0.5246764", "0.5200479", "0.51747113", "0.51611006", "0.5150909", "0.5140705", "0.51399", "0.5136003", "0.5126936", "0.5122214", "0.51077986", "0.51049614"...
0.6685473
0
Get spglib symmetry dataset from a Structure.
def get_symmetry_dataset(structure: Structure, symprec: float = SYMMETRY_TOLERANCE, angle_tolerance: float = ANGLE_TOL) -> dict: cell = structure_to_spglib_cell(structure) return spglib.get_symmetry_dataset(cell=cell, sympr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_symmetry(self):\n from spglib import get_spacegroup\n cell = ( self.lattice, self.fractional_coordinates, self.atomic_nos )\n self.spacegroup = get_spacegroup(cell, symmprec=1e-5)\n print(\"Symmetry space group is\", self.spacegroup)", "def compute_symmetry_3d(structdata, sta...
[ "0.5667199", "0.5576883", "0.5519664", "0.5383802", "0.51993793", "0.5137195", "0.50729096", "0.5040277", "0.50244397", "0.50028515", "0.49727187", "0.49683923", "0.49554533", "0.49520043", "0.49364123", "0.49264452", "0.49063736", "0.48964316", "0.48910108", "0.48393065", "0...
0.7546716
0
Convert structure to spglib cell tuple. Return a cell tuple used by spglib that is composed of lattice parameters, atomic positions in fractional coordinates, and atomic numbers.
def structure_to_spglib_cell(structure: Structure) -> Tuple[list, list, list]: lattice = list(structure.lattice.matrix) positions = structure.frac_coords.tolist() atomic_numbers = [i.specie.number for i in structure.sites] return lattice, positions, atomic_numbers
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def coords_to_structure(self) -> None:\n ...", "def unitCell2P4vaspStruct(uc):\n try:\n #from vaspparsing.SystemPM import *\n from AbInitio.vasp.parsing.Structure import Structure\n import AbInitio.vasp.parsing.matrix as p4mat\n except ImportError:\n print \"P4Vasp could ...
[ "0.5805477", "0.55034447", "0.55026126", "0.5462241", "0.5413421", "0.540865", "0.540865", "0.5321984", "0.5308182", "0.53072065", "0.5267763", "0.52570087", "0.52274275", "0.52244115", "0.51409155", "0.51259816", "0.51194423", "0.5118817", "0.5117905", "0.51159614", "0.51048...
0.80711293
0
Data for one armor item, by type and name
def get(self, item_type, entry_name): armor = ArmorData(name=entry_name) if not hasattr(armor, 'level'): return {"Error": f"'{entry_name}' not found in {item_type} armor. " f"Try this: '{NS.armor._path}/{item_type}/search/" f"{entry_name.replace(' ', '...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, item_type):\n armor_type_id = 0 if item_type == \"light\" else 1\n where = f\"type={armor_type_id}\"\n return get_as_object(\"armor\", ArmorData, where=where)", "def get(self, item_type, search_term):\n armor_type_id = 0 if item_type == \"light\" else 1\n where = ...
[ "0.6941206", "0.6216677", "0.6094252", "0.5861433", "0.58335173", "0.5824723", "0.58173126", "0.5779586", "0.5764441", "0.5763957", "0.56795275", "0.5672821", "0.5671181", "0.5665989", "0.5665989", "0.5658978", "0.5628519", "0.56265455", "0.55896837", "0.55818224", "0.5530423...
0.72483265
0
Search for armor by type
def get(self, item_type, search_term): armor_type_id = 0 if item_type == "light" else 1 where = f"type={armor_type_id}" return search(f"armor", search_term, where=where, model=ArmorData)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get(self, item_type):\n armor_type_id = 0 if item_type == \"light\" else 1\n where = f\"type={armor_type_id}\"\n return get_as_object(\"armor\", ArmorData, where=where)", "def get(self, item_type, entry_name):\n armor = ArmorData(name=entry_name)\n if not hasattr(armor, 'le...
[ "0.6605192", "0.6358644", "0.6311813", "0.6211228", "0.5891919", "0.5829636", "0.57196355", "0.56303674", "0.5611004", "0.5577739", "0.5573177", "0.55069566", "0.5492348", "0.5461244", "0.5456602", "0.5448398", "0.5436667", "0.5434831", "0.5377075", "0.53747", "0.53685737", ...
0.7611095
0
Write the plaintext email content for a given recipient.
def write_plaintext_body(self, recipient: str) -> str: body = f'Dear {recipient},\n\n' \ + 'You are receiving this message because you participated ' \ + f'in {self.trip_title}.\n\n' \ + 'I hope you had a pleasant time.\n\n' \ + 'If you have debts to repay, please...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plaintext_only():\n msg = EmailMessage()\n msg[\"From\"] = sender\n msg[\"To\"] = recipient\n msg[\"Subject\"] = \"Plaintext only\"\n msg.set_content(\"This is the body of a plaintext message.\")\n\n return msg", "def send_email(self,to, subj):\r\n\r\n \"\"\" Currently not implemente...
[ "0.61230975", "0.58844674", "0.5782756", "0.5772196", "0.5745138", "0.57362026", "0.5715956", "0.567944", "0.56768274", "0.56035984", "0.5591884", "0.557902", "0.54868793", "0.54739916", "0.53658736", "0.53658736", "0.5364781", "0.53646946", "0.5353057", "0.5334557", "0.53337...
0.68273336
0
Write the html email content for a given recipient.
def write_html_body(self, recipient: str) -> str: declaration = '<!DOCTYPE html>\n\n' header: str = attach_tag_head( attach_tag_title('reimburser') ) + '\n' preamble: str = self._write_html_preamble(recipient) torso: str = self._write_html_torso(recipient) m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def write_html(self, content):\n self.write(content)", "def write_plaintext_body(self, recipient: str) -> str:\n body = f'Dear {recipient},\\n\\n' \\\n + 'You are receiving this message because you participated ' \\\n + f'in {self.trip_title}.\\n\\n' \\\n + 'I hope ...
[ "0.6415875", "0.6278726", "0.61424017", "0.6041463", "0.59868985", "0.59517837", "0.5924777", "0.583442", "0.583235", "0.57917124", "0.5783035", "0.5752662", "0.5749643", "0.5741578", "0.57343847", "0.5725031", "0.5625921", "0.56108326", "0.56072634", "0.55861557", "0.5576842...
0.74705106
0
Constructs the trip cost table in HTML.
def _construct_html_table(self, df: Table) -> str: string = attach_tag_tr('\n'.join(map(attach_tag_th, df.columns))) stringified_df = _stringify_table(df) for (i, row_elements) in stringified_df.iterrows(): # Commented out code is a bit sleaker, but restrictive #string +...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _html_repr(self):\n html = '<table id=%s>' % (self._id,)\n\n for row in range(self.rows):\n html += '<tr>'\n for col in range(self.columns):\n if row == 0 and self.header_row or col == 0 and self.header_column:\n tag = 'th'\n else:\n tag = 'td'\n html += '...
[ "0.63961804", "0.6360044", "0.6342615", "0.6300299", "0.61835724", "0.61353797", "0.6106828", "0.6102718", "0.60881144", "0.6032661", "0.60168856", "0.60062957", "0.59895504", "0.5985876", "0.59574854", "0.5854876", "0.5836365", "0.58362114", "0.5819817", "0.5819695", "0.5817...
0.7226235
0
Returns a random subsequence with min_stride <= stride <= max_stride. For example if self.length = 4 and we ask for a length 2
def random_subsequence(seq, length, min_stride=1, max_stride=1): # First pick a stride. if max_stride == min_stride: stride = min_stride else: stride = np.random.randint(min_stride, max_stride+1) # Now pick the starting index. # If the subsequence starts at index i, then its final eleme...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def stride(max_seq_len: int) -> int:\n return max(1, max_seq_len // 2)", "def randslice_from_slicelen(slicelen, listlen):\n maxstart = listlen - slicelen\n start = randrange(maxstart + 1)\n maxstep = (listlen - start) // slicelen if slicelen else 1\n step = randrange(1, maxstep + 1)\n stop = star...
[ "0.63644624", "0.6139399", "0.613584", "0.5613276", "0.55990094", "0.55738974", "0.53581023", "0.528104", "0.5271141", "0.5230009", "0.51729834", "0.5146156", "0.5136879", "0.5118242", "0.51171905", "0.5092657", "0.5085889", "0.5073042", "0.50660276", "0.5060677", "0.50271285...
0.84703076
0
Convert pose matrix (3x5) to extrinsic matrix (4x4) and intrinsic matrix (3x3)
def pose2mat(pose): extrinsic = torch.eye(4) extrinsic[:3, :] = pose[:, :4] inv_extrinsic = torch.inverse(extrinsic) extrinsic = torch.inverse(inv_extrinsic) h, w, focal_length = pose[:, 4] intrinsic = torch.Tensor([[focal_length, 0, w/2], [0, focal_length, h/2], ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_extrinsic_matrix(pose):\n batch_size, _ = pose.shape\n rot = pose[:,:3]\n trans = pose[:,3:]\n\n rot = transforms.euler_angles_to_matrix(rot,convention=\"XYZ\")\n pose = torch.cat((rot,trans.view(batch_size, 3, 1)), -1)\n\n return pose", "def convert_pose_inverse_transform(pose):\n ...
[ "0.7709303", "0.6668533", "0.65944237", "0.6398436", "0.63059324", "0.623071", "0.6211102", "0.5987781", "0.5962132", "0.5851783", "0.5848416", "0.58295065", "0.5819406", "0.58128846", "0.58021677", "0.57836634", "0.577834", "0.57698464", "0.5721328", "0.56720847", "0.5670908...
0.77204895
0
Convert LLFF poses to PyTorch convention (w2c extrinsic and hwf)
def convert_llff(pose): hwf = pose[:3, 4:] ext = torch.eye(4) ext[:3, :4] = pose[:3, :4] mat = torch.inverse(ext) mat = mat[[1, 0, 2]] mat[2] = -mat[2] mat[:, 2] = -mat[:, 2] return torch.cat([mat, hwf], -1)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hwc2chw(hwc):\n return hwc.permute(2, 0, 1)", "def ten2pytrch(img, device):\n img = img[:, 0]\n img = np.transpose(img, [0, 3, 1, 2])\n return torch.from_numpy(img * 2 - 1.0).float().to(device)", "def ion2fluoTF(ion_img):\n # return ion_img.T # --> TF1 HepaJune dataset batches FASTER\n #...
[ "0.56349665", "0.5531615", "0.53208774", "0.5256522", "0.5204366", "0.5147666", "0.51306367", "0.5124411", "0.5063691", "0.50255555", "0.50141674", "0.50049436", "0.49778178", "0.49360064", "0.49336657", "0.4932021", "0.4924278", "0.49239174", "0.490643", "0.48919386", "0.488...
0.67766154
0
This function will be the average number of two number
def avg(a,b): return (a+b)/2
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def average(num1, num2):\n\n return (num1 + num2) / 2", "def avg(x, y):\n return (x + y)/2", "def calc_average(numbers):\n return sum(numbers) // len(numbers) # integer division //", "def average(num):\n return sum(num) / len(num)", "def function2(a, b):\r\n average = (a + b) / 2\r\n ...
[ "0.8418318", "0.7811122", "0.7783761", "0.7645497", "0.75732726", "0.75157326", "0.745791", "0.7359915", "0.7344521", "0.733811", "0.72643787", "0.7234622", "0.7145955", "0.7016618", "0.7013344", "0.7013344", "0.6950325", "0.694554", "0.69021994", "0.6900624", "0.6897809", ...
0.8357015
1
This function will sleep with the given seconds like time.sleeo() function
def sleep(seconds): time.sleep(seconds)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sleep(seconds):\n time.sleep(seconds)", "def sleep(seconds):\n time.sleep(seconds)", "def sleep(seconds):\n\n return Sleep(seconds)", "def sleep(self, seconds=60):\n\t\ttime.sleep(seconds)", "def sleep(secs=1.0):\n time.sleep(secs)", "def sleep(seconds):\n # After load and initializing...
[ "0.87173814", "0.87173814", "0.855774", "0.851168", "0.8476451", "0.83972317", "0.8370519", "0.83245087", "0.82079595", "0.7971977", "0.7915644", "0.79125476", "0.7815177", "0.7800869", "0.77263945", "0.7692386", "0.7616232", "0.75914615", "0.7590653", "0.755387", "0.7545075"...
0.8776526
0
This function open the url that you have given. It works like webbrowser.open() function
def open(url): webbrowser.open(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openurl(url):\n\n # Open the URL\n webbrowser.open(url)", "def open_browser(url):\n import webbrowser\n webbrowser.open_new(url)", "def open_in_browser(self):\n webbrowser.open(self.url)", "def open_web_browser(url: str):\n Popen(web_browser + [url], stdout=DEVNULL, stderr=D...
[ "0.8828804", "0.82199275", "0.7929253", "0.7912972", "0.7912401", "0.7846305", "0.7805577", "0.7797339", "0.77827585", "0.7776309", "0.7747668", "0.77426106", "0.77155745", "0.7627966", "0.7548645", "0.7481226", "0.7478042", "0.74230546", "0.74151677", "0.7352512", "0.7347093...
0.89302963
0
This function will open website in chrome you have to first give the url and second you have to give the chorme path
def open_chrome(url,chrome_path): webbrowser.register('chrome', None,webbrowser.BackgroundBrowser(chrome_path)) webbrowser.get('chrome').open(url)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def open(url):\r\n webbrowser.open(url)", "def open_web_browser(url: str):\n Popen(web_browser + [url], stdout=DEVNULL, stderr=DEVNULL)", "def openurl(url):\n\n # Open the URL\n webbrowser.open(url)", "def open_web_chrome(url: str) -> webdriver.Chrome:\n options = webdriver.ChromeO...
[ "0.755337", "0.75032884", "0.73935777", "0.72128797", "0.7203306", "0.7188917", "0.7165283", "0.7111031", "0.71025693", "0.70683134", "0.69504917", "0.6929916", "0.69271356", "0.68253046", "0.6747373", "0.6713842", "0.66886365", "0.65740305", "0.6566772", "0.6566441", "0.6502...
0.82592404
0
This function search in wikipedia and get the results and return it to you.
def wikipedia_search(result,sentence): result = wikipedia.summary(result,sentences=sentence) return result
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def search_wikipedia(self):\n self.summary.delete('1.0', tk.END)\n possibilities = wk.search(self.search_box.get('1.0',tk.END).replace(\"\\n\",\"\"))\n if len(possibilities) > 0:\n try:\n p = wk.page(possibilities[0])\n except wk.DisambiguationError as e:\n...
[ "0.77310365", "0.7091724", "0.70272636", "0.6992434", "0.6975365", "0.6913822", "0.6904317", "0.6796616", "0.6776492", "0.67097527", "0.66634876", "0.66437", "0.6616708", "0.6604414", "0.6564507", "0.6531213", "0.6503528", "0.6486559", "0.6410704", "0.62905854", "0.62833333",...
0.8031819
0
This function will return you time with hour minutes and seconds
def get_time(): return datetime.datetime.now().strftime("%H")+":"+datetime.datetime.now().strftime("%M")+":"+datetime.datetime.now().strftime("%S")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_time(self) -> int:\n t = str(self.eval(\"pyb.RTC().datetime()\").encode(\"utf-8\"))[1:-1].split(\", \")\n return int(t[4]) * 3600 + int(t[5]) * 60 + int(t[6])", "def time(self):\n return time(\n self.hour, self.minute, self.second, self.microsecond, fold=self.fold\n ...
[ "0.7680055", "0.76020753", "0.7595701", "0.75854754", "0.7543408", "0.75380456", "0.7419206", "0.73431045", "0.729178", "0.727815", "0.7257304", "0.7210385", "0.7210385", "0.719823", "0.71618253", "0.71470666", "0.7124439", "0.7113711", "0.7085312", "0.70805144", "0.7064735",...
0.8169108
0
This function will open the program or the folder that you wanted to be open.
def open_program(path): os.startfile(path)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def openCWD(self):\n dirname = os.getcwd()\n osname = platform.system()\n if osname == \"Linux\":\n os.system(\"xdg-open '%s'\" % dirname)\n elif osname == \"Darwin\":\n os.system(\"open '%s'\" % dirname)\n elif osname == \"Windows\":\n os.startfi...
[ "0.72068995", "0.70919657", "0.6967069", "0.6946971", "0.6899423", "0.6843265", "0.6808778", "0.666347", "0.65498185", "0.6430292", "0.64121896", "0.64088106", "0.63980657", "0.63608533", "0.6354702", "0.626754", "0.62340534", "0.62038815", "0.6194021", "0.61879975", "0.61549...
0.8026183
0
This function will take the input from user and you have to give the text in the function
def inp(text): input(text)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ui_input_text() -> str:\n\ttext = input('enter your text ')\n\treturn text", "def textInput():\r\n\r\n\tprint(\"=\" * 50)\r\n\tprint(\"Masukan pesan: (untuk berhenti tekan enter.)\")\r\n\tprint(\"=\" * 50)\r\n\tpesan = input(\"Pesan: \")\r\n\tsemuaPesan = \"\"\r\n\twhile pesan != \"\":\t\t\t\t\t\t\t# meminta...
[ "0.7424973", "0.70946044", "0.7070194", "0.69922805", "0.6974745", "0.6960084", "0.6858386", "0.67839164", "0.6719371", "0.6709079", "0.6692305", "0.6668583", "0.66536367", "0.66197574", "0.6584318", "0.6564329", "0.6562904", "0.6532994", "0.6490697", "0.6485421", "0.64794564...
0.78338397
0
make single topping pizza
def make_pizza(topping='bacon'): print("Have a " + topping + " pizza!")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def make_pizza(topping='bacon'):\r\n print(\"Have a \" + topping + \" pizza!\")", "def make_pizza(size, *toppings):\n\tprint(\"\\nMaking a \" + str(size) +\n\t\"-inch pizza with the following toppings:\")\n\tfor topping in toppings:\n\t\tprint(\"- \" + topping)", "def make_pizza(*toppings):\n print(\"\\n...
[ "0.79380697", "0.745622", "0.7358865", "0.7351002", "0.7336948", "0.7320447", "0.7318649", "0.72897875", "0.72634655", "0.7253257", "0.72473913", "0.7154924", "0.7154924", "0.7089574", "0.70639455", "0.6832723", "0.6507858", "0.61264634", "0.6122003", "0.60687846", "0.603866"...
0.78850144
1
Convert wx.Image to PIL Image.
def wxImage_to_pilImage(image): pil = Image.new('RGB', (image.GetWidth(), image.GetHeight())) pil.fromstring(image.GetData()) return pil
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def PIL2wx(self, image):\n width, height = image.size\n return wx.BitmapFromBuffer(width, height, image.tobytes())", "def imagetopil(wxImage):\n\twxImage = wxImage.Mirror(False)\n\tw = wxImage.GetWidth()\n\th = wxImage.GetHeight()\n\tdata = wxImage.GetData()\n\t\n\tred_image = Image.frombuffer('L...
[ "0.80472296", "0.7496198", "0.7279798", "0.6829054", "0.6346673", "0.6210156", "0.6202476", "0.60905355", "0.5994393", "0.5854683", "0.5838712", "0.57152736", "0.5663321", "0.5625303", "0.5599354", "0.54571974", "0.54107183", "0.5389415", "0.53619236", "0.5330772", "0.5307451...
0.83824795
0
Returns segmented data based on the provided input window duration and overlap.
def buffer(data, duration, data_overlap): # 向上取整(分段数),data_overlap代表相邻时间窗之间的重叠部分 number_segments = int(math.ceil((len(data) - data_overlap) / (duration - data_overlap))) # 按时间窗获取数据(一时间窗为宽度的数据段组) temp_buf = [data[i:i + duration] for i in range(0, len(data), (duration - int(data_overlap)))] # 补全最后一个数据...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def segment_sliding_window(data, winSizeMillisecond=1000, stepSizeMillisecond=100):\r\n\r\n logger.info(\"Sliding window with win size %.2f second and step size %.2f second\",\r\n winSizeMillisecond, stepSizeMillisecond)\r\n\r\n if stepSizeMillisecond <= 0:\r\n raise ValueError(\"Step s...
[ "0.62581116", "0.60675776", "0.5974003", "0.5925953", "0.5837348", "0.5685165", "0.56777185", "0.5673219", "0.56731766", "0.5660051", "0.5620347", "0.5604754", "0.5564672", "0.5513508", "0.55038977", "0.54756296", "0.545424", "0.54100823", "0.54080236", "0.54076374", "0.53557...
0.6827547
0
Plot the codon usage for origin and target host as bar graph
def plot_codon_usage(sequence, ax): x1 = x2 = numpy.arange(len(sequence.codons)) bar_width = 0.5 xlabels = [] origin_f = [] target_f = [] # extract data to plot from sequence object for c in sequence.codons: origin_f.append(c['origin_f']) target_f.append(c['target_f']) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_codon_usage_differences(sequence, ax):\n\n # Generate a range of residues out of the length of the sequence array\n x1 = numpy.arange(len(sequence.codons))\n\n # Set the threshold according to use_frequency\n if sequence.use_frequency:\n threshold = 5\n else:\n threshold = 0.2...
[ "0.59526324", "0.56633836", "0.5536172", "0.54966503", "0.54099727", "0.5348775", "0.53453374", "0.5331417", "0.53305227", "0.5322419", "0.5215668", "0.5192497", "0.5161066", "0.5159176", "0.51475126", "0.50609684", "0.5043205", "0.50220776", "0.50217927", "0.5010438", "0.499...
0.64806
0
Plot the difference in codon usage for origin and target host as bar graph
def plot_codon_usage_differences(sequence, ax): # Generate a range of residues out of the length of the sequence array x1 = numpy.arange(len(sequence.codons)) # Set the threshold according to use_frequency if sequence.use_frequency: threshold = 5 else: threshold = 0.2 # Set wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_codon_usage(sequence, ax):\n\n x1 = x2 = numpy.arange(len(sequence.codons))\n bar_width = 0.5\n xlabels = []\n\n origin_f = []\n target_f = []\n\n # extract data to plot from sequence object\n for c in sequence.codons:\n origin_f.append(c['origin_f'])\n target_f.append(c...
[ "0.62887037", "0.5496365", "0.5490279", "0.53604263", "0.53537625", "0.53279024", "0.5319669", "0.52627635", "0.5234421", "0.5231703", "0.52033126", "0.51960784", "0.5184867", "0.51845306", "0.5137545", "0.51207215", "0.51071644", "0.50821704", "0.508145", "0.50656694", "0.50...
0.6280813
1
Seek the url if it is in current html. Parameter event contains the url name, which is needed by searching process.
def OnURL(self, event): key = event.GetString() if key in self.dictContent: # In order to keep found header showing at top # here first seek to the end of file then seek # back to the header self.rc.ShowPosition(self.rc.GetLastPosition()) self.rc.ShowPosition(self.dictContent.get(key))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def onAboutLeoUrl(self,event=None):\n \n try:\n import webbrowser\n webbrowser.open(self.url)\n except:\n g.es(\"not found: \" + self.url)", "def find(self):\n if self.start >= SMAX:\n return 4\n link = \"http://www.google.com/search?q={}...
[ "0.6237614", "0.5492948", "0.5395715", "0.53565854", "0.52943885", "0.52869225", "0.5231136", "0.51490635", "0.51124656", "0.5100662", "0.5064036", "0.5031638", "0.49945197", "0.49419305", "0.4894042", "0.48920864", "0.48709255", "0.48695666", "0.48347792", "0.48062542", "0.4...
0.62454474
0
Get the time index for the solar rep profiles. Returns
def solar_time_index(self): if self._solar_time_index is None: with Resource(self.solar_fpath) as res: self._solar_time_index = res.time_index return self._solar_time_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solar_time_index(self):\n return self.data.solar_time_index", "def time(self):\r\n return self._idx", "def indexTime(self):\n productSet = self.productSearch.productClient.get_product_set(name=self.productSetPath)\n return productSet.index_time", "def wind_time_index(s...
[ "0.6434821", "0.63582164", "0.62169", "0.61836916", "0.6114667", "0.60695803", "0.6010951", "0.59389555", "0.5810855", "0.5503306", "0.54938483", "0.544385", "0.54156595", "0.54156595", "0.54156595", "0.5408591", "0.5389596", "0.53735733", "0.5326841", "0.5314179", "0.5289777...
0.66143996
0
Get the time index for the wind rep profiles. Returns
def wind_time_index(self): if self._wind_time_index is None: with Resource(self.wind_fpath) as res: self._wind_time_index = res.time_index return self._wind_time_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wind_time_index(self):\n return self.data.wind_time_index", "def hybrid_time_index(self):\n return self.data.hybrid_time_index", "def indexTime(self):\n productSet = self.productSearch.productClient.get_product_set(name=self.productSetPath)\n return productSet.index_time...
[ "0.750108", "0.6274892", "0.6067236", "0.60488135", "0.58945256", "0.5861786", "0.5692657", "0.56620944", "0.56561905", "0.5584628", "0.5508893", "0.5506087", "0.5483317", "0.5458174", "0.5444298", "0.5432435", "0.5420482", "0.5420482", "0.5420482", "0.53780603", "0.53637135"...
0.75930065
0
Get the time index for the hybrid rep profiles. Returns
def hybrid_time_index(self): if self._hybrid_time_index is None: self._hybrid_time_index = self.solar_time_index.join( self.wind_time_index, how='inner') return self._hybrid_time_index
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hybrid_time_index(self):\n return self.data.hybrid_time_index", "def time(self):\r\n return self._idx", "def wind_time_index(self):\n if self._wind_time_index is None:\n with Resource(self.wind_fpath) as res:\n self._wind_time_index = res.time_index\n r...
[ "0.77869314", "0.6246", "0.61711866", "0.61612797", "0.5997803", "0.5992001", "0.56073785", "0.549465", "0.54934114", "0.5488609", "0.54821527", "0.5418426", "0.54089856", "0.53670627", "0.53374773", "0.53118694", "0.5293321", "0.52694017", "0.5246142", "0.52439564", "0.52409...
0.6632212
1
Validate the input data. This method checks for a minimum time index length, a unique profile, and unique merge column that overlaps between both data sets.
def validate(self): self._validate_time_index() self._validate_num_profiles() self._validate_merge_col_exists() self._validate_unique_merge_col() self._validate_merge_col_overlaps()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _validate_time_index(self):\n if len(self.hybrid_time_index) < 8760:\n msg = (\"The length of the merged time index ({}) is less than \"\n \"8760. Please ensure that the input profiles have a \"\n \"time index that overlaps >= 8760 times.\")\n e ...
[ "0.7122489", "0.6712602", "0.6221317", "0.61836725", "0.6058904", "0.6058277", "0.6003456", "0.59980893", "0.5986703", "0.5963275", "0.5939964", "0.59130484", "0.59085566", "0.58986014", "0.5895709", "0.58932143", "0.58587056", "0.5850765", "0.5845587", "0.5835557", "0.581444...
0.74967545
0
Validate the hybrid time index to be of len >= 8760. Raises FileInputError If len(time_index) < 8760 for the hybrid profile.
def _validate_time_index(self): if len(self.hybrid_time_index) < 8760: msg = ("The length of the merged time index ({}) is less than " "8760. Please ensure that the input profiles have a " "time index that overlaps >= 8760 times.") e = msg.format(len...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_ls_input_out_of_range(self):\n index = self.module.user_lookup_table_maker(b\"S|0090|5110|38399|LS\")\n waveform = helper_funcs.convert_c_array_to_list(self.module.waveform_lut,\n 0, index)\n print(f\"waveform: {waveform}\")\n ...
[ "0.55645454", "0.53349376", "0.52908105", "0.514851", "0.51223826", "0.50943077", "0.5067797", "0.50587714", "0.5051093", "0.5015825", "0.49757153", "0.49068865", "0.490585", "0.48379636", "0.48256257", "0.48134157", "0.48115572", "0.4785365", "0.47791785", "0.4764935", "0.47...
0.88489604
0
Validate the number of input profiles. Raises FileInputError If of rep_profiles > 1.
def _validate_num_profiles(self): for fp in [self.solar_fpath, self.wind_fpath]: with Resource(fp) as res: profile_dset_names = [ n for n in res.dsets if self.__profile_reg_check.match(n) ] if not profile_dset_na...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_profile_choice(dims):\n\n if dims[0] > 1:\n profile_choice = int(input(\"Multiple profiles detected.\\nplease choose which profile to use.\\n\"))\n while profile_choice not in range(dims[0]):\n profile_choice = int(input(\"Incorrect selection.\\nplease choose {}.\\n\".forma...
[ "0.6371001", "0.5636708", "0.55839366", "0.5231137", "0.5228164", "0.5183296", "0.5113362", "0.50915724", "0.5083193", "0.50764734", "0.5039972", "0.5026822", "0.5020216", "0.5010537", "0.5001979", "0.4990834", "0.4983467", "0.49700758", "0.49594003", "0.49520007", "0.4922239...
0.75596184
0