Updates self.g or self.path bc you could only choose 1
487386
def Graph2Pandas_converter(self):
        ''''''

        if isinstance(self.path, str) or isinstance(self.path, p):
            self.path = str(self.path)
            filetype = p(self.path).suffix
            if filetype == '.pickle':
                self.g = pickle.load(open(self.path, 'rb'))
                if isinstance(self.g, rdflib.graph.Graph):
                    return self.get_sparql_dataframe()
                else:
                    print('WARNING:: function df() wont work unless an ontology source is loaded')
                    return self.g
            elif filetype == '.ttl' or filetype == '.rdf':
                self.g = rdflib.Graph()
                self.g.parse(self.path, format='turtle')
                return self.get_sparql_dataframe()
            elif filetype == '.nt':
                self.g = rdflib.Graph()
                self.g.parse(self.path, format='nt')
                return self.get_sparql_dataframe()
            elif filetype == '.owl' or filetype == '.xrdf':
                self.g = rdflib.Graph()
                try:
                    self.g.parse(self.path, format='xml')
                except:
                    # some owl formats are more rdf than owl
                    self.g.parse(self.path, format='turtle')
                return self.get_sparql_dataframe()
            else:
                exit('Format options: owl, ttl, df_pickle, rdflib.Graph()')
            try:
                return self.get_sparql_dataframe()
                self.path = None
            except:
                exit('Format options: owl, ttl, df_pickle, rdflib.Graph()')

        elif isinstance(self.g, rdflib.graph.Graph):
            self.path = None
            return self.get_sparql_dataframe()

        else:
            exit('Obj given is not str, pathlib obj, or an rdflib.Graph()')
251648
def update_vip(self, vip, body=None):
        """"""
        return self.put(self.vip_path % (vip), body=body)
371572
def _set_opt(config_dict, path, value):
    """"""
    if value is None:
        return

    if '.' not in path:
        config_dict[path] = value
        return

    key, rest = path.split(".", 1)
    if key not in config_dict:
        config_dict[key] = {}

    _set_opt(config_dict[key], rest, value)
716002
def enter(self, path):
        
        self.current.append(self.add(path))
        return self.current[-1]
1146773
function updatePersistentPath(client, path, data, callback) {
  debug('updatePersistentPath: "%s" "%s"', path, data);

  data = ensureBuffer(data);

  client.setData(path, data, function (err) {
    if (err) {
      if (err.code !== NO_NODE)
        return callback(err);

      createParentPath(client, path, function(err) {
        if (err) return callback(err);

        client.create(path, data, function(err) {
          if (err) {
            if (err.code !== NODE_EXISTS)
              return callback(err);
            client.setData(path, data, callback);
          } else
            callback(null);
        });
      });
    } else
      callback(null);
  });
}
1109141
def set_path(self, path, is_user=False):
        
        self.clear_buttons()
        pathlist = util.rec_split_path(path)
        for (abspath, name) in pathlist:
            self.append_button(abspath, name)

        if is_user:
            self.add_view_history(path)

        self.back_button.set_sensitive(self.can_back())
        self.forward_button.set_sensitive(self.can_forward())

        self.show_all()
705955
def add_path(self, path):
        

        if os.path.exists(path):
            self.paths.add(path)
            return path
        else:
            #logger.debug('Path {} doesn\'t exist'.format(path))
            return None
248123
def update_mandb_path():
    """"""
    manpath_file = os.path.join(environ.HOME, ".manpath")
    man_dir      = environ.cache_dir
    manindex_dir = environ.manindex_dirl

    lines = []

    """ read all lines """
    try:
        with open(manpath_file, 'r') as f:
            lines = f.readlines()
    except IOError:
        return

    """ remove MANDATORY_MANPATH and MANDB_MAP entry """
    lines = [line for line in lines if man_dir not in line]

    with open(manpath_file, 'w') as f:
        if environ.config.UpdateManPath:
            lines.append('MANDATORY_MANPATH\t%s\n' % man_dir)
            lines.append('MANDB_MAP\t\t\t%s\t%s\n' % (man_dir, manindex_dir))

        f.writelines(lines)
1131903
def change_directory(self, path, *args, **kwargs):
		
		previous_path = self.session_path()
		self.session_path(path)
		if os.path.isdir(self.full_path()) is False:
			self.session_path(previous_path)
			raise ValueError('Unable to change directory. It does not exist or is not a directory')
252202
def update(runas=None, path=None):
    '''
    
    '''
    path = path or _pyenv_path(runas)
    path = os.path.expanduser(path)

    return _update_pyenv(path, runas)
998096
def touch(path):
        
        parentDirPath = os.path.dirname(path)

        PathOperations.safeMakeDirs(parentDirPath)

        with open(path, "wb"):
            pass
87454
def path_selection_changed(self):
        """"""
        idx = self.currentIndex()
        if idx == SELECT_OTHER:
            external_path = self.select_directory()
            if len(external_path) > 0:
                self.add_external_path(external_path)
                self.setCurrentIndex(self.count() - 1)
            else:
                self.setCurrentIndex(CWD)
        elif idx == CLEAR_LIST:
            reply = QMessageBox.question(
                    self, _("Clear other directories"),
                    _("Do you want to clear the list of other directories?"),
                    QMessageBox.Yes | QMessageBox.No)
            if reply == QMessageBox.Yes:
                self.clear_external_paths()
            self.setCurrentIndex(CWD)
        elif idx >= EXTERNAL_PATHS:
            self.external_path = to_text_string(self.itemText(idx))
205937
def update(self, path, node):
        ''''''
        assert(type(path) == type(self.name))
        assert(type(node) == type(self.name) or type(node) == type(predefined))

        d = self.color_scheme
        tokens = path.split('.')
        for t in tokens[:-1]:
            d = d.get(t)
            if d == None:
                raise Exception("Path '%s' not found.")
        d[tokens[-1]] = node
1026962
def go_env(self, gopath=None):
    """"""
    # Forcibly nullify the GOPATH if the command does not need one - this can prevent bad user
    # GOPATHs from erroring out commands; see: https://github.com/pantsbuild/pants/issues/2321.
    # NB: As of go 1.8, when GOPATH is unset (set to ''), it defaults to ~/go (assuming HOME is
    # set - and we can't unset that since it might legitimately be used by the subcommand); so we
    # set the GOPATH here to a valid value that nonetheless will fail to work if GOPATH is
    # actually used by the subcommand.
    no_gopath = os.devnull
    return OrderedDict(GOROOT=self.goroot, GOPATH=gopath or no_gopath)
334804
def __update_paths(self, settings):
        
        if not isinstance(settings, dict):
            return

        if 'custom_base_path' in settings:
            base_path = settings['custom_base_path']
            base_path = join(dirname(__file__), base_path)
            self.__load_paths(base_path)
818659
def setOptions(self, glob=False, **kwargs):
        
        if glob:
            self.globalOptions.update(kwargs)
        else:
            self.options.update(kwargs)
2139
def set_or_create(self, path, *args, **kwargs):
        """"""

        d = self.set(path, *args, **kwargs)

        @d.addErrback
        def _error(result):
            return self.create(path, *args, **kwargs)

        return d