query
stringlengths
9
3.4k
document
stringlengths
9
87.4k
metadata
dict
negatives
listlengths
4
101
negative_scores
listlengths
4
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Show embedding space along indicated axis
def show_embedding(lT_log, axis, labels, save_path = None): dim = len(axis) assert(dim == 2 or dim == 3), "Only data in 2 or 3 dimension space can be visualized." if dim == 2: fig = plt.figure(figsize = (6, 6)) plt.scatter(lT_log[:, axis[0]], lT_log[:, axis[1]], c = 'b', s = 5) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def embedding_plot(model,datapath,img_size=100,stride=10,sample_size=1,nrand=None,adjust=True,show_images=True):\n data = set_creation(datapath,img_size,stride,sample_size,nrand=nrand,adjust=adjust)\n model.eval()\n z = model(data[:nrand].float())[-1]\n z = z.data.cpu().numpy()\n plt.style.use('seab...
[ "0.6425836", "0.63833433", "0.62624204", "0.6229844", "0.59683007", "0.59402996", "0.59251606", "0.5922352", "0.59185165", "0.58601743", "0.58289194", "0.5825275", "0.58004504", "0.57833993", "0.57783335", "0.5713599", "0.57017976", "0.5687421", "0.56848377", "0.5648106", "0....
0.611317
4
Show a point cloud in 2d
def show_pair_points(points, pairs, title, save_path = None): fig = plt.figure(figsize = (6, 6)) plt.title(title) plt.scatter(points[:, 0], points[:, 1], c = 'b', s = 5, label = "point cloud") for pair in pairs: print(pair) point_1 = points[pair[0]] point_2 = points[pair[1]] ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_point_cloud(points, colors=None, normals=None,\n show_frame=False, frame_size=1.0, frame_origin=(0, 0, 0)):\n pc = np2pcd(points, colors, normals)\n geometries = [pc]\n if show_frame:\n coord_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=frame...
[ "0.72636724", "0.72375584", "0.71609396", "0.7132317", "0.6933942", "0.6919783", "0.6877211", "0.68398106", "0.65854543", "0.6562634", "0.65615726", "0.6518098", "0.64886963", "0.64688116", "0.64599943", "0.64297676", "0.64172477", "0.6347307", "0.6338426", "0.6316377", "0.62...
0.6120385
28
Show a point cloud in 2d
def show_symmetry(points, nb_1, nb_2, title, save_path = None): fig = plt.figure(figsize = (6, 6)) plt.title(title) plt.scatter(points[:, 0], points[:, 1], c = 'b', s = 5, label = "point cloud") plt.scatter(nb_1[:, 0], nb_1[:, 1], c = 'r', s = 5, label = "symmetry_1") plt.scatter(nb_2[:, 0], nb_2[:...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_point_cloud(points, colors=None, normals=None,\n show_frame=False, frame_size=1.0, frame_origin=(0, 0, 0)):\n pc = np2pcd(points, colors, normals)\n geometries = [pc]\n if show_frame:\n coord_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=frame...
[ "0.72636724", "0.72375584", "0.71609396", "0.7132317", "0.6933942", "0.6919783", "0.6877211", "0.68398106", "0.65854543", "0.6562634", "0.65615726", "0.6518098", "0.64886963", "0.64688116", "0.64599943", "0.64297676", "0.64172477", "0.6347307", "0.6338426", "0.6316377", "0.62...
0.0
-1
Show a point cloud in 2d
def show_orbits(points, nb_pairs, title, save_path = None): fig = plt.figure(figsize = (6, 6)) plt.title(title) plt.scatter(points[:, 0], points[:, 1], c = 'b', s = 5, label = "point cloud") for i in range(len(nb_pairs)): plt.scatter(nb_pairs[i][0][:, 0], nb_pairs[i][0][:, 1], s = 5, label = "%...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def visualize_point_cloud(points, colors=None, normals=None,\n show_frame=False, frame_size=1.0, frame_origin=(0, 0, 0)):\n pc = np2pcd(points, colors, normals)\n geometries = [pc]\n if show_frame:\n coord_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=frame...
[ "0.72636724", "0.72375584", "0.71609396", "0.7132317", "0.6933942", "0.6919783", "0.6877211", "0.68398106", "0.65854543", "0.6562634", "0.65615726", "0.6518098", "0.64886963", "0.64688116", "0.64599943", "0.64297676", "0.64172477", "0.6347307", "0.6338426", "0.6316377", "0.62...
0.57572305
58
StandardizedTierTier a model defined in Swagger
def __init__(self, value=None, calculated_at=None, explanation=None): # noqa: E501 # noqa: E501 self._value = None self._calculated_at = None self._explanation = None self.discriminator = None self.value = value if calculated_at is not None: self.calculated_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self) -> Optional[pulumi.Input['InstanceTier']]:\n return pulumi.get(self, \"tier\")", "def tier(self):\n\n if not hasattr(self, \"_tier\"):\n self._tier = self.opts.get(\"tier\")\n return self._tier", "def tier(self) -> str:\n return pulumi.get(self, \"tier\")",...
[ "0.6445188", "0.64363265", "0.6409928", "0.6409928", "0.6409928", "0.6311461", "0.62864465", "0.62864465", "0.62864465", "0.62864465", "0.62321186", "0.6222428", "0.6162602", "0.6059804", "0.6050189", "0.6026945", "0.6004567", "0.60025877", "0.5947694", "0.59205824", "0.58603...
0.0
-1
Sets the value of this StandardizedTierTier.
def value(self, value): if value is None: raise ValueError("Invalid value for `value`, must not be `None`") # noqa: E501 self._value = value
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self, tier):\n\n self._tier = tier", "def set_tier(self, tier):\n self.single_selection_from_static_kendo_dropdown(self.tier_kendo_dropdown_locator, tier)", "def tier_number(self, tier_number):\n\n self._tier_number = tier_number", "def tier(self):\n\n if not hasattr(self...
[ "0.7639537", "0.73581266", "0.6899906", "0.66168433", "0.65216136", "0.64917374", "0.646807", "0.64081466", "0.62762964", "0.6239686", "0.6239686", "0.6239686", "0.61774784", "0.6152759", "0.6099056", "0.60591483", "0.6048403", "0.6048403", "0.6048403", "0.6048403", "0.597409...
0.0
-1
Sets the calculated_at of this StandardizedTierTier.
def calculated_at(self, calculated_at): self._calculated_at = calculated_at
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier(self, tier):\n\n self._tier = tier", "def scheduled_at(self, scheduled_at):\n\n self._scheduled_at = scheduled_at", "def set_tier(self, tier):\n self.single_selection_from_static_kendo_dropdown(self.tier_kendo_dropdown_locator, tier)", "def created_at(self, created_at):\n\n ...
[ "0.58256483", "0.5355169", "0.5262881", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", "0.51667094", ...
0.7393106
0
Sets the explanation of this StandardizedTierTier.
def explanation(self, explanation): self._explanation = explanation
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def tier_explanation(self, tier_explanation):\n\n self._tier_explanation = tier_explanation", "def tier(self, tier):\n\n self._tier = tier", "def set_description(self, descr):\n self._current_test_descr = descr", "def description(self, value):\n self.definition.description = value...
[ "0.79957366", "0.5871474", "0.5464915", "0.54482603", "0.5392081", "0.53604364", "0.52467775", "0.52365154", "0.5220184", "0.5220184", "0.5220184", "0.5220184", "0.52154154", "0.5203799", "0.51837766", "0.5157714", "0.51374966", "0.5122163", "0.5120805", "0.51175475", "0.5111...
0.6389624
1
Returns the model properties as a dict
def to_dict(self): result = {} for attr, _ in six.iteritems(self.swagger_types): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map( lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_dict(self):\n return self.properties", "def to_dict(self):\n return self.properties", "def get_properties(self):\n return self.properties", "def asdict(self):\n return self._prop_dict", "def json(self):\n rv = {\n prop: getattr(self, prop)\n f...
[ "0.7751993", "0.7751993", "0.73391134", "0.7334895", "0.7297356", "0.727818", "0.7159078", "0.71578115", "0.71494967", "0.71494967", "0.71283495", "0.71275014", "0.7122587", "0.71079814", "0.7060394", "0.7043251", "0.7034103", "0.70233124", "0.69635814", "0.69586295", "0.6900...
0.0
-1
Returns the string representation of the model
def to_str(self): return pprint.pformat(self.to_dict())
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __str__(self):\n return super().__str__() + self.model.__str__()", "def __str__(self) -> str:\n # noinspection PyUnresolvedReferences\n opts = self._meta\n if self.name_field:\n result = str(opts.get_field(self.name_field).value_from_object(self))\n else:\n ...
[ "0.85856134", "0.7814518", "0.77898884", "0.7751367", "0.7751367", "0.7712228", "0.76981676", "0.76700574", "0.7651133", "0.7597206", "0.75800353", "0.7568254", "0.7538184", "0.75228703", "0.7515832", "0.7498764", "0.74850684", "0.74850684", "0.7467648", "0.74488163", "0.7442...
0.0
-1
For `print` and `pprint`
def __repr__(self): return self.to_str()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pprint(*args, **kwargs):\n if PRINTING:\n print(*args, **kwargs)", "def print_out():\n pass", "def custom_print(*objects):\n print(*objects, sep=OFS, end=ORS)", "def _print(self, *args):\n return _ida_hexrays.vd_printer_t__print(self, *args)", "def _printable(self):\n ...
[ "0.75577617", "0.73375154", "0.6986672", "0.698475", "0.6944995", "0.692333", "0.6899106", "0.6898902", "0.68146646", "0.6806209", "0.6753795", "0.67497987", "0.6744008", "0.6700308", "0.6691256", "0.6674591", "0.6658083", "0.66091245", "0.6606931", "0.6601862", "0.6563738", ...
0.0
-1
Returns true if both objects are equal
def __eq__(self, other): if not isinstance(other, StandardizedTierTier): return False return self.__dict__ == other.__dict__
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self, other):\n return are_equal(self, other)", "def __eq__(self,other):\n try: return self.object==other.object and isinstance(self,type(other))\n except: return False", "def __eq__(self, other):\n if i...
[ "0.8088132", "0.8088132", "0.8054589", "0.7982687", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", "0.79670393", ...
0.0
-1
Returns true if both objects are not equal
def __ne__(self, other): return not self == other
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __ne__(self, other: object) -> bool:\n if self.__eq__(other):\n return False\n return True", "def __ne__(self, other: object) -> bool:\n return not self.__eq__(other)", "def __ne__(self, other) -> bool:\n return not self.__eq__(other)", "def __eq__(self, other):\n ...
[ "0.845611", "0.8391477", "0.8144138", "0.81410587", "0.8132492", "0.8093973", "0.80920255", "0.80920255", "0.80920255", "0.8085325", "0.8085325", "0.8076365", "0.8076365", "0.8065748" ]
0.0
-1
This funtion return one list whits the path of ISOs in the folder path insired in parameter
def GetFolderISOFiles(Path): ISOFiles = [] for file in os.listdir(Path): if file[-3:] == 'iso' or file[-3:] == 'ISO': ISOFiles.append(Path + '/' +file) print(ISOFiles) return ISOFiles
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def list_dir(self, path):", "def scandir(path_):\n return os.listdir", "def get_paths(input_folder):\n list_files = []\n conll_folder = glob.glob(input_folder + '/*.json')\n \n for filename in conll_folder:\n list_files.append(filename)\n\n return list_files", "def listdir(self, path):...
[ "0.73667353", "0.6840524", "0.6687913", "0.6571327", "0.65693957", "0.65582794", "0.6470085", "0.64291453", "0.6407391", "0.6406979", "0.6390135", "0.6389266", "0.63871384", "0.6367787", "0.6366471", "0.6361143", "0.6350033", "0.63489014", "0.63378185", "0.6336536", "0.630323...
0.6264688
25
This funtion return integer the number of files in ISO
def NumberOfFilesInISO(XISOPath, XSystemUpdateFolder): command='./extract-xiso -l ' if XSystemUpdateFolder == True: command = command + '-s ' command = command + '"' + XISOPath + '"' print(command) commandOut = commands.getstatusoutput(command) commandOut = commandOut[1].split('\n') ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_file(self):\n self.assert_is_dir_and_exists()\n n = 0\n for _ in self.select_file(recursive=True):\n n += 1\n return n", "def getFileCount(self) -> int:\n ...", "def n_subfile(self):\n self.assert_is_dir_and_exists()\n n = 0\n for _ in se...
[ "0.7400887", "0.7315209", "0.72290283", "0.7170745", "0.701988", "0.7000022", "0.688257", "0.68750906", "0.681171", "0.6706613", "0.66990584", "0.66621566", "0.6575327", "0.6553808", "0.65233034", "0.6516356", "0.6504051", "0.64615285", "0.6457432", "0.64490885", "0.64460576"...
0.76097965
0
This funtion extract the files in ISO
def ExtractFilesInISO(XISOPath, ExtractPath, XSystemUpdateFolder): command=['./extract-xiso', '-x'] if XSystemUpdateFolder == True: command.append('-s') command.append(XISOPath) command.append('-d') command.append(ExtractPath) print(command) sp = subprocess global extract_popen ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def GetFolderISOFiles(Path):\n ISOFiles = []\n for file in os.listdir(Path):\n if file[-3:] == 'iso' or file[-3:] == 'ISO':\n ISOFiles.append(Path + '/' +file)\n print(ISOFiles)\n return ISOFiles", "def extract_files(self) -> list:\n pass", "def extract_file(path):", "def...
[ "0.6875039", "0.6585387", "0.639804", "0.6164385", "0.615887", "0.60463774", "0.60278195", "0.5982999", "0.5965153", "0.58846104", "0.5834605", "0.5832406", "0.5804196", "0.57813597", "0.56719345", "0.5636692", "0.56353647", "0.5620858", "0.5593477", "0.5582736", "0.5560074",...
0.6522118
2
x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature
def __init__(self,*args): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, *args, **kwargs): # real signature unknown; restored from __doc__\n pass", "def __init__(self, *args, **kwargs): # real signature unknown\n pass", "def __init__(self, *args, **kwargs): # real signature unknown\n pass", "def __init__(self, *args, **kwargs): # real signa...
[ "0.72748435", "0.72478586", "0.72478586", "0.72478586", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322", "0.7114322",...
0.0
-1
Reads a dataset from a URL.
def url(self, path=None, type_of="csv"): if "https://" in str(path) or "http://" in str(path) or "file://" in str(path): return self.data_loader(str(path), type_of) else: print("Unknown sample data identifier. Please choose an id from the list below")
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_dataset(dataset_name):\n url = METADATA[dataset_name][\"url\"]\n f = urlopen(url)\n data = _read_rows(f)\n f.close()\n return data", "def fetch_dataset(url, pandas_impl=pandas):\n\n print(f'fetching dataset at {url}')\n return pandas_impl.read_csv(url)", "def download_dataset(url=...
[ "0.7019222", "0.68966436", "0.64686316", "0.6397562", "0.6298438", "0.6295649", "0.62236893", "0.620894", "0.61802775", "0.6161452", "0.61373895", "0.61128914", "0.6091466", "0.6078371", "0.60036445", "0.5996286", "0.59936446", "0.5965552", "0.5925381", "0.5887669", "0.588329...
0.56938386
34
Load data in from a url
def data_loader(self, url, type_of): data_loader = None if type_of == "csv": data_loader = self.csv elif type_of == "json": data_loader = self.json elif type_of == "parquet": data_loader = self.parquet elif type_of == "avro": data_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load(self, url):\n pass", "def load(self, url):\n pass", "def loadu(self, url, **kwargs):\n return self.load(self.open(url, **kwargs), **kwargs)", "def load_data(url: str):\n\n page = requests.get(url=url)\n soup = BeautifulSoup(page.content, 'html.parser')\n return soup", ...
[ "0.7975374", "0.7975374", "0.71954376", "0.7168951", "0.7048649", "0.67794764", "0.67726195", "0.67448", "0.66270715", "0.65927124", "0.65730786", "0.656582", "0.65383065", "0.6533763", "0.6517917", "0.6501635", "0.645566", "0.6428035", "0.6413853", "0.6394601", "0.63764846",...
0.66978467
8
Return a dataframe from a json file.
def json(path): try: # TODO: Check a better way to handle this Spark.instance.spark. Very verbose. df = Spark.instance.spark.read.json(path) except IOError as error: logging.error(error) raise return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_file(filename):\n with open(filename, 'rt') as f:\n d = json.load(f)\n return pd.DataFrame.from_records(d['dataset'])", "def load_data(filepath):\n \n return pd.read_json(filepath)", "def load_data(self, filepath: str) -> pd.DataFrame:\n \n with open(filepath) as f:\n ...
[ "0.819254", "0.7823375", "0.78119093", "0.77657497", "0.75791085", "0.75206435", "0.7203945", "0.7167869", "0.71065944", "0.7062188", "0.6910279", "0.6895788", "0.6882497", "0.68209225", "0.67718965", "0.67359996", "0.6689824", "0.666205", "0.6643767", "0.66075075", "0.659852...
0.7011017
10
Return a dataframe from a csv file.. It is the same read.csv Spark funciont with some predefined params
def csv(path, sep=',', header='true', infer_schema='true', *args, **kwargs): try: df = (Spark.instance.spark.read .options(header=header) .options(mode="DROPMALFORMED") .options(delimiter=sep) .options(inferSchema=infer_schema) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _parse_csv(csv_file: str) -> pd.DataFrame:\n return pd.read_csv(csv_file, header=0)", "def creat_data_frame(spark, file_path):\n df = spark.read \\\n .format(\"csv\") \\\n .option(\"header\", \"true\") \\\n .option(\"inferSchema\", \"true\")\\\n .option(\"samplingRatio\"...
[ "0.76742333", "0.7583322", "0.7549034", "0.74641407", "0.7448721", "0.7291787", "0.7285959", "0.724744", "0.7237754", "0.72303444", "0.7169547", "0.7167265", "0.71414346", "0.7114549", "0.7114549", "0.7114549", "0.70971113", "0.7084145", "0.7058288", "0.7057585", "0.70570195"...
0.7121996
13
Return a dataframe from a parquet file.
def parquet(path, *args, **kwargs): try: df = Spark.instance.spark.read.parquet(path, *args, **kwargs) except IOError as error: logging.error(error) raise return df
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _pq2df(data_file):\n df = pd.read_parquet(data_file)\n return df", "def read_parquet(self, filename):\n if filename is None:\n raise ValueError(\"File name is None\")\n self.logger.info(\"# Reading a Parquet file \" + filename)\n sqlContext = SQLContext(self.spar...
[ "0.8080801", "0.7680819", "0.75473124", "0.71808255", "0.70952356", "0.66877913", "0.65009177", "0.64348716", "0.642109", "0.64079404", "0.63399845", "0.63359207", "0.62860304", "0.624169", "0.6233218", "0.62246", "0.6219255", "0.61767995", "0.61527157", "0.6148135", "0.61377...
0.7916956
1
Load the data from the http request and save it to disk
def write(response, file, chunk_size=8192): total_size = response.headers['Content-Length'].strip() if 'Content-Length' in response.headers else 100 total_size = int(total_size) bytes_so_far = 0 while 1: chunk = response.read(chunk_size) bytes_so_far += len(chunk...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_data(self):\n # Command to get the download data\n pass", "def fetch_save(url):\n\n name = url.split(\"/\")[-1]\n response = requests.get(url, stream=True)\n if response.status_code == 200:\n with open(f\"{DATA_PATH}/{name}\", \"wb\") as f:\n f.write(response.raw...
[ "0.6473304", "0.6228162", "0.6082731", "0.60531247", "0.60495657", "0.58681047", "0.58047765", "0.5790845", "0.57289547", "0.57250524", "0.56729966", "0.56631887", "0.5648555", "0.55728006", "0.5553491", "0.5541447", "0.5524647", "0.5520609", "0.5501267", "0.5475646", "0.5462...
0.0
-1
Preprocess takes an input text line an applies the same preprocessing used in AraBERT pretraining
def preprocess(self, text): if self.model_name == "bert-base-arabert": return self._old_preprocess( text, do_farasa_tokenization=True, ) if self.model_name == "bert-base-arabertv01": return self._old_preprocess(text, do_farasa_tokeniza...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _preprocess(self):\n self.data['sentences'] = self.data['text'].apply(self._tokenize_sent)\n self.data['nouns'] = self.data['sentences'].apply(self._get_nouns)\n # self._get_frequent_features()\n # self._compactness_pruning()\n # self._redundancy_pruning()\n # self._ge...
[ "0.702124", "0.69629145", "0.6902451", "0.67785484", "0.6768156", "0.6608686", "0.6521776", "0.64922255", "0.64709795", "0.6442964", "0.64070773", "0.64030266", "0.6400484", "0.6388811", "0.6304131", "0.62909514", "0.62859696", "0.6259122", "0.62560683", "0.6245865", "0.62340...
0.6612534
5
Reformats the text to a classic format where punctuations, brackets, parenthesis are not seperated by whitespaces. The objective is to make the generated text of any model appear natural and not preprocessed.
def unpreprocess(self, text, desegment=True): if self.model_name in SEGMENTED_MODELS and desegment: text = self.desegment(text) # removes the spaces around quotation marks ex: i " ate " an apple --> i "ate" an apple # https://stackoverflow.com/a/53436792/5381220 text = re.s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preprocess(text):\n text = remove_space(text)\n text = clean_special_punctuations(text)\n text = handle_emojis(text)\n text = clean_number(text)\n text = spacing_punctuation(text)\n text = clean_repeat_words(text)\n text = remove_space(text)\n #text = stop(text)# if changing this, then ...
[ "0.75282043", "0.7487975", "0.7090226", "0.7074452", "0.7063821", "0.70452", "0.70105666", "0.6962441", "0.68735754", "0.68567324", "0.6851152", "0.6823446", "0.6807199", "0.68018055", "0.67301124", "0.6724816", "0.6709943", "0.6704058", "0.6702815", "0.6690054", "0.66852236"...
0.6972378
7
Function to evaluate the log prior. This is a piecewise function returning either 0 or inf
def log_prior(self, x_scaled): x = scale_inverse_transform(self.parameters_scaler, x_scaled) ln_prior = {} for key in self.param_names: try: ln_prior[key] = self.priors[key].log_prob(x[:, self.param_names.index(key)]) except TypeError: x = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def log_prior(x):\n logp = (-0.5 * x.pow(2) - torch.tensor(2 * math.pi).sqrt().log()).sum(dim=1)\n return logp", "def _call(self, x):\n if self.prior is None:\n tmp = ((x - 1 - np.log(x)).inner(self.domain.one()))\n else:\n # This is the old line from odl version 0.6.0.\...
[ "0.7649668", "0.73823214", "0.7289497", "0.725724", "0.70369273", "0.70355916", "0.7010997", "0.6862679", "0.6834659", "0.6778597", "0.67636824", "0.67523545", "0.6744715", "0.6699147", "0.66762686", "0.66680676", "0.6666778", "0.66549045", "0.66526407", "0.6646927", "0.66401...
0.6267439
70
Function to evaluate the log prob. This is the GP log mean + log prior.
def log_prob(self, x_scaled): predictions = self.likelihood(x_scaled) # this function transform the gp mean back to "real" space mean_with_negatives = scale_inverse_transform(self.y_scaler, predictions[0]) # this function replaces negative numbers with zero mean = tf.nn.relu(mean...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compute_log_prob(self,params: ndarray) -> float:\n return self.compute_log_prior(params) + self.compute_log_likelihood(params)", "def log_prob(self):", "def _logp(self, trace, **inputs):\n def calc_log(step):\n exp_pred = np.dot(inputs['gwas_gen'],\n st...
[ "0.7727266", "0.77067864", "0.72754896", "0.7169533", "0.71564955", "0.71349055", "0.7094473", "0.70543903", "0.70453304", "0.69967514", "0.69836086", "0.6983456", "0.6933256", "0.69321316", "0.69272345", "0.69110745", "0.6890131", "0.68761575", "0.68632084", "0.68632084", "0...
0.69520956
12
Function to evaluate GP variance with priors
def mult_var_by_prior(self, x_scaled): model_var = self.likelihood(x_scaled)[1] tensor_log_prior = self.log_prior(x_scaled) return tf.reshape(model_var, shape=tensor_log_prior.shape) * tf.math.exp(tensor_log_prior)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def conditional_variance(self, gp):\n raise NotImplementedError", "def _variance(self,gp):\r\n return self.variance", "def _variance(self,gp):\r\n p = self.gp_link.transf(gp)\r\n return p*(1.-p)", "def _variance(self,gp):\r\n return self.gp_link.transf(gp)**2", "def _vari...
[ "0.7001479", "0.69190866", "0.6851098", "0.68463093", "0.6823274", "0.6555642", "0.64821726", "0.64297533", "0.6186828", "0.6145154", "0.6105192", "0.6069326", "0.60412335", "0.59106874", "0.58750397", "0.5839199", "0.58274245", "0.58097214", "0.5796802", "0.5782451", "0.5769...
0.0
-1
Returns GP mean and variance in "scaled" space (same as gpflow model.predict_f with bounds applied)
def predict(self, x_scaled): model_var_with_prior = self.mult_var_by_prior(x_scaled) scaled_space_mean = self.y_scaler.transform(tf.reshape(tf.math.exp(self.log_prob(x_scaled)), [-1, 1])) return scaled_space_mean, tf.reshape(model_var_with_prior, [-1, 1]).numpy()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fit_gp(self, inputs):\n x_context, y_context, x_data = inputs\n kernel = GP.kernels.RBF(length_scale=self._l_scale, length_scale_bounds=(1e-2, 1e3))\n gp = GP.GaussianProcessRegressor(kernel=kernel).fit(x_context[-1, :], y_context[-1, :])\n y_prediction, y_prediction_std = gp.predic...
[ "0.60946023", "0.5923903", "0.5884754", "0.58357656", "0.57872975", "0.56988716", "0.56963426", "0.56526315", "0.56245965", "0.5610475", "0.56104165", "0.55741924", "0.5556511", "0.5541308", "0.55345446", "0.55169386", "0.54802036", "0.54369193", "0.5432692", "0.5422389", "0....
0.62195873
0
Returns multiple GP samples
def predict_samples(self, x_scaled): all_predictions = [] predictions = self.likelihood(x_scaled) #Todo: this loop can easily be vectorised # fix this when plots have been made for i in range(predictions.shape[0]): mean_with_negatives = scale_inverse_transform(self.y_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def samples(self, gp):\r\n raise NotImplementedError", "def samples(self, gp):\r\n orig_shape = gp.shape\r\n gp = gp.flatten()\r\n Ysim = np.random.poisson(self.gp_link.transf(gp))\r\n return Ysim.reshape(orig_shape)", "def samples(self, gp):\r\n orig_shape = gp.shape\...
[ "0.7857813", "0.68662995", "0.6837922", "0.6826287", "0.6791251", "0.66837394", "0.66450995", "0.6641715", "0.65879714", "0.6524494", "0.6492363", "0.6492363", "0.6454193", "0.64254946", "0.6308791", "0.6303437", "0.6291386", "0.6185553", "0.61466175", "0.6123374", "0.6100571...
0.0
-1
Run sampler over marginal posterior surface. This returns the posterior samples.
def sample_density(self, num_results, num_burnin_steps, initialise_chains, sampler): assert initialise_chains.shape[0] > 1, 'number of chains is 1, at least two chains must be used when sampling' p0 = tf.convert_to_tensor(initialise_chains, dtype=float_type) if sampler == 'MCMC': in...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def posterior_sample(self):\n pass", "def sample_posterior(self):\n if(self.Bayesian):\n for i in range(self.num_layers):\n getattr(self, 'LSTMCell%i'%(i+1)).sample_posterior()", "def _sample_posterior(self):\n\n latent_dim = self.network_architecture['latent_dim'...
[ "0.6507249", "0.6463244", "0.6384315", "0.61163783", "0.60296214", "0.6013357", "0.5988046", "0.5971502", "0.5960403", "0.5866206", "0.585658", "0.57961535", "0.57058126", "0.5644703", "0.56423026", "0.55828935", "0.5537393", "0.5511536", "0.55076844", "0.54656184", "0.545747...
0.0
-1
Wrapper around sklearn scaler (inverse) that doesn't involve numpy
def scale_inverse_transform(whatever_scaler, X): x_new = tf.identity(X) try: x_new -= whatever_scaler.min_ x_new /= whatever_scaler.scale_ except AttributeError: x_new *= whatever_scaler.scale_ x_new += whatever_scaler.mean_ return x_new
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def denorm_it(val, scaler):\n # # inverse transform a single value\n newval = scaler.inverse_transform(val.reshape(1, -1))\n return newval", "def invert_scale(scaler, X, value):\n new_row = [x for x in X] + [value]\n array = np.array(new_row)\n array = array.reshape(1, len(array))\n inverted...
[ "0.7345006", "0.7250114", "0.6689134", "0.6689134", "0.6689134", "0.6689134", "0.6689134", "0.661905", "0.65860146", "0.65598065", "0.65575606", "0.6500443", "0.6460542", "0.64214194", "0.6390401", "0.6373423", "0.6335165", "0.63232076", "0.62935996", "0.6272957", "0.6263339"...
0.7202794
2
all outputs have the unit of mW
def power_report( file=None ): for entry in file: elems = entry.strip().split(' ') elems = prune(elems) if len(elems) >= 6: if elems[0] == "Total" and elems[1] == "Dynamic" and elems[2] == "Power" and elems[3] == "=": dynamic = float(elems[4]) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def W(self):\n if not self.isVaild():\n pass\n return self.Wq() + 1.0/self.muy", "def useUnits():", "def uw(self):\n return sm.unitvec(self.w)", "def get_mol_wt(self):\n return self.get_empirical_formula().get_molecular_weight()", "def get_mol_wt(self):\n retur...
[ "0.6041866", "0.59337413", "0.59043", "0.5867506", "0.5867506", "0.58634657", "0.58505666", "0.58334017", "0.58291554", "0.5828685", "0.58197", "0.5807507", "0.58058566", "0.5801746", "0.579691", "0.5763294", "0.5752986", "0.57422733", "0.57375646", "0.57270724", "0.57161635"...
0.0
-1
output has the unit of mm^2
def area_report( file=None ): for entry in file: elems = entry.strip().split(' ') elems = prune(elems) if len(elems) >= 3: if str(elems[0]) == "Total" and str(elems[1]) == "cell" and str(elems[2]) == "area:": area = float(elems[3]) if str(elems[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __convert_to_mm(self, value, in_devunit=True):\r\n if in_devunit:\r\n value /= self.DEVUNIT_RATIO\r\n return value", "def m_to_mm(meters):\n return meters * 1000.0", "def m_to_mm(): \n # Set blender unit in mm\n bpy.context.scene.unit_settings.scale_length = 0.001...
[ "0.68497676", "0.6797037", "0.67805916", "0.67592186", "0.67404824", "0.6646447", "0.6638052", "0.6588755", "0.6511798", "0.6504115", "0.64981365", "0.63728786", "0.6351094", "0.62902117", "0.62816006", "0.62397957", "0.6225386", "0.6223449", "0.6203363", "0.6186232", "0.6138...
0.0
-1
By now we allow all allowed types without constrain.
def getLocallyAllowedTypes(self): portal_types = api.portal.get_tool('portal_types') my_type = portal_types.getTypeInfo(self) result = portal_types.listTypeInfo() return [t for t in result if my_type.allowType(t.getId()) and t.isConstructionAllowed(self)]
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_allows_valid(self):\n if not isinstance(self.allows_, list):\n raise TypeError(\n 'allows type is %s but expected type is list: %s' % (\n type(self.allows_), self.allows_))\n\n for i, allow in enumerate(self.allows_):\n if not isinstance...
[ "0.6289284", "0.62070316", "0.6151418", "0.6090969", "0.6066005", "0.60621774", "0.6060789", "0.6038607", "0.5915495", "0.5901182", "0.5901182", "0.5845438", "0.5804473", "0.57753146", "0.5764553", "0.57635087", "0.5748032", "0.57470876", "0.5707446", "0.56632257", "0.566026"...
0.0
-1
By now we allow all allowed types without constrain.
def getImmediatelyAddableTypes(self, context=None): return self.getLocallyAllowedTypes()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _is_allows_valid(self):\n if not isinstance(self.allows_, list):\n raise TypeError(\n 'allows type is %s but expected type is list: %s' % (\n type(self.allows_), self.allows_))\n\n for i, allow in enumerate(self.allows_):\n if not isinstance...
[ "0.6289284", "0.62070316", "0.6151418", "0.6090969", "0.6066005", "0.60621774", "0.6060789", "0.6038607", "0.5915495", "0.5901182", "0.5901182", "0.5845438", "0.5804473", "0.57753146", "0.5764553", "0.57635087", "0.5748032", "0.57470876", "0.5707446", "0.56632257", "0.566026"...
0.5549926
28
Call PyEz to install new JUNOS image to device
def install_device_software(self, path, image, target_version): package = os.path.join(os.getcwd(), path) if c.SERVICEPLUGIN_OSSH in self.sample_device.deviceServicePlugin: try: Tools.emit_log(task_name=self.task_name, sample_device=self.sample_device, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def install(self):\n PiService.install(self)\n self.sudo('svn co https://svn.code.sf.net/p/mjpg-streamer/code /etc/mjpg-streamer')\n self.run('cd /etc/mjpg-streamer/mjpg-streamer && sudo make USE_LIB4VL=true clean all && sudo make DESTDIR=/usr install')", "def _install():\n download_file='http://www.i...
[ "0.6222078", "0.6078283", "0.59629583", "0.5815941", "0.57550997", "0.5706842", "0.56755555", "0.5663717", "0.56422436", "0.5641112", "0.56124735", "0.55439395", "0.552297", "0.55203617", "0.5495007", "0.5493053", "0.54912466", "0.54787534", "0.54780823", "0.547773", "0.54126...
0.4962376
62
Connect social account to existing account, if existing email found
def pre_social_login(self, request, sociallogin): if sociallogin.is_existing: return email_addresses = sociallogin.email_addresses for email in email_addresses: try: user_email = EmailAddress.objects.get(email__iexact=email.email) except Ema...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _external_login_or_signup(request,\r\n external_id,\r\n external_domain,\r\n credentials,\r\n email,\r\n fullname,\r\n retfun=None):\r\n ...
[ "0.6368004", "0.60966545", "0.6048381", "0.59991693", "0.59486884", "0.5934243", "0.5869946", "0.58662754", "0.5855204", "0.5833579", "0.5811763", "0.57687676", "0.57521755", "0.56753784", "0.5648578", "0.5643133", "0.5633166", "0.56330556", "0.56206214", "0.5619708", "0.5619...
0.7319161
0
Calculates total loss containing cross entropy with padding ignored.
def loss_function(real, pred, loss_object, pad_token_id): mask = tf.math.logical_not(tf.math.equal(real, pad_token_id)) loss_ = loss_object(real, pred) mask = tf.cast(mask, dtype=loss_.dtype) loss_ *= mask return tf.reduce_sum(loss_) / tf.reduce_sum(mask)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_loss(self, train_x, train_y):\n self.log.info(\"Calculating average categorical crossentropy loss...\")\n\n num_words = np.sum([len(y) for y in train_y])\n return self.calculate_total_loss(train_x, train_y)/float(num_words)", "def calculate_loss(self, pred, gold, smoothing=Fals...
[ "0.6906149", "0.67943317", "0.6712057", "0.6665505", "0.6519638", "0.6517783", "0.651644", "0.64891195", "0.6484199", "0.6472904", "0.6467562", "0.6440021", "0.63934696", "0.63933444", "0.63713855", "0.6368063", "0.63627523", "0.6331519", "0.629701", "0.62892914", "0.6222453"...
0.0
-1
Creates a new Database object.
def __init__(self, connect: str): # create engine self._engine = create_engine(connect) self._engine.echo = False event.listen(self._engine, 'checkout', Database._checkout_listener) # and metadata MetaData(self._engine) # and session self._session = ses...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_database(self, instance, **attrs):\n instance = self._get_resource(_instance.Instance, instance)\n return self._create(\n _database.Database, instance_id=instance.id, **attrs\n )", "def _create_db(self):\n self.db = easydms.dbcore.Database(\":memory:\")\n ...
[ "0.81012857", "0.7803342", "0.7645763", "0.76455563", "0.7597918", "0.7513874", "0.7509577", "0.7494454", "0.748972", "0.74859154", "0.7480001", "0.74596536", "0.7434891", "0.7428196", "0.7428196", "0.7428196", "0.7428196", "0.7428196", "0.7428196", "0.7428196", "0.7428196", ...
0.0
-1
Provide a transactional scope around a series of operations.
def __call__(self): session = self._session() try: yield session session.commit() except: session.rollback() raise finally: session.close()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def session_scope():\n session = Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()", "def session_scope():\n session = Session()\n try:\n yield session\n session.commit()\n ...
[ "0.6569059", "0.6569059", "0.6569059", "0.6485288", "0.64705354", "0.6458157", "0.645436", "0.6433442", "0.642318", "0.63953996", "0.63516915", "0.62020296", "0.61909795", "0.61490947", "0.6068438", "0.6058901", "0.6056808", "0.6052401", "0.60080963", "0.59846854", "0.5968762...
0.5221372
61
Save the trained vectorizer for future use.
def pickle_vectorizer(self, path='models/TFIDFVectorizer.pkl'): with open(path, 'wb') as f: pickle.dump(self.vectorizer, f) print("Pickled vectorizer at {}".format(path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save_vectorizer(self, vectorizer_filepath):\n with open(vectorizer_filepath, \"w\") as fp:\n json.dump(self._vectorizer.to_serializable(), fp)", "def save(self, tfidf_vectorizer_path):\n with open(tfidf_vectorizer_path, \"wb\") as fw:\n pickle.dump(self, fw)", "def save_...
[ "0.76096624", "0.73109317", "0.7164249", "0.70169145", "0.66974753", "0.6566269", "0.6522058", "0.64056844", "0.63931715", "0.6316061", "0.6313552", "0.6313552", "0.6276785", "0.62720037", "0.623774", "0.62127876", "0.62069654", "0.6184085", "0.6171327", "0.61685747", "0.6127...
0.7430699
1
Saves the trained classifier for future use.
def pickle_clf(self, path='models/SentimentClassifier.pkl'): with open(path, 'wb') as f: pickle.dump(self.clf, f) print("Pickled classifier at {}".format(path))
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def save(self):\n joblib.dump(\n self.classifier, \"data/models/badlymappedfinder/badlymappedfinder.joblib\",\n )", "def persist_classifier(clf, X_test, y_test, pickle_file):\n joblib.dump((clf, X_test, y_test), pickle_file)", "def save(self):\n\n try:\n joblib.dum...
[ "0.7782483", "0.7746073", "0.77156997", "0.7690395", "0.7592898", "0.7557048", "0.74742705", "0.7266321", "0.703804", "0.7024992", "0.7018162", "0.7015158", "0.69418323", "0.69284034", "0.6915039", "0.6910194", "0.69033444", "0.68918973", "0.6879996", "0.6866403", "0.6863975"...
0.70769143
8
Plot the ROC curve for X_test and y_test.
def plot_roc(self, X, y): plot_roc(self.clf, X, y)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_roc(model, X_test, Y_test, verbose=False):\n\n y_true, y_pred = Y_test, model.predict(X_test)\n if verbose:\n print(\"CLASSIFICATION REPORT\")\n print(classification_report(y_true, y_pred))\n\n y_pred_prob = model.predict_proba(X_test)[:,1]\n\n fpr, tpr, _ = roc_curve(Y_test, y_p...
[ "0.81790066", "0.80277777", "0.7994181", "0.7877366", "0.7686142", "0.7684883", "0.7512397", "0.7383684", "0.73271465", "0.7208472", "0.71124506", "0.70799464", "0.7026591", "0.7016241", "0.70149523", "0.6978569", "0.6914532", "0.69139344", "0.6845855", "0.6833893", "0.683278...
0.75754845
6
Constructor method. Receives the reference to the Blender object. The second parameter should be the name of the object's parent.
def __init__(self, obj, parent=None): logger.info('%s initialization' % obj.name) # Call the constructor of the parent class super(self.__class__,self).__init__(obj, parent) self.local_data['x'] = 0.0 self.local_data['y'] = 0.0 self.local_data['z'] = 0.0 self.loc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, parent):\n self._parent = parent", "def __init__(self, parent):\n pass", "def __init__(self, parent):\n pass", "def __init__(self, parent):\n pass", "def __init__(self, blend_src, blend_dest, program, parent=None):\n super().__init__(parent=parent)\n s...
[ "0.69186753", "0.6701193", "0.6701193", "0.6701193", "0.6657898", "0.6657543", "0.66375124", "0.65814894", "0.6467207", "0.6345175", "0.62218726", "0.6141906", "0.61244076", "0.6069659", "0.6056966", "0.6054012", "0.6052897", "0.6051803", "0.6018489", "0.5998511", "0.5991595"...
0.60681015
14
Get the x, y, z, yaw, pitch and roll of the blender object.
def default_action(self): x = self.position_3d.x y = self.position_3d.y z = self.position_3d.z yaw = self.position_3d.yaw pitch = self.position_3d.pitch roll = self.position_3d.roll # Gather information about all segments of the kuka-arm self._segments = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getAngles(self) -> tuple:\n return self.getHeading(), self.getPitch(), self.getRoll()", "def get_draw_data(self):\n x, y = self._coordinates\n return x, y, self.__heading", "def get_pos_and_orientation(self):\n pos, rot = p.getBasePositionAndOrientation(self.pybullet_id)\n ...
[ "0.63418734", "0.6309489", "0.6254961", "0.6254961", "0.6254961", "0.6217224", "0.60536915", "0.6044034", "0.6017542", "0.6001574", "0.5949086", "0.5943164", "0.58633053", "0.58633053", "0.58574796", "0.58550453", "0.5844058", "0.5816276", "0.58038104", "0.576194", "0.5691996...
0.0
-1
Set up a log pointing at the specified path.
def setup_logging(log_dir: Optional[str] = None) -> None: config: Dict[str, Any] = { "version": 1, "disable_existing_loggers": True, "formatters": {"console": {"format": "%(asctime)s:\t%(message)s"}}, "handlers": { "console": { "level": "WARNING", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setPath(logPath):\n GlobalLogger.logger.close()\n GlobalLogger.logger = FileLogger(logPath)", "def init_log(path):\n file = open(path, 'w+')\n file.close()", "def init_logger():\n logpath = Path(f\"logs/{time.strftime('%Y.%m.%d %H:%M')}.txt\")\n logpath.parent.mkdir(exist_ok=True)...
[ "0.72605616", "0.72503996", "0.7160252", "0.7023683", "0.697959", "0.6869867", "0.6845562", "0.67412263", "0.66890514", "0.66244304", "0.65874594", "0.65680945", "0.6566808", "0.65642315", "0.6563256", "0.655342", "0.65409786", "0.6536974", "0.6524947", "0.6515317", "0.651353...
0.6125873
67
Initializes the object using the list of technology dictionaries that are copied and formatted. Takes an optional parameter for the datetime.date object of the last full BuiltWith scan.
def __init__(self, technologies_list, last_full_builtwith_scan_date=None): self._technologies_by_name = {} for technologies_dict in technologies_list: copied_technologies_dict = copy.deepcopy(technologies_dict) for name in DATETIME_INFORMATION_NAMES: copied_te...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(\n self, datetime,\n provider, asset_license,\n ext_properties\n ):\n self.ext_properties = ext_properties\n self.license = asset_license\n self.provider = provider\n self.datetime = datetime", "def __init__(self, *args):\n this = _libsbml.n...
[ "0.58997256", "0.58272433", "0.57844007", "0.5710227", "0.55624354", "0.55044675", "0.5499629", "0.5475405", "0.541306", "0.5392969", "0.53880745", "0.53873634", "0.5373261", "0.53632164", "0.53545606", "0.5312174", "0.5298981", "0.52789253", "0.52789253", "0.52765673", "0.52...
0.7597779
0
Initialize the client. Requires a BuiltWith API key. Optionally takes in the API version. If no API version is specified, a default of `12` is used.
def __init__(self, key, api_version=12): if api_version not in ENDPOINTS_BY_API_VERSION.keys(): raise UnsupportedApiVersion(VERSION_EXCEPTION_TEMPLATE % api_version) self.key = key self.api_version = api_version
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __init__(self, client_id: str, client_secret: str,\n x_api_key: str, version: str):\n super().__init__(client_id, client_secret, x_api_key, version)", "def __init__(self, app_key=None, app_sid=None, base_url=None,\n api_version=None, debug=False, proxy=None):\n c...
[ "0.7145586", "0.70431364", "0.6840511", "0.6745353", "0.6723974", "0.67110234", "0.66834116", "0.6665458", "0.661136", "0.66090286", "0.6545305", "0.6392615", "0.631137", "0.62908876", "0.62697035", "0.6265824", "0.6171141", "0.61463577", "0.61458045", "0.61331064", "0.611292...
0.68917906
2
Lookup BuiltWith results for the given domain. If API version 2 is used and the get_last_full_query flag enabled, it also queries for the date of the last full BuiltWith scan.
def lookup(self, domain, get_last_full_query=True): data = {} try: last_full_builtwith_scan_date = None if self.api_version == 7 and isinstance(domain, list): domain = ','.join(domain) if self.api_version in [2, 7]: last_updates_r...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _query(self, mapping, from_date=None, to_date=None, max_count=None,\n offset=None, ascendingly=True, describe=False):\n group, key = mapping.data_var.split(self._data_var_separator)\n\n # build params\n params = 'describe={describe}&keys={key}'.format(describe=str(describe).l...
[ "0.5364037", "0.5217802", "0.5124252", "0.5091811", "0.50653636", "0.5045531", "0.50369877", "0.49869594", "0.49551797", "0.48993677", "0.48925823", "0.4868528", "0.48650628", "0.48334965", "0.48261112", "0.4820986", "0.47899625", "0.47878402", "0.4784079", "0.47710827", "0.4...
0.80236036
0
Get link to next higher level. If a course has only on lesson directly linked, skip this single lesson.
def get_parent_link(lesson, course_id): if lesson.is_root_node(): parent_link = "/gui/course/{}/".format(course_id) else: parent = lesson.get_ancestors(ascending=True, include_self=False)[0] root_ids = get_root_lesson_ids(course_id) if lesson.id in root_ids: parent_li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def next_link(self) -> Optional[str]:\n return pulumi.get(self, \"next_link\")", "def next_link(self) -> str:\n return pulumi.get(self, \"next_link\")", "def get_first_lesson(module):\n try:\n return get_all_lessons(module)[0]\n except IndexError:\n return None", "def get_ne...
[ "0.6164992", "0.5971488", "0.5667383", "0.56460345", "0.56393325", "0.558493", "0.55271924", "0.5500582", "0.54652554", "0.54140425", "0.5357131", "0.53281605", "0.52977896", "0.52976936", "0.52245253", "0.5188574", "0.51845276", "0.5183087", "0.5172216", "0.51708794", "0.517...
0.58739734
2
Does this lesson or any of its descendants need feedback? 0 = no feedback required 1 = feedback not yet provided 2 = feedback provided
def needs_feedback(lesson, course_id): descendants = lesson.get_descendants(include_self=True) provided = False for descendant in descendants: if descendant.feedback_required: # If feedback is needed, check if already provided try: # pylint: disable=E1101 ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_ask_if_examiner_want_to_give_another_chance(self):\n if self.assignment.is_electronic:\n return (self.delivery_status == \"corrected\" and not self.feedback.is_passing_grade) \\\n or self.delivery_status == 'closed-without-feedback'\n else:\n return Fal...
[ "0.6186025", "0.61752695", "0.61344266", "0.5998169", "0.59937", "0.5966056", "0.58796865", "0.5829263", "0.58252865", "0.56954336", "0.56225294", "0.555234", "0.55216324", "0.5501553", "0.54851127", "0.5417297", "0.5385953", "0.5377694", "0.5376452", "0.53695625", "0.5365726...
0.7998184
0
Get plain list of root lessons for user. If there is only one root node, its children will be returned directly.
def get_root_lesson_ids(course_id): # pylint: disable=E1101 lesson_id_list = (CourseLesson.objects.filter(course=course_id) .values_list('lesson', flat=True)) if (len(lesson_id_list) == 1 and Lesson.objects .get(id=lesson_id_list[0]) .get_children()): # ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_all_lessons(module) -> list:\n from core.models import DetailPage, TopicPage\n\n return [\n lesson\n for lesson in DetailPage.objects.live().specific().descendant_of(module)\n if isinstance(lesson.get_parent().specific, TopicPage)\n ]", "def get_rootnodes(self) -> List[RootN...
[ "0.58202595", "0.56926495", "0.54621065", "0.5372502", "0.52808326", "0.5260657", "0.5136428", "0.5116993", "0.50672156", "0.503656", "0.5033046", "0.5016807", "0.4999171", "0.49898365", "0.49669686", "0.49460587", "0.49320826", "0.4929504", "0.4919603", "0.48899287", "0.4887...
0.567087
2
Get meta information about a lesson
def get_lesson_meta(lesson_id): # pylint: disable=E1101 lesson_meta_list = (LessonMetaData.objects.filter(lesson=lesson_id) .prefetch_related()) result = [] for item in lesson_meta_list: result.append({ 'description': item.description.description, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def showLesson(self):\n lesson = \"\"\n lesson += self.__title + \"\\n\\n\"\n lesson += self.__description + \"\\n\"\n lesson += self.__lesson_text + \"\\n\"\n lesson += self.getLink()\n return lesson", "def meta(id):\n db = core.connect()\n return db[id][\"meta\"]...
[ "0.6347282", "0.63374656", "0.6238976", "0.6156013", "0.6148112", "0.61196655", "0.6065378", "0.58501846", "0.5849513", "0.58236367", "0.58219254", "0.5817728", "0.5810855", "0.5797458", "0.57406706", "0.5716694", "0.5701135", "0.5665865", "0.564084", "0.56000566", "0.5573098...
0.6979437
0
Get attachments for a lesson
def get_lesson_attachments(lesson_id): # pylint: disable=E1101 lesson_attachments = Attachment.objects.filter(lesson=lesson_id) result = [] for attachment in lesson_attachments: url = attachment.attached_file.url result.append({'title': attachment.title, 'url': url...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_attachments(self, expense_id):\n return self._get_request({}, Expenses.GET_EXPENSE_ATTACHMENTS.format(expense_id))", "def attachments(self):\n return self._attachments", "def attachments(self):\n return self.properties.get('attachments',\n Attachme...
[ "0.6443785", "0.62607515", "0.6257542", "0.61732197", "0.613358", "0.60169816", "0.5984727", "0.5975392", "0.59665823", "0.589185", "0.58910084", "0.582533", "0.5795188", "0.57261866", "0.57246155", "0.56012267", "0.5595344", "0.5585614", "0.55696243", "0.5561719", "0.5546192...
0.7814485
0
Get list of lessons. If lesson_id is provided, then sublessons will be returned.
def get_lessons(course_id, lesson=None): lesson_list = [] if lesson is None: lesson_list = Lesson.objects.filter( id__in=get_root_lesson_ids(course_id)) else: lesson_list = lesson.get_children() result = [] for lesson_item in lesson_list: result.append({ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_lessons(lesson_id):\n url = '{0}?cat={1}'.format(BASE_URL, lesson_id)\n page = requests.get(url, verify=False)\n soup = BeautifulSoup(page.content)\n output = []\n\n for item in soup.find(id='playlist').findAll('dd'):\n video_id = item.find('a')['href'].split('=')[-1]\n title =...
[ "0.7365375", "0.62064546", "0.61165404", "0.6037979", "0.5811342", "0.5567336", "0.53809226", "0.52577466", "0.52528167", "0.5149042", "0.5014981", "0.49820638", "0.4955708", "0.4920301", "0.48846543", "0.48611218", "0.4850564", "0.4735443", "0.4732919", "0.4681646", "0.46596...
0.7905289
0
Get a CSRF token
def get_token(request: http.Request) -> str: if hasattr(request, '_csrf_hook'): return request._csrf_hook.get_token()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_csrf_token(self):\n return get_csrf_token(self.REQUEST)", "def get_csrf(self):\n rv = self.app.get('/')\n soup = BeautifulSoup(rv.data, 'html.parser')\n tag = soup.body.find('input', attrs = { 'name' : '_csrf_token'})\n return tag['value']", "def get_csrf_token():\n\t...
[ "0.82945985", "0.79842544", "0.7978851", "0.7901868", "0.7893529", "0.7813759", "0.7686076", "0.76118195", "0.7603423", "0.7520915", "0.7415232", "0.73648924", "0.73442954", "0.7296101", "0.72825855", "0.72396684", "0.7208785", "0.71859497", "0.71636873", "0.7134267", "0.7123...
0.825222
1
Change the CSRF token in use for a request should be done on login for security purposes.
def rotate_token(request: http.Request): if hasattr(request, '_csrf_hook'): request._csrf_hook.rotate_token()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def retain_csrf_token(req):\n session = req.environ.get('rex.session', {})\n csrf_token = session.get('_csrf_token')\n if not csrf_token:\n csrf_token = session['_csrf_token'] = b2a(os.urandom(16))\n return csrf_token", "def _request_csrf_token(self, params):\n if params.get(\"action\")...
[ "0.6995657", "0.6735495", "0.66707176", "0.66646796", "0.6627224", "0.66243565", "0.6588753", "0.6564125", "0.64893675", "0.64175296", "0.6354996", "0.6351722", "0.6298024", "0.6286042", "0.626467", "0.62383574", "0.62116677", "0.61504555", "0.6089741", "0.6089741", "0.606432...
0.7636964
0
Nothing needed (no learnable weights).
def build(self, input_shape): pass
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def learn(self):\n pass", "def learn(self):\n pass", "def weights(self):\r\n\t\treturn None", "def train(self)->None:", "def _initialize_weights(self):\n pass", "def learn(self):\n raise NotImplementedError()", "def learn(self):\n raise NotImplementedError", "def __...
[ "0.7334947", "0.7334947", "0.714452", "0.708103", "0.7016172", "0.6954542", "0.6946821", "0.69315475", "0.6878738", "0.6826828", "0.6826828", "0.6826828", "0.6826828", "0.6826828", "0.6802039", "0.67840093", "0.6762436", "0.67506826", "0.6693124", "0.6679761", "0.6647613", ...
0.0
-1
Output tensor shape produced by this layer.
def get_output_shape_for(self, input_shape): # Extract nodes and membership atom_features_shape = input_shape[0] # membership_shape = input_shape[2] # assert (len(atom_features_shape) == 2, # "GraphGather only takes 2 dimensional tensors") n_feat = atom_features_...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def output_shape(self) ->torch.Size:\n return self._computed_output_shape()", "def get_output_shape(self):\n return self.shape", "def output_shape(self):\n raise NotImplementedError", "def get_output_shape(self):\n return self.output_shape", "def get_output_shape(self):\n ...
[ "0.86315733", "0.8435825", "0.83928627", "0.8357466", "0.8357466", "0.8357466", "0.8357466", "0.8357466", "0.79433477", "0.7875424", "0.78421944", "0.78421944", "0.78421944", "0.7797612", "0.7794071", "0.7794071", "0.7794071", "0.76682436", "0.76367337", "0.76367337", "0.7632...
0.0
-1
decorator to coerce a generator to a list
def listify(gen: Callable[..., Union[Generator[T, None, None], AsyncGenerator[T, None]]]) -> Callable[..., List[T]]: if inspect.isasyncgenfunction(gen): @wraps(gen) async def list_func(*args, **kwargs) -> List[Any]: return [v async for v in gen(*args, **kwargs)] elif inspect.isgene...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def as_list(gen):\n return list(gen())", "def to_list():\n\n @sinks\n def _dagpype_internal_fn_act(target):\n l = []\n try:\n while True:\n l.append((yield))\n except GeneratorExit:\n target.send(l) \n target.close()\n\n return _...
[ "0.7745299", "0.69110525", "0.6902051", "0.6683275", "0.6664674", "0.65476835", "0.639381", "0.63147944", "0.6306718", "0.6297463", "0.628525", "0.62602025", "0.62131625", "0.6202488", "0.6202488", "0.6105673", "0.60810256", "0.6071712", "0.6050292", "0.60284764", "0.5994327"...
0.70440924
1
Creates & initiliazes env var object along with path list
def __init__(self, name): self.name = name self.val = os.getenv(name) if self.val != None: self.path_list = self.val.split(':') else: os.environ[name] = name # create a new env variable self.path_list = []
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _init_env_variables(self):\n raise NotImplementedError()", "def _init_env_variables(self):\n raise NotImplementedError()", "def _init_env_variables(self):\n raise NotImplementedError()", "def _init_env_variables(self):\n raise NotImplementedError()", "def _init_env_variables...
[ "0.7017334", "0.7017334", "0.7017334", "0.7017334", "0.7017334", "0.7017334", "0.69044834", "0.6690147", "0.6647359", "0.65812254", "0.6556931", "0.6527983", "0.64512664", "0.64258677", "0.64214504", "0.64065105", "0.6383125", "0.63800716", "0.63728327", "0.6372154", "0.63580...
0.69927865
6
Inserts path into current variable into beginning(0) by default but could be at end (1) or any other position
def padd(self, path, pos=0): path = os.path.normpath(path) # remove double slashes and stuff if path in self.path_list: print(path, "already exists. Not appending to ", self.name) elif os.path.exists(path): self.path_list.insert(pos, path) else: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _path_insert(previous, value):\n prefix = (value,)\n suffix = filter(None, previous.split(os.pathsep))\n return os.pathsep.join(_unique(itertools.chain(prefix, suffix)))", "def prepend_path(path, paths):\n\n if path in paths: paths.remove(path)\n paths.insert(0, path)", "def insertIntoPath(origi...
[ "0.663621", "0.6562241", "0.6221099", "0.59981805", "0.59750736", "0.58214045", "0.57711285", "0.57120967", "0.5685242", "0.5645641", "0.5631411", "0.5630229", "0.56162155", "0.55902374", "0.556333", "0.553749", "0.551732", "0.551529", "0.55131227", "0.54983574", "0.5494282",...
0.5247273
33
Just lists out paths in env variable, one per line
def plist(self): if self.val == None: print("No such env variable ", self.val, " exists!") else: print("Listing for ", self.name) for p in self.path_list: print(" ", p)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def path_list():\n return (os.environ.get(\"PATH\", None) or os.defpath).split(os.pathsep)", "def show_envs(path: Optional[Path] = None):\n path = path or WORKON_HOME or Path.cwd()\n for name, path in sorted(find_environment_folders(path=path, verbose=1)):\n terminal.echo(f'Found {terminal.ye...
[ "0.69197834", "0.6629572", "0.6248786", "0.62064815", "0.61731195", "0.61621183", "0.6069602", "0.6014116", "0.5922058", "0.58610016", "0.58253425", "0.58037055", "0.5796449", "0.57708263", "0.576808", "0.5671742", "0.56449497", "0.5635968", "0.5635968", "0.5558531", "0.55343...
0.6816062
1
Cleans up path to remove dead directories, duplicates, etc.
def pclean(self): path_list_pruned = [] for p in self.path_list: if not os.path.exists(p): print("Does not exist! ", p) elif p in path_list_pruned: print("Duplicate found ", p) else: p = os.path.normpath(p) # remov...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clean_path(path):\n return resolved_path(path)", "def _cleanup_path(path):\n return string.join(filter(None, string.split(path, '/')), '/')", "def clean_path(file_path):\n\n pass", "def clean(path=None):\n conf.load(path)\n logger.info('cleaning output...')\n helpers.rmdir(conf.get('build...
[ "0.76485467", "0.74771315", "0.74742633", "0.7472538", "0.73666084", "0.7118773", "0.70741445", "0.69812334", "0.6940394", "0.6913102", "0.6856391", "0.6856364", "0.684552", "0.68346214", "0.68136364", "0.67961645", "0.67751765", "0.67751765", "0.67677987", "0.66886914", "0.6...
0.69657755
8
Removes all occurences of path from env variable
def premove(self, path): path = os.path.normpath(path) # remove double slashes and stuff if path not in self.path_list: print("Not found in path list! ", path) else: print("Removing ", path, " from env var ", self.name) while path in self.path_list: #...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deletePathFromEnv(self, key):\n while self.envExists(key):\n path = self.envGet(key)\n self.prefab.core.dir_remove(path)\n self.envDelete(key)", "def clean_env():\n for key in ['FOO', 'THOR', 'IRON', 'NAME', 'PERSONAL_DIR']:\n os.environ.pop(key, None)", "d...
[ "0.7498703", "0.7304751", "0.69883406", "0.66856515", "0.6464137", "0.6400526", "0.63484174", "0.63416725", "0.6302538", "0.628006", "0.6257412", "0.6185557", "0.6181752", "0.61598164", "0.6138941", "0.6136912", "0.61135036", "0.61036617", "0.61017025", "0.60534555", "0.60534...
0.6544437
4
Updates the internal env val to ensure path_list & val are insync
def pupdate(self): try: tmp = self.path_list[0] except IndexError: print("Empty value for env variable ", self.name) return for p in self.path_list[1:]: tmp = tmp + ':' + p self.val = tmp
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update(self, env_obj):\n if env_obj:\n if isinstance(env_obj, EnvValues):\n for package_name, env_vars in env_obj.data.items():\n for name, value in env_vars.items():\n if isinstance(value, list):\n value = co...
[ "0.62745166", "0.59792364", "0.5785462", "0.5765213", "0.5754156", "0.56319785", "0.5602906", "0.55717754", "0.5535034", "0.5533392", "0.5532169", "0.55176127", "0.5516329", "0.549734", "0.5485281", "0.54776955", "0.54740787", "0.54621756", "0.5461831", "0.5431891", "0.543187...
0.7859146
0
Writes out sanitized or new path list to file for sourcing
def pwrite(self): shell = os.getenv('SHELL') if shell == None: # assume bash or ksh shell = 'bash' else: shell = os.path.basename(shell) fname = '/tmp/source_' + os.environ['USER'] # get login id of current user try: fid = open(fname, 'w'...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sanitize_paths(self):\n\n for wadfile in self.files:\n if wadfile.path:\n path, filename = os.path.split(wadfile.path)\n if len(filename) < 255:\n continue\n\n basename, ext = os.path.splitext(filename)\n wadfile.p...
[ "0.6192476", "0.61592525", "0.6130787", "0.604309", "0.5877469", "0.5852279", "0.58451945", "0.584018", "0.5819745", "0.5788973", "0.5784694", "0.57155025", "0.57137495", "0.5705489", "0.56855375", "0.5685184", "0.56787026", "0.5648103", "0.5627648", "0.5612862", "0.5598941",...
0.0
-1
Process options based on legal operations & subcommands Return sanitized cmds and arguments
def process_options(args): subcmds = dict() # each key(cmd) can take on a val of 0, or 1 subcmds_wo_arg = [ 'clean', 'list' ] subcmds_with_args = [ 'add', 'remove' ] for cmd in subcmds_wo_arg: subcmds[cmd] = 0 for cmd in subcmds_with_args: subcmds[cmd] = 1 if (len(args) == 0)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _get_run_options(self, cmdp, exec_engine=None):\n cmdp.declare_options(\"-v= -e= -w= -u= -p= -i -t -a -P\")\n cmd_options = {\n \"netcoop\": {\n \"fl\": (\"-P\", \"--publish-all\", \"--netcoop\",), \"act\": \"R\",\n \"p2\": \"CMD_OPT\", \"p3\": False\n ...
[ "0.68020016", "0.6262761", "0.6206423", "0.6184919", "0.6182061", "0.6162515", "0.6088291", "0.6074992", "0.6049868", "0.60402685", "0.60306376", "0.6025602", "0.60253805", "0.6003726", "0.59915304", "0.59439254", "0.5930587", "0.5928856", "0.59242874", "0.59233814", "0.59226...
0.71814495
0
Tests out operation of utils with sample commands and strings
def test(): # usage() path_obj = Env('PATH') path_obj.pclean() path_obj.padd('/home/mahmud/downloads///') path_obj.padd('/home/mahmud/apps//', -1) path_obj.premove('/abcd') path_obj.premove('/cad/tools/platform/lsf/7.0/linux2.6-glibc2.3-x86_64/etc') path_obj.premove('/cad/tools/platform/...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_multiple_commands_at_same_time(self):", "def test_cli_string():\n cmd = get_cli_string()\n assert \"pytest\" in cmd", "def helper_commands():\n # Test HELP\n try:\n check = check50.run(run_command).stdin(\"HELP\")\n for help in help_statement:\n check.stdout(help)\...
[ "0.7079813", "0.70298725", "0.6950176", "0.67688835", "0.671888", "0.66877896", "0.66844237", "0.66413546", "0.66393304", "0.6611795", "0.6599124", "0.6524412", "0.6513141", "0.6493118", "0.6476011", "0.6475439", "0.64677346", "0.64521146", "0.64225674", "0.6415802", "0.63882...
0.0
-1
Handle argument options, create env object, and perform operations
def main(): sys.argv.pop(0) (cmd, var, args) = process_options(sys.argv[:]) execute(cmd, var, args)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialise(self, args, environ):", "def create_environment(args):\n env.username = args.user\n env.password = args.password\n env.service_url = args.service_url\n env.quiet = args.quiet\n env.verbose = args.verbose\n env.manifest = args.manifest\n env.debug = args.debug\n env.always_c...
[ "0.67690766", "0.6507964", "0.6471874", "0.62918115", "0.6101134", "0.6062348", "0.6043099", "0.6033953", "0.60332215", "0.6025298", "0.60152006", "0.5989431", "0.59839684", "0.597561", "0.5971104", "0.59697014", "0.5960937", "0.5931457", "0.5898263", "0.5891475", "0.5873876"...
0.596053
17
Handle multiple requests each expected to be a 4byte length, followed by the LogRecord in pickle format. Logs the record according to whatever policy is configured locally.
def handle(self): while True: chunk = self.connection.recv(4) if len(chunk) < 4: break slen = struct.unpack('>L', chunk)[0] chunk = self.connection.recv(slen) while len(chunk) < slen: chunk = chunk + self.connection.recv...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handle(self):\n while True:\n try:\n chunk = self.connection.recv(4)\n if len(chunk) < 4:\n break\n slen = struct.unpack(\">L\", chunk)[0]\n chunk = self.connection.recv(slen)\n while len(chunk) < sl...
[ "0.642383", "0.6383582", "0.6285302", "0.62784356", "0.6121849", "0.6010063", "0.5838576", "0.55765617", "0.55357414", "0.55147916", "0.54627067", "0.5431377", "0.5374189", "0.53549516", "0.5341674", "0.5333902", "0.53018004", "0.52858895", "0.52804816", "0.52658737", "0.5244...
0.6399498
1
The standard inorder traversal of a binary tree.
def __iter__(self): if self: if self.hasLeftChild(): for elem in self.leftChild: yield elem yield self.key if self.hasRightChild(): for elem in self.rightChild: yield elem
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def inorder_traversal(root, inorder):\r\n if root is None:\r\n return\r\n\r\n inorder_traversal(root.left, inorder)\r\n inorder.append(root.val)\r\n inorder_traversal(root.right, inorder)\r\n return inorder", "def in_order_traversal(self):\n root = self.root\n self.traverse = ...
[ "0.8041937", "0.79388064", "0.786354", "0.7772449", "0.7752841", "0.7664082", "0.7660861", "0.7654784", "0.7539193", "0.74186796", "0.73315924", "0.7330442", "0.73297083", "0.7257317", "0.71613365", "0.716095", "0.71396977", "0.711913", "0.7111722", "0.71086997", "0.7082096",...
0.0
-1
Parse command line arguments.
def build_argparser(): parser = ArgumentParser() parser.add_argument("-m", "--model", required=True, type=str, help="Path to an xml file with a trained model.") parser.add_argument("-i", "--input", required=True, type=str, help="Path to image or video file") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def parse_command_line(self, argv):\n from optparse import OptionParser\n usage = \"usage: %prog [options]\"\n parser = OptionParser(usage)\n\n (options, args) = parser.parse_args(argv)", "def parseArguments(self):\n iterator = iter(sys.argv[1:])...
[ "0.807208", "0.74767", "0.73985106", "0.73932225", "0.73173845", "0.72599804", "0.7232453", "0.7222555", "0.713585", "0.7102058", "0.71020466", "0.7096281", "0.7093058", "0.70890576", "0.7080071", "0.70745754", "0.70641047", "0.70633066", "0.70568484", "0.7051162", "0.7048470...
0.0
-1
Initialize the inference network, stream video to network, and output stats and video.
def infer_on_stream(args, client): count_current = 0 count_last = 0 count_last_last = 0 total_count = 0 duration = 0 avg_duration = 0 total_duration = 0 start_time = 0 active_person = 0 net_input_shape = [] frame_count = 0 # Initialise the class infer_network = Netwo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def infer_on_stream(args, client):\n # Initialise the class\n infer_network = Network()\n # Set Probability threshold for detections\n prob_threshold = args.prob_threshold\n\n ### TODO: Load the model through `infer_network` ###\n infer_network.load_model(args.model,args.cpu_extension,args.device...
[ "0.6824933", "0.66583", "0.66199523", "0.6584647", "0.6472856", "0.62965333", "0.6275877", "0.621905", "0.61590046", "0.59710425", "0.59633476", "0.5932169", "0.5894218", "0.5885044", "0.5830741", "0.5784014", "0.57677317", "0.5767166", "0.57534164", "0.5725565", "0.5706836",...
0.6654395
2
Load the network and parse the output.
def main(): # Grab command line args args = build_argparser().parse_args() #print("finished argparser") # Connect to the MQTT server client = connect_mqtt() #print("finished mqtt connect") # Perform inference on the input stream infer_on_stream(args, client)
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def load_network(self):\t\t\r\n\t\tself.dqn.load_network(self.path)", "def __load_Model(self):\r\n PrintsForUser.printProcess(\"[INFO] Loading network...\")\r\n \r\n self.__model = load_model(self.__model_path)\r\n self.__lb = pickle.loads(open(self.__labels_path, \"rb\").read())", ...
[ "0.7355958", "0.6594214", "0.65300447", "0.64435625", "0.6269429", "0.6132971", "0.606932", "0.5980821", "0.5932085", "0.5918037", "0.591396", "0.59083337", "0.59021485", "0.58683854", "0.585857", "0.5845249", "0.5842063", "0.5813572", "0.57925004", "0.5786059", "0.5769666", ...
0.0
-1
Plot mesh triangles on a given surface
def plotMesh(verts,tris): x = verts[:,0] y = verts[:,1] plt.figure() plt.gca().set_aspect('equal') plt.triplot(x, y, tris, 'k-') plt.title('Unstructured Mesh') plt.xlabel('distance (m)') plt.ylabel('distance (m)')
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def DisplayMesh():\r\n \r\n # Load Surface Mesh Data and generate normals\r\n VTKString = OpenData('C:/Users/Tim/Documents/University/Year 4/Final Project/FinalYearProjectCode/TEH_Code/InputFiles','muscle_surface.vtk')\r\n header, Vertices, Triangles = CreateMatrixVTK(VTKString)\r\n \r\n fig = pl...
[ "0.7586179", "0.73376596", "0.7131", "0.68556476", "0.67790115", "0.670109", "0.66954625", "0.643024", "0.63897085", "0.6355384", "0.6306112", "0.62642723", "0.62621355", "0.62500685", "0.6235236", "0.62293386", "0.6221899", "0.62194383", "0.6191307", "0.6178185", "0.6175373"...
0.75149196
1
Scatter plot of displacements at nodes coords = 0=x,1=y,2=z
def plotScatter(verts, data, coords=(1,2), comp=2): z = data[:,:,comp].flatten() x = verts[:,coords[0]] y = verts[:,coords[1]] # NOTE: either scatter or pcolor should work plt.figure() compDict = {0:'X',1:'Y',2:'Z'} #plt.gca().set_aspect('equal') plt.scatter(x, y, c=z, s=80, cmap=plt.cm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_nodes(self,x_shift,y_shift):\n\n if not self.nodes: return # Bounce if option not selected\n\n self.ax.scatter(self.node_crds[:,0]+x_shift*self.pbc[0],self.node_crds[:,1]+y_shift*self.pbc[1],\n marker=\"o\",s=self.ms,c=self.mc,zorder=1)\n\n # for i,c in enumerat...
[ "0.6807476", "0.64142597", "0.62334967", "0.6168654", "0.6158544", "0.60907406", "0.5997021", "0.5973721", "0.59665745", "0.5944722", "0.59345853", "0.59274155", "0.5919128", "0.5873595", "0.58628434", "0.582913", "0.5811393", "0.57778704", "0.5768547", "0.5741387", "0.573808...
0.6318569
2
Contours of surface deformation Also see matplotlib tricontour and tricontourf functions!
def plotContour(verts, data, comp=2): z = data[:,:,comp].flatten() x = verts[:,0] y = verts[:,1] xi = np.linspace(x.min(), x.max(), x.size) yi = np.linspace(y.min(), y.max(), y.size) zi = griddata(x,y,z, xi,yi, interp='nn') #'nn' #NOTE: for irregularly spaced data plt.figure() #plt.gca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def test_surf():\n def f(x, y):\n sin, cos = numpy.sin, numpy.cos\n return sin(x + y) + sin(2 * x - y) + cos(3 * x + 4 * y)\n\n x, y = numpy.mgrid[-7.:7.05:0.1, -5.:5.05:0.05]\n s = surf(x, y, f)\n mlab.show()\n #cs = contour_surf(x, y, f, contour_z=0)\n return", "def fun_contours...
[ "0.6710656", "0.64235824", "0.6263534", "0.62354016", "0.6122986", "0.6080296", "0.6049337", "0.6044242", "0.60144144", "0.6010357", "0.5990036", "0.5979571", "0.59342635", "0.5906877", "0.5778896", "0.57778335", "0.5777319", "0.57574177", "0.5696239", "0.5689536", "0.5664899...
0.52664924
59
Plot interpolated image of surface displacements, optionally show original points
def plotSurface(surfaceFile, comp=2, points=False, tris=False, profile=False, ax=None, annotate=True, norm=None,xscale=1, yscale=1): verts,data,tris = load_h5(surfaceFile) if comp==3: #radial displacements z = np.hypot(data[:,:,0], data[:,:,1]).flatten() else: z = data[:,:,c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def imshow_surface(self):\n plt.imshow(self.z)\n plt.colorbar()\n plt.show()", "def plot(model, center, extent, outname):\n # define model grid\n xg = np.linspace(-extent, extent, model.shape[0])\n yg = xg.copy()\n interp_func = RectBivariateSpline(xg, yg, model)\n\n x = np.ar...
[ "0.6518163", "0.6399373", "0.62921655", "0.6148502", "0.6133245", "0.6123275", "0.60479116", "0.60328573", "0.6023449", "0.59941006", "0.59833103", "0.5982813", "0.5928283", "0.5919153", "0.5898158", "0.5881833", "0.58795625", "0.5879294", "0.58704317", "0.5856613", "0.585542...
0.69940144
0
Convert axes coordinates in figure to image indicies eg. 15000, 0 in figure corresponds to print tr.transform_point((15000, 0)) zi[0,0]
def imshow2array(imx,imy): # NOTE: would be more efficient to not reconstruct 'tr' transform object every time... # NOTE: different order comp to 'extent' keyword in imshow bbox_in = Bbox.from_extents([x1, y1, x2, y2]) # NOTE: lower left corner always -0.5,-0.5 by deafult with imshow bbox_out = Bbox...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image_coordinates(self, temp):\n iy = np.array((temp.y[:,None]-self.extent[2])/self.spacing[1],dtype=np.int64)\n ix = np.array((temp.x[None,:]-self.extent[0])/self.spacing[0],dtype=np.int64)\n return (iy,ix)", "def pos2im_coordinates(x, z):\n # x_lim = [-0.85, 0.86]\n # z_lim = [-1...
[ "0.6230919", "0.61599123", "0.60299486", "0.60299486", "0.58066416", "0.5777637", "0.5747643", "0.5688933", "0.56749", "0.5665224", "0.56551784", "0.55698895", "0.5561942", "0.5557027", "0.55553687", "0.55513406", "0.55450445", "0.5537824", "0.5509617", "0.54909354", "0.54887...
0.5634949
11
For timedependent runs plot maximum displacements versus time
def plot_maxdisp_time(pointsh5, xscale=1e3, yscale=1e-2, tscale=3.1536e7, adjustRadial=False): coords,data,number,times = pu.load_h5_visco(pointsh5) x = coords[:,0] ur = np.hypot(data[:,:,0], data[:,:,1]) uz = data[:,:,2] # Convert units & extract maximums for each timestep ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_displacements(ds):\n # Se obtienen una matriz de datos con los desplazamientos promedios de cada imagen\n t = ds['t']\n t = t[:n_im-1]\n t = mplt.dates.date2num(t)\n d = ds['d_t']\n \n # Se grafica la curva Desplazamientos promedios vs Tiempo\n formatter = DateFormatter(\"%d/%m - %H...
[ "0.5977297", "0.59203607", "0.591389", "0.5904414", "0.58950406", "0.5851301", "0.583456", "0.5795047", "0.5763769", "0.57332605", "0.569345", "0.567947", "0.56562036", "0.56409806", "0.5510336", "0.54855245", "0.54765123", "0.54744595", "0.54681593", "0.5465856", "0.546511",...
0.6763449
0
Profiles of surface displacement at each timestep
def plot_visco_profiles(pointsh5, skip=slice(None,None,1), xscale=1e3, yscale=1e-2, tscale=3.1536e7, adjustRadial=False, benchmark=[], title=None): plt.figure() coords,data,number,times = pu.load_h5_visco(pointsh5) #x = 1e3*np.loadtxt(points,usecols=[0]) # output_points2.txt #y = np.zeros_like(x) x = coords[:,0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def calculate_averaged_properties(poly_data, bucket):\n\n locator = vtk.vtkPointLocator()\n locator.SetDataSet(poly_data)\n locator.BuildLocator()\n\n LENGTH = 0.03\n MODIFIER = 3e3\n\n volume = numpy.zeros(poly_data.GetNumberOfPoints())\n temperature = numpy.zeros(poly_data.GetNumberOfPoints(...
[ "0.56962234", "0.54362315", "0.5403966", "0.5350075", "0.53178805", "0.5305838", "0.5305637", "0.5265301", "0.525089", "0.5243732", "0.5207485", "0.51850504", "0.5176146", "0.5137093", "0.5131274", "0.5127405", "0.5126373", "0.51173675", "0.51032966", "0.5049595", "0.501489",...
0.0
-1
Plot vertical and radial surface displacement profile if x='r', calculate radial distance from x & y
def plot_profile(outdir, xval='x', xscale=1, yscale=1, comp2los=False, adjustRadial=False, fig=True): #Load data path = os.path.join(outdir,'points.h5') x,y,z,ux,uy,uz = pu.extract_points(path) Y = uz / yscale if xval == 'x': X = x / xscale Y1 = ux / yscale elif...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_radial(data, name, fig, piH=1):\n det = data.detectors[name]\n r = np.array([line[0] for line in det.grids['R']])\n vdetector = np.roll(r, -1)**2-r**2\n vdetector[-1] = det.grids['R'][-1][1]**2 - det.grids['R'][-1][0]**2\n vdetector *= piH/2\n\n val = det.tallies\n val = val/vdetector...
[ "0.5935579", "0.5809302", "0.579844", "0.5662632", "0.56524694", "0.55738705", "0.55172443", "0.5468815", "0.543614", "0.536995", "0.53637147", "0.5336989", "0.5335789", "0.5332538", "0.53319854", "0.53096735", "0.52983105", "0.5291765", "0.5290207", "0.5274528", "0.52724695"...
0.54496723
8
Compare FEM output to vertical and radial displacements from inversion of multiple LOS InSAR datasets
def comp2profile(output): # Load components data = '/home/scott/data/insar/cvz/los2xyz/components.txt_backup' lon,lat,x,ur,uz = np.loadtxt(data,unpack=True) # Load FEM output points = '/home/scott/research/models/pylith/3d/fialko2012/model3_agu/output_points.txt' pointsh5 = '/home/scott/resear...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def compare_CII_w_models(**kwargs):\n\n p = copy.copy(params)\n for key,val in kwargs.items():\n setattr(p,key,val)\n\n if not p.xlim: p.xlim = [-4,2]\n if not p.ylim: p.ylim = [4,10]\n\n fig,ax = plt.subplots(figsize=(8,6))\n ax.set_ylim(p.ylim)\n ax.set_xlim(p.xlim)\n\n # SIGAME Si...
[ "0.6051346", "0.5975104", "0.59319794", "0.58609855", "0.58517313", "0.5824497", "0.5738534", "0.5730661", "0.57001823", "0.5671502", "0.5662626", "0.56435794", "0.5638238", "0.56128585", "0.56081694", "0.56056607", "0.55639225", "0.5549855", "0.554532", "0.55445826", "0.5529...
0.5733137
7
Convert Pylith output to InSAR LOS and plot data, model in map view
def data_model_residual(surface, dem, unw, incidence): los,fem_los,residual = pu.los2pylith(surface,dem,unw,incidence) # Using image_grid fig = plt.figure() grid = ImageGrid(fig, 111, # similar to subplot(111) nrows_ncols = (1, 3), direction="row", ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_LvsL(modeldata,line1='CIV1548',line2='CIII1908',plotname='./TESTPLOT.pdf',\n Zgas=False,logU=False,xid=0.3,nh=100,COratio=0.38,Mcutoff=100,\n logx=False,logy=False,logp1=False,logp2=False,fixxrange=False,fixyrange=False,\n showobs=None,noobserr=False,verbose=True):\n...
[ "0.57275915", "0.5662032", "0.55496144", "0.5544452", "0.55086404", "0.54077375", "0.5395589", "0.5380696", "0.5337075", "0.53228354", "0.53110796", "0.52550274", "0.52178866", "0.51859766", "0.51779294", "0.5175796", "0.51676625", "0.51582605", "0.514516", "0.51354164", "0.5...
0.0
-1
Defaults setup for pressurization history
def plot_timeDB(timeDB, xunits='yr', yunits='MPa', skip=8, P0=33.0): time, pressure = np.loadtxt(timeDB, skiprows=skip, unpack=True) pressure = pressure * P0 #if xunits == 'yr': # time = time / 31536000.0 #elif xunits == 'day': # time = time / 86400.0 plt.figure() plt.plot(time,p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():", "def initialize(self):\n PostProcessorInterfaceBase.initialize(self)\n self.inputFormat = 'HistorySet'\n self.outputFormat = 'HistorySet'", "def Modifier_History(self):\n\t\tpass", "def __init__(self, history=None):\n\n self.__history = history if history else []", "def on...
[ "0.61749583", "0.61044705", "0.5923172", "0.56847167", "0.5676686", "0.56484216", "0.56409806", "0.5607612", "0.5604941", "0.5588264", "0.55781215", "0.5554692", "0.55457157", "0.55457157", "0.55457157", "0.55185014", "0.550989", "0.5501374", "0.5485809", "0.5464516", "0.5439...
0.0
-1
plot results for numerical experiment folder 1) surface profiles for each parameter 2) uz_max versus parameter values 3) residual versus parameter values
def plot_directory_numex(path, vals, param='density', outname=None, show=True, xscale=1e-3,yscale=1e2): #vals = arange(2300.0, 2800.0, 50.0) outdirs = np.sort(os.listdir(path)) plt.figure() # Plot surface profiles for each parameter for val,outdir in zip(vals,outdirs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_directory_profiles(path, outname=None, show=True, xscale=1, yscale=1,\n xval='x', adjustRadial=True):\n outdirs = np.sort(os.listdir(path))\n plt.figure()\n\n #labels=['homogeneous','1D layering', '3D tomography'] #xscale=1e-3, yscale=1e2\n for i,outdir in enumerate(...
[ "0.66833836", "0.66289103", "0.6578164", "0.6558594", "0.65089476", "0.65080667", "0.6504561", "0.6472419", "0.64677024", "0.6441997", "0.63957804", "0.63513416", "0.6350512", "0.6309037", "0.62910414", "0.6289601", "0.6281238", "0.6271773", "0.6265851", "0.6262609", "0.62506...
0.6415346
10
plot RMSE versus parameter value for numerical experiment RMSE is calculated based on full fem output converted to LOS
def plot_directory_surface_rmse(path, vals, param='Vp'): unw = '/home/scott/data/insar/cvz/t2282/geo/geo_stack282_8rlks.unw' incidence = '/home/scott/data/insar/cvz/t2282/aux_files/geo_incidence_8rlks.unw' dem = '/home/scott/data/dems/cgiar/uturuncu_1000_1000.tif' #surface = '/home/scott/research/model...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _plot_rmse(self, val=False):\n _, ax = plt.subplots()\n ax.plot(self.global_rmse, linewidth=3, color='blue', label='Train RMSE')\n ax.set_title('RMSE vs. Number of Iterations')\n if val is not None:\n ax.plot(self.validation_rmse, linewidth=3, color='green', label='Valida...
[ "0.7626725", "0.708637", "0.6610557", "0.6603707", "0.65582985", "0.654513", "0.6439415", "0.6360636", "0.63175553", "0.62971836", "0.6282147", "0.6249508", "0.6227701", "0.62119347", "0.61805004", "0.6114414", "0.61127007", "0.609514", "0.6088742", "0.6055546", "0.6054864", ...
0.6174114
15
Convert scale term to unit label
def get_unit(scale): scale2unit = { 1e-9: 'nm', 1e-6: u'\N{MICRO SIGN}m', #or hex id (lookup): u'\u00B5' 1e-3: 'mm', 0.01: 'cm', 0.1:'dm', 1:'m', 1000:'km', # time ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def point_scale_name(self):", "def to_axis_units(self, label, vals):\n if label in ['Hmolar', 'Smolar', 'Umolar', 'Dmolar', 'P']:\n return vals / 1000\n elif label in ['T']:\n return vals\n else:\n raise ValueError(label)", "def labels_x(x_unit, latex = Tru...
[ "0.66115385", "0.64944685", "0.6276687", "0.62619853", "0.6258747", "0.6168202", "0.6106348", "0.6104452", "0.6032182", "0.59474814", "0.59472513", "0.593621", "0.5931593", "0.591483", "0.59085834", "0.5896219", "0.58899754", "0.588468", "0.58570886", "0.5837348", "0.5832844"...
0.7126686
0
Plot vertical and radial profiles for specified output directories.
def compare_ratios(path='/Volumes/OptiHDD/data/pylith/3d/agu2013/output', steps=['step01','step02'], #labels='', show=True, xscale=1e3, yscale=1e-2): plt.figure() #path = '/Users/scott/Desktop/elastic' # Deep source labels = ['no APMB', 'APMB'] deep = {} uzmax = 0.824873455364 # NOT sure why...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_directory_profiles(path, outname=None, show=True, xscale=1, yscale=1,\n xval='x', adjustRadial=True):\n outdirs = np.sort(os.listdir(path))\n plt.figure()\n\n #labels=['homogeneous','1D layering', '3D tomography'] #xscale=1e-3, yscale=1e2\n for i,outdir in enumerate(...
[ "0.77768505", "0.69358486", "0.6893516", "0.6873988", "0.6526698", "0.6287042", "0.62730706", "0.61070305", "0.6070563", "0.6070449", "0.5956038", "0.5923547", "0.5919201", "0.5887804", "0.5874542", "0.5859539", "0.58339554", "0.5830068", "0.58292556", "0.5784595", "0.5765463...
0.0
-1
Plot vertical and radial profiles for specified output directories.
def plot_ratios(path='/Volumes/OptiHDD/data/pylith/3d/agu2014/output', steps=['step01','step02'], #labels='', show=True, xscale=1e3, yscale=1e-2): plt.figure() #path = '/Users/scott/Desktop/elastic' # Deep source #labels = ['no APMB', 'APMB'] #if labels == '': labels = steps deep = {} #uzma...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_directory_profiles(path, outname=None, show=True, xscale=1, yscale=1,\n xval='x', adjustRadial=True):\n outdirs = np.sort(os.listdir(path))\n plt.figure()\n\n #labels=['homogeneous','1D layering', '3D tomography'] #xscale=1e-3, yscale=1e2\n for i,outdir in enumerate(...
[ "0.77768505", "0.69358486", "0.6893516", "0.6873988", "0.6526698", "0.62730706", "0.61070305", "0.6070563", "0.6070449", "0.5956038", "0.5923547", "0.5919201", "0.5887804", "0.5874542", "0.5859539", "0.58339554", "0.5830068", "0.58292556", "0.5784595", "0.5765463", "0.5737489...
0.6287042
5
Plot profiles for each output/step0X folder on same figure
def plot_directory_profiles(path, outname=None, show=True, xscale=1, yscale=1, xval='x', adjustRadial=True): outdirs = np.sort(os.listdir(path)) plt.figure() #labels=['homogeneous','1D layering', '3D tomography'] #xscale=1e-3, yscale=1e2 for i,outdir in enumerate(outdirs): ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_ratios(path='/Volumes/OptiHDD/data/pylith/3d/agu2014/output',\n\t\t\t\tsteps=['step01','step02'],\n\t\t\t\t#labels='',\n\t\t\t\tshow=True,\n\t\t\t\txscale=1e3,\n\t\t\t\tyscale=1e-2):\n\tplt.figure()\n\t#path = '/Users/scott/Desktop/elastic'\n\n\t# Deep source\n\t#labels = ['no APMB', 'APMB']\n\t#if labels...
[ "0.68558604", "0.6830801", "0.682716", "0.6536897", "0.6412557", "0.6166356", "0.61190796", "0.60816085", "0.6074869", "0.60712504", "0.598796", "0.59763676", "0.5945832", "0.59333724", "0.5919523", "0.589908", "0.58856714", "0.58749056", "0.5861554", "0.5851671", "0.58485967...
0.7218871
0
Plot grid of surface displacement maps from each output/step folder if normalize=True, use step01 colorbar for all images
def plot_directory_surface(path,figsize=(17,11), comp=2, nrow=1, norm=None, cbar='each', cloc='top', outname=None, labels='1', show=True): outdirs = np.sort(os.listdir(path)) nplots = len(outdirs) ncol = np.ceil(nplots/nrow).astype(np.int) fig = plt.figure(figsize=figsize) grid = ImageGrid(fig,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def debugplots(fig,data):\n grid = AxesGrid(fig, 111, # similar to subplot(142)\n nrows_ncols=(1, 6),\n axes_pad=0.0,\n share_all=True,\n label_mode=\"L\",\n cbar_location=\"right\",\n cbar_mode=\"...
[ "0.64044726", "0.63224024", "0.6253856", "0.61958474", "0.6189722", "0.60908437", "0.60695", "0.606345", "0.6026868", "0.6024125", "0.5955344", "0.5922822", "0.5906817", "0.58775115", "0.58641946", "0.58604985", "0.5835713", "0.5813257", "0.5810878", "0.580833", "0.57819027",...
0.703744
0
Use gdal/osr to get latlon point location from georeferenced array indices
def ind2latlon(index, filePath): # Load georeferencing ds = gdal.Open(filePath) proj = ds.GetProjection() gt = ds.GetGeoTransform() srs = osr.SpatialReference() srs.ImportFromWkt(proj) x0 = gt[0] #top left longitude y0 = gt[3] #top left latitude dx = gt[1] #pixel width dy = gt[5...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_coord_indices(lon_array, lat_array, lon_points, lat_points, proj_str):\n\n proj = Proj(proj_str)\n proj_lon, proj_lat = np.array(proj(lon_array, lat_array)) # transform to distances using specified projection\n lonlat = np.column_stack(\n (proj_lon.ravel(), proj_lat.ravel())) # Stack all...
[ "0.64533174", "0.62730485", "0.6266516", "0.6246362", "0.6216341", "0.6202899", "0.6187555", "0.6148967", "0.6142526", "0.6036951", "0.5968435", "0.59425825", "0.59397787", "0.5923113", "0.5836684", "0.5829554", "0.58170235", "0.58012676", "0.5789401", "0.5754598", "0.5750754...
0.72259116
0
Plot transparent fem result on highres srt hillshade with summit and stations, etc comp=0,1,2,3 > ux, uy, uz, ur
def uturuncu_map(surfaceFile,dem,comp=2): fig = plt.figure() ax = fig.add_subplot(111) #print(datadir) #print(dem) geosurface = pu.surface2geotiff(dem,surfaceFile,outname=None,comp=comp,nanval=-9999) #load georeferenced fem output from pu.surface2geotiff #geosurface = '/home/scott/research...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def plot_Ae_HDR10_exr_nl_out_vari_prj_white(graph_name=\"./img/out.png\"):\n width = 1920\n\n fname_list = [\n \"./AfterEffects/Comp 1/prj_w_W-none _00000.exr\",\n \"./AfterEffects/Comp 1/prj_w_W-100 _00000.exr\",\n \"./AfterEffects/Comp 1/prj_w_W-203 _00000.exr\",\n \"./AfterEffe...
[ "0.668535", "0.60801226", "0.6054332", "0.59788936", "0.5932414", "0.5875222", "0.5846639", "0.57671297", "0.5711864", "0.57099444", "0.5647215", "0.5645391", "0.5641379", "0.5634341", "0.5630049", "0.56289643", "0.5628059", "0.562422", "0.5621892", "0.5609679", "0.56076366",...
0.5718604
8
Defaults setup for pressurization history
def plot_powerlawDB(timeDB, xunits='yr', yunits='MPa', skip=8, P0=33.0): workdir = '/home/scott/research/models/pylith/powerlaws/iavcei_diorite' # Plot geotherm z, T = np.loadtxt('geotherm.txt', usecols=(2,3), unpack=True) plt.figure() plt.plot(time,pressure,'b.-',lw=3,label='pressure') plt.xla...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def history():", "def initialize(self):\n PostProcessorInterfaceBase.initialize(self)\n self.inputFormat = 'HistorySet'\n self.outputFormat = 'HistorySet'", "def Modifier_History(self):\n\t\tpass", "def __init__(self, history=None):\n\n self.__history = history if history else []", "def on...
[ "0.61749583", "0.61044705", "0.5923172", "0.56847167", "0.5676686", "0.56484216", "0.56409806", "0.5607612", "0.5604941", "0.5588264", "0.55781215", "0.5554692", "0.55457157", "0.55457157", "0.55457157", "0.55185014", "0.550989", "0.5501374", "0.5485809", "0.5464516", "0.5439...
0.0
-1
Plot stress contours by extracting nearest stresses resolved on a point for 4 vertices per cell (tetrahedra)
def contour_stresses(matFile, infoFile, ax=0, esize=100): # NOTE: some bug to work out here vertices, cells, moduli, stress, strain = pu.load_h5_material(matFile, infoFile) # NOTE: could get list of all elements that have a vertex on a particular surface # or get list of all cells that have a centroid ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def highlight_cells_on_tsne(tsne, cells, fig=None, ax=None):\n fig, ax = get_fig(fig=fig, ax=ax)\n ax.scatter(tsne['x'], tsne['y'], s=3, color='lightgrey')\n ax.scatter(tsne.loc[cells, 'x'], tsne.loc[cells, 'y'], s=3, color='b')\n ax.set_axis_off()\n return fig, ax", "def _uniform_refine_tetrahedr...
[ "0.54688436", "0.54646534", "0.53946656", "0.5362895", "0.5319889", "0.52629554", "0.52503395", "0.52421236", "0.52283096", "0.52271646", "0.52166325", "0.5207605", "0.52060854", "0.5204232", "0.51916236", "0.51884454", "0.5186699", "0.5146042", "0.5143565", "0.51160043", "0....
0.6441977
0
Read from powerlaw database input files
def plot_powerlaw_output(timeDB, xunits='yr', yunits='MPa', skip=8, P0=33.0):
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def read_stock(db, openfile):\n pass", "def read_locations(db, openfile):\n pass", "def read_sql(self):\n pass", "def read(self):\n file_path = os.path.join(self.query_path, self.filename + '.sql')\n with open(file_path, 'r') as f:\n self.raw_sql = f.read()", "def buil...
[ "0.62682515", "0.6117073", "0.6082425", "0.5962235", "0.59511", "0.59221077", "0.5916219", "0.5915477", "0.5911701", "0.58680457", "0.58508563", "0.5843291", "0.5842207", "0.58020455", "0.57885134", "0.5770027", "0.5762379", "0.5760551", "0.5756577", "0.5716415", "0.5681463",...
0.0
-1
Parse command line arguments.
def build_argparser(): parser = ArgumentParser() parser.add_argument("-m", "--model", required=True, type=str, help="Path to an xml file with a trained model.") parser.add_argument("-i", "--input", required=True, type=str, help="Path to image or video file") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def parse_arguments(args):", "def parse_command_line(self, argv):\n from optparse import OptionParser\n usage = \"usage: %prog [options]\"\n parser = OptionParser(usage)\n\n (options, args) = parser.parse_args(argv)", "def parseArguments(self):\n iterator = iter(sys.argv[1:])...
[ "0.807208", "0.74767", "0.73985106", "0.73932225", "0.73173845", "0.72599804", "0.7232453", "0.7222555", "0.713585", "0.7102058", "0.71020466", "0.7096281", "0.7093058", "0.70890576", "0.7080071", "0.70745754", "0.70641047", "0.70633066", "0.70568484", "0.7051162", "0.7048470...
0.0
-1