Create a new file parameter
        :param help_string:
        :param default:
        :param suffixes:
        :return:
1805
def create_new_file(help_string=NO_HELP, default=NO_DEFAULT, suffixes=None):
        # type: (str, Union[str, NO_DEFAULT_TYPE], Union[List[str], None]) -> str
        
        # noinspection PyTypeChecker
        return ParamFilename(
            help_string=help_string,
            default=default,
            type_name="new_file",
            suffixes=suffixes,
        )
104994
def show_make_help(runfiles, compact=false)
      say "!txtpur!Runfile engine v#{Runfile::VERSION}" unless compact
      if runfiles.size < 3 and !compact
        say "\nTip: Type '!txtblu!run new!txtrst!' or '!txtblu!run new name!txtrst!' to create a runfile.\nFor global access, place !txtblu!named.runfiles!txtrst! in ~/runfile/ or in /etc/runfile/."
      end
      if runfiles.empty? 
        say "\n!txtred!Runfile not found."
      else
        say ""
        compact ? say_runfile_usage(runfiles) : say_runfile_list(runfiles)
      end
    end
1200318
def create_default_file(cls, data=None, mode=None):
        """"""
        filepath = cls.get_default_filepath()
        if not filepath:
            return False

        filename = os.path.basename(filepath)
        config = read_file(get_data_path(), filename)

        # Find and replace data in default config
        data = data or {}
        for k, v in six.iteritems(data):
            v = v or ""
            config = re.sub(
                r"^(%(key)s) =[ ]*$" % {"key": k},
                "%(key)s = %(value)s" % {"key": k, "value": v},
                config,
                flags=re.MULTILINE,
            )

        dirpath = os.path.dirname(filepath)
        if not os.path.exists(dirpath):
            os.makedirs(dirpath)
        with click.open_file(filepath, "w+") as f:
            f.write(config)

        if mode is not None:
            os.chmod(filepath, mode)

        return True
68106
def prefix(filename):
    '''  '''
    return os.path.split(re.sub(_afni_suffix_regex,"",str(filename)))[1]
549981
def create_list_int(help_string=NO_HELP, default=NO_DEFAULT):
        # type: (str, Union[List[int], NO_DEFAULT_TYPE]) -> List[int]
        
        # noinspection PyTypeChecker
        return ParamFunctions(
            help_string=help_string,
            default=default,
            type_name="List[int]",
            function_s2t=convert_string_to_list_int,
            function_t2s=convert_list_int_to_string,
        )
291846
def create_file(filename):
    

    expanded_filename = os.path.expanduser(os.path.expandvars(filename))
    if not os.path.exists(expanded_filename):
        open(expanded_filename, "a").close()
974048
def build_base_filename(self):
        
        if self.stream:
            self.stream.close()
            self.stream = None

        # remove old suffix
        if self.suffix_time != "":
            index = self.baseFilename.find("." + self.suffix_time)
            if index == -1:
                index = self.baseFilename.rfind(".")
            self.baseFilename = self.baseFilename[:index]

        # add new suffix
        current_time_tuple = time.localtime()
        self.suffix_time = time.strftime(self.suffix, current_time_tuple)
        self.baseFilename = self.baseFilename + "." + self.suffix_time

        self.mode = 'a'
        if not self.delay:
            self.stream = self._open()
1345160
def NewFile(self, filename, encoding, options):
        
        ret = libxml2mod.xmlReaderNewFile(self._o, filename, encoding, options)
        return ret
109023
def add_suffix(in_files, suffix):
    
    import os.path as op
    from nipype.utils.filemanip import fname_presuffix, filename_to_list
    return op.basename(fname_presuffix(filename_to_list(in_files)[0],
                                       suffix=suffix))
795272
def add_file_arg(self, filename):
    
    self.__arguments.append(filename)
    if filename not in self.__input_files:
      self.__input_files.append(filename)
