get trial log path
3591
def log_trial(args):
    '''''''
    trial_id_path_dict = {}
    nni_config = Config(get_config_filename(args))
    rest_port = nni_config.get_config('restServerPort')
    rest_pid = nni_config.get_config('restServerPid')
    if not detect_process(rest_pid):
        print_error('Experiment is not running...')
        return
    running, response = check_rest_server_quick(rest_port)
    if running:
        response = rest_get(trial_jobs_url(rest_port), REST_TIME_OUT)
        if response and check_response(response):
            content = json.loads(response.text)
            for trial in content:
                trial_id_path_dict[trial['id']] = trial['logPath']
    else:
        print_error('Restful server is not running...')
        exit(1)
    if args.id:
        if args.trial_id:
            if trial_id_path_dict.get(args.trial_id):
                print_normal('id:' + args.trial_id + ' path:' + trial_id_path_dict[args.trial_id])
            else:
                print_error('trial id is not valid!')
                exit(1)
        else:
            print_error('please specific the trial id!')
            exit(1)
    else:
        for key in trial_id_path_dict:
            print('id:' + key + ' path:' + trial_id_path_dict[key])
2968
def getLoggingLocation(self):
		""""""
		if sys.platform == "win32":
			modulePath = os.path.realpath(__file__)
			modulePath = modulePath[:modulePath.rfind("/")]
			return modulePath
		else:
			return "/tmp"
		return ""
702263
def paths_for_download(self):
        """"""
        if self._paths_for_download is None:
            queries = list()
            try:
                for sra in self.gsm.relations['SRA']:
                    query = sra.split("=")[-1]
                    if 'SRX' not in query:
                        raise ValueError(
                            "Sample looks like it is not an SRA: %s" % query)
                    logger.info("Query: %s" % query)
                    queries.append(query)
            except KeyError:
                raise NoSRARelationException(
                    'No relation called SRA for %s' % self.gsm.get_accession())

            # Construction of DataFrame df with paths to download
            df = DataFrame(columns=['download_path'])
            for query in queries:
                # retrieve IDs for given SRX
                searchdata = Entrez.esearch(db='sra', term=query, usehistory='y',
                                            retmode='json')
                answer = json.loads(searchdata.read())
                ids = answer["esearchresult"]["idlist"]
                if len(ids) != 1:
                    raise ValueError(
                        "There should be one and only one ID per SRX")

                # using ID fetch the info
                number_of_trials = 10
                wait_time = 30
                for trial in range(number_of_trials):
                    try:
                        results = Entrez.efetch(db="sra", id=ids[0],
                                                rettype="runinfo",
                                                retmode="text").read()
                        break
                    except HTTPError as httperr:
                        if "502" in str(httperr):
                            logger.warn(("%s, trial %i out of %i, waiting "
                                         "for %i seconds.") % (
                                             str(httperr),
                                             trial,
                                             number_of_trials,
                                             wait_time))
                            time.sleep(wait_time)
                        elif httperr.code == 429:
                            # This means that there is too many requests
                            try:
                                header_wait_time = int(
                                    httperr.headers["Retry-After"])
                            except:
                                header_wait_time = wait_time
                            logger.warn(("%s, trial %i out of %i, waiting "
                                         "for %i seconds.") % (
                                             str(httperr),
                                             trial,
                                             number_of_trials,
                                             header_wait_time))
                            time.sleep(header_wait_time)
                        else:
                            raise httperr
                try:
                    df_tmp = DataFrame([i.split(',') for i in results.split('\n') if i != ''][1:],
                                       columns=[i.split(',') for i in results.split('\n') if i != ''][0])
                except IndexError:
                    logger.error(("SRA is empty (ID: %s, query: %s). "
                                  "Check if it is publicly available.") %
                                 (ids[0], query))
                    continue

                # check it first
                try:
                    df_tmp['download_path']
                except KeyError as e:
                    logger.error('KeyError: ' + str(e) + '\n')
                    logger.error(str(results) + '\n')

                df = concat([df, df_tmp], sort=True)
            self._paths_for_download = [path for path in df['download_path']]
        return self._paths_for_download
1077826
public String getLogLocation() {
        if (logInstanceBrowser instanceof MainLogRepositoryBrowserImpl) {
            return ((MainLogRepositoryBrowserImpl) logInstanceBrowser).getLocation().getAbsolutePath();
        } else {
            return ((OneInstanceBrowserImpl) logInstanceBrowser).getLocation().getAbsolutePath();
        }

    }
