body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1
value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
0ab9dc29f4edf199279d1c3d4e2b4b62700990f0fa8d90e0e3fde6e2ca115e9b | def t(*shape: Dimension) -> TensorType:
'\n Creates an object with the given shape, for testing.\n '
return TestShaped(shape) | Creates an object with the given shape, for testing. | tests/gpflow/experimental/check_shapes/utils.py | t | joelberkeley/GPflow | 0 | python | def t(*shape: Dimension) -> TensorType:
'\n \n '
return TestShaped(shape) | def t(*shape: Dimension) -> TensorType:
'\n \n '
return TestShaped(shape)<|docstring|>Creates an object with the given shape, for testing.<|endoftext|> |
5416f81381da8b1d07b3144b753f7ed095235a5933a48a44c9e8a761e77f776d | def update_availability_zone(ec2, availability_zone: str, volumes: List[AbstractInstanceVolume]):
"Checks that existing volumes located in the same AZ and the AZ from the\n config file matches volumes AZ.\n\n Args:\n ec2: EC2 boto3 client\n availability_zone: Availability Zone from the configura... | Checks that existing volumes located in the same AZ and the AZ from the
config file matches volumes AZ.
Args:
ec2: EC2 boto3 client
availability_zone: Availability Zone from the configuration.
volumes: List of volume objects.
Returns:
The final AZ where the instance should be run or an empty string if... | spotty/providers/aws/helpers/availability_zone.py | update_availability_zone | wilmeragsgh/spotty | 246 | python | def update_availability_zone(ec2, availability_zone: str, volumes: List[AbstractInstanceVolume]):
"Checks that existing volumes located in the same AZ and the AZ from the\n config file matches volumes AZ.\n\n Args:\n ec2: EC2 boto3 client\n availability_zone: Availability Zone from the configura... | def update_availability_zone(ec2, availability_zone: str, volumes: List[AbstractInstanceVolume]):
"Checks that existing volumes located in the same AZ and the AZ from the\n config file matches volumes AZ.\n\n Args:\n ec2: EC2 boto3 client\n availability_zone: Availability Zone from the configura... |
13053b9ea0a6aa56558a8f00163c64a216b025f5db7a0266ac25136350a1ce98 | def fit(self, X, Y2, learning_rate=0.01, max_epochs=1000):
'\n Takes in arguments X and Y. The learning rate is defined by the user as well as the max_epochs.\n\n learning_rate = 1, 0.1, 0.01, 0.001, 0.0001, ens. \n\n max_epochs is the number of iterations, the higher == higher accuracy\n ... | Takes in arguments X and Y. The learning rate is defined by the user as well as the max_epochs.
learning_rate = 1, 0.1, 0.01, 0.001, 0.0001, ens.
max_epochs is the number of iterations, the higher == higher accuracy | Supervised Machine Learning/Perceptron/Perceptron_multi.py | fit | marcelkotze007/mk007---ML-Python-library | 0 | python | def fit(self, X, Y2, learning_rate=0.01, max_epochs=1000):
'\n Takes in arguments X and Y. The learning rate is defined by the user as well as the max_epochs.\n\n learning_rate = 1, 0.1, 0.01, 0.001, 0.0001, ens. \n\n max_epochs is the number of iterations, the higher == higher accuracy\n ... | def fit(self, X, Y2, learning_rate=0.01, max_epochs=1000):
'\n Takes in arguments X and Y. The learning rate is defined by the user as well as the max_epochs.\n\n learning_rate = 1, 0.1, 0.01, 0.001, 0.0001, ens. \n\n max_epochs is the number of iterations, the higher == higher accuracy\n ... |
9089694ace03d99caf78b056c4d27c6dd24dbeee1953a32902e6d2955fe5d05c | @staticmethod
def random_users():
'\n based on the number of the active users in each day, randomly select user ids from user table\n :return: list of the active user ids\n '
ids_lst = User.load_all_ids_from_db()
selected_users = list()
users_In_Day = random.randint(10, (len(ids_lst... | based on the number of the active users in each day, randomly select user ids from user table
:return: list of the active user ids | chainedSCT/extraction/location_Extraction.py | random_users | MSBeni/SmartContactTracing_Chained | 1 | python | @staticmethod
def random_users():
'\n based on the number of the active users in each day, randomly select user ids from user table\n :return: list of the active user ids\n '
ids_lst = User.load_all_ids_from_db()
selected_users = list()
users_In_Day = random.randint(10, (len(ids_lst... | @staticmethod
def random_users():
'\n based on the number of the active users in each day, randomly select user ids from user table\n :return: list of the active user ids\n '
ids_lst = User.load_all_ids_from_db()
selected_users = list()
users_In_Day = random.randint(10, (len(ids_lst... |
586531daff81a97968287eb9a6a646eccb55b4aacf2f792db2921a37e6e652af | @classmethod
def random_user_location(cls, step_size=0.5):
"\n create locations based on defined step size and number of steps in the environment for each user\n :return: list of the positions' tuples\n "
positions = list()
x_pos = random.uniform(0.0, 20.0)
y_pos = random.uniform(0.... | create locations based on defined step size and number of steps in the environment for each user
:return: list of the positions' tuples | chainedSCT/extraction/location_Extraction.py | random_user_location | MSBeni/SmartContactTracing_Chained | 1 | python | @classmethod
def random_user_location(cls, step_size=0.5):
"\n create locations based on defined step size and number of steps in the environment for each user\n :return: list of the positions' tuples\n "
positions = list()
x_pos = random.uniform(0.0, 20.0)
y_pos = random.uniform(0.... | @classmethod
def random_user_location(cls, step_size=0.5):
"\n create locations based on defined step size and number of steps in the environment for each user\n :return: list of the positions' tuples\n "
positions = list()
x_pos = random.uniform(0.0, 20.0)
y_pos = random.uniform(0.... |
f21e53f4b1d8dc44c94cf84e7cf521f2436944c804fae40e364649f0974af0d5 | @classmethod
def save_location_to_db(cls, argument_handler):
"\n create data specifically for all the active users and save timestamped data containing the user's locations to\n database\n :param argument_handler: imported arguments\n :return:\n "
selected_users = cls.random_u... | create data specifically for all the active users and save timestamped data containing the user's locations to
database
:param argument_handler: imported arguments
:return: | chainedSCT/extraction/location_Extraction.py | save_location_to_db | MSBeni/SmartContactTracing_Chained | 1 | python | @classmethod
def save_location_to_db(cls, argument_handler):
"\n create data specifically for all the active users and save timestamped data containing the user's locations to\n database\n :param argument_handler: imported arguments\n :return:\n "
selected_users = cls.random_u... | @classmethod
def save_location_to_db(cls, argument_handler):
"\n create data specifically for all the active users and save timestamped data containing the user's locations to\n database\n :param argument_handler: imported arguments\n :return:\n "
selected_users = cls.random_u... |
c44df322760ad13cc652265c8faa1f6a246a6997126933b38cbc660769b28a1b | def fixCollate(x, pass_pid=False):
'\n 1. make sure only one shape and annotation type in the batch.\n 2. add a meta of the batch.\n '
hashstat = defaultdict(list)
metas = defaultdict(list)
for i in x:
bf = i['meta'].batchflag
metas[bf].append(i.pop('meta'))
hashstat[bf]... | 1. make sure only one shape and annotation type in the batch.
2. add a meta of the batch. | src/data/dataloader.py | fixCollate | JamzumSum/yNet | 5 | python | def fixCollate(x, pass_pid=False):
'\n 1. make sure only one shape and annotation type in the batch.\n 2. add a meta of the batch.\n '
hashstat = defaultdict(list)
metas = defaultdict(list)
for i in x:
bf = i['meta'].batchflag
metas[bf].append(i.pop('meta'))
hashstat[bf]... | def fixCollate(x, pass_pid=False):
'\n 1. make sure only one shape and annotation type in the batch.\n 2. add a meta of the batch.\n '
hashstat = defaultdict(list)
metas = defaultdict(list)
for i in x:
bf = i['meta'].batchflag
metas[bf].append(i.pop('meta'))
hashstat[bf]... |
ba3ef79d2175bb59326176f7136286e40cf2cc4fa22787a1967db228ea1d403b | def load_img(self, img):
'Loads image of piece'
self.img = img | Loads image of piece | src/pieces/piece.py | load_img | pranavmodx/ChessX | 3 | python | def load_img(self, img):
self.img = img | def load_img(self, img):
self.img = img<|docstring|>Loads image of piece<|endoftext|> |
a53ba955a9df9e51dc5ec1097125affb021cd44d8c1369991531361e65c478f2 | def size(self):
'Returns size (or default size) of piece image'
try:
sz = self.img.get_height()
return sz
except:
return 75 | Returns size (or default size) of piece image | src/pieces/piece.py | size | pranavmodx/ChessX | 3 | python | def size(self):
try:
sz = self.img.get_height()
return sz
except:
return 75 | def size(self):
try:
sz = self.img.get_height()
return sz
except:
return 75<|docstring|>Returns size (or default size) of piece image<|endoftext|> |
c4225280b6a3f0aa1bd8b338004544f1e60ba38490be436c9d0d307c0937ec30 | def display(self, screen):
'Displays image on screen'
screen_obj = screen.blit(self.img, self.pos) | Displays image on screen | src/pieces/piece.py | display | pranavmodx/ChessX | 3 | python | def display(self, screen):
screen_obj = screen.blit(self.img, self.pos) | def display(self, screen):
screen_obj = screen.blit(self.img, self.pos)<|docstring|>Displays image on screen<|endoftext|> |
c466a80db6b5120bdc1a06a0271eb5dea5531374d1992adf668e012ba7b2059c | def set_pos(self, pos):
'Set initial position of piece'
self.pos = pos | Set initial position of piece | src/pieces/piece.py | set_pos | pranavmodx/ChessX | 3 | python | def set_pos(self, pos):
self.pos = pos | def set_pos(self, pos):
self.pos = pos<|docstring|>Set initial position of piece<|endoftext|> |
728e2535720ddf4df5fc50904f80c9bf84cfcc61a54167cb208ef126a3c76d8c | def move(self, pos):
'Move piece to required position'
self.pos = pos | Move piece to required position | src/pieces/piece.py | move | pranavmodx/ChessX | 3 | python | def move(self, pos):
self.pos = pos | def move(self, pos):
self.pos = pos<|docstring|>Move piece to required position<|endoftext|> |
5fafd414803ac4ac9baddab34e355ff9767d75cc850e39a3b5fec3d4dbcbcf7f | @ioflo.base.deeding.deedify(salt.utils.stringutils.to_str('SaltRaetMaintFork'), ioinits={'opts': salt.utils.stringutils.to_str('.salt.opts'), 'proc_mgr': salt.utils.stringutils.to_str('.salt.usr.proc_mgr')})
def maint_fork(self):
'\n For off the maintinence process from the master router process\n FloScript:\... | For off the maintinence process from the master router process
FloScript:
do salt raet maint fork at enter | salt/daemons/flo/maint.py | maint_fork | kaelaworthen/salt | 12 | python | @ioflo.base.deeding.deedify(salt.utils.stringutils.to_str('SaltRaetMaintFork'), ioinits={'opts': salt.utils.stringutils.to_str('.salt.opts'), 'proc_mgr': salt.utils.stringutils.to_str('.salt.usr.proc_mgr')})
def maint_fork(self):
'\n For off the maintinence process from the master router process\n FloScript:\... | @ioflo.base.deeding.deedify(salt.utils.stringutils.to_str('SaltRaetMaintFork'), ioinits={'opts': salt.utils.stringutils.to_str('.salt.opts'), 'proc_mgr': salt.utils.stringutils.to_str('.salt.usr.proc_mgr')})
def maint_fork(self):
'\n For off the maintinence process from the master router process\n FloScript:\... |
0026237438c38e6afb9e353d8e1163ea02be540cff9d2c2b477aa71aec9ac092 | def run(self):
'\n Spin up a worker, do this in s multiprocess\n '
behaviors = ['salt.daemons.flo']
preloads = [(salt.utils.stringutils.to_str('.salt.opts'), dict(value=self.opts))]
console_logdir = self.opts.get('ioflo_console_logdir', '')
if console_logdir:
consolepath = os.p... | Spin up a worker, do this in s multiprocess | salt/daemons/flo/maint.py | run | kaelaworthen/salt | 12 | python | def run(self):
'\n \n '
behaviors = ['salt.daemons.flo']
preloads = [(salt.utils.stringutils.to_str('.salt.opts'), dict(value=self.opts))]
console_logdir = self.opts.get('ioflo_console_logdir', )
if console_logdir:
consolepath = os.path.join(console_logdir, 'maintenance.log')
... | def run(self):
'\n \n '
behaviors = ['salt.daemons.flo']
preloads = [(salt.utils.stringutils.to_str('.salt.opts'), dict(value=self.opts))]
console_logdir = self.opts.get('ioflo_console_logdir', )
if console_logdir:
consolepath = os.path.join(console_logdir, 'maintenance.log')
... |
5e6be12f9cc30acc6abd3fa1201b23dcd998a2fc376d4401d6694d64ba3b1a30 | def action(self):
'\n Set up the objects used in the maint process\n '
self.fileserver.value = salt.fileserver.Fileserver(self.opts.value)
self.runners.value = salt.loader.runner(self.opts.value)
self.ckminions.value = salt.utils.minions.CkMinions(self.opts.value)
self.pillargitfs.valu... | Set up the objects used in the maint process | salt/daemons/flo/maint.py | action | kaelaworthen/salt | 12 | python | def action(self):
'\n \n '
self.fileserver.value = salt.fileserver.Fileserver(self.opts.value)
self.runners.value = salt.loader.runner(self.opts.value)
self.ckminions.value = salt.utils.minions.CkMinions(self.opts.value)
self.pillargitfs.value = salt.daemons.masterapi.init_git_pillar(s... | def action(self):
'\n \n '
self.fileserver.value = salt.fileserver.Fileserver(self.opts.value)
self.runners.value = salt.loader.runner(self.opts.value)
self.ckminions.value = salt.utils.minions.CkMinions(self.opts.value)
self.pillargitfs.value = salt.daemons.masterapi.init_git_pillar(s... |
bb52ffcb101995fccb8cbe6eafdfc1682c0dac094cb66c82044a060548054426 | def action(self):
'\n Clean!\n '
salt.daemons.masterapi.clean_fsbackend(self.opts.value) | Clean! | salt/daemons/flo/maint.py | action | kaelaworthen/salt | 12 | python | def action(self):
'\n \n '
salt.daemons.masterapi.clean_fsbackend(self.opts.value) | def action(self):
'\n \n '
salt.daemons.masterapi.clean_fsbackend(self.opts.value)<|docstring|>Clean!<|endoftext|> |
bdd10865a2c6758cfd5aab4c34016d83c39b49375146d4ca0f7359a72452e7c2 | def action(self):
'\n Clear out the old jobs cache\n '
salt.daemons.masterapi.clean_old_jobs(self.opts.value) | Clear out the old jobs cache | salt/daemons/flo/maint.py | action | kaelaworthen/salt | 12 | python | def action(self):
'\n \n '
salt.daemons.masterapi.clean_old_jobs(self.opts.value) | def action(self):
'\n \n '
salt.daemons.masterapi.clean_old_jobs(self.opts.value)<|docstring|>Clear out the old jobs cache<|endoftext|> |
cf4956717ee0c0cee0ae10a60a0750dde9e868e94d884357ea8061f5691334aa | def action(self):
'\n Update!\n '
for pillargit in self.pillargitfs.value:
pillargit.update()
salt.daemons.masterapi.fileserver_update(self.fileserver.value) | Update! | salt/daemons/flo/maint.py | action | kaelaworthen/salt | 12 | python | def action(self):
'\n \n '
for pillargit in self.pillargitfs.value:
pillargit.update()
salt.daemons.masterapi.fileserver_update(self.fileserver.value) | def action(self):
'\n \n '
for pillargit in self.pillargitfs.value:
pillargit.update()
salt.daemons.masterapi.fileserver_update(self.fileserver.value)<|docstring|>Update!<|endoftext|> |
424027b04ab4a4b3544cc5e7dfac890aad797981c1f05b7c29fa0e897b2881ab | def google_plus_profile_links(iterable, icon_path=''):
'\n mainfunc\n '
(yield '<div class="widget">')
(yield '<ul id="accounts">')
for (img, link, (sitename, filename, filepath, imgurl)) in iterable:
(yield '<li>')
(yield ('<a href=%s title=%s rel="me" target="_blank">' % (_repr(l... | mainfunc | get_accounts.py | google_plus_profile_links | westurner/westurner.github.io | 0 | python | def google_plus_profile_links(iterable, icon_path=):
'\n \n '
(yield '<div class="widget">')
(yield '<ul id="accounts">')
for (img, link, (sitename, filename, filepath, imgurl)) in iterable:
(yield '<li>')
(yield ('<a href=%s title=%s rel="me" target="_blank">' % (_repr(link['href'... | def google_plus_profile_links(iterable, icon_path=):
'\n \n '
(yield '<div class="widget">')
(yield '<ul id="accounts">')
for (img, link, (sitename, filename, filepath, imgurl)) in iterable:
(yield '<li>')
(yield ('<a href=%s title=%s rel="me" target="_blank">' % (_repr(link['href'... |
923947e780bc8f4de16896649b7d2e469c84c36b394f4ea3e957b768e6d74ad2 | def reference2array(path):
'this function allows you read in hyperspectral reference in raw format and returns it as array that is averaged\n (this will be used to normalize the raw hyperspectral image)\n Inputs:\n path = path to the raw file of reference\n\n Returns:\n image_array_all = hyperspe... | this function allows you read in hyperspectral reference in raw format and returns it as array that is averaged
(this will be used to normalize the raw hyperspectral image)
Inputs:
path = path to the raw file of reference
Returns:
image_array_all = hyperspectral reference image in array format
gdalhyper = hyperspe... | plantcv/hyperspectral/reference2array.py | reference2array | danforthcenter/plantcv-hyperspectral | 1 | python | def reference2array(path):
'this function allows you read in hyperspectral reference in raw format and returns it as array that is averaged\n (this will be used to normalize the raw hyperspectral image)\n Inputs:\n path = path to the raw file of reference\n\n Returns:\n image_array_all = hyperspe... | def reference2array(path):
'this function allows you read in hyperspectral reference in raw format and returns it as array that is averaged\n (this will be used to normalize the raw hyperspectral image)\n Inputs:\n path = path to the raw file of reference\n\n Returns:\n image_array_all = hyperspe... |
153690b3eae9fab807e01e5e31143a00808470201a0d7b94e353aec02554df2a | def main_scan():
'\n Parser from terminal with\n $ python2 bruker2nifti_scan -h\n $ python2 bruker2nifti_scan -i input_file_path -o output_file_path\n '
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input_scan_folder', dest='pfo_input', type=str, required=True, help='Bruker sca... | Parser from terminal with
$ python2 bruker2nifti_scan -h
$ python2 bruker2nifti_scan -i input_file_path -o output_file_path | bruker2nifti/parsers/bruker2nii_scan.py | main_scan | neuroanatomy/bruker2nifti | 0 | python | def main_scan():
'\n Parser from terminal with\n $ python2 bruker2nifti_scan -h\n $ python2 bruker2nifti_scan -i input_file_path -o output_file_path\n '
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input_scan_folder', dest='pfo_input', type=str, required=True, help='Bruker sca... | def main_scan():
'\n Parser from terminal with\n $ python2 bruker2nifti_scan -h\n $ python2 bruker2nifti_scan -i input_file_path -o output_file_path\n '
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input_scan_folder', dest='pfo_input', type=str, required=True, help='Bruker sca... |
c1d48b5c1acf408253ef538b8f21b1d468fc58c94393d260d25d1e34c85d4474 | def load_tags(self):
'Loads dictionary of tags for further use in BW2'
filename = 'tags.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of tags could not be found.')
with open(filepath) as f:
csv_list = [[val.strip() for val ... | Loads dictionary of tags for further use in BW2 | carculator/export.py | load_tags | SimonVoelker/carculator | 0 | python | def load_tags(self):
filename = 'tags.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of tags could not be found.')
with open(filepath) as f:
csv_list = [[val.strip() for val in r.split(';')] for r in f.readlines()]
data... | def load_tags(self):
filename = 'tags.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of tags could not be found.')
with open(filepath) as f:
csv_list = [[val.strip() for val in r.split(';')] for r in f.readlines()]
data... |
a8f48a7e689fca6215efc4353460f53ad34516558dc162f577566b481fb36caf | def load_mapping_36_to_uvek(self):
'Load mapping dictionary between ecoinvent 3.6 and UVEK'
filename = 'uvek_mapping.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of activities flows match between ecoinvent 3.6 and UVEK could not be fo... | Load mapping dictionary between ecoinvent 3.6 and UVEK | carculator/export.py | load_mapping_36_to_uvek | SimonVoelker/carculator | 0 | python | def load_mapping_36_to_uvek(self):
filename = 'uvek_mapping.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of activities flows match between ecoinvent 3.6 and UVEK could not be found.')
with open(filepath) as f:
csv_list = ... | def load_mapping_36_to_uvek(self):
filename = 'uvek_mapping.csv'
filepath = (DATA_DIR / filename)
if (not filepath.is_file()):
raise FileNotFoundError('The dictionary of activities flows match between ecoinvent 3.6 and UVEK could not be found.')
with open(filepath) as f:
csv_list = ... |
271a1aadcf9f18fa2e4d7cf3dab5ed84bf07752d546e40276e0d04b6a3c219eb | def write_lci(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return the inventory as a dictionary\n If if there several values for one exchange, uncertainty information is generated.\n If `presamples` is True, returns the inventory as well as a `presamples` matrix.\n ... | Return the inventory as a dictionary
If if there several values for one exchange, uncertainty information is generated.
If `presamples` is True, returns the inventory as well as a `presamples` matrix.
If `presamples` is False, returns the inventory with characterized uncertainty information.
If `ecoinvent_compatibility... | carculator/export.py | write_lci | SimonVoelker/carculator | 0 | python | def write_lci(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return the inventory as a dictionary\n If if there several values for one exchange, uncertainty information is generated.\n If `presamples` is True, returns the inventory as well as a `presamples` matrix.\n ... | def write_lci(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return the inventory as a dictionary\n If if there several values for one exchange, uncertainty information is generated.\n If `presamples` is True, returns the inventory as well as a `presamples` matrix.\n ... |
07ea8306bec5e59a2b1e76a5756e061d8311c7e298c3281d1b5098a2779bc8c1 | def write_lci_to_excel(self, directory, ecoinvent_compatibility, ecoinvent_version, software_compatibility, filename=None):
'\n Export an Excel file that can be consumed by the software defined in `software_compatibility`.\n\n :param directory: str. path to export the file to.\n :param ecoinven... | Export an Excel file that can be consumed by the software defined in `software_compatibility`.
:param directory: str. path to export the file to.
:param ecoinvent_compatibility: bool. If True, the inventory is compatible with ecoinvent. If False, the inventory is compatible with REMIND-ecoinvent.
:param ecoinvent_vers... | carculator/export.py | write_lci_to_excel | SimonVoelker/carculator | 0 | python | def write_lci_to_excel(self, directory, ecoinvent_compatibility, ecoinvent_version, software_compatibility, filename=None):
'\n Export an Excel file that can be consumed by the software defined in `software_compatibility`.\n\n :param directory: str. path to export the file to.\n :param ecoinven... | def write_lci_to_excel(self, directory, ecoinvent_compatibility, ecoinvent_version, software_compatibility, filename=None):
'\n Export an Excel file that can be consumed by the software defined in `software_compatibility`.\n\n :param directory: str. path to export the file to.\n :param ecoinven... |
17d085257d02727e8367cfa0a9c2d86cc0606545874576d2dedea71fbf314c30 | def write_lci_to_bw(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return a LCIImporter object with the inventory as `data` attribute.\n\n :return: LCIImporter object to be imported in a Brightway2 project\n :rtype: bw2io.base_lci.LCIImporter\n '
if (presamples ==... | Return a LCIImporter object with the inventory as `data` attribute.
:return: LCIImporter object to be imported in a Brightway2 project
:rtype: bw2io.base_lci.LCIImporter | carculator/export.py | write_lci_to_bw | SimonVoelker/carculator | 0 | python | def write_lci_to_bw(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return a LCIImporter object with the inventory as `data` attribute.\n\n :return: LCIImporter object to be imported in a Brightway2 project\n :rtype: bw2io.base_lci.LCIImporter\n '
if (presamples ==... | def write_lci_to_bw(self, presamples, ecoinvent_compatibility, ecoinvent_version):
'\n Return a LCIImporter object with the inventory as `data` attribute.\n\n :return: LCIImporter object to be imported in a Brightway2 project\n :rtype: bw2io.base_lci.LCIImporter\n '
if (presamples ==... |
68e1629ee8b5ede40cc314ad7f9213694decfc709e67be7a60b76c87b9bd976d | def make_pdf(self, dist, params, size=10000):
"Generate distributions's Probability Distribution Function "
import pandas as pd
arg = params[:(- 2)]
loc = params[(- 2)]
scale = params[(- 1)]
start = (dist.ppf(0.01, *arg, loc=loc, scale=scale) if arg else dist.ppf(0.01, loc=loc, scale=scale))
... | Generate distributions's Probability Distribution Function | carculator/export.py | make_pdf | SimonVoelker/carculator | 0 | python | def make_pdf(self, dist, params, size=10000):
" "
import pandas as pd
arg = params[:(- 2)]
loc = params[(- 2)]
scale = params[(- 1)]
start = (dist.ppf(0.01, *arg, loc=loc, scale=scale) if arg else dist.ppf(0.01, loc=loc, scale=scale))
end = (dist.ppf(0.99, *arg, loc=loc, scale=scale) if arg ... | def make_pdf(self, dist, params, size=10000):
" "
import pandas as pd
arg = params[:(- 2)]
loc = params[(- 2)]
scale = params[(- 1)]
start = (dist.ppf(0.01, *arg, loc=loc, scale=scale) if arg else dist.ppf(0.01, loc=loc, scale=scale))
end = (dist.ppf(0.99, *arg, loc=loc, scale=scale) if arg ... |
78172f453840be45a9fab6858fa551770422b85ef3c1638330be5cc843fb1866 | @commands.command(name='SingleShot', aliases=['Shoot'])
async def single_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a single shot attack.\n\n Example:\n !SingleShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.spl... | Performs a Combat roll for a single shot attack.
Example:
!SingleShot reflex, skill, number of dice, dice sides, damage modifier, distance | bots/cogs/cp2020.py | single_shot | BryanOrabutt/discbot | 0 | python | @commands.command(name='SingleShot', aliases=['Shoot'])
async def single_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a single shot attack.\n\n Example:\n !SingleShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.spl... | @commands.command(name='SingleShot', aliases=['Shoot'])
async def single_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a single shot attack.\n\n Example:\n !SingleShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.spl... |
9048ff8e2f44a161de9cdd133340778ac0c6857fdba0aaad6fb224346fccb3af | @commands.command(name='BurstShot', aliases=['Burst'])
async def burst_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a burst attack.\n\n Example:\n !BurstShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.split(',')
... | Performs a Combat roll for a burst attack.
Example:
!BurstShot reflex, skill, number of dice, dice sides, damage modifier, distance | bots/cogs/cp2020.py | burst_shot | BryanOrabutt/discbot | 0 | python | @commands.command(name='BurstShot', aliases=['Burst'])
async def burst_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a burst attack.\n\n Example:\n !BurstShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.split(',')
... | @commands.command(name='BurstShot', aliases=['Burst'])
async def burst_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a burst attack.\n\n Example:\n !BurstShot reflex, skill, number of dice, dice sides, damage modifier, distance\n '
params = msg.split(',')
... |
1fd651124a1510c8e8996671abd85b5dfdce8217b8cb7283b87467c1b3286614 | @commands.command(name='FullAutoShot', aliases=['FAS'])
async def full_auto_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a full auto attack.\n\n Example:\n !FullAutoShot reflex, skill, shotsFired, number of dice, dice sides, damage modifier, distance\n '
p... | Performs a Combat roll for a full auto attack.
Example:
!FullAutoShot reflex, skill, shotsFired, number of dice, dice sides, damage modifier, distance | bots/cogs/cp2020.py | full_auto_shot | BryanOrabutt/discbot | 0 | python | @commands.command(name='FullAutoShot', aliases=['FAS'])
async def full_auto_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a full auto attack.\n\n Example:\n !FullAutoShot reflex, skill, shotsFired, number of dice, dice sides, damage modifier, distance\n '
p... | @commands.command(name='FullAutoShot', aliases=['FAS'])
async def full_auto_shot(self, ctx, *, msg: str):
'\n Performs a Combat roll for a full auto attack.\n\n Example:\n !FullAutoShot reflex, skill, shotsFired, number of dice, dice sides, damage modifier, distance\n '
p... |
2861f7b619250c817b99edf11f9f03b2f6e0c9bf2dba2f30f0aaff350dec50de | def mms_feeps_pad_spinavg(probe='1', data_units='intensity', datatype='electron', data_rate='srvy', level='l2', suffix='', energy=[70, 600], bin_size=16.3636):
"\n This function will spin-average the FEEPS pitch angle distributions\n \n Parameters:\n probe: str\n probe #, e.g., '4' for MM... | This function will spin-average the FEEPS pitch angle distributions
Parameters:
probe: str
probe #, e.g., '4' for MMS4
data_units: str
'intensity' or 'count_rate'
datatype: str
'electron' or 'ion'
data_rate: str
instrument data rate, e.g., 'srvy' or 'brst'
level:... | pyspedas/mms/feeps/mms_feeps_pad_spinavg.py | mms_feeps_pad_spinavg | xnchu/pyspedas | 1 | python | def mms_feeps_pad_spinavg(probe='1', data_units='intensity', datatype='electron', data_rate='srvy', level='l2', suffix=, energy=[70, 600], bin_size=16.3636):
"\n This function will spin-average the FEEPS pitch angle distributions\n \n Parameters:\n probe: str\n probe #, e.g., '4' for MMS4... | def mms_feeps_pad_spinavg(probe='1', data_units='intensity', datatype='electron', data_rate='srvy', level='l2', suffix=, energy=[70, 600], bin_size=16.3636):
"\n This function will spin-average the FEEPS pitch angle distributions\n \n Parameters:\n probe: str\n probe #, e.g., '4' for MMS4... |
3554f5d87f684fee34c882709d4e8efb0ce3e299f54fa13d3eabe3ea691f9a7a | def handle(self):
'Handles a request ignoring dropped connections.'
try:
self.stager = self.server.stager
self.shell = self.stager.shell
self.options = copy.deepcopy(self.server.server.options)
self.loader = core.loader
self.shell.print_verbose(('handler::handle() - Incom... | Handles a request ignoring dropped connections. | core/handler.py | handle | fymore/- | 9 | python | def handle(self):
try:
self.stager = self.server.stager
self.shell = self.stager.shell
self.options = copy.deepcopy(self.server.server.options)
self.loader = core.loader
self.shell.print_verbose(('handler::handle() - Incoming HTTP from %s' % str(self.client_address)))
... | def handle(self):
try:
self.stager = self.server.stager
self.shell = self.stager.shell
self.options = copy.deepcopy(self.server.server.options)
self.loader = core.loader
self.shell.print_verbose(('handler::handle() - Incoming HTTP from %s' % str(self.client_address)))
... |
551d1b43565a6683232d5db514e576a03c481e42886492269aba6f6e4e68f1b6 | @app.get('/graph', status_code=200, tags=['READ', 'Graph'])
def connect_Graph():
' connects to the dgraph server'
global graph_conn
try:
graph_conn = dGraph_conn()
except Exception as e:
logging.error('At connecting to graph DB')
logging.error(e)
raise HTTPException(statu... | connects to the dgraph server | dgraph/dGraph_fastAPI_server.py | connect_Graph | kavitharaju/vachan-graph | 3 | python | @app.get('/graph', status_code=200, tags=['READ', 'Graph'])
def connect_Graph():
' '
global graph_conn
try:
graph_conn = dGraph_conn()
except Exception as e:
logging.error('At connecting to graph DB')
logging.error(e)
raise HTTPException(status_code=502, detail=('Not conn... | @app.get('/graph', status_code=200, tags=['READ', 'Graph'])
def connect_Graph():
' '
global graph_conn
try:
graph_conn = dGraph_conn()
except Exception as e:
logging.error('At connecting to graph DB')
logging.error(e)
raise HTTPException(status_code=502, detail=('Not conn... |
3c532e35f58f0432435ec593ce9d55371d473b5a42f050c0c995dba3f1c65d27 | @app.delete('/graph', status_code=200, tags=['Graph', 'WRITE'])
def delete():
' delete the entire graph'
global graph_conn
try:
res = graph_conn.drop_all()
except Exception as e:
logging.error('At deleting graph DB')
logging.error(e)
raise HTTPException(status_code=502, d... | delete the entire graph | dgraph/dGraph_fastAPI_server.py | delete | kavitharaju/vachan-graph | 3 | python | @app.delete('/graph', status_code=200, tags=['Graph', 'WRITE'])
def delete():
' '
global graph_conn
try:
res = graph_conn.drop_all()
except Exception as e:
logging.error('At deleting graph DB')
logging.error(e)
raise HTTPException(status_code=502, detail=('Graph side erro... | @app.delete('/graph', status_code=200, tags=['Graph', 'WRITE'])
def delete():
' '
global graph_conn
try:
res = graph_conn.drop_all()
except Exception as e:
logging.error('At deleting graph DB')
logging.error(e)
raise HTTPException(status_code=502, detail=('Graph side erro... |
29715075a69eeec3bb5c927d77ba946febabdf0e7f2e10bbe0d7a970765dcc6d | @app.get('/strongs', status_code=200, tags=['READ', 'Strongs Number'])
def get_strongs(strongs_number: Optional[int]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of strongs nodes and their property values.\n\tI... | Get the list of strongs nodes and their property values.
If strongs_number is sepcified, its properties and occurances are returned.
If strongs_number is not present and bbbcccvvv(bbb- 3 letter bookcode, ccc- chapter number in 3 digits, vvv- verse number in 3 digits)
is provided, lists all strongs in that verse, with t... | dgraph/dGraph_fastAPI_server.py | get_strongs | kavitharaju/vachan-graph | 3 | python | @app.get('/strongs', status_code=200, tags=['READ', 'Strongs Number'])
def get_strongs(strongs_number: Optional[int]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of strongs nodes and their property values.\n\tI... | @app.get('/strongs', status_code=200, tags=['READ', 'Strongs Number'])
def get_strongs(strongs_number: Optional[int]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of strongs nodes and their property values.\n\tI... |
138fe6e6f27165191bd20fd71bf058c31537514ac309b88697959e5e4661fe9f | @app.put('/strongs/{strongs_number}', status_code=200, tags=['Strongs Number', 'WRITE'])
def edit_strongs(strongs_number: int, key_values: List[StrongsPropertyValue]=Body(...)):
' Update a property value of selected strongs number node'
logging.info(('input args strongs_number: %s, key_values: %s' % (strongs_nu... | Update a property value of selected strongs number node | dgraph/dGraph_fastAPI_server.py | edit_strongs | kavitharaju/vachan-graph | 3 | python | @app.put('/strongs/{strongs_number}', status_code=200, tags=['Strongs Number', 'WRITE'])
def edit_strongs(strongs_number: int, key_values: List[StrongsPropertyValue]=Body(...)):
' '
logging.info(('input args strongs_number: %s, key_values: %s' % (strongs_number, key_values)))
nquad =
for prop in key_va... | @app.put('/strongs/{strongs_number}', status_code=200, tags=['Strongs Number', 'WRITE'])
def edit_strongs(strongs_number: int, key_values: List[StrongsPropertyValue]=Body(...)):
' '
logging.info(('input args strongs_number: %s, key_values: %s' % (strongs_number, key_values)))
nquad =
for prop in key_va... |
84e6cb1950c63924172906659a8aa91a11f76551471b0ca841a4161964333300 | @app.post('/strongs', status_code=201, tags=['WRITE', 'Strongs Number'])
def add_strongs():
'creates a strongs dictionary.\n\t Collects strongs data from mysql DB and add to graph \n\t '
try:
db = pymysql.connect(host='localhost', database=rel_db_name, user='root', password='password', charset='utf8mb4'... | creates a strongs dictionary.
Collects strongs data from mysql DB and add to graph | dgraph/dGraph_fastAPI_server.py | add_strongs | kavitharaju/vachan-graph | 3 | python | @app.post('/strongs', status_code=201, tags=['WRITE', 'Strongs Number'])
def add_strongs():
'creates a strongs dictionary.\n\t Collects strongs data from mysql DB and add to graph \n\t '
try:
db = pymysql.connect(host='localhost', database=rel_db_name, user='root', password='password', charset='utf8mb4'... | @app.post('/strongs', status_code=201, tags=['WRITE', 'Strongs Number'])
def add_strongs():
'creates a strongs dictionary.\n\t Collects strongs data from mysql DB and add to graph \n\t '
try:
db = pymysql.connect(host='localhost', database=rel_db_name, user='root', password='password', charset='utf8mb4'... |
1be8feeb0d9d35bfada8ada23645b0b9d40baa1c71868427e9314a79665cbdf2 | @app.get('/translationwords', status_code=200, tags=['READ', 'Translation Words'])
def get_translationwords(translation_word: Optional[str]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of Translation word nodes... | Get the list of Translation word nodes and their property values.
If Translation word is sepcified, its properties and occurances are returned.
If Translation word is not present and bbbcccvvv(bbb- 3 letter bookcode, ccc- chapter number in 3 digits, vvv- verse number in 3 digits)
is provided, lists all Translation word... | dgraph/dGraph_fastAPI_server.py | get_translationwords | kavitharaju/vachan-graph | 3 | python | @app.get('/translationwords', status_code=200, tags=['READ', 'Translation Words'])
def get_translationwords(translation_word: Optional[str]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of Translation word nodes... | @app.get('/translationwords', status_code=200, tags=['READ', 'Translation Words'])
def get_translationwords(translation_word: Optional[str]=None, bbbcccvvv: Optional[str]=Query(None, regex='^\\w\\w\\w\\d\\d\\d\\d\\d\\d'), skip: Optional[int]=None, limit: Optional[int]=None):
' Get the list of Translation word nodes... |
4f1e5226810a0776710c35ba2217c801e54f5e24ac2f5397b256e64934ed1a86 | @app.put('/translationwords/{translation_word}', status_code=200, tags=['WRITE', 'Translation Words'])
def edit_translationwords(translation_word: str, key_values: List[TwPropertyValue]=Body(...)):
' Update a property value of selected Translation word'
logging.info(('input args translation_word: %s, key_values... | Update a property value of selected Translation word | dgraph/dGraph_fastAPI_server.py | edit_translationwords | kavitharaju/vachan-graph | 3 | python | @app.put('/translationwords/{translation_word}', status_code=200, tags=['WRITE', 'Translation Words'])
def edit_translationwords(translation_word: str, key_values: List[TwPropertyValue]=Body(...)):
' '
logging.info(('input args translation_word: %s, key_values: %s' % (translation_word, key_values)))
nquad =... | @app.put('/translationwords/{translation_word}', status_code=200, tags=['WRITE', 'Translation Words'])
def edit_translationwords(translation_word: str, key_values: List[TwPropertyValue]=Body(...)):
' '
logging.info(('input args translation_word: %s, key_values: %s' % (translation_word, key_values)))
nquad =... |
7e049584c3634722bc4b4e5719bea7e8e793a62e739108d007cb23381ffdab8e | @app.post('/translationwords', status_code=201, tags=['WRITE', 'Translation Words'])
def add_translationwords():
'creates a translation word dictionary.\n\t Collects tw data from CSV file and adds to graph \n\t '
tw_path = 'Resources/translationWords/tws.csv'
nodename = 'translation words'
dict_node = {... | creates a translation word dictionary.
Collects tw data from CSV file and adds to graph | dgraph/dGraph_fastAPI_server.py | add_translationwords | kavitharaju/vachan-graph | 3 | python | @app.post('/translationwords', status_code=201, tags=['WRITE', 'Translation Words'])
def add_translationwords():
'creates a translation word dictionary.\n\t Collects tw data from CSV file and adds to graph \n\t '
tw_path = 'Resources/translationWords/tws.csv'
nodename = 'translation words'
dict_node = {... | @app.post('/translationwords', status_code=201, tags=['WRITE', 'Translation Words'])
def add_translationwords():
'creates a translation word dictionary.\n\t Collects tw data from CSV file and adds to graph \n\t '
tw_path = 'Resources/translationWords/tws.csv'
nodename = 'translation words'
dict_node = {... |
87d0fafdfc9813105a8499d3e9eaea8b2e7c4fc92017d8d5f9c58ea5e1b19c84 | @app.get('/bibles', status_code=200, tags=['READ', 'Bible Contents'])
def get_bibles(bible_name: Optional[str]=None, language: Optional[str]=None, skip: Optional[int]=None, limit: Optional[int]=None):
' fetches bibles nodes, properties and available books. \n\tIf no query params are given, all bibles in graph are f... | fetches bibles nodes, properties and available books.
If no query params are given, all bibles in graph are fetched.
If bible_name is specified, only that node is returned.
If only language if given, all bible nodes, and details vavailable in that language is returned
Number of items returned can be set using the skip... | dgraph/dGraph_fastAPI_server.py | get_bibles | kavitharaju/vachan-graph | 3 | python | @app.get('/bibles', status_code=200, tags=['READ', 'Bible Contents'])
def get_bibles(bible_name: Optional[str]=None, language: Optional[str]=None, skip: Optional[int]=None, limit: Optional[int]=None):
' fetches bibles nodes, properties and available books. \n\tIf no query params are given, all bibles in graph are f... | @app.get('/bibles', status_code=200, tags=['READ', 'Bible Contents'])
def get_bibles(bible_name: Optional[str]=None, language: Optional[str]=None, skip: Optional[int]=None, limit: Optional[int]=None):
' fetches bibles nodes, properties and available books. \n\tIf no query params are given, all bibles in graph are f... |
2fb834d1bb79d1cce7c674b73d61da90eb6ab8a043e0a5530ab3868a4ff81e08 | @app.put('/bibles/{bible_name}', status_code=200, tags=['WRITE', 'Bible Contents'])
def edit_bible(bible_name: str, key_values: List[BiblePropertyValue]):
' Update a property value of selected bible node'
logging.info(('input args bible_name: %s, key_values: %s' % (bible_name, key_values)))
nquad = ''
f... | Update a property value of selected bible node | dgraph/dGraph_fastAPI_server.py | edit_bible | kavitharaju/vachan-graph | 3 | python | @app.put('/bibles/{bible_name}', status_code=200, tags=['WRITE', 'Bible Contents'])
def edit_bible(bible_name: str, key_values: List[BiblePropertyValue]):
' '
logging.info(('input args bible_name: %s, key_values: %s' % (bible_name, key_values)))
nquad =
for prop in key_values:
nquad += ('uid(u)... | @app.put('/bibles/{bible_name}', status_code=200, tags=['WRITE', 'Bible Contents'])
def edit_bible(bible_name: str, key_values: List[BiblePropertyValue]):
' '
logging.info(('input args bible_name: %s, key_values: %s' % (bible_name, key_values)))
nquad =
for prop in key_values:
nquad += ('uid(u)... |
fdcf295d22e97ec44af1e98b35983cc96022078aa74b31cc6f87c6a5cc6e594c | def normalize_unicode(text, form='NFKC'):
'to normalize text contents before adding them to DB'
return unicodedata.normalize(form, text) | to normalize text contents before adding them to DB | dgraph/dGraph_fastAPI_server.py | normalize_unicode | kavitharaju/vachan-graph | 3 | python | def normalize_unicode(text, form='NFKC'):
return unicodedata.normalize(form, text) | def normalize_unicode(text, form='NFKC'):
return unicodedata.normalize(form, text)<|docstring|>to normalize text contents before adding them to DB<|endoftext|> |
3652a01ef2cf11d971aee0745601deff14dda0bf6d72b4e662c62d03a52ee60a | def parse_usfm(usfm_string):
'converts an uploaded usfm text to a JSON using usfm-grammar'
if isinstance(usfm_string, bytes):
usfm_string = usfm_string.decode('UTF-8')
file = open('temp.usfm', 'w')
file.write(usfm_string)
file.close()
process = subprocess.Popen(['/usr/bin/usfm-grammar te... | converts an uploaded usfm text to a JSON using usfm-grammar | dgraph/dGraph_fastAPI_server.py | parse_usfm | kavitharaju/vachan-graph | 3 | python | def parse_usfm(usfm_string):
if isinstance(usfm_string, bytes):
usfm_string = usfm_string.decode('UTF-8')
file = open('temp.usfm', 'w')
file.write(usfm_string)
file.close()
process = subprocess.Popen(['/usr/bin/usfm-grammar temp.usfm --level=relaxed --filter=scripture'], stdout=subproce... | def parse_usfm(usfm_string):
if isinstance(usfm_string, bytes):
usfm_string = usfm_string.decode('UTF-8')
file = open('temp.usfm', 'w')
file.write(usfm_string)
file.close()
process = subprocess.Popen(['/usr/bin/usfm-grammar temp.usfm --level=relaxed --filter=scripture'], stdout=subproce... |
6ca0d162616850ad7ebc91af95576e59ac63067acff90bb3a1a1646cc72b4a6e | @app.post('/bibles/usfm', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible_usfm(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), usfm_file: UploadFile=File(...)):
'Processes the usfm and adds contents to corresponding bible(creates new bible if not pr... | Processes the usfm and adds contents to corresponding bible(creates new bible if not present already) | dgraph/dGraph_fastAPI_server.py | add_bible_usfm | kavitharaju/vachan-graph | 3 | python | @app.post('/bibles/usfm', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible_usfm(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), usfm_file: UploadFile=File(...)):
usfm = usfm_file.file.read()
connect_Graph()
try:
bibNode_query_res... | @app.post('/bibles/usfm', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible_usfm(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), usfm_file: UploadFile=File(...)):
usfm = usfm_file.file.read()
connect_Graph()
try:
bibNode_query_res... |
c7de5a8e6ff9b3d8adea3622992741e8aa07c2689499832c72ea1983077bd03d | @app.post('/bibles', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), tablename: str=Body('Hin_IRV4_BibleWord'), bookcode: BibleBook=Body(BibleBook.mat)):
' create a bible node, fetches contents from sp... | create a bible node, fetches contents from specified table in MySQL DB and adds to Graph.
Currently the API is implemented to add only one book at a time.
This is due to the amount of time required. | dgraph/dGraph_fastAPI_server.py | add_bible | kavitharaju/vachan-graph | 3 | python | @app.post('/bibles', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), tablename: str=Body('Hin_IRV4_BibleWord'), bookcode: BibleBook=Body(BibleBook.mat)):
' create a bible node, fetches contents from sp... | @app.post('/bibles', status_code=200, tags=['WRITE', 'Bible Contents'])
def add_bible(bible_name: str=Body('Hindi IRV4 bible'), language: str=Body('Hindi'), version: str=Body('IRV4'), tablename: str=Body('Hin_IRV4_BibleWord'), bookcode: BibleBook=Body(BibleBook.mat)):
' create a bible node, fetches contents from sp... |
5329c53ae053be68a58e13572d0e1074a9c2fc5ec7d62bdfe015ed28e391853d | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}', status_code=200, tags=['READ', 'Bible Contents'])
def get_whole_chapter(bible_name: str, bookcode: BibleBook, chapter: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connections\n\t'
result = {}
... | fetches all verses of the chapter
including their strong number, tw and bible name connections | dgraph/dGraph_fastAPI_server.py | get_whole_chapter | kavitharaju/vachan-graph | 3 | python | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}', status_code=200, tags=['READ', 'Bible Contents'])
def get_whole_chapter(bible_name: str, bookcode: BibleBook, chapter: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connections\n\t'
result = {}
... | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}', status_code=200, tags=['READ', 'Bible Contents'])
def get_whole_chapter(bible_name: str, bookcode: BibleBook, chapter: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connections\n\t'
result = {}
... |
26a59acf1c58ba0b91a219dbcddfebc8a032498c72c3afc03f5580a922a0ce6d | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}', status_code=200, tags=['READ', 'Bible Contents'])
def get_one_verse(bible_name: str, bookcode: BibleBook, chapter: int, verse: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connection... | fetches all verses of the chapter
including their strong number, tw and bible name connections | dgraph/dGraph_fastAPI_server.py | get_one_verse | kavitharaju/vachan-graph | 3 | python | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}', status_code=200, tags=['READ', 'Bible Contents'])
def get_one_verse(bible_name: str, bookcode: BibleBook, chapter: int, verse: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connection... | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}', status_code=200, tags=['READ', 'Bible Contents'])
def get_one_verse(bible_name: str, bookcode: BibleBook, chapter: int, verse: int):
' fetches all verses of the chapter \n\tincluding their strong number, tw and bible name connection... |
690a50c826410c121d27be2f0c8dd3f423d99d871b0afbd9524d720afe12a960 | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}/words/{position}', status_code=200, tags=['READ', 'Bible Contents'])
def get_verse_word(bible_name: str, bookcode: BibleBook, chapter: int, verse: int, position: int):
' fetches all verses of the chapter \n\tincluding their strong num... | fetches all verses of the chapter
including their strong number, tw and bible name connections | dgraph/dGraph_fastAPI_server.py | get_verse_word | kavitharaju/vachan-graph | 3 | python | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}/words/{position}', status_code=200, tags=['READ', 'Bible Contents'])
def get_verse_word(bible_name: str, bookcode: BibleBook, chapter: int, verse: int, position: int):
' fetches all verses of the chapter \n\tincluding their strong num... | @app.get('/bibles/{bible_name}/books/{bookcode}/chapters/{chapter}/verses/{verse}/words/{position}', status_code=200, tags=['READ', 'Bible Contents'])
def get_verse_word(bible_name: str, bookcode: BibleBook, chapter: int, verse: int, position: int):
' fetches all verses of the chapter \n\tincluding their strong num... |
b4595fda4c8f817822e370f25ac5886695a709f82996789adab4ad41a662e1cb | @app.post('/names', status_code=201, tags=['WRITE', 'Bible Names'])
def add_names():
'creates a Bible names dictionary.\n\t* Pass I: Collect names from factgrid, ubs and wiki files and add to dictionary.\n\t* Pass II: Connect the names to each other based on known relations\n\t* Pass III: Connects names to each oth... | creates a Bible names dictionary.
* Pass I: Collect names from factgrid, ubs and wiki files and add to dictionary.
* Pass II: Connect the names to each other based on known relations
* Pass III: Connects names to each other using "sameAs" relation
* Pass IV: Connects names to bible Words in English ULB bible | dgraph/dGraph_fastAPI_server.py | add_names | kavitharaju/vachan-graph | 3 | python | @app.post('/names', status_code=201, tags=['WRITE', 'Bible Names'])
def add_names():
'creates a Bible names dictionary.\n\t* Pass I: Collect names from factgrid, ubs and wiki files and add to dictionary.\n\t* Pass II: Connect the names to each other based on known relations\n\t* Pass III: Connects names to each oth... | @app.post('/names', status_code=201, tags=['WRITE', 'Bible Names'])
def add_names():
'creates a Bible names dictionary.\n\t* Pass I: Collect names from factgrid, ubs and wiki files and add to dictionary.\n\t* Pass II: Connect the names to each other based on known relations\n\t* Pass III: Connects names to each oth... |
a4727a61ef56f30bc65e8c24adfcb99031b4b922cfef94a5f7e81f662dcba760 | @app.post('/versification/original', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_orig(versification: dict):
'Create the entire versification structure with the original versification format'
nodename = 'original'
root_node = {'dgraph.type': 'VersificationNode', 'versification': n... | Create the entire versification structure with the original versification format | dgraph/dGraph_fastAPI_server.py | add_versification_orig | kavitharaju/vachan-graph | 3 | python | @app.post('/versification/original', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_orig(versification: dict):
nodename = 'original'
root_node = {'dgraph.type': 'VersificationNode', 'versification': nodename}
root_node_uid = graph_conn.create_data(root_node)
for book in ver... | @app.post('/versification/original', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_orig(versification: dict):
nodename = 'original'
root_node = {'dgraph.type': 'VersificationNode', 'versification': nodename}
root_node_uid = graph_conn.create_data(root_node)
for book in ver... |
f464d341cdd17de2f12e25059b8261d8144c094b43615b709db76f6cfff86a81 | @app.post('/versification/map', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_map(versification: dict, bible_name: str):
'Add maps from verses of selected bible to the original versification structure as per the map'
connect_Graph()
bib_res = graph_conn.query_data(bible_uid_query, ... | Add maps from verses of selected bible to the original versification structure as per the map | dgraph/dGraph_fastAPI_server.py | add_versification_map | kavitharaju/vachan-graph | 3 | python | @app.post('/versification/map', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_map(versification: dict, bible_name: str):
connect_Graph()
bib_res = graph_conn.query_data(bible_uid_query, {'$bib': bible_name})
if (len(bib_res['bible']) < 1):
raise HTTPException('Bible no... | @app.post('/versification/map', status_code=201, tags=['WRITE', 'Versification'])
def add_versification_map(versification: dict, bible_name: str):
connect_Graph()
bib_res = graph_conn.query_data(bible_uid_query, {'$bib': bible_name})
if (len(bib_res['bible']) < 1):
raise HTTPException('Bible no... |
9d65a37f9d20d95785965d5117415ff907e0b292646a6a075656b829a720fc0b | @app.get('/versification/map', status_code=200, tags=['READ', 'Versification'])
def get_versification_map(bible_name: str):
'Gets a text output as given by versification sniffer, if mapping is added for the bible'
versification = {}
versification['maxVerses'] = {}
versification['partialVerses'] = {}
... | Gets a text output as given by versification sniffer, if mapping is added for the bible | dgraph/dGraph_fastAPI_server.py | get_versification_map | kavitharaju/vachan-graph | 3 | python | @app.get('/versification/map', status_code=200, tags=['READ', 'Versification'])
def get_versification_map(bible_name: str):
versification = {}
versification['maxVerses'] = {}
versification['partialVerses'] = {}
versification['verseMappings'] = {}
versification['excludedVerses'] = []
versifi... | @app.get('/versification/map', status_code=200, tags=['READ', 'Versification'])
def get_versification_map(bible_name: str):
versification = {}
versification['maxVerses'] = {}
versification['partialVerses'] = {}
versification['verseMappings'] = {}
versification['excludedVerses'] = []
versifi... |
d9e0ff8a7f677e1ce5373b58d783499e2c06bf1b7e767a416c154ccf843e43d1 | @app.get('/versification/verse', status_code=200, tags=['READ', 'Versification'])
def get_verse_map(bookcode: BibleBook, chapter: int, verse: int):
'Gets all verses mapped to the original verse given by bcv.'
connect_Graph()
var = {'$book': bookcode.upper(), '$chapter': str(chapter), '$verse': str(verse)}
... | Gets all verses mapped to the original verse given by bcv. | dgraph/dGraph_fastAPI_server.py | get_verse_map | kavitharaju/vachan-graph | 3 | python | @app.get('/versification/verse', status_code=200, tags=['READ', 'Versification'])
def get_verse_map(bookcode: BibleBook, chapter: int, verse: int):
connect_Graph()
var = {'$book': bookcode.upper(), '$chapter': str(chapter), '$verse': str(verse)}
mapped_verses = graph_conn.query_data(parallel_versi_vers... | @app.get('/versification/verse', status_code=200, tags=['READ', 'Versification'])
def get_verse_map(bookcode: BibleBook, chapter: int, verse: int):
connect_Graph()
var = {'$book': bookcode.upper(), '$chapter': str(chapter), '$verse': str(verse)}
mapped_verses = graph_conn.query_data(parallel_versi_vers... |
c2b7d7cd92c237f4329c2359036c8e250ec3e4fd25ff1f6303b7b96b0a1e962d | def __iter__(self):
'\n Iterate over all bounding boxes.\n\n Yields\n ------\n BoundingBox\n '
i = 0
while True:
try:
i %= len(self.bounding_boxes)
(yield self.bounding_boxes[i])
i += 1
except ZeroDivisionError:
... | Iterate over all bounding boxes.
Yields
------
BoundingBox | vision/interface.py | __iter__ | cjhr95/IARC-2020 | 12 | python | def __iter__(self):
'\n Iterate over all bounding boxes.\n\n Yields\n ------\n BoundingBox\n '
i = 0
while True:
try:
i %= len(self.bounding_boxes)
(yield self.bounding_boxes[i])
i += 1
except ZeroDivisionError:
... | def __iter__(self):
'\n Iterate over all bounding boxes.\n\n Yields\n ------\n BoundingBox\n '
i = 0
while True:
try:
i %= len(self.bounding_boxes)
(yield self.bounding_boxes[i])
i += 1
except ZeroDivisionError:
... |
9b5e7e88d0459ac2342e67cb45800d32949744ef503359952c470ca6579ce9e8 | def update(self, bounding_boxes):
'\n Update environment.\n\n Parameters\n ----------\n bounding_boxes: list[BoundingBox]\n New environment data.\n '
self.bounding_boxes = bounding_boxes | Update environment.
Parameters
----------
bounding_boxes: list[BoundingBox]
New environment data. | vision/interface.py | update | cjhr95/IARC-2020 | 12 | python | def update(self, bounding_boxes):
'\n Update environment.\n\n Parameters\n ----------\n bounding_boxes: list[BoundingBox]\n New environment data.\n '
self.bounding_boxes = bounding_boxes | def update(self, bounding_boxes):
'\n Update environment.\n\n Parameters\n ----------\n bounding_boxes: list[BoundingBox]\n New environment data.\n '
self.bounding_boxes = bounding_boxes<|docstring|>Update environment.
Parameters
----------
bounding_boxes: list[Bou... |
47e7c431436ac679de8704855f59db55f3b0743ae36d70e72c1190d81812025a | def main():
' main entry point for module execution\n '
OnyxBufferPoolModule.main() | main entry point for module execution | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.py | main | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 17 | python | def main():
' \n '
OnyxBufferPoolModule.main() | def main():
' \n '
OnyxBufferPoolModule.main()<|docstring|>main entry point for module execution<|endoftext|> |
d5c7177704e803b8dcd8aa95b66e3df1900baafd9742e7c2c9969589f907df61 | def init_module(self):
' initialize module\n '
element_spec = dict(name=dict(type='str', required=True), pool_type=dict(choices=['lossless', 'lossy'], default='lossy'), memory_percent=dict(type='float'), switch_priority=dict(type='int'))
argument_spec = dict()
argument_spec.update(element_spec)
... | initialize module | ansible/venv/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_buffer_pool.py | init_module | gvashchenkolineate/gvashchenkolineate_infra_trytravis | 17 | python | def init_module(self):
' \n '
element_spec = dict(name=dict(type='str', required=True), pool_type=dict(choices=['lossless', 'lossy'], default='lossy'), memory_percent=dict(type='float'), switch_priority=dict(type='int'))
argument_spec = dict()
argument_spec.update(element_spec)
self._module =... | def init_module(self):
' \n '
element_spec = dict(name=dict(type='str', required=True), pool_type=dict(choices=['lossless', 'lossy'], default='lossy'), memory_percent=dict(type='float'), switch_priority=dict(type='int'))
argument_spec = dict()
argument_spec.update(element_spec)
self._module =... |
c08f070d851cbc98dd7cf5df22530ae89254446be22e7605d100e93b7b41dfa2 | def autolabel(rects, ax):
'Attach a text label above each bar in *rects*, displaying its height.'
for rect in rects:
height = rect.get_height()
ax.annotate('{:.0f}'.format(height), xy=((rect.get_x() + (rect.get_width() / 2)), height), xytext=(0, 3), textcoords='offset points', ha='center', va='b... | Attach a text label above each bar in *rects*, displaying its height. | functions.py | autolabel | lesh3000/sql_problem | 1 | python | def autolabel(rects, ax):
for rect in rects:
height = rect.get_height()
ax.annotate('{:.0f}'.format(height), xy=((rect.get_x() + (rect.get_width() / 2)), height), xytext=(0, 3), textcoords='offset points', ha='center', va='bottom') | def autolabel(rects, ax):
for rect in rects:
height = rect.get_height()
ax.annotate('{:.0f}'.format(height), xy=((rect.get_x() + (rect.get_width() / 2)), height), xytext=(0, 3), textcoords='offset points', ha='center', va='bottom')<|docstring|>Attach a text label above each bar in *rects*, disp... |
b694a2c26a3cb907531d96b0dc61b0d0c052d33eeb6fad01bef2b0bf5e99b2dc | def loadLog(filePath):
'Loads json from path and converts to dataframe.\n\n Parameters\n ----------\n filePath : str, required\n \n the path of the file\n\n Returns\n ------\n obj\n \n Pandas DataFrame object\n \n '
dirname = os... | Loads json from path and converts to dataframe.
Parameters
----------
filePath : str, required
the path of the file
Returns
------
obj
Pandas DataFrame object | functions.py | loadLog | lesh3000/sql_problem | 1 | python | def loadLog(filePath):
'Loads json from path and converts to dataframe.\n\n Parameters\n ----------\n filePath : str, required\n \n the path of the file\n\n Returns\n ------\n obj\n \n Pandas DataFrame object\n \n '
dirname = os... | def loadLog(filePath):
'Loads json from path and converts to dataframe.\n\n Parameters\n ----------\n filePath : str, required\n \n the path of the file\n\n Returns\n ------\n obj\n \n Pandas DataFrame object\n \n '
dirname = os... |
2fff0dcb9a8dc97973523a9cc7c0a6db5767729fde1c39e60badcda360a2ecbf | def compareDates(df, df1):
'makes comparisons of timelines available in slow and general logs\n -converts string to float\n -calculates and prints timelines of the logs\n -visualizes logs activites(number of requests per minute) in lineplot for each log\n -views and printsdescriptive stats (... | makes comparisons of timelines available in slow and general logs
-converts string to float
-calculates and prints timelines of the logs
-visualizes logs activites(number of requests per minute) in lineplot for each log
-views and printsdescriptive stats (number of requests per minute) for each log
-summarizes the abov... | functions.py | compareDates | lesh3000/sql_problem | 1 | python | def compareDates(df, df1):
'makes comparisons of timelines available in slow and general logs\n -converts string to float\n -calculates and prints timelines of the logs\n -visualizes logs activites(number of requests per minute) in lineplot for each log\n -views and printsdescriptive stats (... | def compareDates(df, df1):
'makes comparisons of timelines available in slow and general logs\n -converts string to float\n -calculates and prints timelines of the logs\n -visualizes logs activites(number of requests per minute) in lineplot for each log\n -views and printsdescriptive stats (... |
d4dcfb2a999d72e60b216bd1f76a9569af79c666ba809a8e76c1f76e21371cc3 | def clean(s):
'- Removes text between */ /*\n - removes spaces in from nad behind the string\n\n Parameters\n ----------\n s : str, required\n \n string to preprocess\n\n Returns\n ------\n s: str\n '
s = re.sub('\\s+', ' ', s)
try:
... | - Removes text between */ /*
- removes spaces in from nad behind the string
Parameters
----------
s : str, required
string to preprocess
Returns
------
s: str | functions.py | clean | lesh3000/sql_problem | 1 | python | def clean(s):
'- Removes text between */ /*\n - removes spaces in from nad behind the string\n\n Parameters\n ----------\n s : str, required\n \n string to preprocess\n\n Returns\n ------\n s: str\n '
s = re.sub('\\s+', ' ', s)
try:
... | def clean(s):
'- Removes text between */ /*\n - removes spaces in from nad behind the string\n\n Parameters\n ----------\n s : str, required\n \n string to preprocess\n\n Returns\n ------\n s: str\n '
s = re.sub('\\s+', ' ', s)
try:
... |
1e9831fad0d4b541cdfeadceffaee4b04f8c7ea0c2b1d1f6828800c107d117bc | def getCapitalWords(df):
'Gets words written in capital letters.\n\n Parameters\n ----------\n df : obj, pandas dataframe\n \n\n Returns\n ------\n list :str\n \n list of strings\n '
arr = set()
for i in df:
try:
for u... | Gets words written in capital letters.
Parameters
----------
df : obj, pandas dataframe
Returns
------
list :str
list of strings | functions.py | getCapitalWords | lesh3000/sql_problem | 1 | python | def getCapitalWords(df):
'Gets words written in capital letters.\n\n Parameters\n ----------\n df : obj, pandas dataframe\n \n\n Returns\n ------\n list :str\n \n list of strings\n '
arr = set()
for i in df:
try:
for u... | def getCapitalWords(df):
'Gets words written in capital letters.\n\n Parameters\n ----------\n df : obj, pandas dataframe\n \n\n Returns\n ------\n list :str\n \n list of strings\n '
arr = set()
for i in df:
try:
for u... |
a39cfd12ce3c763bc6668cd5d1a951ce45d3c66957dae7dfcc59122e32bf1495 | def process_ndex_neighborhood(gene_names, network_id=None, rdf_out='bel_output.rdf', print_output=True):
"Return a BelProcessor for an NDEx network neighborhood.\n\n Parameters\n ----------\n gene_names : list\n A list of HGNC gene symbols to search the neighborhood of.\n Example: ['BRAF', 'M... | Return a BelProcessor for an NDEx network neighborhood.
Parameters
----------
gene_names : list
A list of HGNC gene symbols to search the neighborhood of.
Example: ['BRAF', 'MAP2K1']
network_id : Optional[str]
The UUID of the network in NDEx. By default, the BEL Large Corpus
network is used.
rdf_out : ... | indra/bel/bel_api.py | process_ndex_neighborhood | jmuhlich/indra | 0 | python | def process_ndex_neighborhood(gene_names, network_id=None, rdf_out='bel_output.rdf', print_output=True):
"Return a BelProcessor for an NDEx network neighborhood.\n\n Parameters\n ----------\n gene_names : list\n A list of HGNC gene symbols to search the neighborhood of.\n Example: ['BRAF', 'M... | def process_ndex_neighborhood(gene_names, network_id=None, rdf_out='bel_output.rdf', print_output=True):
"Return a BelProcessor for an NDEx network neighborhood.\n\n Parameters\n ----------\n gene_names : list\n A list of HGNC gene symbols to search the neighborhood of.\n Example: ['BRAF', 'M... |
356568ef6b10a892ddf7695b59ae7a1bdabaf223995934179a1fa1188b6aa22b | def process_belrdf(rdf_str, print_output=True):
'Return a BelProcessor for a BEL/RDF string.\n\n Parameters\n ----------\n rdf_str : str\n A BEL/RDF string to be processed. This will usually come from reading\n a .rdf file.\n\n Returns\n -------\n bp : BelProcessor\n A BelProc... | Return a BelProcessor for a BEL/RDF string.
Parameters
----------
rdf_str : str
A BEL/RDF string to be processed. This will usually come from reading
a .rdf file.
Returns
-------
bp : BelProcessor
A BelProcessor object which contains INDRA Statements in bp.statements.
Notes
-----
This function calls all ... | indra/bel/bel_api.py | process_belrdf | jmuhlich/indra | 0 | python | def process_belrdf(rdf_str, print_output=True):
'Return a BelProcessor for a BEL/RDF string.\n\n Parameters\n ----------\n rdf_str : str\n A BEL/RDF string to be processed. This will usually come from reading\n a .rdf file.\n\n Returns\n -------\n bp : BelProcessor\n A BelProc... | def process_belrdf(rdf_str, print_output=True):
'Return a BelProcessor for a BEL/RDF string.\n\n Parameters\n ----------\n rdf_str : str\n A BEL/RDF string to be processed. This will usually come from reading\n a .rdf file.\n\n Returns\n -------\n bp : BelProcessor\n A BelProc... |
03f3acde8005df8b54da6018bdd9da75268b633125652d5396c4286c3039e810 | def setup_conf():
'Setup the cfg for the clean up utility.\n\n Use separate setup_conf for the utility because there are many options\n from the main config that do not apply during clean-up.\n '
conf = cfg.CONF
cmd.register_cmd_opts(cmd.ovs_opts, conf)
l3_config.register_l3_agent_config_opts(l... | Setup the cfg for the clean up utility.
Use separate setup_conf for the utility because there are many options
from the main config that do not apply during clean-up. | neutron/cmd/ovs_cleanup.py | setup_conf | mmidolesov2/neutron-1 | 1 | python | def setup_conf():
'Setup the cfg for the clean up utility.\n\n Use separate setup_conf for the utility because there are many options\n from the main config that do not apply during clean-up.\n '
conf = cfg.CONF
cmd.register_cmd_opts(cmd.ovs_opts, conf)
l3_config.register_l3_agent_config_opts(l... | def setup_conf():
'Setup the cfg for the clean up utility.\n\n Use separate setup_conf for the utility because there are many options\n from the main config that do not apply during clean-up.\n '
conf = cfg.CONF
cmd.register_cmd_opts(cmd.ovs_opts, conf)
l3_config.register_l3_agent_config_opts(l... |
d75f4794247b325698c5bc982be43cabe12268a67c5d09f471a699571971fa68 | def get_bridge_deletable_ports(br):
"\n Return a list of OVS Bridge ports, excluding the ports who should not be\n cleaned. such ports are tagged with the 'skip_cleanup' key in external_ids.\n "
return [port.port_name for port in br.get_vif_ports() if (constants.SKIP_CLEANUP not in br.get_port_external... | Return a list of OVS Bridge ports, excluding the ports who should not be
cleaned. such ports are tagged with the 'skip_cleanup' key in external_ids. | neutron/cmd/ovs_cleanup.py | get_bridge_deletable_ports | mmidolesov2/neutron-1 | 1 | python | def get_bridge_deletable_ports(br):
"\n Return a list of OVS Bridge ports, excluding the ports who should not be\n cleaned. such ports are tagged with the 'skip_cleanup' key in external_ids.\n "
return [port.port_name for port in br.get_vif_ports() if (constants.SKIP_CLEANUP not in br.get_port_external... | def get_bridge_deletable_ports(br):
"\n Return a list of OVS Bridge ports, excluding the ports who should not be\n cleaned. such ports are tagged with the 'skip_cleanup' key in external_ids.\n "
return [port.port_name for port in br.get_vif_ports() if (constants.SKIP_CLEANUP not in br.get_port_external... |
0322a28700f4f67b534dd5b0da3f2c65a9642fb873fe3e8e5736a7e54f8a3d51 | def collect_neutron_ports(bridges):
'Collect ports created by Neutron from OVS.'
ports = []
for bridge in bridges:
ovs = ovs_lib.OVSBridge(bridge)
ports += get_bridge_deletable_ports(ovs)
return ports | Collect ports created by Neutron from OVS. | neutron/cmd/ovs_cleanup.py | collect_neutron_ports | mmidolesov2/neutron-1 | 1 | python | def collect_neutron_ports(bridges):
ports = []
for bridge in bridges:
ovs = ovs_lib.OVSBridge(bridge)
ports += get_bridge_deletable_ports(ovs)
return ports | def collect_neutron_ports(bridges):
ports = []
for bridge in bridges:
ovs = ovs_lib.OVSBridge(bridge)
ports += get_bridge_deletable_ports(ovs)
return ports<|docstring|>Collect ports created by Neutron from OVS.<|endoftext|> |
3bbee0d0b5810045e260a9511df10a579f6bc422c922ea5f2f9f48129ff463b9 | def delete_neutron_ports(ports):
'Delete non-internal ports created by Neutron\n\n Non-internal OVS ports need to be removed manually.\n '
for port in ports:
device = ip_lib.IPDevice(port)
if device.exists():
device.link.delete()
LOG.info('Deleting port: %s', port) | Delete non-internal ports created by Neutron
Non-internal OVS ports need to be removed manually. | neutron/cmd/ovs_cleanup.py | delete_neutron_ports | mmidolesov2/neutron-1 | 1 | python | def delete_neutron_ports(ports):
'Delete non-internal ports created by Neutron\n\n Non-internal OVS ports need to be removed manually.\n '
for port in ports:
device = ip_lib.IPDevice(port)
if device.exists():
device.link.delete()
LOG.info('Deleting port: %s', port) | def delete_neutron_ports(ports):
'Delete non-internal ports created by Neutron\n\n Non-internal OVS ports need to be removed manually.\n '
for port in ports:
device = ip_lib.IPDevice(port)
if device.exists():
device.link.delete()
LOG.info('Deleting port: %s', port)<... |
d48d90d072114086f30bc312b7f65bf3a4dbee657158d165e8040d455004c2ed | def main():
'Main method for cleaning up OVS bridges.\n\n The utility cleans up the integration bridges used by Neutron.\n '
conf = setup_conf()
conf()
config.setup_logging()
do_main(conf) | Main method for cleaning up OVS bridges.
The utility cleans up the integration bridges used by Neutron. | neutron/cmd/ovs_cleanup.py | main | mmidolesov2/neutron-1 | 1 | python | def main():
'Main method for cleaning up OVS bridges.\n\n The utility cleans up the integration bridges used by Neutron.\n '
conf = setup_conf()
conf()
config.setup_logging()
do_main(conf) | def main():
'Main method for cleaning up OVS bridges.\n\n The utility cleans up the integration bridges used by Neutron.\n '
conf = setup_conf()
conf()
config.setup_logging()
do_main(conf)<|docstring|>Main method for cleaning up OVS bridges.
The utility cleans up the integration bridges used ... |
a4f91b0b8e2b7f5c1897a2c52f1835c4feef7cdadc8a2aded5738d2ab5cc7acf | def sql_to_markdown(sql_query: str, showindex: bool=False):
'Run a SQL querry on the netspeedlogger database and print a table of the results'
if database_has_results():
df = query(sql_query)
print(df.to_markdown(index=showindex))
else:
print('No results - run `netspeedlogger run` fi... | Run a SQL querry on the netspeedlogger database and print a table of the results | netspeedlogger/cli.py | sql_to_markdown | radinplaid/netspeedlogger | 0 | python | def sql_to_markdown(sql_query: str, showindex: bool=False):
if database_has_results():
df = query(sql_query)
print(df.to_markdown(index=showindex))
else:
print('No results - run `netspeedlogger run` first') | def sql_to_markdown(sql_query: str, showindex: bool=False):
if database_has_results():
df = query(sql_query)
print(df.to_markdown(index=showindex))
else:
print('No results - run `netspeedlogger run` first')<|docstring|>Run a SQL querry on the netspeedlogger database and print a tabl... |
48581f9342b7bf5d963eb30dfea8ba43be5bf1d0f2c89d0792c8ee9c76a6dfd4 | def results():
'Show all results from the netspeedlogger database\n\n If there are more than 10000 results, will show the first 10000\n '
sql_to_markdown("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (M... | Show all results from the netspeedlogger database
If there are more than 10000 results, will show the first 10000 | netspeedlogger/cli.py | results | radinplaid/netspeedlogger | 0 | python | def results():
'Show all results from the netspeedlogger database\n\n If there are more than 10000 results, will show the first 10000\n '
sql_to_markdown("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (M... | def results():
'Show all results from the netspeedlogger database\n\n If there are more than 10000 results, will show the first 10000\n '
sql_to_markdown("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (M... |
edae61c729bccb319cf155d3007a1d6547f634c560e0634bcf18048a4e87fde1 | def summary():
'Display summary of internet speed test results as a table'
if database_has_results():
df = query("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (Mb/s)', ping as 'Ping (ms)' from ... | Display summary of internet speed test results as a table | netspeedlogger/cli.py | summary | radinplaid/netspeedlogger | 0 | python | def summary():
if database_has_results():
df = query("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (Mb/s)', ping as 'Ping (ms)' from netspeedlogger ")
print(df.describe().to_markdown(i... | def summary():
if database_has_results():
df = query("select substr(timestamp,1,19) as 'Date Time', download_speed/(1024*1024) as 'Download Speed (Mb/s)', upload_speed/(1024*1024) as 'Upload Speed (Mb/s)', ping as 'Ping (ms)' from netspeedlogger ")
print(df.describe().to_markdown(i... |
4df2214f78d2dcbed7d5e4058eb8bb50a92542387b380acf66b83d35c6d6e77a | def speedtest():
'Run an internet speed test using speedtest-cli and save the results to a local sqlite database'
print('netspeedlogger speedtest')
print(('=' * len('netspeedlogger speedtest')))
print('Starting to run an internet speed test, and logging the output')
results_dict = run_speedtest()
... | Run an internet speed test using speedtest-cli and save the results to a local sqlite database | netspeedlogger/cli.py | speedtest | radinplaid/netspeedlogger | 0 | python | def speedtest():
print('netspeedlogger speedtest')
print(('=' * len('netspeedlogger speedtest')))
print('Starting to run an internet speed test, and logging the output')
results_dict = run_speedtest()
df = speedtest_dict_to_dataframe(results_dict)
write_speedtest_to_database(df)
print('... | def speedtest():
print('netspeedlogger speedtest')
print(('=' * len('netspeedlogger speedtest')))
print('Starting to run an internet speed test, and logging the output')
results_dict = run_speedtest()
df = speedtest_dict_to_dataframe(results_dict)
write_speedtest_to_database(df)
print('... |
89d836977e3548190a6215d1b92523348d642435b76837f0ae670e919ae68bda | def delete_database():
'Run a SQL querry on the netspeedlogger database and print a table of the results'
db_path = get_database_path()
print(f'Deleting netspeedlogger database at path: `{db_path}`')
print("Are you sure you want to delete the whole database? Input 'y' for yes or 'n' for no")
for i i... | Run a SQL querry on the netspeedlogger database and print a table of the results | netspeedlogger/cli.py | delete_database | radinplaid/netspeedlogger | 0 | python | def delete_database():
db_path = get_database_path()
print(f'Deleting netspeedlogger database at path: `{db_path}`')
print("Are you sure you want to delete the whole database? Input 'y' for yes or 'n' for no")
for i in range(10):
confirmation = input("Please type 'y' for Yes or 'n' for No")... | def delete_database():
db_path = get_database_path()
print(f'Deleting netspeedlogger database at path: `{db_path}`')
print("Are you sure you want to delete the whole database? Input 'y' for yes or 'n' for no")
for i in range(10):
confirmation = input("Please type 'y' for Yes or 'n' for No")... |
194f9f4f213fc22ba71a2c93a756b58b424298f3cb7601f7c6c3a3bb8cd0497f | def get_partitions(self, source):
'Process of read partitions data/ground truth'
paths = self._get_partitions(source)
dataset = dict()
for i in self.partitions:
dataset[i] = {'dt': [], 'gt': []}
for item in paths[i]:
img = cv2.imread(os.path.join(source, item[0]), cv2.IMREAD_... | Process of read partitions data/ground truth | src/transform/rimes.py | get_partitions | keyochali/handwritten-text-recognition | 2 | python | def get_partitions(self, source):
paths = self._get_partitions(source)
dataset = dict()
for i in self.partitions:
dataset[i] = {'dt': [], 'gt': []}
for item in paths[i]:
img = cv2.imread(os.path.join(source, item[0]), cv2.IMREAD_GRAYSCALE)
img = np.array(img[(ite... | def get_partitions(self, source):
paths = self._get_partitions(source)
dataset = dict()
for i in self.partitions:
dataset[i] = {'dt': [], 'gt': []}
for item in paths[i]:
img = cv2.imread(os.path.join(source, item[0]), cv2.IMREAD_GRAYSCALE)
img = np.array(img[(ite... |
3f60b1d39849555084fe8eb0d34c90e517a4bfa0a62db1b99c48d339faab5373 | def _get_partitions(self, source):
'Read the partitions file'
def generate(xml, subpath, partition, validation=False):
xml = ET.parse(os.path.join(source, xml)).getroot()
dt = []
for page_tag in xml:
page_path = page_tag.attrib['FileName']
for (i, line_tag) in en... | Read the partitions file | src/transform/rimes.py | _get_partitions | keyochali/handwritten-text-recognition | 2 | python | def _get_partitions(self, source):
def generate(xml, subpath, partition, validation=False):
xml = ET.parse(os.path.join(source, xml)).getroot()
dt = []
for page_tag in xml:
page_path = page_tag.attrib['FileName']
for (i, line_tag) in enumerate(page_tag.iter('Lin... | def _get_partitions(self, source):
def generate(xml, subpath, partition, validation=False):
xml = ET.parse(os.path.join(source, xml)).getroot()
dt = []
for page_tag in xml:
page_path = page_tag.attrib['FileName']
for (i, line_tag) in enumerate(page_tag.iter('Lin... |
16eec2c4e118a67dda121b8f30f28c0df080b0a85fbaad06ac75d866b7bdccb9 | def get_app_sec_failover_hostnames(config_id: Optional[int]=None, opts: Optional[pulumi.InvokeOptions]=None) -> AwaitableGetAppSecFailoverHostnamesResult:
'\n **Scopes**: Security configuration\n\n Returns a list of the failover hostnames in a configuration. The returned information is described in the [List ... | **Scopes**: Security configuration
Returns a list of the failover hostnames in a configuration. The returned information is described in the [List failover hostnames](https://developer.akamai.com/api/cloud_security/application_security/v1.html#getfailoverhostnames) section of the Application Security API.
**Related A... | sdk/python/pulumi_akamai/get_app_sec_failover_hostnames.py | get_app_sec_failover_hostnames | pulumi/pulumi-akamai | 3 | python | def get_app_sec_failover_hostnames(config_id: Optional[int]=None, opts: Optional[pulumi.InvokeOptions]=None) -> AwaitableGetAppSecFailoverHostnamesResult:
'\n **Scopes**: Security configuration\n\n Returns a list of the failover hostnames in a configuration. The returned information is described in the [List ... | def get_app_sec_failover_hostnames(config_id: Optional[int]=None, opts: Optional[pulumi.InvokeOptions]=None) -> AwaitableGetAppSecFailoverHostnamesResult:
'\n **Scopes**: Security configuration\n\n Returns a list of the failover hostnames in a configuration. The returned information is described in the [List ... |
0a41fe5df1928f72cd4445f5ffb7ca84937eca0fb9314a2b5e4079cda68ec434 | @_utilities.lift_output_func(get_app_sec_failover_hostnames)
def get_app_sec_failover_hostnames_output(config_id: Optional[pulumi.Input[int]]=None, opts: Optional[pulumi.InvokeOptions]=None) -> pulumi.Output[GetAppSecFailoverHostnamesResult]:
'\n **Scopes**: Security configuration\n\n Returns a list of the fa... | **Scopes**: Security configuration
Returns a list of the failover hostnames in a configuration. The returned information is described in the [List failover hostnames](https://developer.akamai.com/api/cloud_security/application_security/v1.html#getfailoverhostnames) section of the Application Security API.
**Related A... | sdk/python/pulumi_akamai/get_app_sec_failover_hostnames.py | get_app_sec_failover_hostnames_output | pulumi/pulumi-akamai | 3 | python | @_utilities.lift_output_func(get_app_sec_failover_hostnames)
def get_app_sec_failover_hostnames_output(config_id: Optional[pulumi.Input[int]]=None, opts: Optional[pulumi.InvokeOptions]=None) -> pulumi.Output[GetAppSecFailoverHostnamesResult]:
'\n **Scopes**: Security configuration\n\n Returns a list of the fa... | @_utilities.lift_output_func(get_app_sec_failover_hostnames)
def get_app_sec_failover_hostnames_output(config_id: Optional[pulumi.Input[int]]=None, opts: Optional[pulumi.InvokeOptions]=None) -> pulumi.Output[GetAppSecFailoverHostnamesResult]:
'\n **Scopes**: Security configuration\n\n Returns a list of the fa... |
bcf5b51a327014088b63f706e1dc3987198031e1f0241bd10b06cf4dd5bcb53c | @property
@pulumi.getter
def id(self) -> str:
'\n The provider-assigned unique ID for this managed resource.\n '
return pulumi.get(self, 'id') | The provider-assigned unique ID for this managed resource. | sdk/python/pulumi_akamai/get_app_sec_failover_hostnames.py | id | pulumi/pulumi-akamai | 3 | python | @property
@pulumi.getter
def id(self) -> str:
'\n \n '
return pulumi.get(self, 'id') | @property
@pulumi.getter
def id(self) -> str:
'\n \n '
return pulumi.get(self, 'id')<|docstring|>The provider-assigned unique ID for this managed resource.<|endoftext|> |
99572c002fce0d5ba4f68c8a5eb5890985f89922939bdd4a21d0c5a5bde50671 | def setUp(self):
'Sets up the needed objects used throughout the test.'
self._resolver_context = context.Context()
test_path = self._GetTestFilePath(['fvdetest.qcow2'])
self._SkipIfPathNotExists(test_path)
test_os_path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_OS, locat... | Sets up the needed objects used throughout the test. | tests/vfs/cs_file_system.py | setUp | jaegeral/dfvfs | 0 | python | def setUp(self):
self._resolver_context = context.Context()
test_path = self._GetTestFilePath(['fvdetest.qcow2'])
self._SkipIfPathNotExists(test_path)
test_os_path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_OS, location=test_path)
test_qcow_path_spec = path_spec_fac... | def setUp(self):
self._resolver_context = context.Context()
test_path = self._GetTestFilePath(['fvdetest.qcow2'])
self._SkipIfPathNotExists(test_path)
test_os_path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_OS, location=test_path)
test_qcow_path_spec = path_spec_fac... |
dd029afa706cbbe66b58905cf013e0290da5ca47bd22950a743f7117c7cedf25 | def tearDown(self):
'Cleans up the needed objects used throughout the test.'
self._resolver_context.Empty() | Cleans up the needed objects used throughout the test. | tests/vfs/cs_file_system.py | tearDown | jaegeral/dfvfs | 0 | python | def tearDown(self):
self._resolver_context.Empty() | def tearDown(self):
self._resolver_context.Empty()<|docstring|>Cleans up the needed objects used throughout the test.<|endoftext|> |
e311679ebf1fadbee5b334f89e54b53be7228e5436bdfd770d5f2b0e44a26218 | def testOpenAndClose(self):
'Test the open and close functionality.'
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open() | Test the open and close functionality. | tests/vfs/cs_file_system.py | testOpenAndClose | jaegeral/dfvfs | 0 | python | def testOpenAndClose(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open() | def testOpenAndClose(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()<|docstring|>Test the open and close functionality.<|endoftext|> |
cef935b3d35bd7f3b693e9976023f5b9ce389e1b17ea31959b354471d86f9162 | def testFileEntryExistsByPathSpec(self):
'Test the file entry exists by path specification functionality.'
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(defi... | Test the file entry exists by path specification functionality. | tests/vfs/cs_file_system.py | testFileEntryExistsByPathSpec | jaegeral/dfvfs | 0 | python | def testFileEntryExistsByPathSpec(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_CS, location='/', parent=self._gpt_path_sp... | def testFileEntryExistsByPathSpec(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_CS, location='/', parent=self._gpt_path_sp... |
04412eeb821aa5475e8e0d85edf0856562520aac4aceae2faf8724fa60cc1aeb | def testGetFileEntryByPathSpec(self):
'Tests the GetFileEntryByPathSpec function.'
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_C... | Tests the GetFileEntryByPathSpec function. | tests/vfs/cs_file_system.py | testGetFileEntryByPathSpec | jaegeral/dfvfs | 0 | python | def testGetFileEntryByPathSpec(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_CS, location='/', parent=self._gpt_path_spec)... | def testGetFileEntryByPathSpec(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
path_spec = path_spec_factory.Factory.NewPathSpec(definitions.TYPE_INDICATOR_CS, location='/', parent=self._gpt_path_spec)... |
047a7c44d6ab0e479cb8d1a44de9660ec0f288f579a4313341a383845fd3e575 | def testGetRootFileEntry(self):
'Test the get root file entry functionality.'
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
file_entry = file_system.GetRootFileEntry()
self.assertIsNotNone(file_entry)
... | Test the get root file entry functionality. | tests/vfs/cs_file_system.py | testGetRootFileEntry | jaegeral/dfvfs | 0 | python | def testGetRootFileEntry(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
file_entry = file_system.GetRootFileEntry()
self.assertIsNotNone(file_entry)
self.assertEqual(file_entry.name, ) | def testGetRootFileEntry(self):
file_system = cs_file_system.CSFileSystem(self._resolver_context, self._cs_path_spec)
self.assertIsNotNone(file_system)
file_system.Open()
file_entry = file_system.GetRootFileEntry()
self.assertIsNotNone(file_entry)
self.assertEqual(file_entry.name, )<|docstr... |
732588fec966c5c3dd4f948a56b3a1194703f4e170521ce6c7ac6155fd021cc5 | def f(x):
'Identity'
return x | Identity | python/pyspark/sql/tests/test_udf.py | f | zoujhub/spark | 35,083 | python | def f(x):
return x | def f(x):
return x<|docstring|>Identity<|endoftext|> |
2a9282ce919ffbb7dbf50b63cc526f17a73a961918e1b80d1fb04d08114f7e51 | def download_weightscomp(ascii='ascii2', isotype='some'):
"\n Downloader function for the NIST Atomic Weights and Isotopic Compositions database\n\n Makes a GET request to download data; then extracts preformatted text\n\n Parameters\n ----------\n ascii: str\n GET request parameter, refer to ... | Downloader function for the NIST Atomic Weights and Isotopic Compositions database
Makes a GET request to download data; then extracts preformatted text
Parameters
----------
ascii: str
GET request parameter, refer to the NIST docs
(default: 'ascii')
isotype: str
GET request parameter, refer to the NIST d... | carsus/io/nist/weightscomp.py | download_weightscomp | epassaro/carsus | 21 | python | def download_weightscomp(ascii='ascii2', isotype='some'):
"\n Downloader function for the NIST Atomic Weights and Isotopic Compositions database\n\n Makes a GET request to download data; then extracts preformatted text\n\n Parameters\n ----------\n ascii: str\n GET request parameter, refer to ... | def download_weightscomp(ascii='ascii2', isotype='some'):
"\n Downloader function for the NIST Atomic Weights and Isotopic Compositions database\n\n Makes a GET request to download data; then extracts preformatted text\n\n Parameters\n ----------\n ascii: str\n GET request parameter, refer to ... |
6598327ad814a31f75872e4e452b2ca8da9aa56a9eb0036b8d0163e26f566380 | def prepare_atomic_dataframe(self):
' Returns a new dataframe created from `base` and containing data *only* related to atoms '
atomic = self.base[ATOM_WEIGHT_COLS].reset_index(level=MASS_NUM_COL, drop=True)
atomic = atomic[(~ atomic.index.duplicated())]
atomic = self._prepare_atomic_weights(atomic)
... | Returns a new dataframe created from `base` and containing data *only* related to atoms | carsus/io/nist/weightscomp.py | prepare_atomic_dataframe | epassaro/carsus | 21 | python | def prepare_atomic_dataframe(self):
' '
atomic = self.base[ATOM_WEIGHT_COLS].reset_index(level=MASS_NUM_COL, drop=True)
atomic = atomic[(~ atomic.index.duplicated())]
atomic = self._prepare_atomic_weights(atomic)
atomic = atomic[pd.notnull(atomic[AW_VAL_COL])]
return atomic | def prepare_atomic_dataframe(self):
' '
atomic = self.base[ATOM_WEIGHT_COLS].reset_index(level=MASS_NUM_COL, drop=True)
atomic = atomic[(~ atomic.index.duplicated())]
atomic = self._prepare_atomic_weights(atomic)
atomic = atomic[pd.notnull(atomic[AW_VAL_COL])]
return atomic<|docstring|>Returns ... |
3500eb548c1fc1278ca5adfa4967b43835eb082564ee1248eb37267cf09dedd4 | def prepare_isotope_dataframe(self):
' Returns a new dataframe created from `base` and containing data *only* related to isotopes '
pass | Returns a new dataframe created from `base` and containing data *only* related to isotopes | carsus/io/nist/weightscomp.py | prepare_isotope_dataframe | epassaro/carsus | 21 | python | def prepare_isotope_dataframe(self):
' '
pass | def prepare_isotope_dataframe(self):
' '
pass<|docstring|>Returns a new dataframe created from `base` and containing data *only* related to isotopes<|endoftext|> |
b6b3423dbfbaca40105360cd59726f84fb618cf4d0c391a51815170908be1627 | def ingest(self, atomic_weights=True):
' *Only* ingests atomic weights *for now* '
if (self.parser.base is None):
self.download()
if atomic_weights:
self.ingest_atomic_weights()
self.session.flush() | *Only* ingests atomic weights *for now* | carsus/io/nist/weightscomp.py | ingest | epassaro/carsus | 21 | python | def ingest(self, atomic_weights=True):
' '
if (self.parser.base is None):
self.download()
if atomic_weights:
self.ingest_atomic_weights()
self.session.flush() | def ingest(self, atomic_weights=True):
' '
if (self.parser.base is None):
self.download()
if atomic_weights:
self.ingest_atomic_weights()
self.session.flush()<|docstring|>*Only* ingests atomic weights *for now*<|endoftext|> |
0080836b7e917f90245324cf234b2c35fefc4396ac862cd11015ee2e21f54841 | def _get_version(self):
'Returns NIST Atomic Weights and Isotopic Components\n Database version.\n '
selector = 'td'
html = requests.get(WEIGHTSCOMP_VERSION_URL).text
bs = BeautifulSoup(html, 'html5lib')
version = bs.select(selector)
version = version[0].text.split()[1]
self... | Returns NIST Atomic Weights and Isotopic Components
Database version. | carsus/io/nist/weightscomp.py | _get_version | epassaro/carsus | 21 | python | def _get_version(self):
'Returns NIST Atomic Weights and Isotopic Components\n Database version.\n '
selector = 'td'
html = requests.get(WEIGHTSCOMP_VERSION_URL).text
bs = BeautifulSoup(html, 'html5lib')
version = bs.select(selector)
version = version[0].text.split()[1]
self... | def _get_version(self):
'Returns NIST Atomic Weights and Isotopic Components\n Database version.\n '
selector = 'td'
html = requests.get(WEIGHTSCOMP_VERSION_URL).text
bs = BeautifulSoup(html, 'html5lib')
version = bs.select(selector)
version = version[0].text.split()[1]
self... |
f1f59642a05c51f5b700ac4ff9138cb7101bed85a297786700a3c0a243c0a4dc | def to_hdf(self, fname):
'Dump the `base` attribute into an HDF5 file\n\n Parameters\n ----------\n fname : path\n Path to the HDF5 output file\n '
with pd.HDFStore(fname, 'w') as f:
f.put('/atom_data', self.base, min_itemsize={'symbol': 2, 'name': 15}) | Dump the `base` attribute into an HDF5 file
Parameters
----------
fname : path
Path to the HDF5 output file | carsus/io/nist/weightscomp.py | to_hdf | epassaro/carsus | 21 | python | def to_hdf(self, fname):
'Dump the `base` attribute into an HDF5 file\n\n Parameters\n ----------\n fname : path\n Path to the HDF5 output file\n '
with pd.HDFStore(fname, 'w') as f:
f.put('/atom_data', self.base, min_itemsize={'symbol': 2, 'name': 15}) | def to_hdf(self, fname):
'Dump the `base` attribute into an HDF5 file\n\n Parameters\n ----------\n fname : path\n Path to the HDF5 output file\n '
with pd.HDFStore(fname, 'w') as f:
f.put('/atom_data', self.base, min_itemsize={'symbol': 2, 'name': 15})<|docstring|>... |
934635ecf3d36384c1af2d3e35800e0a6ba146fb3805f1e5599eb04ea0b94491 | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadFromDataset\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which... | DESCRIPTION
-----------
The Constructor for LoadFromDataset
Parameters
-----------
id : bci_lib.ID
id of the stage
database : bci_lib.Database
The dictionary which we held all our data in and it's accessible from all stages
inputs : Tuple[ID, ...]
It's the tuple of some ids(bci_lib.ID) of ... | bci_lib/Stages/LoadData/LoadData.py | __init__ | SahandSadeghpour/bci_lib | 0 | python | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadFromDataset\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which... | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadFromDataset\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which... |
ab49ae644720d0dd6cacdfe62e4ea5c53fa30fb4b491f9c538525cc8c3300ed0 | def set_params(self, dataset: dict, save_in_cache: bool=True):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad From Dataset\n\n\t\tParameter\n\t\t-----------\n\t\tdataset : dict or list\n\n\t\tsave_in_cache: bool | True\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data_info': dataset... | DESCRIPTION
-----------
Load From Dataset
Parameter
-----------
dataset : dict or list
save_in_cache: bool | True
Example
-----------
----------- | bci_lib/Stages/LoadData/LoadData.py | set_params | SahandSadeghpour/bci_lib | 0 | python | def set_params(self, dataset: dict, save_in_cache: bool=True):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad From Dataset\n\n\t\tParameter\n\t\t-----------\n\t\tdataset : dict or list\n\n\t\tsave_in_cache: bool | True\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data_info': dataset... | def set_params(self, dataset: dict, save_in_cache: bool=True):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad From Dataset\n\n\t\tParameter\n\t\t-----------\n\t\tdataset : dict or list\n\n\t\tsave_in_cache: bool | True\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data_info': dataset... |
c6782d79222d5a7e994d06e59171595a87369eea71ef0bea932c46caff9666b9 | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the data from datasets and save it on database\n\t\t-----------\n\t\t'
params = self.get_params()
outputs = self._outputs
data = Dataset.load(**params)
self._set_output(data, outputs[0])
self._finish() | DESCRIPTION
-----------
Import the data from datasets and save it on database
----------- | bci_lib/Stages/LoadData/LoadData.py | do_task | SahandSadeghpour/bci_lib | 0 | python | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the data from datasets and save it on database\n\t\t-----------\n\t\t'
params = self.get_params()
outputs = self._outputs
data = Dataset.load(**params)
self._set_output(data, outputs[0])
self._finish() | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the data from datasets and save it on database\n\t\t-----------\n\t\t'
params = self.get_params()
outputs = self._outputs
data = Dataset.load(**params)
self._set_output(data, outputs[0])
self._finish()<|docstring|>DESCRIPTION
---... |
a93834e0c407387999bb48ce408b30bb68bda22c53e4239be1171a35e201e131 | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadRaw\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we held... | DESCRIPTION
-----------
The Constructor for LoadRaw
Parameters
-----------
id : bci_lib.ID
id of the stage
database : bci_lib.Database
The dictionary which we held all our data in and it's accessible from all stages
inputs : Tuple[ID, ...]
It's the tuple of some ids(bci_lib.ID) of input da... | bci_lib/Stages/LoadData/LoadData.py | __init__ | SahandSadeghpour/bci_lib | 0 | python | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadRaw\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we held... | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadRaw\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we held... |
67e6ab5ebbff9898771d8c97c3bdea4e9d56d77cbe166c37a190ba793b4954d0 | def set_params(self, rawdata: mne.io.Raw):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad raw data\n\n\t\tParameter\n\t\t-----------\n\t\trawdata : Instance of mne.io.Raw\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data': rawdata}
return self._params | DESCRIPTION
-----------
Load raw data
Parameter
-----------
rawdata : Instance of mne.io.Raw
Example
-----------
----------- | bci_lib/Stages/LoadData/LoadData.py | set_params | SahandSadeghpour/bci_lib | 0 | python | def set_params(self, rawdata: mne.io.Raw):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad raw data\n\n\t\tParameter\n\t\t-----------\n\t\trawdata : Instance of mne.io.Raw\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data': rawdata}
return self._params | def set_params(self, rawdata: mne.io.Raw):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tLoad raw data\n\n\t\tParameter\n\t\t-----------\n\t\trawdata : Instance of mne.io.Raw\n\n\t\tExample\n\t\t-----------\n\n\t\t-----------\n\t\t'
self._params = {'data': rawdata}
return self._params<|docstring|>DESCRIPTION
---... |
66490ace81b37022ffbe184f59c70fae9251f3a0615934fc782be91b65a1176e | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the raw data from user and save it on database\n\t\t-----------\n\t\t'
raw = self._params.pop('data')
output = RawData(self._outputs[0], raw)
self._set_output(output, self._outputs[0]) | DESCRIPTION
-----------
Import the raw data from user and save it on database
----------- | bci_lib/Stages/LoadData/LoadData.py | do_task | SahandSadeghpour/bci_lib | 0 | python | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the raw data from user and save it on database\n\t\t-----------\n\t\t'
raw = self._params.pop('data')
output = RawData(self._outputs[0], raw)
self._set_output(output, self._outputs[0]) | def do_task(self):
'\n\t\tDESCRIPTION\n\t\t-----------\n\t\tImport the raw data from user and save it on database\n\t\t-----------\n\t\t'
raw = self._params.pop('data')
output = RawData(self._outputs[0], raw)
self._set_output(output, self._outputs[0])<|docstring|>DESCRIPTION
-----------
Import the raw d... |
4cd467ebba479fb54b0a35d03e7a0a7b13583fac8ef63d7d4ab9613b3e207394 | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadEpochs\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we h... | DESCRIPTION
-----------
The Constructor for LoadEpochs
Parameters
-----------
id : bci_lib.ID
id of the stage
database : bci_lib.Database
The dictionary which we held all our data in and it's accessible from all stages
inputs : Tuple[ID, ...]
It's the tuple of some ids(bci_lib.ID) of input... | bci_lib/Stages/LoadData/LoadData.py | __init__ | SahandSadeghpour/bci_lib | 0 | python | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadEpochs\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we h... | def __init__(self, id: ID, database: Database, outputs: Tuple[ID], mark_as_test: bool=False):
"\n\t\tDESCRIPTION\n\t\t-----------\n\t\tThe Constructor for LoadEpochs\n\n\t\tParameters\n\t\t-----------\n\t\tid : bci_lib.ID\n\n\t\t\tid of the stage\n\n\t\tdatabase : bci_lib.Database\n\n\t\t\tThe dictionary which we h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.