Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for file_name in os.listdir(folder):
src_file = os.path.join(folder, file_name)
target_file = os.path.join(entity.FLUME_WORKER_ENTITY_FOLDER, file_name)
self.add_file(src_file, target_file)
def _sorted_hooks(hooks_dict):
result = []
for name in sorted(hooks_dict.keys()):
result.append(hooks_dict[name])
return result
import copy
resource = copy.deepcopy(self._resource)
from bigflow.core.serde import cloudpickle
resource.add_file_from_bytes(
cloudpickle.dumps(_sorted_hooks(self._init_hooks)),
".init_hooks")
resource.add_file_from_bytes(
cloudpickle.dumps(_sorted_hooks(self._fini_hooks)),
".fini_hooks")
self._resource_message = resource.to_proto_message()
self.add_file(src_file, target_file)
def _sorted_hooks(hooks_dict):
result = []
for name in sorted(hooks_dict.keys()):
result.append(hooks_dict[name])
return result
import copy
resource = copy.deepcopy(self._resource)
from bigflow.core.serde import cloudpickle
resource.add_file_from_bytes(
cloudpickle.dumps(_sorted_hooks(self._init_hooks)),
".init_hooks")
resource.add_file_from_bytes(
cloudpickle.dumps(_sorted_hooks(self._fini_hooks)),
".fini_hooks")
self._resource_message = resource.to_proto_message()
def get_entity_config(self):
"""
get_entity_config
"""
return cloudpickle.dumps(self)