Get the full path of a temporary CIB-file with the name of the CIB
190864
def _get_cibfile_tmp(cibname):
    '''
    
    '''
    cibfile_tmp = '{0}.tmp'.format(_get_cibfile(cibname))
    log.trace('cibfile_tmp: %s', cibfile_tmp)
    return cibfile_tmp
123924
def tmppath(path=None, include_unix_username=True):
    
    addon = "luigitemp-%08d" % random.randrange(1e9)
    temp_dir = '/tmp'  # default tmp dir if none is specified in config

    # 1. Figure out to which temporary directory to place
    configured_hdfs_tmp_dir = hdfs().tmp_dir
    if configured_hdfs_tmp_dir is not None:
        # config is superior
        base_dir = configured_hdfs_tmp_dir
    elif path is not None:
        # need to copy correct schema and network location
        parsed = urlparse(path)
        base_dir = urlunparse((parsed.scheme, parsed.netloc, temp_dir, '', '', ''))
    else:
        # just system temporary directory
        base_dir = temp_dir

    # 2. Figure out what to place
    if path is not None:
        if path.startswith(temp_dir + '/'):
            # Not 100%, but some protection from directories like /tmp/tmp/file
            subdir = path[len(temp_dir):]
        else:
            # Protection from /tmp/hdfs:/dir/file
            parsed = urlparse(path)
            subdir = parsed.path
        subdir = subdir.lstrip('/') + '-'
    else:
        # just return any random temporary location
        subdir = ''

    if include_unix_username:
        subdir = os.path.join(getpass.getuser(), subdir)

    return os.path.join(base_dir, subdir + addon)
1032949
def path_to(self, p):
        """"""
        if os.path.isabs(p):
            return p

        return os.sep.join([self._original_dir, p])
760567
def _relpath(name):
    
    return os.path.normpath(os.path.splitdrive(name)[1]).lstrip(_allsep)
894653
def getfullfilename(file_path):
        ''' 
        '''
        warnings.warn("getfullfilename() is deprecated and will be removed in near future. Use chirptext.io.write_file() instead", DeprecationWarning)
        if file_path:
            return os.path.basename(file_path)
        else:
            return ''
371592
def get_path(self, prefix=None, filename=None):
        """"""
        prefix = prefix or settings.FLOW_EXECUTOR['DATA_DIR']

        path = os.path.join(prefix, self.subpath)
        if filename:
            path = os.path.join(path, filename)

        return path
1104568
def file2abspath(filename, this_file=__file__):
    
    return os.path.abspath(
        os.path.join(os.path.dirname(os.path.abspath(this_file)), filename))
484312
def get_data_path(filename):
    
    if os.path.isabs(filename):
        return filename
    else:
        return os.path.join(get_data_dir(), filename)
95436
def get_file(self):
        
        content = self._load()
        if not content:
            return None
        filename = "temporary_file.bin"
        with open(filename, "wb") as file_name:
            file_name.write(content)
        return filename
39829
def _get_full_path(self, path, environ):
        
        if path.startswith('/'):
            path = environ.get('SCRIPT_NAME', '') + path
        return path
931081
def _get_path_by_name(part, paths):
    
    for path in paths:
        if path.alias == part:
            return path
    raise ValueError
719140
def get_log_path(config_file_name):
    ''''''
    stdout_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stdout')
    stderr_full_path = os.path.join(NNICTL_HOME_DIR, config_file_name, 'stderr')
    return stdout_full_path, stderr_full_path
155116
def _get_archive_tmp_dir(filename):
    """"""
    head, tail = os.path.split(filename)
    return os.path.join(head, _ARCHIVE_TMP_DIR_TEMPLATE.format(tail))
1172626
def _GetRelPath(self, filename):
		""""""
		assert filename.startswith(self.subdir), (filename, self.subdir)
		return filename[len(self.subdir):].lstrip(r"\/")
1184424
def get_tmp_file(dir=None):
    ""
    with tempfile.NamedTemporaryFile(delete=False, dir=dir) as f: return f.name
952889
def get_path_name(self):
        
        complete_path = os.path.dirname(os.path.abspath(self.path))
        name = self.path.replace(complete_path + PATH_SEPARATOR, "")
        if name.endswith("/"):
            name = name[: -1]

        return complete_path, name
1268486
def getTmpFilename(self, tmp_dir="/tmp",prefix='tmp',suffix='.fasta',\
           include_class_id=False,result_constructor=FilePath):
        

        return super(Pplacer,self).getTmpFilename(tmp_dir=tmp_dir,
                                    prefix=prefix,
                                    suffix=suffix,
                                    include_class_id=include_class_id,
                                    result_constructor=result_constructor)