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
9f89ef537db0ca912ad609f7bb9a1549b709f82c239dc1f1e49af398c4735b49
def _update_dependent_attributes_(self) -> None: '\n Atualiza atributos que tem dependências de tempo ou de outros atibutos que podem mudar\n ' print('Atualizando atributos dependentes.') (self.date, self.time) = get_current_time_and_data() self.image_name = ((((((((('#' + str(self.training_idx)) + '|') + self.date) + '|') + self.time) + '|') + '|epoch=') + str((self.last_epoch + self.number_of_epochs))) + '.png') self.sub_dir_0 = 'Relatorios-Dados-etc/Resultados/' self.sub_dir_1 = (self.dataset_name + '/') self.sub_dir_2 = (self.model_name.replace('.json', '') + '/') self.sub_dir_3 = (str(self.training_idx) + '/') self.data_path = (((self.sub_dir_0 + self.sub_dir_1) + self.sub_dir_2) + self.sub_dir_3) csv_name: str = (('csv-#' + str(self.training_idx)) + '.log') self.csv_pathname: str = (self.data_path + csv_name) self.last_epoch: int = get_last_epoch(self.csv_pathname) self.model_save_pathname: str = (((self.data_path + '#') + str(self.training_idx)) + '-checkp')
Atualiza atributos que tem dependências de tempo ou de outros atibutos que podem mudar
old/automatic_training.py
_update_dependent_attributes_
AlanPXD/IC-AutoEncoder
0
python
def _update_dependent_attributes_(self) -> None: '\n \n ' print('Atualizando atributos dependentes.') (self.date, self.time) = get_current_time_and_data() self.image_name = ((((((((('#' + str(self.training_idx)) + '|') + self.date) + '|') + self.time) + '|') + '|epoch=') + str((self.last_epoch + self.number_of_epochs))) + '.png') self.sub_dir_0 = 'Relatorios-Dados-etc/Resultados/' self.sub_dir_1 = (self.dataset_name + '/') self.sub_dir_2 = (self.model_name.replace('.json', ) + '/') self.sub_dir_3 = (str(self.training_idx) + '/') self.data_path = (((self.sub_dir_0 + self.sub_dir_1) + self.sub_dir_2) + self.sub_dir_3) csv_name: str = (('csv-#' + str(self.training_idx)) + '.log') self.csv_pathname: str = (self.data_path + csv_name) self.last_epoch: int = get_last_epoch(self.csv_pathname) self.model_save_pathname: str = (((self.data_path + '#') + str(self.training_idx)) + '-checkp')
def _update_dependent_attributes_(self) -> None: '\n \n ' print('Atualizando atributos dependentes.') (self.date, self.time) = get_current_time_and_data() self.image_name = ((((((((('#' + str(self.training_idx)) + '|') + self.date) + '|') + self.time) + '|') + '|epoch=') + str((self.last_epoch + self.number_of_epochs))) + '.png') self.sub_dir_0 = 'Relatorios-Dados-etc/Resultados/' self.sub_dir_1 = (self.dataset_name + '/') self.sub_dir_2 = (self.model_name.replace('.json', ) + '/') self.sub_dir_3 = (str(self.training_idx) + '/') self.data_path = (((self.sub_dir_0 + self.sub_dir_1) + self.sub_dir_2) + self.sub_dir_3) csv_name: str = (('csv-#' + str(self.training_idx)) + '.log') self.csv_pathname: str = (self.data_path + csv_name) self.last_epoch: int = get_last_epoch(self.csv_pathname) self.model_save_pathname: str = (((self.data_path + '#') + str(self.training_idx)) + '-checkp')<|docstring|>Atualiza atributos que tem dependências de tempo ou de outros atibutos que podem mudar<|endoftext|>
0acfcfdf7bda56b6b7793f0f523118b1cb96e23a8abce36dbaaf1827d3e5a9b5
def change_attributes(self, kw_att_and_val: dict) -> None: "\n ## Função:\n\n Muda determinados atributos especificadoes na forma de keyword e valor.\n\n ## Retorna:\n\n Sem retorno\n\n ## Exemplo:\n \n Caso queira mudar o nome do modelo a ser usado e do otimizador escreva:\n\n >>> Kw_att_and_val = {'model_name': 'nome', 'optimizer': optimizer_class}\n # note que 'model_name' e 'optimizer' são atributos de Auto_training\n " print('Mudando atributos selecionados') def recursive_update(dictionary: dict, Kw): for (key, value) in Kw.items(): if (type(value) == dict): if (key[0] == '*'): dictionary[key[1:]] = value else: recursive_update(dictionary[key], value) else: dictionary[key] = value recursive_update(self.__dict__, kw_att_and_val) self._update_dependent_attributes_()
## Função: Muda determinados atributos especificadoes na forma de keyword e valor. ## Retorna: Sem retorno ## Exemplo: Caso queira mudar o nome do modelo a ser usado e do otimizador escreva: >>> Kw_att_and_val = {'model_name': 'nome', 'optimizer': optimizer_class} # note que 'model_name' e 'optimizer' são atributos de Auto_training
old/automatic_training.py
change_attributes
AlanPXD/IC-AutoEncoder
0
python
def change_attributes(self, kw_att_and_val: dict) -> None: "\n ## Função:\n\n Muda determinados atributos especificadoes na forma de keyword e valor.\n\n ## Retorna:\n\n Sem retorno\n\n ## Exemplo:\n \n Caso queira mudar o nome do modelo a ser usado e do otimizador escreva:\n\n >>> Kw_att_and_val = {'model_name': 'nome', 'optimizer': optimizer_class}\n # note que 'model_name' e 'optimizer' são atributos de Auto_training\n " print('Mudando atributos selecionados') def recursive_update(dictionary: dict, Kw): for (key, value) in Kw.items(): if (type(value) == dict): if (key[0] == '*'): dictionary[key[1:]] = value else: recursive_update(dictionary[key], value) else: dictionary[key] = value recursive_update(self.__dict__, kw_att_and_val) self._update_dependent_attributes_()
def change_attributes(self, kw_att_and_val: dict) -> None: "\n ## Função:\n\n Muda determinados atributos especificadoes na forma de keyword e valor.\n\n ## Retorna:\n\n Sem retorno\n\n ## Exemplo:\n \n Caso queira mudar o nome do modelo a ser usado e do otimizador escreva:\n\n >>> Kw_att_and_val = {'model_name': 'nome', 'optimizer': optimizer_class}\n # note que 'model_name' e 'optimizer' são atributos de Auto_training\n " print('Mudando atributos selecionados') def recursive_update(dictionary: dict, Kw): for (key, value) in Kw.items(): if (type(value) == dict): if (key[0] == '*'): dictionary[key[1:]] = value else: recursive_update(dictionary[key], value) else: dictionary[key] = value recursive_update(self.__dict__, kw_att_and_val) self._update_dependent_attributes_()<|docstring|>## Função: Muda determinados atributos especificadoes na forma de keyword e valor. ## Retorna: Sem retorno ## Exemplo: Caso queira mudar o nome do modelo a ser usado e do otimizador escreva: >>> Kw_att_and_val = {'model_name': 'nome', 'optimizer': optimizer_class} # note que 'model_name' e 'optimizer' são atributos de Auto_training<|endoftext|>
2bd85389fddbf450cf88b4605b1acb830e5e36258c667ab4829aa33ae6eccd60
def save_state(self) -> None: '\n ## Função :\n\n Salva o estado atual do objeto.\n ' print('Saving the actual state.') self._check_if_dirs_exists_() with open(self.state_pathname, 'wb') as file: pickle.dump(self.state, file, pickle.HIGHEST_PROTOCOL) file.close()
## Função : Salva o estado atual do objeto.
old/automatic_training.py
save_state
AlanPXD/IC-AutoEncoder
0
python
def save_state(self) -> None: '\n ## Função :\n\n Salva o estado atual do objeto.\n ' print('Saving the actual state.') self._check_if_dirs_exists_() with open(self.state_pathname, 'wb') as file: pickle.dump(self.state, file, pickle.HIGHEST_PROTOCOL) file.close()
def save_state(self) -> None: '\n ## Função :\n\n Salva o estado atual do objeto.\n ' print('Saving the actual state.') self._check_if_dirs_exists_() with open(self.state_pathname, 'wb') as file: pickle.dump(self.state, file, pickle.HIGHEST_PROTOCOL) file.close()<|docstring|>## Função : Salva o estado atual do objeto.<|endoftext|>
e676fe766e68473cc911a683d848e987feb8f0fc884ba7e9a60ac67c430c69b0
def load_state(self) -> None: '\n ## Função :\n\n Carrega o estado armazenado no arquivo\n ' print('Loading the actual state.') if file_exists(self.state_pathname): with open(self.state_pathname, 'rb') as file: previous_obj: Training_State = pickle.load(file) self.state = previous_obj file.close()
## Função : Carrega o estado armazenado no arquivo
old/automatic_training.py
load_state
AlanPXD/IC-AutoEncoder
0
python
def load_state(self) -> None: '\n ## Função :\n\n Carrega o estado armazenado no arquivo\n ' print('Loading the actual state.') if file_exists(self.state_pathname): with open(self.state_pathname, 'rb') as file: previous_obj: Training_State = pickle.load(file) self.state = previous_obj file.close()
def load_state(self) -> None: '\n ## Função :\n\n Carrega o estado armazenado no arquivo\n ' print('Loading the actual state.') if file_exists(self.state_pathname): with open(self.state_pathname, 'rb') as file: previous_obj: Training_State = pickle.load(file) self.state = previous_obj file.close()<|docstring|>## Função : Carrega o estado armazenado no arquivo<|endoftext|>
59c91dc45371c50ff015b3dc9c0f337bf3027dd26a6da60ced6c8ec53ed9e151
def _check_if_dirs_exists_(self) -> None: '\n ## Função:\n\n Verifica se todos os diretórios que compoem os diretorios existem.\n E no caso de não existirem, o método cria esses diretórios.\n\n ## Exemplo: \n * `Relatorios-Dados-etc/Imagens de resultados`\n\n São dois diretórios, ambos serão criados caso ja não existam na pasta\n onde o programa é executado.\n ' print('checking if the dirs exists') if (not isdir(dirname(self.state.csv_pathname))): makedirs(dirname(self.state.csv_pathname)) if (not isdir(dirname(self.state.data_path))): makedirs(dirname(self.state.data_path)) if (not isdir(dirname(self.state_pathname))): makedirs(dirname(self.state_pathname)) if (not isdir(dirname(self.state.dataframe_pathname))): makedirs(dirname(self.state.dataframe_pathname)) if (not isdir(dirname(self.state.model_save_pathname))): makedirs(dirname(self.state.model_save_pathname))
## Função: Verifica se todos os diretórios que compoem os diretorios existem. E no caso de não existirem, o método cria esses diretórios. ## Exemplo: * `Relatorios-Dados-etc/Imagens de resultados` São dois diretórios, ambos serão criados caso ja não existam na pasta onde o programa é executado.
old/automatic_training.py
_check_if_dirs_exists_
AlanPXD/IC-AutoEncoder
0
python
def _check_if_dirs_exists_(self) -> None: '\n ## Função:\n\n Verifica se todos os diretórios que compoem os diretorios existem.\n E no caso de não existirem, o método cria esses diretórios.\n\n ## Exemplo: \n * `Relatorios-Dados-etc/Imagens de resultados`\n\n São dois diretórios, ambos serão criados caso ja não existam na pasta\n onde o programa é executado.\n ' print('checking if the dirs exists') if (not isdir(dirname(self.state.csv_pathname))): makedirs(dirname(self.state.csv_pathname)) if (not isdir(dirname(self.state.data_path))): makedirs(dirname(self.state.data_path)) if (not isdir(dirname(self.state_pathname))): makedirs(dirname(self.state_pathname)) if (not isdir(dirname(self.state.dataframe_pathname))): makedirs(dirname(self.state.dataframe_pathname)) if (not isdir(dirname(self.state.model_save_pathname))): makedirs(dirname(self.state.model_save_pathname))
def _check_if_dirs_exists_(self) -> None: '\n ## Função:\n\n Verifica se todos os diretórios que compoem os diretorios existem.\n E no caso de não existirem, o método cria esses diretórios.\n\n ## Exemplo: \n * `Relatorios-Dados-etc/Imagens de resultados`\n\n São dois diretórios, ambos serão criados caso ja não existam na pasta\n onde o programa é executado.\n ' print('checking if the dirs exists') if (not isdir(dirname(self.state.csv_pathname))): makedirs(dirname(self.state.csv_pathname)) if (not isdir(dirname(self.state.data_path))): makedirs(dirname(self.state.data_path)) if (not isdir(dirname(self.state_pathname))): makedirs(dirname(self.state_pathname)) if (not isdir(dirname(self.state.dataframe_pathname))): makedirs(dirname(self.state.dataframe_pathname)) if (not isdir(dirname(self.state.model_save_pathname))): makedirs(dirname(self.state.model_save_pathname))<|docstring|>## Função: Verifica se todos os diretórios que compoem os diretorios existem. E no caso de não existirem, o método cria esses diretórios. ## Exemplo: * `Relatorios-Dados-etc/Imagens de resultados` São dois diretórios, ambos serão criados caso ja não existam na pasta onde o programa é executado.<|endoftext|>
c7b307dad5a9b1e0a06b15294810bad35bb66cdb878695f1becaab554755fb57
def _load_model_(self) -> Model: '\n ## Função:\n\n Carrega o modelo de rede neural definido no atributo `model_name`, \n junto dos pesos armazenados no checkpoint definido no atibuto `checkpoint_name`\n ' print('Trying to load a previous state of training.') if file_exists(self.state.model_save_pathname): nNet: Model = load_model(self.state.model_save_pathname, custom_objects={self.state.loss().name: self.state.loss}, compile=True) print('Previous state loaded.') return nNet print('Loading just the model.') try: json_file = open((self.state.models_dir + self.state.model_name), 'r') except FileNotFoundError: raise Exception(((('Fail attempt to load the model ' + self.state.model_name) + ' at ') + self.state.models_dir)) json_readed = json_file.read() nNet: Model = model_from_json(json_readed) json_file.close() return nNet
## Função: Carrega o modelo de rede neural definido no atributo `model_name`, junto dos pesos armazenados no checkpoint definido no atibuto `checkpoint_name`
old/automatic_training.py
_load_model_
AlanPXD/IC-AutoEncoder
0
python
def _load_model_(self) -> Model: '\n ## Função:\n\n Carrega o modelo de rede neural definido no atributo `model_name`, \n junto dos pesos armazenados no checkpoint definido no atibuto `checkpoint_name`\n ' print('Trying to load a previous state of training.') if file_exists(self.state.model_save_pathname): nNet: Model = load_model(self.state.model_save_pathname, custom_objects={self.state.loss().name: self.state.loss}, compile=True) print('Previous state loaded.') return nNet print('Loading just the model.') try: json_file = open((self.state.models_dir + self.state.model_name), 'r') except FileNotFoundError: raise Exception(((('Fail attempt to load the model ' + self.state.model_name) + ' at ') + self.state.models_dir)) json_readed = json_file.read() nNet: Model = model_from_json(json_readed) json_file.close() return nNet
def _load_model_(self) -> Model: '\n ## Função:\n\n Carrega o modelo de rede neural definido no atributo `model_name`, \n junto dos pesos armazenados no checkpoint definido no atibuto `checkpoint_name`\n ' print('Trying to load a previous state of training.') if file_exists(self.state.model_save_pathname): nNet: Model = load_model(self.state.model_save_pathname, custom_objects={self.state.loss().name: self.state.loss}, compile=True) print('Previous state loaded.') return nNet print('Loading just the model.') try: json_file = open((self.state.models_dir + self.state.model_name), 'r') except FileNotFoundError: raise Exception(((('Fail attempt to load the model ' + self.state.model_name) + ' at ') + self.state.models_dir)) json_readed = json_file.read() nNet: Model = model_from_json(json_readed) json_file.close() return nNet<|docstring|>## Função: Carrega o modelo de rede neural definido no atributo `model_name`, junto dos pesos armazenados no checkpoint definido no atibuto `checkpoint_name`<|endoftext|>
c0aee458bb1d69435e2d1bd5499f29f382476225af72bd3abbcb248a4ddb52e7
def _get_last_epoch_(self) -> int: '\n ## Função:\n\n Retorna a ultima época treinada de um checkpoint. \n\n obs: retorna -1 quando nenhum treino foi realizado para o treino inciar na época 0.\n ' last_epoch: int if file_exists(self.state.csv_pathname): dataframe = self.get_csv_training_history() if dataframe.empty: last_epoch = (- 1) else: last_epoch = dataframe['epoch'].tolist()[(- 1)] else: last_epoch = (- 1) return last_epoch
## Função: Retorna a ultima época treinada de um checkpoint. obs: retorna -1 quando nenhum treino foi realizado para o treino inciar na época 0.
old/automatic_training.py
_get_last_epoch_
AlanPXD/IC-AutoEncoder
0
python
def _get_last_epoch_(self) -> int: '\n ## Função:\n\n Retorna a ultima época treinada de um checkpoint. \n\n obs: retorna -1 quando nenhum treino foi realizado para o treino inciar na época 0.\n ' last_epoch: int if file_exists(self.state.csv_pathname): dataframe = self.get_csv_training_history() if dataframe.empty: last_epoch = (- 1) else: last_epoch = dataframe['epoch'].tolist()[(- 1)] else: last_epoch = (- 1) return last_epoch
def _get_last_epoch_(self) -> int: '\n ## Função:\n\n Retorna a ultima época treinada de um checkpoint. \n\n obs: retorna -1 quando nenhum treino foi realizado para o treino inciar na época 0.\n ' last_epoch: int if file_exists(self.state.csv_pathname): dataframe = self.get_csv_training_history() if dataframe.empty: last_epoch = (- 1) else: last_epoch = dataframe['epoch'].tolist()[(- 1)] else: last_epoch = (- 1) return last_epoch<|docstring|>## Função: Retorna a ultima época treinada de um checkpoint. obs: retorna -1 quando nenhum treino foi realizado para o treino inciar na época 0.<|endoftext|>
3ad2469910f05b158617b0fb64539227b258ce5029e6216ddc732c64e5a39ba2
def start_training(self) -> None: '\n ## Function:\n\n Starts the training\n\n ## Receives:\n\n Nothing\n\n ## Returns:\n\n None\n\n ## Examples:\n\n ...\n \n ## Raises:\n\n Nothing.\n ' dataset: DataSet = DataSet() dataset.load_by_name(self.state.dataset_name) x_train = dataset.x_train x_test = dataset.x_test y_train = dataset.y_train y_test = dataset.y_test neural_net: Model = self._load_model_() neural_net.compile(optimizer=self.state.optimizer(**self.state.optimizer_kwargs), loss=self.state.loss(**self.state.loss_kwargs), **self.state.compile_kwargs) self._check_if_dirs_exists_() csv_logger = CSVLogger(filename=self.state.csv_pathname, separator=';', append=True) standard_callbacks: list = [csv_logger] neural_net.fit(x=x_train, y=y_train, validation_data=(x_test, y_test), initial_epoch=(self._get_last_epoch_() + 1), callbacks=standard_callbacks, epochs=((self.state.last_epoch + self.state.number_of_epochs) + 1), **self.state.fit_Kwargs) neural_net.save(filepath=self.state.model_save_pathname) self.save_data_to_dataframe() self.state._update_dependent_attributes_() self.save_state()
## Function: Starts the training ## Receives: Nothing ## Returns: None ## Examples: ... ## Raises: Nothing.
old/automatic_training.py
start_training
AlanPXD/IC-AutoEncoder
0
python
def start_training(self) -> None: '\n ## Function:\n\n Starts the training\n\n ## Receives:\n\n Nothing\n\n ## Returns:\n\n None\n\n ## Examples:\n\n ...\n \n ## Raises:\n\n Nothing.\n ' dataset: DataSet = DataSet() dataset.load_by_name(self.state.dataset_name) x_train = dataset.x_train x_test = dataset.x_test y_train = dataset.y_train y_test = dataset.y_test neural_net: Model = self._load_model_() neural_net.compile(optimizer=self.state.optimizer(**self.state.optimizer_kwargs), loss=self.state.loss(**self.state.loss_kwargs), **self.state.compile_kwargs) self._check_if_dirs_exists_() csv_logger = CSVLogger(filename=self.state.csv_pathname, separator=';', append=True) standard_callbacks: list = [csv_logger] neural_net.fit(x=x_train, y=y_train, validation_data=(x_test, y_test), initial_epoch=(self._get_last_epoch_() + 1), callbacks=standard_callbacks, epochs=((self.state.last_epoch + self.state.number_of_epochs) + 1), **self.state.fit_Kwargs) neural_net.save(filepath=self.state.model_save_pathname) self.save_data_to_dataframe() self.state._update_dependent_attributes_() self.save_state()
def start_training(self) -> None: '\n ## Function:\n\n Starts the training\n\n ## Receives:\n\n Nothing\n\n ## Returns:\n\n None\n\n ## Examples:\n\n ...\n \n ## Raises:\n\n Nothing.\n ' dataset: DataSet = DataSet() dataset.load_by_name(self.state.dataset_name) x_train = dataset.x_train x_test = dataset.x_test y_train = dataset.y_train y_test = dataset.y_test neural_net: Model = self._load_model_() neural_net.compile(optimizer=self.state.optimizer(**self.state.optimizer_kwargs), loss=self.state.loss(**self.state.loss_kwargs), **self.state.compile_kwargs) self._check_if_dirs_exists_() csv_logger = CSVLogger(filename=self.state.csv_pathname, separator=';', append=True) standard_callbacks: list = [csv_logger] neural_net.fit(x=x_train, y=y_train, validation_data=(x_test, y_test), initial_epoch=(self._get_last_epoch_() + 1), callbacks=standard_callbacks, epochs=((self.state.last_epoch + self.state.number_of_epochs) + 1), **self.state.fit_Kwargs) neural_net.save(filepath=self.state.model_save_pathname) self.save_data_to_dataframe() self.state._update_dependent_attributes_() self.save_state()<|docstring|>## Function: Starts the training ## Receives: Nothing ## Returns: None ## Examples: ... ## Raises: Nothing.<|endoftext|>
a963c7e2bf8bf3ce570dd12306982f1aee92f7d15ac11cfbfffd4582ff731958
def set_a_new_training(self, new_parameters: dict) -> None: '\n ## Function:\n\n Executes a new training after changes in parameters.\n\n ## Receives:\n\n A `dict` where the keys are the parameters to be changed, and the values are new parameters.\n\n ### Possibilities :\n\n \'model_name\' : "AutoEncoder-1.0-64x64.json",\n \'dataset_name\' : "rafael_cifar_10",\n \'number_of_epochs\' : 5,\n \n \'fit_Kwargs\' : {\n \'batch_size\': 10,\n \'verbose\': 1,\n \'validation_split\': 0, \n \'shuffle\': True,\n \'class_weight\': None,\n \'sample_weight\': None,\n \'steps_per_epoch\': None, \n \'validation_steps\': None, \n \'validation_batch_size\': None, \n \'validation_freq\': 1,\n \'max_queue_size\': 10, \n \'workers\': 1, \n \'use_multiprocessing\': False\n },\n \n \'compile_kwargs\' : {\n \'metrics\': None,\n \'loss_weights\': None,\n \'weighted_metrics\': None,\n \'run_eagerly\': None,\n \'steps_per_execution\': None\n },\n \n \'optimizer\' : Adam,\n\n \'optimizer_kwargs\' : {\n \'learning_rate\': 0.001,\n \'beta_1\': 0.9,\n \'beta_2\': 0.999, \n \'epsilon\': 1e-7,\n \'amsgrad\': False\n },\n\n \'loss_class\' : LSSIM,\n \'loss_kwargs\' : { \n \'max_val\':255,\n \'filter_size\':9,\n \'filter_sigma\':1.5,\n \'k1\':0.01,\n \'k2\':0.03\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> self.set_a_new_training ( {"model_name": "model2",\n "dataset": new_dataset} )\n\n ## Raises:\n\n Nothing.\n ' self.state.change_training_idx() self.state.change_attributes(new_parameters) self.start_training()
## Function: Executes a new training after changes in parameters. ## Receives: A `dict` where the keys are the parameters to be changed, and the values are new parameters. ### Possibilities : 'model_name' : "AutoEncoder-1.0-64x64.json", 'dataset_name' : "rafael_cifar_10", 'number_of_epochs' : 5, 'fit_Kwargs' : { 'batch_size': 10, 'verbose': 1, 'validation_split': 0, 'shuffle': True, 'class_weight': None, 'sample_weight': None, 'steps_per_epoch': None, 'validation_steps': None, 'validation_batch_size': None, 'validation_freq': 1, 'max_queue_size': 10, 'workers': 1, 'use_multiprocessing': False }, 'compile_kwargs' : { 'metrics': None, 'loss_weights': None, 'weighted_metrics': None, 'run_eagerly': None, 'steps_per_execution': None }, 'optimizer' : Adam, 'optimizer_kwargs' : { 'learning_rate': 0.001, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-7, 'amsgrad': False }, 'loss_class' : LSSIM, 'loss_kwargs' : { 'max_val':255, 'filter_size':9, 'filter_sigma':1.5, 'k1':0.01, 'k2':0.03 ## Returns: None ## Examples: >>> self.set_a_new_training ( {"model_name": "model2", "dataset": new_dataset} ) ## Raises: Nothing.
old/automatic_training.py
set_a_new_training
AlanPXD/IC-AutoEncoder
0
python
def set_a_new_training(self, new_parameters: dict) -> None: '\n ## Function:\n\n Executes a new training after changes in parameters.\n\n ## Receives:\n\n A `dict` where the keys are the parameters to be changed, and the values are new parameters.\n\n ### Possibilities :\n\n \'model_name\' : "AutoEncoder-1.0-64x64.json",\n \'dataset_name\' : "rafael_cifar_10",\n \'number_of_epochs\' : 5,\n \n \'fit_Kwargs\' : {\n \'batch_size\': 10,\n \'verbose\': 1,\n \'validation_split\': 0, \n \'shuffle\': True,\n \'class_weight\': None,\n \'sample_weight\': None,\n \'steps_per_epoch\': None, \n \'validation_steps\': None, \n \'validation_batch_size\': None, \n \'validation_freq\': 1,\n \'max_queue_size\': 10, \n \'workers\': 1, \n \'use_multiprocessing\': False\n },\n \n \'compile_kwargs\' : {\n \'metrics\': None,\n \'loss_weights\': None,\n \'weighted_metrics\': None,\n \'run_eagerly\': None,\n \'steps_per_execution\': None\n },\n \n \'optimizer\' : Adam,\n\n \'optimizer_kwargs\' : {\n \'learning_rate\': 0.001,\n \'beta_1\': 0.9,\n \'beta_2\': 0.999, \n \'epsilon\': 1e-7,\n \'amsgrad\': False\n },\n\n \'loss_class\' : LSSIM,\n \'loss_kwargs\' : { \n \'max_val\':255,\n \'filter_size\':9,\n \'filter_sigma\':1.5,\n \'k1\':0.01,\n \'k2\':0.03\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> self.set_a_new_training ( {"model_name": "model2",\n "dataset": new_dataset} )\n\n ## Raises:\n\n Nothing.\n ' self.state.change_training_idx() self.state.change_attributes(new_parameters) self.start_training()
def set_a_new_training(self, new_parameters: dict) -> None: '\n ## Function:\n\n Executes a new training after changes in parameters.\n\n ## Receives:\n\n A `dict` where the keys are the parameters to be changed, and the values are new parameters.\n\n ### Possibilities :\n\n \'model_name\' : "AutoEncoder-1.0-64x64.json",\n \'dataset_name\' : "rafael_cifar_10",\n \'number_of_epochs\' : 5,\n \n \'fit_Kwargs\' : {\n \'batch_size\': 10,\n \'verbose\': 1,\n \'validation_split\': 0, \n \'shuffle\': True,\n \'class_weight\': None,\n \'sample_weight\': None,\n \'steps_per_epoch\': None, \n \'validation_steps\': None, \n \'validation_batch_size\': None, \n \'validation_freq\': 1,\n \'max_queue_size\': 10, \n \'workers\': 1, \n \'use_multiprocessing\': False\n },\n \n \'compile_kwargs\' : {\n \'metrics\': None,\n \'loss_weights\': None,\n \'weighted_metrics\': None,\n \'run_eagerly\': None,\n \'steps_per_execution\': None\n },\n \n \'optimizer\' : Adam,\n\n \'optimizer_kwargs\' : {\n \'learning_rate\': 0.001,\n \'beta_1\': 0.9,\n \'beta_2\': 0.999, \n \'epsilon\': 1e-7,\n \'amsgrad\': False\n },\n\n \'loss_class\' : LSSIM,\n \'loss_kwargs\' : { \n \'max_val\':255,\n \'filter_size\':9,\n \'filter_sigma\':1.5,\n \'k1\':0.01,\n \'k2\':0.03\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> self.set_a_new_training ( {"model_name": "model2",\n "dataset": new_dataset} )\n\n ## Raises:\n\n Nothing.\n ' self.state.change_training_idx() self.state.change_attributes(new_parameters) self.start_training()<|docstring|>## Function: Executes a new training after changes in parameters. ## Receives: A `dict` where the keys are the parameters to be changed, and the values are new parameters. ### Possibilities : 'model_name' : "AutoEncoder-1.0-64x64.json", 'dataset_name' : "rafael_cifar_10", 'number_of_epochs' : 5, 'fit_Kwargs' : { 'batch_size': 10, 'verbose': 1, 'validation_split': 0, 'shuffle': True, 'class_weight': None, 'sample_weight': None, 'steps_per_epoch': None, 'validation_steps': None, 'validation_batch_size': None, 'validation_freq': 1, 'max_queue_size': 10, 'workers': 1, 'use_multiprocessing': False }, 'compile_kwargs' : { 'metrics': None, 'loss_weights': None, 'weighted_metrics': None, 'run_eagerly': None, 'steps_per_execution': None }, 'optimizer' : Adam, 'optimizer_kwargs' : { 'learning_rate': 0.001, 'beta_1': 0.9, 'beta_2': 0.999, 'epsilon': 1e-7, 'amsgrad': False }, 'loss_class' : LSSIM, 'loss_kwargs' : { 'max_val':255, 'filter_size':9, 'filter_sigma':1.5, 'k1':0.01, 'k2':0.03 ## Returns: None ## Examples: >>> self.set_a_new_training ( {"model_name": "model2", "dataset": new_dataset} ) ## Raises: Nothing.<|endoftext|>
d3fd9701bbfcde968e5187b1934d17cc9f400d2d16a5605c7d4cd07990ee697d
def set_a_sequence_of_trainings(self, list_of_changes: list) -> None: '\n ## Function:\n\n Executes pieces of training after changes in parameters.\n\n ## Receives:\n\n A `list` where the elements are dicts containing the training changes.\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> change1 = {"model_name": "model2"}\n >>> change2 = {"dataset": new_dataset}\n >>> list_of_changes = [change1, change2]\n >>> self.set_a_new_training ( list_of_changes )\n\n In this example, the first training begins after change1, and the second training is started afterward of change2.\n\n ## Raises:\n\n Nothing.\n ' changes: dict for changes in list_of_changes: self.set_a_new_training(changes)
## Function: Executes pieces of training after changes in parameters. ## Receives: A `list` where the elements are dicts containing the training changes. ## Returns: None ## Examples: >>> change1 = {"model_name": "model2"} >>> change2 = {"dataset": new_dataset} >>> list_of_changes = [change1, change2] >>> self.set_a_new_training ( list_of_changes ) In this example, the first training begins after change1, and the second training is started afterward of change2. ## Raises: Nothing.
old/automatic_training.py
set_a_sequence_of_trainings
AlanPXD/IC-AutoEncoder
0
python
def set_a_sequence_of_trainings(self, list_of_changes: list) -> None: '\n ## Function:\n\n Executes pieces of training after changes in parameters.\n\n ## Receives:\n\n A `list` where the elements are dicts containing the training changes.\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> change1 = {"model_name": "model2"}\n >>> change2 = {"dataset": new_dataset}\n >>> list_of_changes = [change1, change2]\n >>> self.set_a_new_training ( list_of_changes )\n\n In this example, the first training begins after change1, and the second training is started afterward of change2.\n\n ## Raises:\n\n Nothing.\n ' changes: dict for changes in list_of_changes: self.set_a_new_training(changes)
def set_a_sequence_of_trainings(self, list_of_changes: list) -> None: '\n ## Function:\n\n Executes pieces of training after changes in parameters.\n\n ## Receives:\n\n A `list` where the elements are dicts containing the training changes.\n\n ## Returns:\n\n None\n\n ## Examples:\n\n >>> change1 = {"model_name": "model2"}\n >>> change2 = {"dataset": new_dataset}\n >>> list_of_changes = [change1, change2]\n >>> self.set_a_new_training ( list_of_changes )\n\n In this example, the first training begins after change1, and the second training is started afterward of change2.\n\n ## Raises:\n\n Nothing.\n ' changes: dict for changes in list_of_changes: self.set_a_new_training(changes)<|docstring|>## Function: Executes pieces of training after changes in parameters. ## Receives: A `list` where the elements are dicts containing the training changes. ## Returns: None ## Examples: >>> change1 = {"model_name": "model2"} >>> change2 = {"dataset": new_dataset} >>> list_of_changes = [change1, change2] >>> self.set_a_new_training ( list_of_changes ) In this example, the first training begins after change1, and the second training is started afterward of change2. ## Raises: Nothing.<|endoftext|>
0f4eb81407e4b846471dfe130902876a5278924482e725857606655ca3cec429
def getenv_bool(name: str, default: bool=False) -> bool: "Gets a boolean-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : bool, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``False``.\n\n Returns\n -------\n bool\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = (env_value.upper() in ('TRUE', '1')) return rv
Gets a boolean-valued environment variable. Parameters ---------- name : str The environment variable to get (if it exists). default : bool, optional The default value to use (if the `name` variable doesn't exist), the default value is ``False``. Returns ------- bool The environment variable `name` value to use.
src/backend/app/core/config.py
getenv_bool
douglasdaly/dougliz-wedding
5
python
def getenv_bool(name: str, default: bool=False) -> bool: "Gets a boolean-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : bool, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``False``.\n\n Returns\n -------\n bool\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = (env_value.upper() in ('TRUE', '1')) return rv
def getenv_bool(name: str, default: bool=False) -> bool: "Gets a boolean-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : bool, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``False``.\n\n Returns\n -------\n bool\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = (env_value.upper() in ('TRUE', '1')) return rv<|docstring|>Gets a boolean-valued environment variable. Parameters ---------- name : str The environment variable to get (if it exists). default : bool, optional The default value to use (if the `name` variable doesn't exist), the default value is ``False``. Returns ------- bool The environment variable `name` value to use.<|endoftext|>
7e08d378654df738308c53b7ce0c286e12d8f0d7aae0b407951edb75f058787e
def getenv_int(name: str, default: tp.Optional[int]=None) -> int: "Gets an integer-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : int, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``None``.\n\n Returns\n -------\n int\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = int(env_value) return rv
Gets an integer-valued environment variable. Parameters ---------- name : str The environment variable to get (if it exists). default : int, optional The default value to use (if the `name` variable doesn't exist), the default value is ``None``. Returns ------- int The environment variable `name` value to use.
src/backend/app/core/config.py
getenv_int
douglasdaly/dougliz-wedding
5
python
def getenv_int(name: str, default: tp.Optional[int]=None) -> int: "Gets an integer-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : int, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``None``.\n\n Returns\n -------\n int\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = int(env_value) return rv
def getenv_int(name: str, default: tp.Optional[int]=None) -> int: "Gets an integer-valued environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : int, optional\n The default value to use (if the `name` variable doesn't exist),\n the default value is ``None``.\n\n Returns\n -------\n int\n The environment variable `name` value to use.\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): rv = int(env_value) return rv<|docstring|>Gets an integer-valued environment variable. Parameters ---------- name : str The environment variable to get (if it exists). default : int, optional The default value to use (if the `name` variable doesn't exist), the default value is ``None``. Returns ------- int The environment variable `name` value to use.<|endoftext|>
79d797fc96d9c8e530d384c35c00e1eea9a5e57d135b5d95b30ad08472541fbd
def getenv_dict(name: str, default: tp.Optional[tp.Dict[(str, str)]]=None) -> tp.Dict[(str, str)]: "Gets a dictionary of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n JSON-formatted string representing a dictionary.\n default : Dict[str, str], optional\n The default value to use (if the `name` variable doesn't exist,\n the default value is ``{}``).\n\n Returns\n -------\n Dict[str, str]\n The dictionary from the environment variable `name`'s data.\n\n " rv = (default or {}) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('\'" ') rv = json.loads(env_value) return rv
Gets a dictionary of values from an environment variable. Parameters ---------- name : str The environment variable to get (if it exists). Expects a JSON-formatted string representing a dictionary. default : Dict[str, str], optional The default value to use (if the `name` variable doesn't exist, the default value is ``{}``). Returns ------- Dict[str, str] The dictionary from the environment variable `name`'s data.
src/backend/app/core/config.py
getenv_dict
douglasdaly/dougliz-wedding
5
python
def getenv_dict(name: str, default: tp.Optional[tp.Dict[(str, str)]]=None) -> tp.Dict[(str, str)]: "Gets a dictionary of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n JSON-formatted string representing a dictionary.\n default : Dict[str, str], optional\n The default value to use (if the `name` variable doesn't exist,\n the default value is ``{}``).\n\n Returns\n -------\n Dict[str, str]\n The dictionary from the environment variable `name`'s data.\n\n " rv = (default or {}) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('\'" ') rv = json.loads(env_value) return rv
def getenv_dict(name: str, default: tp.Optional[tp.Dict[(str, str)]]=None) -> tp.Dict[(str, str)]: "Gets a dictionary of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n JSON-formatted string representing a dictionary.\n default : Dict[str, str], optional\n The default value to use (if the `name` variable doesn't exist,\n the default value is ``{}``).\n\n Returns\n -------\n Dict[str, str]\n The dictionary from the environment variable `name`'s data.\n\n " rv = (default or {}) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('\'" ') rv = json.loads(env_value) return rv<|docstring|>Gets a dictionary of values from an environment variable. Parameters ---------- name : str The environment variable to get (if it exists). Expects a JSON-formatted string representing a dictionary. default : Dict[str, str], optional The default value to use (if the `name` variable doesn't exist, the default value is ``{}``). Returns ------- Dict[str, str] The dictionary from the environment variable `name`'s data.<|endoftext|>
86b5220053701f50d6219a91eb55073a6322eb8f6106239fe78a91316d732cf1
def getenv_list(name: str, default: tp.Optional[tp.List[str]]=None, *, seperator: str=',') -> tp.List[str]: "Gets a list of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n character-seperated string (using `seperator`).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``[]``).\n seperator : str, optional\n The character-seperating string to use (default is a comma).\n\n Returns\n -------\n Sequence[str]\n The sequence from the environment variable `name`'s data.\n\n " rv = (default or []) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('"\' ') rv = [x.strip() for x in env_value.split(seperator)] return rv
Gets a list of values from an environment variable. Parameters ---------- name : str The environment variable to get (if it exists). Expects a character-seperated string (using `seperator`). default : Sequence[str], optional The default value to use (if the `name` environment variable doesn't exist, the default is ``[]``). seperator : str, optional The character-seperating string to use (default is a comma). Returns ------- Sequence[str] The sequence from the environment variable `name`'s data.
src/backend/app/core/config.py
getenv_list
douglasdaly/dougliz-wedding
5
python
def getenv_list(name: str, default: tp.Optional[tp.List[str]]=None, *, seperator: str=',') -> tp.List[str]: "Gets a list of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n character-seperated string (using `seperator`).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``[]``).\n seperator : str, optional\n The character-seperating string to use (default is a comma).\n\n Returns\n -------\n Sequence[str]\n The sequence from the environment variable `name`'s data.\n\n " rv = (default or []) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('"\' ') rv = [x.strip() for x in env_value.split(seperator)] return rv
def getenv_list(name: str, default: tp.Optional[tp.List[str]]=None, *, seperator: str=',') -> tp.List[str]: "Gets a list of values from an environment variable.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists). Expects a\n character-seperated string (using `seperator`).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``[]``).\n seperator : str, optional\n The character-seperating string to use (default is a comma).\n\n Returns\n -------\n Sequence[str]\n The sequence from the environment variable `name`'s data.\n\n " rv = (default or []) env_value = os.getenv(name) if (env_value is not None): env_value = env_value.strip('"\' ') rv = [x.strip() for x in env_value.split(seperator)] return rv<|docstring|>Gets a list of values from an environment variable. Parameters ---------- name : str The environment variable to get (if it exists). Expects a character-seperated string (using `seperator`). default : Sequence[str], optional The default value to use (if the `name` environment variable doesn't exist, the default is ``[]``). seperator : str, optional The character-seperating string to use (default is a comma). Returns ------- Sequence[str] The sequence from the environment variable `name`'s data.<|endoftext|>
c7b90e0d42c4d26b981bc7ae0b3f0c9eda0cc155e56301b52cefe46e79e4e53d
def getenv_quotestr(name: str, default: tp.Optional[str]=None) -> tp.Optional[str]: "Gets a clean environment variable as a (non-quoted) string value.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``None``).\n\n Returns\n -------\n Optional[str]\n The cleaned string version of the environment variable (if it\n exists).\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): if ((env_value[0] == env_value[(- 1)]) and (env_value[0] in ('"', "'"))): rv = env_value[1:(- 1)] else: rv = env_value return rv
Gets a clean environment variable as a (non-quoted) string value. Parameters ---------- name : str The environment variable to get (if it exists). default : Sequence[str], optional The default value to use (if the `name` environment variable doesn't exist, the default is ``None``). Returns ------- Optional[str] The cleaned string version of the environment variable (if it exists).
src/backend/app/core/config.py
getenv_quotestr
douglasdaly/dougliz-wedding
5
python
def getenv_quotestr(name: str, default: tp.Optional[str]=None) -> tp.Optional[str]: "Gets a clean environment variable as a (non-quoted) string value.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``None``).\n\n Returns\n -------\n Optional[str]\n The cleaned string version of the environment variable (if it\n exists).\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): if ((env_value[0] == env_value[(- 1)]) and (env_value[0] in ('"', "'"))): rv = env_value[1:(- 1)] else: rv = env_value return rv
def getenv_quotestr(name: str, default: tp.Optional[str]=None) -> tp.Optional[str]: "Gets a clean environment variable as a (non-quoted) string value.\n\n Parameters\n ----------\n name : str\n The environment variable to get (if it exists).\n default : Sequence[str], optional\n The default value to use (if the `name` environment variable\n doesn't exist, the default is ``None``).\n\n Returns\n -------\n Optional[str]\n The cleaned string version of the environment variable (if it\n exists).\n\n " rv = default env_value = os.getenv(name) if (env_value is not None): if ((env_value[0] == env_value[(- 1)]) and (env_value[0] in ('"', "'"))): rv = env_value[1:(- 1)] else: rv = env_value return rv<|docstring|>Gets a clean environment variable as a (non-quoted) string value. Parameters ---------- name : str The environment variable to get (if it exists). default : Sequence[str], optional The default value to use (if the `name` environment variable doesn't exist, the default is ``None``). Returns ------- Optional[str] The cleaned string version of the environment variable (if it exists).<|endoftext|>
f16e65aaef164a697fdf18f356a4a84523974b48cfbbda8171348be2ab75ba12
def _get_previous_sim_type(self, sim_type: str): '\n Works out where to get starting structure from based on the current run and simulation type\n ' if (self.run_type == _PSE.RBFE): return 'em' elif (self.run_type == _PSE.ABFE): if (sim_type in ('em', 'nvt')): return 'em' elif (sim_type == 'npt'): return 'nvt' elif (sim_type == 'eq'): return 'npt'
Works out where to get starting structure from based on the current run and simulation type
src/icolos/core/workflow_steps/pmx/prepare_simulations.py
_get_previous_sim_type
jharrymoore/Icolos
0
python
def _get_previous_sim_type(self, sim_type: str): '\n \n ' if (self.run_type == _PSE.RBFE): return 'em' elif (self.run_type == _PSE.ABFE): if (sim_type in ('em', 'nvt')): return 'em' elif (sim_type == 'npt'): return 'nvt' elif (sim_type == 'eq'): return 'npt'
def _get_previous_sim_type(self, sim_type: str): '\n \n ' if (self.run_type == _PSE.RBFE): return 'em' elif (self.run_type == _PSE.ABFE): if (sim_type in ('em', 'nvt')): return 'em' elif (sim_type == 'npt'): return 'nvt' elif (sim_type == 'eq'): return 'npt'<|docstring|>Works out where to get starting structure from based on the current run and simulation type<|endoftext|>
2604825615922bdf72b709d4949f09dfe391722ad016ffb777e6710579cf6502
def load_voc_instances(dirname: str, split: str): '\n Load licenseplates VOC detection annotations to Detectron2 format.\n\n Args:\n dirname: Contain "annotations", "images"\n split (str): one of "train", "test"\n ' with PathManager.open(os.path.join(dirname, (split + '.txt'))) as f: fileids = np.loadtxt(f, dtype=np.str) dicts = [] for fileid in fileids: anno_file = os.path.join(dirname, 'annotations', (fileid + '.xml')) jpeg_file = os.path.join(dirname, 'images', (fileid + '.jpg')) tree = ET.parse(anno_file) r = {'file_name': jpeg_file, 'image_id': fileid, 'height': int(tree.findall('./size/height')[0].text), 'width': int(tree.findall('./size/width')[0].text)} instances = [] for obj in tree.findall('object'): cls = obj.find('name').text bbox = obj.find('bndbox') bbox = [float(bbox.find(x).text) for x in ['xmin', 'ymin', 'xmax', 'ymax']] instances.append({'category_id': CLASS_NAMES.index(cls), 'bbox': bbox, 'bbox_mode': BoxMode.XYXY_ABS}) r['annotations'] = instances dicts.append(r) return dicts
Load licenseplates VOC detection annotations to Detectron2 format. Args: dirname: Contain "annotations", "images" split (str): one of "train", "test"
licenseplates/dataset.py
load_voc_instances
jagin/detectron2-licenseplates
39
python
def load_voc_instances(dirname: str, split: str): '\n Load licenseplates VOC detection annotations to Detectron2 format.\n\n Args:\n dirname: Contain "annotations", "images"\n split (str): one of "train", "test"\n ' with PathManager.open(os.path.join(dirname, (split + '.txt'))) as f: fileids = np.loadtxt(f, dtype=np.str) dicts = [] for fileid in fileids: anno_file = os.path.join(dirname, 'annotations', (fileid + '.xml')) jpeg_file = os.path.join(dirname, 'images', (fileid + '.jpg')) tree = ET.parse(anno_file) r = {'file_name': jpeg_file, 'image_id': fileid, 'height': int(tree.findall('./size/height')[0].text), 'width': int(tree.findall('./size/width')[0].text)} instances = [] for obj in tree.findall('object'): cls = obj.find('name').text bbox = obj.find('bndbox') bbox = [float(bbox.find(x).text) for x in ['xmin', 'ymin', 'xmax', 'ymax']] instances.append({'category_id': CLASS_NAMES.index(cls), 'bbox': bbox, 'bbox_mode': BoxMode.XYXY_ABS}) r['annotations'] = instances dicts.append(r) return dicts
def load_voc_instances(dirname: str, split: str): '\n Load licenseplates VOC detection annotations to Detectron2 format.\n\n Args:\n dirname: Contain "annotations", "images"\n split (str): one of "train", "test"\n ' with PathManager.open(os.path.join(dirname, (split + '.txt'))) as f: fileids = np.loadtxt(f, dtype=np.str) dicts = [] for fileid in fileids: anno_file = os.path.join(dirname, 'annotations', (fileid + '.xml')) jpeg_file = os.path.join(dirname, 'images', (fileid + '.jpg')) tree = ET.parse(anno_file) r = {'file_name': jpeg_file, 'image_id': fileid, 'height': int(tree.findall('./size/height')[0].text), 'width': int(tree.findall('./size/width')[0].text)} instances = [] for obj in tree.findall('object'): cls = obj.find('name').text bbox = obj.find('bndbox') bbox = [float(bbox.find(x).text) for x in ['xmin', 'ymin', 'xmax', 'ymax']] instances.append({'category_id': CLASS_NAMES.index(cls), 'bbox': bbox, 'bbox_mode': BoxMode.XYXY_ABS}) r['annotations'] = instances dicts.append(r) return dicts<|docstring|>Load licenseplates VOC detection annotations to Detectron2 format. Args: dirname: Contain "annotations", "images" split (str): one of "train", "test"<|endoftext|>
326deedb536703a7e8af53def6791b6f9d8c0ded3a8c319f96705ae3cd5fec2b
def test_parse_exac_line(exac_handle): 'Test to parse a exac line' header = next(exac_handle).rstrip().split('\t') first_gene = next(exac_handle) gene_info = parse_exac_line(header=header, line=first_gene) assert (gene_info['hgnc_symbol'] == first_gene.split('\t')[1])
Test to parse a exac line
tests/parse/test_parse_exac_genes.py
test_parse_exac_line
Clinical-Genomics/scout
111
python
def test_parse_exac_line(exac_handle): header = next(exac_handle).rstrip().split('\t') first_gene = next(exac_handle) gene_info = parse_exac_line(header=header, line=first_gene) assert (gene_info['hgnc_symbol'] == first_gene.split('\t')[1])
def test_parse_exac_line(exac_handle): header = next(exac_handle).rstrip().split('\t') first_gene = next(exac_handle) gene_info = parse_exac_line(header=header, line=first_gene) assert (gene_info['hgnc_symbol'] == first_gene.split('\t')[1])<|docstring|>Test to parse a exac line<|endoftext|>
9e371ca67ac3b206d163418ea6e6694e954ea6921b61b14b3b9d328d98bc9a26
def onTrack(self, callback=None): '\n Callback that gets called each time a video track is received::\n\n @r.video.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.video.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.video.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)
Callback that gets called each time a video track is received:: @r.video.onTrack def onTrack(track): print(track) The callback actually works exactly as a subscribe(), so you can do:: subscription = r.video.onTrack() await subscription.get() Note that if you have more than one track, you will need to tell rtcbot how many tracks to prepare to receive:: r.video.offerToReceive(2)
rtcbot/connection.py
onTrack
kimsooyoung/rtcbot
35
python
def onTrack(self, callback=None): '\n Callback that gets called each time a video track is received::\n\n @r.video.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.video.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.video.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)
def onTrack(self, callback=None): '\n Callback that gets called each time a video track is received::\n\n @r.video.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.video.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.video.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)<|docstring|>Callback that gets called each time a video track is received:: @r.video.onTrack def onTrack(track): print(track) The callback actually works exactly as a subscribe(), so you can do:: subscription = r.video.onTrack() await subscription.get() Note that if you have more than one track, you will need to tell rtcbot how many tracks to prepare to receive:: r.video.offerToReceive(2)<|endoftext|>
8a8ea8c905099060b1ff9b6b794759f850b4acfc35695cd832de22130f3e2b2f
def addTrack(self, frameSubscription=None, fps=None, canSkip=True): '\n Allows to send multiple video tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single video stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding video track to connection') s = VideoSender(fps=fps, canSkip=True) if (frameSubscription is not None): s.putSubscription(frameSubscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.videoStreamTrack) self._senders.add(s) return s
Allows to send multiple video tracks in a single connection. Each call to putTrack *adds* the track to the connection. For simple usage, where you only have a single video stream, just use `putSubscription` - it automatically calls putTrack for you.
rtcbot/connection.py
addTrack
kimsooyoung/rtcbot
35
python
def addTrack(self, frameSubscription=None, fps=None, canSkip=True): '\n Allows to send multiple video tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single video stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding video track to connection') s = VideoSender(fps=fps, canSkip=True) if (frameSubscription is not None): s.putSubscription(frameSubscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.videoStreamTrack) self._senders.add(s) return s
def addTrack(self, frameSubscription=None, fps=None, canSkip=True): '\n Allows to send multiple video tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single video stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding video track to connection') s = VideoSender(fps=fps, canSkip=True) if (frameSubscription is not None): s.putSubscription(frameSubscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.videoStreamTrack) self._senders.add(s) return s<|docstring|>Allows to send multiple video tracks in a single connection. Each call to putTrack *adds* the track to the connection. For simple usage, where you only have a single video stream, just use `putSubscription` - it automatically calls putTrack for you.<|endoftext|>
0031c1632cdfb20207d27f14bdfaf91b4dc5e6bc60fb592d2c36e56c01b2aa53
def _onTrack(self, track): '\n Internal raw track receiver\n ' self._log.debug('Received video track from connection') track = VideoReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)
Internal raw track receiver
rtcbot/connection.py
_onTrack
kimsooyoung/rtcbot
35
python
def _onTrack(self, track): '\n \n ' self._log.debug('Received video track from connection') track = VideoReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)
def _onTrack(self, track): '\n \n ' self._log.debug('Received video track from connection') track = VideoReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)<|docstring|>Internal raw track receiver<|endoftext|>
3477f4884b4d204ab93b44caf8f8d434eea6e048d586ace9d43c401be2759e48
def offerToReceive(self, num=1): '\n Set the number of tracks that you can receive\n ' if (self._offerToReceive < num): self._offerToReceive = num
Set the number of tracks that you can receive
rtcbot/connection.py
offerToReceive
kimsooyoung/rtcbot
35
python
def offerToReceive(self, num=1): '\n \n ' if (self._offerToReceive < num): self._offerToReceive = num
def offerToReceive(self, num=1): '\n \n ' if (self._offerToReceive < num): self._offerToReceive = num<|docstring|>Set the number of tracks that you can receive<|endoftext|>
4b850c7792c32556cbc15fc5a2d55ec2588c8ff55f8fd15ed9a42c939450d644
def onTrack(self, callback=None): '\n Callback that gets called each time a audio track is received::\n\n @r.audio.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.audio.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.audio.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)
Callback that gets called each time a audio track is received:: @r.audio.onTrack def onTrack(track): print(track) The callback actually works exactly as a subscribe(), so you can do:: subscription = r.audio.onTrack() await subscription.get() Note that if you have more than one track, you will need to tell rtcbot how many tracks to prepare to receive:: r.audio.offerToReceive(2)
rtcbot/connection.py
onTrack
kimsooyoung/rtcbot
35
python
def onTrack(self, callback=None): '\n Callback that gets called each time a audio track is received::\n\n @r.audio.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.audio.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.audio.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)
def onTrack(self, callback=None): '\n Callback that gets called each time a audio track is received::\n\n @r.audio.onTrack\n def onTrack(track):\n print(track)\n\n The callback actually works exactly as a subscribe(), so you can do::\n\n subscription = r.audio.onTrack()\n await subscription.get()\n\n Note that if you have more than one track, you will need to tell rtcbot how\n many tracks to prepare to receive::\n\n r.audio.offerToReceive(2)\n\n ' self.offerToReceive() return self._trackSubscriber.subscribe(callback)<|docstring|>Callback that gets called each time a audio track is received:: @r.audio.onTrack def onTrack(track): print(track) The callback actually works exactly as a subscribe(), so you can do:: subscription = r.audio.onTrack() await subscription.get() Note that if you have more than one track, you will need to tell rtcbot how many tracks to prepare to receive:: r.audio.offerToReceive(2)<|endoftext|>
390062e95cd99affb81da3f9b5b1eb9ac0ce8846c5326d240ac881125808212c
def addTrack(self, subscription=None, sampleRate=48000, canSkip=True): '\n Allows to send multiple audio tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single audio stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding audio track to connection') s = AudioSender(sampleRate=sampleRate, canSkip=True) if (subscription is not None): s.putSubscription(subscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.audioStreamTrack) self._senders.add(s) return s
Allows to send multiple audio tracks in a single connection. Each call to putTrack *adds* the track to the connection. For simple usage, where you only have a single audio stream, just use `putSubscription` - it automatically calls putTrack for you.
rtcbot/connection.py
addTrack
kimsooyoung/rtcbot
35
python
def addTrack(self, subscription=None, sampleRate=48000, canSkip=True): '\n Allows to send multiple audio tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single audio stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding audio track to connection') s = AudioSender(sampleRate=sampleRate, canSkip=True) if (subscription is not None): s.putSubscription(subscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.audioStreamTrack) self._senders.add(s) return s
def addTrack(self, subscription=None, sampleRate=48000, canSkip=True): '\n Allows to send multiple audio tracks in a single connection.\n Each call to putTrack *adds* the track to the connection.\n For simple usage, where you only have a single audio stream,\n just use `putSubscription` - it automatically calls putTrack for you.\n ' self._log.debug('Adding audio track to connection') s = AudioSender(sampleRate=sampleRate, canSkip=True) if (subscription is not None): s.putSubscription(subscription) elif (self._defaultSender is None): s.putSubscription(self._defaultSenderSubscription) if (self._defaultSender is None): self._defaultSender = s self._defaultSender.onClose(self.close) self._rtc.addTrack(s.audioStreamTrack) self._senders.add(s) return s<|docstring|>Allows to send multiple audio tracks in a single connection. Each call to putTrack *adds* the track to the connection. For simple usage, where you only have a single audio stream, just use `putSubscription` - it automatically calls putTrack for you.<|endoftext|>
1c1632b167e0e2009e0b3e6a7d4239075813f55a92b17b74bf43c1b2e29bd41e
def _onTrack(self, track): '\n Internal raw track receiver\n ' self._log.debug('Received audio track from connection') track = AudioReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)
Internal raw track receiver
rtcbot/connection.py
_onTrack
kimsooyoung/rtcbot
35
python
def _onTrack(self, track): '\n \n ' self._log.debug('Received audio track from connection') track = AudioReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)
def _onTrack(self, track): '\n \n ' self._log.debug('Received audio track from connection') track = AudioReceiver(track) if (self._defaultReceiver is None): self._defaultReceiver = track self._defaultReceiver.subscribe(self._put_nowait) self._defaultReceiver.onClose(self.close) self._receivers.add(track) self._trackSubscriber._put_nowait(track)<|docstring|>Internal raw track receiver<|endoftext|>
3477f4884b4d204ab93b44caf8f8d434eea6e048d586ace9d43c401be2759e48
def offerToReceive(self, num=1): '\n Set the number of tracks that you can receive\n ' if (self._offerToReceive < num): self._offerToReceive = num
Set the number of tracks that you can receive
rtcbot/connection.py
offerToReceive
kimsooyoung/rtcbot
35
python
def offerToReceive(self, num=1): '\n \n ' if (self._offerToReceive < num): self._offerToReceive = num
def offerToReceive(self, num=1): '\n \n ' if (self._offerToReceive < num): self._offerToReceive = num<|docstring|>Set the number of tracks that you can receive<|endoftext|>
1bdfa10ecc5e08edb528f4cc922a6388b51d7b53d1f536cc2f74bc516c6a599c
async def getLocalDescription(self, description=None): '\n Gets the description to send on. Creates an initial description\n if no remote description was passed, and creates a response if\n a remote was given,\n ' if (self._hasRemoteDescription or (description is not None)): if (not self._hasRemoteDescription): (await self.setRemoteDescription(description)) self._log.debug('Creating response to connection offer') try: answer = (await self._rtc.createAnswer()) except AttributeError: self._log.exception("\n>>> Looks like the offer didn't include the necessary info to set up audio/video. See RTCConnection.video.offerToReceive(). <<<\n\n") raise (await self._rtc.setLocalDescription(answer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type} self._log.debug('Setting up default data channel') channel = DataChannel(self._rtc.createDataChannel('default', ordered=self._defaultChannelOrdered)) channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) self._dataChannels[channel.name] = channel if (len(self.video._senders) < self.video._offerToReceive): self._log.debug('Offering to receive video') for i in range((self.video._offerToReceive - len(self.video._senders))): self._rtc.addTransceiver('video', 'recvonly') if (len(self.audio._senders) < self.audio._offerToReceive): self._log.debug('Offering to receive audio') for i in range((self.audio._offerToReceive - len(self.audio._senders))): self._rtc.addTransceiver('audio', 'recvonly') self._log.debug('Creating new connection offer') offer = (await self._rtc.createOffer()) (await self._rtc.setLocalDescription(offer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type}
Gets the description to send on. Creates an initial description if no remote description was passed, and creates a response if a remote was given,
rtcbot/connection.py
getLocalDescription
kimsooyoung/rtcbot
35
python
async def getLocalDescription(self, description=None): '\n Gets the description to send on. Creates an initial description\n if no remote description was passed, and creates a response if\n a remote was given,\n ' if (self._hasRemoteDescription or (description is not None)): if (not self._hasRemoteDescription): (await self.setRemoteDescription(description)) self._log.debug('Creating response to connection offer') try: answer = (await self._rtc.createAnswer()) except AttributeError: self._log.exception("\n>>> Looks like the offer didn't include the necessary info to set up audio/video. See RTCConnection.video.offerToReceive(). <<<\n\n") raise (await self._rtc.setLocalDescription(answer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type} self._log.debug('Setting up default data channel') channel = DataChannel(self._rtc.createDataChannel('default', ordered=self._defaultChannelOrdered)) channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) self._dataChannels[channel.name] = channel if (len(self.video._senders) < self.video._offerToReceive): self._log.debug('Offering to receive video') for i in range((self.video._offerToReceive - len(self.video._senders))): self._rtc.addTransceiver('video', 'recvonly') if (len(self.audio._senders) < self.audio._offerToReceive): self._log.debug('Offering to receive audio') for i in range((self.audio._offerToReceive - len(self.audio._senders))): self._rtc.addTransceiver('audio', 'recvonly') self._log.debug('Creating new connection offer') offer = (await self._rtc.createOffer()) (await self._rtc.setLocalDescription(offer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type}
async def getLocalDescription(self, description=None): '\n Gets the description to send on. Creates an initial description\n if no remote description was passed, and creates a response if\n a remote was given,\n ' if (self._hasRemoteDescription or (description is not None)): if (not self._hasRemoteDescription): (await self.setRemoteDescription(description)) self._log.debug('Creating response to connection offer') try: answer = (await self._rtc.createAnswer()) except AttributeError: self._log.exception("\n>>> Looks like the offer didn't include the necessary info to set up audio/video. See RTCConnection.video.offerToReceive(). <<<\n\n") raise (await self._rtc.setLocalDescription(answer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type} self._log.debug('Setting up default data channel') channel = DataChannel(self._rtc.createDataChannel('default', ordered=self._defaultChannelOrdered)) channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) self._dataChannels[channel.name] = channel if (len(self.video._senders) < self.video._offerToReceive): self._log.debug('Offering to receive video') for i in range((self.video._offerToReceive - len(self.video._senders))): self._rtc.addTransceiver('video', 'recvonly') if (len(self.audio._senders) < self.audio._offerToReceive): self._log.debug('Offering to receive audio') for i in range((self.audio._offerToReceive - len(self.audio._senders))): self._rtc.addTransceiver('audio', 'recvonly') self._log.debug('Creating new connection offer') offer = (await self._rtc.createOffer()) (await self._rtc.setLocalDescription(offer)) return {'sdp': self._rtc.localDescription.sdp, 'type': self._rtc.localDescription.type}<|docstring|>Gets the description to send on. Creates an initial description if no remote description was passed, and creates a response if a remote was given,<|endoftext|>
8cd12d465f0f3092084894b6e21c40aa72da9d26e4e7cef4247ad0097db9bc24
def _onDatachannel(self, channel): '\n When a data channel comes in, adds it to the data channels, and sets up its messaging and stuff.\n\n ' channel = DataChannel(channel) self._log.debug('Got channel: %s', channel.name) if (channel.name == 'default'): channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) else: self._dataChannelSubscriber.put_nowait(channel) self._dataChannels[channel.name] = channel
When a data channel comes in, adds it to the data channels, and sets up its messaging and stuff.
rtcbot/connection.py
_onDatachannel
kimsooyoung/rtcbot
35
python
def _onDatachannel(self, channel): '\n \n\n ' channel = DataChannel(channel) self._log.debug('Got channel: %s', channel.name) if (channel.name == 'default'): channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) else: self._dataChannelSubscriber.put_nowait(channel) self._dataChannels[channel.name] = channel
def _onDatachannel(self, channel): '\n \n\n ' channel = DataChannel(channel) self._log.debug('Got channel: %s', channel.name) if (channel.name == 'default'): channel.putSubscription(NoClosedSubscription(self._get)) channel.subscribe(self._put_nowait) channel.onReady((lambda : self._setReady(channel.ready))) channel.onClose(self.close) else: self._dataChannelSubscriber.put_nowait(channel) self._dataChannels[channel.name] = channel<|docstring|>When a data channel comes in, adds it to the data channels, and sets up its messaging and stuff.<|endoftext|>
ee943925c6fd6043caa7abcaff4f2b2b1d5b0df3b5ce01aea743861423fb63e8
def onDataChannel(self, callback=None): '\n Acts as a subscriber...\n ' return self._dataChannelSubscriber.subscribe(callback)
Acts as a subscriber...
rtcbot/connection.py
onDataChannel
kimsooyoung/rtcbot
35
python
def onDataChannel(self, callback=None): '\n \n ' return self._dataChannelSubscriber.subscribe(callback)
def onDataChannel(self, callback=None): '\n \n ' return self._dataChannelSubscriber.subscribe(callback)<|docstring|>Acts as a subscriber...<|endoftext|>
e59c206bfbf31d0ae99f662724d2516fdaa4fc157215826978cf529a28887f90
def addDataChannel(self, name, ordered=True): '\n Adds a data channel to the connection. Note that the RTCConnection adds a "default" channel\n automatically, which you can subscribe to directly.\n ' self._log.debug('Adding data channel to connection') if ((name in self._dataChannels) or (name == 'default')): raise KeyError('Data channel %s already exists', name) dc = DataChannel(self._rtc.createDataChannel(name, ordered=ordered)) self._dataChannels[name] = dc return dc
Adds a data channel to the connection. Note that the RTCConnection adds a "default" channel automatically, which you can subscribe to directly.
rtcbot/connection.py
addDataChannel
kimsooyoung/rtcbot
35
python
def addDataChannel(self, name, ordered=True): '\n Adds a data channel to the connection. Note that the RTCConnection adds a "default" channel\n automatically, which you can subscribe to directly.\n ' self._log.debug('Adding data channel to connection') if ((name in self._dataChannels) or (name == 'default')): raise KeyError('Data channel %s already exists', name) dc = DataChannel(self._rtc.createDataChannel(name, ordered=ordered)) self._dataChannels[name] = dc return dc
def addDataChannel(self, name, ordered=True): '\n Adds a data channel to the connection. Note that the RTCConnection adds a "default" channel\n automatically, which you can subscribe to directly.\n ' self._log.debug('Adding data channel to connection') if ((name in self._dataChannels) or (name == 'default')): raise KeyError('Data channel %s already exists', name) dc = DataChannel(self._rtc.createDataChannel(name, ordered=ordered)) self._dataChannels[name] = dc return dc<|docstring|>Adds a data channel to the connection. Note that the RTCConnection adds a "default" channel automatically, which you can subscribe to directly.<|endoftext|>
bb51950f3a86a834836ce5c63cfb9c210eb497148581511946720c7e9fdc60f8
def getDataChannel(self, name): '\n Returns the data channel with the given name. Please note that the "default" channel is considered special,\n and is not returned.\n ' if (name == 'default'): raise KeyError("Default channel not available for 'get'. Use the RTCConnection's subscribe and put_nowait methods for access to it.") return self._dataChannels[name]
Returns the data channel with the given name. Please note that the "default" channel is considered special, and is not returned.
rtcbot/connection.py
getDataChannel
kimsooyoung/rtcbot
35
python
def getDataChannel(self, name): '\n Returns the data channel with the given name. Please note that the "default" channel is considered special,\n and is not returned.\n ' if (name == 'default'): raise KeyError("Default channel not available for 'get'. Use the RTCConnection's subscribe and put_nowait methods for access to it.") return self._dataChannels[name]
def getDataChannel(self, name): '\n Returns the data channel with the given name. Please note that the "default" channel is considered special,\n and is not returned.\n ' if (name == 'default'): raise KeyError("Default channel not available for 'get'. Use the RTCConnection's subscribe and put_nowait methods for access to it.") return self._dataChannels[name]<|docstring|>Returns the data channel with the given name. Please note that the "default" channel is considered special, and is not returned.<|endoftext|>
edd7900eb0ec6879ea110951f347309eae5abd0dd1d0a88f25e8e04a88f963ae
@property def video(self): '\n Convenience function - you can subscribe to it to get video frames once they show up\n ' return self._videoHandler
Convenience function - you can subscribe to it to get video frames once they show up
rtcbot/connection.py
video
kimsooyoung/rtcbot
35
python
@property def video(self): '\n \n ' return self._videoHandler
@property def video(self): '\n \n ' return self._videoHandler<|docstring|>Convenience function - you can subscribe to it to get video frames once they show up<|endoftext|>
559b3d328f43ce25b4c2df50bfc8118d9d4eebaf5b8247bba3877a082bd9d343
@property def audio(self): '\n Convenience function - you can subscribe to it to get audio once a stream is received\n ' return self._audioHandler
Convenience function - you can subscribe to it to get audio once a stream is received
rtcbot/connection.py
audio
kimsooyoung/rtcbot
35
python
@property def audio(self): '\n \n ' return self._audioHandler
@property def audio(self): '\n \n ' return self._audioHandler<|docstring|>Convenience function - you can subscribe to it to get audio once a stream is received<|endoftext|>
5c35f11528c5c6bcb2789cfe44c53b3c5664ec6baae26f2a9805c80dbdb85864
def close(self): '\n If the loop is running, returns a future that will close the connection. Otherwise, runs\n the loop temporarily to complete closing.\n ' if self.closed: if self._loop.is_running(): async def donothing(): pass return asyncio.ensure_future(donothing()) return None self._log.debug('Closing connection') super().close() self.video.close() self.audio.close() for dc in self._dataChannels: self._dataChannels[dc].close() self._dataChannelSubscriber.close() if self._loop.is_running(): self._log.debug('Loop is running - close will return a future!') return asyncio.ensure_future(self._rtc.close()) else: self._loop.run_until_complete(self._rtc.close()) return None
If the loop is running, returns a future that will close the connection. Otherwise, runs the loop temporarily to complete closing.
rtcbot/connection.py
close
kimsooyoung/rtcbot
35
python
def close(self): '\n If the loop is running, returns a future that will close the connection. Otherwise, runs\n the loop temporarily to complete closing.\n ' if self.closed: if self._loop.is_running(): async def donothing(): pass return asyncio.ensure_future(donothing()) return None self._log.debug('Closing connection') super().close() self.video.close() self.audio.close() for dc in self._dataChannels: self._dataChannels[dc].close() self._dataChannelSubscriber.close() if self._loop.is_running(): self._log.debug('Loop is running - close will return a future!') return asyncio.ensure_future(self._rtc.close()) else: self._loop.run_until_complete(self._rtc.close()) return None
def close(self): '\n If the loop is running, returns a future that will close the connection. Otherwise, runs\n the loop temporarily to complete closing.\n ' if self.closed: if self._loop.is_running(): async def donothing(): pass return asyncio.ensure_future(donothing()) return None self._log.debug('Closing connection') super().close() self.video.close() self.audio.close() for dc in self._dataChannels: self._dataChannels[dc].close() self._dataChannelSubscriber.close() if self._loop.is_running(): self._log.debug('Loop is running - close will return a future!') return asyncio.ensure_future(self._rtc.close()) else: self._loop.run_until_complete(self._rtc.close()) return None<|docstring|>If the loop is running, returns a future that will close the connection. Otherwise, runs the loop temporarily to complete closing.<|endoftext|>
6dcda9820e27e7ea613b56d7b49a24efd320d59617bd4e4b300d885acc1b5227
def send(self, msg): '\n Send is an alias for put_nowait - makes it easier for people new to rtcbot to understand\n what is going on\n ' self.put_nowait(msg)
Send is an alias for put_nowait - makes it easier for people new to rtcbot to understand what is going on
rtcbot/connection.py
send
kimsooyoung/rtcbot
35
python
def send(self, msg): '\n Send is an alias for put_nowait - makes it easier for people new to rtcbot to understand\n what is going on\n ' self.put_nowait(msg)
def send(self, msg): '\n Send is an alias for put_nowait - makes it easier for people new to rtcbot to understand\n what is going on\n ' self.put_nowait(msg)<|docstring|>Send is an alias for put_nowait - makes it easier for people new to rtcbot to understand what is going on<|endoftext|>
e0b033e254b95e2c72aa0fa7abdd80c092d32cb7079ea548c3220809350ecb17
@classmethod async def fetch(cls, id: Union[(str, int)]) -> Optional['File']: 'Fetch a `File` with the given id.' query = 'SELECT * FROM files WHERE id = $1' record = (await cls.pool.fetchrow(query, int(id))) if (record is None): return None return cls(**record)
Fetch a `File` with the given id.
cdn/file.py
fetch
Tech-With-Tim/models
2
python
@classmethod async def fetch(cls, id: Union[(str, int)]) -> Optional['File']: query = 'SELECT * FROM files WHERE id = $1' record = (await cls.pool.fetchrow(query, int(id))) if (record is None): return None return cls(**record)
@classmethod async def fetch(cls, id: Union[(str, int)]) -> Optional['File']: query = 'SELECT * FROM files WHERE id = $1' record = (await cls.pool.fetchrow(query, int(id))) if (record is None): return None return cls(**record)<|docstring|>Fetch a `File` with the given id.<|endoftext|>
37f5861e2f7cc4edc0cc0e437759af6d3e8abc679480c7bc588b9beb0f9da0be
@property def created_at(self) -> 'datetime': 'Returns the objects creation time in UTC.' return utils.snowflake_time(id=self.id, internal=True)
Returns the objects creation time in UTC.
cdn/file.py
created_at
Tech-With-Tim/models
2
python
@property def created_at(self) -> 'datetime': return utils.snowflake_time(id=self.id, internal=True)
@property def created_at(self) -> 'datetime': return utils.snowflake_time(id=self.id, internal=True)<|docstring|>Returns the objects creation time in UTC.<|endoftext|>
fac6d18f8cb7b5748d19337bd00518890b0c24e9af2fe86eb9c462ddb13e5321
@pytest.mark.unit def test_record_model_create(self, test_record_model): 'Should return a Subcategory record model instance.' assert isinstance(test_record_model, RAMSTKSubCategoryRecord) assert (test_record_model.__tablename__ == 'ramstk_subcategory') assert (test_record_model.category_id == 1) assert (test_record_model.subcategory_id == 1) assert (test_record_model.description == 'Linear')
Should return a Subcategory record model instance.
tests/models/commondb/subcategory/subcategory_unit_test.py
test_record_model_create
weibullguy/ramstk
4
python
@pytest.mark.unit def test_record_model_create(self, test_record_model): assert isinstance(test_record_model, RAMSTKSubCategoryRecord) assert (test_record_model.__tablename__ == 'ramstk_subcategory') assert (test_record_model.category_id == 1) assert (test_record_model.subcategory_id == 1) assert (test_record_model.description == 'Linear')
@pytest.mark.unit def test_record_model_create(self, test_record_model): assert isinstance(test_record_model, RAMSTKSubCategoryRecord) assert (test_record_model.__tablename__ == 'ramstk_subcategory') assert (test_record_model.category_id == 1) assert (test_record_model.subcategory_id == 1) assert (test_record_model.description == 'Linear')<|docstring|>Should return a Subcategory record model instance.<|endoftext|>
7ea89b44e28339158734af7714a53cd90f4aea973f3a6be66a099f2e996b88a3
@pytest.mark.unit def test_table_model_create(self, unit_test_table_model): 'Should return a Subcategory table model instance.' assert isinstance(unit_test_table_model, RAMSTKSubCategoryTable) assert isinstance(unit_test_table_model.tree, Tree) assert isinstance(unit_test_table_model.dao, MockDAO) assert (unit_test_table_model._lst_id_columns == ['category_id', 'subcategory_id']) assert (unit_test_table_model._tag == 'subcategory') assert (unit_test_table_model._root == 0) assert pub.isSubscribed(unit_test_table_model.do_get_attributes, 'request_get_subcategory_attributes') assert pub.isSubscribed(unit_test_table_model.do_get_tree, 'request_get_subcategory_tree')
Should return a Subcategory table model instance.
tests/models/commondb/subcategory/subcategory_unit_test.py
test_table_model_create
weibullguy/ramstk
4
python
@pytest.mark.unit def test_table_model_create(self, unit_test_table_model): assert isinstance(unit_test_table_model, RAMSTKSubCategoryTable) assert isinstance(unit_test_table_model.tree, Tree) assert isinstance(unit_test_table_model.dao, MockDAO) assert (unit_test_table_model._lst_id_columns == ['category_id', 'subcategory_id']) assert (unit_test_table_model._tag == 'subcategory') assert (unit_test_table_model._root == 0) assert pub.isSubscribed(unit_test_table_model.do_get_attributes, 'request_get_subcategory_attributes') assert pub.isSubscribed(unit_test_table_model.do_get_tree, 'request_get_subcategory_tree')
@pytest.mark.unit def test_table_model_create(self, unit_test_table_model): assert isinstance(unit_test_table_model, RAMSTKSubCategoryTable) assert isinstance(unit_test_table_model.tree, Tree) assert isinstance(unit_test_table_model.dao, MockDAO) assert (unit_test_table_model._lst_id_columns == ['category_id', 'subcategory_id']) assert (unit_test_table_model._tag == 'subcategory') assert (unit_test_table_model._root == 0) assert pub.isSubscribed(unit_test_table_model.do_get_attributes, 'request_get_subcategory_attributes') assert pub.isSubscribed(unit_test_table_model.do_get_tree, 'request_get_subcategory_tree')<|docstring|>Should return a Subcategory table model instance.<|endoftext|>
18a3b5c4828dc4e48daf97e86ed80be958575313f8143ae21b8ceefb2245315b
@pytest.mark.unit def test_get_attributes(self, test_record_model): 'Should return a dict of attribute key:value pairs.\n\n This method must be local because the attributes are different for each\n database record model.\n ' _attributes = test_record_model.get_attributes() assert (_attributes['category_id'] == 1) assert (_attributes['subcategory_id'] == 1) assert (_attributes['description'] == 'Linear')
Should return a dict of attribute key:value pairs. This method must be local because the attributes are different for each database record model.
tests/models/commondb/subcategory/subcategory_unit_test.py
test_get_attributes
weibullguy/ramstk
4
python
@pytest.mark.unit def test_get_attributes(self, test_record_model): 'Should return a dict of attribute key:value pairs.\n\n This method must be local because the attributes are different for each\n database record model.\n ' _attributes = test_record_model.get_attributes() assert (_attributes['category_id'] == 1) assert (_attributes['subcategory_id'] == 1) assert (_attributes['description'] == 'Linear')
@pytest.mark.unit def test_get_attributes(self, test_record_model): 'Should return a dict of attribute key:value pairs.\n\n This method must be local because the attributes are different for each\n database record model.\n ' _attributes = test_record_model.get_attributes() assert (_attributes['category_id'] == 1) assert (_attributes['subcategory_id'] == 1) assert (_attributes['description'] == 'Linear')<|docstring|>Should return a dict of attribute key:value pairs. This method must be local because the attributes are different for each database record model.<|endoftext|>
62f364957a1881df186e9cefc5d6e1573be65b4aa1549c1efff3f4ecae9baf3b
def compute(startdt, enddt, context): '\n PE\n :param startdt:\n :param enddt:\n :return:\n ' user_log.info('pe compute') _jyConnStr = 'mysql+pymysql://liangh:huaxun!@#db@172.18.44.5:3306/jydb' engine = create_engine(_jyConnStr) _category = [1] _sectors = [1, 2, 6] _sql = ("SELECT p.TradingDay,p.PE,a.SecuCode,a.SecuMarket FROM LC_DIndicesForValuation as p inner join secumain as a on a.innerCode=p.innerCode where a.SecuMarket in (83,90) and a.SecuCategory in (%s) and a.ListedSector in (%s) and a.ListedState!=9 and p.TradingDay between '%s' and '%s' order by p.TradingDay asc" % (','.join([str(i) for i in _category]), ','.join([str(i) for i in _sectors]), startdt.strftime('%Y-%m-%d'), enddt.strftime('%Y-%m-%d'))) print(_sql) _res = pd.read_sql(sql=_sql, con=engine) market = {90: 'XSHE', 83: 'XSHG'} _res.SecuCode = ((_res.SecuCode + '.') + _res.SecuMarket.apply((lambda x: market.get(x)))) _res = _res.drop(['SecuMarket'], axis=1).set_index(['TradingDay', 'SecuCode']).unstack(level=(- 1)) _res.columns = _res.columns.droplevel(level=0) return _res
PE :param startdt: :param enddt: :return:
rqalpha/examples/pe.py
compute
xclxxl414/rqalpha
0
python
def compute(startdt, enddt, context): '\n PE\n :param startdt:\n :param enddt:\n :return:\n ' user_log.info('pe compute') _jyConnStr = 'mysql+pymysql://liangh:huaxun!@#db@172.18.44.5:3306/jydb' engine = create_engine(_jyConnStr) _category = [1] _sectors = [1, 2, 6] _sql = ("SELECT p.TradingDay,p.PE,a.SecuCode,a.SecuMarket FROM LC_DIndicesForValuation as p inner join secumain as a on a.innerCode=p.innerCode where a.SecuMarket in (83,90) and a.SecuCategory in (%s) and a.ListedSector in (%s) and a.ListedState!=9 and p.TradingDay between '%s' and '%s' order by p.TradingDay asc" % (','.join([str(i) for i in _category]), ','.join([str(i) for i in _sectors]), startdt.strftime('%Y-%m-%d'), enddt.strftime('%Y-%m-%d'))) print(_sql) _res = pd.read_sql(sql=_sql, con=engine) market = {90: 'XSHE', 83: 'XSHG'} _res.SecuCode = ((_res.SecuCode + '.') + _res.SecuMarket.apply((lambda x: market.get(x)))) _res = _res.drop(['SecuMarket'], axis=1).set_index(['TradingDay', 'SecuCode']).unstack(level=(- 1)) _res.columns = _res.columns.droplevel(level=0) return _res
def compute(startdt, enddt, context): '\n PE\n :param startdt:\n :param enddt:\n :return:\n ' user_log.info('pe compute') _jyConnStr = 'mysql+pymysql://liangh:huaxun!@#db@172.18.44.5:3306/jydb' engine = create_engine(_jyConnStr) _category = [1] _sectors = [1, 2, 6] _sql = ("SELECT p.TradingDay,p.PE,a.SecuCode,a.SecuMarket FROM LC_DIndicesForValuation as p inner join secumain as a on a.innerCode=p.innerCode where a.SecuMarket in (83,90) and a.SecuCategory in (%s) and a.ListedSector in (%s) and a.ListedState!=9 and p.TradingDay between '%s' and '%s' order by p.TradingDay asc" % (','.join([str(i) for i in _category]), ','.join([str(i) for i in _sectors]), startdt.strftime('%Y-%m-%d'), enddt.strftime('%Y-%m-%d'))) print(_sql) _res = pd.read_sql(sql=_sql, con=engine) market = {90: 'XSHE', 83: 'XSHG'} _res.SecuCode = ((_res.SecuCode + '.') + _res.SecuMarket.apply((lambda x: market.get(x)))) _res = _res.drop(['SecuMarket'], axis=1).set_index(['TradingDay', 'SecuCode']).unstack(level=(- 1)) _res.columns = _res.columns.droplevel(level=0) return _res<|docstring|>PE :param startdt: :param enddt: :return:<|endoftext|>
d0b91e365dce05783c7254af7804e8bd0feeea824bb0ed1a0b41e983fe23fc82
def _onSendMenuButtonClicked(self): 'Executed when the menu button is clicked.' send_to_3D_print_log = self._hasSlicedModel() if (not send_to_3D_print_log): Logger.log('d', 'No file sliced, not sending to 3D Print Log') self._createDialog('Please slice file before sending to 3D Print Log.', 'File Not Sliced').exec() return self._sendTo3DPrintLog()
Executed when the menu button is clicked.
PrintLogUploader.py
_onSendMenuButtonClicked
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _onSendMenuButtonClicked(self): send_to_3D_print_log = self._hasSlicedModel() if (not send_to_3D_print_log): Logger.log('d', 'No file sliced, not sending to 3D Print Log') self._createDialog('Please slice file before sending to 3D Print Log.', 'File Not Sliced').exec() return self._sendTo3DPrintLog()
def _onSendMenuButtonClicked(self): send_to_3D_print_log = self._hasSlicedModel() if (not send_to_3D_print_log): Logger.log('d', 'No file sliced, not sending to 3D Print Log') self._createDialog('Please slice file before sending to 3D Print Log.', 'File Not Sliced').exec() return self._sendTo3DPrintLog()<|docstring|>Executed when the menu button is clicked.<|endoftext|>
fbcfe858c5fab13bc0fc91e2edf89293b4e8b154b8e599645693f8e35bbcb983
def _onWriteStarted(self, output_device): 'Send to 3D Print Log when gcode is saved.' try: send_to_3D_print_log = self._shouldSendTo3DPrintLog() if (not send_to_3D_print_log): Logger.log('d', 'User denied the prompt') return self._sendTo3DPrintLog() except Exception: Logger.logException('e', 'Exception raised in _onWriteStarted')
Send to 3D Print Log when gcode is saved.
PrintLogUploader.py
_onWriteStarted
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _onWriteStarted(self, output_device): try: send_to_3D_print_log = self._shouldSendTo3DPrintLog() if (not send_to_3D_print_log): Logger.log('d', 'User denied the prompt') return self._sendTo3DPrintLog() except Exception: Logger.logException('e', 'Exception raised in _onWriteStarted')
def _onWriteStarted(self, output_device): try: send_to_3D_print_log = self._shouldSendTo3DPrintLog() if (not send_to_3D_print_log): Logger.log('d', 'User denied the prompt') return self._sendTo3DPrintLog() except Exception: Logger.logException('e', 'Exception raised in _onWriteStarted')<|docstring|>Send to 3D Print Log when gcode is saved.<|endoftext|>
35837f9b09807cc741f70e90479fcce93e475efcfa2db2a1727a567c841ba688
def _sendTo3DPrintLog(self): 'Gets the print settings and send them to 3D Print Log' try: Logger.log('i', 'Generating Test Log') data = dict() data['curaVersion'] = self._application.getVersion() data['pluginVersion'] = self.plugin_version settings = dict() settings['note'] = self._generateNotes() settings['print_name'] = self._getPrintName() settings.update(self._getCuraMetadata()) settings.update(self._getPrintTime()) settings.update(self._getMaterialUsage()) preferences = self._application.getInstance().getPreferences() include_snapshot = preferences.getValue('3d_print_log/include_snapshot') if include_snapshot: snapshot = self._generateSnapshot() if snapshot: settings['snapshot'] = snapshot data['settings'] = settings self._sendToApi(data) except Exception: Logger.logException('e', 'Exception raised while sending print info in _sendTo3DPrintLog.')
Gets the print settings and send them to 3D Print Log
PrintLogUploader.py
_sendTo3DPrintLog
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _sendTo3DPrintLog(self): try: Logger.log('i', 'Generating Test Log') data = dict() data['curaVersion'] = self._application.getVersion() data['pluginVersion'] = self.plugin_version settings = dict() settings['note'] = self._generateNotes() settings['print_name'] = self._getPrintName() settings.update(self._getCuraMetadata()) settings.update(self._getPrintTime()) settings.update(self._getMaterialUsage()) preferences = self._application.getInstance().getPreferences() include_snapshot = preferences.getValue('3d_print_log/include_snapshot') if include_snapshot: snapshot = self._generateSnapshot() if snapshot: settings['snapshot'] = snapshot data['settings'] = settings self._sendToApi(data) except Exception: Logger.logException('e', 'Exception raised while sending print info in _sendTo3DPrintLog.')
def _sendTo3DPrintLog(self): try: Logger.log('i', 'Generating Test Log') data = dict() data['curaVersion'] = self._application.getVersion() data['pluginVersion'] = self.plugin_version settings = dict() settings['note'] = self._generateNotes() settings['print_name'] = self._getPrintName() settings.update(self._getCuraMetadata()) settings.update(self._getPrintTime()) settings.update(self._getMaterialUsage()) preferences = self._application.getInstance().getPreferences() include_snapshot = preferences.getValue('3d_print_log/include_snapshot') if include_snapshot: snapshot = self._generateSnapshot() if snapshot: settings['snapshot'] = snapshot data['settings'] = settings self._sendToApi(data) except Exception: Logger.logException('e', 'Exception raised while sending print info in _sendTo3DPrintLog.')<|docstring|>Gets the print settings and send them to 3D Print Log<|endoftext|>
34c5520686d3a2c045aa6065615df6edafe72fb42d611db46791acca28879cbd
def _shouldSendTo3DPrintLog(self) -> bool: 'Returns true if this print should be sent.' hasSliced = self._hasSlicedModel() if (not hasSliced): return False dialog = self._createConfirmationDialog() returnValue = dialog.exec() return (returnValue == QMessageBox.Ok)
Returns true if this print should be sent.
PrintLogUploader.py
_shouldSendTo3DPrintLog
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _shouldSendTo3DPrintLog(self) -> bool: hasSliced = self._hasSlicedModel() if (not hasSliced): return False dialog = self._createConfirmationDialog() returnValue = dialog.exec() return (returnValue == QMessageBox.Ok)
def _shouldSendTo3DPrintLog(self) -> bool: hasSliced = self._hasSlicedModel() if (not hasSliced): return False dialog = self._createConfirmationDialog() returnValue = dialog.exec() return (returnValue == QMessageBox.Ok)<|docstring|>Returns true if this print should be sent.<|endoftext|>
ba9adcd5fc31b429bb56ee267c6130a5a7042e534991e7b97f90f073ee9d0467
def _hasSlicedModel(self) -> bool: 'Checks to see if the model has been sliced' scene = self._application.getController().getScene() if (not hasattr(scene, 'gcode_dict')): return False gcode_dict = getattr(scene, 'gcode_dict') if (not gcode_dict): return False return True
Checks to see if the model has been sliced
PrintLogUploader.py
_hasSlicedModel
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _hasSlicedModel(self) -> bool: scene = self._application.getController().getScene() if (not hasattr(scene, 'gcode_dict')): return False gcode_dict = getattr(scene, 'gcode_dict') if (not gcode_dict): return False return True
def _hasSlicedModel(self) -> bool: scene = self._application.getController().getScene() if (not hasattr(scene, 'gcode_dict')): return False gcode_dict = getattr(scene, 'gcode_dict') if (not gcode_dict): return False return True<|docstring|>Checks to see if the model has been sliced<|endoftext|>
e34e98bb4ca3d077818f393f5482b4da4d9a813075e64228a924074bd22b5364
def _createConfirmationDialog(self): 'Create a message box prompting the user if they want to send this print information.' msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText('Would you like to send to 3Dprintlog.com?') msgBox.setWindowTitle('Send to 3D Print Log?') msgBox.setStandardButtons((QMessageBox.Ok | QMessageBox.Cancel)) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox
Create a message box prompting the user if they want to send this print information.
PrintLogUploader.py
_createConfirmationDialog
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _createConfirmationDialog(self): msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText('Would you like to send to 3Dprintlog.com?') msgBox.setWindowTitle('Send to 3D Print Log?') msgBox.setStandardButtons((QMessageBox.Ok | QMessageBox.Cancel)) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox
def _createConfirmationDialog(self): msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText('Would you like to send to 3Dprintlog.com?') msgBox.setWindowTitle('Send to 3D Print Log?') msgBox.setStandardButtons((QMessageBox.Ok | QMessageBox.Cancel)) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox<|docstring|>Create a message box prompting the user if they want to send this print information.<|endoftext|>
3e3600a58dc1f519a740fc7716a4e74106ab20d6e5d593395d4e775cbbc905e2
def _createDialog(self, text, title): 'Create a messsage box with a title and text' msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText(text) msgBox.setWindowTitle(title) msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox
Create a messsage box with a title and text
PrintLogUploader.py
_createDialog
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _createDialog(self, text, title): msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText(text) msgBox.setWindowTitle(title) msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox
def _createDialog(self, text, title): msgBox = QMessageBox() msgBox.setIcon(QMessageBox.Information) msgBox.setText(text) msgBox.setWindowTitle(title) msgBox.setStandardButtons(QMessageBox.Ok) msgBox.setDefaultButton(QMessageBox.Ok) self._add3DPrintLogLogo(msgBox) return msgBox<|docstring|>Create a messsage box with a title and text<|endoftext|>
d7a72e3f176552420659a156f0bf976c4df9876a2bd0fb30eba2cdedcf01f8be
def _add3DPrintLogLogo(self, msgBox): 'Adds the 3D Print Log Logo as a message boxes icon.' p = QPixmap() plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId()) if (not plugin_path): Logger.log('e', 'Could not get plugin path!', self.getPluginId()) return None file_path = os.path.join(plugin_path, '3DPrintLog_logo_64px.jpg') p.load(file_path) msgBox.setIconPixmap(p)
Adds the 3D Print Log Logo as a message boxes icon.
PrintLogUploader.py
_add3DPrintLogLogo
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _add3DPrintLogLogo(self, msgBox): p = QPixmap() plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId()) if (not plugin_path): Logger.log('e', 'Could not get plugin path!', self.getPluginId()) return None file_path = os.path.join(plugin_path, '3DPrintLog_logo_64px.jpg') p.load(file_path) msgBox.setIconPixmap(p)
def _add3DPrintLogLogo(self, msgBox): p = QPixmap() plugin_path = PluginRegistry.getInstance().getPluginPath(self.getPluginId()) if (not plugin_path): Logger.log('e', 'Could not get plugin path!', self.getPluginId()) return None file_path = os.path.join(plugin_path, '3DPrintLog_logo_64px.jpg') p.load(file_path) msgBox.setIconPixmap(p)<|docstring|>Adds the 3D Print Log Logo as a message boxes icon.<|endoftext|>
ea60d21ddded23553fa0df3add649d5190242c8ee8d47975e4a2be6be906e96c
def _sendToApi(self, data): 'Sends the data to the 3D Print Log api.' binary_data = json.dumps(data).encode('utf-8') network_manager = self._application.getHttpRequestManager() network_manager.post(self.api_url, data=binary_data, callback=self._onRequestFinished, error_callback=self._onRequestError)
Sends the data to the 3D Print Log api.
PrintLogUploader.py
_sendToApi
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _sendToApi(self, data): binary_data = json.dumps(data).encode('utf-8') network_manager = self._application.getHttpRequestManager() network_manager.post(self.api_url, data=binary_data, callback=self._onRequestFinished, error_callback=self._onRequestError)
def _sendToApi(self, data): binary_data = json.dumps(data).encode('utf-8') network_manager = self._application.getHttpRequestManager() network_manager.post(self.api_url, data=binary_data, callback=self._onRequestFinished, error_callback=self._onRequestError)<|docstring|>Sends the data to the 3D Print Log api.<|endoftext|>
feace19c4cac2ce62e22454b22a3c83a46022274f64d45269d761168a7ef389d
def _onRequestFinished(self, reply: 'QNetworkReply') -> None: 'Handle the response from the API after sending the settings.' status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) if (status_code == 200): results = json.loads(reply.readAll().data().decode('utf-8')) newGuid = results['newSettingId'] data = dict() data['cura_version'] = self._application.getVersion() data['plugin_version'] = self.plugin_version data['settingId'] = newGuid self._openBrowser(data) return data = reply.readAll().data().decode('utf-8') Logger.log('e', 'Settings Api request failed, status code %s, data: %s', status_code, data)
Handle the response from the API after sending the settings.
PrintLogUploader.py
_onRequestFinished
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _onRequestFinished(self, reply: 'QNetworkReply') -> None: status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) if (status_code == 200): results = json.loads(reply.readAll().data().decode('utf-8')) newGuid = results['newSettingId'] data = dict() data['cura_version'] = self._application.getVersion() data['plugin_version'] = self.plugin_version data['settingId'] = newGuid self._openBrowser(data) return data = reply.readAll().data().decode('utf-8') Logger.log('e', 'Settings Api request failed, status code %s, data: %s', status_code, data)
def _onRequestFinished(self, reply: 'QNetworkReply') -> None: status_code = reply.attribute(QNetworkRequest.HttpStatusCodeAttribute) if (status_code == 200): results = json.loads(reply.readAll().data().decode('utf-8')) newGuid = results['newSettingId'] data = dict() data['cura_version'] = self._application.getVersion() data['plugin_version'] = self.plugin_version data['settingId'] = newGuid self._openBrowser(data) return data = reply.readAll().data().decode('utf-8') Logger.log('e', 'Settings Api request failed, status code %s, data: %s', status_code, data)<|docstring|>Handle the response from the API after sending the settings.<|endoftext|>
5c98147d70eea3e1dff28741a7edae5c4617d77bfb384fa08b7b8652c746bd97
def _openBrowser(self, data): 'Opens 3D Print Log website and passes the data as query params.' import webbrowser try: from urllib import urlencode except ImportError: from urllib.parse import urlencode query_params = urlencode(data) url = ((self.new_print_url + '?') + query_params) webbrowser.open(url, new=0, autoraise=True)
Opens 3D Print Log website and passes the data as query params.
PrintLogUploader.py
_openBrowser
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _openBrowser(self, data): import webbrowser try: from urllib import urlencode except ImportError: from urllib.parse import urlencode query_params = urlencode(data) url = ((self.new_print_url + '?') + query_params) webbrowser.open(url, new=0, autoraise=True)
def _openBrowser(self, data): import webbrowser try: from urllib import urlencode except ImportError: from urllib.parse import urlencode query_params = urlencode(data) url = ((self.new_print_url + '?') + query_params) webbrowser.open(url, new=0, autoraise=True)<|docstring|>Opens 3D Print Log website and passes the data as query params.<|endoftext|>
9b76234d189eaefdfb8604c8c06d8acbfff1149ba65c757b33e14f1e66859760
def _generateSnapshot(self) -> Optional[str]: 'Grabs the snapshot from the Cura Backend if one exists and returns it as a buffer.' try: Logger.log('i', 'Generating Snapshot') backend = CuraApplication.getInstance().getBackend() snapshot = (None if (getattr(backend, 'getLatestSnapshot', None) is None) else backend.getLatestSnapshot()) if (snapshot is None): Logger.log('i', 'No snapshot from backend, generate snapshot ourselves.') try: from cura.Snapshot import Snapshot snapshot = Snapshot.snapshot(width=300, height=300) except: Logger.log('e', 'Failed to create snapshot image') return None if snapshot: Logger.log('i', 'Snapshot Found') thumbnail_buffer = QBuffer() thumbnail_buffer.open(QBuffer.ReadWrite) snapshot.save(thumbnail_buffer, 'PNG') encodedSnapshot = thumbnail_buffer.data().toBase64().data().decode('utf-8') thumbnail_buffer.close() return encodedSnapshot else: Logger.log('i', 'No Snapshot Found') return None except Exception: Logger.logException('e', 'Exception raised while saving snapshot') return None
Grabs the snapshot from the Cura Backend if one exists and returns it as a buffer.
PrintLogUploader.py
_generateSnapshot
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _generateSnapshot(self) -> Optional[str]: try: Logger.log('i', 'Generating Snapshot') backend = CuraApplication.getInstance().getBackend() snapshot = (None if (getattr(backend, 'getLatestSnapshot', None) is None) else backend.getLatestSnapshot()) if (snapshot is None): Logger.log('i', 'No snapshot from backend, generate snapshot ourselves.') try: from cura.Snapshot import Snapshot snapshot = Snapshot.snapshot(width=300, height=300) except: Logger.log('e', 'Failed to create snapshot image') return None if snapshot: Logger.log('i', 'Snapshot Found') thumbnail_buffer = QBuffer() thumbnail_buffer.open(QBuffer.ReadWrite) snapshot.save(thumbnail_buffer, 'PNG') encodedSnapshot = thumbnail_buffer.data().toBase64().data().decode('utf-8') thumbnail_buffer.close() return encodedSnapshot else: Logger.log('i', 'No Snapshot Found') return None except Exception: Logger.logException('e', 'Exception raised while saving snapshot') return None
def _generateSnapshot(self) -> Optional[str]: try: Logger.log('i', 'Generating Snapshot') backend = CuraApplication.getInstance().getBackend() snapshot = (None if (getattr(backend, 'getLatestSnapshot', None) is None) else backend.getLatestSnapshot()) if (snapshot is None): Logger.log('i', 'No snapshot from backend, generate snapshot ourselves.') try: from cura.Snapshot import Snapshot snapshot = Snapshot.snapshot(width=300, height=300) except: Logger.log('e', 'Failed to create snapshot image') return None if snapshot: Logger.log('i', 'Snapshot Found') thumbnail_buffer = QBuffer() thumbnail_buffer.open(QBuffer.ReadWrite) snapshot.save(thumbnail_buffer, 'PNG') encodedSnapshot = thumbnail_buffer.data().toBase64().data().decode('utf-8') thumbnail_buffer.close() return encodedSnapshot else: Logger.log('i', 'No Snapshot Found') return None except Exception: Logger.logException('e', 'Exception raised while saving snapshot') return None<|docstring|>Grabs the snapshot from the Cura Backend if one exists and returns it as a buffer.<|endoftext|>
99ec06ee7956cb676b43ccb0b063f0c3ff23408f9e241b646f1e936005dba3f3
def _getCuraMetadata(self): 'Returns meta data about cura and the plugin itself.' data = dict() data['time_stamp'] = time.time() data['cura_version'] = self._application.getVersion() data['cura_build_type'] = ApplicationMetadata.CuraBuildType data['plugin_version'] = self.plugin_version return data
Returns meta data about cura and the plugin itself.
PrintLogUploader.py
_getCuraMetadata
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _getCuraMetadata(self): data = dict() data['time_stamp'] = time.time() data['cura_version'] = self._application.getVersion() data['cura_build_type'] = ApplicationMetadata.CuraBuildType data['plugin_version'] = self.plugin_version return data
def _getCuraMetadata(self): data = dict() data['time_stamp'] = time.time() data['cura_version'] = self._application.getVersion() data['cura_build_type'] = ApplicationMetadata.CuraBuildType data['plugin_version'] = self.plugin_version return data<|docstring|>Returns meta data about cura and the plugin itself.<|endoftext|>
a74f8afce30d0504206cd8c11cf719cfce759c3f014ad578dd1576a8ef6f79eb
def _getPrintTime(self): 'Returns the estimated print time in seconds.' data = dict() print_information = self._application.getPrintInformation() data['estimated_print_time_seconds'] = int(print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds)) return data
Returns the estimated print time in seconds.
PrintLogUploader.py
_getPrintTime
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _getPrintTime(self): data = dict() print_information = self._application.getPrintInformation() data['estimated_print_time_seconds'] = int(print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds)) return data
def _getPrintTime(self): data = dict() print_information = self._application.getPrintInformation() data['estimated_print_time_seconds'] = int(print_information.currentPrintTime.getDisplayString(DurationFormat.Format.Seconds)) return data<|docstring|>Returns the estimated print time in seconds.<|endoftext|>
72ce8eaa72e779c52b10b5647f87917bf2e472f4d3143a89981bf7c686e1a941
def _getPrintName(self): 'Returns the name of the Print Object.' for node in DepthFirstIterator(self._application.getController().getScene().getRoot()): if node.callDecoration('isSliceable'): return node.getName() return ''
Returns the name of the Print Object.
PrintLogUploader.py
_getPrintName
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _getPrintName(self): for node in DepthFirstIterator(self._application.getController().getScene().getRoot()): if node.callDecoration('isSliceable'): return node.getName() return
def _getPrintName(self): for node in DepthFirstIterator(self._application.getController().getScene().getRoot()): if node.callDecoration('isSliceable'): return node.getName() return <|docstring|>Returns the name of the Print Object.<|endoftext|>
01595a074ec5c0b4e35c6d26c667bde8fd7ed1414bc3eec871c026ccf1c18e3f
def _getMaterialUsage(self): 'Returns a dictionary containing the material used in milligrams.' print_information = self._application.getPrintInformation() data = dict() material_used_g = sum(print_information.materialWeights) material_used_mg = round((material_used_g * 1000)) data['material_used_mg'] = material_used_mg return data
Returns a dictionary containing the material used in milligrams.
PrintLogUploader.py
_getMaterialUsage
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _getMaterialUsage(self): print_information = self._application.getPrintInformation() data = dict() material_used_g = sum(print_information.materialWeights) material_used_mg = round((material_used_g * 1000)) data['material_used_mg'] = material_used_mg return data
def _getMaterialUsage(self): print_information = self._application.getPrintInformation() data = dict() material_used_g = sum(print_information.materialWeights) material_used_mg = round((material_used_g * 1000)) data['material_used_mg'] = material_used_mg return data<|docstring|>Returns a dictionary containing the material used in milligrams.<|endoftext|>
cbe09440739b3cf656e9fd227519f957bbd5c057b914c8e0cb684525f67bf779
def _buildSettingRow(self, setting_name) -> str: 'Builds the string representation of a single setting, \n taking into account if the setting is different between extruders.' machine_manager = self._application.getMachineManager() global_stack = machine_manager.activeMachine extruders = global_stack.extruderList extruders = sorted(extruders, key=(lambda extruder: extruder.getMetaDataEntry('position'))) settingValues = collections.OrderedDict() for extruder in extruders: extruder_position = int(extruder.getMetaDataEntry('position', '0')) print_information = self._application.getPrintInformation() if (len(print_information.materialLengths) > extruder_position): materialUsed = print_information.materialLengths[extruder_position] if ((materialUsed is None) or (not (materialUsed > 0))): continue value = extruder.getProperty(setting_name, 'value') unit = extruder.getProperty(setting_name, 'unit') result = str(value) if (unit and (not str(unit).isspace())): if (str(unit) in ['°C', '°F', '%']): result = (result + str(unit)) else: result = ((result + ' ') + str(unit)) settingValues[('Ex ' + str((extruder_position + 1)))] = result areAllValuesTheSame = (len(list(set(list(settingValues.values())))) == 1) if areAllValuesTheSame: label = global_stack.getProperty(setting_name, 'label') value = list(settingValues.values())[0] return ((str(label) + ': ') + str(value)) label = global_stack.getProperty(setting_name, 'label') result = (str(label) + ': ') isFirst = True for setting in settingValues: if (not isFirst): result = (result + ', ') result = ((((result + settingValues[setting]) + ' (') + str(setting)) + ')') isFirst = False return result
Builds the string representation of a single setting, taking into account if the setting is different between extruders.
PrintLogUploader.py
_buildSettingRow
ChristopherHoffman/3d-print-log-cura-plugin
5
python
def _buildSettingRow(self, setting_name) -> str: 'Builds the string representation of a single setting, \n taking into account if the setting is different between extruders.' machine_manager = self._application.getMachineManager() global_stack = machine_manager.activeMachine extruders = global_stack.extruderList extruders = sorted(extruders, key=(lambda extruder: extruder.getMetaDataEntry('position'))) settingValues = collections.OrderedDict() for extruder in extruders: extruder_position = int(extruder.getMetaDataEntry('position', '0')) print_information = self._application.getPrintInformation() if (len(print_information.materialLengths) > extruder_position): materialUsed = print_information.materialLengths[extruder_position] if ((materialUsed is None) or (not (materialUsed > 0))): continue value = extruder.getProperty(setting_name, 'value') unit = extruder.getProperty(setting_name, 'unit') result = str(value) if (unit and (not str(unit).isspace())): if (str(unit) in ['°C', '°F', '%']): result = (result + str(unit)) else: result = ((result + ' ') + str(unit)) settingValues[('Ex ' + str((extruder_position + 1)))] = result areAllValuesTheSame = (len(list(set(list(settingValues.values())))) == 1) if areAllValuesTheSame: label = global_stack.getProperty(setting_name, 'label') value = list(settingValues.values())[0] return ((str(label) + ': ') + str(value)) label = global_stack.getProperty(setting_name, 'label') result = (str(label) + ': ') isFirst = True for setting in settingValues: if (not isFirst): result = (result + ', ') result = ((((result + settingValues[setting]) + ' (') + str(setting)) + ')') isFirst = False return result
def _buildSettingRow(self, setting_name) -> str: 'Builds the string representation of a single setting, \n taking into account if the setting is different between extruders.' machine_manager = self._application.getMachineManager() global_stack = machine_manager.activeMachine extruders = global_stack.extruderList extruders = sorted(extruders, key=(lambda extruder: extruder.getMetaDataEntry('position'))) settingValues = collections.OrderedDict() for extruder in extruders: extruder_position = int(extruder.getMetaDataEntry('position', '0')) print_information = self._application.getPrintInformation() if (len(print_information.materialLengths) > extruder_position): materialUsed = print_information.materialLengths[extruder_position] if ((materialUsed is None) or (not (materialUsed > 0))): continue value = extruder.getProperty(setting_name, 'value') unit = extruder.getProperty(setting_name, 'unit') result = str(value) if (unit and (not str(unit).isspace())): if (str(unit) in ['°C', '°F', '%']): result = (result + str(unit)) else: result = ((result + ' ') + str(unit)) settingValues[('Ex ' + str((extruder_position + 1)))] = result areAllValuesTheSame = (len(list(set(list(settingValues.values())))) == 1) if areAllValuesTheSame: label = global_stack.getProperty(setting_name, 'label') value = list(settingValues.values())[0] return ((str(label) + ': ') + str(value)) label = global_stack.getProperty(setting_name, 'label') result = (str(label) + ': ') isFirst = True for setting in settingValues: if (not isFirst): result = (result + ', ') result = ((((result + settingValues[setting]) + ' (') + str(setting)) + ')') isFirst = False return result<|docstring|>Builds the string representation of a single setting, taking into account if the setting is different between extruders.<|endoftext|>
7ce5a98b746fb2f00fbab878cfb79b952b4f0d861d55438666d9e7dd59e16f05
def get_image_name(self): '\n :return: image name\n '
:return: image name
services/docker_runner.py
get_image_name
eliorav/Population-Genotype-Frequency
0
python
def get_image_name(self): '\n \n '
def get_image_name(self): '\n \n '<|docstring|>:return: image name<|endoftext|>
cf1eddd481c3e655da38dc779e8d7845ef1784e660c20d53ebf8482cf6c07167
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n ' return None
Get a MIDI message, convert to button (0-7), top row (0-3) to select preset
src/midibox.py
get_button
ytsibizov/midibox
4
python
def get_button(self): ' \n ' return None
def get_button(self): ' \n ' return None<|docstring|>Get a MIDI message, convert to button (0-7), top row (0-3) to select preset<|endoftext|>
d506106fd93906ccec959f61ea4be9243920e7cd486886a867d1bc2292bd4969
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n DEBUG:root:[144, 91, 0]\n DEBUG:root:[144, 91, 127]\n DEBUG:root:[144, 92, 0]\n DEBUG:root:[144, 92, 127]\n DEBUG:root:[144, 93, 0]\n DEBUG:root:[144, 93, 127]\n DEBUG:root:[144, 94, 0]\n DEBUG:root:[144, 94, 127]\n Bottom row:\n DEBUG:root:[144, 86, 127]\n DEBUG:root:[144, 86, 0]\n DEBUG:root:[144, 95, 127]\n DEBUG:root:[144, 95, 0]\n DEBUG:root:[144, 48, 127]\n DEBUG:root:[144, 48, 0]\n DEBUG:root:[144, 49, 127]\n DEBUG:root:[144, 49, 0]\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 144) and (message[2] == 127)): button = (message[1] - 91) if ((button >= 0) and (button <= 3)): logging.debug('Button {0}'.format(button)) return button if (message[1] == 86): button = 4 if (message[1] == 95): button = 5 if (message[1] == 48): button = 6 if (message[1] == 49): button = 7 if (button is not None): logging.debug('Button {}'.format(button)) return button return None
Get a MIDI message, convert to button (0-7), top row (0-3) to select preset Top row: DEBUG:root:[144, 91, 0] DEBUG:root:[144, 91, 127] DEBUG:root:[144, 92, 0] DEBUG:root:[144, 92, 127] DEBUG:root:[144, 93, 0] DEBUG:root:[144, 93, 127] DEBUG:root:[144, 94, 0] DEBUG:root:[144, 94, 127] Bottom row: DEBUG:root:[144, 86, 127] DEBUG:root:[144, 86, 0] DEBUG:root:[144, 95, 127] DEBUG:root:[144, 95, 0] DEBUG:root:[144, 48, 127] DEBUG:root:[144, 48, 0] DEBUG:root:[144, 49, 127] DEBUG:root:[144, 49, 0]
src/midibox.py
get_button
ytsibizov/midibox
4
python
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n DEBUG:root:[144, 91, 0]\n DEBUG:root:[144, 91, 127]\n DEBUG:root:[144, 92, 0]\n DEBUG:root:[144, 92, 127]\n DEBUG:root:[144, 93, 0]\n DEBUG:root:[144, 93, 127]\n DEBUG:root:[144, 94, 0]\n DEBUG:root:[144, 94, 127]\n Bottom row:\n DEBUG:root:[144, 86, 127]\n DEBUG:root:[144, 86, 0]\n DEBUG:root:[144, 95, 127]\n DEBUG:root:[144, 95, 0]\n DEBUG:root:[144, 48, 127]\n DEBUG:root:[144, 48, 0]\n DEBUG:root:[144, 49, 127]\n DEBUG:root:[144, 49, 0]\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 144) and (message[2] == 127)): button = (message[1] - 91) if ((button >= 0) and (button <= 3)): logging.debug('Button {0}'.format(button)) return button if (message[1] == 86): button = 4 if (message[1] == 95): button = 5 if (message[1] == 48): button = 6 if (message[1] == 49): button = 7 if (button is not None): logging.debug('Button {}'.format(button)) return button return None
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n DEBUG:root:[144, 91, 0]\n DEBUG:root:[144, 91, 127]\n DEBUG:root:[144, 92, 0]\n DEBUG:root:[144, 92, 127]\n DEBUG:root:[144, 93, 0]\n DEBUG:root:[144, 93, 127]\n DEBUG:root:[144, 94, 0]\n DEBUG:root:[144, 94, 127]\n Bottom row:\n DEBUG:root:[144, 86, 127]\n DEBUG:root:[144, 86, 0]\n DEBUG:root:[144, 95, 127]\n DEBUG:root:[144, 95, 0]\n DEBUG:root:[144, 48, 127]\n DEBUG:root:[144, 48, 0]\n DEBUG:root:[144, 49, 127]\n DEBUG:root:[144, 49, 0]\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 144) and (message[2] == 127)): button = (message[1] - 91) if ((button >= 0) and (button <= 3)): logging.debug('Button {0}'.format(button)) return button if (message[1] == 86): button = 4 if (message[1] == 95): button = 5 if (message[1] == 48): button = 6 if (message[1] == 49): button = 7 if (button is not None): logging.debug('Button {}'.format(button)) return button return None<|docstring|>Get a MIDI message, convert to button (0-7), top row (0-3) to select preset Top row: DEBUG:root:[144, 91, 0] DEBUG:root:[144, 91, 127] DEBUG:root:[144, 92, 0] DEBUG:root:[144, 92, 127] DEBUG:root:[144, 93, 0] DEBUG:root:[144, 93, 127] DEBUG:root:[144, 94, 0] DEBUG:root:[144, 94, 127] Bottom row: DEBUG:root:[144, 86, 127] DEBUG:root:[144, 86, 0] DEBUG:root:[144, 95, 127] DEBUG:root:[144, 95, 0] DEBUG:root:[144, 48, 127] DEBUG:root:[144, 48, 0] DEBUG:root:[144, 49, 127] DEBUG:root:[144, 49, 0]<|endoftext|>
7667cfb9f2821d8977b7da712e5e0ac2dd6eafcd03f326ecfceeeedcc59232dc
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 138) and (message[2] == 0)): button = (message[1] - 8) if ((button >= 0) and (button <= 8)): logging.debug('Button {0}'.format(button)) return button if (button is not None): logging.debug('Button {}'.format(button)) return button return None
Get a MIDI message, convert to button (0-7), top row (0-3) to select preset Top row:
src/midibox.py
get_button
ytsibizov/midibox
4
python
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 138) and (message[2] == 0)): button = (message[1] - 8) if ((button >= 0) and (button <= 8)): logging.debug('Button {0}'.format(button)) return button if (button is not None): logging.debug('Button {}'.format(button)) return button return None
def get_button(self): ' Get a MIDI message, convert to button (0-7), top row (0-3) to select preset\n Top row:\n ' button = None msg = self.indev.get_message() if msg: (message, deltatime) = msg logging.debug(('MIDI IN: %r' % message)) if ((message[0] == 138) and (message[2] == 0)): button = (message[1] - 8) if ((button >= 0) and (button <= 8)): logging.debug('Button {0}'.format(button)) return button if (button is not None): logging.debug('Button {}'.format(button)) return button return None<|docstring|>Get a MIDI message, convert to button (0-7), top row (0-3) to select preset Top row:<|endoftext|>
03ed506a10242aee68e2a615f9b0a79feee902d6327a7c7649b049e92e7fb922
def load_authors(authors_file: Path) -> Dict[(str, Author)]: 'Load a list of authors from the given file' with open(authors_file) as f: authors_list = yaml.load(f, Loader=yaml.SafeLoader) authors = [Author(**d) for d in authors_list] return {author.name: author for author in authors}
Load a list of authors from the given file
advent/data.py
load_authors
camphor-/advent
0
python
def load_authors(authors_file: Path) -> Dict[(str, Author)]: with open(authors_file) as f: authors_list = yaml.load(f, Loader=yaml.SafeLoader) authors = [Author(**d) for d in authors_list] return {author.name: author for author in authors}
def load_authors(authors_file: Path) -> Dict[(str, Author)]: with open(authors_file) as f: authors_list = yaml.load(f, Loader=yaml.SafeLoader) authors = [Author(**d) for d in authors_list] return {author.name: author for author in authors}<|docstring|>Load a list of authors from the given file<|endoftext|>
ae289fc92fde5e0911df2c27f08f34b024b75322a05be226bb0f9cc3af4c1da8
def load_entries(entries_file: Path, authors: Mapping[(str, Author)]) -> List[Entry]: 'Load a list of entries from the given file\n\n This method replaces url of entries which are not published yet with None.\n ' today = datetime.now(tz=TIMEZONE).date() def load_entry(d: Dict[(str, Any)]) -> Entry: entry = Entry(**d) if (entry.author is not None): entry.author_url = authors[entry.author].url if (entry.date > today): entry.url = None return entry with open(entries_file) as f: return list(map(load_entry, yaml.load(f, Loader=yaml.SafeLoader)))
Load a list of entries from the given file This method replaces url of entries which are not published yet with None.
advent/data.py
load_entries
camphor-/advent
0
python
def load_entries(entries_file: Path, authors: Mapping[(str, Author)]) -> List[Entry]: 'Load a list of entries from the given file\n\n This method replaces url of entries which are not published yet with None.\n ' today = datetime.now(tz=TIMEZONE).date() def load_entry(d: Dict[(str, Any)]) -> Entry: entry = Entry(**d) if (entry.author is not None): entry.author_url = authors[entry.author].url if (entry.date > today): entry.url = None return entry with open(entries_file) as f: return list(map(load_entry, yaml.load(f, Loader=yaml.SafeLoader)))
def load_entries(entries_file: Path, authors: Mapping[(str, Author)]) -> List[Entry]: 'Load a list of entries from the given file\n\n This method replaces url of entries which are not published yet with None.\n ' today = datetime.now(tz=TIMEZONE).date() def load_entry(d: Dict[(str, Any)]) -> Entry: entry = Entry(**d) if (entry.author is not None): entry.author_url = authors[entry.author].url if (entry.date > today): entry.url = None return entry with open(entries_file) as f: return list(map(load_entry, yaml.load(f, Loader=yaml.SafeLoader)))<|docstring|>Load a list of entries from the given file This method replaces url of entries which are not published yet with None.<|endoftext|>
74e119de8f0b89048900682f5cdc24e9da834f5e9da57232daa3f4c83270ed69
def group_entries_by_year(entries: Iterable[Entry]) -> Dict[(int, List[Entry])]: 'Groups entries by year in descending order' entries_by_year = {} years = list({e.date.year for e in entries}) for year in sorted(years, reverse=True): entries_by_year[year] = [e for e in entries if (e.date.year == year)] return entries_by_year
Groups entries by year in descending order
advent/data.py
group_entries_by_year
camphor-/advent
0
python
def group_entries_by_year(entries: Iterable[Entry]) -> Dict[(int, List[Entry])]: entries_by_year = {} years = list({e.date.year for e in entries}) for year in sorted(years, reverse=True): entries_by_year[year] = [e for e in entries if (e.date.year == year)] return entries_by_year
def group_entries_by_year(entries: Iterable[Entry]) -> Dict[(int, List[Entry])]: entries_by_year = {} years = list({e.date.year for e in entries}) for year in sorted(years, reverse=True): entries_by_year[year] = [e for e in entries if (e.date.year == year)] return entries_by_year<|docstring|>Groups entries by year in descending order<|endoftext|>
7401480d96774f1d78016e13a9613d57cca01bee0a4b0ca2d2783e321282ab12
def get_last_published_entries(entries: Iterable[Entry], n: int) -> List[Entry]: 'Get last N published entries in descending order' return sorted(filter((lambda e: e.url), entries), reverse=True, key=attrgetter('date'))[:n]
Get last N published entries in descending order
advent/data.py
get_last_published_entries
camphor-/advent
0
python
def get_last_published_entries(entries: Iterable[Entry], n: int) -> List[Entry]: return sorted(filter((lambda e: e.url), entries), reverse=True, key=attrgetter('date'))[:n]
def get_last_published_entries(entries: Iterable[Entry], n: int) -> List[Entry]: return sorted(filter((lambda e: e.url), entries), reverse=True, key=attrgetter('date'))[:n]<|docstring|>Get last N published entries in descending order<|endoftext|>
7aaae41eadabfc88689bb2356f401458b76004ff374c93cb8172b5690894fd30
def get_entry_for_day(entries: Iterable[Entry], day: date) -> Optional[Entry]: 'Find an entry on the given day if it exists' for entry in entries: if (entry.date == day): return entry return None
Find an entry on the given day if it exists
advent/data.py
get_entry_for_day
camphor-/advent
0
python
def get_entry_for_day(entries: Iterable[Entry], day: date) -> Optional[Entry]: for entry in entries: if (entry.date == day): return entry return None
def get_entry_for_day(entries: Iterable[Entry], day: date) -> Optional[Entry]: for entry in entries: if (entry.date == day): return entry return None<|docstring|>Find an entry on the given day if it exists<|endoftext|>
b3e5206923422703144aba29c462126bad254f28be103b6d55b8d7992d9a640f
def get_sha1(filepath): '\n calculate the sha1 hash of the content of a given file\n\n Parameters\n ----------\n filepath : path\n the file of which to calculate the hash.\n\n Returns\n -------\n hash: str\n the hash of the content of the file.\n\n ' sha1sum = hashlib.sha1() with open(filepath, 'rb') as source: block = source.read((2 ** 16)) while (len(block) != 0): sha1sum.update(block) block = source.read((2 ** 16)) return sha1sum.hexdigest()
calculate the sha1 hash of the content of a given file Parameters ---------- filepath : path the file of which to calculate the hash. Returns ------- hash: str the hash of the content of the file.
MedicalImageAnonymizer/GUI/_ssh_utils.py
get_sha1
fiendish/MedicalImageAnonymizer
2
python
def get_sha1(filepath): '\n calculate the sha1 hash of the content of a given file\n\n Parameters\n ----------\n filepath : path\n the file of which to calculate the hash.\n\n Returns\n -------\n hash: str\n the hash of the content of the file.\n\n ' sha1sum = hashlib.sha1() with open(filepath, 'rb') as source: block = source.read((2 ** 16)) while (len(block) != 0): sha1sum.update(block) block = source.read((2 ** 16)) return sha1sum.hexdigest()
def get_sha1(filepath): '\n calculate the sha1 hash of the content of a given file\n\n Parameters\n ----------\n filepath : path\n the file of which to calculate the hash.\n\n Returns\n -------\n hash: str\n the hash of the content of the file.\n\n ' sha1sum = hashlib.sha1() with open(filepath, 'rb') as source: block = source.read((2 ** 16)) while (len(block) != 0): sha1sum.update(block) block = source.read((2 ** 16)) return sha1sum.hexdigest()<|docstring|>calculate the sha1 hash of the content of a given file Parameters ---------- filepath : path the file of which to calculate the hash. Returns ------- hash: str the hash of the content of the file.<|endoftext|>
f1ae289cd390693512bcc503a312a3bb349cc7001d97704500e9513fbffb9bf5
@contextmanager def get_destination_local(params, remote_config): '\n generate a context manager with the remote connection to the server\n\n Parameters\n ----------\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Yields\n ------\n rem : RemoteConnection\n the actul connection to the remote server.\n\n todo : path\n the (remote) directory where to write the files in the pushin.\n\n done : path\n the (remote) directory where to search for the completed results.\n\n ' with ParamikoMachine(missing_host_policy=paramiko.AutoAddPolicy(), **params) as rem: with rem.cwd(remote_config['base_dir']): todo = (rem.cwd / remote_config['todo_subdir']) done = (rem.cwd / remote_config['done_subdir']) (yield (rem, todo, done))
generate a context manager with the remote connection to the server Parameters ---------- params : dict parameters of the connection host remote_config : dict parameters of the remote server Yields ------ rem : RemoteConnection the actul connection to the remote server. todo : path the (remote) directory where to write the files in the pushin. done : path the (remote) directory where to search for the completed results.
MedicalImageAnonymizer/GUI/_ssh_utils.py
get_destination_local
fiendish/MedicalImageAnonymizer
2
python
@contextmanager def get_destination_local(params, remote_config): '\n generate a context manager with the remote connection to the server\n\n Parameters\n ----------\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Yields\n ------\n rem : RemoteConnection\n the actul connection to the remote server.\n\n todo : path\n the (remote) directory where to write the files in the pushin.\n\n done : path\n the (remote) directory where to search for the completed results.\n\n ' with ParamikoMachine(missing_host_policy=paramiko.AutoAddPolicy(), **params) as rem: with rem.cwd(remote_config['base_dir']): todo = (rem.cwd / remote_config['todo_subdir']) done = (rem.cwd / remote_config['done_subdir']) (yield (rem, todo, done))
@contextmanager def get_destination_local(params, remote_config): '\n generate a context manager with the remote connection to the server\n\n Parameters\n ----------\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Yields\n ------\n rem : RemoteConnection\n the actul connection to the remote server.\n\n todo : path\n the (remote) directory where to write the files in the pushin.\n\n done : path\n the (remote) directory where to search for the completed results.\n\n ' with ParamikoMachine(missing_host_policy=paramiko.AutoAddPolicy(), **params) as rem: with rem.cwd(remote_config['base_dir']): todo = (rem.cwd / remote_config['todo_subdir']) done = (rem.cwd / remote_config['done_subdir']) (yield (rem, todo, done))<|docstring|>generate a context manager with the remote connection to the server Parameters ---------- params : dict parameters of the connection host remote_config : dict parameters of the remote server Yields ------ rem : RemoteConnection the actul connection to the remote server. todo : path the (remote) directory where to write the files in the pushin. done : path the (remote) directory where to search for the completed results.<|endoftext|>
45661fe82ece77233dc533af38d8f1ebaa4d37d050b0a0d23a7217eee2397281
def query_single_file(filename, params, remote): '\n given a filepath, check all the files on the remote server whose\n names contains the hash of the original one.\n\n Parameters\n ----------\n filepath : path\n filepath (with full locatable path) to search for in the server\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n origin_hash : str\n the hash of the original file (calculated on the content)\n\n exists : list of paths\n all the files on the server whose name contains the hash of the\n original file. The list is empty if no files are found\n\n ' with get_destination_local(params, remote) as (rem, todo, done): origin = filename origin_hash = get_sha1(origin) source = (done / origin_hash) find_hash = (lambda p: (origin_hash in str(p))) paths = list(done.walk(filter=find_hash)) return (origin_hash, paths)
given a filepath, check all the files on the remote server whose names contains the hash of the original one. Parameters ---------- filepath : path filepath (with full locatable path) to search for in the server params : dict parameters of the connection host remote_config : dict parameters of the remote server Returns ------- origin_hash : str the hash of the original file (calculated on the content) exists : list of paths all the files on the server whose name contains the hash of the original file. The list is empty if no files are found
MedicalImageAnonymizer/GUI/_ssh_utils.py
query_single_file
fiendish/MedicalImageAnonymizer
2
python
def query_single_file(filename, params, remote): '\n given a filepath, check all the files on the remote server whose\n names contains the hash of the original one.\n\n Parameters\n ----------\n filepath : path\n filepath (with full locatable path) to search for in the server\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n origin_hash : str\n the hash of the original file (calculated on the content)\n\n exists : list of paths\n all the files on the server whose name contains the hash of the\n original file. The list is empty if no files are found\n\n ' with get_destination_local(params, remote) as (rem, todo, done): origin = filename origin_hash = get_sha1(origin) source = (done / origin_hash) find_hash = (lambda p: (origin_hash in str(p))) paths = list(done.walk(filter=find_hash)) return (origin_hash, paths)
def query_single_file(filename, params, remote): '\n given a filepath, check all the files on the remote server whose\n names contains the hash of the original one.\n\n Parameters\n ----------\n filepath : path\n filepath (with full locatable path) to search for in the server\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n origin_hash : str\n the hash of the original file (calculated on the content)\n\n exists : list of paths\n all the files on the server whose name contains the hash of the\n original file. The list is empty if no files are found\n\n ' with get_destination_local(params, remote) as (rem, todo, done): origin = filename origin_hash = get_sha1(origin) source = (done / origin_hash) find_hash = (lambda p: (origin_hash in str(p))) paths = list(done.walk(filter=find_hash)) return (origin_hash, paths)<|docstring|>given a filepath, check all the files on the remote server whose names contains the hash of the original one. Parameters ---------- filepath : path filepath (with full locatable path) to search for in the server params : dict parameters of the connection host remote_config : dict parameters of the remote server Returns ------- origin_hash : str the hash of the original file (calculated on the content) exists : list of paths all the files on the server whose name contains the hash of the original file. The list is empty if no files are found<|endoftext|>
d838d0d76fe6cd2d674a1bbcc79de37f3372edcc471f2143648d328f179b75a4
def push_single_file(filepath, params, remote_config): '\n upload a file to the server while changing its name\n\n Parameters\n ----------\n filepath : path\n the file to upload to the server.\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Raises\n ------\n FileExistsError\n if the file that would be generated already exists.\n\n Returns\n -------\n destination : path\n the location in which it has been copied on the server.\n\n ' with get_destination_local(params, remote_config) as (rem, todo, done): origin = filepath origin_hash = get_sha1(origin) destination = (todo / origin_hash) destination = destination.with_suffix(os.path.splitext(str(origin))[(- 1)]) destination = Path(destination) if (not destination.exists()): rem.upload(origin, destination) else: s = '{} has already been pushed'.format(filepath) raise FileExistsError(s) if False: origin.chmod(read_only) return destination
upload a file to the server while changing its name Parameters ---------- filepath : path the file to upload to the server. params : dict parameters of the connection host remote_config : dict parameters of the remote server Raises ------ FileExistsError if the file that would be generated already exists. Returns ------- destination : path the location in which it has been copied on the server.
MedicalImageAnonymizer/GUI/_ssh_utils.py
push_single_file
fiendish/MedicalImageAnonymizer
2
python
def push_single_file(filepath, params, remote_config): '\n upload a file to the server while changing its name\n\n Parameters\n ----------\n filepath : path\n the file to upload to the server.\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Raises\n ------\n FileExistsError\n if the file that would be generated already exists.\n\n Returns\n -------\n destination : path\n the location in which it has been copied on the server.\n\n ' with get_destination_local(params, remote_config) as (rem, todo, done): origin = filepath origin_hash = get_sha1(origin) destination = (todo / origin_hash) destination = destination.with_suffix(os.path.splitext(str(origin))[(- 1)]) destination = Path(destination) if (not destination.exists()): rem.upload(origin, destination) else: s = '{} has already been pushed'.format(filepath) raise FileExistsError(s) if False: origin.chmod(read_only) return destination
def push_single_file(filepath, params, remote_config): '\n upload a file to the server while changing its name\n\n Parameters\n ----------\n filepath : path\n the file to upload to the server.\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Raises\n ------\n FileExistsError\n if the file that would be generated already exists.\n\n Returns\n -------\n destination : path\n the location in which it has been copied on the server.\n\n ' with get_destination_local(params, remote_config) as (rem, todo, done): origin = filepath origin_hash = get_sha1(origin) destination = (todo / origin_hash) destination = destination.with_suffix(os.path.splitext(str(origin))[(- 1)]) destination = Path(destination) if (not destination.exists()): rem.upload(origin, destination) else: s = '{} has already been pushed'.format(filepath) raise FileExistsError(s) if False: origin.chmod(read_only) return destination<|docstring|>upload a file to the server while changing its name Parameters ---------- filepath : path the file to upload to the server. params : dict parameters of the connection host remote_config : dict parameters of the remote server Raises ------ FileExistsError if the file that would be generated already exists. Returns ------- destination : path the location in which it has been copied on the server.<|endoftext|>
a1c32a80442592d2c3ac7c3557a26f80c500880559810b31c262e63213cdca62
def pull_single_file(filepath, destination_dir, params, remote_config): '\n\n Parameters\n ----------\n filepath : plumbum path object\n origin file to pull from the server\n\n destination_dir : plumbum path object\n the directory in which to copy the files\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n pulled_file: List[path]\n the list of filepaths downloaded from the server\n (after name-swapping the hash)\n\n ' pulled_file = [] with get_destination_local(params, remote_config) as (rem, todo, done): (origin_hash, paths) = query_single_file(filepath, params, remote_config) for path in paths: path.remote = rem dest_name = path.name.replace(origin_hash, filepath.stem) destination = (destination_dir / dest_name) rem.download(path, destination) pulled_file.append(destination) return pulled_file
Parameters ---------- filepath : plumbum path object origin file to pull from the server destination_dir : plumbum path object the directory in which to copy the files params : dict parameters of the connection host remote_config : dict parameters of the remote server Returns ------- pulled_file: List[path] the list of filepaths downloaded from the server (after name-swapping the hash)
MedicalImageAnonymizer/GUI/_ssh_utils.py
pull_single_file
fiendish/MedicalImageAnonymizer
2
python
def pull_single_file(filepath, destination_dir, params, remote_config): '\n\n Parameters\n ----------\n filepath : plumbum path object\n origin file to pull from the server\n\n destination_dir : plumbum path object\n the directory in which to copy the files\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n pulled_file: List[path]\n the list of filepaths downloaded from the server\n (after name-swapping the hash)\n\n ' pulled_file = [] with get_destination_local(params, remote_config) as (rem, todo, done): (origin_hash, paths) = query_single_file(filepath, params, remote_config) for path in paths: path.remote = rem dest_name = path.name.replace(origin_hash, filepath.stem) destination = (destination_dir / dest_name) rem.download(path, destination) pulled_file.append(destination) return pulled_file
def pull_single_file(filepath, destination_dir, params, remote_config): '\n\n Parameters\n ----------\n filepath : plumbum path object\n origin file to pull from the server\n\n destination_dir : plumbum path object\n the directory in which to copy the files\n\n params : dict\n parameters of the connection host\n\n remote_config : dict\n parameters of the remote server\n\n Returns\n -------\n pulled_file: List[path]\n the list of filepaths downloaded from the server\n (after name-swapping the hash)\n\n ' pulled_file = [] with get_destination_local(params, remote_config) as (rem, todo, done): (origin_hash, paths) = query_single_file(filepath, params, remote_config) for path in paths: path.remote = rem dest_name = path.name.replace(origin_hash, filepath.stem) destination = (destination_dir / dest_name) rem.download(path, destination) pulled_file.append(destination) return pulled_file<|docstring|>Parameters ---------- filepath : plumbum path object origin file to pull from the server destination_dir : plumbum path object the directory in which to copy the files params : dict parameters of the connection host remote_config : dict parameters of the remote server Returns ------- pulled_file: List[path] the list of filepaths downloaded from the server (after name-swapping the hash)<|endoftext|>
3bbd32bf97bdffd9eb6aae1504d44d9825a34c0d792f6456bd669af1650b3c10
def test_filerep_sync_ct(self): '\n @data_provider sync_ct_tests\n ' fault_name = self.test_data[1][0] fault_type = self.test_data[1][1] fault_role = self.test_data[1][2] filerep_state = self.test_data[1][3] filerep_role = self.test_data[1][4] tinctest.logger.info('\n ===============================================') tinctest.logger.info(('\n Starting New Test: %s ' % self.test_data[0][1])) tinctest.logger.info('\n ===============================================') self.filerep_sync_ct(fault_name, fault_type, fault_role, filerep_state, filerep_role)
@data_provider sync_ct_tests
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/fts/fts_transitions/test_fts_transitions_01.py
test_filerep_sync_ct
lintzc/GPDB
1
python
def test_filerep_sync_ct(self): '\n \n ' fault_name = self.test_data[1][0] fault_type = self.test_data[1][1] fault_role = self.test_data[1][2] filerep_state = self.test_data[1][3] filerep_role = self.test_data[1][4] tinctest.logger.info('\n ===============================================') tinctest.logger.info(('\n Starting New Test: %s ' % self.test_data[0][1])) tinctest.logger.info('\n ===============================================') self.filerep_sync_ct(fault_name, fault_type, fault_role, filerep_state, filerep_role)
def test_filerep_sync_ct(self): '\n \n ' fault_name = self.test_data[1][0] fault_type = self.test_data[1][1] fault_role = self.test_data[1][2] filerep_state = self.test_data[1][3] filerep_role = self.test_data[1][4] tinctest.logger.info('\n ===============================================') tinctest.logger.info(('\n Starting New Test: %s ' % self.test_data[0][1])) tinctest.logger.info('\n ===============================================') self.filerep_sync_ct(fault_name, fault_type, fault_role, filerep_state, filerep_role)<|docstring|>@data_provider sync_ct_tests<|endoftext|>
4577121bc86ebe38c7750585a9210e12d7e20478b567d25127a6bad38eac047b
def __init__(self, completed_at=None, condition_note=None, container_image=None, cpu=None, created_at=None, created_by=None, data_set=None, display_id=None, entry_point=None, execution_time=None, favorite=None, full_name=None, git_model=None, gpu=None, id=None, key=None, local_data_set=None, log_summary=None, memo=None, memory=None, modified_at=None, modified_by=None, name=None, node=None, node_ports=None, options=None, parent_full_name_list=None, parents=None, partition=None, ports=None, started_at=None, status=None, status_type=None, tags=None, waiting_time=None, zip=None): 'TrainingApiModelsDetailsOutputModel - a model defined in Swagger' self._completed_at = None self._condition_note = None self._container_image = None self._cpu = None self._created_at = None self._created_by = None self._data_set = None self._display_id = None self._entry_point = None self._execution_time = None self._favorite = None self._full_name = None self._git_model = None self._gpu = None self._id = None self._key = None self._local_data_set = None self._log_summary = None self._memo = None self._memory = None self._modified_at = None self._modified_by = None self._name = None self._node = None self._node_ports = None self._options = None self._parent_full_name_list = None self._parents = None self._partition = None self._ports = None self._started_at = None self._status = None self._status_type = None self._tags = None self._waiting_time = None self._zip = None self.discriminator = None if (completed_at is not None): self.completed_at = completed_at if (condition_note is not None): self.condition_note = condition_note if (container_image is not None): self.container_image = container_image if (cpu is not None): self.cpu = cpu if (created_at is not None): self.created_at = created_at if (created_by is not None): self.created_by = created_by if (data_set is not None): self.data_set = data_set if (display_id is not None): self.display_id = display_id if (entry_point is not None): self.entry_point = entry_point if (execution_time is not None): self.execution_time = execution_time if (favorite is not None): self.favorite = favorite if (full_name is not None): self.full_name = full_name if (git_model is not None): self.git_model = git_model if (gpu is not None): self.gpu = gpu if (id is not None): self.id = id if (key is not None): self.key = key if (local_data_set is not None): self.local_data_set = local_data_set if (log_summary is not None): self.log_summary = log_summary if (memo is not None): self.memo = memo if (memory is not None): self.memory = memory if (modified_at is not None): self.modified_at = modified_at if (modified_by is not None): self.modified_by = modified_by if (name is not None): self.name = name if (node is not None): self.node = node if (node_ports is not None): self.node_ports = node_ports if (options is not None): self.options = options if (parent_full_name_list is not None): self.parent_full_name_list = parent_full_name_list if (parents is not None): self.parents = parents if (partition is not None): self.partition = partition if (ports is not None): self.ports = ports if (started_at is not None): self.started_at = started_at if (status is not None): self.status = status if (status_type is not None): self.status_type = status_type if (tags is not None): self.tags = tags if (waiting_time is not None): self.waiting_time = waiting_time if (zip is not None): self.zip = zip
TrainingApiModelsDetailsOutputModel - a model defined in Swagger
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
__init__
yonetatuu/kamonohashi
100
python
def __init__(self, completed_at=None, condition_note=None, container_image=None, cpu=None, created_at=None, created_by=None, data_set=None, display_id=None, entry_point=None, execution_time=None, favorite=None, full_name=None, git_model=None, gpu=None, id=None, key=None, local_data_set=None, log_summary=None, memo=None, memory=None, modified_at=None, modified_by=None, name=None, node=None, node_ports=None, options=None, parent_full_name_list=None, parents=None, partition=None, ports=None, started_at=None, status=None, status_type=None, tags=None, waiting_time=None, zip=None): self._completed_at = None self._condition_note = None self._container_image = None self._cpu = None self._created_at = None self._created_by = None self._data_set = None self._display_id = None self._entry_point = None self._execution_time = None self._favorite = None self._full_name = None self._git_model = None self._gpu = None self._id = None self._key = None self._local_data_set = None self._log_summary = None self._memo = None self._memory = None self._modified_at = None self._modified_by = None self._name = None self._node = None self._node_ports = None self._options = None self._parent_full_name_list = None self._parents = None self._partition = None self._ports = None self._started_at = None self._status = None self._status_type = None self._tags = None self._waiting_time = None self._zip = None self.discriminator = None if (completed_at is not None): self.completed_at = completed_at if (condition_note is not None): self.condition_note = condition_note if (container_image is not None): self.container_image = container_image if (cpu is not None): self.cpu = cpu if (created_at is not None): self.created_at = created_at if (created_by is not None): self.created_by = created_by if (data_set is not None): self.data_set = data_set if (display_id is not None): self.display_id = display_id if (entry_point is not None): self.entry_point = entry_point if (execution_time is not None): self.execution_time = execution_time if (favorite is not None): self.favorite = favorite if (full_name is not None): self.full_name = full_name if (git_model is not None): self.git_model = git_model if (gpu is not None): self.gpu = gpu if (id is not None): self.id = id if (key is not None): self.key = key if (local_data_set is not None): self.local_data_set = local_data_set if (log_summary is not None): self.log_summary = log_summary if (memo is not None): self.memo = memo if (memory is not None): self.memory = memory if (modified_at is not None): self.modified_at = modified_at if (modified_by is not None): self.modified_by = modified_by if (name is not None): self.name = name if (node is not None): self.node = node if (node_ports is not None): self.node_ports = node_ports if (options is not None): self.options = options if (parent_full_name_list is not None): self.parent_full_name_list = parent_full_name_list if (parents is not None): self.parents = parents if (partition is not None): self.partition = partition if (ports is not None): self.ports = ports if (started_at is not None): self.started_at = started_at if (status is not None): self.status = status if (status_type is not None): self.status_type = status_type if (tags is not None): self.tags = tags if (waiting_time is not None): self.waiting_time = waiting_time if (zip is not None): self.zip = zip
def __init__(self, completed_at=None, condition_note=None, container_image=None, cpu=None, created_at=None, created_by=None, data_set=None, display_id=None, entry_point=None, execution_time=None, favorite=None, full_name=None, git_model=None, gpu=None, id=None, key=None, local_data_set=None, log_summary=None, memo=None, memory=None, modified_at=None, modified_by=None, name=None, node=None, node_ports=None, options=None, parent_full_name_list=None, parents=None, partition=None, ports=None, started_at=None, status=None, status_type=None, tags=None, waiting_time=None, zip=None): self._completed_at = None self._condition_note = None self._container_image = None self._cpu = None self._created_at = None self._created_by = None self._data_set = None self._display_id = None self._entry_point = None self._execution_time = None self._favorite = None self._full_name = None self._git_model = None self._gpu = None self._id = None self._key = None self._local_data_set = None self._log_summary = None self._memo = None self._memory = None self._modified_at = None self._modified_by = None self._name = None self._node = None self._node_ports = None self._options = None self._parent_full_name_list = None self._parents = None self._partition = None self._ports = None self._started_at = None self._status = None self._status_type = None self._tags = None self._waiting_time = None self._zip = None self.discriminator = None if (completed_at is not None): self.completed_at = completed_at if (condition_note is not None): self.condition_note = condition_note if (container_image is not None): self.container_image = container_image if (cpu is not None): self.cpu = cpu if (created_at is not None): self.created_at = created_at if (created_by is not None): self.created_by = created_by if (data_set is not None): self.data_set = data_set if (display_id is not None): self.display_id = display_id if (entry_point is not None): self.entry_point = entry_point if (execution_time is not None): self.execution_time = execution_time if (favorite is not None): self.favorite = favorite if (full_name is not None): self.full_name = full_name if (git_model is not None): self.git_model = git_model if (gpu is not None): self.gpu = gpu if (id is not None): self.id = id if (key is not None): self.key = key if (local_data_set is not None): self.local_data_set = local_data_set if (log_summary is not None): self.log_summary = log_summary if (memo is not None): self.memo = memo if (memory is not None): self.memory = memory if (modified_at is not None): self.modified_at = modified_at if (modified_by is not None): self.modified_by = modified_by if (name is not None): self.name = name if (node is not None): self.node = node if (node_ports is not None): self.node_ports = node_ports if (options is not None): self.options = options if (parent_full_name_list is not None): self.parent_full_name_list = parent_full_name_list if (parents is not None): self.parents = parents if (partition is not None): self.partition = partition if (ports is not None): self.ports = ports if (started_at is not None): self.started_at = started_at if (status is not None): self.status = status if (status_type is not None): self.status_type = status_type if (tags is not None): self.tags = tags if (waiting_time is not None): self.waiting_time = waiting_time if (zip is not None): self.zip = zip<|docstring|>TrainingApiModelsDetailsOutputModel - a model defined in Swagger<|endoftext|>
ba4d92cbe98a7cc91361fd7c74e369542b47dd951bd173a0a00dc519b13943a3
@property def completed_at(self): 'Gets the completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._completed_at
Gets the completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
completed_at
yonetatuu/kamonohashi
100
python
@property def completed_at(self): 'Gets the completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._completed_at
@property def completed_at(self): 'Gets the completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._completed_at<|docstring|>Gets the completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
5a8d10c1059ed05d7b7ebfa5551b1db695704c0ebd83deef2964d8163acb34aa
@completed_at.setter def completed_at(self, completed_at): 'Sets the completed_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param completed_at: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._completed_at = completed_at
Sets the completed_at of this TrainingApiModelsDetailsOutputModel. :param completed_at: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
completed_at
yonetatuu/kamonohashi
100
python
@completed_at.setter def completed_at(self, completed_at): 'Sets the completed_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param completed_at: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._completed_at = completed_at
@completed_at.setter def completed_at(self, completed_at): 'Sets the completed_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param completed_at: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._completed_at = completed_at<|docstring|>Sets the completed_at of this TrainingApiModelsDetailsOutputModel. :param completed_at: The completed_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
227f61ffc625e5dd131299d9112c1854646a1455d0aeefdf5ed79d02c4cea0e9
@property def condition_note(self): 'Gets the condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._condition_note
Gets the condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
condition_note
yonetatuu/kamonohashi
100
python
@property def condition_note(self): 'Gets the condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._condition_note
@property def condition_note(self): 'Gets the condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._condition_note<|docstring|>Gets the condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
0c5a96b10d33220864298726cceb54577326397fcc74cd49a91d1b2294f9883d
@condition_note.setter def condition_note(self, condition_note): 'Sets the condition_note of this TrainingApiModelsDetailsOutputModel.\n\n\n :param condition_note: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._condition_note = condition_note
Sets the condition_note of this TrainingApiModelsDetailsOutputModel. :param condition_note: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
condition_note
yonetatuu/kamonohashi
100
python
@condition_note.setter def condition_note(self, condition_note): 'Sets the condition_note of this TrainingApiModelsDetailsOutputModel.\n\n\n :param condition_note: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._condition_note = condition_note
@condition_note.setter def condition_note(self, condition_note): 'Sets the condition_note of this TrainingApiModelsDetailsOutputModel.\n\n\n :param condition_note: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._condition_note = condition_note<|docstring|>Sets the condition_note of this TrainingApiModelsDetailsOutputModel. :param condition_note: The condition_note of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
d27c2e01ac19a54cb23c3e38ff0c3b35fed87721b8e4733d4408354ee27725a4
@property def container_image(self): 'Gets the container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsContainerImageOutputModel\n ' return self._container_image
Gets the container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: ComponentsContainerImageOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
container_image
yonetatuu/kamonohashi
100
python
@property def container_image(self): 'Gets the container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsContainerImageOutputModel\n ' return self._container_image
@property def container_image(self): 'Gets the container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsContainerImageOutputModel\n ' return self._container_image<|docstring|>Gets the container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: ComponentsContainerImageOutputModel<|endoftext|>
656685ce3deace501bfaf5159497a6ed14d07305bcdb6b7d6cf485c62e56d9d1
@container_image.setter def container_image(self, container_image): 'Sets the container_image of this TrainingApiModelsDetailsOutputModel.\n\n\n :param container_image: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsContainerImageOutputModel\n ' self._container_image = container_image
Sets the container_image of this TrainingApiModelsDetailsOutputModel. :param container_image: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: ComponentsContainerImageOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
container_image
yonetatuu/kamonohashi
100
python
@container_image.setter def container_image(self, container_image): 'Sets the container_image of this TrainingApiModelsDetailsOutputModel.\n\n\n :param container_image: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsContainerImageOutputModel\n ' self._container_image = container_image
@container_image.setter def container_image(self, container_image): 'Sets the container_image of this TrainingApiModelsDetailsOutputModel.\n\n\n :param container_image: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsContainerImageOutputModel\n ' self._container_image = container_image<|docstring|>Sets the container_image of this TrainingApiModelsDetailsOutputModel. :param container_image: The container_image of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: ComponentsContainerImageOutputModel<|endoftext|>
1e353a494a9b596855613b8267b85df2e92216ad5b067e4e3574bb578e19ef3d
@property def cpu(self): 'Gets the cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._cpu
Gets the cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: int
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
cpu
yonetatuu/kamonohashi
100
python
@property def cpu(self): 'Gets the cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._cpu
@property def cpu(self): 'Gets the cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._cpu<|docstring|>Gets the cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: int<|endoftext|>
26ecfcc59373707b30ae9c0ff324499df1127ed8afe929498c508bf582e305a3
@cpu.setter def cpu(self, cpu): 'Sets the cpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param cpu: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._cpu = cpu
Sets the cpu of this TrainingApiModelsDetailsOutputModel. :param cpu: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: int
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
cpu
yonetatuu/kamonohashi
100
python
@cpu.setter def cpu(self, cpu): 'Sets the cpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param cpu: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._cpu = cpu
@cpu.setter def cpu(self, cpu): 'Sets the cpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param cpu: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._cpu = cpu<|docstring|>Sets the cpu of this TrainingApiModelsDetailsOutputModel. :param cpu: The cpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: int<|endoftext|>
1fdec5797eafda43d25d3c64c2bb838169c432b6c023c9a3f229040b1117d87e
@property def created_at(self): 'Gets the created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_at
Gets the created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
created_at
yonetatuu/kamonohashi
100
python
@property def created_at(self): 'Gets the created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_at
@property def created_at(self): 'Gets the created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_at<|docstring|>Gets the created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
fe2692788282d4358118b5ce9367ad89e248e248fa9ea1367c159299000b31d3
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_at: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_at = created_at
Sets the created_at of this TrainingApiModelsDetailsOutputModel. :param created_at: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
created_at
yonetatuu/kamonohashi
100
python
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_at: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_at = created_at
@created_at.setter def created_at(self, created_at): 'Sets the created_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_at: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_at = created_at<|docstring|>Sets the created_at of this TrainingApiModelsDetailsOutputModel. :param created_at: The created_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
372b9668a0d45199883fa4246d814069edfd0c00b52d1cd022db57ffd2bd7d82
@property def created_by(self): 'Gets the created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_by
Gets the created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
created_by
yonetatuu/kamonohashi
100
python
@property def created_by(self): 'Gets the created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_by
@property def created_by(self): 'Gets the created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._created_by<|docstring|>Gets the created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
46582b0577da1c2404de2e4aede8f8fa6b4156cd6c6e1ca4322f1f40eedfdb2f
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_by: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_by = created_by
Sets the created_by of this TrainingApiModelsDetailsOutputModel. :param created_by: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
created_by
yonetatuu/kamonohashi
100
python
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_by: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_by = created_by
@created_by.setter def created_by(self, created_by): 'Sets the created_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param created_by: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._created_by = created_by<|docstring|>Sets the created_by of this TrainingApiModelsDetailsOutputModel. :param created_by: The created_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
5355736d623c0d0199b4917efc22c38a32faa4785eab50e3459cfa869d1f6dde
@property def data_set(self): 'Gets the data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: DataSetApiModelsIndexOutputModel\n ' return self._data_set
Gets the data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: DataSetApiModelsIndexOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
data_set
yonetatuu/kamonohashi
100
python
@property def data_set(self): 'Gets the data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: DataSetApiModelsIndexOutputModel\n ' return self._data_set
@property def data_set(self): 'Gets the data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: DataSetApiModelsIndexOutputModel\n ' return self._data_set<|docstring|>Gets the data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: DataSetApiModelsIndexOutputModel<|endoftext|>
10d3baaec7d47087a724f733c98ba8740fb0ce9a4aa7fda57b50eeb50b3238fd
@data_set.setter def data_set(self, data_set): 'Sets the data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param data_set: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: DataSetApiModelsIndexOutputModel\n ' self._data_set = data_set
Sets the data_set of this TrainingApiModelsDetailsOutputModel. :param data_set: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: DataSetApiModelsIndexOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
data_set
yonetatuu/kamonohashi
100
python
@data_set.setter def data_set(self, data_set): 'Sets the data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param data_set: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: DataSetApiModelsIndexOutputModel\n ' self._data_set = data_set
@data_set.setter def data_set(self, data_set): 'Sets the data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param data_set: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: DataSetApiModelsIndexOutputModel\n ' self._data_set = data_set<|docstring|>Sets the data_set of this TrainingApiModelsDetailsOutputModel. :param data_set: The data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: DataSetApiModelsIndexOutputModel<|endoftext|>
cecf045bd95ff82d187a36ddde19ebff7b559c49c841dd5892e667c66fb43ff6
@property def display_id(self): 'Gets the display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._display_id
Gets the display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: int
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
display_id
yonetatuu/kamonohashi
100
python
@property def display_id(self): 'Gets the display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._display_id
@property def display_id(self): 'Gets the display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n ' return self._display_id<|docstring|>Gets the display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: int<|endoftext|>
3707759b66d2b0af324a184aabe894934e64333508cac2fa3a5ee14db678e75a
@display_id.setter def display_id(self, display_id): 'Sets the display_id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param display_id: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._display_id = display_id
Sets the display_id of this TrainingApiModelsDetailsOutputModel. :param display_id: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: int
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
display_id
yonetatuu/kamonohashi
100
python
@display_id.setter def display_id(self, display_id): 'Sets the display_id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param display_id: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._display_id = display_id
@display_id.setter def display_id(self, display_id): 'Sets the display_id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param display_id: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n ' self._display_id = display_id<|docstring|>Sets the display_id of this TrainingApiModelsDetailsOutputModel. :param display_id: The display_id of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: int<|endoftext|>
3ecf3c117b0e46509731ee6efc3c2e73e7743e34d979dfc948a80fe65bde41a8
@property def entry_point(self): 'Gets the entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._entry_point
Gets the entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
entry_point
yonetatuu/kamonohashi
100
python
@property def entry_point(self): 'Gets the entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._entry_point
@property def entry_point(self): 'Gets the entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._entry_point<|docstring|>Gets the entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
6d0e3f2da4d2344653f89f203a53e0073a3be08c2f79fbf90aff799755b0a3cb
@entry_point.setter def entry_point(self, entry_point): 'Sets the entry_point of this TrainingApiModelsDetailsOutputModel.\n\n\n :param entry_point: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._entry_point = entry_point
Sets the entry_point of this TrainingApiModelsDetailsOutputModel. :param entry_point: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
entry_point
yonetatuu/kamonohashi
100
python
@entry_point.setter def entry_point(self, entry_point): 'Sets the entry_point of this TrainingApiModelsDetailsOutputModel.\n\n\n :param entry_point: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._entry_point = entry_point
@entry_point.setter def entry_point(self, entry_point): 'Sets the entry_point of this TrainingApiModelsDetailsOutputModel.\n\n\n :param entry_point: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._entry_point = entry_point<|docstring|>Sets the entry_point of this TrainingApiModelsDetailsOutputModel. :param entry_point: The entry_point of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
3f4a7c654abe6c89ac71f2c942044b9e4a9736d4f780f5e3082ea1158af24a4f
@property def execution_time(self): 'Gets the execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._execution_time
Gets the execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
execution_time
yonetatuu/kamonohashi
100
python
@property def execution_time(self): 'Gets the execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._execution_time
@property def execution_time(self): 'Gets the execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._execution_time<|docstring|>Gets the execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
3a0cdc83c779a153f28784dbf9a12a5f79498d6b72d9f6bbccc40bdf896302e0
@execution_time.setter def execution_time(self, execution_time): 'Sets the execution_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param execution_time: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._execution_time = execution_time
Sets the execution_time of this TrainingApiModelsDetailsOutputModel. :param execution_time: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
execution_time
yonetatuu/kamonohashi
100
python
@execution_time.setter def execution_time(self, execution_time): 'Sets the execution_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param execution_time: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._execution_time = execution_time
@execution_time.setter def execution_time(self, execution_time): 'Sets the execution_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param execution_time: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._execution_time = execution_time<|docstring|>Sets the execution_time of this TrainingApiModelsDetailsOutputModel. :param execution_time: The execution_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
01ae4532589660e347a167c472ef711c29c411eaafd4695923dc9edb2c092d39
@property def favorite(self): 'Gets the favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n ' return self._favorite
Gets the favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: bool
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
favorite
yonetatuu/kamonohashi
100
python
@property def favorite(self): 'Gets the favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n ' return self._favorite
@property def favorite(self): 'Gets the favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n ' return self._favorite<|docstring|>Gets the favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: bool<|endoftext|>
a58c778df260b944df417e05794460bb682edec781c65d43784f5ec8df88a92b
@favorite.setter def favorite(self, favorite): 'Sets the favorite of this TrainingApiModelsDetailsOutputModel.\n\n\n :param favorite: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n ' self._favorite = favorite
Sets the favorite of this TrainingApiModelsDetailsOutputModel. :param favorite: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: bool
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
favorite
yonetatuu/kamonohashi
100
python
@favorite.setter def favorite(self, favorite): 'Sets the favorite of this TrainingApiModelsDetailsOutputModel.\n\n\n :param favorite: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n ' self._favorite = favorite
@favorite.setter def favorite(self, favorite): 'Sets the favorite of this TrainingApiModelsDetailsOutputModel.\n\n\n :param favorite: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n ' self._favorite = favorite<|docstring|>Sets the favorite of this TrainingApiModelsDetailsOutputModel. :param favorite: The favorite of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: bool<|endoftext|>
37d3a8c017332dcc6fe4001c48b15df727f85106b7fbbd056571c70df1345289
@property def full_name(self): 'Gets the full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._full_name
Gets the full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
full_name
yonetatuu/kamonohashi
100
python
@property def full_name(self): 'Gets the full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._full_name
@property def full_name(self): 'Gets the full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n ' return self._full_name<|docstring|>Gets the full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: str<|endoftext|>
e050e63b096aaee026bb99119adeb125abcf78d6a5633ec3d92160a310c4ed6b
@full_name.setter def full_name(self, full_name): 'Sets the full_name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param full_name: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._full_name = full_name
Sets the full_name of this TrainingApiModelsDetailsOutputModel. :param full_name: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
full_name
yonetatuu/kamonohashi
100
python
@full_name.setter def full_name(self, full_name): 'Sets the full_name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param full_name: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._full_name = full_name
@full_name.setter def full_name(self, full_name): 'Sets the full_name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param full_name: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n ' self._full_name = full_name<|docstring|>Sets the full_name of this TrainingApiModelsDetailsOutputModel. :param full_name: The full_name of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: str<|endoftext|>
491b2b9344ffdd9de00e56b4723cfed5fbcd3bfb393a6c601e8ad8f0de5b87f3
@property def git_model(self): 'Gets the git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsGitCommitOutputModel\n ' return self._git_model
Gets the git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: ComponentsGitCommitOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
git_model
yonetatuu/kamonohashi
100
python
@property def git_model(self): 'Gets the git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsGitCommitOutputModel\n ' return self._git_model
@property def git_model(self): 'Gets the git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: ComponentsGitCommitOutputModel\n ' return self._git_model<|docstring|>Gets the git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :return: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :rtype: ComponentsGitCommitOutputModel<|endoftext|>
55a5214002695b6f9ec890410f523fa5991edfcda575036eb7d504bfdd5a8b0a
@git_model.setter def git_model(self, git_model): 'Sets the git_model of this TrainingApiModelsDetailsOutputModel.\n\n\n :param git_model: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsGitCommitOutputModel\n ' self._git_model = git_model
Sets the git_model of this TrainingApiModelsDetailsOutputModel. :param git_model: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: ComponentsGitCommitOutputModel
sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py
git_model
yonetatuu/kamonohashi
100
python
@git_model.setter def git_model(self, git_model): 'Sets the git_model of this TrainingApiModelsDetailsOutputModel.\n\n\n :param git_model: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsGitCommitOutputModel\n ' self._git_model = git_model
@git_model.setter def git_model(self, git_model): 'Sets the git_model of this TrainingApiModelsDetailsOutputModel.\n\n\n :param git_model: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: ComponentsGitCommitOutputModel\n ' self._git_model = git_model<|docstring|>Sets the git_model of this TrainingApiModelsDetailsOutputModel. :param git_model: The git_model of this TrainingApiModelsDetailsOutputModel. # noqa: E501 :type: ComponentsGitCommitOutputModel<|endoftext|>