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 |
|---|---|---|---|---|---|---|---|---|---|
e1091016081d80fad8f61db34d36b3e6cff27045b0a5406987e83b86d924f386 | @property
def gpu(self):
'Gets the gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._gpu | Gets the gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | gpu | yonetatuu/kamonohashi | 100 | python | @property
def gpu(self):
'Gets the gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._gpu | @property
def gpu(self):
'Gets the gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._gpu<|docstring|>Gets the gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int<|endoftext|> |
c57123c766d1e05cae4761d679c8bc3559a24968fbb77ed95c1766296c104b87 | @gpu.setter
def gpu(self, gpu):
'Sets the gpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param gpu: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._gpu = gpu | Sets the gpu of this TrainingApiModelsDetailsOutputModel.
:param gpu: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | gpu | yonetatuu/kamonohashi | 100 | python | @gpu.setter
def gpu(self, gpu):
'Sets the gpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param gpu: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._gpu = gpu | @gpu.setter
def gpu(self, gpu):
'Sets the gpu of this TrainingApiModelsDetailsOutputModel.\n\n\n :param gpu: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._gpu = gpu<|docstring|>Sets the gpu of this TrainingApiModelsDetailsOutputModel.
:param gpu: The gpu of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int<|endoftext|> |
ac30610af81204ebb1a06be571bbda8ae51987b78d3180c833f704619ef9994f | @property
def id(self):
'Gets the id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._id | Gets the id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | id | yonetatuu/kamonohashi | 100 | python | @property
def id(self):
'Gets the id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._id | @property
def id(self):
'Gets the id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._id<|docstring|>Gets the id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int<|endoftext|> |
b8c67ad9e6e764fc146b0c20d9cab02fda4cf481666664956a2d2e4c96a866a9 | @id.setter
def id(self, id):
'Sets the id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param id: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._id = id | Sets the id of this TrainingApiModelsDetailsOutputModel.
:param id: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | id | yonetatuu/kamonohashi | 100 | python | @id.setter
def id(self, id):
'Sets the id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param id: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._id = id | @id.setter
def id(self, id):
'Sets the id of this TrainingApiModelsDetailsOutputModel.\n\n\n :param id: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._id = id<|docstring|>Sets the id of this TrainingApiModelsDetailsOutputModel.
:param id: The id of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int<|endoftext|> |
bf30aeef574c630b1100454a1a3b6b306a85fc7962fea01f4389659f229d196f | @property
def key(self):
'Gets the key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._key | Gets the key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | key | yonetatuu/kamonohashi | 100 | python | @property
def key(self):
'Gets the key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._key | @property
def key(self):
'Gets the key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._key<|docstring|>Gets the key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
b00f124f24899929ccd3f836cd31178421fa69a1db18902b5b28d97b0eb4d0cd | @key.setter
def key(self, key):
'Sets the key of this TrainingApiModelsDetailsOutputModel.\n\n\n :param key: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._key = key | Sets the key of this TrainingApiModelsDetailsOutputModel.
:param key: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | key | yonetatuu/kamonohashi | 100 | python | @key.setter
def key(self, key):
'Sets the key of this TrainingApiModelsDetailsOutputModel.\n\n\n :param key: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._key = key | @key.setter
def key(self, key):
'Sets the key of this TrainingApiModelsDetailsOutputModel.\n\n\n :param key: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._key = key<|docstring|>Sets the key of this TrainingApiModelsDetailsOutputModel.
:param key: The key of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
02eb67ad6eccbf73019ddd7141fa563f3a783732de48b38b602c6e520768731d | @property
def local_data_set(self):
'Gets the local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._local_data_set | Gets the local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: bool | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | local_data_set | yonetatuu/kamonohashi | 100 | python | @property
def local_data_set(self):
'Gets the local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._local_data_set | @property
def local_data_set(self):
'Gets the local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._local_data_set<|docstring|>Gets the local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: bool<|endoftext|> |
7b0a556209c66526574efd251ae2b580879508610fde50ecbd0e696ab1b09164 | @local_data_set.setter
def local_data_set(self, local_data_set):
'Sets the local_data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param local_data_set: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._local_data_set = local_data_set | Sets the local_data_set of this TrainingApiModelsDetailsOutputModel.
:param local_data_set: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: bool | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | local_data_set | yonetatuu/kamonohashi | 100 | python | @local_data_set.setter
def local_data_set(self, local_data_set):
'Sets the local_data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param local_data_set: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._local_data_set = local_data_set | @local_data_set.setter
def local_data_set(self, local_data_set):
'Sets the local_data_set of this TrainingApiModelsDetailsOutputModel.\n\n\n :param local_data_set: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._local_data_set = local_data_set<|docstring|>Sets the local_data_set of this TrainingApiModelsDetailsOutputModel.
:param local_data_set: The local_data_set of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: bool<|endoftext|> |
ed1f6796f39eb325348f928286fc7e15d05c2dae7cb83994413710860244f70d | @property
def log_summary(self):
'Gets the log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._log_summary | Gets the log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | log_summary | yonetatuu/kamonohashi | 100 | python | @property
def log_summary(self):
'Gets the log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._log_summary | @property
def log_summary(self):
'Gets the log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._log_summary<|docstring|>Gets the log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
e053810df47a3f401ef35d2a42da1e74434d81432da59f55328bb1c811356867 | @log_summary.setter
def log_summary(self, log_summary):
'Sets the log_summary of this TrainingApiModelsDetailsOutputModel.\n\n\n :param log_summary: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._log_summary = log_summary | Sets the log_summary of this TrainingApiModelsDetailsOutputModel.
:param log_summary: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | log_summary | yonetatuu/kamonohashi | 100 | python | @log_summary.setter
def log_summary(self, log_summary):
'Sets the log_summary of this TrainingApiModelsDetailsOutputModel.\n\n\n :param log_summary: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._log_summary = log_summary | @log_summary.setter
def log_summary(self, log_summary):
'Sets the log_summary of this TrainingApiModelsDetailsOutputModel.\n\n\n :param log_summary: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._log_summary = log_summary<|docstring|>Sets the log_summary of this TrainingApiModelsDetailsOutputModel.
:param log_summary: The log_summary of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
6791a106c87e801604b3df5e398f11e87b07eb7e952fb0bd12db25b60613ff5c | @property
def memo(self):
'Gets the memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._memo | Gets the memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | memo | yonetatuu/kamonohashi | 100 | python | @property
def memo(self):
'Gets the memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._memo | @property
def memo(self):
'Gets the memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._memo<|docstring|>Gets the memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
74b3820bf240af5f17cff35a1c4ced436002acfeb262032ab95fcbb917cc287d | @memo.setter
def memo(self, memo):
'Sets the memo of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memo: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._memo = memo | Sets the memo of this TrainingApiModelsDetailsOutputModel.
:param memo: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | memo | yonetatuu/kamonohashi | 100 | python | @memo.setter
def memo(self, memo):
'Sets the memo of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memo: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._memo = memo | @memo.setter
def memo(self, memo):
'Sets the memo of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memo: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._memo = memo<|docstring|>Sets the memo of this TrainingApiModelsDetailsOutputModel.
:param memo: The memo of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
93fa78d004329b183cf33b6db1934b61a8997270bcb7f8826675ed9b93f8d4fd | @property
def memory(self):
'Gets the memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._memory | Gets the memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | memory | yonetatuu/kamonohashi | 100 | python | @property
def memory(self):
'Gets the memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._memory | @property
def memory(self):
'Gets the memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: int\n '
return self._memory<|docstring|>Gets the memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: int<|endoftext|> |
2af49ed9f7321931d2ceab7aa7e42f3fc8312b63878932a7a2ff4f19c9332947 | @memory.setter
def memory(self, memory):
'Sets the memory of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memory: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._memory = memory | Sets the memory of this TrainingApiModelsDetailsOutputModel.
:param memory: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | memory | yonetatuu/kamonohashi | 100 | python | @memory.setter
def memory(self, memory):
'Sets the memory of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memory: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._memory = memory | @memory.setter
def memory(self, memory):
'Sets the memory of this TrainingApiModelsDetailsOutputModel.\n\n\n :param memory: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: int\n '
self._memory = memory<|docstring|>Sets the memory of this TrainingApiModelsDetailsOutputModel.
:param memory: The memory of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: int<|endoftext|> |
f772b4ee1e9f096fe8801f3b7d421ffd7804ef3001a4f9780445383cd2a4fdb6 | @property
def modified_at(self):
'Gets the modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_at | Gets the modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | modified_at | yonetatuu/kamonohashi | 100 | python | @property
def modified_at(self):
'Gets the modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_at | @property
def modified_at(self):
'Gets the modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_at<|docstring|>Gets the modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
8966325f168b3ea36a63f1eb4cbf94a0e49a97f3fba689910e8a7e9eedf55f16 | @modified_at.setter
def modified_at(self, modified_at):
'Sets the modified_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_at: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_at = modified_at | Sets the modified_at of this TrainingApiModelsDetailsOutputModel.
:param modified_at: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | modified_at | yonetatuu/kamonohashi | 100 | python | @modified_at.setter
def modified_at(self, modified_at):
'Sets the modified_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_at: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_at = modified_at | @modified_at.setter
def modified_at(self, modified_at):
'Sets the modified_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_at: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_at = modified_at<|docstring|>Sets the modified_at of this TrainingApiModelsDetailsOutputModel.
:param modified_at: The modified_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
465fec9965d6dfecd926e749eaeaa64a8bcfde5b9f84592f6965e65c892ba971 | @property
def modified_by(self):
'Gets the modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_by | Gets the modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | modified_by | yonetatuu/kamonohashi | 100 | python | @property
def modified_by(self):
'Gets the modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_by | @property
def modified_by(self):
'Gets the modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._modified_by<|docstring|>Gets the modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
016e5207f83ce2dca9f8f657119c76a0d6cc56a036ff3e032931b180b0cc6eed | @modified_by.setter
def modified_by(self, modified_by):
'Sets the modified_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_by: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_by = modified_by | Sets the modified_by of this TrainingApiModelsDetailsOutputModel.
:param modified_by: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | modified_by | yonetatuu/kamonohashi | 100 | python | @modified_by.setter
def modified_by(self, modified_by):
'Sets the modified_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_by: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_by = modified_by | @modified_by.setter
def modified_by(self, modified_by):
'Sets the modified_by of this TrainingApiModelsDetailsOutputModel.\n\n\n :param modified_by: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._modified_by = modified_by<|docstring|>Sets the modified_by of this TrainingApiModelsDetailsOutputModel.
:param modified_by: The modified_by of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
50b728d20e18ac1ca944169a36590ff583060e0ee5cf33f74f0e74ccd86f64e4 | @property
def name(self):
'Gets the name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._name | Gets the name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | name | yonetatuu/kamonohashi | 100 | python | @property
def name(self):
'Gets the name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._name | @property
def name(self):
'Gets the name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._name<|docstring|>Gets the name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
83c33b6056d340e2043423eff3261d78f57cdb763c6166c359d9e15d1171787b | @name.setter
def name(self, name):
'Sets the name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param name: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._name = name | Sets the name of this TrainingApiModelsDetailsOutputModel.
:param name: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | name | yonetatuu/kamonohashi | 100 | python | @name.setter
def name(self, name):
'Sets the name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param name: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._name = name | @name.setter
def name(self, name):
'Sets the name of this TrainingApiModelsDetailsOutputModel.\n\n\n :param name: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._name = name<|docstring|>Sets the name of this TrainingApiModelsDetailsOutputModel.
:param name: The name of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
40a68b954385969a6d5eec24d127177f84d4208bf86d17bc3334cea2938c5ec0 | @property
def node(self):
'Gets the node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._node | Gets the node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | node | yonetatuu/kamonohashi | 100 | python | @property
def node(self):
'Gets the node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._node | @property
def node(self):
'Gets the node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._node<|docstring|>Gets the node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
a58dd74a8b8afc732c6b9cee1bf885dd191e2b8b98ee05a080861fab68a91a30 | @node.setter
def node(self, node):
'Sets the node of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._node = node | Sets the node of this TrainingApiModelsDetailsOutputModel.
:param node: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | node | yonetatuu/kamonohashi | 100 | python | @node.setter
def node(self, node):
'Sets the node of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._node = node | @node.setter
def node(self, node):
'Sets the node of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._node = node<|docstring|>Sets the node of this TrainingApiModelsDetailsOutputModel.
:param node: The node of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
7e7a33d01246587eccc51df906fa8c2fbcff23c794d7e180290c606c5c4c9cdc | @property
def node_ports(self):
'Gets the node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._node_ports | Gets the node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[SystemCollectionsGenericKeyValuePair] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | node_ports | yonetatuu/kamonohashi | 100 | python | @property
def node_ports(self):
'Gets the node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._node_ports | @property
def node_ports(self):
'Gets the node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._node_ports<|docstring|>Gets the node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[SystemCollectionsGenericKeyValuePair]<|endoftext|> |
5a4eda5f04f6bdb970d59b4503188fe8d628d7cd09a2a2a14325acadb586dfe4 | @node_ports.setter
def node_ports(self, node_ports):
'Sets the node_ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node_ports: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._node_ports = node_ports | Sets the node_ports of this TrainingApiModelsDetailsOutputModel.
:param node_ports: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[SystemCollectionsGenericKeyValuePair] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | node_ports | yonetatuu/kamonohashi | 100 | python | @node_ports.setter
def node_ports(self, node_ports):
'Sets the node_ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node_ports: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._node_ports = node_ports | @node_ports.setter
def node_ports(self, node_ports):
'Sets the node_ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param node_ports: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._node_ports = node_ports<|docstring|>Sets the node_ports of this TrainingApiModelsDetailsOutputModel.
:param node_ports: The node_ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[SystemCollectionsGenericKeyValuePair]<|endoftext|> |
1b81d98e990adbc5e99e9e0df1dafa6a89e7f2139b9459b43ec71ba8d4be79b1 | @property
def options(self):
'Gets the options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._options | Gets the options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[SystemCollectionsGenericKeyValuePair] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | options | yonetatuu/kamonohashi | 100 | python | @property
def options(self):
'Gets the options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._options | @property
def options(self):
'Gets the options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[SystemCollectionsGenericKeyValuePair]\n '
return self._options<|docstring|>Gets the options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[SystemCollectionsGenericKeyValuePair]<|endoftext|> |
e223cb36facb5ba6b74db9994a50ad69ade3742584254d4fdd054101ecc4f7e0 | @options.setter
def options(self, options):
'Sets the options of this TrainingApiModelsDetailsOutputModel.\n\n\n :param options: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._options = options | Sets the options of this TrainingApiModelsDetailsOutputModel.
:param options: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[SystemCollectionsGenericKeyValuePair] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | options | yonetatuu/kamonohashi | 100 | python | @options.setter
def options(self, options):
'Sets the options of this TrainingApiModelsDetailsOutputModel.\n\n\n :param options: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._options = options | @options.setter
def options(self, options):
'Sets the options of this TrainingApiModelsDetailsOutputModel.\n\n\n :param options: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[SystemCollectionsGenericKeyValuePair]\n '
self._options = options<|docstring|>Sets the options of this TrainingApiModelsDetailsOutputModel.
:param options: The options of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[SystemCollectionsGenericKeyValuePair]<|endoftext|> |
b8e33fb080f3eb70dd7ec0005f438da92fa31170b792932f16dbf5667ab0e4bf | @property
def parent_full_name_list(self):
'Gets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._parent_full_name_list | Gets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[str] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | parent_full_name_list | yonetatuu/kamonohashi | 100 | python | @property
def parent_full_name_list(self):
'Gets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._parent_full_name_list | @property
def parent_full_name_list(self):
'Gets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._parent_full_name_list<|docstring|>Gets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[str]<|endoftext|> |
07eeba32d5fc77fd0fb0d329843f3398fdfe91e53af30f720db52825b7fbf1a3 | @parent_full_name_list.setter
def parent_full_name_list(self, parent_full_name_list):
'Sets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parent_full_name_list: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._parent_full_name_list = parent_full_name_list | Sets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel.
:param parent_full_name_list: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[str] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | parent_full_name_list | yonetatuu/kamonohashi | 100 | python | @parent_full_name_list.setter
def parent_full_name_list(self, parent_full_name_list):
'Sets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parent_full_name_list: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._parent_full_name_list = parent_full_name_list | @parent_full_name_list.setter
def parent_full_name_list(self, parent_full_name_list):
'Sets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parent_full_name_list: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._parent_full_name_list = parent_full_name_list<|docstring|>Sets the parent_full_name_list of this TrainingApiModelsDetailsOutputModel.
:param parent_full_name_list: The parent_full_name_list of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[str]<|endoftext|> |
2937cef0aec816e15f70b3efb0a56553fa8e07ac460dc8a20d012df9ed3f7d74 | @property
def parents(self):
'Gets the parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[TrainingApiModelsIndexOutputModel]\n '
return self._parents | Gets the parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[TrainingApiModelsIndexOutputModel] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | parents | yonetatuu/kamonohashi | 100 | python | @property
def parents(self):
'Gets the parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[TrainingApiModelsIndexOutputModel]\n '
return self._parents | @property
def parents(self):
'Gets the parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[TrainingApiModelsIndexOutputModel]\n '
return self._parents<|docstring|>Gets the parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[TrainingApiModelsIndexOutputModel]<|endoftext|> |
ea003e9e06d292afe71862e0ef3fe99a32706d9272357b8de8ab89f4678f60f0 | @parents.setter
def parents(self, parents):
'Sets the parents of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parents: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[TrainingApiModelsIndexOutputModel]\n '
self._parents = parents | Sets the parents of this TrainingApiModelsDetailsOutputModel.
:param parents: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[TrainingApiModelsIndexOutputModel] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | parents | yonetatuu/kamonohashi | 100 | python | @parents.setter
def parents(self, parents):
'Sets the parents of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parents: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[TrainingApiModelsIndexOutputModel]\n '
self._parents = parents | @parents.setter
def parents(self, parents):
'Sets the parents of this TrainingApiModelsDetailsOutputModel.\n\n\n :param parents: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[TrainingApiModelsIndexOutputModel]\n '
self._parents = parents<|docstring|>Sets the parents of this TrainingApiModelsDetailsOutputModel.
:param parents: The parents of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[TrainingApiModelsIndexOutputModel]<|endoftext|> |
8fdf3215f5083b2737a9c33df597bcbd2e38984df8ecb1cff47d2e0161b5c955 | @property
def partition(self):
'Gets the partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._partition | Gets the partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | partition | yonetatuu/kamonohashi | 100 | python | @property
def partition(self):
'Gets the partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._partition | @property
def partition(self):
'Gets the partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._partition<|docstring|>Gets the partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
9389e99380f779d9420286b7d720389066adec01eb1c7b85ba7ab852c0934e93 | @partition.setter
def partition(self, partition):
'Sets the partition of this TrainingApiModelsDetailsOutputModel.\n\n\n :param partition: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._partition = partition | Sets the partition of this TrainingApiModelsDetailsOutputModel.
:param partition: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | partition | yonetatuu/kamonohashi | 100 | python | @partition.setter
def partition(self, partition):
'Sets the partition of this TrainingApiModelsDetailsOutputModel.\n\n\n :param partition: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._partition = partition | @partition.setter
def partition(self, partition):
'Sets the partition of this TrainingApiModelsDetailsOutputModel.\n\n\n :param partition: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._partition = partition<|docstring|>Sets the partition of this TrainingApiModelsDetailsOutputModel.
:param partition: The partition of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
c8157e9c4eede9ff62c7a5e0efad640ce376021c6b2b2604ddaff5842c8069d6 | @property
def ports(self):
'Gets the ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[int]\n '
return self._ports | Gets the ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[int] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | ports | yonetatuu/kamonohashi | 100 | python | @property
def ports(self):
'Gets the ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[int]\n '
return self._ports | @property
def ports(self):
'Gets the ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[int]\n '
return self._ports<|docstring|>Gets the ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[int]<|endoftext|> |
fce6bf40869d41fc2cead8c0d45a760a3f55a9dab31a0cca1249b21570ae7c0f | @ports.setter
def ports(self, ports):
'Sets the ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param ports: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[int]\n '
self._ports = ports | Sets the ports of this TrainingApiModelsDetailsOutputModel.
:param ports: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[int] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | ports | yonetatuu/kamonohashi | 100 | python | @ports.setter
def ports(self, ports):
'Sets the ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param ports: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[int]\n '
self._ports = ports | @ports.setter
def ports(self, ports):
'Sets the ports of this TrainingApiModelsDetailsOutputModel.\n\n\n :param ports: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[int]\n '
self._ports = ports<|docstring|>Sets the ports of this TrainingApiModelsDetailsOutputModel.
:param ports: The ports of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[int]<|endoftext|> |
befb4dc763140f6de4bf18b65de1ca366f8dfa861ddd79fedc4bbe33b5b77734 | @property
def started_at(self):
'Gets the started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._started_at | Gets the started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | started_at | yonetatuu/kamonohashi | 100 | python | @property
def started_at(self):
'Gets the started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._started_at | @property
def started_at(self):
'Gets the started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._started_at<|docstring|>Gets the started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
b13e33768aeca1f409b7a07a14097f97b5d4e43d14729eb67918f7ca9fde60c1 | @started_at.setter
def started_at(self, started_at):
'Sets the started_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param started_at: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._started_at = started_at | Sets the started_at of this TrainingApiModelsDetailsOutputModel.
:param started_at: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | started_at | yonetatuu/kamonohashi | 100 | python | @started_at.setter
def started_at(self, started_at):
'Sets the started_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param started_at: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._started_at = started_at | @started_at.setter
def started_at(self, started_at):
'Sets the started_at of this TrainingApiModelsDetailsOutputModel.\n\n\n :param started_at: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._started_at = started_at<|docstring|>Sets the started_at of this TrainingApiModelsDetailsOutputModel.
:param started_at: The started_at of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
74e603c9b03be1fe0817d13f84b9b851522b0c6ee9f5f668ac06fe912f22c35a | @property
def status(self):
'Gets the status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status | Gets the status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | status | yonetatuu/kamonohashi | 100 | python | @property
def status(self):
'Gets the status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status | @property
def status(self):
'Gets the status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status<|docstring|>Gets the status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
46132cc617fe4e67e430046cfb94af238b2841fd1aadbb8a253102f9741d537e | @status.setter
def status(self, status):
'Sets the status of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status = status | Sets the status of this TrainingApiModelsDetailsOutputModel.
:param status: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | status | yonetatuu/kamonohashi | 100 | python | @status.setter
def status(self, status):
'Sets the status of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status = status | @status.setter
def status(self, status):
'Sets the status of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status = status<|docstring|>Sets the status of this TrainingApiModelsDetailsOutputModel.
:param status: The status of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
10869b03ff4f8eee7341bc46bc30cb15b77002375da3f7469b11cd3830be168c | @property
def status_type(self):
'Gets the status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status_type | Gets the status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | status_type | yonetatuu/kamonohashi | 100 | python | @property
def status_type(self):
'Gets the status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status_type | @property
def status_type(self):
'Gets the status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._status_type<|docstring|>Gets the status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
ead386d6f11bde63981c17346b59dfc8afdfc1d321b59ac660395c8569f4e8a6 | @status_type.setter
def status_type(self, status_type):
'Sets the status_type of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status_type: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status_type = status_type | Sets the status_type of this TrainingApiModelsDetailsOutputModel.
:param status_type: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | status_type | yonetatuu/kamonohashi | 100 | python | @status_type.setter
def status_type(self, status_type):
'Sets the status_type of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status_type: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status_type = status_type | @status_type.setter
def status_type(self, status_type):
'Sets the status_type of this TrainingApiModelsDetailsOutputModel.\n\n\n :param status_type: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._status_type = status_type<|docstring|>Sets the status_type of this TrainingApiModelsDetailsOutputModel.
:param status_type: The status_type of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
159883001ec963737bcb6918f2100722d3b8aa8cb3136f59a5f5aa4dd617a2a6 | @property
def tags(self):
'Gets the tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._tags | Gets the tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[str] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | tags | yonetatuu/kamonohashi | 100 | python | @property
def tags(self):
'Gets the tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._tags | @property
def tags(self):
'Gets the tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: list[str]\n '
return self._tags<|docstring|>Gets the tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: list[str]<|endoftext|> |
dd6888d390660391ef0987c333c1a1a397c8c84a483449cb7b7024e8df010dde | @tags.setter
def tags(self, tags):
'Sets the tags of this TrainingApiModelsDetailsOutputModel.\n\n\n :param tags: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._tags = tags | Sets the tags of this TrainingApiModelsDetailsOutputModel.
:param tags: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[str] | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | tags | yonetatuu/kamonohashi | 100 | python | @tags.setter
def tags(self, tags):
'Sets the tags of this TrainingApiModelsDetailsOutputModel.\n\n\n :param tags: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._tags = tags | @tags.setter
def tags(self, tags):
'Sets the tags of this TrainingApiModelsDetailsOutputModel.\n\n\n :param tags: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: list[str]\n '
self._tags = tags<|docstring|>Sets the tags of this TrainingApiModelsDetailsOutputModel.
:param tags: The tags of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: list[str]<|endoftext|> |
720219a76aa551664534e40c7379763edd21fe05bbc0064a7d43066ec227ecdb | @property
def waiting_time(self):
'Gets the waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._waiting_time | Gets the waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | waiting_time | yonetatuu/kamonohashi | 100 | python | @property
def waiting_time(self):
'Gets the waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._waiting_time | @property
def waiting_time(self):
'Gets the waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: str\n '
return self._waiting_time<|docstring|>Gets the waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: str<|endoftext|> |
fb59b76a5a02db6a744e8f11ed4224a91cd7d95e0f7fe734a0d4f65f13facbe8 | @waiting_time.setter
def waiting_time(self, waiting_time):
'Sets the waiting_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param waiting_time: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._waiting_time = waiting_time | Sets the waiting_time of this TrainingApiModelsDetailsOutputModel.
:param waiting_time: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | waiting_time | yonetatuu/kamonohashi | 100 | python | @waiting_time.setter
def waiting_time(self, waiting_time):
'Sets the waiting_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param waiting_time: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._waiting_time = waiting_time | @waiting_time.setter
def waiting_time(self, waiting_time):
'Sets the waiting_time of this TrainingApiModelsDetailsOutputModel.\n\n\n :param waiting_time: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: str\n '
self._waiting_time = waiting_time<|docstring|>Sets the waiting_time of this TrainingApiModelsDetailsOutputModel.
:param waiting_time: The waiting_time of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: str<|endoftext|> |
39e92ce4490d0a2496a8fb6f22273df1f6362fdf7a2372edc563ad4a29965c61 | @property
def zip(self):
'Gets the zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._zip | Gets the zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: bool | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | zip | yonetatuu/kamonohashi | 100 | python | @property
def zip(self):
'Gets the zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._zip | @property
def zip(self):
'Gets the zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n\n\n :return: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :rtype: bool\n '
return self._zip<|docstring|>Gets the zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:return: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:rtype: bool<|endoftext|> |
a549a763b3cff47361e51a0c468cade9bf651a88ec7063f6b89235a992830d61 | @zip.setter
def zip(self, zip):
'Sets the zip of this TrainingApiModelsDetailsOutputModel.\n\n\n :param zip: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._zip = zip | Sets the zip of this TrainingApiModelsDetailsOutputModel.
:param zip: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: bool | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | zip | yonetatuu/kamonohashi | 100 | python | @zip.setter
def zip(self, zip):
'Sets the zip of this TrainingApiModelsDetailsOutputModel.\n\n\n :param zip: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._zip = zip | @zip.setter
def zip(self, zip):
'Sets the zip of this TrainingApiModelsDetailsOutputModel.\n\n\n :param zip: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501\n :type: bool\n '
self._zip = zip<|docstring|>Sets the zip of this TrainingApiModelsDetailsOutputModel.
:param zip: The zip of this TrainingApiModelsDetailsOutputModel. # noqa: E501
:type: bool<|endoftext|> |
bf3e2227e949dcb017ef260ffee2600ccc8a97fa608338080d3b2d87c3fc2f9c | def to_dict(self):
'Returns the model properties as a dict'
result = {}
for (attr, _) in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items()))
else:
result[attr] = value
if issubclass(TrainingApiModelsDetailsOutputModel, dict):
for (key, value) in self.items():
result[key] = value
return result | Returns the model properties as a dict | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | to_dict | yonetatuu/kamonohashi | 100 | python | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items()))
else:
result[attr] = value
if issubclass(TrainingApiModelsDetailsOutputModel, dict):
for (key, value) in self.items():
result[key] = value
return result | def to_dict(self):
result = {}
for (attr, _) in six.iteritems(self.swagger_types):
value = getattr(self, attr)
if isinstance(value, list):
result[attr] = list(map((lambda x: (x.to_dict() if hasattr(x, 'to_dict') else x)), value))
elif hasattr(value, 'to_dict'):
result[attr] = value.to_dict()
elif isinstance(value, dict):
result[attr] = dict(map((lambda item: ((item[0], item[1].to_dict()) if hasattr(item[1], 'to_dict') else item)), value.items()))
else:
result[attr] = value
if issubclass(TrainingApiModelsDetailsOutputModel, dict):
for (key, value) in self.items():
result[key] = value
return result<|docstring|>Returns the model properties as a dict<|endoftext|> |
cbb19eaa2fc8a113d9e32f924ef280a7e97563f8915f94f65dab438997af2e99 | def to_str(self):
'Returns the string representation of the model'
return pprint.pformat(self.to_dict()) | Returns the string representation of the model | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | to_str | yonetatuu/kamonohashi | 100 | python | def to_str(self):
return pprint.pformat(self.to_dict()) | def to_str(self):
return pprint.pformat(self.to_dict())<|docstring|>Returns the string representation of the model<|endoftext|> |
772243a2c2b3261a9b954d07aaf295e3c1242a579a495e2d6a5679c677861703 | def __repr__(self):
'For `print` and `pprint`'
return self.to_str() | For `print` and `pprint` | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | __repr__ | yonetatuu/kamonohashi | 100 | python | def __repr__(self):
return self.to_str() | def __repr__(self):
return self.to_str()<|docstring|>For `print` and `pprint`<|endoftext|> |
2dc8521c398ab701e6fe29e998e3fdfb0c7512309c66ca53725419da7f1fe29f | def __eq__(self, other):
'Returns true if both objects are equal'
if (not isinstance(other, TrainingApiModelsDetailsOutputModel)):
return False
return (self.__dict__ == other.__dict__) | Returns true if both objects are equal | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | __eq__ | yonetatuu/kamonohashi | 100 | python | def __eq__(self, other):
if (not isinstance(other, TrainingApiModelsDetailsOutputModel)):
return False
return (self.__dict__ == other.__dict__) | def __eq__(self, other):
if (not isinstance(other, TrainingApiModelsDetailsOutputModel)):
return False
return (self.__dict__ == other.__dict__)<|docstring|>Returns true if both objects are equal<|endoftext|> |
43dc6740163eb9fc1161d09cb2208a64c7ad0cc8d9c8637ac3264522d3ec7e42 | def __ne__(self, other):
'Returns true if both objects are not equal'
return (not (self == other)) | Returns true if both objects are not equal | sdk/kamonohashi/op/rest/models/training_api_models_details_output_model.py | __ne__ | yonetatuu/kamonohashi | 100 | python | def __ne__(self, other):
return (not (self == other)) | def __ne__(self, other):
return (not (self == other))<|docstring|>Returns true if both objects are not equal<|endoftext|> |
d493da212f19f527ecffcf74a45d8feb38b89d38ee323e08ff88f23a97af6699 | def login(studentnumber, password):
'登录\n\n 登录,无返回值,在一个会话内执行可保持登录状态\n\n :param studentnumber: 用户名,学号\n :param password: 密码\n :return: 无返回\n '
response = s.get(url, headers=headers)
(DEBUG and print('login home page:', response.content.decode('utf-8')))
login_salt = s.get(login_salt_url, headers=headers).content.decode('utf-8')
(DEBUG and print('login salt:', login_salt))
password_salt = ((login_salt + '-') + password)
password_post = hashlib.sha1(password_salt.encode('utf-8')).hexdigest()
data = {'username': studentnumber, 'password': password_post, 'captcha': '', 'terminal': 'student'}
(DEBUG and print('post data: ', data))
(DEBUG and print('s headers: ', s.headers))
print('学号: {}'.format(studentnumber))
response = s.post(checkurl, data=json.dumps(data), headers=headers_content_json).content.decode('utf-8')
(DEBUG and print(response))
try:
print('exception', json.loads(response)['exception'])
print('message', json.loads(response)['message'])
except:
result = json.loads(response)
if result.get('result', None):
print('模拟登录成功')
else:
print('登录失败, message: {}'.format(result.get('message', None)))
exit(1) | 登录
登录,无返回值,在一个会话内执行可保持登录状态
:param studentnumber: 用户名,学号
:param password: 密码
:return: 无返回 | ahnu_course.py | login | AHNU2019/curriculum_to_ics | 1 | python | def login(studentnumber, password):
'登录\n\n 登录,无返回值,在一个会话内执行可保持登录状态\n\n :param studentnumber: 用户名,学号\n :param password: 密码\n :return: 无返回\n '
response = s.get(url, headers=headers)
(DEBUG and print('login home page:', response.content.decode('utf-8')))
login_salt = s.get(login_salt_url, headers=headers).content.decode('utf-8')
(DEBUG and print('login salt:', login_salt))
password_salt = ((login_salt + '-') + password)
password_post = hashlib.sha1(password_salt.encode('utf-8')).hexdigest()
data = {'username': studentnumber, 'password': password_post, 'captcha': , 'terminal': 'student'}
(DEBUG and print('post data: ', data))
(DEBUG and print('s headers: ', s.headers))
print('学号: {}'.format(studentnumber))
response = s.post(checkurl, data=json.dumps(data), headers=headers_content_json).content.decode('utf-8')
(DEBUG and print(response))
try:
print('exception', json.loads(response)['exception'])
print('message', json.loads(response)['message'])
except:
result = json.loads(response)
if result.get('result', None):
print('模拟登录成功')
else:
print('登录失败, message: {}'.format(result.get('message', None)))
exit(1) | def login(studentnumber, password):
'登录\n\n 登录,无返回值,在一个会话内执行可保持登录状态\n\n :param studentnumber: 用户名,学号\n :param password: 密码\n :return: 无返回\n '
response = s.get(url, headers=headers)
(DEBUG and print('login home page:', response.content.decode('utf-8')))
login_salt = s.get(login_salt_url, headers=headers).content.decode('utf-8')
(DEBUG and print('login salt:', login_salt))
password_salt = ((login_salt + '-') + password)
password_post = hashlib.sha1(password_salt.encode('utf-8')).hexdigest()
data = {'username': studentnumber, 'password': password_post, 'captcha': , 'terminal': 'student'}
(DEBUG and print('post data: ', data))
(DEBUG and print('s headers: ', s.headers))
print('学号: {}'.format(studentnumber))
response = s.post(checkurl, data=json.dumps(data), headers=headers_content_json).content.decode('utf-8')
(DEBUG and print(response))
try:
print('exception', json.loads(response)['exception'])
print('message', json.loads(response)['message'])
except:
result = json.loads(response)
if result.get('result', None):
print('模拟登录成功')
else:
print('登录失败, message: {}'.format(result.get('message', None)))
exit(1)<|docstring|>登录
登录,无返回值,在一个会话内执行可保持登录状态
:param studentnumber: 用户名,学号
:param password: 密码
:return: 无返回<|endoftext|> |
c7826a730c4f9921958a895e2e3b46dc1fc990e123e45a17ce53231a72959fe0 | def getLessons(savefile=None):
'获取课程表课程\n\n 从教务系统爬取课程表json数据,获取lessons。\n\n :param savefile: 保存课程表json文件的文件名,为空时不保存文件\n :return: 返回课程信息\n '
kcb_page = s.get(kcburl, headers=headers_content_xml).content.decode('utf-8')
(DEBUG and print('kcb page: ', kcb_page))
kcb_json = json.loads(kcb_page)
if savefile:
with open(savefile, 'w+', encoding='utf-8') as f:
f.write(kcb_page)
(DEBUG and print('type(kcb_json)', type(kcb_json)))
lessons = kcb_json.get('lessons', None)
return lessons | 获取课程表课程
从教务系统爬取课程表json数据,获取lessons。
:param savefile: 保存课程表json文件的文件名,为空时不保存文件
:return: 返回课程信息 | ahnu_course.py | getLessons | AHNU2019/curriculum_to_ics | 1 | python | def getLessons(savefile=None):
'获取课程表课程\n\n 从教务系统爬取课程表json数据,获取lessons。\n\n :param savefile: 保存课程表json文件的文件名,为空时不保存文件\n :return: 返回课程信息\n '
kcb_page = s.get(kcburl, headers=headers_content_xml).content.decode('utf-8')
(DEBUG and print('kcb page: ', kcb_page))
kcb_json = json.loads(kcb_page)
if savefile:
with open(savefile, 'w+', encoding='utf-8') as f:
f.write(kcb_page)
(DEBUG and print('type(kcb_json)', type(kcb_json)))
lessons = kcb_json.get('lessons', None)
return lessons | def getLessons(savefile=None):
'获取课程表课程\n\n 从教务系统爬取课程表json数据,获取lessons。\n\n :param savefile: 保存课程表json文件的文件名,为空时不保存文件\n :return: 返回课程信息\n '
kcb_page = s.get(kcburl, headers=headers_content_xml).content.decode('utf-8')
(DEBUG and print('kcb page: ', kcb_page))
kcb_json = json.loads(kcb_page)
if savefile:
with open(savefile, 'w+', encoding='utf-8') as f:
f.write(kcb_page)
(DEBUG and print('type(kcb_json)', type(kcb_json)))
lessons = kcb_json.get('lessons', None)
return lessons<|docstring|>获取课程表课程
从教务系统爬取课程表json数据,获取lessons。
:param savefile: 保存课程表json文件的文件名,为空时不保存文件
:return: 返回课程信息<|endoftext|> |
b423bc6d4de0d242ee4f8ef780de0b3f9d5b3854924754f2a5204d08264bcb5f | def praseLessons(lessons=None):
'解析课程表\n\n 解析lessons,将课程表转换为Course类\n\n :param lessons: 课程信息\n :return: 返回 Course 对象列表\n '
courses = []
if lessons:
for lesson in lessons:
course = lesson.get('course')
nameZh = course.get('nameZh')
(DEBUG and print(nameZh))
scheduleText = lesson.get('scheduleText')
dateTimePlacePersonText = scheduleText.get('dateTimePlacePersonText')
infos = dateTimePlacePersonText.get('textZh')
if infos:
(DEBUG and print(infos, type(infos)))
fulll_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+(.+?)\\s+(.+?)\\s+(.+?)(?:;|$)', re.U)
res_kclist = fulll_pattern.findall(infos)
(DEBUG and print(res_kclist))
no_room_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+([^\\s]+?)(?:;|$)', re.U)
no_room_res_kclist = no_room_pattern.findall(infos)
for kc in no_room_res_kclist:
courses.append(Course(*((((nameZh,) + kc[:5]) + ('未安排校区', '未安排教室')) + kc[5:])))
for kc in res_kclist:
courses.append(Course(*((nameZh,) + kc)))
if DEBUG:
for course in courses:
print(course)
return courses | 解析课程表
解析lessons,将课程表转换为Course类
:param lessons: 课程信息
:return: 返回 Course 对象列表 | ahnu_course.py | praseLessons | AHNU2019/curriculum_to_ics | 1 | python | def praseLessons(lessons=None):
'解析课程表\n\n 解析lessons,将课程表转换为Course类\n\n :param lessons: 课程信息\n :return: 返回 Course 对象列表\n '
courses = []
if lessons:
for lesson in lessons:
course = lesson.get('course')
nameZh = course.get('nameZh')
(DEBUG and print(nameZh))
scheduleText = lesson.get('scheduleText')
dateTimePlacePersonText = scheduleText.get('dateTimePlacePersonText')
infos = dateTimePlacePersonText.get('textZh')
if infos:
(DEBUG and print(infos, type(infos)))
fulll_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+(.+?)\\s+(.+?)\\s+(.+?)(?:;|$)', re.U)
res_kclist = fulll_pattern.findall(infos)
(DEBUG and print(res_kclist))
no_room_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+([^\\s]+?)(?:;|$)', re.U)
no_room_res_kclist = no_room_pattern.findall(infos)
for kc in no_room_res_kclist:
courses.append(Course(*((((nameZh,) + kc[:5]) + ('未安排校区', '未安排教室')) + kc[5:])))
for kc in res_kclist:
courses.append(Course(*((nameZh,) + kc)))
if DEBUG:
for course in courses:
print(course)
return courses | def praseLessons(lessons=None):
'解析课程表\n\n 解析lessons,将课程表转换为Course类\n\n :param lessons: 课程信息\n :return: 返回 Course 对象列表\n '
courses = []
if lessons:
for lesson in lessons:
course = lesson.get('course')
nameZh = course.get('nameZh')
(DEBUG and print(nameZh))
scheduleText = lesson.get('scheduleText')
dateTimePlacePersonText = scheduleText.get('dateTimePlacePersonText')
infos = dateTimePlacePersonText.get('textZh')
if infos:
(DEBUG and print(infos, type(infos)))
fulll_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+(.+?)\\s+(.+?)\\s+(.+?)(?:;|$)', re.U)
res_kclist = fulll_pattern.findall(infos)
(DEBUG and print(res_kclist))
no_room_pattern = re.compile('\\s*(\\d+?)~(\\d+?)周\\s+周(.+?)\\s+第?(.+?)节~第?(.+?)节\\s+([^\\s]+?)(?:;|$)', re.U)
no_room_res_kclist = no_room_pattern.findall(infos)
for kc in no_room_res_kclist:
courses.append(Course(*((((nameZh,) + kc[:5]) + ('未安排校区', '未安排教室')) + kc[5:])))
for kc in res_kclist:
courses.append(Course(*((nameZh,) + kc)))
if DEBUG:
for course in courses:
print(course)
return courses<|docstring|>解析课程表
解析lessons,将课程表转换为Course类
:param lessons: 课程信息
:return: 返回 Course 对象列表<|endoftext|> |
2feae1573fa8aa229de3e39c8f62a3ed020e9c00d0bfbc3958f5e5e0bb1139ec | def get_course_time(start_time, end_time, summer=True):
'获取作息时间\n\n 根据是否为夏季返回作息时间,传参为每天的第几节到第几节。\n\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param summer: 是否夏季,默认为True\n :return: 返回作息时间\n '
if summer:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 30], [15, 15]], '七': [[15, 20], [16, 5]], '八': [[16, 10], [16, 55]], '九': [[17, 10], [17, 55]], '十': [[18, 0], [18, 45]], '十一': [[19, 30], [20, 15]], '十二': [[20, 20], [21, 5]], '十三': [[21, 10], [21, 55]]}
else:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 0], [14, 45]], '七': [[14, 50], [15, 35]], '八': [[15, 40], [16, 25]], '九': [[16, 40], [17, 25]], '十': [[17, 30], [18, 15]], '十一': [[19, 0], [19, 45]], '十二': [[19, 50], [20, 35]], '十三': [[20, 40], [21, 25]]}
return (sc[start_time][0], sc[end_time][1]) | 获取作息时间
根据是否为夏季返回作息时间,传参为每天的第几节到第几节。
:param start_time: 开始节数
:param end_time: 结束节数
:param summer: 是否夏季,默认为True
:return: 返回作息时间 | ahnu_course.py | get_course_time | AHNU2019/curriculum_to_ics | 1 | python | def get_course_time(start_time, end_time, summer=True):
'获取作息时间\n\n 根据是否为夏季返回作息时间,传参为每天的第几节到第几节。\n\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param summer: 是否夏季,默认为True\n :return: 返回作息时间\n '
if summer:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 30], [15, 15]], '七': [[15, 20], [16, 5]], '八': [[16, 10], [16, 55]], '九': [[17, 10], [17, 55]], '十': [[18, 0], [18, 45]], '十一': [[19, 30], [20, 15]], '十二': [[20, 20], [21, 5]], '十三': [[21, 10], [21, 55]]}
else:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 0], [14, 45]], '七': [[14, 50], [15, 35]], '八': [[15, 40], [16, 25]], '九': [[16, 40], [17, 25]], '十': [[17, 30], [18, 15]], '十一': [[19, 0], [19, 45]], '十二': [[19, 50], [20, 35]], '十三': [[20, 40], [21, 25]]}
return (sc[start_time][0], sc[end_time][1]) | def get_course_time(start_time, end_time, summer=True):
'获取作息时间\n\n 根据是否为夏季返回作息时间,传参为每天的第几节到第几节。\n\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param summer: 是否夏季,默认为True\n :return: 返回作息时间\n '
if summer:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 30], [15, 15]], '七': [[15, 20], [16, 5]], '八': [[16, 10], [16, 55]], '九': [[17, 10], [17, 55]], '十': [[18, 0], [18, 45]], '十一': [[19, 30], [20, 15]], '十二': [[20, 20], [21, 5]], '十三': [[21, 10], [21, 55]]}
else:
sc = {'一': [[8, 0], [8, 45]], '二': [[8, 50], [9, 35]], '三': [[9, 50], [10, 35]], '四': [[10, 40], [11, 25]], '五': [[11, 30], [12, 15]], '六': [[14, 0], [14, 45]], '七': [[14, 50], [15, 35]], '八': [[15, 40], [16, 25]], '九': [[16, 40], [17, 25]], '十': [[17, 30], [18, 15]], '十一': [[19, 0], [19, 45]], '十二': [[19, 50], [20, 35]], '十三': [[20, 40], [21, 25]]}
return (sc[start_time][0], sc[end_time][1])<|docstring|>获取作息时间
根据是否为夏季返回作息时间,传参为每天的第几节到第几节。
:param start_time: 开始节数
:param end_time: 结束节数
:param summer: 是否夏季,默认为True
:return: 返回作息时间<|endoftext|> |
bfc04f029c72c7163b7092a91f45bd82a9dcad676dda059e2021c5fa2f643687 | def generateEvent(course, summer=False, count=17, start_date=start_date):
'生成日历事件\n\n 根据参数生成日历事件\n\n :param course: 课程信息\n :param summer: 夏季作息\n :param count: 事件重复次数,一般为周数\n :param start_date: 事件开始时间\n :return: 返回一个日历事件\n '
event = Event()
ev_start_date = (start_date + timedelta(days=week[course.day]))
(s_t, e_t) = get_course_time(course.start_time, course.end_time, summer=summer)
ev_start_datetime = datetime.combine(ev_start_date, time(s_t[0], s_t[1]))
ev_end_datetime = datetime.combine(ev_start_date, time(e_t[0], e_t[1]))
ev_interval = 1
event.add('uid', (str(uuid1()) + '@AHNU'))
event.add('summary', course.name)
event.add('dtstamp', datetime.now())
event.add('dtstart', ev_start_datetime)
event.add('dtend', ev_end_datetime)
event.add('location', course.room)
event.add('rrule', {'freq': 'weekly', 'interval': ev_interval, 'count': count})
event.add('comment', ('教师:' + course.teacher))
return event | 生成日历事件
根据参数生成日历事件
:param course: 课程信息
:param summer: 夏季作息
:param count: 事件重复次数,一般为周数
:param start_date: 事件开始时间
:return: 返回一个日历事件 | ahnu_course.py | generateEvent | AHNU2019/curriculum_to_ics | 1 | python | def generateEvent(course, summer=False, count=17, start_date=start_date):
'生成日历事件\n\n 根据参数生成日历事件\n\n :param course: 课程信息\n :param summer: 夏季作息\n :param count: 事件重复次数,一般为周数\n :param start_date: 事件开始时间\n :return: 返回一个日历事件\n '
event = Event()
ev_start_date = (start_date + timedelta(days=week[course.day]))
(s_t, e_t) = get_course_time(course.start_time, course.end_time, summer=summer)
ev_start_datetime = datetime.combine(ev_start_date, time(s_t[0], s_t[1]))
ev_end_datetime = datetime.combine(ev_start_date, time(e_t[0], e_t[1]))
ev_interval = 1
event.add('uid', (str(uuid1()) + '@AHNU'))
event.add('summary', course.name)
event.add('dtstamp', datetime.now())
event.add('dtstart', ev_start_datetime)
event.add('dtend', ev_end_datetime)
event.add('location', course.room)
event.add('rrule', {'freq': 'weekly', 'interval': ev_interval, 'count': count})
event.add('comment', ('教师:' + course.teacher))
return event | def generateEvent(course, summer=False, count=17, start_date=start_date):
'生成日历事件\n\n 根据参数生成日历事件\n\n :param course: 课程信息\n :param summer: 夏季作息\n :param count: 事件重复次数,一般为周数\n :param start_date: 事件开始时间\n :return: 返回一个日历事件\n '
event = Event()
ev_start_date = (start_date + timedelta(days=week[course.day]))
(s_t, e_t) = get_course_time(course.start_time, course.end_time, summer=summer)
ev_start_datetime = datetime.combine(ev_start_date, time(s_t[0], s_t[1]))
ev_end_datetime = datetime.combine(ev_start_date, time(e_t[0], e_t[1]))
ev_interval = 1
event.add('uid', (str(uuid1()) + '@AHNU'))
event.add('summary', course.name)
event.add('dtstamp', datetime.now())
event.add('dtstart', ev_start_datetime)
event.add('dtend', ev_end_datetime)
event.add('location', course.room)
event.add('rrule', {'freq': 'weekly', 'interval': ev_interval, 'count': count})
event.add('comment', ('教师:' + course.teacher))
return event<|docstring|>生成日历事件
根据参数生成日历事件
:param course: 课程信息
:param summer: 夏季作息
:param count: 事件重复次数,一般为周数
:param start_date: 事件开始时间
:return: 返回一个日历事件<|endoftext|> |
ac373bddf2f20534d423acd2250ef00fa2b34d4107fde2e97d34d5ce7425cd72 | def to_ics(courses, savefile='kcb.ics'):
'转换为日历\n\n 将课程表转换为日历文件\n\n :param courses: Course课程列表\n :param savefile: 保存日历文件路径\n :return: 无返回\n '
print('正在生成日历……')
global start_date
if (start_date.weekday() != 0):
ee = timedelta(days=start_date.weekday())
start_date_first_day = (start_date - ee)
else:
start_date_first_day = start_date
cal = Calendar()
cal['version'] = '2.0'
cal['prodid'] = '-//AHNU//阿才//CN'
for course in courses:
start_date_first_week = (start_date_first_day + timedelta(days=(7 * (int(course.start_week) - 1))))
all_weeks = ((int(course.end_week) - int(course.start_week)) + 1)
if (semester == 1):
days_delta = (winter_start_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=True, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=False, count=last_weeks, start_date=winter_start_date)
elif (semester == 2):
days_delta = (winter_end_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=False, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=True, count=last_weeks, start_date=winter_end_date)
else:
print('not implement')
cal.add_component(first_event)
cal.add_component(last_event)
with open(savefile, 'w+', encoding='utf-8') as file:
ical = cal.to_ical().decode('utf-8')
file.write(cal.to_ical().decode('utf-8').replace('\r\n', '\n').strip())
print('已将所有课程生成日历文件: {}'.format(savefile)) | 转换为日历
将课程表转换为日历文件
:param courses: Course课程列表
:param savefile: 保存日历文件路径
:return: 无返回 | ahnu_course.py | to_ics | AHNU2019/curriculum_to_ics | 1 | python | def to_ics(courses, savefile='kcb.ics'):
'转换为日历\n\n 将课程表转换为日历文件\n\n :param courses: Course课程列表\n :param savefile: 保存日历文件路径\n :return: 无返回\n '
print('正在生成日历……')
global start_date
if (start_date.weekday() != 0):
ee = timedelta(days=start_date.weekday())
start_date_first_day = (start_date - ee)
else:
start_date_first_day = start_date
cal = Calendar()
cal['version'] = '2.0'
cal['prodid'] = '-//AHNU//阿才//CN'
for course in courses:
start_date_first_week = (start_date_first_day + timedelta(days=(7 * (int(course.start_week) - 1))))
all_weeks = ((int(course.end_week) - int(course.start_week)) + 1)
if (semester == 1):
days_delta = (winter_start_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=True, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=False, count=last_weeks, start_date=winter_start_date)
elif (semester == 2):
days_delta = (winter_end_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=False, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=True, count=last_weeks, start_date=winter_end_date)
else:
print('not implement')
cal.add_component(first_event)
cal.add_component(last_event)
with open(savefile, 'w+', encoding='utf-8') as file:
ical = cal.to_ical().decode('utf-8')
file.write(cal.to_ical().decode('utf-8').replace('\r\n', '\n').strip())
print('已将所有课程生成日历文件: {}'.format(savefile)) | def to_ics(courses, savefile='kcb.ics'):
'转换为日历\n\n 将课程表转换为日历文件\n\n :param courses: Course课程列表\n :param savefile: 保存日历文件路径\n :return: 无返回\n '
print('正在生成日历……')
global start_date
if (start_date.weekday() != 0):
ee = timedelta(days=start_date.weekday())
start_date_first_day = (start_date - ee)
else:
start_date_first_day = start_date
cal = Calendar()
cal['version'] = '2.0'
cal['prodid'] = '-//AHNU//阿才//CN'
for course in courses:
start_date_first_week = (start_date_first_day + timedelta(days=(7 * (int(course.start_week) - 1))))
all_weeks = ((int(course.end_week) - int(course.start_week)) + 1)
if (semester == 1):
days_delta = (winter_start_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=True, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=False, count=last_weeks, start_date=winter_start_date)
elif (semester == 2):
days_delta = (winter_end_date - start_date_first_week)
first_weeks = math.ceil((days_delta.days / 7))
last_weeks = (all_weeks - first_weeks)
first_event = generateEvent(course, summer=False, count=first_weeks, start_date=start_date_first_week)
last_event = generateEvent(course, summer=True, count=last_weeks, start_date=winter_end_date)
else:
print('not implement')
cal.add_component(first_event)
cal.add_component(last_event)
with open(savefile, 'w+', encoding='utf-8') as file:
ical = cal.to_ical().decode('utf-8')
file.write(cal.to_ical().decode('utf-8').replace('\r\n', '\n').strip())
print('已将所有课程生成日历文件: {}'.format(savefile))<|docstring|>转换为日历
将课程表转换为日历文件
:param courses: Course课程列表
:param savefile: 保存日历文件路径
:return: 无返回<|endoftext|> |
4491ee25d094a3e11a791274e7b1d6aae2e0c0c53c2c522a18f5661a2881c7c8 | def __init__(self, name, start_week, end_week, day, start_time, end_time, school_area, room, teacher):
'初始化Course\n\n 初始化Course\n\n :param name: 课程名称\n :param start_week: 开始周\n :param end_week: 结束周\n :param day: 星期几\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param school_area: 校区\n :param room: 教室\n :param teacher: 教师\n :return: 无返回\n '
self.name = name
self.start_week = start_week
self.end_week = end_week
self.day = day
self.start_time = start_time
self.end_time = end_time
self.school_area = school_area
self.room = room
self.teacher = teacher | 初始化Course
初始化Course
:param name: 课程名称
:param start_week: 开始周
:param end_week: 结束周
:param day: 星期几
:param start_time: 开始节数
:param end_time: 结束节数
:param school_area: 校区
:param room: 教室
:param teacher: 教师
:return: 无返回 | ahnu_course.py | __init__ | AHNU2019/curriculum_to_ics | 1 | python | def __init__(self, name, start_week, end_week, day, start_time, end_time, school_area, room, teacher):
'初始化Course\n\n 初始化Course\n\n :param name: 课程名称\n :param start_week: 开始周\n :param end_week: 结束周\n :param day: 星期几\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param school_area: 校区\n :param room: 教室\n :param teacher: 教师\n :return: 无返回\n '
self.name = name
self.start_week = start_week
self.end_week = end_week
self.day = day
self.start_time = start_time
self.end_time = end_time
self.school_area = school_area
self.room = room
self.teacher = teacher | def __init__(self, name, start_week, end_week, day, start_time, end_time, school_area, room, teacher):
'初始化Course\n\n 初始化Course\n\n :param name: 课程名称\n :param start_week: 开始周\n :param end_week: 结束周\n :param day: 星期几\n :param start_time: 开始节数\n :param end_time: 结束节数\n :param school_area: 校区\n :param room: 教室\n :param teacher: 教师\n :return: 无返回\n '
self.name = name
self.start_week = start_week
self.end_week = end_week
self.day = day
self.start_time = start_time
self.end_time = end_time
self.school_area = school_area
self.room = room
self.teacher = teacher<|docstring|>初始化Course
初始化Course
:param name: 课程名称
:param start_week: 开始周
:param end_week: 结束周
:param day: 星期几
:param start_time: 开始节数
:param end_time: 结束节数
:param school_area: 校区
:param room: 教室
:param teacher: 教师
:return: 无返回<|endoftext|> |
d7e27e62c5564e95bfaf14d7d5621563012d8c642455e7b2656ea199545dac57 | def get_projects(self):
'Return a list of project titles'
raise NotImplementedError | Return a list of project titles | model.py | get_projects | ulrikpedersen/toggl-gnome-applet | 0 | python | def get_projects(self):
raise NotImplementedError | def get_projects(self):
raise NotImplementedError<|docstring|>Return a list of project titles<|endoftext|> |
d81cee558771fb16d93cc3821e78dc871d805421785c68287a1ed00604e1d057 | def get_time_entries(self):
'Return a list of time entry dictionaries.\n Default: {\'project\': "", \'description\': "", \'duration\': None}'
raise NotImplementedError | Return a list of time entry dictionaries.
Default: {'project': "", 'description': "", 'duration': None} | model.py | get_time_entries | ulrikpedersen/toggl-gnome-applet | 0 | python | def get_time_entries(self):
'Return a list of time entry dictionaries.\n Default: {\'project\': , \'description\': , \'duration\': None}'
raise NotImplementedError | def get_time_entries(self):
'Return a list of time entry dictionaries.\n Default: {\'project\': , \'description\': , \'duration\': None}'
raise NotImplementedError<|docstring|>Return a list of time entry dictionaries.
Default: {'project': "", 'description': "", 'duration': None}<|endoftext|> |
6bcc88caa7b24cd14609820cdb59c955fd3a4202645c179d3248d69862b24be9 | def generate_liststore(self):
'Create and return a gtk.ListStore model'
raise NotImplementedError | Create and return a gtk.ListStore model | model.py | generate_liststore | ulrikpedersen/toggl-gnome-applet | 0 | python | def generate_liststore(self):
raise NotImplementedError | def generate_liststore(self):
raise NotImplementedError<|docstring|>Create and return a gtk.ListStore model<|endoftext|> |
728ca162cb3746d3379ebec8fce03747d195d175a2b1a1e100678e54e3a432fb | def register_for_notification(self, func):
'Register a callable or function for a callback nofication when the \n model detects a change in state.'
raise NotImplementedError | Register a callable or function for a callback nofication when the
model detects a change in state. | model.py | register_for_notification | ulrikpedersen/toggl-gnome-applet | 0 | python | def register_for_notification(self, func):
'Register a callable or function for a callback nofication when the \n model detects a change in state.'
raise NotImplementedError | def register_for_notification(self, func):
'Register a callable or function for a callback nofication when the \n model detects a change in state.'
raise NotImplementedError<|docstring|>Register a callable or function for a callback nofication when the
model detects a change in state.<|endoftext|> |
05085c58047d6869d2f184f38a10616f29311de477a78dfc1185ed39b5369e07 | def update(self):
'Non-blocking command to update the model data'
raise NotImplementedError | Non-blocking command to update the model data | model.py | update | ulrikpedersen/toggl-gnome-applet | 0 | python | def update(self):
raise NotImplementedError | def update(self):
raise NotImplementedError<|docstring|>Non-blocking command to update the model data<|endoftext|> |
7df6cb96d22ca8452f72e19a1deb3fd6d0310220b4809e3cc3fac987275fd823 | def __init__(self):
'\n Constructor\n '
self.toggl = toggl.Toggl()
self.projects = []
self.time_entries = []
self.notifiers = []
self._lock = threading.Lock()
self._get_updates() | Constructor | model.py | __init__ | ulrikpedersen/toggl-gnome-applet | 0 | python | def __init__(self):
'\n \n '
self.toggl = toggl.Toggl()
self.projects = []
self.time_entries = []
self.notifiers = []
self._lock = threading.Lock()
self._get_updates() | def __init__(self):
'\n \n '
self.toggl = toggl.Toggl()
self.projects = []
self.time_entries = []
self.notifiers = []
self._lock = threading.Lock()
self._get_updates()<|docstring|>Constructor<|endoftext|> |
9a28e1ba0deda793a9303e267388c110dc2303af8f964e5b7d411862c2c18089 | def _get_updates(self):
'Query toggl for updates and notify any listeners'
dirty = False
projects = self._get_toggl_projects()
ts_entries = self._get_toggl_time_entries()
self._lock.acquire()
if (not (self.projects == projects)):
dirty = True
self.projects = projects
if (not (self.time_entries == ts_entries)):
dirty = True
self.time_entries = ts_entries
self._lock.release()
if dirty:
self._notify_projects_change() | Query toggl for updates and notify any listeners | model.py | _get_updates | ulrikpedersen/toggl-gnome-applet | 0 | python | def _get_updates(self):
dirty = False
projects = self._get_toggl_projects()
ts_entries = self._get_toggl_time_entries()
self._lock.acquire()
if (not (self.projects == projects)):
dirty = True
self.projects = projects
if (not (self.time_entries == ts_entries)):
dirty = True
self.time_entries = ts_entries
self._lock.release()
if dirty:
self._notify_projects_change() | def _get_updates(self):
dirty = False
projects = self._get_toggl_projects()
ts_entries = self._get_toggl_time_entries()
self._lock.acquire()
if (not (self.projects == projects)):
dirty = True
self.projects = projects
if (not (self.time_entries == ts_entries)):
dirty = True
self.time_entries = ts_entries
self._lock.release()
if dirty:
self._notify_projects_change()<|docstring|>Query toggl for updates and notify any listeners<|endoftext|> |
f7f349b9603580222080bac1dda6d493ce3f9f59d32728766f582f8efcc0da90 | def _get_toggl_projects(self):
'Return a sorted list of projects'
wid = self.toggl.get_default_workspace_id()
projects = self.toggl.get_projects(wid)
return sorted(projects, key=(lambda k: k['id'])) | Return a sorted list of projects | model.py | _get_toggl_projects | ulrikpedersen/toggl-gnome-applet | 0 | python | def _get_toggl_projects(self):
wid = self.toggl.get_default_workspace_id()
projects = self.toggl.get_projects(wid)
return sorted(projects, key=(lambda k: k['id'])) | def _get_toggl_projects(self):
wid = self.toggl.get_default_workspace_id()
projects = self.toggl.get_projects(wid)
return sorted(projects, key=(lambda k: k['id']))<|docstring|>Return a sorted list of projects<|endoftext|> |
b549df5945f0e15f88989fa3b5fa1e889391f3456b1b5ab054965c11d79d4c11 | def readCoreRegister(self, reg):
'\n read CPU register\n Unpack floating point register values\n '
regIndex = register_name_to_index(reg)
regValue = self.readCoreRegisterRaw(regIndex)
if (regIndex >= 64):
regValue = conversion.u32BEToFloat32BE(regValue)
return regValue | read CPU register
Unpack floating point register values | pyOCD/debug/context.py | readCoreRegister | dragoniteArm/pyOCD_CC3220sf | 1 | python | def readCoreRegister(self, reg):
'\n read CPU register\n Unpack floating point register values\n '
regIndex = register_name_to_index(reg)
regValue = self.readCoreRegisterRaw(regIndex)
if (regIndex >= 64):
regValue = conversion.u32BEToFloat32BE(regValue)
return regValue | def readCoreRegister(self, reg):
'\n read CPU register\n Unpack floating point register values\n '
regIndex = register_name_to_index(reg)
regValue = self.readCoreRegisterRaw(regIndex)
if (regIndex >= 64):
regValue = conversion.u32BEToFloat32BE(regValue)
return regValue<|docstring|>read CPU register
Unpack floating point register values<|endoftext|> |
8a59be7faa6a851a05468fe769ba23e055d884213ae1fbcaa1d252bab76c7753 | def readCoreRegisterRaw(self, reg):
'\n read a core register (r0 .. r16).\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
vals = self.readCoreRegistersRaw([reg])
return vals[0] | read a core register (r0 .. r16).
If reg is a string, find the number associated to this register
in the lookup table CORE_REGISTER | pyOCD/debug/context.py | readCoreRegisterRaw | dragoniteArm/pyOCD_CC3220sf | 1 | python | def readCoreRegisterRaw(self, reg):
'\n read a core register (r0 .. r16).\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
vals = self.readCoreRegistersRaw([reg])
return vals[0] | def readCoreRegisterRaw(self, reg):
'\n read a core register (r0 .. r16).\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
vals = self.readCoreRegistersRaw([reg])
return vals[0]<|docstring|>read a core register (r0 .. r16).
If reg is a string, find the number associated to this register
in the lookup table CORE_REGISTER<|endoftext|> |
f2e710c3ad94b743648b55cc2ff9cd2fc39b9329ad31260e0c0b2831d814f58d | def writeCoreRegister(self, reg, data):
'\n write a CPU register.\n Will need to pack floating point register values before writing.\n '
regIndex = register_name_to_index(reg)
if (regIndex >= 64):
data = conversion.float32beToU32be(data)
self.writeCoreRegisterRaw(regIndex, data) | write a CPU register.
Will need to pack floating point register values before writing. | pyOCD/debug/context.py | writeCoreRegister | dragoniteArm/pyOCD_CC3220sf | 1 | python | def writeCoreRegister(self, reg, data):
'\n write a CPU register.\n Will need to pack floating point register values before writing.\n '
regIndex = register_name_to_index(reg)
if (regIndex >= 64):
data = conversion.float32beToU32be(data)
self.writeCoreRegisterRaw(regIndex, data) | def writeCoreRegister(self, reg, data):
'\n write a CPU register.\n Will need to pack floating point register values before writing.\n '
regIndex = register_name_to_index(reg)
if (regIndex >= 64):
data = conversion.float32beToU32be(data)
self.writeCoreRegisterRaw(regIndex, data)<|docstring|>write a CPU register.
Will need to pack floating point register values before writing.<|endoftext|> |
73ac063f4d4ffdec9bf04597f466ff20eccf13e3a03367aa594e538945b75a56 | def writeCoreRegisterRaw(self, reg, data):
'\n write a core register (r0 .. r16)\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
self.writeCoreRegistersRaw([reg], [data]) | write a core register (r0 .. r16)
If reg is a string, find the number associated to this register
in the lookup table CORE_REGISTER | pyOCD/debug/context.py | writeCoreRegisterRaw | dragoniteArm/pyOCD_CC3220sf | 1 | python | def writeCoreRegisterRaw(self, reg, data):
'\n write a core register (r0 .. r16)\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
self.writeCoreRegistersRaw([reg], [data]) | def writeCoreRegisterRaw(self, reg, data):
'\n write a core register (r0 .. r16)\n If reg is a string, find the number associated to this register\n in the lookup table CORE_REGISTER\n '
self.writeCoreRegistersRaw([reg], [data])<|docstring|>write a core register (r0 .. r16)
If reg is a string, find the number associated to this register
in the lookup table CORE_REGISTER<|endoftext|> |
708d958507dc176bc34aac7f3e52f6428428a400a78a76100166e44d5c6c4bac | def insertion_sort(input_list):
'This function takes in a list and sorts the values in accending order.\n This sort is done in place (modifing the existing list)\n\n\n Arguments:\n list {list} -- [A list to be sorted (in place)]\n '
for index in range(1, len(input_list)):
value = input_list[index]
i = (index - 1)
while (i >= 0):
if (value < input_list[i]):
input_list[(i + 1)] = input_list[i]
input_list[i] = value
i = (i - 1)
else:
break
return input_list | This function takes in a list and sorts the values in accending order.
This sort is done in place (modifing the existing list)
Arguments:
list {list} -- [A list to be sorted (in place)] | code-challanges/401_code_challenges/sorts/insertion_sort.py | insertion_sort | schoentr/data-structures-and-algorithms | 0 | python | def insertion_sort(input_list):
'This function takes in a list and sorts the values in accending order.\n This sort is done in place (modifing the existing list)\n\n\n Arguments:\n list {list} -- [A list to be sorted (in place)]\n '
for index in range(1, len(input_list)):
value = input_list[index]
i = (index - 1)
while (i >= 0):
if (value < input_list[i]):
input_list[(i + 1)] = input_list[i]
input_list[i] = value
i = (i - 1)
else:
break
return input_list | def insertion_sort(input_list):
'This function takes in a list and sorts the values in accending order.\n This sort is done in place (modifing the existing list)\n\n\n Arguments:\n list {list} -- [A list to be sorted (in place)]\n '
for index in range(1, len(input_list)):
value = input_list[index]
i = (index - 1)
while (i >= 0):
if (value < input_list[i]):
input_list[(i + 1)] = input_list[i]
input_list[i] = value
i = (i - 1)
else:
break
return input_list<|docstring|>This function takes in a list and sorts the values in accending order.
This sort is done in place (modifing the existing list)
Arguments:
list {list} -- [A list to be sorted (in place)]<|endoftext|> |
c2fe018e41622f1a5edff0576c0ab89fbcad147f51fc50c47dcc70b9bb7d009d | def triggerVulnerability(self, length):
'\n\t\tCurrently, Windows injection is still a WIP.\n\t\tStay tuned. For now, use Linux or MacOS.\n\t\t'
print('Triggering vulnerability...')
self.parent.processError('UnsupportedPlatform')
return | Currently, Windows injection is still a WIP.
Stay tuned. For now, use Linux or MacOS. | launcher/injector/IWindowsInjector.py | triggerVulnerability | Trapdoor-NX/switch-launcher | 15 | python | def triggerVulnerability(self, length):
'\n\t\tCurrently, Windows injection is still a WIP.\n\t\tStay tuned. For now, use Linux or MacOS.\n\t\t'
print('Triggering vulnerability...')
self.parent.processError('UnsupportedPlatform')
return | def triggerVulnerability(self, length):
'\n\t\tCurrently, Windows injection is still a WIP.\n\t\tStay tuned. For now, use Linux or MacOS.\n\t\t'
print('Triggering vulnerability...')
self.parent.processError('UnsupportedPlatform')
return<|docstring|>Currently, Windows injection is still a WIP.
Stay tuned. For now, use Linux or MacOS.<|endoftext|> |
7e16688794f9fa76572b066ea9d5f521121c355fc47f2da6fe56b62d909fb125 | @testing.gen_test
def test_download_content_type_switches(self):
'waterbutler.core.mime_types contains content type\n overrides.\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.md')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'text/x-markdown')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download') | waterbutler.core.mime_types contains content type
overrides. | tests/server/api/v0/test_crud.py | test_download_content_type_switches | birdbrained/waterbutler | 0 | python | @testing.gen_test
def test_download_content_type_switches(self):
'waterbutler.core.mime_types contains content type\n overrides.\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.md')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'text/x-markdown')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download') | @testing.gen_test
def test_download_content_type_switches(self):
'waterbutler.core.mime_types contains content type\n overrides.\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.md')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'text/x-markdown')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download')<|docstring|>waterbutler.core.mime_types contains content type
overrides.<|endoftext|> |
4590bff3eade212c2f77e3987e292b7fd609f52f14cc0c59b781038a910f8057 | @testing.gen_test
def test_download_content_type_does_not_switch(self):
'mime_types should not override file extension not in the dict\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.png')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'application/octet-stream')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download') | mime_types should not override file extension not in the dict | tests/server/api/v0/test_crud.py | test_download_content_type_does_not_switch | birdbrained/waterbutler | 0 | python | @testing.gen_test
def test_download_content_type_does_not_switch(self):
'\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.png')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'application/octet-stream')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download') | @testing.gen_test
def test_download_content_type_does_not_switch(self):
'\n '
data = b'freddie brian john roger'
stream = streams.StringStream(data)
stream.name = None
stream.content_type = 'application/octet-stream'
self.mock_provider.download = utils.MockCoroutine(return_value=stream)
resp = (yield self.http_client.fetch(self.get_url('/file?provider=queenhub&path=/freddie.png')))
assert (resp.body == data)
assert (resp.headers['Content-Type'] == 'application/octet-stream')
calls = self.mock_provider.download.call_args_list
assert (len(calls) == 1)
(args, kwargs) = calls[0]
assert (kwargs.get('action') == 'download')<|docstring|>mime_types should not override file extension not in the dict<|endoftext|> |
77e4f6a56077586e8d0e751f9e82cb48add6782d94a2ee26aea466641e4d88ff | def gkern(kernlen=21, std=3):
'Returns a 2D Gaussian kernel array.'
gkern1d = signal.gaussian(kernlen, std=std).reshape(kernlen, 1)
gkern2d = np.outer(gkern1d, gkern1d)
return gkern2d | Returns a 2D Gaussian kernel array. | test.py | gkern | tonymisic/Localizing-Visual-Sounds-the-Hard-Way | 0 | python | def gkern(kernlen=21, std=3):
gkern1d = signal.gaussian(kernlen, std=std).reshape(kernlen, 1)
gkern2d = np.outer(gkern1d, gkern1d)
return gkern2d | def gkern(kernlen=21, std=3):
gkern1d = signal.gaussian(kernlen, std=std).reshape(kernlen, 1)
gkern2d = np.outer(gkern1d, gkern1d)
return gkern2d<|docstring|>Returns a 2D Gaussian kernel array.<|endoftext|> |
e4b88f2148d16ce050adfdc99b47403e997eca8ac8ddb1414afb6e3aabfff189 | def _sign_challenge(self, msg: Dict) -> Optional[str]:
'\n Based on https://github.com/CryptoFacilities/WebSocket-v1-Python/blob/master/cfWebSocketApiV1.py.\n '
try:
sha256_hash = hashlib.sha256()
sha256_hash.update(msg['message'].encode('utf8'))
hash_digest = sha256_hash.digest()
secret_decoded = base64.b64decode(self._api_keys['secret'])
hmac_digest = hmac.new(secret_decoded, hash_digest, hashlib.sha512).digest()
sch = base64.b64encode(hmac_digest).decode('utf-8')
return sch
except Exception as e:
rootLogger.error(f'Error signing challenge upon websocket authentication: {e}')
return None | Based on https://github.com/CryptoFacilities/WebSocket-v1-Python/blob/master/cfWebSocketApiV1.py. | clients/kraken/futures/kraken_futures_ws.py | _sign_challenge | fbuchert/crypto-trading | 0 | python | def _sign_challenge(self, msg: Dict) -> Optional[str]:
'\n \n '
try:
sha256_hash = hashlib.sha256()
sha256_hash.update(msg['message'].encode('utf8'))
hash_digest = sha256_hash.digest()
secret_decoded = base64.b64decode(self._api_keys['secret'])
hmac_digest = hmac.new(secret_decoded, hash_digest, hashlib.sha512).digest()
sch = base64.b64encode(hmac_digest).decode('utf-8')
return sch
except Exception as e:
rootLogger.error(f'Error signing challenge upon websocket authentication: {e}')
return None | def _sign_challenge(self, msg: Dict) -> Optional[str]:
'\n \n '
try:
sha256_hash = hashlib.sha256()
sha256_hash.update(msg['message'].encode('utf8'))
hash_digest = sha256_hash.digest()
secret_decoded = base64.b64decode(self._api_keys['secret'])
hmac_digest = hmac.new(secret_decoded, hash_digest, hashlib.sha512).digest()
sch = base64.b64encode(hmac_digest).decode('utf-8')
return sch
except Exception as e:
rootLogger.error(f'Error signing challenge upon websocket authentication: {e}')
return None<|docstring|>Based on https://github.com/CryptoFacilities/WebSocket-v1-Python/blob/master/cfWebSocketApiV1.py.<|endoftext|> |
ab251c8c8bf499cd2de7ede51c9acebd703a5b7c78797ca9acf9746b8b9bc6b7 | def setUp(self):
'Function: setUp\n\n Description: Initialization for unit testing.\n\n Arguments:\n\n '
self.name = 'Mysql_Server'
self.server_id = 10
self.sql_user = 'mysql_user'
self.sql_pass = 'my_japd'
self.machine = getattr(machine, 'Linux')()
self.host = 'host_server'
self.port = 3307
self.defaults_file = 'def_cfg_file'
self.extra_def_file = 'extra_cfg_file' | Function: setUp
Description: Initialization for unit testing.
Arguments: | test/unit/mysql_class/server_flushlogs.py | setUp | deepcoder42/mysql-lib | 1 | python | def setUp(self):
'Function: setUp\n\n Description: Initialization for unit testing.\n\n Arguments:\n\n '
self.name = 'Mysql_Server'
self.server_id = 10
self.sql_user = 'mysql_user'
self.sql_pass = 'my_japd'
self.machine = getattr(machine, 'Linux')()
self.host = 'host_server'
self.port = 3307
self.defaults_file = 'def_cfg_file'
self.extra_def_file = 'extra_cfg_file' | def setUp(self):
'Function: setUp\n\n Description: Initialization for unit testing.\n\n Arguments:\n\n '
self.name = 'Mysql_Server'
self.server_id = 10
self.sql_user = 'mysql_user'
self.sql_pass = 'my_japd'
self.machine = getattr(machine, 'Linux')()
self.host = 'host_server'
self.port = 3307
self.defaults_file = 'def_cfg_file'
self.extra_def_file = 'extra_cfg_file'<|docstring|>Function: setUp
Description: Initialization for unit testing.
Arguments:<|endoftext|> |
a7e82c06f26eead801899086cfba06db14316b821b38692a0a8ebef392cfab48 | @mock.patch('mysql_class.Server.upd_log_stats')
@mock.patch('mysql_class.flush_logs')
def test_flush_logs(self, mock_logs, mock_update):
'Function: test_flush_logs\n\n Description: Test flush_logs method.\n\n Arguments:\n\n '
mock_logs.return_value = True
mock_update.return_value = True
mysqldb = mysql_class.Server(self.name, self.server_id, self.sql_user, self.sql_pass, self.machine, defaults_file=self.defaults_file)
self.assertFalse(mysqldb.flush_logs()) | Function: test_flush_logs
Description: Test flush_logs method.
Arguments: | test/unit/mysql_class/server_flushlogs.py | test_flush_logs | deepcoder42/mysql-lib | 1 | python | @mock.patch('mysql_class.Server.upd_log_stats')
@mock.patch('mysql_class.flush_logs')
def test_flush_logs(self, mock_logs, mock_update):
'Function: test_flush_logs\n\n Description: Test flush_logs method.\n\n Arguments:\n\n '
mock_logs.return_value = True
mock_update.return_value = True
mysqldb = mysql_class.Server(self.name, self.server_id, self.sql_user, self.sql_pass, self.machine, defaults_file=self.defaults_file)
self.assertFalse(mysqldb.flush_logs()) | @mock.patch('mysql_class.Server.upd_log_stats')
@mock.patch('mysql_class.flush_logs')
def test_flush_logs(self, mock_logs, mock_update):
'Function: test_flush_logs\n\n Description: Test flush_logs method.\n\n Arguments:\n\n '
mock_logs.return_value = True
mock_update.return_value = True
mysqldb = mysql_class.Server(self.name, self.server_id, self.sql_user, self.sql_pass, self.machine, defaults_file=self.defaults_file)
self.assertFalse(mysqldb.flush_logs())<|docstring|>Function: test_flush_logs
Description: Test flush_logs method.
Arguments:<|endoftext|> |
9a7384c4fddc6ce47e4d9d55e8143d4e6e7cfb696ee01626f3f0ec8a80b5221c | def parse_manufacturer_specific(input_data):
"\n Parse the manufacturer specific data as returned via Bluez ManufacturerData. This skips the data for LEN, ADT and\n CoID as specified in Chapter 6.4.2.2 of the spec on page 124. Data therefore starts at TY (must be 0x06).\n\n :param input_data: manufacturer specific data as bytes\n :return: a dict containing the type (key 'type', value 'HomeKit'), the status flag (key 'sf'), human readable\n version of the status flag (key 'flags'), the device id (key 'device_id'), the accessory category\n identifier (key 'acid'), human readable version of the category (key 'category'), the global state number\n (key 'gsn'), the configuration number (key 'cn') and the compatible version (key 'cv')\n "
logging.debug('manufacturer specific data: %s', input_data.hex())
ty = input_data[0]
input_data = input_data[1:]
if (ty == 6):
ty = 'HomeKit'
ail = input_data[0]
logging.debug('advertising interval %s', '{0:02x}'.format(ail))
length = (ail & 31)
if (length != 13):
logging.debug('error with length of manufacturer data')
input_data = input_data[1:]
sf = input_data[0]
flags = BleStatusFlags[sf]
input_data = input_data[1:]
device_id = ':'.join((input_data[:6].hex()[(0 + i):(2 + i)] for i in range(0, 12, 2))).upper()
input_data = input_data[6:]
acid = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
gsn = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
cn = input_data[0]
input_data = input_data[1:]
cv = input_data[0]
input_data = input_data[1:]
if (len(input_data) > 0):
logging.debug('remaining data: %s', input_data.hex())
return {'manufacturer': 'apple', 'type': ty, 'sf': sf, 'flags': flags, 'device_id': device_id, 'acid': acid, 'gsn': gsn, 'cn': cn, 'cv': cv, 'category': Categories[int(acid)]}
return {'manufacturer': 'apple', 'type': ty} | Parse the manufacturer specific data as returned via Bluez ManufacturerData. This skips the data for LEN, ADT and
CoID as specified in Chapter 6.4.2.2 of the spec on page 124. Data therefore starts at TY (must be 0x06).
:param input_data: manufacturer specific data as bytes
:return: a dict containing the type (key 'type', value 'HomeKit'), the status flag (key 'sf'), human readable
version of the status flag (key 'flags'), the device id (key 'device_id'), the accessory category
identifier (key 'acid'), human readable version of the category (key 'category'), the global state number
(key 'gsn'), the configuration number (key 'cn') and the compatible version (key 'cv') | homekit/controller/ble_impl/manufacturer_data.py | parse_manufacturer_specific | elmopl/homekit_python | 3 | python | def parse_manufacturer_specific(input_data):
"\n Parse the manufacturer specific data as returned via Bluez ManufacturerData. This skips the data for LEN, ADT and\n CoID as specified in Chapter 6.4.2.2 of the spec on page 124. Data therefore starts at TY (must be 0x06).\n\n :param input_data: manufacturer specific data as bytes\n :return: a dict containing the type (key 'type', value 'HomeKit'), the status flag (key 'sf'), human readable\n version of the status flag (key 'flags'), the device id (key 'device_id'), the accessory category\n identifier (key 'acid'), human readable version of the category (key 'category'), the global state number\n (key 'gsn'), the configuration number (key 'cn') and the compatible version (key 'cv')\n "
logging.debug('manufacturer specific data: %s', input_data.hex())
ty = input_data[0]
input_data = input_data[1:]
if (ty == 6):
ty = 'HomeKit'
ail = input_data[0]
logging.debug('advertising interval %s', '{0:02x}'.format(ail))
length = (ail & 31)
if (length != 13):
logging.debug('error with length of manufacturer data')
input_data = input_data[1:]
sf = input_data[0]
flags = BleStatusFlags[sf]
input_data = input_data[1:]
device_id = ':'.join((input_data[:6].hex()[(0 + i):(2 + i)] for i in range(0, 12, 2))).upper()
input_data = input_data[6:]
acid = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
gsn = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
cn = input_data[0]
input_data = input_data[1:]
cv = input_data[0]
input_data = input_data[1:]
if (len(input_data) > 0):
logging.debug('remaining data: %s', input_data.hex())
return {'manufacturer': 'apple', 'type': ty, 'sf': sf, 'flags': flags, 'device_id': device_id, 'acid': acid, 'gsn': gsn, 'cn': cn, 'cv': cv, 'category': Categories[int(acid)]}
return {'manufacturer': 'apple', 'type': ty} | def parse_manufacturer_specific(input_data):
"\n Parse the manufacturer specific data as returned via Bluez ManufacturerData. This skips the data for LEN, ADT and\n CoID as specified in Chapter 6.4.2.2 of the spec on page 124. Data therefore starts at TY (must be 0x06).\n\n :param input_data: manufacturer specific data as bytes\n :return: a dict containing the type (key 'type', value 'HomeKit'), the status flag (key 'sf'), human readable\n version of the status flag (key 'flags'), the device id (key 'device_id'), the accessory category\n identifier (key 'acid'), human readable version of the category (key 'category'), the global state number\n (key 'gsn'), the configuration number (key 'cn') and the compatible version (key 'cv')\n "
logging.debug('manufacturer specific data: %s', input_data.hex())
ty = input_data[0]
input_data = input_data[1:]
if (ty == 6):
ty = 'HomeKit'
ail = input_data[0]
logging.debug('advertising interval %s', '{0:02x}'.format(ail))
length = (ail & 31)
if (length != 13):
logging.debug('error with length of manufacturer data')
input_data = input_data[1:]
sf = input_data[0]
flags = BleStatusFlags[sf]
input_data = input_data[1:]
device_id = ':'.join((input_data[:6].hex()[(0 + i):(2 + i)] for i in range(0, 12, 2))).upper()
input_data = input_data[6:]
acid = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
gsn = int.from_bytes(input_data[:2], byteorder='little')
input_data = input_data[2:]
cn = input_data[0]
input_data = input_data[1:]
cv = input_data[0]
input_data = input_data[1:]
if (len(input_data) > 0):
logging.debug('remaining data: %s', input_data.hex())
return {'manufacturer': 'apple', 'type': ty, 'sf': sf, 'flags': flags, 'device_id': device_id, 'acid': acid, 'gsn': gsn, 'cn': cn, 'cv': cv, 'category': Categories[int(acid)]}
return {'manufacturer': 'apple', 'type': ty}<|docstring|>Parse the manufacturer specific data as returned via Bluez ManufacturerData. This skips the data for LEN, ADT and
CoID as specified in Chapter 6.4.2.2 of the spec on page 124. Data therefore starts at TY (must be 0x06).
:param input_data: manufacturer specific data as bytes
:return: a dict containing the type (key 'type', value 'HomeKit'), the status flag (key 'sf'), human readable
version of the status flag (key 'flags'), the device id (key 'device_id'), the accessory category
identifier (key 'acid'), human readable version of the category (key 'category'), the global state number
(key 'gsn'), the configuration number (key 'cn') and the compatible version (key 'cv')<|endoftext|> |
f68faaaf04cd6a396e6dc8260cba4b265fe0391836064277cb3532a92f7488bb | def getPpdName(model):
'\n get ppds from models.dat for postscript printers\n for pclm printers forming ppd name from model name\n '
m = models.ModelData()
dict = m.read_all_files(False)
for m in dict:
if (model in m):
print('dict[m]', dict[m])
key = 'ppd-name'
if (key in dict[m].keys()):
ppd_name = (dict[m]['ppd-name'] + '.gz')
elif model.startswith('apollo'):
ppd_name = (model + '.ppd.gz')
elif model.startswith('hp_'):
model1 = model.replace('hp_', 'hp-')
ppd_name = (model1 + '.ppd.gz')
else:
ppd_name = (('hp-' + model) + '.ppd.gz')
else:
pass
return ppd_name | get ppds from models.dat for postscript printers
for pclm printers forming ppd name from model name | 0900-hp/hplip-3.21.12/prnt/cups.py | getPpdName | rgfaber/dev-toolkit | 0 | python | def getPpdName(model):
'\n get ppds from models.dat for postscript printers\n for pclm printers forming ppd name from model name\n '
m = models.ModelData()
dict = m.read_all_files(False)
for m in dict:
if (model in m):
print('dict[m]', dict[m])
key = 'ppd-name'
if (key in dict[m].keys()):
ppd_name = (dict[m]['ppd-name'] + '.gz')
elif model.startswith('apollo'):
ppd_name = (model + '.ppd.gz')
elif model.startswith('hp_'):
model1 = model.replace('hp_', 'hp-')
ppd_name = (model1 + '.ppd.gz')
else:
ppd_name = (('hp-' + model) + '.ppd.gz')
else:
pass
return ppd_name | def getPpdName(model):
'\n get ppds from models.dat for postscript printers\n for pclm printers forming ppd name from model name\n '
m = models.ModelData()
dict = m.read_all_files(False)
for m in dict:
if (model in m):
print('dict[m]', dict[m])
key = 'ppd-name'
if (key in dict[m].keys()):
ppd_name = (dict[m]['ppd-name'] + '.gz')
elif model.startswith('apollo'):
ppd_name = (model + '.ppd.gz')
elif model.startswith('hp_'):
model1 = model.replace('hp_', 'hp-')
ppd_name = (model1 + '.ppd.gz')
else:
ppd_name = (('hp-' + model) + '.ppd.gz')
else:
pass
return ppd_name<|docstring|>get ppds from models.dat for postscript printers
for pclm printers forming ppd name from model name<|endoftext|> |
8b170f34c8cc1bea26131037012a6778af2babd51eb9f999f7c77e3d6d9aa21c | def getPPDPath(addtional_paths=None):
'\n Returns the CUPS ppd path (not the foomatic one under /usr/share/ppd).\n Usually this is /usr/share/cups/model.\n '
if (addtional_paths is None):
addtional_paths = []
search_paths = (prop.ppd_search_path.split(';') + addtional_paths)
for path in search_paths:
ppd_path = os.path.join(path, 'cups/model')
if os.path.exists(ppd_path):
return ppd_path | Returns the CUPS ppd path (not the foomatic one under /usr/share/ppd).
Usually this is /usr/share/cups/model. | 0900-hp/hplip-3.21.12/prnt/cups.py | getPPDPath | rgfaber/dev-toolkit | 0 | python | def getPPDPath(addtional_paths=None):
'\n Returns the CUPS ppd path (not the foomatic one under /usr/share/ppd).\n Usually this is /usr/share/cups/model.\n '
if (addtional_paths is None):
addtional_paths = []
search_paths = (prop.ppd_search_path.split(';') + addtional_paths)
for path in search_paths:
ppd_path = os.path.join(path, 'cups/model')
if os.path.exists(ppd_path):
return ppd_path | def getPPDPath(addtional_paths=None):
'\n Returns the CUPS ppd path (not the foomatic one under /usr/share/ppd).\n Usually this is /usr/share/cups/model.\n '
if (addtional_paths is None):
addtional_paths = []
search_paths = (prop.ppd_search_path.split(';') + addtional_paths)
for path in search_paths:
ppd_path = os.path.join(path, 'cups/model')
if os.path.exists(ppd_path):
return ppd_path<|docstring|>Returns the CUPS ppd path (not the foomatic one under /usr/share/ppd).
Usually this is /usr/share/cups/model.<|endoftext|> |
0c609e34b217f6dab7554b7f1034756a6ffa6e90c6556ae5dcc65e1b69c02bb3 | def getPPDPath1(addtional_paths=None):
'\n return path for hplip ppds. \n '
filename_config = '/etc/hp/hplip.conf'
file_conf = open(filename_config, 'r')
for line in file_conf:
if ('ppd=' in line):
count = line.find('=')
ppd_path = line[(count + 1):(len(line) - 1)]
return ppd_path | return path for hplip ppds. | 0900-hp/hplip-3.21.12/prnt/cups.py | getPPDPath1 | rgfaber/dev-toolkit | 0 | python | def getPPDPath1(addtional_paths=None):
'\n \n '
filename_config = '/etc/hp/hplip.conf'
file_conf = open(filename_config, 'r')
for line in file_conf:
if ('ppd=' in line):
count = line.find('=')
ppd_path = line[(count + 1):(len(line) - 1)]
return ppd_path | def getPPDPath1(addtional_paths=None):
'\n \n '
filename_config = '/etc/hp/hplip.conf'
file_conf = open(filename_config, 'r')
for line in file_conf:
if ('ppd=' in line):
count = line.find('=')
ppd_path = line[(count + 1):(len(line) - 1)]
return ppd_path<|docstring|>return path for hplip ppds.<|endoftext|> |
3309853caa718d8b5fbcf14ba3bdd8636df37a10198aae2018e35aa796733fd5 | def getAllowableMIMETypes():
'\n Scan all /etc/cups/*.convs and /usr/share/cups/mime\n files for allowable file formats.\n '
paths = []
allowable_mime_types = []
files = []
if os.path.exists('/etc/cups'):
paths.append('/etc/cups/*.convs')
if os.path.exists('/usr/share/cups/mime'):
paths.append('/usr/share/cups/mime/*.convs')
for path in paths:
files.extend(glob.glob(path))
for f in files:
conv_file = open(f, 'r')
for line in conv_file:
if ((not line.startswith('#')) and (len(line) > 1)):
try:
(source, dest, cost, prog) = line.split()
except ValueError:
continue
if (source not in ('application/octet-stream', 'application/vnd.cups-postscript')):
allowable_mime_types.append(source)
allowable_mime_types.append('image/x-bmp')
allowable_mime_types.append('text/cpp')
allowable_mime_types.append('application/x-python')
allowable_mime_types.append('application/hplip-fax')
return allowable_mime_types | Scan all /etc/cups/*.convs and /usr/share/cups/mime
files for allowable file formats. | 0900-hp/hplip-3.21.12/prnt/cups.py | getAllowableMIMETypes | rgfaber/dev-toolkit | 0 | python | def getAllowableMIMETypes():
'\n Scan all /etc/cups/*.convs and /usr/share/cups/mime\n files for allowable file formats.\n '
paths = []
allowable_mime_types = []
files = []
if os.path.exists('/etc/cups'):
paths.append('/etc/cups/*.convs')
if os.path.exists('/usr/share/cups/mime'):
paths.append('/usr/share/cups/mime/*.convs')
for path in paths:
files.extend(glob.glob(path))
for f in files:
conv_file = open(f, 'r')
for line in conv_file:
if ((not line.startswith('#')) and (len(line) > 1)):
try:
(source, dest, cost, prog) = line.split()
except ValueError:
continue
if (source not in ('application/octet-stream', 'application/vnd.cups-postscript')):
allowable_mime_types.append(source)
allowable_mime_types.append('image/x-bmp')
allowable_mime_types.append('text/cpp')
allowable_mime_types.append('application/x-python')
allowable_mime_types.append('application/hplip-fax')
return allowable_mime_types | def getAllowableMIMETypes():
'\n Scan all /etc/cups/*.convs and /usr/share/cups/mime\n files for allowable file formats.\n '
paths = []
allowable_mime_types = []
files = []
if os.path.exists('/etc/cups'):
paths.append('/etc/cups/*.convs')
if os.path.exists('/usr/share/cups/mime'):
paths.append('/usr/share/cups/mime/*.convs')
for path in paths:
files.extend(glob.glob(path))
for f in files:
conv_file = open(f, 'r')
for line in conv_file:
if ((not line.startswith('#')) and (len(line) > 1)):
try:
(source, dest, cost, prog) = line.split()
except ValueError:
continue
if (source not in ('application/octet-stream', 'application/vnd.cups-postscript')):
allowable_mime_types.append(source)
allowable_mime_types.append('image/x-bmp')
allowable_mime_types.append('text/cpp')
allowable_mime_types.append('application/x-python')
allowable_mime_types.append('application/hplip-fax')
return allowable_mime_types<|docstring|>Scan all /etc/cups/*.convs and /usr/share/cups/mime
files for allowable file formats.<|endoftext|> |
a0587e283b981137d4865b0db4bc46f8044c58c360b0bb056f3db0f690d45190 | def levenshtein_distance(a, b):
'\n Calculates the Levenshtein distance between a and b.\n Written by Magnus Lie Hetland.\n '
(n, m) = (len(a), len(b))
if (n > m):
(a, b) = (b, a)
(n, m) = (m, n)
current = list(range((n + 1)))
for i in range(1, (m + 1)):
(previous, current) = (current, ([i] + ([0] * m)))
for j in range(1, (n + 1)):
(add, delete) = ((previous[j] + 1), (current[(j - 1)] + 1))
change = previous[(j - 1)]
if (a[(j - 1)] != b[(i - 1)]):
change = (change + 1)
current[j] = min(add, delete, change)
return current[n] | Calculates the Levenshtein distance between a and b.
Written by Magnus Lie Hetland. | 0900-hp/hplip-3.21.12/prnt/cups.py | levenshtein_distance | rgfaber/dev-toolkit | 0 | python | def levenshtein_distance(a, b):
'\n Calculates the Levenshtein distance between a and b.\n Written by Magnus Lie Hetland.\n '
(n, m) = (len(a), len(b))
if (n > m):
(a, b) = (b, a)
(n, m) = (m, n)
current = list(range((n + 1)))
for i in range(1, (m + 1)):
(previous, current) = (current, ([i] + ([0] * m)))
for j in range(1, (n + 1)):
(add, delete) = ((previous[j] + 1), (current[(j - 1)] + 1))
change = previous[(j - 1)]
if (a[(j - 1)] != b[(i - 1)]):
change = (change + 1)
current[j] = min(add, delete, change)
return current[n] | def levenshtein_distance(a, b):
'\n Calculates the Levenshtein distance between a and b.\n Written by Magnus Lie Hetland.\n '
(n, m) = (len(a), len(b))
if (n > m):
(a, b) = (b, a)
(n, m) = (m, n)
current = list(range((n + 1)))
for i in range(1, (m + 1)):
(previous, current) = (current, ([i] + ([0] * m)))
for j in range(1, (n + 1)):
(add, delete) = ((previous[j] + 1), (current[(j - 1)] + 1))
change = previous[(j - 1)]
if (a[(j - 1)] != b[(i - 1)]):
change = (change + 1)
current[j] = min(add, delete, change)
return current[n]<|docstring|>Calculates the Levenshtein distance between a and b.
Written by Magnus Lie Hetland.<|endoftext|> |
7057317d21cbc5ef12810ccae38e2bae2ef47763ec23782d541350ea251e24c7 | def getPPDFile(stripped_model, ppds):
'\n Match up a model name to a PPD from a list of system PPD files.\n '
log.debug('1st stage edit distance match')
mins = {}
eds = {}
min_edit_distance = sys.maxsize
log.debug(('Determining edit distance from %s (only showing edit distances < 4)...' % stripped_model))
for f in ppds:
t = stripModel(os.path.basename(f))
eds[f] = levenshtein_distance(stripped_model, t)
if (eds[f] < 4):
log.debug(("dist('%s') = %d" % (t, eds[f])))
min_edit_distance = min(min_edit_distance, eds[f])
log.debug(('Min. dist = %d' % min_edit_distance))
for f in ppds:
if (eds[f] == min_edit_distance):
for m in mins:
if (os.path.basename(m) == os.path.basename(f)):
break
else:
mins[f] = ppds[f]
log.debug(mins)
if (len(mins) > 1):
log.debug('2nd stage matching with model number')
try:
model_number = number_pat.match(stripped_model).group(1)
model_number = int(model_number)
except AttributeError:
pass
except ValueError:
pass
else:
log.debug(('model_number=%d' % model_number))
matches = {}
for x in range(3):
factor = (10 ** x)
log.debug(('Factor = %d' % factor))
adj_model_number = (int((model_number / factor)) * factor)
(number_matching, match) = (0, '')
for m in mins:
try:
mins_model_number = number_pat.match(os.path.basename(m)).group(1)
mins_model_number = int(mins_model_number)
log.debug(('mins_model_number= %d' % mins_model_number))
except AttributeError:
continue
except ValueError:
continue
mins_adj_model_number = (int((mins_model_number / factor)) * factor)
log.debug(('mins_adj_model_number=%d' % mins_adj_model_number))
log.debug(('adj_model_number=%d' % adj_model_number))
if (mins_adj_model_number == adj_model_number):
log.debug('match')
number_matching += 1
matches[m] = ppds[m]
log.debug(matches)
log.debug('***')
if len(matches):
mins = matches
break
return mins | Match up a model name to a PPD from a list of system PPD files. | 0900-hp/hplip-3.21.12/prnt/cups.py | getPPDFile | rgfaber/dev-toolkit | 0 | python | def getPPDFile(stripped_model, ppds):
'\n \n '
log.debug('1st stage edit distance match')
mins = {}
eds = {}
min_edit_distance = sys.maxsize
log.debug(('Determining edit distance from %s (only showing edit distances < 4)...' % stripped_model))
for f in ppds:
t = stripModel(os.path.basename(f))
eds[f] = levenshtein_distance(stripped_model, t)
if (eds[f] < 4):
log.debug(("dist('%s') = %d" % (t, eds[f])))
min_edit_distance = min(min_edit_distance, eds[f])
log.debug(('Min. dist = %d' % min_edit_distance))
for f in ppds:
if (eds[f] == min_edit_distance):
for m in mins:
if (os.path.basename(m) == os.path.basename(f)):
break
else:
mins[f] = ppds[f]
log.debug(mins)
if (len(mins) > 1):
log.debug('2nd stage matching with model number')
try:
model_number = number_pat.match(stripped_model).group(1)
model_number = int(model_number)
except AttributeError:
pass
except ValueError:
pass
else:
log.debug(('model_number=%d' % model_number))
matches = {}
for x in range(3):
factor = (10 ** x)
log.debug(('Factor = %d' % factor))
adj_model_number = (int((model_number / factor)) * factor)
(number_matching, match) = (0, )
for m in mins:
try:
mins_model_number = number_pat.match(os.path.basename(m)).group(1)
mins_model_number = int(mins_model_number)
log.debug(('mins_model_number= %d' % mins_model_number))
except AttributeError:
continue
except ValueError:
continue
mins_adj_model_number = (int((mins_model_number / factor)) * factor)
log.debug(('mins_adj_model_number=%d' % mins_adj_model_number))
log.debug(('adj_model_number=%d' % adj_model_number))
if (mins_adj_model_number == adj_model_number):
log.debug('match')
number_matching += 1
matches[m] = ppds[m]
log.debug(matches)
log.debug('***')
if len(matches):
mins = matches
break
return mins | def getPPDFile(stripped_model, ppds):
'\n \n '
log.debug('1st stage edit distance match')
mins = {}
eds = {}
min_edit_distance = sys.maxsize
log.debug(('Determining edit distance from %s (only showing edit distances < 4)...' % stripped_model))
for f in ppds:
t = stripModel(os.path.basename(f))
eds[f] = levenshtein_distance(stripped_model, t)
if (eds[f] < 4):
log.debug(("dist('%s') = %d" % (t, eds[f])))
min_edit_distance = min(min_edit_distance, eds[f])
log.debug(('Min. dist = %d' % min_edit_distance))
for f in ppds:
if (eds[f] == min_edit_distance):
for m in mins:
if (os.path.basename(m) == os.path.basename(f)):
break
else:
mins[f] = ppds[f]
log.debug(mins)
if (len(mins) > 1):
log.debug('2nd stage matching with model number')
try:
model_number = number_pat.match(stripped_model).group(1)
model_number = int(model_number)
except AttributeError:
pass
except ValueError:
pass
else:
log.debug(('model_number=%d' % model_number))
matches = {}
for x in range(3):
factor = (10 ** x)
log.debug(('Factor = %d' % factor))
adj_model_number = (int((model_number / factor)) * factor)
(number_matching, match) = (0, )
for m in mins:
try:
mins_model_number = number_pat.match(os.path.basename(m)).group(1)
mins_model_number = int(mins_model_number)
log.debug(('mins_model_number= %d' % mins_model_number))
except AttributeError:
continue
except ValueError:
continue
mins_adj_model_number = (int((mins_model_number / factor)) * factor)
log.debug(('mins_adj_model_number=%d' % mins_adj_model_number))
log.debug(('adj_model_number=%d' % adj_model_number))
if (mins_adj_model_number == adj_model_number):
log.debug('match')
number_matching += 1
matches[m] = ppds[m]
log.debug(matches)
log.debug('***')
if len(matches):
mins = matches
break
return mins<|docstring|>Match up a model name to a PPD from a list of system PPD files.<|endoftext|> |
2cdebdde5073d08fbc8ea071a232d4cd1825cca74ebfa95de8375d0c17e7df9f | def make_call(command, target=''):
'\n call command\n '
if (dry_run or verbose):
print(('calling ... ' + ' '.join(command)))
if dry_run:
return
kwargs = {}
if (not verbose):
kwargs['stdout'] = DEVNULL
kwargs['stderr'] = DEVNULL
try:
subprocess.check_call(command, **kwargs)
except subprocess.CalledProcessError:
if (target == ''):
target = ' '.join(command)
print(('Failed when calling command: ' + target))
raise | call command | setup.py | make_call | GabrielJie/PyMFEM | 1 | python | def make_call(command, target=):
'\n \n '
if (dry_run or verbose):
print(('calling ... ' + ' '.join(command)))
if dry_run:
return
kwargs = {}
if (not verbose):
kwargs['stdout'] = DEVNULL
kwargs['stderr'] = DEVNULL
try:
subprocess.check_call(command, **kwargs)
except subprocess.CalledProcessError:
if (target == ):
target = ' '.join(command)
print(('Failed when calling command: ' + target))
raise | def make_call(command, target=):
'\n \n '
if (dry_run or verbose):
print(('calling ... ' + ' '.join(command)))
if dry_run:
return
kwargs = {}
if (not verbose):
kwargs['stdout'] = DEVNULL
kwargs['stderr'] = DEVNULL
try:
subprocess.check_call(command, **kwargs)
except subprocess.CalledProcessError:
if (target == ):
target = ' '.join(command)
print(('Failed when calling command: ' + target))
raise<|docstring|>call command<|endoftext|> |
94760ab0aa18213832e82dca40a56de227e485e5466569bae5757f8d1c953db1 | def chdir(path):
'\n change directory\n '
pwd = os.getcwd()
os.chdir(path)
if verbose:
print(('Moving to a directory : ' + path))
return pwd | change directory | setup.py | chdir | GabrielJie/PyMFEM | 1 | python | def chdir(path):
'\n \n '
pwd = os.getcwd()
os.chdir(path)
if verbose:
print(('Moving to a directory : ' + path))
return pwd | def chdir(path):
'\n \n '
pwd = os.getcwd()
os.chdir(path)
if verbose:
print(('Moving to a directory : ' + path))
return pwd<|docstring|>change directory<|endoftext|> |
d7452bdab773cf9af59e54e6c0d534b60c34a4962f2b5d9d7fb7a011083bdd5b | def make(target):
'\n make : add -j option automatically\n '
command = ['make', '-j', str(max(((multiprocessing.cpu_count() - 1), 1)))]
make_call(command, target=target) | make : add -j option automatically | setup.py | make | GabrielJie/PyMFEM | 1 | python | def make(target):
'\n \n '
command = ['make', '-j', str(max(((multiprocessing.cpu_count() - 1), 1)))]
make_call(command, target=target) | def make(target):
'\n \n '
command = ['make', '-j', str(max(((multiprocessing.cpu_count() - 1), 1)))]
make_call(command, target=target)<|docstring|>make : add -j option automatically<|endoftext|> |
925f8f4e5b9e6cc83f04e4c60cef7dc96935c8451514511f55fc1ec4aa586264 | def make_install(target, prefix=None):
'\n make install\n '
command = ['make', 'install']
if (prefix is not None):
command.append(('prefix=' + prefix))
make_call(command, target=target) | make install | setup.py | make_install | GabrielJie/PyMFEM | 1 | python | def make_install(target, prefix=None):
'\n \n '
command = ['make', 'install']
if (prefix is not None):
command.append(('prefix=' + prefix))
make_call(command, target=target) | def make_install(target, prefix=None):
'\n \n '
command = ['make', 'install']
if (prefix is not None):
command.append(('prefix=' + prefix))
make_call(command, target=target)<|docstring|>make install<|endoftext|> |
61ab441b868ed3d632b9d16e3ede4f1fb4f96a4dbaecf017eef58f8baeda94a2 | def download(xxx):
'\n download tar.gz from somewhere. xxx is name.\n url is given by repos above\n '
from urllib import request
import tarfile
if os.path.exists(os.path.join(extdir, xxx)):
print((('Download ' + xxx) + ' skipped. Use clean --all-exts if needed'))
return
url = repo_releases[xxx]
print('Downloading :', url)
ftpstream = request.urlopen(url)
targz = tarfile.open(fileobj=ftpstream, mode='r|gz')
targz.extractall(path=extdir)
os.rename(os.path.join(extdir, targz.getnames()[0].split('/')[0]), os.path.join(extdir, xxx)) | download tar.gz from somewhere. xxx is name.
url is given by repos above | setup.py | download | GabrielJie/PyMFEM | 1 | python | def download(xxx):
'\n download tar.gz from somewhere. xxx is name.\n url is given by repos above\n '
from urllib import request
import tarfile
if os.path.exists(os.path.join(extdir, xxx)):
print((('Download ' + xxx) + ' skipped. Use clean --all-exts if needed'))
return
url = repo_releases[xxx]
print('Downloading :', url)
ftpstream = request.urlopen(url)
targz = tarfile.open(fileobj=ftpstream, mode='r|gz')
targz.extractall(path=extdir)
os.rename(os.path.join(extdir, targz.getnames()[0].split('/')[0]), os.path.join(extdir, xxx)) | def download(xxx):
'\n download tar.gz from somewhere. xxx is name.\n url is given by repos above\n '
from urllib import request
import tarfile
if os.path.exists(os.path.join(extdir, xxx)):
print((('Download ' + xxx) + ' skipped. Use clean --all-exts if needed'))
return
url = repo_releases[xxx]
print('Downloading :', url)
ftpstream = request.urlopen(url)
targz = tarfile.open(fileobj=ftpstream, mode='r|gz')
targz.extractall(path=extdir)
os.rename(os.path.join(extdir, targz.getnames()[0].split('/')[0]), os.path.join(extdir, xxx))<|docstring|>download tar.gz from somewhere. xxx is name.
url is given by repos above<|endoftext|> |
a2eed0fa0d3935937b9c8490856322b99b9dc850def470da94fe71be345a92f2 | def cmake(path, **kwargs):
'\n run cmake. must be called in the target directory\n '
command = ['cmake', path]
for (key, value) in kwargs.items():
command.append(((('-' + key) + '=') + value))
make_call(command) | run cmake. must be called in the target directory | setup.py | cmake | GabrielJie/PyMFEM | 1 | python | def cmake(path, **kwargs):
'\n \n '
command = ['cmake', path]
for (key, value) in kwargs.items():
command.append(((('-' + key) + '=') + value))
make_call(command) | def cmake(path, **kwargs):
'\n \n '
command = ['cmake', path]
for (key, value) in kwargs.items():
command.append(((('-' + key) + '=') + value))
make_call(command)<|docstring|>run cmake. must be called in the target directory<|endoftext|> |
f4284cc90036a235fe39124d8479e81f04cb85ff08f6ea40b6594593eecc5431 | def cmake_make_hypre():
'\n build hypre\n '
if verbose:
print('Building hypre')
cmbuild = 'cmbuild'
path = os.path.join(extdir, 'hypre', 'src', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
pwd = chdir(path)
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DHYPRE_INSTALL_PREFIX': hypre_prefix, 'DHYPRE_ENABLE_SHARED': '1', 'DCMAKE_INSTALL_PREFIX': hypre_prefix, 'DCMAKE_INSTALL_NAME_DIR': os.path.join(hypre_prefix, 'lib'), 'DCMAKE_C_COMPILER': mpicc_command}
cmake('..', **cmake_opts)
make('hypre')
make_install('hypre')
os.chdir(pwd) | build hypre | setup.py | cmake_make_hypre | GabrielJie/PyMFEM | 1 | python | def cmake_make_hypre():
'\n \n '
if verbose:
print('Building hypre')
cmbuild = 'cmbuild'
path = os.path.join(extdir, 'hypre', 'src', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
pwd = chdir(path)
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DHYPRE_INSTALL_PREFIX': hypre_prefix, 'DHYPRE_ENABLE_SHARED': '1', 'DCMAKE_INSTALL_PREFIX': hypre_prefix, 'DCMAKE_INSTALL_NAME_DIR': os.path.join(hypre_prefix, 'lib'), 'DCMAKE_C_COMPILER': mpicc_command}
cmake('..', **cmake_opts)
make('hypre')
make_install('hypre')
os.chdir(pwd) | def cmake_make_hypre():
'\n \n '
if verbose:
print('Building hypre')
cmbuild = 'cmbuild'
path = os.path.join(extdir, 'hypre', 'src', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
pwd = chdir(path)
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DHYPRE_INSTALL_PREFIX': hypre_prefix, 'DHYPRE_ENABLE_SHARED': '1', 'DCMAKE_INSTALL_PREFIX': hypre_prefix, 'DCMAKE_INSTALL_NAME_DIR': os.path.join(hypre_prefix, 'lib'), 'DCMAKE_C_COMPILER': mpicc_command}
cmake('..', **cmake_opts)
make('hypre')
make_install('hypre')
os.chdir(pwd)<|docstring|>build hypre<|endoftext|> |
f770a8dd22321090080fd6031eb65d33333db38b6cb8046ff074b5a785bae1a6 | def make_metis(use_int64=False, use_real64=False):
'\n build metis\n '
if verbose:
print('Building metis')
path = os.path.join(extdir, 'metis')
if (not os.path.exists(path)):
assert False, 'metis is not downloaded'
pwd = chdir(path)
sed_command = find_command('sed')
if (sed_command is None):
assert False, 'sed is not foudn'
if use_int64:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 32/#define IDXTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 64/#define IDXTYPEWIDTH 32/g', 'include/metis.h']
if use_real64:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 32/#define REALTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 64/#define REALTYPEWIDTH 32/g', 'include/metis.h']
make_call(command)
command = ['make', 'config', 'shared=1', ('prefix=' + metis_prefix), ('cc=' + cc_command)]
make_call(command)
make('metis')
make_install('metis')
if (platform == 'darwin'):
command = ['install_name_tool', '-id', os.path.join(metis_prefix, 'lib', 'libmetis.dylib'), os.path.join(metis_prefix, 'lib', 'libmetis.dylib')]
make_call(command)
os.chdir(pwd) | build metis | setup.py | make_metis | GabrielJie/PyMFEM | 1 | python | def make_metis(use_int64=False, use_real64=False):
'\n \n '
if verbose:
print('Building metis')
path = os.path.join(extdir, 'metis')
if (not os.path.exists(path)):
assert False, 'metis is not downloaded'
pwd = chdir(path)
sed_command = find_command('sed')
if (sed_command is None):
assert False, 'sed is not foudn'
if use_int64:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 32/#define IDXTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 64/#define IDXTYPEWIDTH 32/g', 'include/metis.h']
if use_real64:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 32/#define REALTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 64/#define REALTYPEWIDTH 32/g', 'include/metis.h']
make_call(command)
command = ['make', 'config', 'shared=1', ('prefix=' + metis_prefix), ('cc=' + cc_command)]
make_call(command)
make('metis')
make_install('metis')
if (platform == 'darwin'):
command = ['install_name_tool', '-id', os.path.join(metis_prefix, 'lib', 'libmetis.dylib'), os.path.join(metis_prefix, 'lib', 'libmetis.dylib')]
make_call(command)
os.chdir(pwd) | def make_metis(use_int64=False, use_real64=False):
'\n \n '
if verbose:
print('Building metis')
path = os.path.join(extdir, 'metis')
if (not os.path.exists(path)):
assert False, 'metis is not downloaded'
pwd = chdir(path)
sed_command = find_command('sed')
if (sed_command is None):
assert False, 'sed is not foudn'
if use_int64:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 32/#define IDXTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define IDXTYPEWIDTH 64/#define IDXTYPEWIDTH 32/g', 'include/metis.h']
if use_real64:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 32/#define REALTYPEWIDTH 64/g', 'include/metis.h']
else:
command = [sed_command, '-i', 's/#define REALTYPEWIDTH 64/#define REALTYPEWIDTH 32/g', 'include/metis.h']
make_call(command)
command = ['make', 'config', 'shared=1', ('prefix=' + metis_prefix), ('cc=' + cc_command)]
make_call(command)
make('metis')
make_install('metis')
if (platform == 'darwin'):
command = ['install_name_tool', '-id', os.path.join(metis_prefix, 'lib', 'libmetis.dylib'), os.path.join(metis_prefix, 'lib', 'libmetis.dylib')]
make_call(command)
os.chdir(pwd)<|docstring|>build metis<|endoftext|> |
7ba5b6999163343e2d2a02b6f1ed747261c41089e09522abf9247f28bc7de53b | def cmake_make_mfem(serial=True):
'\n build MFEM\n '
cmbuild = ('cmbuild_ser' if serial else 'cmbuild_par')
path = os.path.join(extdir, 'mfem', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
ldflags = (os.getenv('LDFLAGS') if (os.getenv('LDFLAGS') is not None) else '')
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DMFEM_ENABLE_EXAMPLES': '1', 'DMFEM_ENABLE_MINIAPPS': '1', 'DCMAKE_SHARED_LINKER_FLAGS': ldflags, 'DMFEM_USE_ZLIB': '1', 'DCMAKE_CXX_FLAGS': cxx11_flag}
if serial:
cmake_opts['DCMAKE_CXX_COMPILER'] = cxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '1'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfems_prefix
else:
cmake_opts['DCMAKE_CXX_COMPILER'] = mpicxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '0'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfemp_prefix
cmake_opts['DMFEM_USE_MPI'] = '1'
cmake_opts['DMFEM_USE_METIS_5'] = '1'
cmake_opts['DHYPRE_DIR'] = hypre_prefix
cmake_opts['DMETIS_DIR'] = metis_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
ldflags = ((('-L' + metislibpath) + ' ') + ldflags)
ldflags = ((('-L' + hyprelibpath) + ' ') + ldflags)
cmake_opts['DCMAKE_SHARED_LINKER_FLAGS'] = ldflags
cmake_opts['DCMAKE_EXE_LINKER_FLAGS'] = ldflags
if enable_strumpack:
cmake_opts['DMFEM_USE_STRUMPACK'] = '1'
cmake_opts['DSTRUMPACK_DIR'] = strumpack_prefix
if enable_pumi:
cmake_opts['DMFEM_USE_PUMI'] = '1'
cmake_opts['DPUMI_DIR'] = pumi_prefix
if enable_cuda:
cmake_opts['DMFEM_USE_CUDA'] = '1'
if enable_libceed:
cmake_opts['DMFEM_USE_CEED'] = '1'
cmake_opts['DCEED_DIR'] = libceed_prefix
if enable_gslib:
if serial:
pass
else:
cmake_opts['DMFEM_USE_GSLIB'] = '1'
cmake_opts['DGSLIB_DIR'] = gslibp_prefix
pwd = chdir(path)
cmake('..', **cmake_opts)
txt = ('serial' if serial else 'parallel')
make(('mfem_' + txt))
make_install(('mfem_' + txt))
os.chdir(pwd) | build MFEM | setup.py | cmake_make_mfem | GabrielJie/PyMFEM | 1 | python | def cmake_make_mfem(serial=True):
'\n \n '
cmbuild = ('cmbuild_ser' if serial else 'cmbuild_par')
path = os.path.join(extdir, 'mfem', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
ldflags = (os.getenv('LDFLAGS') if (os.getenv('LDFLAGS') is not None) else )
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DMFEM_ENABLE_EXAMPLES': '1', 'DMFEM_ENABLE_MINIAPPS': '1', 'DCMAKE_SHARED_LINKER_FLAGS': ldflags, 'DMFEM_USE_ZLIB': '1', 'DCMAKE_CXX_FLAGS': cxx11_flag}
if serial:
cmake_opts['DCMAKE_CXX_COMPILER'] = cxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '1'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfems_prefix
else:
cmake_opts['DCMAKE_CXX_COMPILER'] = mpicxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '0'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfemp_prefix
cmake_opts['DMFEM_USE_MPI'] = '1'
cmake_opts['DMFEM_USE_METIS_5'] = '1'
cmake_opts['DHYPRE_DIR'] = hypre_prefix
cmake_opts['DMETIS_DIR'] = metis_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
ldflags = ((('-L' + metislibpath) + ' ') + ldflags)
ldflags = ((('-L' + hyprelibpath) + ' ') + ldflags)
cmake_opts['DCMAKE_SHARED_LINKER_FLAGS'] = ldflags
cmake_opts['DCMAKE_EXE_LINKER_FLAGS'] = ldflags
if enable_strumpack:
cmake_opts['DMFEM_USE_STRUMPACK'] = '1'
cmake_opts['DSTRUMPACK_DIR'] = strumpack_prefix
if enable_pumi:
cmake_opts['DMFEM_USE_PUMI'] = '1'
cmake_opts['DPUMI_DIR'] = pumi_prefix
if enable_cuda:
cmake_opts['DMFEM_USE_CUDA'] = '1'
if enable_libceed:
cmake_opts['DMFEM_USE_CEED'] = '1'
cmake_opts['DCEED_DIR'] = libceed_prefix
if enable_gslib:
if serial:
pass
else:
cmake_opts['DMFEM_USE_GSLIB'] = '1'
cmake_opts['DGSLIB_DIR'] = gslibp_prefix
pwd = chdir(path)
cmake('..', **cmake_opts)
txt = ('serial' if serial else 'parallel')
make(('mfem_' + txt))
make_install(('mfem_' + txt))
os.chdir(pwd) | def cmake_make_mfem(serial=True):
'\n \n '
cmbuild = ('cmbuild_ser' if serial else 'cmbuild_par')
path = os.path.join(extdir, 'mfem', cmbuild)
if os.path.exists(path):
print('working directory already exists!')
else:
os.makedirs(path)
ldflags = (os.getenv('LDFLAGS') if (os.getenv('LDFLAGS') is not None) else )
cmake_opts = {'DCMAKE_VERBOSE_MAKEFILE': '1', 'DBUILD_SHARED_LIBS': '1', 'DMFEM_ENABLE_EXAMPLES': '1', 'DMFEM_ENABLE_MINIAPPS': '1', 'DCMAKE_SHARED_LINKER_FLAGS': ldflags, 'DMFEM_USE_ZLIB': '1', 'DCMAKE_CXX_FLAGS': cxx11_flag}
if serial:
cmake_opts['DCMAKE_CXX_COMPILER'] = cxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '1'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfems_prefix
else:
cmake_opts['DCMAKE_CXX_COMPILER'] = mpicxx_command
cmake_opts['DMFEM_USE_EXCEPTIONS'] = '0'
cmake_opts['DCMAKE_INSTALL_PREFIX'] = mfemp_prefix
cmake_opts['DMFEM_USE_MPI'] = '1'
cmake_opts['DMFEM_USE_METIS_5'] = '1'
cmake_opts['DHYPRE_DIR'] = hypre_prefix
cmake_opts['DMETIS_DIR'] = metis_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
ldflags = ((('-L' + metislibpath) + ' ') + ldflags)
ldflags = ((('-L' + hyprelibpath) + ' ') + ldflags)
cmake_opts['DCMAKE_SHARED_LINKER_FLAGS'] = ldflags
cmake_opts['DCMAKE_EXE_LINKER_FLAGS'] = ldflags
if enable_strumpack:
cmake_opts['DMFEM_USE_STRUMPACK'] = '1'
cmake_opts['DSTRUMPACK_DIR'] = strumpack_prefix
if enable_pumi:
cmake_opts['DMFEM_USE_PUMI'] = '1'
cmake_opts['DPUMI_DIR'] = pumi_prefix
if enable_cuda:
cmake_opts['DMFEM_USE_CUDA'] = '1'
if enable_libceed:
cmake_opts['DMFEM_USE_CEED'] = '1'
cmake_opts['DCEED_DIR'] = libceed_prefix
if enable_gslib:
if serial:
pass
else:
cmake_opts['DMFEM_USE_GSLIB'] = '1'
cmake_opts['DGSLIB_DIR'] = gslibp_prefix
pwd = chdir(path)
cmake('..', **cmake_opts)
txt = ('serial' if serial else 'parallel')
make(('mfem_' + txt))
make_install(('mfem_' + txt))
os.chdir(pwd)<|docstring|>build MFEM<|endoftext|> |
65dd887ab0c08e8a244d80df4f4eb5032d5ec5c81574b7d205071e4624092d79 | def write_setup_local():
'\n create setup_local.py. parameters written here will be read\n by setup.py in mfem._ser and mfem._par\n '
import numpy
mfemser = mfems_prefix
mfempar = mfemp_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
params = {'cxx_ser': cxx_command, 'cc_ser': cc_command, 'cxx_par': mpicxx_command, 'cc_par': mpicc_command, 'whole_archive': '--whole-archive', 'no_whole_archive': '--no-whole-archive', 'nocompactunwind': '', 'swigflag': '-Wall -c++ -python -fastproxy -olddefs -keyword', 'hypreinc': os.path.join(hypre_prefix, 'include'), 'hyprelib': hyprelibpath, 'metisinc': os.path.join(metis_prefix, 'include'), 'metis5lib': metislibpath, 'numpync': numpy.get_include(), 'mfembuilddir': os.path.join(mfempar, 'include'), 'mfemincdir': os.path.join(mfempar, 'include', 'mfem'), 'mfemlnkdir': os.path.join(mfempar, 'lib'), 'mfemserbuilddir': os.path.join(mfemser, 'include'), 'mfemserincdir': os.path.join(mfemser, 'include', 'mfem'), 'mfemserlnkdir': os.path.join(mfemser, 'lib'), 'mfemsrcdir': os.path.join(mfem_source), 'add_pumi': '', 'add_strumpack': '', 'add_cuda': '', 'add_libceed': '', 'add_gslib': '', 'add_gslibp': '', 'add_gslibs': '', 'libceedinc': os.path.join(libceed_prefix, 'include'), 'gslibsinc': os.path.join(gslibs_prefix, 'include'), 'gslibpinc': os.path.join(gslibp_prefix, 'include'), 'cxx11flag': cxx11_flag}
try:
import mpi4py
params['mpi4pyinc'] = mpi4py.get_include()
except ImportError:
params['mpi4pyinc'] = ''
def add_extra(xxx):
params[('add_' + xxx)] = '1'
params[(xxx + 'inc')] = os.path.join(globals()[(xxx + '_prefix')], 'include')
params[(xxx + 'lib')] = os.path.join(globals()[(xxx + '_prefix')], 'lib')
if enable_pumi:
add_extra('pumi')
if enable_strumpack:
add_extra('strumpack')
if enable_cuda:
add_extra('cuda')
if enable_libceed:
add_extra('libceed')
if enable_gslib:
add_extra('gslibp')
pwd = chdir(rootdir)
fid = open('setup_local.py', 'w')
fid.write('# setup_local.py \n')
fid.write('# generated from setup.py\n')
fid.write('# do not edit this directly\n')
for (key, value) in params.items():
text = (((key.lower() + ' = "') + value) + '"')
fid.write((text + '\n'))
fid.close()
os.chdir(pwd) | create setup_local.py. parameters written here will be read
by setup.py in mfem._ser and mfem._par | setup.py | write_setup_local | GabrielJie/PyMFEM | 1 | python | def write_setup_local():
'\n create setup_local.py. parameters written here will be read\n by setup.py in mfem._ser and mfem._par\n '
import numpy
mfemser = mfems_prefix
mfempar = mfemp_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
params = {'cxx_ser': cxx_command, 'cc_ser': cc_command, 'cxx_par': mpicxx_command, 'cc_par': mpicc_command, 'whole_archive': '--whole-archive', 'no_whole_archive': '--no-whole-archive', 'nocompactunwind': , 'swigflag': '-Wall -c++ -python -fastproxy -olddefs -keyword', 'hypreinc': os.path.join(hypre_prefix, 'include'), 'hyprelib': hyprelibpath, 'metisinc': os.path.join(metis_prefix, 'include'), 'metis5lib': metislibpath, 'numpync': numpy.get_include(), 'mfembuilddir': os.path.join(mfempar, 'include'), 'mfemincdir': os.path.join(mfempar, 'include', 'mfem'), 'mfemlnkdir': os.path.join(mfempar, 'lib'), 'mfemserbuilddir': os.path.join(mfemser, 'include'), 'mfemserincdir': os.path.join(mfemser, 'include', 'mfem'), 'mfemserlnkdir': os.path.join(mfemser, 'lib'), 'mfemsrcdir': os.path.join(mfem_source), 'add_pumi': , 'add_strumpack': , 'add_cuda': , 'add_libceed': , 'add_gslib': , 'add_gslibp': , 'add_gslibs': , 'libceedinc': os.path.join(libceed_prefix, 'include'), 'gslibsinc': os.path.join(gslibs_prefix, 'include'), 'gslibpinc': os.path.join(gslibp_prefix, 'include'), 'cxx11flag': cxx11_flag}
try:
import mpi4py
params['mpi4pyinc'] = mpi4py.get_include()
except ImportError:
params['mpi4pyinc'] =
def add_extra(xxx):
params[('add_' + xxx)] = '1'
params[(xxx + 'inc')] = os.path.join(globals()[(xxx + '_prefix')], 'include')
params[(xxx + 'lib')] = os.path.join(globals()[(xxx + '_prefix')], 'lib')
if enable_pumi:
add_extra('pumi')
if enable_strumpack:
add_extra('strumpack')
if enable_cuda:
add_extra('cuda')
if enable_libceed:
add_extra('libceed')
if enable_gslib:
add_extra('gslibp')
pwd = chdir(rootdir)
fid = open('setup_local.py', 'w')
fid.write('# setup_local.py \n')
fid.write('# generated from setup.py\n')
fid.write('# do not edit this directly\n')
for (key, value) in params.items():
text = (((key.lower() + ' = "') + value) + '"')
fid.write((text + '\n'))
fid.close()
os.chdir(pwd) | def write_setup_local():
'\n create setup_local.py. parameters written here will be read\n by setup.py in mfem._ser and mfem._par\n '
import numpy
mfemser = mfems_prefix
mfempar = mfemp_prefix
hyprelibpath = os.path.dirname(find_libpath_from_prefix('HYPRE', hypre_prefix))
metislibpath = os.path.dirname(find_libpath_from_prefix('metis', metis_prefix))
params = {'cxx_ser': cxx_command, 'cc_ser': cc_command, 'cxx_par': mpicxx_command, 'cc_par': mpicc_command, 'whole_archive': '--whole-archive', 'no_whole_archive': '--no-whole-archive', 'nocompactunwind': , 'swigflag': '-Wall -c++ -python -fastproxy -olddefs -keyword', 'hypreinc': os.path.join(hypre_prefix, 'include'), 'hyprelib': hyprelibpath, 'metisinc': os.path.join(metis_prefix, 'include'), 'metis5lib': metislibpath, 'numpync': numpy.get_include(), 'mfembuilddir': os.path.join(mfempar, 'include'), 'mfemincdir': os.path.join(mfempar, 'include', 'mfem'), 'mfemlnkdir': os.path.join(mfempar, 'lib'), 'mfemserbuilddir': os.path.join(mfemser, 'include'), 'mfemserincdir': os.path.join(mfemser, 'include', 'mfem'), 'mfemserlnkdir': os.path.join(mfemser, 'lib'), 'mfemsrcdir': os.path.join(mfem_source), 'add_pumi': , 'add_strumpack': , 'add_cuda': , 'add_libceed': , 'add_gslib': , 'add_gslibp': , 'add_gslibs': , 'libceedinc': os.path.join(libceed_prefix, 'include'), 'gslibsinc': os.path.join(gslibs_prefix, 'include'), 'gslibpinc': os.path.join(gslibp_prefix, 'include'), 'cxx11flag': cxx11_flag}
try:
import mpi4py
params['mpi4pyinc'] = mpi4py.get_include()
except ImportError:
params['mpi4pyinc'] =
def add_extra(xxx):
params[('add_' + xxx)] = '1'
params[(xxx + 'inc')] = os.path.join(globals()[(xxx + '_prefix')], 'include')
params[(xxx + 'lib')] = os.path.join(globals()[(xxx + '_prefix')], 'lib')
if enable_pumi:
add_extra('pumi')
if enable_strumpack:
add_extra('strumpack')
if enable_cuda:
add_extra('cuda')
if enable_libceed:
add_extra('libceed')
if enable_gslib:
add_extra('gslibp')
pwd = chdir(rootdir)
fid = open('setup_local.py', 'w')
fid.write('# setup_local.py \n')
fid.write('# generated from setup.py\n')
fid.write('# do not edit this directly\n')
for (key, value) in params.items():
text = (((key.lower() + ' = "') + value) + '"')
fid.write((text + '\n'))
fid.close()
os.chdir(pwd)<|docstring|>create setup_local.py. parameters written here will be read
by setup.py in mfem._ser and mfem._par<|endoftext|> |
20ecca31a93c2dbcff2de8f871536bb32393d1ca72cb53a980c7fa52fc942edc | def generate_wrapper():
'\n run swig.\n '
if (dry_run or verbose):
print('generating SWIG wrapper')
print('using MFEM source', os.path.abspath(mfem_source))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
def ifiles():
ifiles = os.listdir()
ifiles = [x for x in ifiles if x.endswith('.i')]
ifiles = [x for x in ifiles if (not x.startswith('#'))]
ifiles = [x for x in ifiles if (not x.startswith('.'))]
return ifiles
def check_new(ifile):
wfile = (ifile[:(- 2)] + '_wrap.cxx')
if (not os.path.exists(wfile)):
return True
return (os.path.getmtime(ifile) > os.path.getmtime(wfile))
mfemser = mfems_prefix
mfempar = mfemp_prefix
pwd = chdir(os.path.join(rootdir, 'mfem', 'common'))
command1 = [sys.executable, 'generate_lininteg_ext.py']
command2 = [sys.executable, 'generate_bilininteg_ext.py']
make_call(command1)
make_call(command2)
os.chdir(pwd)
swig_command = (find_command('swig') if (os.getenv('SWIG') is None) else os.getenv('SWIG'))
if (swig_command is None):
assert False, 'SWIG is not installed'
swigflag = '-Wall -c++ -python -fastproxy -olddefs -keyword'.split(' ')
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
serflag = [('-I' + os.path.join(mfemser, 'include')), ('-I' + os.path.join(mfemser, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source))]
for file in ifiles():
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + serflag) + [file])
make_call(command)
if (not build_parallel):
os.chdir(pwd)
return
chdir(os.path.join(rootdir, 'mfem', '_par'))
import mpi4py
parflag = [('-I' + os.path.join(mfempar, 'include')), ('-I' + os.path.join(mfempar, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source)), ('-I' + os.path.join(hypre_prefix, 'include')), ('-I' + os.path.join(metis_prefix, 'include')), ('-I' + mpi4py.get_include())]
if enable_pumi:
parflag.append(('-I' + os.path.join(pumi_prefix, 'include')))
if enable_strumpack:
parflag.append(('-I' + os.path.join(strumpack_prefix, 'include')))
for file in ifiles():
if ((file == 'strumpack.i') and (not enable_strumpack)):
continue
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + parflag) + [file])
make_call(command)
os.chdir(pwd) | run swig. | setup.py | generate_wrapper | GabrielJie/PyMFEM | 1 | python | def generate_wrapper():
'\n \n '
if (dry_run or verbose):
print('generating SWIG wrapper')
print('using MFEM source', os.path.abspath(mfem_source))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
def ifiles():
ifiles = os.listdir()
ifiles = [x for x in ifiles if x.endswith('.i')]
ifiles = [x for x in ifiles if (not x.startswith('#'))]
ifiles = [x for x in ifiles if (not x.startswith('.'))]
return ifiles
def check_new(ifile):
wfile = (ifile[:(- 2)] + '_wrap.cxx')
if (not os.path.exists(wfile)):
return True
return (os.path.getmtime(ifile) > os.path.getmtime(wfile))
mfemser = mfems_prefix
mfempar = mfemp_prefix
pwd = chdir(os.path.join(rootdir, 'mfem', 'common'))
command1 = [sys.executable, 'generate_lininteg_ext.py']
command2 = [sys.executable, 'generate_bilininteg_ext.py']
make_call(command1)
make_call(command2)
os.chdir(pwd)
swig_command = (find_command('swig') if (os.getenv('SWIG') is None) else os.getenv('SWIG'))
if (swig_command is None):
assert False, 'SWIG is not installed'
swigflag = '-Wall -c++ -python -fastproxy -olddefs -keyword'.split(' ')
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
serflag = [('-I' + os.path.join(mfemser, 'include')), ('-I' + os.path.join(mfemser, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source))]
for file in ifiles():
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + serflag) + [file])
make_call(command)
if (not build_parallel):
os.chdir(pwd)
return
chdir(os.path.join(rootdir, 'mfem', '_par'))
import mpi4py
parflag = [('-I' + os.path.join(mfempar, 'include')), ('-I' + os.path.join(mfempar, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source)), ('-I' + os.path.join(hypre_prefix, 'include')), ('-I' + os.path.join(metis_prefix, 'include')), ('-I' + mpi4py.get_include())]
if enable_pumi:
parflag.append(('-I' + os.path.join(pumi_prefix, 'include')))
if enable_strumpack:
parflag.append(('-I' + os.path.join(strumpack_prefix, 'include')))
for file in ifiles():
if ((file == 'strumpack.i') and (not enable_strumpack)):
continue
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + parflag) + [file])
make_call(command)
os.chdir(pwd) | def generate_wrapper():
'\n \n '
if (dry_run or verbose):
print('generating SWIG wrapper')
print('using MFEM source', os.path.abspath(mfem_source))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
def ifiles():
ifiles = os.listdir()
ifiles = [x for x in ifiles if x.endswith('.i')]
ifiles = [x for x in ifiles if (not x.startswith('#'))]
ifiles = [x for x in ifiles if (not x.startswith('.'))]
return ifiles
def check_new(ifile):
wfile = (ifile[:(- 2)] + '_wrap.cxx')
if (not os.path.exists(wfile)):
return True
return (os.path.getmtime(ifile) > os.path.getmtime(wfile))
mfemser = mfems_prefix
mfempar = mfemp_prefix
pwd = chdir(os.path.join(rootdir, 'mfem', 'common'))
command1 = [sys.executable, 'generate_lininteg_ext.py']
command2 = [sys.executable, 'generate_bilininteg_ext.py']
make_call(command1)
make_call(command2)
os.chdir(pwd)
swig_command = (find_command('swig') if (os.getenv('SWIG') is None) else os.getenv('SWIG'))
if (swig_command is None):
assert False, 'SWIG is not installed'
swigflag = '-Wall -c++ -python -fastproxy -olddefs -keyword'.split(' ')
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
serflag = [('-I' + os.path.join(mfemser, 'include')), ('-I' + os.path.join(mfemser, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source))]
for file in ifiles():
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + serflag) + [file])
make_call(command)
if (not build_parallel):
os.chdir(pwd)
return
chdir(os.path.join(rootdir, 'mfem', '_par'))
import mpi4py
parflag = [('-I' + os.path.join(mfempar, 'include')), ('-I' + os.path.join(mfempar, 'include', 'mfem')), ('-I' + os.path.abspath(mfem_source)), ('-I' + os.path.join(hypre_prefix, 'include')), ('-I' + os.path.join(metis_prefix, 'include')), ('-I' + mpi4py.get_include())]
if enable_pumi:
parflag.append(('-I' + os.path.join(pumi_prefix, 'include')))
if enable_strumpack:
parflag.append(('-I' + os.path.join(strumpack_prefix, 'include')))
for file in ifiles():
if ((file == 'strumpack.i') and (not enable_strumpack)):
continue
if (not check_new(file)):
continue
command = ((([swig_command] + swigflag) + parflag) + [file])
make_call(command)
os.chdir(pwd)<|docstring|>run swig.<|endoftext|> |
3f4d2ac3535dee22d04a30b374210ea6a934aaaa530609f350330ad9257594f0 | def make_mfem_wrapper(serial=True):
'\n compile PyMFEM wrapper code\n '
if (dry_run or verbose):
print(('compiling wrapper code, serial=' + str(serial)))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
record_mfem_sha(mfem_source)
write_setup_local()
if serial:
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
else:
pwd = chdir(os.path.join(rootdir, 'mfem', '_par'))
python = sys.executable
command = [python, 'setup.py', 'build_ext', '--inplace']
make_call(command)
os.chdir(pwd) | compile PyMFEM wrapper code | setup.py | make_mfem_wrapper | GabrielJie/PyMFEM | 1 | python | def make_mfem_wrapper(serial=True):
'\n \n '
if (dry_run or verbose):
print(('compiling wrapper code, serial=' + str(serial)))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
record_mfem_sha(mfem_source)
write_setup_local()
if serial:
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
else:
pwd = chdir(os.path.join(rootdir, 'mfem', '_par'))
python = sys.executable
command = [python, 'setup.py', 'build_ext', '--inplace']
make_call(command)
os.chdir(pwd) | def make_mfem_wrapper(serial=True):
'\n \n '
if (dry_run or verbose):
print(('compiling wrapper code, serial=' + str(serial)))
if (not os.path.exists(os.path.abspath(mfem_source))):
assert False, 'MFEM source directory. Use --mfem-source=<path>'
record_mfem_sha(mfem_source)
write_setup_local()
if serial:
pwd = chdir(os.path.join(rootdir, 'mfem', '_ser'))
else:
pwd = chdir(os.path.join(rootdir, 'mfem', '_par'))
python = sys.executable
command = [python, 'setup.py', 'build_ext', '--inplace']
make_call(command)
os.chdir(pwd)<|docstring|>compile PyMFEM wrapper code<|endoftext|> |
83937a422438490cbb90c02fb0acfac243cd8a23ad67288010902502371a8418 | def configure_install(self):
'\n called when install workflow is used\n '
global prefix, dry_run, verbose, ext_prefix
global clean_swig, run_swig, swig_only, skip_install
global build_mfem, build_mfemp, build_parallel, build_serial
global mfem_branch, mfem_source
global build_metis, build_hypre, build_libceed, build_gslib
global mfems_prefix, mfemp_prefix, metis_prefix, hypre_prefix
global cc_command, cxx_command, mpicc_command, mpicxx_command
global metis_64
global enable_cuda, cuda_prefix
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global enable_libceed, libceed_prefix, libceed_only
global enable_gslib, gslibs_prefix, gslibp_prefix, gslib_only
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
if dry_run:
verbose = True
prefix = abspath(self.prefix)
mfem_source = abspath(self.mfem_source)
skip_ext = bool(self.skip_ext)
skip_install = bool(self.build_only)
swig_only = bool(self.swig)
ext_only = bool(self.ext_only)
metis_64 = bool(self.with_metis64)
enable_pumi = bool(self.with_pumi)
enable_strumpack = bool(self.with_strumpack)
enable_cuda = bool(self.with_cuda)
enable_libceed = bool(self.with_libceed)
libceed_only = bool(self.libceed_only)
enable_gslib = bool(self.with_gslib)
gslib_only = bool(self.gslib_only)
build_parallel = bool(self.with_parallel)
build_serial = (not bool(self.no_serial))
run_swig = swig_only
if build_serial:
build_serial = ((not swig_only) and (not ext_only))
if build_parallel:
try:
import mpi4py
except ImportError:
assert False, 'Can not import mpi4py'
if (self.mfem_prefix != ''):
mfem_prefix = abspath(self.mfem_prefix)
mfems_prefix = abspath(self.mfem_prefix)
mfemp_prefix = abspath(self.mfem_prefix)
if (self.mfems_prefix != ''):
mfems_prefix = abspath(self.mfems_prefix)
if (self.mfemp_prefix != ''):
mfemp_prefix = abspath(self.mfemp_prefix)
check = find_libpath_from_prefix('mfem', mfems_prefix)
assert (check != ''), 'libmfem.so is not found in the specified <path>/lib'
check = find_libpath_from_prefix('mfem', mfemp_prefix)
assert (check != ''), 'libmfem.so is not found in the specified <path>/lib'
build_mfem = False
hypre_prefix = mfem_prefix
metis_prefix = mfem_prefix
if (self.mfem_prefix_no_swig != ''):
clean_swig = False
run_swig = False
else:
clean_swig = True
run_swig = True
if swig_only:
clean_swig = False
else:
build_mfem = True
build_mfemp = build_parallel
build_hypre = build_parallel
build_metis = build_parallel
if (ext_prefix == ''):
ext_prefix = external_install_prefix()
hypre_prefix = os.path.join(ext_prefix)
metis_prefix = os.path.join(ext_prefix)
mfem_prefix = ext_prefix
mfems_prefix = os.path.join(ext_prefix, 'ser')
mfemp_prefix = os.path.join(ext_prefix, 'par')
if (self.mfem_branch != ''):
mfem_branch = self.mfem_branch
if (self.hypre_prefix != ''):
check = find_libpath_from_prefix('HYPRE', self.hypre_prefix)
assert (check != ''), 'libHYPRE.so is not found in the specified <path>/lib or lib64'
hypre_prefix = os.path.expanduser(self.hypre_prefix)
build_hypre = False
if (self.metis_prefix != ''):
check = find_libpath_from_prefix('metis', self.metis_prefix)
assert (check != ''), 'libmetis.so is not found in the specified <path>/lib or lib64'
metis_prefix = os.path.expanduser(self.metis_prefix)
build_metis = False
if (enable_libceed or libceed_only):
if (self.libceed_prefix != ''):
libceed_prefix = os.path.expanduser(self.libceed_prefix)
build_libceed = False
else:
libceed_prefix = mfem_prefix
build_libceed = True
if (enable_gslib or gslib_only):
if (self.gslib_prefix != ''):
build_gslib = False
gslibs_prefix = os.path.expanduser(self.gslib_prefix)
gslibp_prefix = os.path.expanduser(self.gslib_prefix)
else:
gslibs_prefix = mfems_prefix
gslibp_prefix = mfemp_prefix
build_gslib = True
if enable_pumi:
run_swig = True
if enable_strumpack:
run_swig = True
if (self.pumi_prefix != ''):
pumi_prefix = abspath(self.pumi_prefix)
else:
pumi_prefix = mfem_prefix
if (self.strumpack_prefix != ''):
strumpack_prefix = abspath(self.strumpack_prefix)
else:
strumpack_prefix = mfem_prefix
if enable_cuda:
nvcc = find_command('nvcc')
cuda_prefix = os.path.dirname(os.path.dirname(nvcc))
if (self.CC != ''):
cc_command = self.CC
if (self.CXX != ''):
cxx_command = self.CXX
if (self.MPICC != ''):
mpicc_command = self.MPICC
if (self.MPICXX != ''):
mpicxx_command = self.MPICXX
if skip_ext:
build_metis = False
build_hypre = False
build_mfem = False
build_mfemp = False
build_libceed = False
build_gslib = False
if swig_only:
build_serial = False
if ext_only:
clean_swig = False
run_swig = False
build_serial = False
build_parallel = False
skip_install = True
if libceed_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_gslib = False
build_serial = False
build_parallel = False
build_libceed = True
skip_install = True
if gslib_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_serial = False
build_libceed = False
build_gslib = True
skip_install = True
global is_configured
is_configured = True | called when install workflow is used | setup.py | configure_install | GabrielJie/PyMFEM | 1 | python | def configure_install(self):
'\n \n '
global prefix, dry_run, verbose, ext_prefix
global clean_swig, run_swig, swig_only, skip_install
global build_mfem, build_mfemp, build_parallel, build_serial
global mfem_branch, mfem_source
global build_metis, build_hypre, build_libceed, build_gslib
global mfems_prefix, mfemp_prefix, metis_prefix, hypre_prefix
global cc_command, cxx_command, mpicc_command, mpicxx_command
global metis_64
global enable_cuda, cuda_prefix
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global enable_libceed, libceed_prefix, libceed_only
global enable_gslib, gslibs_prefix, gslibp_prefix, gslib_only
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
if dry_run:
verbose = True
prefix = abspath(self.prefix)
mfem_source = abspath(self.mfem_source)
skip_ext = bool(self.skip_ext)
skip_install = bool(self.build_only)
swig_only = bool(self.swig)
ext_only = bool(self.ext_only)
metis_64 = bool(self.with_metis64)
enable_pumi = bool(self.with_pumi)
enable_strumpack = bool(self.with_strumpack)
enable_cuda = bool(self.with_cuda)
enable_libceed = bool(self.with_libceed)
libceed_only = bool(self.libceed_only)
enable_gslib = bool(self.with_gslib)
gslib_only = bool(self.gslib_only)
build_parallel = bool(self.with_parallel)
build_serial = (not bool(self.no_serial))
run_swig = swig_only
if build_serial:
build_serial = ((not swig_only) and (not ext_only))
if build_parallel:
try:
import mpi4py
except ImportError:
assert False, 'Can not import mpi4py'
if (self.mfem_prefix != ):
mfem_prefix = abspath(self.mfem_prefix)
mfems_prefix = abspath(self.mfem_prefix)
mfemp_prefix = abspath(self.mfem_prefix)
if (self.mfems_prefix != ):
mfems_prefix = abspath(self.mfems_prefix)
if (self.mfemp_prefix != ):
mfemp_prefix = abspath(self.mfemp_prefix)
check = find_libpath_from_prefix('mfem', mfems_prefix)
assert (check != ), 'libmfem.so is not found in the specified <path>/lib'
check = find_libpath_from_prefix('mfem', mfemp_prefix)
assert (check != ), 'libmfem.so is not found in the specified <path>/lib'
build_mfem = False
hypre_prefix = mfem_prefix
metis_prefix = mfem_prefix
if (self.mfem_prefix_no_swig != ):
clean_swig = False
run_swig = False
else:
clean_swig = True
run_swig = True
if swig_only:
clean_swig = False
else:
build_mfem = True
build_mfemp = build_parallel
build_hypre = build_parallel
build_metis = build_parallel
if (ext_prefix == ):
ext_prefix = external_install_prefix()
hypre_prefix = os.path.join(ext_prefix)
metis_prefix = os.path.join(ext_prefix)
mfem_prefix = ext_prefix
mfems_prefix = os.path.join(ext_prefix, 'ser')
mfemp_prefix = os.path.join(ext_prefix, 'par')
if (self.mfem_branch != ):
mfem_branch = self.mfem_branch
if (self.hypre_prefix != ):
check = find_libpath_from_prefix('HYPRE', self.hypre_prefix)
assert (check != ), 'libHYPRE.so is not found in the specified <path>/lib or lib64'
hypre_prefix = os.path.expanduser(self.hypre_prefix)
build_hypre = False
if (self.metis_prefix != ):
check = find_libpath_from_prefix('metis', self.metis_prefix)
assert (check != ), 'libmetis.so is not found in the specified <path>/lib or lib64'
metis_prefix = os.path.expanduser(self.metis_prefix)
build_metis = False
if (enable_libceed or libceed_only):
if (self.libceed_prefix != ):
libceed_prefix = os.path.expanduser(self.libceed_prefix)
build_libceed = False
else:
libceed_prefix = mfem_prefix
build_libceed = True
if (enable_gslib or gslib_only):
if (self.gslib_prefix != ):
build_gslib = False
gslibs_prefix = os.path.expanduser(self.gslib_prefix)
gslibp_prefix = os.path.expanduser(self.gslib_prefix)
else:
gslibs_prefix = mfems_prefix
gslibp_prefix = mfemp_prefix
build_gslib = True
if enable_pumi:
run_swig = True
if enable_strumpack:
run_swig = True
if (self.pumi_prefix != ):
pumi_prefix = abspath(self.pumi_prefix)
else:
pumi_prefix = mfem_prefix
if (self.strumpack_prefix != ):
strumpack_prefix = abspath(self.strumpack_prefix)
else:
strumpack_prefix = mfem_prefix
if enable_cuda:
nvcc = find_command('nvcc')
cuda_prefix = os.path.dirname(os.path.dirname(nvcc))
if (self.CC != ):
cc_command = self.CC
if (self.CXX != ):
cxx_command = self.CXX
if (self.MPICC != ):
mpicc_command = self.MPICC
if (self.MPICXX != ):
mpicxx_command = self.MPICXX
if skip_ext:
build_metis = False
build_hypre = False
build_mfem = False
build_mfemp = False
build_libceed = False
build_gslib = False
if swig_only:
build_serial = False
if ext_only:
clean_swig = False
run_swig = False
build_serial = False
build_parallel = False
skip_install = True
if libceed_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_gslib = False
build_serial = False
build_parallel = False
build_libceed = True
skip_install = True
if gslib_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_serial = False
build_libceed = False
build_gslib = True
skip_install = True
global is_configured
is_configured = True | def configure_install(self):
'\n \n '
global prefix, dry_run, verbose, ext_prefix
global clean_swig, run_swig, swig_only, skip_install
global build_mfem, build_mfemp, build_parallel, build_serial
global mfem_branch, mfem_source
global build_metis, build_hypre, build_libceed, build_gslib
global mfems_prefix, mfemp_prefix, metis_prefix, hypre_prefix
global cc_command, cxx_command, mpicc_command, mpicxx_command
global metis_64
global enable_cuda, cuda_prefix
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global enable_libceed, libceed_prefix, libceed_only
global enable_gslib, gslibs_prefix, gslibp_prefix, gslib_only
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
if dry_run:
verbose = True
prefix = abspath(self.prefix)
mfem_source = abspath(self.mfem_source)
skip_ext = bool(self.skip_ext)
skip_install = bool(self.build_only)
swig_only = bool(self.swig)
ext_only = bool(self.ext_only)
metis_64 = bool(self.with_metis64)
enable_pumi = bool(self.with_pumi)
enable_strumpack = bool(self.with_strumpack)
enable_cuda = bool(self.with_cuda)
enable_libceed = bool(self.with_libceed)
libceed_only = bool(self.libceed_only)
enable_gslib = bool(self.with_gslib)
gslib_only = bool(self.gslib_only)
build_parallel = bool(self.with_parallel)
build_serial = (not bool(self.no_serial))
run_swig = swig_only
if build_serial:
build_serial = ((not swig_only) and (not ext_only))
if build_parallel:
try:
import mpi4py
except ImportError:
assert False, 'Can not import mpi4py'
if (self.mfem_prefix != ):
mfem_prefix = abspath(self.mfem_prefix)
mfems_prefix = abspath(self.mfem_prefix)
mfemp_prefix = abspath(self.mfem_prefix)
if (self.mfems_prefix != ):
mfems_prefix = abspath(self.mfems_prefix)
if (self.mfemp_prefix != ):
mfemp_prefix = abspath(self.mfemp_prefix)
check = find_libpath_from_prefix('mfem', mfems_prefix)
assert (check != ), 'libmfem.so is not found in the specified <path>/lib'
check = find_libpath_from_prefix('mfem', mfemp_prefix)
assert (check != ), 'libmfem.so is not found in the specified <path>/lib'
build_mfem = False
hypre_prefix = mfem_prefix
metis_prefix = mfem_prefix
if (self.mfem_prefix_no_swig != ):
clean_swig = False
run_swig = False
else:
clean_swig = True
run_swig = True
if swig_only:
clean_swig = False
else:
build_mfem = True
build_mfemp = build_parallel
build_hypre = build_parallel
build_metis = build_parallel
if (ext_prefix == ):
ext_prefix = external_install_prefix()
hypre_prefix = os.path.join(ext_prefix)
metis_prefix = os.path.join(ext_prefix)
mfem_prefix = ext_prefix
mfems_prefix = os.path.join(ext_prefix, 'ser')
mfemp_prefix = os.path.join(ext_prefix, 'par')
if (self.mfem_branch != ):
mfem_branch = self.mfem_branch
if (self.hypre_prefix != ):
check = find_libpath_from_prefix('HYPRE', self.hypre_prefix)
assert (check != ), 'libHYPRE.so is not found in the specified <path>/lib or lib64'
hypre_prefix = os.path.expanduser(self.hypre_prefix)
build_hypre = False
if (self.metis_prefix != ):
check = find_libpath_from_prefix('metis', self.metis_prefix)
assert (check != ), 'libmetis.so is not found in the specified <path>/lib or lib64'
metis_prefix = os.path.expanduser(self.metis_prefix)
build_metis = False
if (enable_libceed or libceed_only):
if (self.libceed_prefix != ):
libceed_prefix = os.path.expanduser(self.libceed_prefix)
build_libceed = False
else:
libceed_prefix = mfem_prefix
build_libceed = True
if (enable_gslib or gslib_only):
if (self.gslib_prefix != ):
build_gslib = False
gslibs_prefix = os.path.expanduser(self.gslib_prefix)
gslibp_prefix = os.path.expanduser(self.gslib_prefix)
else:
gslibs_prefix = mfems_prefix
gslibp_prefix = mfemp_prefix
build_gslib = True
if enable_pumi:
run_swig = True
if enable_strumpack:
run_swig = True
if (self.pumi_prefix != ):
pumi_prefix = abspath(self.pumi_prefix)
else:
pumi_prefix = mfem_prefix
if (self.strumpack_prefix != ):
strumpack_prefix = abspath(self.strumpack_prefix)
else:
strumpack_prefix = mfem_prefix
if enable_cuda:
nvcc = find_command('nvcc')
cuda_prefix = os.path.dirname(os.path.dirname(nvcc))
if (self.CC != ):
cc_command = self.CC
if (self.CXX != ):
cxx_command = self.CXX
if (self.MPICC != ):
mpicc_command = self.MPICC
if (self.MPICXX != ):
mpicxx_command = self.MPICXX
if skip_ext:
build_metis = False
build_hypre = False
build_mfem = False
build_mfemp = False
build_libceed = False
build_gslib = False
if swig_only:
build_serial = False
if ext_only:
clean_swig = False
run_swig = False
build_serial = False
build_parallel = False
skip_install = True
if libceed_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_gslib = False
build_serial = False
build_parallel = False
build_libceed = True
skip_install = True
if gslib_only:
clean_swig = False
run_swig = False
build_mfem = False
build_mfemp = False
build_metis = False
build_hypre = False
build_serial = False
build_libceed = False
build_gslib = True
skip_install = True
global is_configured
is_configured = True<|docstring|>called when install workflow is used<|endoftext|> |
c8a12a1fddefe0320dd175e62516979b756e92e5adeb56e398ad773f3f62930b | def configure_bdist(self):
'\n called when bdist workflow is used\n '
global prefix, dry_run, verbose, run_swig
global build_mfem, build_parallel, build_serial
global mfem_branch, mfem_source
global cc_command, cxx_command, mpicc_command, mpicxx_command
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global do_bdist_wheel
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
prefix = abspath(self.bdist_dir)
run_swig = False
build_parallel = False
build_serial = True
global is_configured
is_configured = True
do_bdist_wheel = True
mfem_source = './external/mfem' | called when bdist workflow is used | setup.py | configure_bdist | GabrielJie/PyMFEM | 1 | python | def configure_bdist(self):
'\n \n '
global prefix, dry_run, verbose, run_swig
global build_mfem, build_parallel, build_serial
global mfem_branch, mfem_source
global cc_command, cxx_command, mpicc_command, mpicxx_command
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global do_bdist_wheel
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
prefix = abspath(self.bdist_dir)
run_swig = False
build_parallel = False
build_serial = True
global is_configured
is_configured = True
do_bdist_wheel = True
mfem_source = './external/mfem' | def configure_bdist(self):
'\n \n '
global prefix, dry_run, verbose, run_swig
global build_mfem, build_parallel, build_serial
global mfem_branch, mfem_source
global cc_command, cxx_command, mpicc_command, mpicxx_command
global enable_pumi, pumi_prefix
global enable_strumpack, strumpack_prefix
global do_bdist_wheel
dry_run = (bool(self.dry_run) if (dry_run == (- 1)) else dry_run)
verbose = (bool(self.verbose) if (verbose == (- 1)) else verbose)
prefix = abspath(self.bdist_dir)
run_swig = False
build_parallel = False
build_serial = True
global is_configured
is_configured = True
do_bdist_wheel = True
mfem_source = './external/mfem'<|docstring|>called when bdist workflow is used<|endoftext|> |
82dbf36a1bb055392461968bdae93cc65f16b75f1c398f0796218e933fbe3dfe | def _dict_handler(d):
'\n Dictionary to dictionary handler converter.\n\n :param d: Dictionary\n :return: Dictionary handler\n '
return chain.from_iterable(d.items()) | Dictionary to dictionary handler converter.
:param d: Dictionary
:return: Dictionary handler | compss/programming_model/bindings/python/src/pycompss/util/objects/sizer.py | _dict_handler | class-euproject/compss | 2 | python | def _dict_handler(d):
'\n Dictionary to dictionary handler converter.\n\n :param d: Dictionary\n :return: Dictionary handler\n '
return chain.from_iterable(d.items()) | def _dict_handler(d):
'\n Dictionary to dictionary handler converter.\n\n :param d: Dictionary\n :return: Dictionary handler\n '
return chain.from_iterable(d.items())<|docstring|>Dictionary to dictionary handler converter.
:param d: Dictionary
:return: Dictionary handler<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.