Applies the new data type of the scoped variable defined by path

        :param str path: The path identifying the edited variable
        :param str new_variable_type_str: New data type as str
327914
def apply_new_scoped_variable_type(self, path, new_variable_type_str):
        
        data_port_id = self.list_store[path][self.ID_STORAGE_ID]
        try:
            if self.model.state.scoped_variables[data_port_id].data_type.__name__ != new_variable_type_str:
                self.model.state.scoped_variables[data_port_id].change_data_type(new_variable_type_str)
        except ValueError as e:
            logger.error("Error while changing data type: {0}".format(e))
1035367
def addPath(rel_path, prepend=False):
    
    path = lambda *paths: os.path.abspath(
        os.path.join(os.path.dirname(__file__), *paths)) + '/'
    if prepend:
      return sys.path.insert(0, path(rel_path))
    return sys.path.append(path(rel_path))
1128241
def put(self, path, data, **options):
        
        data, options = self._update_request(data, options)
        return self.request('put', path, data=data, **options)
949384
def add_to_pythonpath(self, path):
        """"""
        pathlist = self.get_pythonpath()
        if path in pathlist:
            return False
        else:
            pathlist.insert(0, path)
            self.set_pythonpath(pathlist)
            return True
427654
public VarSetBuilder varSetAtPath( String[] path)
    {
    VarSet varSet = null;
    if( path != null && path.length > 0)
      {
      varSet = new VarSet( path[0]);
      varSet_.addMember( varSet);

      for( int i = 1; i < path.length; i++)
        {
        VarSet child = new VarSet( path[i]);
        varSet.addMember( child);
        varSet = child;
        }
      }

    return
      varSet == null
      ? null
      : new VarSetBuilder( varSet);
    }
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
1332477
def AddFileReadData(self, path, file_data_path):
    
    if self.file_system.FileEntryExistsByPath(path):
      raise ValueError('Path: {0:s} already set.'.format(path))

    with open(file_data_path, 'rb') as file_object:
      file_data = file_object.read()

    self._AddParentDirectories(path)
    self.file_system.AddFileEntry(path, file_data=file_data)
376982
def _insert_vars(self, path: str, data: dict) -> str:
        
        data = data.copy()
        while True:
            match = re.search(self.VAR_REPLACE_REGEX, path)
            if not match:
                return path
            replace_from = match.group(0)
            replace_with = str(data.get(match.group(1)))
            path = path.replace(replace_from, replace_with)
1146481
def declare_variable(self, id_, lineno, type_, default_value=None):
        
        assert isinstance(type_, symbols.TYPEREF)
        if not self.check_is_undeclared(id_, lineno, scope=self.current_scope, show_error=False):
            entry = self.get_entry(id_)
            if entry.scope == SCOPE.parameter:
                syntax_error(lineno,
                             "Variable '%s' already declared as a parameter "
                             "at %s:%i" % (id_, entry.filename, entry.lineno))
            else:
                syntax_error(lineno, "Variable '%s' already declared at "
                                     "%s:%i" % (id_, entry.filename, entry.lineno))
            return None

        if not self.check_class(id_, CLASS.var, lineno, scope=self.current_scope):
            return None

        entry = (self.get_entry(id_, scope=self.current_scope) or
                 self.declare(id_, lineno, symbols.VAR(id_, lineno, class_=CLASS.var)))
        __DEBUG__("Entry %s declared with class %s at scope %i" % (entry.name, CLASS.to_string(entry.class_),
                                                                   self.current_scope))

        if entry.type_ is None or entry.type_ == self.basic_types[TYPE.unknown]:
            entry.type_ = type_

        if entry.type_ != type_:
            if not type_.implicit and entry.type_ is not None:
                syntax_error(lineno,
                             "'%s' suffix is for type '%s' but it was "
                             "declared as '%s'" %
                             (id_, entry.type_, type_))
                return None
                # type_ = entry.type_  # TODO: Unused??

        entry.scope = SCOPE.global_ if self.current_scope == self.global_scope else SCOPE.local
        entry.callable = False
        entry.class_ = CLASS.var  # HINT: class_ attribute could be erased if access_id was used.
        entry.declared = True  # marks it as declared

        if entry.type_.implicit and entry.type_ != self.basic_types[TYPE.unknown]:
            warning_implicit_type(lineno, id_, entry.type_.name)

        if default_value is not None and entry.type_ != default_value.type_:
            if is_number(default_value):
                default_value = symbols.TYPECAST.make_node(entry.type_, default_value,
                                                           lineno)
                if default_value is None:
                    return None
            else:
                syntax_error(lineno,
                             "Variable '%s' declared as '%s' but initialized "
                             "with a '%s' value" %
                             (id_, entry.type_, default_value.type_))
                return None

        entry.default_value = default_value
        return entry
