Get the name of the targetfile based on the job arguments
970364
def resolve_targetfile(self, args, require_sim_name=False):  # x
        """"""
        ttype = args.get('ttype')
        if is_null(ttype):
            sys.stderr.write('Target type must be specified')
            return (None, None)

        sim = args.get('sim')
        if is_null(sim):
            if require_sim_name:
                sys.stderr.write('Simulation scenario must be specified')
                return (None, None)
            else:
                sim = None

        name_keys = dict(target_type=ttype,
                         targetlist='target_list.yaml',
                         sim_name=sim,
                         fullpath=True)
        if sim is None:
            targetfile = self.targetfile(**name_keys)
        else:
            targetfile = self.sim_targetfile(**name_keys)

        targets_override = args.get('targetfile')
        if is_not_null(targets_override):
            targetfile = targets_override

        return (targetfile, sim)
1203202
def _getPFilename(self,native,prompt):
        
        return self.get(native=native,prompt=prompt)
697266
def getTmpFilename(self, tmp_dir=None, prefix='tmp', suffix='.txt'):
        
        # Override to change default constructor to str(). FilePath
        # objects muck up the Mothur script.
        return super(Mothur, self).getTmpFilename(
            tmp_dir=tmp_dir, prefix=prefix, suffix=suffix,
            result_constructor=str)
936453
def guess_filename(obj):
    """"""
    name = getattr(obj, 'name', None)
    if (name and isinstance(name, basestring) and name[0] != '<' and
            name[-1] != '>'):
        return os.path.basename(name)
295988
def detect_appname(target)
      return "app.rb" if File.exist?(File.join(self.target, "app.rb"))
      return "application.rb" if File.exist?(File.join(self.target, "application.rb"))
      file_array = Dir.glob(File.join("#{target}", "*.rb"))
      return file_array[0] if ! file_array.nil? and file_array.count == 1
      return "" # gracefully failure
    end
580384
def generate_dep_names(self, target: Target):
        """"""
        yield from sorted(get_descendants(self.target_graph, target.name))
565952
def get_gopath(self, target):
    """"""
    return os.path.join(self.workdir, target.id)
895204
def get_filename(self, runSetName, fileExtension):
        '''
        
        '''

        fileName = self.benchmark.output_base_name + ".results."

        if runSetName:
            fileName += runSetName + "."

        return fileName + fileExtension
789550
def _make_scatter_logfile_name(cls, key, linkname, job_config):
        
        logfile = job_config.get('logfile', "%s_%s_%s.log" %
                                 (cls.default_prefix_logfile, linkname, key))
        job_config['logfile'] = logfile
510249
function getNewFilename(list, name) {
  if (list.indexOf(name) === -1) {
    return name;
  }
  const parsed = parseFilename(name);
  const base = parsed.base;
  const ext = parsed.ext;
  if (!base) {
    const newName = getNextNumberName(ext);
    return getNewFilename(list, newName);
  } else {
    const basename = getNextNumberName(base);
    return getNewFilename(list, `${basename}${ext}`);
  }
}
685904
function fileName(file) {
  let prefix = null
  let reference = null

  if (isPathSubDirOf(file, PROJECT_DIR)) {
    // Assets from the target project.
    prefix = []
    reference = PROJECT_DIR
  } else if (isPathSubDirOf(file, TOOLBOX_DIR)) {
    // Assets from the Toolbox.
    prefix = ['__borela__']
    reference = TOOLBOX_DIR
  }

  const RELATIVE = relative(reference, file)
  let nodes = RELATIVE.split(sep)

  if (nodes[0] === 'src')
    nodes.shift()

  if (prefix.length > 0)
    nodes = [...prefix, ...nodes]

  return `${nodes.join('/')}?[sha512:hash:base64:8]`
}
89894
def determine_output_name(self, sources):
        """"""
        assert is_iterable_typed(sources, virtual_target.VirtualTarget)

        # The simple case if when a name
        # of source has single dot. Then, we take the part before
        # dot. Several dots can be caused by:
        # - Using source file like a.host.cpp
        # - A type which suffix has a dot. Say, we can
        #   type 'host_cpp' with extension 'host.cpp'.
        # In the first case, we want to take the part till the last
        # dot. In the second case -- no sure, but for now take
        # the part till the last dot too.
        name = os.path.splitext(sources[0].name())[0]

        for s in sources[1:]:
            n2 = os.path.splitext(s.name())
            if n2 != name:
                get_manager().errors()(
                    "%s: source targets have different names: cannot determine target name"
                    % (self.id_))

        # Names of sources might include directory. We should strip it.
        return self.determine_target_name(sources[0].name())
999827
def _getFilename(self, fileNumber):
        
        cur = self._connection.cursor()
        cur.execute('SELECT name FROM files WHERE id = ?', (fileNumber,))
        row = cur.fetchone()
        if row is None:
            return None
        else:
            return row[0]
881097
def get_makefile_filename():
    """"""
    if _PYTHON_BUILD:
        return os.path.join(_PROJECT_BASE, "Makefile")
    if hasattr(sys, 'abiflags'):
        config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags)
    else:
        config_dir_name = 'config'
    return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile')
783193
private static String getJobTemplateName(JobExecutionPlan jobExecutionPlan) {
    Optional<URI> jobTemplateUri = jobExecutionPlan.getJobSpec().getTemplateURI();
    if (jobTemplateUri.isPresent()) {
      return Files.getNameWithoutExtension(new Path(jobTemplateUri.get()).getName());
    } else {
      return null;
    }
  }
777868
def name(self):
        
        try:
            return self._name
        except AttributeError:
            if self.is_task:
                try:
                    return self.pos_str
                except:
                    return os.path.basename(self.workdir)
            else:
                return os.path.basename(self.workdir)
119013
def _get_pants_target_alias(self, pants_target_type):
    """"""
    if pants_target_type in self.target_aliases_map:
      return self.target_aliases_map.get(pants_target_type)
    else:
      return "{}.{}".format(pants_target_type.__module__, pants_target_type.__name__)