647063
def cli_new():
    
    parser = ArgumentParser()
    parser.add_argument('filename', help='Case file name', nargs='*')

    # general options
    general_group = parser.add_argument_group('General options')
    general_group.add_argument('-r', '--routine', choices=routines.__cli__,
                               help='Routine to run', nargs='*',
                               default=['pflow'], )
    general_group.add_argument('--edit-config', help='Quick edit of the config file',
                               default='', nargs='?', type=str)
    general_group.add_argument('--license', action='store_true', help='Display software license')

    # I/O
    io_group = parser.add_argument_group('I/O options', 'Optional arguments for managing I/Os')
    io_group.add_argument('-p', '--path', help='Path to case files', type=str, default='', dest='input_path')
    io_group.add_argument('-a', '--addfile', help='Additional files used by some formats.')
    io_group.add_argument('-D', '--dynfile', help='Additional dynamic file in dm format.')
    io_group.add_argument('-P', '--pert', help='Perturbation file path', default='')
    io_group.add_argument('-d', '--dump-raw', help='Dump RAW format case file.')
    io_group.add_argument('-n', '--no-output', help='Force no output of any '
                                                    'kind',
                          action='store_true')
    io_group.add_argument('-o', '--output_path', help='Output path prefix', type=str, default='')
    io_group.add_argument('-C', '--clean', help='Clean output files', action='store_true')

    config_exclusive = parser.add_mutually_exclusive_group()
    config_exclusive.add_argument('--load-config', help='path to the rc config to load',
                                  dest='config')
    config_exclusive.add_argument('--save-config', help='save configuration to file name',
                                  nargs='?', type=str, default='')

    # helps and documentations
    group_help = parser.add_argument_group('Help and documentation',
                                           'Optional arguments for usage, model and config documentation')
    group_help.add_argument(
        '-g', '--group', help='Show the models in the group.')
    group_help.add_argument(
        '-q', '--quick-help', help='Show a quick help of model format.')
    group_help.add_argument(
        '-c',
        '--category',
        help='Show model names in the given category.')
    group_help.add_argument(
        '-l',
        '--model-list',
        help='Show a full list of all models.',
        action='store_true')
    group_help.add_argument(
        '-f',
        '--model-format',
        help='Show the format definition of models.', nargs='*', default=[])
    group_help.add_argument(
        '-Q',
        '--model-var',
        help='Show the definition of variables <MODEL.VAR>.')
    group_help.add_argument(
        '--config-option', help='Show a quick help of a config option <CONFIG.OPTION>')
    group_help.add_argument(
        '--help-config',
        help='Show help of the <CONFIG> class. Use ALL for all configs.')
    group_help.add_argument(
        '-s',
        '--search',
        help='Search for models that match the pattern.')

    # simulation control
    sim_options = parser.add_argument_group('Simulation control options',
                                            'Overwrites the simulation configs')
    sim_options.add_argument(
        '--dime', help='Specify DiME streaming server address and port')
    sim_options.add_argument(
        '--tf', help='End time of time-domain simulation', type=float)

    # developer options
    dev_group = parser.add_argument_group('Developer options', 'Options for developer debugging')
    dev_group.add_argument(
        '-v',
        '--verbose',
        help='Program logging level.'
        'Available levels are 10-DEBUG, 20-INFO, 30-WARNING, '
        '40-ERROR or 50-CRITICAL. The default level is 20-INFO',
        type=int, default=20, choices=(10, 20, 30, 40, 50))
    dev_group.add_argument(
        '--profile', action='store_true', help='Enable Python cProfiler')
    dev_group.add_argument(
        '--ncpu', help='Number of parallel processes', type=int, default=0)
    dev_group.add_argument(
        '--show-data', type=str, help='Show model data converted to system base', nargs='*'
    )
    dev_group.add_argument(
        '-x', '--exit', help='Exit before running routine', action='store_true'
    )

    args = parser.parse_args()

    return args
1073619
def _format_help_dicts(help_dicts, display_defaults=False):
    
    help_strs = []
    for help_dict in help_dicts:
        help_str = "%s (%s" % (
            help_dict["var_name"],
            "Required" if help_dict["required"] else "Optional",
        )
        if help_dict.get("default") and display_defaults:
            help_str += ", Default=%s)" % help_dict["default"]
        else:
            help_str += ")"
        if help_dict.get("help_str"):
            help_str += ": %s" % help_dict["help_str"]
        help_strs.append(help_str)

    return "\n".join(help_strs)
1081784
def new_file(new_name=false, body)
      f_name = new_name || file_name_with_path
      File.open(f_name, "w") { |line|
        line.write(body)
        line
      }
    end
1272422
def add_file(self, file, filename):
        
        self.files['_{}'.format(filename)] = (filename, file)
1373709
def create_file_name(file, base_dir)
      file_name = file.split("/").delete_if { |f| f.include?(".") }.first
      unless File.exists?(File.join(base_dir, file_name))
        Dir.mkdir(File.join(base_dir, file_name))
      end
      file_name
    end
1131747
private void makeNewFile() throws IOException {
		String filename=prefix+(files.size()+1)+suffix;
		File file=new File(parent, filename);
		out=new FileOutputStream(file);
		bytesOut=0;
		files.add(file);
	}
1039104
def add_file(self, filename):
        
        with (open(filename, 'rb')) as f:
            data = f.read()
        # below won't handle the same name files
        # in different paths
        fname = os.path.basename(filename)
        self.files[fname] = base64.b64encode(data)