query stringlengths 9 9.05k | document stringlengths 10 222k | metadata dict | negatives listlengths 30 30 | negative_scores listlengths 30 30 | document_score stringlengths 4 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
This function estimates centralities from all networks provided in the network, random and degree lists. | def generate_ci_frame(networks, random, degree, fractions, prev, perm, core):
# Create empty pandas dataframe
results = pd.DataFrame(columns=['Node', 'Network', 'Group', 'Network type', 'Conserved fraction',
'Prevalence of conserved fraction',
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __generate_central_nodes(self,k=3):\n if k < 3:\n k = 3\n \n self.__logger.info(\"CENTRAL_NODES: Try to seek {} nodes which are currently central\".format(k)) \n res = [n for n,_ in sorted(nx.betweenness_centrality(self.G).items(),key=itemgetter(1),reverse=True... | [
"0.6314487",
"0.59640557",
"0.58434755",
"0.5819694",
"0.58180547",
"0.5783225",
"0.5766978",
"0.56455487",
"0.56235516",
"0.5523937",
"0.55193025",
"0.5489237",
"0.54628044",
"0.54487073",
"0.53971404",
"0.5345829",
"0.533469",
"0.5334331",
"0.5321298",
"0.53101933",
"0.5284... | 0.59728146 | 1 |
Given a list with centrality rankings calculated from multiple networks, this function calculates the confidence interval. | def generate_confidence_interval(ranking):
nodes = list()
for x in ranking:
if x:
nodes.extend(x[1].keys())
ci = dict.fromkeys(set(nodes))
for node in ci:
# first constuct array of ranking
ranks = [_catch(x[1], node) for x in ranking if _catch(x[1], node)]
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def confidenceInterval(model, N = 30):\n predicted_accuracies = [0]*N\n predicted_roc = [0]*N\n for i in tqdm(range(N)):\n X_train, X_test, y_train, y_test = train_test_split(X, y_binary, random_state=i)\n scaler = StandardScaler()\n X_train = scaler.fit_transform(X_train)\n X_... | [
"0.5595948",
"0.54243886",
"0.5388224",
"0.53662395",
"0.52424455",
"0.5233333",
"0.52233917",
"0.51881146",
"0.5165064",
"0.5159151",
"0.51419145",
"0.5130692",
"0.50929934",
"0.5061606",
"0.5054744",
"0.5049904",
"0.504449",
"0.5042364",
"0.5010332",
"0.49927625",
"0.497503... | 0.6702172 | 0 |
Write a release ID to the .releases directory in the root of the repo. | def write_release_id(project, release_id):
releases_dir = os.path.join(ROOT, '.releases')
os.makedirs(releases_dir, exist_ok=True)
release_file = os.path.join(releases_dir, project)
with open(release_file, 'w') as f:
f.write(release_id) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def release_package_to_repository(self, version: str) -> None:\n logger.info(f\"Uploading the package [{version}]\")\n pass",
"def publish_release(ctx):\n rel = _get_release()\n rel.update_release(rel.title, rel.raw_data[\"body\"], draft=False)",
"def release(filepath, github_account, force... | [
"0.6012878",
"0.6003138",
"0.590499",
"0.5779497",
"0.5763372",
"0.5622104",
"0.56182945",
"0.55255127",
"0.5498298",
"0.54755676",
"0.5458896",
"0.5453926",
"0.53944206",
"0.5390273",
"0.5334438",
"0.5334047",
"0.5330773",
"0.5306938",
"0.52968234",
"0.5265908",
"0.5246078",... | 0.8484773 | 0 |
Return True/False if ``zf1`` and ``zf2`` have the same contents. This ignores file metadata (e.g. creation time), and just looks at filenames and CRC32 checksums. This requires zipcmp to be available. | def compare_zip_files(zf1, zf2):
try:
subprocess.check_call(['zipcmp', '-q', zf1, zf2])
except subprocess.CalledProcessError:
return False
else:
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _verify_archive_equality(self, file1, file2):\r\n temp_dir_1 = mkdtemp()\r\n temp_dir_2 = mkdtemp()\r\n try:\r\n extract_source(file1, temp_dir_1)\r\n extract_source(file2, temp_dir_2)\r\n return directories_equal(temp_dir_1, temp_dir_2)\r\n\r\n fina... | [
"0.71641237",
"0.70214564",
"0.66670173",
"0.6579378",
"0.65652305",
"0.6443781",
"0.64085513",
"0.6357318",
"0.6352329",
"0.62977356",
"0.6296663",
"0.62960505",
"0.628952",
"0.62581897",
"0.6123939",
"0.609668",
"0.60597116",
"0.60241115",
"0.5942458",
"0.5941132",
"0.58881... | 0.8076111 | 0 |
Builds a similarity matrix for the given properties. | def __init__(self, properties: Properties):
if isinstance(properties, Properties):
self._size = properties.get_size()
self._similarity_matrix = []
self._properties = properties
self.build_matrix()
self._similarity_matrix = np.array(self._similarity_ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def build_matrix(self):\n \n for p1 in self._properties: \n p1 = p1.get_vectorized_data()\n \n for p2 in self._properties:\n p2 = p2.get_vectorized_data()\n v1, v2 = self.prepare_vectors(p1, p2)\n self._similarity_matri... | [
"0.7914751",
"0.54876554",
"0.5435861",
"0.5377563",
"0.53690016",
"0.535762",
"0.53250813",
"0.52459514",
"0.52441126",
"0.5193121",
"0.5119729",
"0.5103986",
"0.5088947",
"0.5082702",
"0.5074578",
"0.5068519",
"0.5067365",
"0.5051759",
"0.5050141",
"0.50171447",
"0.5010239"... | 0.7075531 | 1 |
Builds the similarity matrix. | def build_matrix(self):
for p1 in self._properties:
p1 = p1.get_vectorized_data()
for p2 in self._properties:
p2 = p2.get_vectorized_data()
v1, v2 = self.prepare_vectors(p1, p2)
self._similarity_matrix.append(cosi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __build_distance_matrix(self):\n for i in range(0, len(self.__corpus)):\n doc_i = self.__corpus[i]\n for j in range(i + 1, len(self.__corpus)):\n doc_j = self.__corpus[j]\n distance = doc_i.calc_distance(doc_j)\n self.__distance_matrix.a... | [
"0.68912256",
"0.6658603",
"0.658625",
"0.656426",
"0.6235788",
"0.61662203",
"0.6157443",
"0.6144603",
"0.6119483",
"0.60919136",
"0.6051222",
"0.5996565",
"0.597997",
"0.59771067",
"0.59732485",
"0.59334433",
"0.59255946",
"0.5919345",
"0.5910376",
"0.5907111",
"0.5886785",... | 0.7823807 | 0 |
Plots a heatmap of the similarity matrix. | def plot_matrix(self, matrix: np.ndarray):
sns.heatmap(matrix, annot=True)
plt.show() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def plot_correlation_mat(corr_matrix):\n fig, ax = plt.subplots(figsize=(15, 10))\n ax = sns.heatmap(corr_matrix, annot=True, linewidths=0.5, fmt=\".2f\", cmap=\"YlGnBu\")\n return fig, ax",
"def plot_dist_matrix(embeddings, phrases, width=800, height=600):\n\n dist_matrix = compute_dist_matrix(embed... | [
"0.7494774",
"0.7344375",
"0.72263736",
"0.71772736",
"0.7101004",
"0.703731",
"0.70203215",
"0.69431424",
"0.692695",
"0.6870683",
"0.6865225",
"0.6862517",
"0.6829845",
"0.6809121",
"0.6800667",
"0.6781252",
"0.67683375",
"0.6758248",
"0.67337716",
"0.6715164",
"0.6702051",... | 0.75873464 | 0 |
Convert a large number of bytes to an easily readable format. >>> human(54) '54K' >>> human(1500) '1.5M' >>> human(2 20 1023) '1023G' | def human(byte):
# Adapted from ranger.ext.human_readable
if byte <= 0:
return '0'
if byte < 2**10:
return '%dK' % byte
if byte < 2**10 * 99:
return '%.2gM' % (byte / 2**10.0)
if byte < 2**10 * 999:
return '%.3gM' % (byte / 2**10.0)
if byte < 2**20:
retu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def byte_to_human(byte):\n\n p = int(math.log(byte, 1024))\n\n value = byte / 1024 ** p # getting more human readable version\n value = round(value, 1) # rounding to the nearest 0.1\n value = int(value) if value % 1 == 0 else value # converting into 'int' if no decimal\n\n uni... | [
"0.7806186",
"0.7618024",
"0.75634074",
"0.7497946",
"0.74814117",
"0.74374753",
"0.7377739",
"0.7310549",
"0.72890496",
"0.7145166",
"0.708928",
"0.7009511",
"0.6985712",
"0.68886065",
"0.68886065",
"0.68788487",
"0.68262845",
"0.68256074",
"0.6813313",
"0.6806926",
"0.68060... | 0.804466 | 0 |
A function that return a background color escape sequence. Multiple invocations will cycle through the 8 base colors. | def next_color():
global _color
char = BG_COLORS[_color]
_color = (_color + 1) % 8
return char | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_color_codes(animation=False, background=False):\r\n\r\n ansi_code = \"\\033[48;5;{}m{}\" if background else \"\\033[38;5;{}m{}\"\r\n v = 0.1 if animation else 0\r\n for i in range(32):\r\n for j in range(8):\r\n sleep(v)\r\n code = str(i * 8 + j)\r\n sys.std... | [
"0.7062807",
"0.63121545",
"0.6233279",
"0.6139599",
"0.6043277",
"0.6031808",
"0.60078603",
"0.59789914",
"0.5947852",
"0.5946905",
"0.5924647",
"0.59134233",
"0.5793565",
"0.5740114",
"0.5731457",
"0.57188743",
"0.5705881",
"0.568973",
"0.5683275",
"0.5673569",
"0.5658943",... | 0.67196286 | 1 |
Make camelcase lowercase and use underscores. >>> uncamel('CamelCase') 'camel_case' >>> uncamel('CamelCamelCase') 'camel_camel_case' >>> uncamel('Camel2Camel2Case') 'camel2_camel2_case' >>> uncamel('getHTTPResponseCode') 'get_http_response_code' >>> uncamel('get2HTTPResponseCode') 'get2_http_response_code' >>> uncamel(... | def uncamel(s):
for pat in uncamel_patterns:
s = pat.sub(r'\1_\2', s)
return s.lower() | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _camel_killer(attr):\n try:\n attr = str(attr)\n except UnicodeEncodeError:\n attr = attr.encode('utf-8', 'ignore')\n s1 = _first_cap_re.sub('\\\\1_\\\\2', attr)\n s2 = _all_cap_re.sub('\\\\1_\\\\2', s1)\n return re.sub('_+', '_', s2.casefold() if hasattr(s2, 'casefold') else s2.lo... | [
"0.70549875",
"0.69809014",
"0.69791555",
"0.6859775",
"0.67920375",
"0.67258507",
"0.67164844",
"0.6704222",
"0.6701815",
"0.66974115",
"0.66836464",
"0.66215944",
"0.6603618",
"0.65358156",
"0.65303355",
"0.6520912",
"0.6458613",
"0.64301735",
"0.64301735",
"0.6426971",
"0.... | 0.7477283 | 1 |
Find the solution to a Sudoku grid. | def solve(grid):
puzzle_dict = grid_values(grid)
return search(puzzle_dict) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def solve(grid):\n return search(grid_values(grid))",
"def solve(grid):\n return search(grid_values(grid))",
"def solve(grid):\n\n return search(grid_values(grid))",
"def solve(grid):\n\n return search(grid_values(grid))",
"def solve_with_bruteforce(grid):\n\n res = check_sudoku(grid)\n i... | [
"0.79434085",
"0.79434085",
"0.7882068",
"0.7882068",
"0.7844465",
"0.7827152",
"0.7652962",
"0.76348853",
"0.76140237",
"0.7582164",
"0.7568436",
"0.75664485",
"0.7560566",
"0.7548821",
"0.75406986",
"0.7520498",
"0.7520498",
"0.7516733",
"0.75083035",
"0.7480947",
"0.746493... | 0.83060414 | 0 |
create a directory at this prefix | def create(self, prefix, args=()):
assert os.path.isdir(prefix)
assert not self.exists(prefix, args)
dir_path = self.path(prefix, args)
os.makedirs(dir_path)
self.creation_side_effect_(prefix, args) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create(self, basedir, outdir, name, prefix=None):",
"def create_directory(prefix, dir_path):\n prefix = os.path.abspath(prefix)\n dir_path = os.path.abspath(dir_path)\n assert os.path.isdir(prefix)\n assert os.path.commonprefix([prefix, dir_path]) == prefix\n if not os.path.exists(dir_path):\n... | [
"0.7769426",
"0.7682276",
"0.7537707",
"0.73421997",
"0.7298781",
"0.72784287",
"0.71885437",
"0.7158555",
"0.7127186",
"0.7126865",
"0.70768994",
"0.7040604",
"0.7026778",
"0.7006469",
"0.69958806",
"0.6991989",
"0.6965039",
"0.6963406",
"0.6962849",
"0.69555014",
"0.6933517... | 0.7857942 | 0 |
names of the directories that have been created at this prefix | def created_names(self, prefix):
assert os.path.isdir(prefix)
cwd = os.getcwd()
os.chdir(prefix)
names = tuple(sorted(filter(
os.path.isdir,
glob.glob(os.path.join(*('*' * self.depth))))))
os.chdir(cwd)
return names | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def list_dirs(self):\n return self.list_groups()",
"def listdirs(self):\n return self.list_groups()",
"def root_directory_list(self) -> str:\n return self.__root_directory_list",
"def folder_name(self): \n folders = []\n for folder in self.folders:\n folders.appe... | [
"0.691882",
"0.685393",
"0.66929233",
"0.6686697",
"0.6667076",
"0.662857",
"0.6564089",
"0.65544885",
"0.6334319",
"0.6330037",
"0.6286095",
"0.62307715",
"0.6220921",
"0.61857855",
"0.6151357",
"0.61305183",
"0.6121902",
"0.6115219",
"0.6107949",
"0.60691726",
"0.60691726",... | 0.8089483 | 0 |
get a copy of this DataDir stacked over a base DataDir | def stacked_over(self, base_ddir):
nargs = base_ddir.nargs + self.nargs
depth = base_ddir.depth + self.depth
def name_(args):
base_args = args[:base_ddir.nargs]
args = args[base_ddir.nargs:]
return os.path.join(base_ddir.name_(base_args), self.name_(args))
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stacked_over(self, base_ddir):\n ddir = self.dir.stacked_over(base_ddir)\n return DataFile(ddir=ddir, name=self.name, writer_=self.writer_,\n reader_=self.reader_)",
"def __enter__(self):\n if self.seed:\n np.random.seed(self.seed)\n self._generat... | [
"0.653958",
"0.6231668",
"0.6083726",
"0.6008662",
"0.5719856",
"0.5680569",
"0.5679239",
"0.5624907",
"0.55945885",
"0.5591656",
"0.5583786",
"0.55729306",
"0.556206",
"0.54988515",
"0.54868954",
"0.548297",
"0.54697067",
"0.5433164",
"0.5425006",
"0.5405363",
"0.54047304",
... | 0.67142594 | 0 |
get a copy of this DataFile stacked over a base DataDir | def stacked_over(self, base_ddir):
ddir = self.dir.stacked_over(base_ddir)
return DataFile(ddir=ddir, name=self.name, writer_=self.writer_,
reader_=self.reader_) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def load_copy(self):\n if getattr(self.ancestor,'partial_load',False):\n raise NotImplementedError(\"Cannot load a copy of data that was itself partial-loaded\")\n return load(self.ancestor.filename, take=self.get_index_list(self.ancestor))",
"def get_data(self, *args, docopy=True):\n ... | [
"0.64072734",
"0.6321198",
"0.6310084",
"0.62883174",
"0.61993796",
"0.6109446",
"0.58601296",
"0.58515275",
"0.58387417",
"0.57040757",
"0.57040757",
"0.5698472",
"0.5687549",
"0.5686441",
"0.56183416",
"0.5617365",
"0.5562492",
"0.5554467",
"0.55346173",
"0.55285996",
"0.55... | 0.6760203 | 0 |
get a copy of this DataLayer stacked over a base DataDir | def stacked_over(self, base_ddir):
ddir = self.dir.stacked_over(base_ddir)
dfile_dct = {name: obj.stacked_over(base_ddir)
for name, obj in vars(self.file).items()}
return DataLayer(ddir=ddir, dfile_dct=dfile_dct) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def stacked_over(self, base_ddir):\n ddir = self.dir.stacked_over(base_ddir)\n return DataFile(ddir=ddir, name=self.name, writer_=self.writer_,\n reader_=self.reader_)",
"def stacked_over(self, base_ddir):\n nargs = base_ddir.nargs + self.nargs\n depth = base_dd... | [
"0.64380217",
"0.6412427",
"0.6041013",
"0.6041013",
"0.59065616",
"0.5865063",
"0.5793853",
"0.57216835",
"0.5632163",
"0.5629808",
"0.5602038",
"0.55561054",
"0.5548168",
"0.5520588",
"0.5514196",
"0.54615796",
"0.5442857",
"0.5415977",
"0.5409025",
"0.54047763",
"0.5391419... | 0.6730558 | 0 |
create a FileSystem by stacking DataLayers | def by_stacking(dlayer_seq):
names, objs = zip(*dlayer_seq)
assert len(set(names)) == len(names)
objs = list(itertools.accumulate(
objs, (lambda x, y: y.stacked_over(x.dir))))
dlayer_dct = dict(zip(names, objs))
return FileSystem(dlayer_dct=dlayer_dct) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def filesystem_layers(self):\n pass",
"def create(self):\n\n if rs.IsLayer(self.name):\n\n return self\n\n mom = \"\"\n \n for s in self.path:\n \n son = s if (mom == \"\") else (mom + \"::\" + s)\n\n mommy = None if mom == \"\" else ... | [
"0.59689397",
"0.5960251",
"0.5947073",
"0.5924192",
"0.5911347",
"0.5740006",
"0.569123",
"0.56125546",
"0.5496988",
"0.54632896",
"0.5419751",
"0.5419483",
"0.53888094",
"0.53857446",
"0.53855366",
"0.53477913",
"0.53450125",
"0.53023064",
"0.5298727",
"0.5253486",
"0.52495... | 0.72823554 | 0 |
Finds and returns first item in iterable for which func(item) is True. | def finditem(func, seq):
return next((item for item in seq if func(item))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find(function, iterable):\n for x in iterable:\n if function(x) == True:\n return x",
"def find_item(self, func):\n return next((_(x) for x in self._ if func(x)), None)",
"def first(iterable: Iterable[T1], predicate: Callable[[T1], bool]) -> Union[T1, None]:\n for x in iterab... | [
"0.7988461",
"0.77495664",
"0.7717934",
"0.76899344",
"0.7434396",
"0.73144096",
"0.71711123",
"0.7161674",
"0.7155707",
"0.71323633",
"0.70963126",
"0.70186496",
"0.6895164",
"0.6847543",
"0.672738",
"0.65167874",
"0.65167874",
"0.63901216",
"0.6385112",
"0.6377561",
"0.6319... | 0.7852561 | 1 |
Loads the records from the JSON file. Also filters out empty records. | def load_records(file, preview_records=False):
with open(file, 'r') as json_file:
records = json_file.readlines()
records = [json.loads(record) for record in records]
records = list(filter(lambda record: record[constants.TEXT] != '', records))
if preview_records:
print("=====Random... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def read_records_from_json(filename):\n with open(filename, 'r') as f:\n return json.load(f)",
"def feed_records(self):\n if not self.stats_file:\n return\n\n with open(self.stats_file) as fh:\n reader = reverse_file(fh)\n for line in reader:\n ... | [
"0.6850254",
"0.6810818",
"0.6262635",
"0.61452705",
"0.60747796",
"0.60744333",
"0.60130894",
"0.5920821",
"0.5856486",
"0.58485484",
"0.5830737",
"0.58152884",
"0.58148676",
"0.57816184",
"0.57809335",
"0.5774938",
"0.5771562",
"0.5770931",
"0.576627",
"0.5766134",
"0.57591... | 0.7307374 | 0 |
Filters stopwords, punctuation, and contractions from the tagged records. This is done after tagging to make sure that the tagging is as accurate as possible. | def filter_stopwords(tagged_records):
print('Filtering stopwords')
stop_words = list(stopwords.words('english'))
stop_words.extend(string.punctuation)
stop_words.extend(constants.CONTRACTIONS)
stop_words.extend(constants.MYSQL_STOPWORDS)
dictionary_words = set(nltk_words.words())
de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _apply_filters(self, text, tag):\n\n # The order of the filters below is important\n # and should not be changed\n\n # intial_quotes needs to happen at this point so that\n # attribute values introduced later on do not get affected\n text = self.initial_quotes(text)\n ... | [
"0.60466915",
"0.5965037",
"0.5942566",
"0.59351397",
"0.5864473",
"0.58627397",
"0.57657516",
"0.57438827",
"0.5712905",
"0.5677681",
"0.5644001",
"0.55446243",
"0.5511411",
"0.543259",
"0.54307246",
"0.54205996",
"0.54192215",
"0.54008144",
"0.53978235",
"0.5359957",
"0.533... | 0.7649171 | 0 |
Extracts the most common collocations present in the records. | def extract_collocations(records, num_collocations, collocation_window, compare_collocations = False):
bigram_measures = BigramAssocMeasures()
bigram_finder = BigramCollocationFinder.from_words(records, window_size=collocation_window)
bigram_finder.apply_freq_filter(min_freq=3)
best_collocations = b... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def find_most_common_in_match(data_frame, match_cols):\n\n cluster_cols = match_cols + ['hotel_cluster']\n groups = data_frame.groupby(cluster_cols)\n\n top_clusters = {}\n for name, group in groups:\n bookings = group['is_booking'].sum()\n clicks = len(group) - bookings\n\n score ... | [
"0.6028261",
"0.5870629",
"0.5626739",
"0.5537614",
"0.5373423",
"0.5311959",
"0.52718264",
"0.5225008",
"0.52200633",
"0.5212712",
"0.5192737",
"0.518836",
"0.51812756",
"0.5178689",
"0.51732606",
"0.51705456",
"0.5155667",
"0.5149639",
"0.5146881",
"0.5143037",
"0.51372325"... | 0.71942234 | 0 |
sort all words stored in the set | def sort(self):
self.words = set(sorted(self.words)) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sort_words(words):\n return sorted(words)",
"def sort_by_unicode(self):\n utils.sort_unicode_word_list(self.words_new)",
"def words_in_sorted_order(self):\n print 'Words in sorted order:'\n self.words_in_sorted_order_utils(self.root)",
"def wordset(word_list):\n\n unique_words = []\n\n... | [
"0.7518157",
"0.7237136",
"0.7105536",
"0.6985375",
"0.696479",
"0.6906705",
"0.6834268",
"0.6832409",
"0.68154144",
"0.65746254",
"0.6569344",
"0.6549598",
"0.64929724",
"0.649015",
"0.6445446",
"0.6426475",
"0.6377167",
"0.6355737",
"0.63325834",
"0.63290054",
"0.6321619",
... | 0.85628486 | 0 |
Run macs2 for chip and input samples avoiding errors due to samples. | def run(name, chip_bam, input_bam, genome_build, out_dir, method, resources, data):
# output file name need to have the caller name
config = dd.get_config(data)
out_file = os.path.join(out_dir, name + "_peaks_macs2.xls")
macs2_file = os.path.join(out_dir, name + "_peaks.xls")
if utils.file_exists(ou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def macs2(shift=-100, extsize=200, exclude_blacklisted_regions=False):\n\n mkdir(MACS2_DIR)\n\n printp(\"\"\"\\n#\\n# peak calling\\n#\"\"\")\n printp(\"\"\"# drmr:label macs2\\n\"\"\")\n printp(\"\"\"\\n# drmr:job nodes=1 processors=1 memory=8g working_directory={} time_limit=4h\"\"\".format(MACS2_DIR... | [
"0.61800784",
"0.5979533",
"0.5728848",
"0.5415833",
"0.5405405",
"0.5320313",
"0.5211707",
"0.5177838",
"0.5169228",
"0.5157144",
"0.51335984",
"0.5117398",
"0.51072896",
"0.5092319",
"0.50873286",
"0.5085784",
"0.5080749",
"0.50784177",
"0.5075419",
"0.5073388",
"0.5057124"... | 0.60792214 | 1 |
Record the data for current session. | def record(self, data):
# Init the session when start the recording
if self.session_id not in self._cache:
self._cache[self.session_id] = {}
self._cache[self.session_id] = dict_deep_update(self._cache[self.session_id], data)
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def record(self):\n # TODO: record the data",
"def save_session_data(self, session_id, data):\n raise NotImplementedError()",
"def save_data(self):\n data = self.data\n if data is not None:\n data = base64.encodestring(pickle.dumps(data))\n connection = self._o... | [
"0.78123003",
"0.7405443",
"0.7165393",
"0.7132619",
"0.6954963",
"0.68168247",
"0.6786672",
"0.6645221",
"0.664239",
"0.6597379",
"0.6500272",
"0.64867353",
"0.6428594",
"0.64095145",
"0.63788927",
"0.6348037",
"0.62584955",
"0.6187251",
"0.6162822",
"0.61092734",
"0.6101633... | 0.78032136 | 1 |
Get the data by session id | def get_session(self, session_id):
return self._cache[session_id] | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_session_data(self, session_id):\n raise NotImplementedError()",
"def get(self, *, session_id):\n response = openvidu().get_session(session_id)\n\n if response.status_code == 200:\n return response.json()\n elif response.status_code == 404:\n abort(NotFoun... | [
"0.81686085",
"0.71336895",
"0.7039058",
"0.70263207",
"0.69604623",
"0.67705524",
"0.66804385",
"0.66571105",
"0.65770257",
"0.6564746",
"0.65484065",
"0.6434819",
"0.64062244",
"0.63812053",
"0.6380368",
"0.63772535",
"0.63334125",
"0.6310783",
"0.63084567",
"0.63065916",
"... | 0.7179496 | 1 |
Clean a session by session id | def clean_session(self, session_id):
self._cache[session_id] = {}
return self | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_session(self,session_id):\n del self.sessions[session_id]",
"def close_session(session_id):\n db.sessions.remove({'session_id': session_id})",
"def remove_session(self) -> None:\n pass",
"def delete_session(self, session):\n db = self.open()\n del db[session.id]",
... | [
"0.7544495",
"0.72619665",
"0.6923704",
"0.6922809",
"0.6678236",
"0.66212755",
"0.65912896",
"0.65866995",
"0.65296215",
"0.64927185",
"0.6458982",
"0.6453794",
"0.64206177",
"0.64181393",
"0.64034396",
"0.6389116",
"0.6364327",
"0.63517374",
"0.63223886",
"0.6308467",
"0.62... | 0.7492122 | 1 |
Some stats too big and can not save to google datastore, so need to save to json file to read later | def dump_stats(self, key, data):
file_path = os.path.join(os.environ['PROJ_HOME'], 'models', str(self.session_id), key + '.json')
# Some data can be
data = GoogleDataStore().normalize_data(data)
with open(file_path, "w") as f:
json.dump(data, f, indent=4, sort_keys=True, de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def write_stats_to_json(self, stats: Dict, path: str) -> None:\n if os.path.isfile(path):\n with open(path, 'r') as json_file:\n prev_data = json.load(json_file)\n json_file.close()\n with open(path, 'w') as json_file:\n stats['season'] = se... | [
"0.6621064",
"0.6352696",
"0.618373",
"0.6176568",
"0.61696243",
"0.6132695",
"0.6099479",
"0.6087375",
"0.60581",
"0.60278696",
"0.6026008",
"0.5874523",
"0.58460367",
"0.5808093",
"0.5798178",
"0.577549",
"0.575061",
"0.57202995",
"0.5717354",
"0.5715695",
"0.5704097",
"0... | 0.70294636 | 0 |
Download all submission file to local | def sync_submission_files(self):
blobs = GoogleStorage().list_blobs_with_prefix(self.bucket_name, 'submissions')
for blob in blobs:
destination_file_name = os.path.join(os.environ['PROJ_HOME'], blob.name)
# Check if the local file exist before download file
if not o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def download_files(self):",
"def download(self):\n\n with open(self.dataset_path) as dataset_file:\n dataset = json.load(dataset_file)\n\n path = \"\".join([POST_HIT_PATH, dataset[\"dataset\"][\"data_path\"]])\n if not os.path.exists(path):\n os.makedirs(pat... | [
"0.76832527",
"0.72336435",
"0.71417105",
"0.6991378",
"0.68040156",
"0.6660595",
"0.6660595",
"0.6517251",
"0.64998394",
"0.64509106",
"0.64442974",
"0.6418989",
"0.6397763",
"0.63761884",
"0.636748",
"0.6324725",
"0.631936",
"0.63132274",
"0.6309997",
"0.6309129",
"0.629949... | 0.7915012 | 0 |
Upload training files (in models folder) of a session id | def upload_training_files(self, session_id):
session_id = str(session_id)
folder = 'models/{}'.format(session_id)
self.upload_files(folder) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sync_training_files(self, session_id):\n session_id = str(session_id)\n folder = 'models/{}'.format(session_id)\n self.sync_files(folder)",
"def upload_training_file(self):\n\n file_path = os.getcwd() + \"/\" + self.console_label.training_file_name\n\n with open(file_path, ... | [
"0.79254603",
"0.66897506",
"0.62327737",
"0.6198404",
"0.6088938",
"0.5985286",
"0.595388",
"0.5950122",
"0.5948538",
"0.59208304",
"0.589832",
"0.58612204",
"0.58500755",
"0.58401483",
"0.579688",
"0.5794398",
"0.57470626",
"0.5740303",
"0.5720518",
"0.571798",
"0.5710154",... | 0.899562 | 0 |
Reformat the values of the submission files at locally if need | def reformat_submission_files(self, submission_local_path=None):
if submission_local_path is not None:
sub_files = [f for f in listdir(submission_local_path) if isfile(join(submission_local_path, f))]
for sub_file in sub_files:
submission_local_file_path = '{}/{}'.format(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def files_to_submissions(self):\n url = \"https://raw.githubusercontent.com/owid/covid-19-data/master/public/data/testing/covid-testing-latest-data-source-details.csv\"\n self.parse_file(url)",
"def _filename_pre_data(self) -> dict:\n key = []\n remainder = \"\"\n prework = {}\... | [
"0.642555",
"0.5717492",
"0.5586006",
"0.5539578",
"0.551712",
"0.5395858",
"0.53547",
"0.5332632",
"0.5325045",
"0.5320194",
"0.5319504",
"0.53011245",
"0.52813345",
"0.52614653",
"0.52496547",
"0.5209417",
"0.5174141",
"0.51717263",
"0.5162205",
"0.5159992",
"0.51583433",
... | 0.69528383 | 0 |
Download all top submission file to local and do ensemble these submission file based on session id list | def sync_and_ensemble_top_submission_files(self, sids):
# Download all submission file if sids is empty array
if len(sids) < 1:
self.sync_submission_files()
else:
blobs = GoogleStorage().list_blobs_with_prefix(self.bucket_name, 'submissions')
submission_local... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sync_submission_files(self):\n blobs = GoogleStorage().list_blobs_with_prefix(self.bucket_name, 'submissions')\n\n for blob in blobs:\n destination_file_name = os.path.join(os.environ['PROJ_HOME'], blob.name)\n\n # Check if the local file exist before download file\n ... | [
"0.6342849",
"0.6114907",
"0.5924573",
"0.58115375",
"0.5803886",
"0.5761328",
"0.57528394",
"0.5708669",
"0.57082283",
"0.56931555",
"0.5688942",
"0.5598787",
"0.5588771",
"0.5579191",
"0.55660766",
"0.54919386",
"0.54695094",
"0.54533213",
"0.5424328",
"0.54163575",
"0.5411... | 0.72030395 | 0 |
Shuffle orders of points in each point cloud changes FPS behavior. | def shuffle_points(data):
idx = np.arange(data.shape[1])
np.random.shuffle(idx)
return data[:, idx, :], idx | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def shuffle_points(mutated_genome,index):\n random.shuffle(mutated_genome[index][2])",
"def shuffle_points(batch_data):\n idx = np.arange(batch_data.shape[1])\n np.random.shuffle(idx)\n return batch_data[:, idx, :]",
"def shuffle_points(batch_data):\n idx = np.arange(batch_data.shape[1])\n np.... | [
"0.7041814",
"0.6627027",
"0.6604705",
"0.6554147",
"0.64843124",
"0.64065075",
"0.6399468",
"0.6378406",
"0.63584083",
"0.6308074",
"0.6308074",
"0.62790626",
"0.61783606",
"0.61771435",
"0.6156442",
"0.6153498",
"0.61443853",
"0.6138688",
"0.60873425",
"0.6063841",
"0.60610... | 0.6660805 | 1 |
A checker for valid ElementTree elements that excludes XsdElement objects. | def is_etree_element(obj: Any) -> bool:
return hasattr(obj, 'append') and hasattr(obj, 'tag') and hasattr(obj, 'attrib') | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_element(obj):\n return isinstance(obj, etree._Element) # noqa",
"def validateElement(self, doc, elem):\n if doc is None: doc__o = None\n else: doc__o = doc._o\n if elem is None: elem__o = None\n else: elem__o = elem._o\n ret = libxml2mod.xmlValidateElement(self._o, d... | [
"0.6824575",
"0.6302681",
"0.6242924",
"0.6212686",
"0.6164077",
"0.6131169",
"0.5949349",
"0.593076",
"0.5893753",
"0.5859745",
"0.5775626",
"0.5732878",
"0.5691299",
"0.5685656",
"0.5655421",
"0.56494623",
"0.55857307",
"0.55488104",
"0.5540682",
"0.55384994",
"0.5525928",
... | 0.6612141 | 1 |
Caches links of entries from the daily releases. cache_from_releases is responsible for sanitizing each show name to pass as a Redis key name. The URL of the | def cache_from_releases(releases: List[dict]) -> None:
client = redis.Redis(host=os.environ.get('REDIS_HOST', 'localhost'))
for release in (r for r in releases if r.get('url')): # filter out releases without a url
key_name = _title_to_key(release['title'])
client.setex(key_name, ONE_DAY, relea... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_from_releases(releases: List[Tuple[str, str, str]]) -> List[str]:\n output = []\n client = redis.Redis(host=os.environ.get('REDIS_HOST', 'localhost'))\n\n for release in releases:\n key_name = _title_to_key(release[0])\n url = client.get(key_name)\n\n if url is not None:\n ... | [
"0.6107926",
"0.5344368",
"0.5280667",
"0.523355",
"0.5222567",
"0.50541806",
"0.50393325",
"0.5002521",
"0.4978812",
"0.49458566",
"0.49454966",
"0.49353266",
"0.4934924",
"0.4917737",
"0.4881563",
"0.48485097",
"0.4828384",
"0.48057023",
"0.4797818",
"0.4757207",
"0.4753952... | 0.77135354 | 0 |
Gets available links for the given releases and returns them markdownformatted. get_from_releases takes a list of releases generated in `main.hourly_releases` and checks for the existence of keys whose names correspond to the names of each release. The output is a markdownformatted string created from the URL to the re... | def get_from_releases(releases: List[Tuple[str, str, str]]) -> List[str]:
output = []
client = redis.Redis(host=os.environ.get('REDIS_HOST', 'localhost'))
for release in releases:
key_name = _title_to_key(release[0])
url = client.get(key_name)
if url is not None:
output... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_from_releases(releases: List[dict]) -> None:\n client = redis.Redis(host=os.environ.get('REDIS_HOST', 'localhost'))\n\n for release in (r for r in releases if r.get('url')): # filter out releases without a url\n key_name = _title_to_key(release['title'])\n client.setex(key_name, ONE_... | [
"0.62876546",
"0.6100536",
"0.5645146",
"0.5555504",
"0.55209565",
"0.5510671",
"0.54995596",
"0.54396397",
"0.53327656",
"0.53141147",
"0.52950925",
"0.52401245",
"0.5179105",
"0.51664394",
"0.5091349",
"0.50331205",
"0.50256675",
"0.5015576",
"0.49286744",
"0.49080792",
"0.... | 0.8002756 | 0 |
Set global numpy and astropy warnings | def set_warnings(numpy_level='ignore', astropy_level='ignore'):
from astropy.utils.exceptions import AstropyWarning
np.seterr(all=numpy_level)
warnings.simplefilter(astropy_level, category=AstropyWarning) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def setup_test():\n if LooseVersion(np.__version__) >= LooseVersion('1.14'):\n np.set_printoptions(legacy='1.13')\n\n # Temporary fix until scipy release in October 2018\n # must be removed after that\n # print the first occurrence of matching warnings for each location\n # (module + line num... | [
"0.6843397",
"0.6719991",
"0.59046966",
"0.5890972",
"0.585644",
"0.5725862",
"0.57230127",
"0.56640774",
"0.56599265",
"0.56599265",
"0.56599265",
"0.56599265",
"0.56599265",
"0.56599265",
"0.56599265",
"0.56599265",
"0.5640387",
"0.5632564",
"0.5585389",
"0.5578787",
"0.555... | 0.7989988 | 0 |
Add `~shapely.geometry.Polygon` 'footprint' attributes to visit dict. | def get_visit_footprints(visits):
import os
import astropy.io.fits as pyfits
import astropy.wcs as pywcs
from shapely.geometry import Polygon
N = len(visits)
for i in range(N):
for j in range(len(visits[i]['files'])):
flt_file = visits[i]['files'][j]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_reference_terrain(self, terrain_info):\n for p in terrain_info['features']:\n if (p['geometry']['type'] == 'Polygon'):\n # creating a new polygon\n new_poly = Polygon(p['geometry']['coordinates'])\n self.terrain_poly.append(new_poly)\n ... | [
"0.53100467",
"0.510452",
"0.5047828",
"0.5014441",
"0.49463576",
"0.4942638",
"0.48405844",
"0.48121822",
"0.48097488",
"0.47231767",
"0.47182226",
"0.47003147",
"0.46776888",
"0.4666873",
"0.46655098",
"0.46572185",
"0.4653061",
"0.46326017",
"0.4580808",
"0.45769587",
"0.4... | 0.57927096 | 0 |
Find overlapping visits/filters to make combined mosaics | def parse_visit_overlaps(visits, buffer=15.):
import copy
from shapely.geometry import Polygon
N = len(visits)
exposure_groups = []
used = np.arange(len(visits)) < 0
for i in range(N):
f_i = visits[i]['product'].split('-')[-1]
if used[i]:
continue
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def check_sim_overlaps(self, verbose = False):\n if hasattr(self.phot, \"data\") and hasattr(self, 'spec'):\n for i, spectrum in enumerate(self.sim_spec):\n if verbose:print(i, spectrum)\n for j, filtername in enumerate(self.phot.data_filters):\n i... | [
"0.5576807",
"0.55171025",
"0.52555335",
"0.52056015",
"0.5190537",
"0.5163057",
"0.51527715",
"0.5131599",
"0.5105637",
"0.50875515",
"0.50755936",
"0.5065796",
"0.5063961",
"0.50491273",
"0.5023992",
"0.5010492",
"0.49699506",
"0.494761",
"0.49106088",
"0.48948205",
"0.4887... | 0.6336186 | 0 |
Get associated lists of grism and direct exposures | def parse_grism_associations(exposure_groups,
best_direct=DIRECT_ORDER,
get_max_overlap=True):
N = len(exposure_groups)
grism_groups = []
for i in range(N):
f_i = exposure_groups[i]['product'].split('-')[-1]
root_i = exposure_gr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_gates(self):\n return self.gates",
"def getWithImages(self):\n return [x for x in self.xeps if x.images]",
"def get_designs(self):",
"def maps(self):\n refs = []\n for r in self.context.getBRefs():\n # get all the maps referencing the agency\n if r.Ty... | [
"0.56175",
"0.55892766",
"0.5586148",
"0.548386",
"0.5476574",
"0.54144734",
"0.54038477",
"0.5392461",
"0.53821445",
"0.5381245",
"0.53701216",
"0.5341538",
"0.5335363",
"0.53333443",
"0.53094834",
"0.5308671",
"0.52935755",
"0.5289493",
"0.5275798",
"0.52681345",
"0.5253283... | 0.57539225 | 0 |
Get simple filter name out of an HST image header. ACS has two keywords for the two filter wheels, so just return the nonCLEAR filter. For example, >>> h = astropy.io.fits.Header() >>> h['INSTRUME'] = 'ACS' >>> h['FILTER1'] = 'CLEAR1L' >>> h['FILTER2'] = 'F814W' >>> from grizli.utils import get_hst_filter >>> print(get... | def get_hst_filter(header):
if 'FILTER' in header:
return header['FILTER'].upper()
if header['INSTRUME'].strip() == 'ACS':
for i in [1,2]:
filter_i = header['FILTER{0:d}'.format(i)]
if 'CLEAR' in filter_i:
continue
else:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_filter(image):\n logging.debug('Retrieving filter for {}'.format(image))\n try:\n filter = fits.getheader(image)['FILTER']\n except KeyError:\n logging.debug('No FILTER key found, trying FILTER1')\n #The 814 image has the filter information under the keyword FILTER2:\n ... | [
"0.65740573",
"0.6295286",
"0.6175207",
"0.5905012",
"0.5680691",
"0.55971265",
"0.5595847",
"0.5428323",
"0.54085046",
"0.53721166",
"0.52620685",
"0.52138877",
"0.5191931",
"0.5175739",
"0.5131244",
"0.511717",
"0.504596",
"0.50424904",
"0.5026906",
"0.5005086",
"0.49640167... | 0.87214637 | 0 |
Unset bit flags from a DQ array | def unset_dq_bits(value, okbits=32+64+512, verbose=False):
bin_bits = np.binary_repr(okbits)
n = len(bin_bits)
for i in range(n):
if bin_bits[-(i+1)] == '1':
if verbose:
print(2**i)
value -= (value & 2**i)
return value | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def unset(self, *options: str) -> int:\n self.flags &= ~(self.mask(*options))\n return self.flags",
"def unset_bit(x, k):\n\n return x & ~(1 << k)",
"def resetFlags():\r\n for flag in flags:\r\n flags[flag] = False",
"def build_mask(dqarr, bitvalue):\n bitvalue = interpret_bit_f... | [
"0.627239",
"0.6123109",
"0.6090351",
"0.60387355",
"0.6030209",
"0.5976419",
"0.5947276",
"0.5944814",
"0.59088093",
"0.5875451",
"0.58599484",
"0.58528095",
"0.57819575",
"0.5762859",
"0.5762556",
"0.5739184",
"0.5698015",
"0.56767523",
"0.5644628",
"0.5544823",
"0.55243534... | 0.6472853 | 0 |
Get a dictionary of common emission line wavelengths and line ratios Returns | def get_line_wavelengths():
line_wavelengths = OrderedDict() ; line_ratios = OrderedDict()
line_wavelengths['PaB'] = [12821]
line_ratios['PaB'] = [1.]
line_wavelengths['Ha'] = [6564.61]
line_ratios['Ha'] = [1.]
line_wavelengths['Hb'] = [4862.68]
line_ratios['Hb'] = [1.]
line_wavelen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lines():\n line_dict = {}\n #\n line_dict['ArI'] = 2**0\n line_dict['HgI'] = 2**1\n line_dict['KrI'] = 2**2\n line_dict['NeI'] = 2**3\n line_dict['XeI'] = 2**4\n line_dict['CdI'] = 2**5\n line_dict['ZnI'] = 2**6\n line_dict['HeI'] = 2**7\n line_dict['OH_R24000'] = 2**8\n lin... | [
"0.61606765",
"0.5887412",
"0.57125324",
"0.5712466",
"0.5616241",
"0.557773",
"0.5515143",
"0.54773915",
"0.54552245",
"0.5399129",
"0.53944135",
"0.5394321",
"0.5378989",
"0.53673154",
"0.5350882",
"0.5339634",
"0.5262879",
"0.52427125",
"0.5241554",
"0.52258426",
"0.522234... | 0.6840279 | 0 |
Add two templates together The new wavelength array is the union of both input spectra and each input spectrum is linearly interpolated to the final grid. | def __add__(self, spectrum):
new_wave = np.unique(np.append(self.wave, spectrum.wave))
new_wave.sort()
new_flux = np.interp(new_wave, self.wave, self.flux)
new_flux += np.interp(new_wave, spectrum.wave, spectrum.flux)
out = SpectrumTemplate(wave=new_wave, flux=new_flux)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def merge_spectra(datalist):\n resolution = get_resolution(datalist[0])\n concat = np.concatenate(datalist)\n # xvals = concat[:, 0]\n # print \"Median Resolution:\", resolution\n # axis = nonlinear_axis(np.amin(concat[:, 0]), np.amax(concat[:, 0]), resolution)\n axis = ud.nonlinear_axis(np.amin(... | [
"0.5974437",
"0.59426314",
"0.5521126",
"0.54301745",
"0.5360166",
"0.5358687",
"0.5327826",
"0.5309657",
"0.5280995",
"0.5275434",
"0.5274342",
"0.52499586",
"0.52233315",
"0.52150226",
"0.52109563",
"0.51997215",
"0.5192757",
"0.5171536",
"0.51654035",
"0.51547587",
"0.5151... | 0.7005405 | 0 |
Multiply spectrum by a scalar value | def __mul__(self, scalar):
out = SpectrumTemplate(wave=self.wave, flux=self.flux*scalar)
out.fwhm = self.fwhm
return out | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def integrate_spectrum(self):\n flux = sum(self.spectrum)\n return flux",
"def scalar_mult(diagram, scalar):\n for oindex in diagram.offsets:\n diagram.offsets[oindex] *= scalar",
"def scalar_mult(diagram, scalar):\n for oindex in diagram.offsets:\n diagram.off... | [
"0.6443531",
"0.6245501",
"0.6245501",
"0.60025203",
"0.5942316",
"0.5938919",
"0.5869239",
"0.5852433",
"0.5836749",
"0.58327353",
"0.58325666",
"0.58146083",
"0.5809853",
"0.57916784",
"0.57568765",
"0.5756472",
"0.56738794",
"0.5673109",
"0.5673109",
"0.5664442",
"0.566103... | 0.68712676 | 0 |
Make fnu version of the template. Sets the `flux_fnu` attribute, assuming that the wavelength is given | def to_fnu(self, fnu_units=FNU_CGS):
#import astropy.constants as const
#flux_fnu = self.flux * self.wave**2 / 3.e18
#flux_fnu = (self.flux*self.fluxunits*(self.wave*self.waveunits)**2/const.c).to(FNU_CGS) #,
if ((FNU_CGS.__str__() == 'erg / (cm2 Hz s)') &
(sel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def flux(self, u):\n flu = np.zeros((3,2), dtype=np.float64)\n flu[0,0] = u[1]\n flu[1,0] = u[0] * (u[1]/u[0])**2 + 0.5 * 9.81*u[0]**2\n flu[2,0] = u[1] * u[2]/u[0] #FIXME attenzione che c'è il punto controllare se sono scalari o vettori'\n flu[0,1] = u[2]\n flu[1,1] = u[2... | [
"0.6604434",
"0.6055472",
"0.59769416",
"0.5701345",
"0.56837976",
"0.5640254",
"0.5619412",
"0.5548573",
"0.5530652",
"0.5529754",
"0.5481792",
"0.5467627",
"0.54343855",
"0.54118454",
"0.5406788",
"0.53896415",
"0.53709114",
"0.53520477",
"0.5337106",
"0.53165364",
"0.53092... | 0.75718397 | 0 |
Integrate the template through an `~eazy.FilterDefinition` filter object. Examples Compute the WFC3/IR F140W AB magnitude of a pure emission line at the | def integrate_filter(self, filter):
INTEGRATOR = np.trapz
try:
import grizli.utils_c
interp = grizli.utils_c.interp.interp_conserve_c
except ImportError:
interp = np.interp
#wz = self.wave*(1+z)
if (filter.wave.min() > self.wa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def mce_filter(freq, f_raw, params):\n\tz = np.exp(-2j*np.pi*freq/f_raw)\n\tb11, b12, b21, b22 = np.array(params[:4])*0.5**14\n\tH = (1+z)**4 / (1-b11*z+b12*z**2) / (1-b21*z+b22*z**2)\n\tH /= 2**4 / (1-b11+b12) / (1-b21+b22)\n\treturn H",
"def main():\n amplitute_variation = [0.98, 1.02]\n frequency_vari... | [
"0.58151317",
"0.5650733",
"0.54938495",
"0.53521734",
"0.5337691",
"0.52621305",
"0.52351755",
"0.5213709",
"0.5152777",
"0.51213014",
"0.5118301",
"0.50652784",
"0.5035257",
"0.5026629",
"0.5006921",
"0.5000265",
"0.4986632",
"0.49762252",
"0.49672413",
"0.4960904",
"0.4952... | 0.635893 | 0 |
Generate a list of templates for fitting to the grism spectra The different sets of continuum templates are stored in >>> temp_dir = os.path.join(os.getenv('GRIZLI'), 'templates') | def load_templates(fwhm=400, line_complexes=True, stars=False,
full_line_list=None, continuum_list=None,
fsps_templates=False, alf_template=False):
if stars:
# templates = glob.glob('%s/templates/Pickles_stars/ext/*dat' %(os.getenv('GRIZLI')))
# templates =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _set_templates(spm_dir=SPM_DIR):\n global EPI_TEMPLATE, T1_TEMPLATE, GM_TEMPLATE, WM_TEMPLATE, CSF_TEMPLATE\n\n spm_version = _get_version_spm(SPM_DIR)\n\n # Set the tpm and template paths according to SPM version\n if spm_version == 'spm12':\n template_path = 'toolbox/OldNorm'\n tpm_... | [
"0.6718762",
"0.66420853",
"0.6454433",
"0.64006406",
"0.6371855",
"0.63270265",
"0.6310704",
"0.6269733",
"0.6242973",
"0.6235836",
"0.61921674",
"0.6188417",
"0.61525846",
"0.61410415",
"0.61185724",
"0.60871303",
"0.60363704",
"0.5995305",
"0.5970588",
"0.5952313",
"0.5942... | 0.67001003 | 1 |
Compute template sum analogous to `np.dot(coeffs, templates)`. | def dot_templates(coeffs, templates, z=0, max_R=5000):
if len(coeffs) != len(templates):
raise ValueError ('shapes of coeffs ({0}) and templates ({1}) don\'t match'.format(len(coeffs), len(templates)))
# for i, te in enumerate(templates):
# if i == 0:
# tc = templat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def polynomial_sum(self, coefficients: list | np.ndarray, t: np.ndarray):\n # convert time to array if importing a single value\n t = np.atleast_1d(t)\n return np.sum([c * (t ** i) for i, c in enumerate(coefficients)], axis=0)",
"def tensdot(polyList,order,trunc):\n\n def reshape(poly,exp... | [
"0.5516386",
"0.54195106",
"0.54046565",
"0.53731656",
"0.5358249",
"0.53305006",
"0.5202382",
"0.5192432",
"0.51706827",
"0.5156779",
"0.5146261",
"0.5143894",
"0.51343423",
"0.51329386",
"0.51216805",
"0.51104075",
"0.50872535",
"0.5080868",
"0.5077732",
"0.5077732",
"0.507... | 0.7044764 | 0 |
Return an array version of the templates that have all been interpolated to the same grid. | def array_templates(templates, max_R=5000):
from grizli.utils_c.interp import interp_conserve_c
wave = np.unique(np.hstack([templates[t].wave for t in templates]))
clipsum, iter = 1, 0
while (clipsum > 0) & (iter < 10):
clip = np.gradient(wave)/wave < 1/max_R
idx = np.arange(len... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_temp():\n\n\tall_temp = scipy.io.loadmat('../files/ALL.templates1')\n\ttemp = all_temp['templates'].astype(np.float64)\n\tt = temp.copy()\n\treturn (t)",
"def get_template_series(self, nb_images):\n\n # Tab for the series of images\n self.template = []\n\n # Tab\n temp = []\n\... | [
"0.60703003",
"0.5943658",
"0.58832616",
"0.58292484",
"0.58062845",
"0.57171226",
"0.5709569",
"0.5614271",
"0.5597241",
"0.5593119",
"0.55874455",
"0.5568584",
"0.5524762",
"0.55177367",
"0.5453238",
"0.5432895",
"0.5432752",
"0.5423811",
"0.5358149",
"0.5319184",
"0.528591... | 0.6466277 | 0 |
Compute templatefit emission line equivalent widths | def compute_equivalent_widths(templates, coeffs, covar, max_R=5000, Ndraw=1000, seed=0):
if False:
# Testing
templates = t1
chi2, coeffsx, coeffs_errx, covarx = mb.xfit_at_z(z=tfit['z'], templates=templates, fitter='nnls', fit_background=True, get_uncertainties=2)
covar = covarx... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def estimate_widths(self):\n res = self.results\n # Prepare a spot for the uncertainties\n res['velocity_uncertainty'] = np.zeros(len(res['velocities']))\n for n in range(len(res['time_index'])):\n fit_res = self.estimate_width(n)\n res['velocities'][n] = fit_res['... | [
"0.6515485",
"0.57640064",
"0.5680466",
"0.56203365",
"0.55028325",
"0.54935926",
"0.54935926",
"0.5455733",
"0.54125345",
"0.53709584",
"0.53678817",
"0.5342097",
"0.53171307",
"0.53120923",
"0.53061634",
"0.5306016",
"0.5304207",
"0.52926344",
"0.5253392",
"0.5237845",
"0.5... | 0.6158215 | 1 |
Get correct pscale from a `~astropy.wcs.WCS` object | def get_wcs_pscale(wcs):
from numpy import linalg
det = linalg.det(wcs.wcs.cd)
pscale = np.sqrt(np.abs(det))*3600.
return pscale | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_image_scale (wcs):\n return list(proj_plane_pixel_scales(wcs))",
"def scale(self):\n return self.scale_factor / CONSTANTS.AU",
"def _get_scale_from_magzp(self, magzp):\n scale = 10.0**( 0.4*(self['magzp_ref']-magzp) )\n return scale",
"def get_scale():\r\n\r\n \r\n retur... | [
"0.7437173",
"0.6240309",
"0.6172994",
"0.6125156",
"0.6112565",
"0.60280067",
"0.60209906",
"0.6015406",
"0.60008794",
"0.59973484",
"0.5901195",
"0.5891125",
"0.5891125",
"0.5867685",
"0.58588535",
"0.5853099",
"0.5852131",
"0.58403826",
"0.5809048",
"0.58080256",
"0.576295... | 0.82844704 | 0 |
Update WCS with shift, rotation, & scale Paramters | def transform_wcs(in_wcs, translation=[0.,0.], rotation=0., scale=1.):
out_wcs = in_wcs.deepcopy()
out_wcs.wcs.crpix += np.array(translation)
theta = -rotation
_mat = np.array([[np.cos(theta), -np.sin(theta)],
[np.sin(theta), np.cos(theta)]])
out_wcs.wcs.cd = np.dot(out_wcs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def makeWcs(projName, destCtrInd, skyOffset, rotAng, scaleFac, srcWcs, srcCtrInd):\n ps = dafBase.PropertySet()\n srcCtrPix = lsst.geom.Point2D(*[float(val) for val in srcCtrInd])\n destCtrFitsPix = lsst.geom.Point2D(*[ind + 1.0 for ind in destCtrInd])\n srcCtrFitsPix = lsst.geom.Point2D(*[ind + 1.0 fo... | [
"0.6352505",
"0.6077135",
"0.5895363",
"0.5799527",
"0.57718384",
"0.57593066",
"0.57534134",
"0.56536984",
"0.55861306",
"0.55807275",
"0.5546948",
"0.5513806",
"0.54910356",
"0.54632026",
"0.5431571",
"0.5412642",
"0.54096824",
"0.5376602",
"0.537656",
"0.53506047",
"0.5316... | 0.60946333 | 1 |
Make a WCS header for a 2D spectrum | def make_spectrum_wcsheader(center_wave=1.4e4, dlam=40, NX=100, spatial_scale=1, NY=10):
h = pyfits.ImageHDU(data=np.zeros((2*NY, 2*NX), dtype=np.float32))
refh = h.header
refh['CRPIX1'] = NX+1
refh['CRPIX2'] = NY+1
refh['CRVAL1'] = center_wave
refh['CD1_1'] = dlam
refh['CD1_2'] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def wfirst_header(ra=53.1592277508136, dec=-27.782056346146, pa_aper=128.589, naxis=(4096,4096)):\n #naxis = 2048, 2048\n crpix = naxis[0]/2., naxis[0]/2.\n \n cd = np.array([[ -0.11, 0], [0, 0.11]])/3600.\n cd_rot = rotate_CD_matrix(cd, pa_aper)\n \n h = pyfits.Header()\n \n h['CRVAL1'... | [
"0.7110238",
"0.7100553",
"0.7006183",
"0.67446095",
"0.64489645",
"0.63313615",
"0.631879",
"0.6298971",
"0.628228",
"0.61749274",
"0.60822564",
"0.6059507",
"0.6046955",
"0.59891164",
"0.5987763",
"0.59360594",
"0.5878587",
"0.5843551",
"0.5830052",
"0.5827539",
"0.58274525... | 0.74951166 | 0 |
Modify `astropy.wcs.WCS.to_header` to produce more keywords | def to_header(wcs, relax=True):
header = wcs.to_header(relax=relax)
if hasattr(wcs, '_naxis1'):
header['NAXIS'] = wcs.naxis
header['NAXIS1'] = wcs._naxis1
header['NAXIS2'] = wcs._naxis2
for k in header:
if k.startswith('PC'):
cd = k.replace('PC','CD')
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def prep_hd(header,phi_c,lambda_c,nx,ny,dx,dy):\n header_out = {}\n\n # Keywords to get from original header\n keys_hd = ['TELESCOP', 'INSTRUME', 'WAVELNTH', 'CAMERA','DATE',\n 'DATE_S','DATE-OBS','T_OBS','T_REC','TRECEPOC',\n 'TRECSTEP','TRECUNIT','HARPNUM','DSUN_OBS','DSUN_RE... | [
"0.6922213",
"0.6575564",
"0.6496217",
"0.6451081",
"0.6406416",
"0.6333983",
"0.6327991",
"0.63070816",
"0.624649",
"0.61701316",
"0.6157372",
"0.61472404",
"0.611695",
"0.6103093",
"0.60922843",
"0.6074273",
"0.6063403",
"0.60622376",
"0.6053997",
"0.60501295",
"0.6027178",... | 0.7747574 | 0 |
Make a celestial WCS header | def make_wcsheader(ra=40.07293, dec=-1.6137748, size=2, pixscale=0.1, get_hdu=False, theta=0):
if np.isscalar(pixscale):
cdelt = [pixscale/3600.]*2
else:
cdelt = [pixscale[0]/3600., pixscale[1]/3600.]
if np.isscalar(size):
npix = np.cast[int]([size/pixscale, size/pixsca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __make_header__(self):\n header = lashead.Header(point_format=0)\n return header",
"def to_header(wcs, relax=True):\n header = wcs.to_header(relax=relax)\n if hasattr(wcs, '_naxis1'):\n header['NAXIS'] = wcs.naxis\n header['NAXIS1'] = wcs._naxis1\n header['NAXIS2'] = ... | [
"0.7053945",
"0.6530175",
"0.6422884",
"0.63452524",
"0.6339763",
"0.6315265",
"0.6305137",
"0.6269222",
"0.6260864",
"0.6177266",
"0.6152206",
"0.6149178",
"0.6050981",
"0.6041264",
"0.60271686",
"0.6015387",
"0.6012876",
"0.5979148",
"0.5966145",
"0.5927436",
"0.5920981",
... | 0.65636235 | 1 |
Drizzle array data with associated wcs | def drizzle_array_groups(sci_list, wht_list, wcs_list, scale=0.1, kernel='point', pixfrac=1., verbose=True):
from drizzlepac.astrodrizzle import adrizzle
from stsci.tools import logutil
log = logutil.create_logger(__name__)
# Output header / WCS
header, outputwcs = compute_output_wcs(wcs_li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _lzw(self, tile: bytes) -> np.ndarray:\n decoded = self._reshape(np.frombuffer(imagecodecs.lzw_decode(tile), self.dtype))\n self._unpredict(decoded)\n return np.rollaxis(decoded, 2, 0)",
"def _indv_mem_wcslist(self):\n wcs_list = []\n\n for m in self.members:\n w... | [
"0.5998269",
"0.5742309",
"0.5636674",
"0.5599932",
"0.5567645",
"0.548629",
"0.54774475",
"0.54130304",
"0.5383681",
"0.53621554",
"0.5317225",
"0.5282212",
"0.5237968",
"0.51977015",
"0.51900077",
"0.5176413",
"0.51479614",
"0.5079774",
"0.5073192",
"0.50395447",
"0.5036647... | 0.585774 | 1 |
Compute output WCS that contains the full list of input WCS | def compute_output_wcs(wcs_list, pixel_scale=0.1, max_size=10000):
from shapely.geometry import Polygon
footprint = Polygon(wcs_list[0].calc_footprint())
for i in range(1, len(wcs_list)):
fp_i = Polygon(wcs_list[i].calc_footprint())
footprint = footprint.union(fp_i)
x, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def combined_wcs(self) -> BaseHighLevelWCS:",
"def make_output_wcs(input_models, pscale_ratio=1.0):\n wcslist = [i.meta.wcs for i in input_models]\n for w, i in zip(wcslist, input_models):\n if w.bounding_box is None:\n w.bounding_box = wcs_bbox_from_shape(i.data.shape)\n naxes = wcsli... | [
"0.6690976",
"0.62666726",
"0.611839",
"0.6066955",
"0.5770837",
"0.5763604",
"0.57466924",
"0.5737075",
"0.5592131",
"0.55116725",
"0.54982585",
"0.54630476",
"0.54343206",
"0.5424304",
"0.5404834",
"0.540401",
"0.53684354",
"0.53480315",
"0.53446597",
"0.53331274",
"0.53292... | 0.66113955 | 1 |
TBD Fetch necessary calibration files needed for running calwf3 from STScI FTP | def fetch_hst_calibs(flt_file, ftpdir='https://hst-crds.stsci.edu/unchecked_get/references/hst/', calib_types=['BPIXTAB', 'CCDTAB', 'OSCNTAB', 'CRREJTAB', 'DARKFILE', 'NLINFILE', 'PFLTFILE', 'IMPHTTAB', 'IDCTAB', 'NPOLFILE'], verbose=True):
import os
im = pyfits.open(flt_file)
if im[0].header['... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fetch_config_files(ACS=False):\n cwd = os.getcwd()\n \n print('Config directory: {0}/CONF'.format(os.getenv('GRIZLI')))\n \n os.chdir(os.path.join(os.getenv('GRIZLI'), 'CONF'))\n \n ftpdir = 'ftp://ftp.stsci.edu/cdbs/wfc3_aux/'\n tarfiles = ['{0}/WFC3.IR.G102.cal.V4.32.tar.gz'.format(ft... | [
"0.6708977",
"0.6315064",
"0.6193005",
"0.6140257",
"0.59149903",
"0.5767589",
"0.5741235",
"0.5736535",
"0.5707743",
"0.5634692",
"0.55581725",
"0.5539958",
"0.5490447",
"0.5489629",
"0.5464169",
"0.5438666",
"0.5415234",
"0.541029",
"0.5383154",
"0.53732395",
"0.5331585",
... | 0.6501715 | 1 |
Evaluate PSF at dx,dy coordinates TBD | def eval_ePSF(self, psf_xy, dx, dy, extended_data=None):
# So much faster than scipy.interpolate.griddata!
from scipy.ndimage.interpolation import map_coordinates
# ePSF only defined to 12.5 pixels
ok = (np.abs(dx) <= 12.5) & (np.abs(dy) <= 12.5)
coords = np.array([50+4*... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fs2ps2D(px, s):\n\t\tsfun = psarclength(px)\t\n\t\treturn sfun-s",
"def EvaluatePosition(self, , p_float=..., p_float=..., p_float=..., *args, **kwargs):\n ...",
"def sgfxy2p(s, N):\n x = sgf_coord.index(s[0])\n y = sgf_coord.index(s[1])\n\n p = rc2p(y + 1, x + 1, N)\n #print('x:{} y:{} ... | [
"0.6266068",
"0.60964245",
"0.60065013",
"0.59376395",
"0.59320134",
"0.5894716",
"0.58409303",
"0.5840905",
"0.5796013",
"0.5745288",
"0.5698731",
"0.5675599",
"0.5668839",
"0.56653845",
"0.5660228",
"0.5646253",
"0.5637478",
"0.5611441",
"0.5561778",
"0.5545343",
"0.5538557... | 0.6571531 | 0 |
Objective function for fitting ePSFs TBD params = [normalization, xc, yc, background] | def objective_epsf(params, self, psf_xy, sci, ivar, xp, yp, extended_data, ret):
dx = xp-params[1]
dy = yp-params[2]
ddx = xp-xp.min()
ddy = yp-yp.min()
ddx = ddx/ddx.max()
ddy = ddy/ddy.max()
psf_offset = self.eval_ePSF(psf_xy, dx, dy, extended_data=ex... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fit(self, x, y): \n # *** START CODE HERE ***\n y = y.reshape(y.shape[0], 1)\n y_0 = (1 - y).reshape(y.shape)\n m = y.shape[0]\n m_0 = np.asscalar(np.sum(y_0))\n m_1 = np.asscalar(np.sum(y))\n # Find phi, mu_0, mu_1, and sigma\n phi = np.sum(y) / m\n ... | [
"0.59548545",
"0.58927435",
"0.587909",
"0.5795295",
"0.5765725",
"0.5732857",
"0.57058656",
"0.56838477",
"0.5654238",
"0.5589921",
"0.5584145",
"0.5578832",
"0.5568349",
"0.55488914",
"0.5546996",
"0.5546996",
"0.5546996",
"0.5541382",
"0.5517577",
"0.5510937",
"0.55049056"... | 0.5949814 | 1 |
Parse column names for RA/Dec and set to `~astropy.units.degree` units if not already set | def parse_radec_columns(self, rd_pairs=None):
from collections import OrderedDict
import astropy.units as u
if rd_pairs is None:
rd_pairs = OrderedDict()
rd_pairs['ra'] = 'dec'
rd_pairs['ALPHA_J2000'] = 'DELTA_J2000'
rd_pairs['X_WORLD'] = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def fix_coord_units(cat, RA, DEC):\n cat[RA].info.unit = u.deg\n cat[DEC].info.unit = u.deg\n return cat",
"def parse_column_units(\n filepath: Path, sheet_name: str = None\n) -> Dict[str, ureg.Quantity]:\n method = map_input_method(filepath)\n unit_header = method(str(filepath), nrows=1, heade... | [
"0.61894846",
"0.57042384",
"0.5652417",
"0.52916104",
"0.5236946",
"0.5095183",
"0.5078325",
"0.50564945",
"0.50511265",
"0.504571",
"0.4983508",
"0.49827683",
"0.49799746",
"0.49452618",
"0.49286866",
"0.4923418",
"0.4911651",
"0.49081388",
"0.49059412",
"0.48693573",
"0.48... | 0.6671751 | 0 |
Compute `~astropy.coordinates.SkyCoord` projected matches between two `GTable` tables. | def match_to_catalog_sky(self, other, self_radec=None, other_radec=None):
from astropy.coordinates import SkyCoord
if self_radec is None:
rd = self.parse_radec_columns(self)
else:
rd = self.parse_radec_columns(self, rd_pairs={self_radec[0]:self_radec[1]})
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def query_and_match(coo, match_radius=1, columns=full_columns):\n from pyia import GaiaDataNew\n query = create_source_query_from(coo, columns=columns)\n gaia = GaiaDataNew.from_query(query)\n gcoo = SkyCoord(gaia.ra, gaia.dec)\n idx, d2d, _ = coo.match_to_catalog_sky(gcoo)\n iimatch = d2d.arcsec... | [
"0.64839524",
"0.56498295",
"0.54668623",
"0.5442664",
"0.5191807",
"0.5108136",
"0.5081041",
"0.50384295",
"0.5003137",
"0.4994864",
"0.4968268",
"0.49562576",
"0.49562",
"0.49473956",
"0.4943959",
"0.49232733",
"0.49200028",
"0.48976973",
"0.4878783",
"0.4874656",
"0.487048... | 0.58706856 | 1 |
Test if column elements "in" an iterable (e.g., a list of strings) | def column_values_in_list(col, test_list):
test = np.array([c_i in test_list for c_i in col])
return test | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def __contains__(self, item):\r\n if isinstance(item, six.string_types):\r\n return item in self.iternames()\r\n else:\r\n # let's assume we were given a column\r\n return item in self.iterall()",
"def is_in(elt, seq):\n\treturn any(x is elt for x in seq)",
"def i... | [
"0.7237073",
"0.65824205",
"0.6559596",
"0.6466056",
"0.64289176",
"0.62798744",
"0.6222516",
"0.6173602",
"0.61678326",
"0.61554897",
"0.6114213",
"0.6100592",
"0.6040192",
"0.60400015",
"0.6017045",
"0.5986568",
"0.59841007",
"0.59723645",
"0.5966105",
"0.5962353",
"0.59414... | 0.66550386 | 1 |
Make `fill_between` work like linestyle='stepsmid'. | def fill_between_steps(x, y0, y1, ax=None, *args, **kwargs):
so = np.argsort(x)
mid = x[so][:-1] + np.diff(x[so])/2.
xfull = np.append(np.append(x, mid), mid+np.diff(x[so])/1.e6)
y0full = np.append(np.append(y0, y0[:-1]), y0[1:])
y1full = np.append(np.append(y1, y1[:-1]), y1[1:])
so = np.ar... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def _apply_fill_between(\n self, *args, where=None, negpos=None, negcolor=None, poscolor=None,\n lw=None, linewidth=None, color=None, facecolor=None,\n stack=None, stacked=None, **kwargs\n):\n # Parse input arguments\n method = kwargs.pop('_method')\n name = method.__name__\n sx = 'y' if 'x' i... | [
"0.6194329",
"0.58404624",
"0.5823397",
"0.5787718",
"0.57874143",
"0.5727825",
"0.5601672",
"0.55796117",
"0.55512273",
"0.55089235",
"0.5491749",
"0.54865134",
"0.54784167",
"0.5439497",
"0.5357665",
"0.5329896",
"0.5281",
"0.52607465",
"0.52465767",
"0.51984173",
"0.518880... | 0.66050285 | 0 |
Fill a covariance matrix in a larger array that had masked values | def fill_masked_covar(covar, mask):
N = mask.shape[0]
idx = np.arange(N)[mask]
covar_full = np.zeros((N,N), dtype=covar.dtype)
for i, ii in enumerate(idx):
for j, jj in enumerate(idx):
covar_full[ii,jj] = covar[i,j]
return covar_full | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def applymask(self,mask):\n self.spec[mask==0]=np.nan",
"def build_cov_dataset(self):\n return self.ini_eeg_f[:, :, self.mask_tri].copy()",
"def nanvarc(array_data, axis=0):\n\n mdatreal = np.ma.masked_array(array_data.real, np.isnan(array_data.real));\n varreal = np.var(mdatreal, axis=axi... | [
"0.5916731",
"0.57886356",
"0.57143116",
"0.57047987",
"0.56604385",
"0.55519664",
"0.5545087",
"0.5541007",
"0.5476354",
"0.5475203",
"0.53900343",
"0.53813595",
"0.53199834",
"0.5319842",
"0.53146785",
"0.53098035",
"0.5231785",
"0.5231425",
"0.5226821",
"0.5222625",
"0.520... | 0.6901612 | 0 |
Make Alf + FSPS template | def make_alf_template():
import alf.alf
import fsps
ssp = alf.alf.Alf()
sp = fsps.StellarPopulation(zcontinuous=1)
sp.params['logzsol'] = 0.2
# Alf
m = ssp.get_model(in_place=False, logage=0.96, zh=0.2, mgh=0.2)
# FSPS
w, spec = sp.get_spectrum(tage=10**0.96, peraa=Tr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_to_pr_export(self, exp_template):",
"def vcf_template(alignments, fasta, info_dict, format_dict, model_dir, version):\n meta_1 = [\n \"##fileformat=VCFv4.2\",\n \"##filedate=\" + get_today(),\n \"##source=RNAIndelv\" + version,\n \"##reference=\" + fasta,\n '##FILTER... | [
"0.571407",
"0.56627667",
"0.54480946",
"0.5391545",
"0.53576493",
"0.53422505",
"0.5337591",
"0.5331988",
"0.5234191",
"0.5194609",
"0.5188689",
"0.51762736",
"0.51521665",
"0.51310354",
"0.511237",
"0.5111384",
"0.51056236",
"0.50959104",
"0.5086769",
"0.50837445",
"0.50487... | 0.764195 | 0 |
Custom context processor for assignments count. | def assignments_count(request):
count_assignments = 0
# check if current user is authenticated or not.
if request.user.is_authenticated:
try:
# get assignments count for students.
student = request.user.student
count_assignments = Assignment.objects.assignm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def context_counts(self, context):\n return (\n self.counts[len(context) + 1][context] if context else self.counts.unigrams\n )",
"def action_count(self):\n raise NotImplementedError",
"def set_count(c):\n global count\n count = c",
"def count(self):\n\n raise Not... | [
"0.5890687",
"0.5601878",
"0.55599153",
"0.5484178",
"0.542122",
"0.5409144",
"0.54088676",
"0.5402766",
"0.5359285",
"0.53588",
"0.5347469",
"0.5326645",
"0.5315804",
"0.5315451",
"0.5281957",
"0.5271463",
"0.5266362",
"0.52486414",
"0.5222963",
"0.52057874",
"0.5197582",
... | 0.63846594 | 0 |
Determine if there are other rules in the grammar containing this symbol as an element of a production | def isRoot(self):
for symbol in self.GlobalSymbolDict.values():
if(symbol == self):
continue
for production in symbol.productions:
if self in production.elements:
return False
return True | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def is_production_regular(prod):\r\n return len(prod.symbols) <= 2 and all(map(is_terminal, prod.symbols[:-1]))",
"def __contains__(self, o):\n # type: (Type[Nonterminal]) -> bool\n _NonterminalSet._control_nonterminal(o)\n return super().__contains__(o)",
"def is_regular(self):\r\n ... | [
"0.63558054",
"0.6116731",
"0.5814324",
"0.5736929",
"0.5707902",
"0.56743085",
"0.5565555",
"0.5497998",
"0.5493756",
"0.5471188",
"0.5469698",
"0.54357076",
"0.54003453",
"0.5351087",
"0.5338151",
"0.53185016",
"0.53031397",
"0.5293924",
"0.5284059",
"0.526398",
"0.52602243... | 0.6270909 | 1 |
If this symbol produces one or zero literals in all its productions, and all the expansions of the symbols in its productions, it's terminally equivalent. For terminally equivalent symbols, return a set of regular expressions so that every terminal this symbol can produce matches at least one of them. | def get_terminal_equivalent_regexes(self):
if self.is_gla or self.is_lit:
return self.regex
regexes = Set()
for production in self.productions:
elements = production.elements
if len(elements) > 1:
return None
elif len(elements) == 0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def endings(g, n):\n res = set()\n\n for prod in g.productions(n):\n if all(not is_nonterminal(item) for item in prod.rhs()):\n res.add(prod.rhs())",
"def free_symbols(self) -> set[Basic]:\n empty: set[Basic] = set()\n return empty.union(*(a.free_symbols for a in self.args))... | [
"0.58076394",
"0.57593113",
"0.56606656",
"0.561997",
"0.5592019",
"0.54924464",
"0.54066515",
"0.5339881",
"0.53377503",
"0.5333657",
"0.5329677",
"0.5216846",
"0.52072245",
"0.5196174",
"0.51555467",
"0.51342696",
"0.51281226",
"0.50944024",
"0.50706214",
"0.5051948",
"0.50... | 0.770482 | 0 |
Gets all of the contexts for this symbol within this production. Will look up at the context of the lhs of the production if necessary (in the case that there is no symbol to the left or right of this symbol in the production.) | def get_contexts_for_production(self,production,alreadySeen=()):
contexts=[]
alreadySeen = alreadySeen + ((self,production),)
elements = production.elements
for i in range(0,len(elements)):
if self == elements[i]:
if(len(elements) == 1): # the current producti... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_contexts(self,alreadySeen=()):\n contexts = []\n for lhs_symbol in self.GlobalSymbolDict.values():\n for production in lhs_symbol.productions:\n # You HAVE to pair the self with the production\n # because you may have seen this production, but have\n ... | [
"0.82437015",
"0.693126",
"0.6637329",
"0.6564408",
"0.6292905",
"0.6279406",
"0.62281567",
"0.61930466",
"0.6021821",
"0.59945995",
"0.5976115",
"0.5897208",
"0.58425915",
"0.5772522",
"0.5761522",
"0.5721338",
"0.56694216",
"0.56469065",
"0.5639653",
"0.5589881",
"0.5460926... | 0.7922801 | 1 |
Get a set of regexes matching the rightmost symbol in the complete expansion of this symbol. | def getRightRegexes(self):
return self.get_xmost_expansion_regexes(-1) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_xmost_expansion_regexes(self,direction,alreadySeen=()):\n xmost_regexes = Set()\n if self.get_terminal_equivalent_regexes() != None:\n return self.get_terminal_equivalent_regexes()\n for production in self.productions:\n elements = production.elements\n ... | [
"0.71593994",
"0.6983265",
"0.65677077",
"0.59534913",
"0.5775659",
"0.56973034",
"0.56156814",
"0.55609274",
"0.5523202",
"0.5421104",
"0.5393839",
"0.53901076",
"0.53149605",
"0.5312919",
"0.5310577",
"0.5294202",
"0.5282658",
"0.526588",
"0.5258793",
"0.52485317",
"0.52410... | 0.8143341 | 0 |
Get a set of regexes matching the leftmost symbol in the complete expansion of this symbol. | def getLeftRegexes(self):
return self.get_xmost_expansion_regexes(0) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def getRightRegexes(self):\n return self.get_xmost_expansion_regexes(-1)",
"def get_xmost_expansion_regexes(self,direction,alreadySeen=()):\n xmost_regexes = Set()\n if self.get_terminal_equivalent_regexes() != None:\n return self.get_terminal_equivalent_regexes()\n for pro... | [
"0.73142225",
"0.7121889",
"0.5902702",
"0.56433284",
"0.5445919",
"0.5441216",
"0.5427524",
"0.524531",
"0.5221194",
"0.52193326",
"0.5180444",
"0.5169028",
"0.51615506",
"0.5124692",
"0.51234084",
"0.5096742",
"0.50911814",
"0.5068668",
"0.50525224",
"0.50039166",
"0.499190... | 0.8371362 | 0 |
Computing stabilized sinkhorn over log domain with acceleration. Adapted from "SCALING ALGORITHMS FOR UNBALANCED OPTIMAL TRANSPORT PROBLEMS" by Chizat et al, 2017 | def sinkhorn_log(mu,nu,c,epsilon,
options={'niter':1000, 'tau':-0.5, 'rho':np.inf}):
for key,val in zip(['tau','rho','niter'],[-.5,np.inf,500]):
options.setdefault(key, val)
rho,tau,niter = options['rho'],options['tau'],options['niter']
lam = rho/(rho+epsilon)
if rho==np.inf:... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_double_ended_wls_fix_gamma_estimate_synthetic():\n from dtscalibration import DataStore\n\n cable_len = 100.0\n nt = 500\n time = np.arange(nt)\n x = np.linspace(0.0, cable_len, 100)\n ts_cold = np.ones(nt) * 4.0\n ts_warm = np.ones(nt) * 20.0\n\n C_p = 15246\n C_m = 2400.0\n ... | [
"0.62608474",
"0.62025493",
"0.6157312",
"0.61570984",
"0.60472107",
"0.60395",
"0.6029113",
"0.60195524",
"0.60055786",
"0.5984837",
"0.59612614",
"0.59607565",
"0.5957195",
"0.5924482",
"0.58964074",
"0.5857631",
"0.5801",
"0.57985365",
"0.5761254",
"0.57581896",
"0.5718602... | 0.6295303 | 0 |
Returns the vocabulary ID of the word argument If the word is not in the vocabulary, it is added | def getVocabID(word):
return str(vocabulary[word]) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def word_to_id(self, word):\r\n if word in self._vocab:\r\n return self._vocab[word]\r\n else:\r\n return self._unk_id",
"def word_to_id(vocab, unk_id, word):\n if word in vocab:\n return vocab[word]\n else:\n return unk_id",
"def _add_new_word(self, word):\n if w... | [
"0.7652051",
"0.75911736",
"0.7182673",
"0.7134602",
"0.7083004",
"0.70689493",
"0.70547587",
"0.70503885",
"0.6916971",
"0.6653913",
"0.6618128",
"0.65741044",
"0.6569239",
"0.65363044",
"0.6474226",
"0.6474226",
"0.6433574",
"0.6410126",
"0.6351854",
"0.6268062",
"0.6255719... | 0.8102371 | 0 |
Add a link with named two interfaces | def addLinkNamedIfce(self, src, dst, *args, **kwargs):
self.addLink(src, dst,
intfName1="-".join((src, dst)),
intfName2="-".join((dst, src)),
* args, **kwargs
) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_link (self, src, dst):\n raise NotImplementedError",
"def add_link(self, link):\n raise NotImplementedError",
"def linkTo( self, node2, port1=None, port2=None ):\n node1 = self\n if port1 is None:\n port1 = node1.newPort()\n if port2 is None:\n port2... | [
"0.6932805",
"0.6485061",
"0.6399633",
"0.6372239",
"0.62786704",
"0.6268114",
"0.6255924",
"0.61529845",
"0.5978085",
"0.59374326",
"0.59199464",
"0.5912764",
"0.5856737",
"0.5854061",
"0.58525485",
"0.5814454",
"0.5812263",
"0.58030677",
"0.5793622",
"0.5780555",
"0.5780325... | 0.7233077 | 0 |
Get the openflow port based on iterface name | def get_ofport(ifce):
return check_output(
split("sudo ovs-vsctl get Interface {} ofport".format(ifce))) | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def port(name):\n\n words = name.upper().split('-', 1)\n\n if len(words) == 1:\n words.append(words[0][1])\n\n return int(f\"{ord(words[0][0])}{ord(words[1][0])}\")",
"def _get_port(self):\n return self.__port",
"def port(self) -> int:",
"def get_open_port():\n sock = so... | [
"0.67765176",
"0.6712063",
"0.6656538",
"0.6638921",
"0.6608906",
"0.65795124",
"0.6571486",
"0.6558359",
"0.6558359",
"0.6528659",
"0.64942056",
"0.6456683",
"0.64541733",
"0.6418182",
"0.6386513",
"0.6385661",
"0.6373097",
"0.6373097",
"0.6373097",
"0.6373097",
"0.6373097",... | 0.6969255 | 0 |
Add Third Party Platform Credential (AddThirdPartyLoginPlatformCredentialV3) This is the API to Add 3rd Platform Credential. | def add_third_party_login_platform_credential_v3(
body: ModelThirdPartyLoginPlatformCredentialRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def add_third_party_login_platform_credential_v3_async(\n body: ModelThirdPartyLoginPlatformCredentialRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = g... | [
"0.8421494",
"0.7545012",
"0.7361114",
"0.69771963",
"0.6825711",
"0.66966546",
"0.6606758",
"0.66062313",
"0.65634036",
"0.62986004",
"0.6267107",
"0.59440714",
"0.58668923",
"0.56752837",
"0.5521856",
"0.5485606",
"0.5394016",
"0.5020205",
"0.4924328",
"0.47864103",
"0.4699... | 0.8599631 | 0 |
Add Third Party Platform Credential (AddThirdPartyLoginPlatformCredentialV3) This is the API to Add 3rd Platform Credential. | async def add_third_party_login_platform_credential_v3_async(
body: ModelThirdPartyLoginPlatformCredentialRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def add_third_party_login_platform_credential_v3(\n body: ModelThirdPartyLoginPlatformCredentialRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_... | [
"0.85997236",
"0.754399",
"0.73599786",
"0.69758165",
"0.68239",
"0.66953164",
"0.6605864",
"0.66050506",
"0.65616983",
"0.62974393",
"0.62662315",
"0.5943458",
"0.58665186",
"0.56746477",
"0.55209976",
"0.54858255",
"0.5393689",
"0.50193065",
"0.49230534",
"0.47863647",
"0.4... | 0.8421404 | 1 |
Delete Third Party Platform Credential (DeleteThirdPartyLoginPlatformCredentialV3) | def delete_third_party_login_platform_credential_v3(
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def delete_third_party_login_platform_credential_v3_async(\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ... | [
"0.76813275",
"0.7377684",
"0.68917674",
"0.6787013",
"0.64769965",
"0.63108146",
"0.6307383",
"0.62955153",
"0.628247",
"0.6266506",
"0.6195117",
"0.61584795",
"0.60772866",
"0.60695416",
"0.60690224",
"0.60399723",
"0.6029687",
"0.5867777",
"0.58151364",
"0.5793832",
"0.579... | 0.7896419 | 0 |
Delete Third Party Platform Credential (DeleteThirdPartyLoginPlatformCredentialV3) | async def delete_third_party_login_platform_credential_v3_async(
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_third_party_login_platform_credential_v3(\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None... | [
"0.7896496",
"0.7378148",
"0.689317",
"0.67882323",
"0.6477846",
"0.63117623",
"0.63076186",
"0.62970763",
"0.6283002",
"0.62670445",
"0.61955744",
"0.6159267",
"0.6077576",
"0.60703504",
"0.6068842",
"0.6041126",
"0.60296017",
"0.58669084",
"0.5814675",
"0.57939595",
"0.5792... | 0.76819044 | 1 |
Unregister Third Party Platform Credential's domain (DeleteThirdPartyLoginPlatformDomainV3) This is the API to unregister 3rd Platform domain. | def delete_third_party_login_platform_domain_v3(
body: ModelPlatformDomainDeleteRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def delete_third_party_login_platform_domain_v3_async(\n body: ModelPlatformDomainDeleteRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_na... | [
"0.70707345",
"0.6288866",
"0.5993803",
"0.57031727",
"0.5630144",
"0.5503238",
"0.54252756",
"0.539336",
"0.5381968",
"0.53584284",
"0.5339856",
"0.5239202",
"0.521882",
"0.5002577",
"0.48815748",
"0.4848027",
"0.47958577",
"0.47744533",
"0.46098983",
"0.45848212",
"0.452784... | 0.72705233 | 0 |
Unregister Third Party Platform Credential's domain (DeleteThirdPartyLoginPlatformDomainV3) This is the API to unregister 3rd Platform domain. | async def delete_third_party_login_platform_domain_v3_async(
body: ModelPlatformDomainDeleteRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete_third_party_login_platform_domain_v3(\n body: ModelPlatformDomainDeleteRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n ... | [
"0.7272087",
"0.62871784",
"0.5992254",
"0.57044977",
"0.56316066",
"0.5508236",
"0.54296935",
"0.53994876",
"0.5385129",
"0.5364575",
"0.53379023",
"0.5243262",
"0.5222625",
"0.50065273",
"0.48853555",
"0.48521715",
"0.4797548",
"0.4775157",
"0.46088138",
"0.45882672",
"0.45... | 0.70722866 | 1 |
Get Active OIDC Platform Credential By Client ID (RetrieveActiveOIDCClientsPublicV3) This is the Public API to Get All Active OIDC Platform Credential By Client ID | def retrieve_active_oidc_clients_public_v3(
client_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
request = Ret... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_all_active_third_party_login_platform_credential_public_v3(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, e... | [
"0.63874894",
"0.6279502",
"0.62568897",
"0.6130017",
"0.61057746",
"0.6089175",
"0.60385054",
"0.60253507",
"0.59560007",
"0.59274083",
"0.56851786",
"0.56680524",
"0.5667173",
"0.5667173",
"0.5667173",
"0.5665535",
"0.5611946",
"0.55531573",
"0.55341846",
"0.5531382",
"0.54... | 0.63867503 | 1 |
Get All Active Third Party Platform Active Credential for Public Usage (RetrieveAllActiveThirdPartyLoginPlatformCredentialPublicV3) This is the Public API to Get All Active 3rd Platform Credential. | def retrieve_all_active_third_party_login_platform_credential_public_v3(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
requ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def retrieve_all_active_third_party_login_platform_credential_public_v3_async(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n re... | [
"0.82078254",
"0.8064167",
"0.78715646",
"0.752673",
"0.7351573",
"0.64485025",
"0.5972793",
"0.5853242",
"0.57285434",
"0.5644998",
"0.55709416",
"0.54779637",
"0.54653996",
"0.54653996",
"0.54653996",
"0.5405369",
"0.5230386",
"0.5094451",
"0.50583166",
"0.5047825",
"0.5030... | 0.83577305 | 0 |
Get All Active Third Party Platform Active Credential for Public Usage (RetrieveAllActiveThirdPartyLoginPlatformCredentialPublicV3) This is the Public API to Get All Active 3rd Platform Credential. | async def retrieve_all_active_third_party_login_platform_credential_public_v3_async(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, er... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_all_active_third_party_login_platform_credential_public_v3(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, e... | [
"0.8358643",
"0.8064928",
"0.78723884",
"0.7528242",
"0.73530734",
"0.6449992",
"0.59738255",
"0.5855259",
"0.57294214",
"0.5646421",
"0.5571903",
"0.54784083",
"0.5466956",
"0.5466956",
"0.5466956",
"0.5405157",
"0.52327675",
"0.50942904",
"0.505969",
"0.5048515",
"0.5031072... | 0.8208803 | 1 |
Get All Active Third Party Platform Active Credential (RetrieveAllActiveThirdPartyLoginPlatformCredentialV3) | def retrieve_all_active_third_party_login_platform_credential_v3(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
request = R... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def retrieve_all_active_third_party_login_platform_credential_v3_async(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return No... | [
"0.77651715",
"0.7400081",
"0.7272379",
"0.7094292",
"0.7092316",
"0.6985664",
"0.62268925",
"0.6199885",
"0.6186397",
"0.6147448",
"0.58864164",
"0.5874004",
"0.5835918",
"0.58041525",
"0.58041525",
"0.58041525",
"0.5792582",
"0.5671989",
"0.5648651",
"0.55597544",
"0.550218... | 0.79043734 | 0 |
Get All Active Third Party Platform Active Credential (RetrieveAllActiveThirdPartyLoginPlatformCredentialV3) | async def retrieve_all_active_third_party_login_platform_credential_v3_async(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_all_active_third_party_login_platform_credential_v3(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, error\n ... | [
"0.7904713",
"0.7400626",
"0.72730684",
"0.70941633",
"0.7093008",
"0.69856644",
"0.62273407",
"0.6201955",
"0.6187022",
"0.61485744",
"0.58865213",
"0.58755916",
"0.5837602",
"0.58055735",
"0.58055735",
"0.58055735",
"0.579374",
"0.5672846",
"0.5649455",
"0.55611914",
"0.550... | 0.77656686 | 1 |
Get All Third Party Platform Credential (RetrieveAllThirdPartyLoginPlatformCredentialV3) | def retrieve_all_third_party_login_platform_credential_v3(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
request = Retrieve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def retrieve_all_third_party_login_platform_credential_v3_async(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, err... | [
"0.807427",
"0.80063605",
"0.78745925",
"0.722432",
"0.7137676",
"0.66351444",
"0.6315544",
"0.6238624",
"0.61886257",
"0.59974205",
"0.5891693",
"0.5839668",
"0.5716044",
"0.56451696",
"0.56320995",
"0.56262124",
"0.5529142",
"0.55000377",
"0.547563",
"0.54624695",
"0.544581... | 0.8241854 | 0 |
Get All Third Party Platform Credential (RetrieveAllThirdPartyLoginPlatformCredentialV3) | async def retrieve_all_third_party_login_platform_credential_v3_async(
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
reques... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_all_third_party_login_platform_credential_v3(\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return None, error\n requ... | [
"0.8241854",
"0.80063605",
"0.78745925",
"0.722432",
"0.7137676",
"0.66351444",
"0.6315544",
"0.6238624",
"0.61886257",
"0.59974205",
"0.5891693",
"0.5839668",
"0.5716044",
"0.56451696",
"0.56320995",
"0.56262124",
"0.5529142",
"0.55000377",
"0.547563",
"0.54624695",
"0.54458... | 0.807427 | 1 |
Retrieve Third Party Platform Credential (RetrieveThirdPartyLoginPlatformCredentialV3) | def retrieve_third_party_login_platform_credential_v3(
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None, error
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def retrieve_third_party_login_platform_credential_v3_async(\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n ... | [
"0.755441",
"0.69176805",
"0.67899233",
"0.66421485",
"0.65420425",
"0.629104",
"0.6066667",
"0.6026432",
"0.60145533",
"0.60044223",
"0.6001326",
"0.59767616",
"0.5953303",
"0.5915786",
"0.5871005",
"0.58497584",
"0.5832627",
"0.5818731",
"0.58004564",
"0.5784197",
"0.576999... | 0.78218895 | 0 |
Retrieve Third Party Platform Credential (RetrieveThirdPartyLoginPlatformCredentialV3) | async def retrieve_third_party_login_platform_credential_v3_async(
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if error:
return None... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def retrieve_third_party_login_platform_credential_v3(\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n if error:\n return No... | [
"0.78208065",
"0.6918093",
"0.67903453",
"0.6642514",
"0.65424734",
"0.62904996",
"0.60662",
"0.6027024",
"0.60148066",
"0.60036063",
"0.6000883",
"0.59766537",
"0.595401",
"0.5915515",
"0.58706456",
"0.5849183",
"0.5831824",
"0.58184814",
"0.5799919",
"0.57833844",
"0.57699"... | 0.7553558 | 1 |
Update Third Party Platform Credential (UpdateThirdPartyLoginPlatformCredentialV3) This is the API to Add 3rd Platform Credential. | def update_third_party_login_platform_credential_v3(
body: ModelThirdPartyLoginPlatformCredentialRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def update_third_party_login_platform_credential_v3_async(\n body: ModelThirdPartyLoginPlatformCredentialRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error ... | [
"0.8467939",
"0.7581231",
"0.73586327",
"0.6818736",
"0.6679118",
"0.66381913",
"0.65337265",
"0.650118",
"0.63141036",
"0.5895355",
"0.58058333",
"0.56191736",
"0.55858094",
"0.55481136",
"0.5434486",
"0.5328526",
"0.5223417",
"0.519984",
"0.51870733",
"0.5032881",
"0.501319... | 0.8676103 | 0 |
Update Third Party Platform Credential (UpdateThirdPartyLoginPlatformCredentialV3) This is the API to Add 3rd Platform Credential. | async def update_third_party_login_platform_credential_v3_async(
body: ModelThirdPartyLoginPlatformCredentialRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_service... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_third_party_login_platform_credential_v3(\n body: ModelThirdPartyLoginPlatformCredentialRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_servic... | [
"0.867672",
"0.758148",
"0.7358639",
"0.6820058",
"0.66786355",
"0.6639284",
"0.6532846",
"0.65007085",
"0.6313165",
"0.5893092",
"0.5803391",
"0.5617062",
"0.55863774",
"0.55458236",
"0.54350954",
"0.5327221",
"0.52229965",
"0.51974803",
"0.51845354",
"0.5034113",
"0.5013304... | 0.84682876 | 1 |
Set Third Party Platform Credential's domain (UpdateThirdPartyLoginPlatformDomainV3) This is the API to set 3rd Platform domain. | def update_third_party_login_platform_domain_v3(
body: ModelPlatformDomainUpdateRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
if erro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async def update_third_party_login_platform_domain_v3_async(\n body: ModelPlatformDomainUpdateRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_na... | [
"0.7676851",
"0.6580459",
"0.64069116",
"0.63766915",
"0.62417215",
"0.6015453",
"0.56360114",
"0.5553909",
"0.5543924",
"0.5523618",
"0.55134267",
"0.537943",
"0.5337137",
"0.53331316",
"0.53331316",
"0.52365506",
"0.51966155",
"0.51966155",
"0.513452",
"0.51176053",
"0.5109... | 0.78225636 | 0 |
Set Third Party Platform Credential's domain (UpdateThirdPartyLoginPlatformDomainV3) This is the API to set 3rd Platform domain. | async def update_third_party_login_platform_domain_v3_async(
body: ModelPlatformDomainUpdateRequest,
platform_id: str,
namespace: Optional[str] = None,
x_additional_headers: Optional[Dict[str, str]] = None,
**kwargs
):
if namespace is None:
namespace, error = get_services_namespace()
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_third_party_login_platform_domain_v3(\n body: ModelPlatformDomainUpdateRequest,\n platform_id: str,\n namespace: Optional[str] = None,\n x_additional_headers: Optional[Dict[str, str]] = None,\n **kwargs\n):\n if namespace is None:\n namespace, error = get_services_namespace()\n ... | [
"0.78238827",
"0.6583972",
"0.6406462",
"0.6380729",
"0.6241837",
"0.60155755",
"0.56386477",
"0.5552521",
"0.55415493",
"0.5521816",
"0.55112517",
"0.53826034",
"0.53357047",
"0.5331028",
"0.5331028",
"0.52341604",
"0.51944804",
"0.51944804",
"0.51344264",
"0.51164156",
"0.5... | 0.7678748 | 1 |
Extracts the time sequential water level in the specified basin from swmm model and write it to a csv file. | def extract_basin_wl(swmm_inputfile, basin_id, time_step, csv_file_basename):
time_series = []
water_depth = []
with Simulation(swmm_inputfile) as sim:
su = Nodes(sim)[basin_id]
sim.step_advance(time_step)
for step in sim:
time_series.append(sim.current_time)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def export_data(self):\r\n \r\n \r\n output_file = 'export.csv'\r\n data = self.get_raw_data()\r\n \r\n if data != []:\r\n print('Writing to file', output_file)\r\n with open(output_file, 'w',) as csvfile:\r\n fluorescence_levels = csv.... | [
"0.5531487",
"0.5493261",
"0.53233045",
"0.53185743",
"0.5215056",
"0.51799726",
"0.51706505",
"0.5162671",
"0.51359594",
"0.5101726",
"0.5081368",
"0.5057722",
"0.50205237",
"0.5010379",
"0.49924266",
"0.49881124",
"0.4981162",
"0.49693727",
"0.4965886",
"0.49465442",
"0.494... | 0.7695444 | 0 |
Insert the provided rain data file path into the swmm model. | def insert_rain_data_file_path(swmm_inputfile, rain_data_file):
with open(swmm_inputfile, "r+") as f:
file_content = f.read()
new_line = "long_term_rainfallgauge5061 FILE \"" + rain_data_file + "\""
file_content = re.sub(r"long_term_rainfallgauge5061 FILE \"[^\"]*\"", new_line,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def addFile(self, path):\n self._model.insertFile(path)",
"def __insert_modify_data_file(self, path, update_data = None, method = None):\n #First we copy the data page file to a temp file if the data page file exists\n temp_path = path + '.temp'\n piece_size = 512 # 512 bytes at a tim... | [
"0.57351565",
"0.52974737",
"0.51927006",
"0.5167218",
"0.5142628",
"0.5121303",
"0.5103312",
"0.50816256",
"0.5075919",
"0.5070616",
"0.5067605",
"0.5061986",
"0.5042472",
"0.5037231",
"0.50081307",
"0.49867168",
"0.49379036",
"0.49343234",
"0.49273467",
"0.48889822",
"0.486... | 0.7049009 | 0 |
Checks whether the option exists and is set. By set, it means whether the option has length. All the option values are strings. | def isset(cls,name):
inst = cls.inst()
if name in inst.options and \
len(inst.options[name]) > 0:
return True
else:
return False | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def has_option(self, key):\n\n return key in self.__opt",
"def cmd_has_option(self, executable, search_option, arg=None):\n if not executable:\n return False\n arg_list = []\n if arg and is_genstr(arg):\n arg_list = [arg]\n elif isinstance(arg, list):\n ... | [
"0.6767008",
"0.65435916",
"0.64932984",
"0.64729404",
"0.639705",
"0.63537467",
"0.63436705",
"0.6281091",
"0.6248929",
"0.62403876",
"0.62034166",
"0.6151544",
"0.6106507",
"0.6028073",
"0.6026179",
"0.60239244",
"0.5998859",
"0.5950932",
"0.5938954",
"0.59149677",
"0.59009... | 0.7168316 | 0 |
Runs policy iteration. You should call the policy_evaluation() and policy_improvement() methods to implement this method. | def policy_iteration(P, nS, nA, policy, gamma=0.9, tol=1e-8):
new_policy_iter = policy.copy()
############################
# YOUR IMPLEMENTATION HERE #
while True:
current_policy=new_policy_iter.copy()
Val_iter = policy_evaluation(P, nS, nA, new_policy_iter, gamma=0.9, tol=1e-8)
new_polic... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def policyIteration(P,R,gamma,theta,initial_policy,max_iter=1000000):\n policy_stable = False\n policy = np.copy(initial_policy)\n num_iter = 0\n \n while (not policy_stable) and num_iter < max_iter:\n num_iter += 1\n print('Policy Iteration: ', num_iter)\n # policy evaluation\n... | [
"0.72770274",
"0.6966099",
"0.69478893",
"0.68453646",
"0.64673454",
"0.6463884",
"0.64408743",
"0.6357283",
"0.6322446",
"0.6319925",
"0.6294502",
"0.62867415",
"0.6274515",
"0.62729496",
"0.62691873",
"0.6260339",
"0.6258248",
"0.62190104",
"0.62040496",
"0.6177333",
"0.617... | 0.697538 | 1 |
Sets a given topic to the given raw Twiki markup. | def set_topic(self,topic_path,topic_text):
params = {'username': self.settings['auth']['username'],
'password': self.settings['auth']['password']}
# -- Grab the crypttoken by editing the page but doing nothing.
twiki_cgi = "{:s}/bin/edit/{:s}".format(self.url,topic_path)
response =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def topic(self, topic: str):\n if topic is None:\n raise ValueError(\"Invalid value for `topic`, must not be `None`\") # noqa: E501\n\n self._topic = topic",
"def SetTopic(host, change, topic):\n path = '%s/topic' % _GetChangePath(change)\n body = {'topic': topic}\n return FetchUrlJs... | [
"0.6441221",
"0.64019316",
"0.61368185",
"0.6094035",
"0.5900604",
"0.5578918",
"0.5497284",
"0.5465255",
"0.53616834",
"0.53287494",
"0.5294307",
"0.52222306",
"0.52221173",
"0.5202569",
"0.51856244",
"0.51736116",
"0.5168435",
"0.51663977",
"0.51432836",
"0.5131316",
"0.511... | 0.6862753 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.