body stringlengths 26 98.2k | body_hash int64 -9,222,864,604,528,158,000 9,221,803,474B | docstring stringlengths 1 16.8k | path stringlengths 5 230 | name stringlengths 1 96 | repository_name stringlengths 7 89 | lang stringclasses 1
value | body_without_docstring stringlengths 20 98.2k |
|---|---|---|---|---|---|---|---|
def download_file(url, filename, sourceiss3bucket=None):
'\nDownload the file from `url` and save it locally under `filename`.\n :rtype : bool\n :param url:\n :param filename:\n :param sourceiss3bucket:\n '
conn = None
if sourceiss3bucket:
bucket_name = url.split('/')[3]
key_n... | -3,808,279,429,678,038,000 | Download the file from `url` and save it locally under `filename`.
:rtype : bool
:param url:
:param filename:
:param sourceiss3bucket: | MasterScripts/systemprep-linuxmaster.py | download_file | plus3it/SystemPrep | python | def download_file(url, filename, sourceiss3bucket=None):
'\nDownload the file from `url` and save it locally under `filename`.\n :rtype : bool\n :param url:\n :param filename:\n :param sourceiss3bucket:\n '
conn = None
if sourceiss3bucket:
bucket_name = url.split('/')[3]
key_n... |
def cleanup(workingdir):
'\n Removes temporary files loaded to the system.\n :param workingdir: str, Path to the working directory\n :return: bool\n '
print(('+-' * 40))
print('Cleanup Time...')
try:
shutil.rmtree(workingdir)
except Exception as exc:
raise SystemError('Cl... | 3,193,561,795,270,635,500 | Removes temporary files loaded to the system.
:param workingdir: str, Path to the working directory
:return: bool | MasterScripts/systemprep-linuxmaster.py | cleanup | plus3it/SystemPrep | python | def cleanup(workingdir):
'\n Removes temporary files loaded to the system.\n :param workingdir: str, Path to the working directory\n :return: bool\n '
print(('+-' * 40))
print('Cleanup Time...')
try:
shutil.rmtree(workingdir)
except Exception as exc:
raise SystemError('Cl... |
def main(noreboot='false', **kwargs):
'\n Master script that calls content scripts to be deployed when provisioning systems\n '
scriptname = ''
if ('__file__' in dir()):
scriptname = os.path.abspath(__file__)
else:
scriptname = os.path.abspath(sys.argv[0])
noreboot = ('true' ==... | 4,525,279,070,260,258,300 | Master script that calls content scripts to be deployed when provisioning systems | MasterScripts/systemprep-linuxmaster.py | main | plus3it/SystemPrep | python | def main(noreboot='false', **kwargs):
'\n \n '
scriptname =
if ('__file__' in dir()):
scriptname = os.path.abspath(__file__)
else:
scriptname = os.path.abspath(sys.argv[0])
noreboot = ('true' == noreboot.lower())
sourceiss3bucket = ('true' == kwargs.get('sourceiss3bucket',... |
def score(self, x, startprob, transmat):
'Log probability for a given data `x`.\n\n Attributes\n ----------\n x : ndarray\n Data to evaluate.\n %(_doc_default_callparams)s\n\n Returns\n -------\n log_prob : float\n The log probability of the dat... | -3,877,954,204,768,832,500 | Log probability for a given data `x`.
Attributes
----------
x : ndarray
Data to evaluate.
%(_doc_default_callparams)s
Returns
-------
log_prob : float
The log probability of the data. | mlpy/stats/models/_basic.py | score | evenmarbles/mlpy | python | def score(self, x, startprob, transmat):
'Log probability for a given data `x`.\n\n Attributes\n ----------\n x : ndarray\n Data to evaluate.\n %(_doc_default_callparams)s\n\n Returns\n -------\n log_prob : float\n The log probability of the dat... |
def sample(self, startprob, transmat, size=1):
'Sample from a Markov model.\n\n Attributes\n ----------\n size: int\n Defining number of sampled variates. Defaults to `1`.\n\n Returns\n -------\n vals: ndarray\n The sampled sequences of size (nseq, seq... | 4,241,172,080,405,026,000 | Sample from a Markov model.
Attributes
----------
size: int
Defining number of sampled variates. Defaults to `1`.
Returns
-------
vals: ndarray
The sampled sequences of size (nseq, seqlen). | mlpy/stats/models/_basic.py | sample | evenmarbles/mlpy | python | def sample(self, startprob, transmat, size=1):
'Sample from a Markov model.\n\n Attributes\n ----------\n size: int\n Defining number of sampled variates. Defaults to `1`.\n\n Returns\n -------\n vals: ndarray\n The sampled sequences of size (nseq, seq... |
def fit(self, x):
'Fit a Markov model from data via MLE or MAP.\n\n Attributes\n ----------\n x : ndarray[int]\n Observed data\n\n Returns\n -------\n %(_doc_default_callparams)s\n\n '
nstates = nunique(x.ravel())
pi_pseudo_counts = np.ones(nstates... | -6,525,996,465,640,089,000 | Fit a Markov model from data via MLE or MAP.
Attributes
----------
x : ndarray[int]
Observed data
Returns
-------
%(_doc_default_callparams)s | mlpy/stats/models/_basic.py | fit | evenmarbles/mlpy | python | def fit(self, x):
'Fit a Markov model from data via MLE or MAP.\n\n Attributes\n ----------\n x : ndarray[int]\n Observed data\n\n Returns\n -------\n %(_doc_default_callparams)s\n\n '
nstates = nunique(x.ravel())
pi_pseudo_counts = np.ones(nstates... |
def __init__(self, startprob, transmat):
'Create a "frozen" Markov model.\n\n Parameters\n ----------\n startprob : array_like\n Start probabilities\n transmat : array_like\n Transition matrix\n\n '
self._model = markov_gen()
self.startprob = startpro... | 2,096,330,718,006,145,000 | Create a "frozen" Markov model.
Parameters
----------
startprob : array_like
Start probabilities
transmat : array_like
Transition matrix | mlpy/stats/models/_basic.py | __init__ | evenmarbles/mlpy | python | def __init__(self, startprob, transmat):
'Create a "frozen" Markov model.\n\n Parameters\n ----------\n startprob : array_like\n Start probabilities\n transmat : array_like\n Transition matrix\n\n '
self._model = markov_gen()
self.startprob = startpro... |
@classmethod
def getInputSpecification(cls):
'\n Method to get a reference to a class that specifies the input data for\n class cls.\n @ Out, inputSpecification, InputData.ParameterInput, class to use for\n specifying input of cls.\n '
specs = super(PolynomialRegression, cls).getInputSp... | 6,709,305,341,692,526,000 | Method to get a reference to a class that specifies the input data for
class cls.
@ Out, inputSpecification, InputData.ParameterInput, class to use for
specifying input of cls. | framework/TSA/PolynomialRegression.py | getInputSpecification | archmagethanos/raven | python | @classmethod
def getInputSpecification(cls):
'\n Method to get a reference to a class that specifies the input data for\n class cls.\n @ Out, inputSpecification, InputData.ParameterInput, class to use for\n specifying input of cls.\n '
specs = super(PolynomialRegression, cls).getInputSp... |
def __init__(self, *args, **kwargs):
'\n A constructor that will appropriately intialize a supervised learning object\n @ In, args, list, an arbitrary list of positional values\n @ In, kwargs, dict, an arbitrary dictionary of keywords and values\n @ Out, None\n '
super().__init__(*args, *... | 1,282,056,979,279,828,700 | A constructor that will appropriately intialize a supervised learning object
@ In, args, list, an arbitrary list of positional values
@ In, kwargs, dict, an arbitrary dictionary of keywords and values
@ Out, None | framework/TSA/PolynomialRegression.py | __init__ | archmagethanos/raven | python | def __init__(self, *args, **kwargs):
'\n A constructor that will appropriately intialize a supervised learning object\n @ In, args, list, an arbitrary list of positional values\n @ In, kwargs, dict, an arbitrary dictionary of keywords and values\n @ Out, None\n '
super().__init__(*args, *... |
def handleInput(self, spec):
'\n Reads user inputs into this object.\n @ In, inp, InputData.InputParams, input specifications\n @ Out, settings, dict, initialization settings for this algorithm\n '
settings = super().handleInput(spec)
settings['degree'] = spec.findFirst('degree').value
... | 3,221,797,229,476,569,000 | Reads user inputs into this object.
@ In, inp, InputData.InputParams, input specifications
@ Out, settings, dict, initialization settings for this algorithm | framework/TSA/PolynomialRegression.py | handleInput | archmagethanos/raven | python | def handleInput(self, spec):
'\n Reads user inputs into this object.\n @ In, inp, InputData.InputParams, input specifications\n @ Out, settings, dict, initialization settings for this algorithm\n '
settings = super().handleInput(spec)
settings['degree'] = spec.findFirst('degree').value
... |
def characterize(self, signal, pivot, targets, settings):
'\n Determines the charactistics of the signal based on this algorithm.\n @ In, signal, np.ndarray, time series with dims [time, target]\n @ In, pivot, np.1darray, time-like parameter values\n @ In, targets, list(str), names of targets in... | -1,975,003,618,679,932,400 | Determines the charactistics of the signal based on this algorithm.
@ In, signal, np.ndarray, time series with dims [time, target]
@ In, pivot, np.1darray, time-like parameter values
@ In, targets, list(str), names of targets in same order as signal
@ In, settings, dict, additional settings specific to this algorithm
@... | framework/TSA/PolynomialRegression.py | characterize | archmagethanos/raven | python | def characterize(self, signal, pivot, targets, settings):
'\n Determines the charactistics of the signal based on this algorithm.\n @ In, signal, np.ndarray, time series with dims [time, target]\n @ In, pivot, np.1darray, time-like parameter values\n @ In, targets, list(str), names of targets in... |
def getParamNames(self, settings):
'\n Return list of expected variable names based on the parameters\n @ In, settings, dict, training parameters for this algorithm\n @ Out, names, list, string list of names\n '
names = []
for target in settings['target']:
base = f'{self.name}__{ta... | 1,502,671,060,607,642,000 | Return list of expected variable names based on the parameters
@ In, settings, dict, training parameters for this algorithm
@ Out, names, list, string list of names | framework/TSA/PolynomialRegression.py | getParamNames | archmagethanos/raven | python | def getParamNames(self, settings):
'\n Return list of expected variable names based on the parameters\n @ In, settings, dict, training parameters for this algorithm\n @ Out, names, list, string list of names\n '
names = []
for target in settings['target']:
base = f'{self.name}__{ta... |
def getParamsAsVars(self, params):
'\n Map characterization parameters into flattened variable format\n @ In, params, dict, trained parameters (as from characterize)\n @ Out, rlz, dict, realization-style response\n '
rlz = {}
for (target, info) in params.items():
base = f'{self.nam... | 5,117,106,150,454,316,000 | Map characterization parameters into flattened variable format
@ In, params, dict, trained parameters (as from characterize)
@ Out, rlz, dict, realization-style response | framework/TSA/PolynomialRegression.py | getParamsAsVars | archmagethanos/raven | python | def getParamsAsVars(self, params):
'\n Map characterization parameters into flattened variable format\n @ In, params, dict, trained parameters (as from characterize)\n @ Out, rlz, dict, realization-style response\n '
rlz = {}
for (target, info) in params.items():
base = f'{self.nam... |
def generate(self, params, pivot, settings):
'\n Generates a synthetic history from fitted parameters.\n @ In, params, dict, characterization such as otained from self.characterize()\n @ In, pivot, np.array(float), pivot parameter values\n @ In, settings, dict, additional settings specific to al... | 1,532,766,129,109,472,000 | Generates a synthetic history from fitted parameters.
@ In, params, dict, characterization such as otained from self.characterize()
@ In, pivot, np.array(float), pivot parameter values
@ In, settings, dict, additional settings specific to algorithm
@ Out, synthetic, np.array(float), synthetic estimated model signal | framework/TSA/PolynomialRegression.py | generate | archmagethanos/raven | python | def generate(self, params, pivot, settings):
'\n Generates a synthetic history from fitted parameters.\n @ In, params, dict, characterization such as otained from self.characterize()\n @ In, pivot, np.array(float), pivot parameter values\n @ In, settings, dict, additional settings specific to al... |
def writeXML(self, writeTo, params):
'\n Allows the engine to put whatever it wants into an XML to print to file.\n @ In, writeTo, xmlUtils.StaticXmlElement, entity to write to\n @ In, params, dict, trained parameters as from self.characterize\n @ Out, None\n '
for (target, info) in param... | 1,898,250,700,010,009,300 | Allows the engine to put whatever it wants into an XML to print to file.
@ In, writeTo, xmlUtils.StaticXmlElement, entity to write to
@ In, params, dict, trained parameters as from self.characterize
@ Out, None | framework/TSA/PolynomialRegression.py | writeXML | archmagethanos/raven | python | def writeXML(self, writeTo, params):
'\n Allows the engine to put whatever it wants into an XML to print to file.\n @ In, writeTo, xmlUtils.StaticXmlElement, entity to write to\n @ In, params, dict, trained parameters as from self.characterize\n @ Out, None\n '
for (target, info) in param... |
@pytest.fixture
def client(request):
'\n Definges the client object to make requests against\n '
(db_fd, app.APP.config['DATABASE']) = tempfile.mkstemp()
app.APP.config['TESTING'] = True
client = app.APP.test_client()
def teardown():
'\n Close the client once testing has comple... | -2,865,272,458,671,341,000 | Definges the client object to make requests against | tests/test_rest_file_region.py | client | Multiscale-Genomics/mg-rest-file | python | @pytest.fixture
def client(request):
'\n \n '
(db_fd, app.APP.config['DATABASE']) = tempfile.mkstemp()
app.APP.config['TESTING'] = True
client = app.APP.test_client()
def teardown():
'\n Close the client once testing has completed\n '
os.close(db_fd)
os.u... |
def test_region_meta(client):
'\n Test that the track endpoint is returning the usage paramerts\n '
rest_value = client.get('/mug/api/dmp/file/whole', headers=dict(Authorization='Authorization: Bearer teststring'))
details = json.loads(rest_value.data)
assert ('usage' in details) | 3,116,075,016,171,612,700 | Test that the track endpoint is returning the usage paramerts | tests/test_rest_file_region.py | test_region_meta | Multiscale-Genomics/mg-rest-file | python | def test_region_meta(client):
'\n \n '
rest_value = client.get('/mug/api/dmp/file/whole', headers=dict(Authorization='Authorization: Bearer teststring'))
details = json.loads(rest_value.data)
assert ('usage' in details) |
def test_region_file(client):
'\n Test that the track endpoint is returning the usage paramerts\n '
rest_value = client.get('/mug/api/dmp/file/region?file_id=testtest0000&chrom=19&start=3000000&end=3100000', headers=dict(Authorization='Authorization: Bearer teststring'))
assert (len(rest_value.data) >... | 5,789,364,442,130,801,000 | Test that the track endpoint is returning the usage paramerts | tests/test_rest_file_region.py | test_region_file | Multiscale-Genomics/mg-rest-file | python | def test_region_file(client):
'\n \n '
rest_value = client.get('/mug/api/dmp/file/region?file_id=testtest0000&chrom=19&start=3000000&end=3100000', headers=dict(Authorization='Authorization: Bearer teststring'))
assert (len(rest_value.data) > 0) |
def teardown():
'\n Close the client once testing has completed\n '
os.close(db_fd)
os.unlink(app.APP.config['DATABASE']) | -8,832,247,154,748,192,000 | Close the client once testing has completed | tests/test_rest_file_region.py | teardown | Multiscale-Genomics/mg-rest-file | python | def teardown():
'\n \n '
os.close(db_fd)
os.unlink(app.APP.config['DATABASE']) |
def build_model(model_name, num_features, num_classes):
'Hyper-parameters are determined by auto training, refer to grb.utils.trainer.AutoTrainer.'
if (model_name in ['gcn', 'gcn_ln', 'gcn_at', 'gcn_ln_at']):
from grb.model.torch import GCN
model = GCN(in_features=num_features, out_features=num_... | 6,690,898,841,103,739,000 | Hyper-parameters are determined by auto training, refer to grb.utils.trainer.AutoTrainer. | pipeline/configs/grb-citeseer/config.py | build_model | sigeisler/grb | python | def build_model(model_name, num_features, num_classes):
if (model_name in ['gcn', 'gcn_ln', 'gcn_at', 'gcn_ln_at']):
from grb.model.torch import GCN
model = GCN(in_features=num_features, out_features=num_classes, hidden_features=128, n_layers=3, layer_norm=(True if ('ln' in model_name) else Fal... |
def wrap(lower, upper, x):
'\n Circularly alias the numeric value x into the range [lower,upper).\n\n Valid for cyclic quantities like orientations or hues.\n '
axis_range = (upper - lower)
return (lower + (((x - lower) + ((2.0 * axis_range) * (1.0 - math.floor((x / (2.0 * axis_range)))))) % axis_r... | 630,713,999,419,601,900 | Circularly alias the numeric value x into the range [lower,upper).
Valid for cyclic quantities like orientations or hues. | featuremapper/distribution.py | wrap | fcr/featuremapper | python | def wrap(lower, upper, x):
'\n Circularly alias the numeric value x into the range [lower,upper).\n\n Valid for cyclic quantities like orientations or hues.\n '
axis_range = (upper - lower)
return (lower + (((x - lower) + ((2.0 * axis_range) * (1.0 - math.floor((x / (2.0 * axis_range)))))) % axis_r... |
def calc_theta(bins, axis_range):
'\n Convert a bin number to a direction in radians.\n\n Works for NumPy arrays of bin numbers, returning\n an array of directions.\n '
return np.exp(((((2.0 * np.pi) * bins) / axis_range) * 1j)) | 4,120,604,362,412,400,000 | Convert a bin number to a direction in radians.
Works for NumPy arrays of bin numbers, returning
an array of directions. | featuremapper/distribution.py | calc_theta | fcr/featuremapper | python | def calc_theta(bins, axis_range):
'\n Convert a bin number to a direction in radians.\n\n Works for NumPy arrays of bin numbers, returning\n an array of directions.\n '
return np.exp(((((2.0 * np.pi) * bins) / axis_range) * 1j)) |
def data(self):
'\n Answer a dictionary with bins as keys.\n '
return self._data | -4,481,491,216,808,856,600 | Answer a dictionary with bins as keys. | featuremapper/distribution.py | data | fcr/featuremapper | python | def data(self):
'\n \n '
return self._data |
def pop(self, feature_bin):
'\n Remove the entry with bin from the distribution.\n '
if (self._pop_store is not None):
raise Exception('Distribution: attempt to pop value before outstanding restore')
self._pop_store = self._data.pop(feature_bin)
self._keys = list(self._data.keys())... | -4,856,610,280,572,698,000 | Remove the entry with bin from the distribution. | featuremapper/distribution.py | pop | fcr/featuremapper | python | def pop(self, feature_bin):
'\n \n '
if (self._pop_store is not None):
raise Exception('Distribution: attempt to pop value before outstanding restore')
self._pop_store = self._data.pop(feature_bin)
self._keys = list(self._data.keys())
self._values = list(self._data.values()) |
def restore(self, feature_bin):
'\n Restore the entry with bin from the distribution.\n Only valid if called after a pop.\n '
if (self._pop_store is None):
raise Exception('Distribution: attempt to restore value before pop')
self._data[feature_bin] = self._pop_store
self._po... | 1,775,950,284,836,956,400 | Restore the entry with bin from the distribution.
Only valid if called after a pop. | featuremapper/distribution.py | restore | fcr/featuremapper | python | def restore(self, feature_bin):
'\n Restore the entry with bin from the distribution.\n Only valid if called after a pop.\n '
if (self._pop_store is None):
raise Exception('Distribution: attempt to restore value before pop')
self._data[feature_bin] = self._pop_store
self._po... |
def vector_sum(self):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n\n Each feature_bin contributes a vector of length equal to its value, at\n a direction corresponding to the feature_bin number. Specifically,\n the total feature_bin number range is ... | 6,490,668,294,525,124,000 | Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
Each feature_bin contributes a vector of length equal to its value, at
a direction corresponding to the feature_bin number. Specifically,
the total feature_bin number range is mapped into a direction range
[0,2pi].
For a cyclic distribution... | featuremapper/distribution.py | vector_sum | fcr/featuremapper | python | def vector_sum(self):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n\n Each feature_bin contributes a vector of length equal to its value, at\n a direction corresponding to the feature_bin number. Specifically,\n the total feature_bin number range is ... |
def _fast_vector_sum(self, values, theta):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n \n This implementation assumes that the values of the distribution needed for the \n vector sum will not be changed and depends on cached values.\n \n ... | -1,804,977,039,230,122,000 | Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
This implementation assumes that the values of the distribution needed for the
vector sum will not be changed and depends on cached values. | featuremapper/distribution.py | _fast_vector_sum | fcr/featuremapper | python | def _fast_vector_sum(self, values, theta):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n \n This implementation assumes that the values of the distribution needed for the \n vector sum will not be changed and depends on cached values.\n \n ... |
def get_value(self, feature_bin):
'\n Return the value of the specified feature_bin.\n\n (Return None if there is no such feature_bin.)\n '
return self._data.get(feature_bin) | -3,871,729,423,209,276,400 | Return the value of the specified feature_bin.
(Return None if there is no such feature_bin.) | featuremapper/distribution.py | get_value | fcr/featuremapper | python | def get_value(self, feature_bin):
'\n Return the value of the specified feature_bin.\n\n (Return None if there is no such feature_bin.)\n '
return self._data.get(feature_bin) |
def get_count(self, feature_bin):
'\n Return the count from the specified feature_bin.\n\n (Return None if there is no such feature_bin.)\n '
return self._counts.get(feature_bin) | 3,929,430,799,493,367,000 | Return the count from the specified feature_bin.
(Return None if there is no such feature_bin.) | featuremapper/distribution.py | get_count | fcr/featuremapper | python | def get_count(self, feature_bin):
'\n Return the count from the specified feature_bin.\n\n (Return None if there is no such feature_bin.)\n '
return self._counts.get(feature_bin) |
def values(self):
'\n Return a list of values.\n\n Various statistics can then be calculated if desired:\n\n sum(vals) (total of all values)\n max(vals) (highest value in any feature_bin)\n\n Note that the feature_bin-order of values returned does not necessarily\n ma... | 7,122,961,979,136,912,000 | Return a list of values.
Various statistics can then be calculated if desired:
sum(vals) (total of all values)
max(vals) (highest value in any feature_bin)
Note that the feature_bin-order of values returned does not necessarily
match that returned by counts(). | featuremapper/distribution.py | values | fcr/featuremapper | python | def values(self):
'\n Return a list of values.\n\n Various statistics can then be calculated if desired:\n\n sum(vals) (total of all values)\n max(vals) (highest value in any feature_bin)\n\n Note that the feature_bin-order of values returned does not necessarily\n ma... |
def counts(self):
'\n Return a list of values.\n\n Various statistics can then be calculated if desired:\n\n sum(counts) (total of all counts)\n max(counts) (highest count in any feature_bin)\n\n Note that the feature_bin-order of values returned does not necessarily\n ... | -577,602,815,931,901,200 | Return a list of values.
Various statistics can then be calculated if desired:
sum(counts) (total of all counts)
max(counts) (highest count in any feature_bin)
Note that the feature_bin-order of values returned does not necessarily
match that returned by values(). | featuremapper/distribution.py | counts | fcr/featuremapper | python | def counts(self):
'\n Return a list of values.\n\n Various statistics can then be calculated if desired:\n\n sum(counts) (total of all counts)\n max(counts) (highest count in any feature_bin)\n\n Note that the feature_bin-order of values returned does not necessarily\n ... |
def bins(self):
'\n Return a list of bins that have been populated.\n '
return self._keys | 8,935,579,620,609,360,000 | Return a list of bins that have been populated. | featuremapper/distribution.py | bins | fcr/featuremapper | python | def bins(self):
'\n \n '
return self._keys |
def sub_distr(self, distr):
'\n Subtract the given distribution from the current one.\n Only existing bins are modified, new bins in the given\n distribution are discarded without raising errors.\n\n Note that total_value and total_count are not affected, and\n keep_peak is ignore... | 786,399,384,776,559,700 | Subtract the given distribution from the current one.
Only existing bins are modified, new bins in the given
distribution are discarded without raising errors.
Note that total_value and total_count are not affected, and
keep_peak is ignored, therefore analysis relying on these
values should not call this method. | featuremapper/distribution.py | sub_distr | fcr/featuremapper | python | def sub_distr(self, distr):
'\n Subtract the given distribution from the current one.\n Only existing bins are modified, new bins in the given\n distribution are discarded without raising errors.\n\n Note that total_value and total_count are not affected, and\n keep_peak is ignore... |
def max_value_bin(self):
'\n Return the feature_bin with the largest value.\n \n Note that uses cached values so that pop and restore\n need to be used if want with altered distribution.\n '
return self._keys[np.argmax(self._values)] | 6,829,382,467,599,951,000 | Return the feature_bin with the largest value.
Note that uses cached values so that pop and restore
need to be used if want with altered distribution. | featuremapper/distribution.py | max_value_bin | fcr/featuremapper | python | def max_value_bin(self):
'\n Return the feature_bin with the largest value.\n \n Note that uses cached values so that pop and restore\n need to be used if want with altered distribution.\n '
return self._keys[np.argmax(self._values)] |
def weighted_sum(self):
'Return the sum of each value times its feature_bin.'
return np.inner(self._keys, self._values) | 3,106,585,788,290,091,500 | Return the sum of each value times its feature_bin. | featuremapper/distribution.py | weighted_sum | fcr/featuremapper | python | def weighted_sum(self):
return np.inner(self._keys, self._values) |
def value_mag(self, feature_bin):
'Return the value of a single feature_bin as a proportion of total_value.'
return self._safe_divide(self._data.get(feature_bin), self.total_value) | 3,479,951,534,854,595,600 | Return the value of a single feature_bin as a proportion of total_value. | featuremapper/distribution.py | value_mag | fcr/featuremapper | python | def value_mag(self, feature_bin):
return self._safe_divide(self._data.get(feature_bin), self.total_value) |
def count_mag(self, feature_bin):
'Return the count of a single feature_bin as a proportion of total_count.'
return self._safe_divide(float(self._counts.get(feature_bin)), float(self.total_count)) | -1,181,326,390,964,662,500 | Return the count of a single feature_bin as a proportion of total_count. | featuremapper/distribution.py | count_mag | fcr/featuremapper | python | def count_mag(self, feature_bin):
return self._safe_divide(float(self._counts.get(feature_bin)), float(self.total_count)) |
def _bins_to_radians(self, bin):
'\n Convert a bin number to a direction in radians.\n\n Works for NumPy arrays of bin numbers, returning\n an array of directions.\n '
return (((2 * np.pi) * bin) / self.axis_range) | 2,133,827,564,899,951,900 | Convert a bin number to a direction in radians.
Works for NumPy arrays of bin numbers, returning
an array of directions. | featuremapper/distribution.py | _bins_to_radians | fcr/featuremapper | python | def _bins_to_radians(self, bin):
'\n Convert a bin number to a direction in radians.\n\n Works for NumPy arrays of bin numbers, returning\n an array of directions.\n '
return (((2 * np.pi) * bin) / self.axis_range) |
def _radians_to_bins(self, direction):
'\n Convert a direction in radians into a feature_bin number.\n\n Works for NumPy arrays of direction, returning\n an array of feature_bin numbers.\n '
return ((direction * self.axis_range) / (2 * np.pi)) | -3,051,043,271,045,395,500 | Convert a direction in radians into a feature_bin number.
Works for NumPy arrays of direction, returning
an array of feature_bin numbers. | featuremapper/distribution.py | _radians_to_bins | fcr/featuremapper | python | def _radians_to_bins(self, direction):
'\n Convert a direction in radians into a feature_bin number.\n\n Works for NumPy arrays of direction, returning\n an array of feature_bin numbers.\n '
return ((direction * self.axis_range) / (2 * np.pi)) |
def _safe_divide(self, numerator, denominator):
'\n Division routine that avoids division-by-zero errors\n (returning zero in such cases) but keeps track of them\n for undefined_values().\n '
if (denominator == 0):
self.undefined_vals += 1
return 0
else:
r... | -4,667,346,801,391,625,000 | Division routine that avoids division-by-zero errors
(returning zero in such cases) but keeps track of them
for undefined_values(). | featuremapper/distribution.py | _safe_divide | fcr/featuremapper | python | def _safe_divide(self, numerator, denominator):
'\n Division routine that avoids division-by-zero errors\n (returning zero in such cases) but keeps track of them\n for undefined_values().\n '
if (denominator == 0):
self.undefined_vals += 1
return 0
else:
r... |
def __call__(self, distribution):
'\n Apply the distribution statistic function; must be implemented by subclasses.\n\n Subclasses sould be called with a Distribution as argument, return will be a\n dictionary, with Pref objects as values\n '
raise NotImplementedError | -1,237,814,911,082,698,200 | Apply the distribution statistic function; must be implemented by subclasses.
Subclasses sould be called with a Distribution as argument, return will be a
dictionary, with Pref objects as values | featuremapper/distribution.py | __call__ | fcr/featuremapper | python | def __call__(self, distribution):
'\n Apply the distribution statistic function; must be implemented by subclasses.\n\n Subclasses sould be called with a Distribution as argument, return will be a\n dictionary, with Pref objects as values\n '
raise NotImplementedError |
def vector_sum(self, d):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n\n Each bin contributes a vector of length equal to its value, at\n a direction corresponding to the bin number. Specifically,\n the total bin number range is mapped into a directi... | 6,010,283,714,036,825,000 | Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).
Each bin contributes a vector of length equal to its value, at
a direction corresponding to the bin number. Specifically,
the total bin number range is mapped into a direction range
[0,2pi].
For a cyclic distribution, the avgbinnum will be ... | featuremapper/distribution.py | vector_sum | fcr/featuremapper | python | def vector_sum(self, d):
'\n Return the vector sum of the distribution as a tuple (magnitude, avgbinnum).\n\n Each bin contributes a vector of length equal to its value, at\n a direction corresponding to the bin number. Specifically,\n the total bin number range is mapped into a directi... |
def _weighted_average(self, d):
'\n Return the weighted_sum divided by the sum of the values\n '
return d._safe_divide(d.weighted_sum(), sum(d.values())) | -7,139,313,861,122,571,000 | Return the weighted_sum divided by the sum of the values | featuremapper/distribution.py | _weighted_average | fcr/featuremapper | python | def _weighted_average(self, d):
'\n \n '
return d._safe_divide(d.weighted_sum(), sum(d.values())) |
def selectivity(self, d):
'\n Return a measure of the peakedness of the distribution. The\n calculation differs depending on whether this is a cyclic\n variable. For a cyclic variable, returns the magnitude of the\n vector_sum() divided by the sum_value() (see\n _vector_selectiv... | 2,468,232,232,889,291,300 | Return a measure of the peakedness of the distribution. The
calculation differs depending on whether this is a cyclic
variable. For a cyclic variable, returns the magnitude of the
vector_sum() divided by the sum_value() (see
_vector_selectivity for more details). For a non-cyclic
variable, returns the max_value_bin(... | featuremapper/distribution.py | selectivity | fcr/featuremapper | python | def selectivity(self, d):
'\n Return a measure of the peakedness of the distribution. The\n calculation differs depending on whether this is a cyclic\n variable. For a cyclic variable, returns the magnitude of the\n vector_sum() divided by the sum_value() (see\n _vector_selectiv... |
def _relative_selectivity(self, d):
'\n Return max_value_bin()) as a proportion of the sum_value().\n\n This quantity is a measure of how strongly the distribution is\n biased towards the max_value_bin(). For a smooth,\n single-lobed distribution with an inclusive, non-cyclic range,\n ... | -3,182,837,868,106,845,000 | Return max_value_bin()) as a proportion of the sum_value().
This quantity is a measure of how strongly the distribution is
biased towards the max_value_bin(). For a smooth,
single-lobed distribution with an inclusive, non-cyclic range,
this quantity is an analog to vector_selectivity. To be a
precise analog for arbi... | featuremapper/distribution.py | _relative_selectivity | fcr/featuremapper | python | def _relative_selectivity(self, d):
'\n Return max_value_bin()) as a proportion of the sum_value().\n\n This quantity is a measure of how strongly the distribution is\n biased towards the max_value_bin(). For a smooth,\n single-lobed distribution with an inclusive, non-cyclic range,\n ... |
def _vector_selectivity(self, d):
'\n Return the magnitude of the vector_sum() divided by the sum_value().\n\n This quantity is a vector-based measure of the peakedness of\n the distribution. If only a single feature_bin has a non-zero value(),\n the selectivity will be 1.0, and if all ... | -1,075,925,606,402,771,200 | Return the magnitude of the vector_sum() divided by the sum_value().
This quantity is a vector-based measure of the peakedness of
the distribution. If only a single feature_bin has a non-zero value(),
the selectivity will be 1.0, and if all bins have the same
value() then the selectivity will be 0.0. Other distribut... | featuremapper/distribution.py | _vector_selectivity | fcr/featuremapper | python | def _vector_selectivity(self, d):
'\n Return the magnitude of the vector_sum() divided by the sum_value().\n\n This quantity is a vector-based measure of the peakedness of\n the distribution. If only a single feature_bin has a non-zero value(),\n the selectivity will be 1.0, and if all ... |
def second_max_value_bin(self, d):
'\n Return the feature_bin with the second largest value.\n If there is one feature_bin only, return it. This is not a correct result,\n however it is practical for plotting compatibility, and it will not\n mistakenly be claimed as secondary maximum, by... | 5,669,550,611,112,714,000 | Return the feature_bin with the second largest value.
If there is one feature_bin only, return it. This is not a correct result,
however it is practical for plotting compatibility, and it will not
mistakenly be claimed as secondary maximum, by forcing its selectivity
to 0.0 | featuremapper/distribution.py | second_max_value_bin | fcr/featuremapper | python | def second_max_value_bin(self, d):
'\n Return the feature_bin with the second largest value.\n If there is one feature_bin only, return it. This is not a correct result,\n however it is practical for plotting compatibility, and it will not\n mistakenly be claimed as secondary maximum, by... |
def second_selectivity(self, d):
'\n Return the selectivity of the second largest value in the distribution.\n If there is one feature_bin only, the selectivity is 0, since there is no second\n peack at all, and this value is also used to discriminate the validity\n of second_max_value_b... | -4,364,512,480,252,476,000 | Return the selectivity of the second largest value in the distribution.
If there is one feature_bin only, the selectivity is 0, since there is no second
peack at all, and this value is also used to discriminate the validity
of second_max_value_bin()
Selectivity is computed in two ways depending on whether the variable ... | featuremapper/distribution.py | second_selectivity | fcr/featuremapper | python | def second_selectivity(self, d):
'\n Return the selectivity of the second largest value in the distribution.\n If there is one feature_bin only, the selectivity is 0, since there is no second\n peack at all, and this value is also used to discriminate the validity\n of second_max_value_b... |
def _relative_second_selectivity(self, d):
'\n Return the value of the second maximum as a proportion of the sum_value()\n see _relative_selectivity() for further details\n '
k = d.max_value_bin()
d.pop(k)
m = max(d.values())
d.restore(k)
proportion = d._safe_divide(m, sum(d... | -8,135,196,164,067,553,000 | Return the value of the second maximum as a proportion of the sum_value()
see _relative_selectivity() for further details | featuremapper/distribution.py | _relative_second_selectivity | fcr/featuremapper | python | def _relative_second_selectivity(self, d):
'\n Return the value of the second maximum as a proportion of the sum_value()\n see _relative_selectivity() for further details\n '
k = d.max_value_bin()
d.pop(k)
m = max(d.values())
d.restore(k)
proportion = d._safe_divide(m, sum(d... |
def _vector_second_selectivity(self, d):
'\n Return the magnitude of the vector_sum() of all bins excluding the\n maximum one, divided by the sum_value().\n see _vector_selectivity() for further details\n '
k = d.max_value_bin()
d.pop(k)
s = self.vector_sum(d)[0]
d.restor... | -8,547,644,693,540,583,000 | Return the magnitude of the vector_sum() of all bins excluding the
maximum one, divided by the sum_value().
see _vector_selectivity() for further details | featuremapper/distribution.py | _vector_second_selectivity | fcr/featuremapper | python | def _vector_second_selectivity(self, d):
'\n Return the magnitude of the vector_sum() of all bins excluding the\n maximum one, divided by the sum_value().\n see _vector_selectivity() for further details\n '
k = d.max_value_bin()
d.pop(k)
s = self.vector_sum(d)[0]
d.restor... |
def second_peak_bin(self, d):
"\n Return the feature_bin with the second peak in the distribution.\n Unlike second_max_value_bin(), it does not return a feature_bin which is the\n second largest value, if laying on a wing of the first peak, the second\n peak is returned only if the distr... | 3,829,011,528,027,905,000 | Return the feature_bin with the second peak in the distribution.
Unlike second_max_value_bin(), it does not return a feature_bin which is the
second largest value, if laying on a wing of the first peak, the second
peak is returned only if the distribution is truly multimodal. If it isn't,
return the first peak (for com... | featuremapper/distribution.py | second_peak_bin | fcr/featuremapper | python | def second_peak_bin(self, d):
"\n Return the feature_bin with the second peak in the distribution.\n Unlike second_max_value_bin(), it does not return a feature_bin which is the\n second largest value, if laying on a wing of the first peak, the second\n peak is returned only if the distr... |
def second_peak_selectivity(self, d):
'\n Return the selectivity of the second peak in the distribution.\n\n If the distribution has only one peak, return 0.0, and this value is\n also usefl to discriminate the validity of second_peak_bin()\n '
l = len(d.keys())
if (l <= 1):
... | 248,254,795,784,561,150 | Return the selectivity of the second peak in the distribution.
If the distribution has only one peak, return 0.0, and this value is
also usefl to discriminate the validity of second_peak_bin() | featuremapper/distribution.py | second_peak_selectivity | fcr/featuremapper | python | def second_peak_selectivity(self, d):
'\n Return the selectivity of the second peak in the distribution.\n\n If the distribution has only one peak, return 0.0, and this value is\n also usefl to discriminate the validity of second_peak_bin()\n '
l = len(d.keys())
if (l <= 1):
... |
def second_peak(self, d):
'\n Return preference and selectivity of the second peak in the distribution.\n\n It is just the combination of second_peak_bin() and\n second_peak_selectivity(), with the advantage of avoiding a duplicate\n call of second_peak_bin(), if the user is interested i... | 2,059,865,115,646,842,600 | Return preference and selectivity of the second peak in the distribution.
It is just the combination of second_peak_bin() and
second_peak_selectivity(), with the advantage of avoiding a duplicate
call of second_peak_bin(), if the user is interested in both preference
and selectivity, as often is the case. | featuremapper/distribution.py | second_peak | fcr/featuremapper | python | def second_peak(self, d):
'\n Return preference and selectivity of the second peak in the distribution.\n\n It is just the combination of second_peak_bin() and\n second_peak_selectivity(), with the advantage of avoiding a duplicate\n call of second_peak_bin(), if the user is interested i... |
def _orth(self, t):
'\n Return the orthogonal orientation\n '
if (t < (0.5 * np.pi)):
return (t + (0.5 * np.pi))
return (t - (0.5 * np.pi)) | 3,040,861,717,531,347,500 | Return the orthogonal orientation | featuremapper/distribution.py | _orth | fcr/featuremapper | python | def _orth(self, t):
'\n \n '
if (t < (0.5 * np.pi)):
return (t + (0.5 * np.pi))
return (t - (0.5 * np.pi)) |
def _in_pi(self, t):
'\n Reduce orientation from -pi..2pi to 0..pi\n '
if (t > np.pi):
return (t - np.pi)
if (t < 0):
return (t + np.pi)
return t | 2,151,608,601,211,757,800 | Reduce orientation from -pi..2pi to 0..pi | featuremapper/distribution.py | _in_pi | fcr/featuremapper | python | def _in_pi(self, t):
'\n \n '
if (t > np.pi):
return (t - np.pi)
if (t < 0):
return (t + np.pi)
return t |
def von_mises(self, pars, x):
'\n Compute a simplified von Mises function.\n\n Original formulation in Richard von Mises, "Wahrscheinlichkeitsrechnung\n und ihre Anwendungen in der Statistik und theoretischen Physik", 1931,\n Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., " Dir... | 803,809,184,716,551,800 | Compute a simplified von Mises function.
Original formulation in Richard von Mises, "Wahrscheinlichkeitsrechnung
und ihre Anwendungen in der Statistik und theoretischen Physik", 1931,
Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., " Directional
Statistics", 1999, J. Wiley, p.36;
http://en.wikipedia.org/wiki/... | featuremapper/distribution.py | von_mises | fcr/featuremapper | python | def von_mises(self, pars, x):
'\n Compute a simplified von Mises function.\n\n Original formulation in Richard von Mises, "Wahrscheinlichkeitsrechnung\n und ihre Anwendungen in der Statistik und theoretischen Physik", 1931,\n Deuticke, Leipzig; see also Mardia, K.V. and Jupp, P.E., " Dir... |
def von2_mises(self, pars, x):
'\n Compute a simplified bimodal von Mises function\n\n Two superposed von Mises functions, with different peak and bandwith values\n '
p1 = pars[:3]
p2 = pars[3:]
return (self.von_mises(p1, x) + self.von_mises(p2, x)) | -2,769,227,981,127,466,500 | Compute a simplified bimodal von Mises function
Two superposed von Mises functions, with different peak and bandwith values | featuremapper/distribution.py | von2_mises | fcr/featuremapper | python | def von2_mises(self, pars, x):
'\n Compute a simplified bimodal von Mises function\n\n Two superposed von Mises functions, with different peak and bandwith values\n '
p1 = pars[:3]
p2 = pars[3:]
return (self.von_mises(p1, x) + self.von_mises(p2, x)) |
def fit_vm(self, distribution):
'\n computes the best fit of the monovariate von Mises function in the\n semi-circle.\n Return a tuple with the orientation preference, in the same range of\n axis_bounds, the orientation selectivity, and an estimate of the\n goodness-of-fit, as the... | -6,745,883,549,451,692,000 | computes the best fit of the monovariate von Mises function in the
semi-circle.
Return a tuple with the orientation preference, in the same range of
axis_bounds, the orientation selectivity, and an estimate of the
goodness-of-fit, as the variance of the predicted orientation
preference. The selectivity is given by the ... | featuremapper/distribution.py | fit_vm | fcr/featuremapper | python | def fit_vm(self, distribution):
'\n computes the best fit of the monovariate von Mises function in the\n semi-circle.\n Return a tuple with the orientation preference, in the same range of\n axis_bounds, the orientation selectivity, and an estimate of the\n goodness-of-fit, as the... |
def fit_v2m(self, distribution):
'\n computes the best fit of the bivariate von Mises function in the\n semi-circle.\n Return the tuple:\n (\n orientation1_preference, orientation1_selectivity, goodness_of_fit1,\n orientation2_preference, orientation2_selectivity, g... | 2,784,568,525,277,119,500 | computes the best fit of the bivariate von Mises function in the
semi-circle.
Return the tuple:
(
orientation1_preference, orientation1_selectivity, goodness_of_fit1,
orientation2_preference, orientation2_selectivity, goodness_of_fit2
)
See fit_vm() for considerations about selectivity and goodness_of_fit | featuremapper/distribution.py | fit_v2m | fcr/featuremapper | python | def fit_v2m(self, distribution):
'\n computes the best fit of the bivariate von Mises function in the\n semi-circle.\n Return the tuple:\n (\n orientation1_preference, orientation1_selectivity, goodness_of_fit1,\n orientation2_preference, orientation2_selectivity, g... |
def __call__(self, distribution):
'\n Apply the distribution statistic function; must be implemented by subclasses.\n\n '
raise NotImplementedError | 195,079,524,237,858,200 | Apply the distribution statistic function; must be implemented by subclasses. | featuremapper/distribution.py | __call__ | fcr/featuremapper | python | def __call__(self, distribution):
'\n \n\n '
raise NotImplementedError |
def _analyze_distr(self, d):
'\n Analyze the given distribution with von Mises bimodal fit.\n\n The distribution is analyzed with both unimodal and bimodal fits, and a\n decision about the number of modes is made by comparing the goodness of\n fit. It is a quick but inaccurate way of est... | -6,726,496,357,450,420,000 | Analyze the given distribution with von Mises bimodal fit.
The distribution is analyzed with both unimodal and bimodal fits, and a
decision about the number of modes is made by comparing the goodness of
fit. It is a quick but inaccurate way of estimating the number of modes.
Return preference, selectivity, goodness of... | featuremapper/distribution.py | _analyze_distr | fcr/featuremapper | python | def _analyze_distr(self, d):
'\n Analyze the given distribution with von Mises bimodal fit.\n\n The distribution is analyzed with both unimodal and bimodal fits, and a\n decision about the number of modes is made by comparing the goodness of\n fit. It is a quick but inaccurate way of est... |
def process_lengths(input):
'\n Computing the lengths of sentences in current batchs\n '
max_length = input.size(1)
lengths = list((max_length - input.data.eq(0).sum(1).squeeze()))
return lengths | -2,427,997,533,236,584,400 | Computing the lengths of sentences in current batchs | AiR-M/ban/base_model.py | process_lengths | szzexpoi/AiR | python | def process_lengths(input):
'\n \n '
max_length = input.size(1)
lengths = list((max_length - input.data.eq(0).sum(1).squeeze()))
return lengths |
def select_last(x, lengths):
'\n Adaptively select the hidden state at the end of sentences\n '
batch_size = x.size(0)
seq_length = x.size(1)
mask = x.data.new().resize_as_(x.data).fill_(0)
for i in range(batch_size):
mask[i][(lengths[i] - 1)].fill_(1)
mask = Variable(mask)
x =... | -8,111,296,031,895,657,000 | Adaptively select the hidden state at the end of sentences | AiR-M/ban/base_model.py | select_last | szzexpoi/AiR | python | def select_last(x, lengths):
'\n \n '
batch_size = x.size(0)
seq_length = x.size(1)
mask = x.data.new().resize_as_(x.data).fill_(0)
for i in range(batch_size):
mask[i][(lengths[i] - 1)].fill_(1)
mask = Variable(mask)
x = x.mul(mask)
x = x.sum(1).view(batch_size, x.size(2), ... |
def forward(self, v, b, q):
'Forward\n\n v: [batch, num_objs, obj_dim]\n b: [batch, num_objs, b_dim]\n q: [batch_size, seq_length]\n\n return: logits, not probs\n '
w_emb = self.w_emb(q)
q_emb = self.q_emb.forward_all(w_emb)
boxes = b[:, :, :4].transpose(1, 2)
b_em... | 8,726,120,948,886,197,000 | Forward
v: [batch, num_objs, obj_dim]
b: [batch, num_objs, b_dim]
q: [batch_size, seq_length]
return: logits, not probs | AiR-M/ban/base_model.py | forward | szzexpoi/AiR | python | def forward(self, v, b, q):
'Forward\n\n v: [batch, num_objs, obj_dim]\n b: [batch, num_objs, b_dim]\n q: [batch_size, seq_length]\n\n return: logits, not probs\n '
w_emb = self.w_emb(q)
q_emb = self.q_emb.forward_all(w_emb)
boxes = b[:, :, :4].transpose(1, 2)
b_em... |
def forward(self, v, b, q):
'Forward\n\n v: [batch, num_objs, obj_dim]\n b: [batch, num_objs, b_dim]\n q: [batch_size, seq_length]\n\n return: logits, not probs\n '
w_emb = self.w_emb(q)
q_emb = self.q_emb.forward_all(w_emb)
ori_q_emb = q_emb
boxes = b[:, :, :4].tr... | -7,458,918,011,432,265,000 | Forward
v: [batch, num_objs, obj_dim]
b: [batch, num_objs, b_dim]
q: [batch_size, seq_length]
return: logits, not probs | AiR-M/ban/base_model.py | forward | szzexpoi/AiR | python | def forward(self, v, b, q):
'Forward\n\n v: [batch, num_objs, obj_dim]\n b: [batch, num_objs, b_dim]\n q: [batch_size, seq_length]\n\n return: logits, not probs\n '
w_emb = self.w_emb(q)
q_emb = self.q_emb.forward_all(w_emb)
ori_q_emb = q_emb
boxes = b[:, :, :4].tr... |
def update_twitter_banner(api: tweepy.API) -> None:
'Update the twitter banner of the current profile using the image specified in config.'
api.update_profile_banner(Config.IMAGE_PATH) | 4,279,449,391,939,052,000 | Update the twitter banner of the current profile using the image specified in config. | app/twitter.py | update_twitter_banner | janaSunrise/Spotify-Twitter-Banner | python | def update_twitter_banner(api: tweepy.API) -> None:
api.update_profile_banner(Config.IMAGE_PATH) |
def __init__(__self__, *, account_name: pulumi.Input[str], resource_group_name: pulumi.Input[str], group_id: Optional[pulumi.Input[str]]=None, private_endpoint: Optional[pulumi.Input['PrivateEndpointPropertyArgs']]=None, private_endpoint_connection_name: Optional[pulumi.Input[str]]=None, private_link_service_connection... | -4,943,972,685,862,324,000 | The set of arguments for constructing a PrivateEndpointConnection resource.
:param pulumi.Input[str] account_name: Cosmos DB database account name.
:param pulumi.Input[str] resource_group_name: The name of the resource group. The name is case insensitive.
:param pulumi.Input[str] group_id: Group id of the private endpo... | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | __init__ | polivbr/pulumi-azure-native | python | def __init__(__self__, *, account_name: pulumi.Input[str], resource_group_name: pulumi.Input[str], group_id: Optional[pulumi.Input[str]]=None, private_endpoint: Optional[pulumi.Input['PrivateEndpointPropertyArgs']]=None, private_endpoint_connection_name: Optional[pulumi.Input[str]]=None, private_link_service_connection... |
@property
@pulumi.getter(name='accountName')
def account_name(self) -> pulumi.Input[str]:
'\n Cosmos DB database account name.\n '
return pulumi.get(self, 'account_name') | 502,045,046,113,578,100 | Cosmos DB database account name. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | account_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='accountName')
def account_name(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'account_name') |
@property
@pulumi.getter(name='resourceGroupName')
def resource_group_name(self) -> pulumi.Input[str]:
'\n The name of the resource group. The name is case insensitive.\n '
return pulumi.get(self, 'resource_group_name') | 9,099,428,823,929,783,000 | The name of the resource group. The name is case insensitive. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | resource_group_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='resourceGroupName')
def resource_group_name(self) -> pulumi.Input[str]:
'\n \n '
return pulumi.get(self, 'resource_group_name') |
@property
@pulumi.getter(name='groupId')
def group_id(self) -> Optional[pulumi.Input[str]]:
'\n Group id of the private endpoint.\n '
return pulumi.get(self, 'group_id') | 6,219,630,646,862,960,000 | Group id of the private endpoint. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | group_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='groupId')
def group_id(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'group_id') |
@property
@pulumi.getter(name='privateEndpoint')
def private_endpoint(self) -> Optional[pulumi.Input['PrivateEndpointPropertyArgs']]:
'\n Private endpoint which the connection belongs to.\n '
return pulumi.get(self, 'private_endpoint') | 5,022,729,442,492,625,000 | Private endpoint which the connection belongs to. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | private_endpoint | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='privateEndpoint')
def private_endpoint(self) -> Optional[pulumi.Input['PrivateEndpointPropertyArgs']]:
'\n \n '
return pulumi.get(self, 'private_endpoint') |
@property
@pulumi.getter(name='privateEndpointConnectionName')
def private_endpoint_connection_name(self) -> Optional[pulumi.Input[str]]:
'\n The name of the private endpoint connection.\n '
return pulumi.get(self, 'private_endpoint_connection_name') | 9,106,011,365,118,251,000 | The name of the private endpoint connection. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | private_endpoint_connection_name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='privateEndpointConnectionName')
def private_endpoint_connection_name(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'private_endpoint_connection_name') |
@property
@pulumi.getter(name='privateLinkServiceConnectionState')
def private_link_service_connection_state(self) -> Optional[pulumi.Input['PrivateLinkServiceConnectionStatePropertyArgs']]:
'\n Connection State of the Private Endpoint Connection.\n '
return pulumi.get(self, 'private_link_service_... | -6,430,009,499,459,862,000 | Connection State of the Private Endpoint Connection. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | private_link_service_connection_state | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='privateLinkServiceConnectionState')
def private_link_service_connection_state(self) -> Optional[pulumi.Input['PrivateLinkServiceConnectionStatePropertyArgs']]:
'\n \n '
return pulumi.get(self, 'private_link_service_connection_state') |
@property
@pulumi.getter(name='provisioningState')
def provisioning_state(self) -> Optional[pulumi.Input[str]]:
'\n Provisioning state of the private endpoint.\n '
return pulumi.get(self, 'provisioning_state') | -7,459,372,872,054,955,000 | Provisioning state of the private endpoint. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | provisioning_state | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='provisioningState')
def provisioning_state(self) -> Optional[pulumi.Input[str]]:
'\n \n '
return pulumi.get(self, 'provisioning_state') |
@overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, account_name: Optional[pulumi.Input[str]]=None, group_id: Optional[pulumi.Input[str]]=None, private_endpoint: Optional[pulumi.Input[pulumi.InputType['PrivateEndpointPropertyArgs']]]=None, private_endpoint_connection_name: ... | 2,332,089,667,209,762,000 | A private endpoint connection
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input[str] account_name: Cosmos DB database account name.
:param pulumi.Input[str] group_id: Group id of the private endpoint.
:param pulumi.Input[pulumi.InputTy... | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | __init__ | polivbr/pulumi-azure-native | python | @overload
def __init__(__self__, resource_name: str, opts: Optional[pulumi.ResourceOptions]=None, account_name: Optional[pulumi.Input[str]]=None, group_id: Optional[pulumi.Input[str]]=None, private_endpoint: Optional[pulumi.Input[pulumi.InputType['PrivateEndpointPropertyArgs']]]=None, private_endpoint_connection_name: ... |
@overload
def __init__(__self__, resource_name: str, args: PrivateEndpointConnectionArgs, opts: Optional[pulumi.ResourceOptions]=None):
"\n A private endpoint connection\n\n :param str resource_name: The name of the resource.\n :param PrivateEndpointConnectionArgs args: The arguments to use to ... | 1,086,483,198,058,566,000 | A private endpoint connection
:param str resource_name: The name of the resource.
:param PrivateEndpointConnectionArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | __init__ | polivbr/pulumi-azure-native | python | @overload
def __init__(__self__, resource_name: str, args: PrivateEndpointConnectionArgs, opts: Optional[pulumi.ResourceOptions]=None):
"\n A private endpoint connection\n\n :param str resource_name: The name of the resource.\n :param PrivateEndpointConnectionArgs args: The arguments to use to ... |
@staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'PrivateEndpointConnection':
"\n Get an existing PrivateEndpointConnection resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :... | 1,281,849,848,306,374,700 | Get an existing PrivateEndpointConnection resource's state with the given name, id, and optional extra
properties used to qualify the lookup.
:param str resource_name: The unique name of the resulting resource.
:param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
:param pulumi.ResourceOptions... | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | get | polivbr/pulumi-azure-native | python | @staticmethod
def get(resource_name: str, id: pulumi.Input[str], opts: Optional[pulumi.ResourceOptions]=None) -> 'PrivateEndpointConnection':
"\n Get an existing PrivateEndpointConnection resource's state with the given name, id, and optional extra\n properties used to qualify the lookup.\n\n :... |
@property
@pulumi.getter(name='groupId')
def group_id(self) -> pulumi.Output[Optional[str]]:
'\n Group id of the private endpoint.\n '
return pulumi.get(self, 'group_id') | 1,222,296,214,502,759,200 | Group id of the private endpoint. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | group_id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='groupId')
def group_id(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'group_id') |
@property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n The name of the resource\n '
return pulumi.get(self, 'name') | 2,231,345,607,626,165,800 | The name of the resource | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def name(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'name') |
@property
@pulumi.getter(name='privateEndpoint')
def private_endpoint(self) -> pulumi.Output[Optional['outputs.PrivateEndpointPropertyResponse']]:
'\n Private endpoint which the connection belongs to.\n '
return pulumi.get(self, 'private_endpoint') | 5,557,291,932,331,128,000 | Private endpoint which the connection belongs to. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | private_endpoint | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='privateEndpoint')
def private_endpoint(self) -> pulumi.Output[Optional['outputs.PrivateEndpointPropertyResponse']]:
'\n \n '
return pulumi.get(self, 'private_endpoint') |
@property
@pulumi.getter(name='privateLinkServiceConnectionState')
def private_link_service_connection_state(self) -> pulumi.Output[Optional['outputs.PrivateLinkServiceConnectionStatePropertyResponse']]:
'\n Connection State of the Private Endpoint Connection.\n '
return pulumi.get(self, 'private_... | 4,314,061,072,508,133,000 | Connection State of the Private Endpoint Connection. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | private_link_service_connection_state | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='privateLinkServiceConnectionState')
def private_link_service_connection_state(self) -> pulumi.Output[Optional['outputs.PrivateLinkServiceConnectionStatePropertyResponse']]:
'\n \n '
return pulumi.get(self, 'private_link_service_connection_state') |
@property
@pulumi.getter(name='provisioningState')
def provisioning_state(self) -> pulumi.Output[Optional[str]]:
'\n Provisioning state of the private endpoint.\n '
return pulumi.get(self, 'provisioning_state') | -2,609,549,406,412,615,000 | Provisioning state of the private endpoint. | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | provisioning_state | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='provisioningState')
def provisioning_state(self) -> pulumi.Output[Optional[str]]:
'\n \n '
return pulumi.get(self, 'provisioning_state') |
@property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
'\n The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"\n '
return pulumi.get(self, 'type') | -5,449,551,391,296,740,000 | The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" | sdk/python/pulumi_azure_native/documentdb/v20210615/private_endpoint_connection.py | type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def type(self) -> pulumi.Output[str]:
'\n \n '
return pulumi.get(self, 'type') |
def p_bp_location(self, args):
'\n bp_start ::= opt_space location_if opt_space\n ' | -6,279,436,233,502,354,000 | bp_start ::= opt_space location_if opt_space | example/gdb-loc/gdbloc/parser.py | p_bp_location | rocky/python-spark | python | def p_bp_location(self, args):
'\n \n ' |
def p_asm_range(self, args):
"\n arange_start ::= opt_space arange\n arange ::= range\n arange ::= addr_location opt_space COMMA opt_space NUMBER\n arange ::= addr_location opt_space COMMA opt_space OFFSET\n arange ::= addr_location opt_space COMMA opt_space ADDRESS\n aran... | 6,546,008,999,439,895,000 | arange_start ::= opt_space arange
arange ::= range
arange ::= addr_location opt_space COMMA opt_space NUMBER
arange ::= addr_location opt_space COMMA opt_space OFFSET
arange ::= addr_location opt_space COMMA opt_space ADDRESS
arange ::= location opt_space COMMA opt_space ADDRESS
arange ::= addr_location opt_space COMM... | example/gdb-loc/gdbloc/parser.py | p_asm_range | rocky/python-spark | python | def p_asm_range(self, args):
"\n arange_start ::= opt_space arange\n arange ::= range\n arange ::= addr_location opt_space COMMA opt_space NUMBER\n arange ::= addr_location opt_space COMMA opt_space OFFSET\n arange ::= addr_location opt_space COMMA opt_space ADDRESS\n aran... |
def p_list_range(self, args):
'\n range_start ::= opt_space range\n\n range ::= location opt_space COMMA opt_space NUMBER\n range ::= location opt_space COMMA opt_space OFFSET\n range ::= COMMA opt_space location\n range ::= location opt_space COMMA\n range ::= location\n ... | -2,263,275,189,617,537,000 | range_start ::= opt_space range
range ::= location opt_space COMMA opt_space NUMBER
range ::= location opt_space COMMA opt_space OFFSET
range ::= COMMA opt_space location
range ::= location opt_space COMMA
range ::= location
range ::= DIRECTION | example/gdb-loc/gdbloc/parser.py | p_list_range | rocky/python-spark | python | def p_list_range(self, args):
'\n range_start ::= opt_space range\n\n range ::= location opt_space COMMA opt_space NUMBER\n range ::= location opt_space COMMA opt_space OFFSET\n range ::= COMMA opt_space location\n range ::= location opt_space COMMA\n range ::= location\n ... |
def p_location(self, args):
'\n opt_space ::= SPACE?\n\n location_if ::= location\n location_if ::= location SPACE IF tokens\n\n # Note no space is allowed between FILENAME and NUMBER\n location ::= FILENAME COLON NUMBER\n location ::= FUNCNAME\n\n # If just ... | 857,460,103,374,779,500 | opt_space ::= SPACE?
location_if ::= location
location_if ::= location SPACE IF tokens
# Note no space is allowed between FILENAME and NUMBER
location ::= FILENAME COLON NUMBER
location ::= FUNCNAME
# If just a number is given, the the filename is implied
location ::= NUMBER
location ::= METHOD
locatio... | example/gdb-loc/gdbloc/parser.py | p_location | rocky/python-spark | python | def p_location(self, args):
'\n opt_space ::= SPACE?\n\n location_if ::= location\n location_if ::= location SPACE IF tokens\n\n # Note no space is allowed between FILENAME and NUMBER\n location ::= FILENAME COLON NUMBER\n location ::= FUNCNAME\n\n # If just ... |
def __init__(self, server_url: str, **kwargs) -> None:
'The WOQLClient constructor.\n\n Parameters\n ----------\n server_url : str\n URL of the server that this client will connect to.\n \\**kwargs\n Extra configuration options\n\n '
self.server_url = ser... | -1,364,098,096,190,279,400 | The WOQLClient constructor.
Parameters
----------
server_url : str
URL of the server that this client will connect to.
\**kwargs
Extra configuration options | terminusdb_client/woqlclient/woqlClient.py | __init__ | terminusdb/woql-client-p | python | def __init__(self, server_url: str, **kwargs) -> None:
'The WOQLClient constructor.\n\n Parameters\n ----------\n server_url : str\n URL of the server that this client will connect to.\n \\**kwargs\n Extra configuration options\n\n '
self.server_url = ser... |
def connect(self, team: str='admin', db: Optional[str]=None, remote_auth: str=None, use_token: bool=False, jwt_token: Optional[str]=None, api_token: Optional[str]=None, key: str='root', user: str='admin', branch: str='main', ref: Optional[str]=None, repo: str='local', **kwargs) -> None:
'Connect to a Terminus serve... | 8,423,099,675,081,320,000 | Connect to a Terminus server at the given URI with an API key.
Stores the connection settings and necessary meta-data for the connected server. You need to connect before most database operations.
Parameters
----------
team: str
Name of the team, default to be "admin"
db: optional, str
Name of the database co... | terminusdb_client/woqlclient/woqlClient.py | connect | terminusdb/woql-client-p | python | def connect(self, team: str='admin', db: Optional[str]=None, remote_auth: str=None, use_token: bool=False, jwt_token: Optional[str]=None, api_token: Optional[str]=None, key: str='root', user: str='admin', branch: str='main', ref: Optional[str]=None, repo: str='local', **kwargs) -> None:
'Connect to a Terminus serve... |
def close(self) -> None:
'Undo connect and close the connection.\n\n The connection will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the connection, unless connect is call again.'
self._connected = False | -6,189,939,517,125,445,000 | Undo connect and close the connection.
The connection will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the connection, unless connect is call again. | terminusdb_client/woqlclient/woqlClient.py | close | terminusdb/woql-client-p | python | def close(self) -> None:
'Undo connect and close the connection.\n\n The connection will be unusable from this point forward; an Error (or subclass) exception will be raised if any operation is attempted with the connection, unless connect is call again.'
self._connected = False |
def _check_connection(self, check_db=True) -> None:
'Raise connection InterfaceError if not connected\n Defaults to check if a db is connected'
if (not self._connected):
raise InterfaceError('Client is not connected to a TerminusDB server.')
if (check_db and (self.db is None)):
raise ... | 4,379,756,186,759,730,700 | Raise connection InterfaceError if not connected
Defaults to check if a db is connected | terminusdb_client/woqlclient/woqlClient.py | _check_connection | terminusdb/woql-client-p | python | def _check_connection(self, check_db=True) -> None:
'Raise connection InterfaceError if not connected\n Defaults to check if a db is connected'
if (not self._connected):
raise InterfaceError('Client is not connected to a TerminusDB server.')
if (check_db and (self.db is None)):
raise ... |
def get_commit_history(self, max_history: int=500) -> list:
'Get the whole commit history.\n Commit history - Commit id, author of the commit, commit message and the commit time, in the current branch from the current commit, ordered backwards in time, will be returned in a dictionary in the follow format:\n... | 1,425,721,135,152,934,100 | Get the whole commit history.
Commit history - Commit id, author of the commit, commit message and the commit time, in the current branch from the current commit, ordered backwards in time, will be returned in a dictionary in the follow format:
{"commit_id":
{"author": "commit_author",
"message": "commit_message",
"tim... | terminusdb_client/woqlclient/woqlClient.py | get_commit_history | terminusdb/woql-client-p | python | def get_commit_history(self, max_history: int=500) -> list:
'Get the whole commit history.\n Commit history - Commit id, author of the commit, commit message and the commit time, in the current branch from the current commit, ordered backwards in time, will be returned in a dictionary in the follow format:\n... |
def get_all_branches(self, get_data_version=False):
'Get all the branches available in the database.'
self._check_connection()
api_url = self._documents_url().split('/')
api_url = api_url[:(- 2)]
api_url = ('/'.join(api_url) + '/_commits')
result = requests.get(api_url, headers={'user-agent': f'... | -2,184,391,910,578,389,500 | Get all the branches available in the database. | terminusdb_client/woqlclient/woqlClient.py | get_all_branches | terminusdb/woql-client-p | python | def get_all_branches(self, get_data_version=False):
self._check_connection()
api_url = self._documents_url().split('/')
api_url = api_url[:(- 2)]
api_url = ('/'.join(api_url) + '/_commits')
result = requests.get(api_url, headers={'user-agent': f'terminusdb-client-python/{__version__}'}, params=... |
def rollback(self, steps=1) -> None:
"Curently not implementated. Please check back later.\n\n Raises\n ----------\n NotImplementedError\n Since TerminusDB currently does not support open transactions. This method is not applicable to it's usage. To reset commit head, use WOQLClient.... | -2,812,794,403,207,086,000 | Curently not implementated. Please check back later.
Raises
----------
NotImplementedError
Since TerminusDB currently does not support open transactions. This method is not applicable to it's usage. To reset commit head, use WOQLClient.reset | terminusdb_client/woqlclient/woqlClient.py | rollback | terminusdb/woql-client-p | python | def rollback(self, steps=1) -> None:
"Curently not implementated. Please check back later.\n\n Raises\n ----------\n NotImplementedError\n Since TerminusDB currently does not support open transactions. This method is not applicable to it's usage. To reset commit head, use WOQLClient.... |
def copy(self) -> 'WOQLClient':
'Create a deep copy of this client.\n\n Returns\n -------\n WOQLClient\n The copied client instance.\n\n Examples\n --------\n >>> client = WOQLClient("https://127.0.0.1:6363/")\n >>> clone = client.copy()\n >>> asser... | -5,851,508,991,514,087,000 | Create a deep copy of this client.
Returns
-------
WOQLClient
The copied client instance.
Examples
--------
>>> client = WOQLClient("https://127.0.0.1:6363/")
>>> clone = client.copy()
>>> assert client is not clone | terminusdb_client/woqlclient/woqlClient.py | copy | terminusdb/woql-client-p | python | def copy(self) -> 'WOQLClient':
'Create a deep copy of this client.\n\n Returns\n -------\n WOQLClient\n The copied client instance.\n\n Examples\n --------\n >>> client = WOQLClient("https://127.0.0.1:6363/")\n >>> clone = client.copy()\n >>> asser... |
def set_db(self, dbid: str, team: Optional[str]=None) -> str:
'Set the connection to another database. This will reset the connection.\n\n Parameters\n ----------\n dbid : str\n Database identifer to set in the config.\n team : str\n Team identifer to set in the con... | 6,096,587,200,381,540,000 | Set the connection to another database. This will reset the connection.
Parameters
----------
dbid : str
Database identifer to set in the config.
team : str
Team identifer to set in the config. If not passed in, it will use the current one.
Returns
-------
str
The current database identifier.
Examples
--... | terminusdb_client/woqlclient/woqlClient.py | set_db | terminusdb/woql-client-p | python | def set_db(self, dbid: str, team: Optional[str]=None) -> str:
'Set the connection to another database. This will reset the connection.\n\n Parameters\n ----------\n dbid : str\n Database identifer to set in the config.\n team : str\n Team identifer to set in the con... |
def resource(self, ttype: ResourceType, val: Optional[str]=None) -> str:
'Create a resource identifier string based on the current config.\n\n Parameters\n ----------\n ttype : ResourceType\n Type of resource.\n val : str, optional\n Branch or commit identifier.\n\n... | 930,136,883,031,564,500 | Create a resource identifier string based on the current config.
Parameters
----------
ttype : ResourceType
Type of resource.
val : str, optional
Branch or commit identifier.
Returns
-------
str
The constructed resource string.
Examples
--------
>>> client = WOQLClient("https://127.0.0.1:6363")
>>> clien... | terminusdb_client/woqlclient/woqlClient.py | resource | terminusdb/woql-client-p | python | def resource(self, ttype: ResourceType, val: Optional[str]=None) -> str:
'Create a resource identifier string based on the current config.\n\n Parameters\n ----------\n ttype : ResourceType\n Type of resource.\n val : str, optional\n Branch or commit identifier.\n\n... |
def _get_prefixes(self):
'Get the prefixes for a given database'
self._check_connection()
result = requests.get(self._db_base('prefixes'), headers={'user-agent': f'terminusdb-client-python/{__version__}'}, auth=self._auth())
return json.loads(_finish_response(result)) | 5,538,847,128,667,846,000 | Get the prefixes for a given database | terminusdb_client/woqlclient/woqlClient.py | _get_prefixes | terminusdb/woql-client-p | python | def _get_prefixes(self):
self._check_connection()
result = requests.get(self._db_base('prefixes'), headers={'user-agent': f'terminusdb-client-python/{__version__}'}, auth=self._auth())
return json.loads(_finish_response(result)) |
def create_database(self, dbid: str, team: Optional[str]=None, label: Optional[str]=None, description: Optional[str]=None, prefixes: Optional[dict]=None, include_schema: bool=True) -> None:
'Create a TerminusDB database by posting\n a terminus:Database document to the Terminus Server.\n\n Parameters\n... | 3,640,779,118,710,737,000 | Create a TerminusDB database by posting
a terminus:Database document to the Terminus Server.
Parameters
----------
dbid : str
Unique identifier of the database.
team : str, optional
ID of the Team in which to create the DB (defaults to 'admin')
label : str, optional
Database name.
description : str, option... | terminusdb_client/woqlclient/woqlClient.py | create_database | terminusdb/woql-client-p | python | def create_database(self, dbid: str, team: Optional[str]=None, label: Optional[str]=None, description: Optional[str]=None, prefixes: Optional[dict]=None, include_schema: bool=True) -> None:
'Create a TerminusDB database by posting\n a terminus:Database document to the Terminus Server.\n\n Parameters\n... |
def delete_database(self, dbid: Optional[str]=None, team: Optional[str]=None, force: bool=False) -> None:
'Delete a TerminusDB database.\n\n If ``team`` is provided, then the team in the config will be updated\n and the new value will be used in future requests to the server.\n\n Parameters\n ... | -4,838,731,874,326,968,000 | Delete a TerminusDB database.
If ``team`` is provided, then the team in the config will be updated
and the new value will be used in future requests to the server.
Parameters
----------
dbid : str
ID of the database to delete
team : str, optional
the team in which the database resides (defaults to "admin")
fo... | terminusdb_client/woqlclient/woqlClient.py | delete_database | terminusdb/woql-client-p | python | def delete_database(self, dbid: Optional[str]=None, team: Optional[str]=None, force: bool=False) -> None:
'Delete a TerminusDB database.\n\n If ``team`` is provided, then the team in the config will be updated\n and the new value will be used in future requests to the server.\n\n Parameters\n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.