parameters: (self)
docstring: Create a backup in /tmp
docstring_summary: Create a backup in /tmp
docstring_tokens: Create a backup in / tmp
function: def create(self):
          """Create a backup in /tmp"""
          if not is_safe_to_remove(self.repository.content.path.local):
              return
          if os.path.exists(self.backup_path):
              shutil.rmtree(self.backup_path)
              while os.path.exists(self.backup_path):
                  sleep(0.1)
          os.makedirs(self.backup_path, exist_ok=True)
  
          for filename in os.listdir(self.repository.content.path.local):
              if filename.endswith(".yaml"):
                  source_file_name = f"{self.repository.content.path.local}/{filename}"
                  target_file_name = f"{self.backup_path}/{filename}"
                  shutil.copyfile(source_file_name, target_file_name)
function_tokens: def create ( self ) : if not is_safe_to_remove ( self . repository . content . path . local ) : return if os . path . exists ( self . backup_path ) : shutil . rmtree ( self . backup_path ) while os . path . exists ( self . backup_path ) : sleep ( 0.1 ) os . makedirs ( self . backup_path , exist_ok = True ) for filename in os . listdir ( self . repository . content . path . local ) : if filename . endswith ( ".yaml" ) : source_file_name = f"{self.repository.content.path.local}/{filename}" target_file_name = f"{self.backup_path}/{filename}" shutil . copyfile ( source_file_name , target_file_name )