1162146
def exceptions_log_path(cls, for_pid=None, in_dir=None):
    """"""
    if for_pid is None:
      intermediate_filename_component = ''
    else:
      assert(isinstance(for_pid, IntegerForPid))
      intermediate_filename_component = '.{}'.format(for_pid)
    in_dir = in_dir or cls._log_dir
    return os.path.join(
      in_dir,
      'logs',
      'exceptions{}.log'.format(intermediate_filename_component))
168055
def _ClientPathToString(client_path, prefix=""):
  """"""
  return os.path.join(prefix, client_path.client_id, client_path.vfs_path)
1142939
def _get_path(queue_name=None, include_messages=None, message_id=None):
    '''
    
    '''
    if queue_name and include_messages and message_id:
        return '/{0}/messages/{1}'.format(_str(queue_name), message_id)
    if queue_name and include_messages:
        return '/{0}/messages'.format(_str(queue_name))
    elif queue_name:
        return '/{0}'.format(_str(queue_name))
    else:
        return '/'
1023372
def get_logfile_path(working_dir):
   
   logfile_filename = virtualchain_hooks.get_virtual_chain_name() + ".log"
   return os.path.join( working_dir, logfile_filename )
244296
public BaseHolder getSessionFromPath(String strSessionPathID)
    {
        if (strSessionPathID == null)
            return null;
        BaseHolder rootHolder = null;
        // Now, traverse the path
        int iStartPosition = 0;
        int iEndPosition = 0;
        while (iEndPosition < strSessionPathID.length())
        {
            iEndPosition = strSessionPathID.indexOf(PATH_SEPARATOR, iStartPosition);
            if (iEndPosition == -1)
                iEndPosition = strSessionPathID.length();
            String strID = strSessionPathID.substring(iStartPosition, iEndPosition);
            if (iStartPosition == 0)
                rootHolder = (TaskHolder)m_mapTasks.get(strID);
            else
                rootHolder = rootHolder.get(strID);
            if (rootHolder == null)
                return null;
            iStartPosition = iEndPosition + 1;
        }
        return rootHolder;
    }
83102
def get_log_rhos(target_action_log_probs, behaviour_action_log_probs):
    """"""
    t = tf.stack(target_action_log_probs)
    b = tf.stack(behaviour_action_log_probs)
    log_rhos = tf.reduce_sum(t - b, axis=0)
    return log_rhos
1184618
function getPath(path, callback) {
  fs.lstat(path, function(err, stats) {
    if(err) return callback(err);

    // Check if it's a link
    if(stats.isSymbolicLink()) fs.readlink(path, callback);

    callback(err, path);
  });
}
846503
public function getFilePath()
    {
        if (!$this->filePath) {
            $path = sprintf(storage_path('logs/%s'), $this->file);

            if (!file_exists($path)) {
                throw new \Exception('log not exists!');
            }

            $this->filePath = $path;
        }

        return $this->filePath;
    }
1212961
def new_log_filepath(self):
        ''''''
        lastlog_filename = os.path.join(self.dataflash_dir,'LASTLOG.TXT')
        if os.path.exists(lastlog_filename) and os.stat(lastlog_filename).st_size != 0:
            fh = open(lastlog_filename,'rb')
            log_cnt = int(fh.read()) + 1
            fh.close()
        else:
            log_cnt = 1

        self.lastlog_file = open(lastlog_filename,'w+b')
        self.lastlog_file.write(log_cnt.__str__())
        self.lastlog_file.close()

        return os.path.join(self.dataflash_dir, '%u.BIN' % (log_cnt,));
1345881
def get_trial(self, trial_id):
        """"""
        response = requests.get(
            urljoin(self._path, "trials/{}".format(trial_id)))
        return self._deserialize(response)
717181
def get_logs(self):
        ''''''
        folder = os.path.dirname(self.pcfg['log_file'])
        for path, dir, files in os.walk(folder):
            for file in files:
                if os.path.splitext(file)[-1] == '.log':
                    yield os.path.join(path, file)
283311
def _get_paths():
    """"""
    import os
    base_path = os.path.dirname(os.path.abspath(__file__))
    test_data_dir = os.path.join(base_path, 'tests', 'data', 'Plate01')
    test_data_file = os.path.join(test_data_dir, 'RFP_Well_A3.fcs')
    return test_data_dir, test_data_file
755772
def determine_path():
    """"""
    root = __file__
    if os.path.islink(root):
        root = os.path.realpath(root)
    return os.path.dirname(os.path.abspath(root))