original_docstring: 
          Put all files from multiple dir into one
          
docstring: Put all files from multiple dir into one
docstring_tokens: Put all files from multiple dir into one
code: def merge_dirs(self, src, dst, keep_separate=True, keep_parent_directory=False):
          """
          Put all files from multiple dir into one
          """
          os.makedirs(dst, exist_ok=True)
          self.logger.info("Trying to merge all files in {} -> {}".format(src, dst))
  
          for (directory, dirnames, filenames) in os.walk(src):
              for f in dirnames if keep_parent_directory else filenames:
                  file_abs_path = os.path.abspath(os.path.join(directory, f))
                  if os.name == "nt":  # work around for windows 256 character path limit
                      file_abs_path = ("\\\\?\\" + file_abs_path)
  
                  try:
                      if keep_separate:
                          # Copy Require full path name, including the filename
                          full_dst = os.path.join(dst, file_abs_path.split(os.sep)[
                              -1])  # get the source filename and add it to dst path
                          self.logger.debug("Copying file: {} -> {}".format(file_abs_path, full_dst))
                          if keep_parent_directory:
                              shutil.copytree(file_abs_path, full_dst)
                          else:
                              shutil.copy(file_abs_path, full_dst)
                      else:
                          self.logger.debug("Moving file: {} -> {}".format(file_abs_path, dst))
                          shutil.move(file_abs_path, dst)
                  except Exception:
                      self.logger.exception("Failed to move/copy file: {} -> {}".format(file_abs_path, dst))
                      continue
          if not keep_separate:
              shutil.rmtree(src)
code_tokens: def merge_dirs ( self , src , dst , keep_separate = True , keep_parent_directory = False ) : os . makedirs ( dst , exist_ok = True ) self . logger . info ( "Trying to merge all files in {} -> {}" . format ( src , dst ) ) for ( directory , dirnames , filenames ) in os . walk ( src ) : for f in dirnames if keep_parent_directory else filenames : file_abs_path = os . path . abspath ( os . path . join ( directory , f ) ) if os . name == "nt" : file_abs_path = ( "\\\\?\\" + file_abs_path ) try : if keep_separate : full_dst = os . path . join ( dst , file_abs_path . split ( os . sep ) [ - 1 ] ) self . logger . debug ( "Copying file: {} -> {}" . format ( file_abs_path , full_dst ) ) if keep_parent_directory : shutil . copytree ( file_abs_path , full_dst ) else : shutil . copy ( file_abs_path , full_dst ) else : self . logger . debug ( "Moving file: {} -> {}" . format ( file_abs_path , dst ) ) shutil . move ( file_abs_path , dst ) except Exception : self . logger . exception ( "Failed to move/copy file: {} -> {}" . format ( file_abs_path , dst ) ) continue if not keep_separate : shutil . rmtree ( src )
short_docstring: Put all files from multiple dir into one
short_docstring_tokens: Put all files from multiple dir into one
comment: """
          Put all files from multiple dir into one
          """$SEP$# work around for windows 256 character path limit$SEP$# Copy Require full path name, including the filename$SEP$# get the source filename and add it to dst path