original_docstring: create a directory with a increased number as suffix for the given prefix
docstring: create a directory with a increased number as suffix for the given prefix
docstring_tokens: create a directory with a increased number as suffix for the given prefix
code: def make_numbered_dir(root, prefix):
      """create a directory with a increased number as suffix for the given prefix"""
      for i in range(10):
          # try up to 10 times to create the folder
          max_existing = _max(map(parse_num, find_suffixes(root, prefix)), default=-1)
          new_number = max_existing + 1
          new_path = root.joinpath("{}{}".format(prefix, new_number))
          try:
              new_path.mkdir()
          except Exception:
              pass
          else:
              _force_symlink(root, prefix + "current", new_path)
              return new_path
      else:
          raise EnvironmentError(
              "could not create numbered dir with prefix "
              "{prefix} in {root} after 10 tries".format(prefix=prefix, root=root)
          )
code_tokens: def make_numbered_dir ( root , prefix ) : for i in range ( 10 ) : max_existing = _max ( map ( parse_num , find_suffixes ( root , prefix ) ) , default = - 1 ) new_number = max_existing + 1 new_path = root . joinpath ( "{}{}" . format ( prefix , new_number ) ) try : new_path . mkdir ( ) except Exception : pass else : _force_symlink ( root , prefix + "current" , new_path ) return new_path else : raise EnvironmentError ( "could not create numbered dir with prefix " "{prefix} in {root} after 10 tries" . format ( prefix = prefix , root = root ) )
short_docstring: create a directory with a increased number as suffix for the given prefix
short_docstring_tokens: create a directory with a increased number as suffix for the given prefix
comment: """create a directory with a increased number as suffix for the given prefix"""$SEP$# try up to 10 times to create the folder