998955
def set(self, *path):
        
        self.path = [self.channel_name]
        self.path.extend(list(path))
1121682
def __format_path(self, path):
        
        # Unicode strings are converted back to strings, because it seems
        # that inotify_add_watch from ctypes does not work well when
        # it receives an ctypes.create_unicode_buffer instance as argument.
        # Therefore even wd are indexed with bytes string and not with
        # unicode paths.
        if isinstance(path, unicode):
            path = path.encode(sys.getfilesystemencoding())
        return os.path.normpath(path)
643216
def load_path(self, path):
        
        logger.debug("load_path(path=%s)" % path)
        if os.path.isfile(path):
            configtype = self.guess_type(path)
            logger.debug("Detected config type: %s" % self._type_to_str(configtype))
            if configtype in self.TYPES:
                logger.debug("Opening config for reading")
                with open(path, 'r') as f:
                    data = f.read()
                datadict = self.TYPES[configtype]().reverse(data)
                return self.load_data(datadict)
            else:
                raise ValueError("Unsupported config type")
        else:
            logger.warn("load_path couldn't find the path: %s" % path)
62600
def add_to_path(p):
    '''
        
    '''
    old_path = sys.path
    if p not in sys.path:
        sys.path = sys.path[:]
        sys.path.insert(0, p)
    try:
        yield
    finally:
        sys.path = old_path
290862
def set_type(self,type):
    
    self.add_var_opt('type',str(type))
    self.__type = str(type)
    self.__set_output()
831157
def RegisterPathSpec(cls, path_spec_type):
    
    type_indicator = path_spec_type.TYPE_INDICATOR
    if type_indicator in cls._path_spec_types:
      raise KeyError(
          'Path specification type: {0:s} already set.'.format(
              type_indicator))

    cls._path_spec_types[type_indicator] = path_spec_type

    if getattr(path_spec_type, '_IS_SYSTEM_LEVEL', False):
      cls._system_level_type_indicators[type_indicator] = path_spec_type
43049
def add_default_values_of_scoped_variables_to_scoped_data(self):
        
        for key, scoped_var in self.scoped_variables.items():
            self.scoped_data[str(scoped_var.data_port_id) + self.state_id] = \
                ScopedData(scoped_var.name, scoped_var.default_value, scoped_var.data_type, self.state_id,
                           ScopedVariable, parent=self)
849557
def assign_variable(type, name, value, node)
      scope    = assignment_scope(type)
      variable = scope.lookup(type, name)

      # If there's already a variable we'll just update it.
      if variable
        variable.reference_amount += 1

        # `value` is not for conditional assignments as those are handled
        # manually.
        variable.value = value if value
      else
        variable = Definition::RubyObject.new(
          :type             => type,
          :name             => name,
          :value            => value,
          :instance_type    => :instance,
          :reference_amount => 0,
          :line             => node.line,
          :column           => node.column,
          :file             => node.file
        )
      end

      buffer_assignment_value(value)

      # Primarily used by #after_send to support variable assignments as method
      # call arguments.
      if value and !value_stack.empty?
        value_stack.push(variable.value)
      end

      add_variable(variable, scope)
    end