Set slicing type using continuous information if provided.

        Also visit subnodes as they may contains relevant typing information.
170826
def visit_Slice(self, node):
        
        self.generic_visit(node)
        if node.step is None or (isinstance(node.step, ast.Num) and
                                 node.step.n == 1):
            self.result[node] = self.builder.NamedType(
                'pythonic::types::contiguous_slice')
        else:
            self.result[node] = self.builder.NamedType(
                'pythonic::types::slice')
1372046
def _populate_struct_type_attributes(self, env, data_type):
        
        parent_type = None
        extends = data_type._ast_node.extends
        if extends:
            # A parent type must be fully defined and not just a forward
            # reference.
            parent_type = self._resolve_type(env, extends, True)
            if isinstance(parent_type, Alias):
                # Restrict extending aliases because it's difficult to generate
                # code for it in Python. We put all type references at the end
                # to avoid out-of-order declaration issues, but using "extends"
                # in Python forces the reference to happen earlier.
                raise InvalidSpec(
                    'A struct cannot extend an alias. '
                    'Use the canonical name instead.',
                    data_type._ast_node.lineno, data_type._ast_node.path)
            if isinstance(parent_type, Nullable):
                raise InvalidSpec(
                    'A struct cannot extend a nullable type.',
                    data_type._ast_node.lineno, data_type._ast_node.path)
            if not isinstance(parent_type, Struct):
                raise InvalidSpec(
                    'A struct can only extend another struct: '
                    '%s is not a struct.' % quote(parent_type.name),
                    data_type._ast_node.lineno, data_type._ast_node.path)
        api_type_fields = []
        for stone_field in data_type._ast_node.fields:
            api_type_field = self._create_struct_field(env, stone_field)
            api_type_fields.append(api_type_field)
        data_type.set_attributes(
            data_type._ast_node.doc, api_type_fields, parent_type)
952134
def set_scanner (type, scanner):
    
    if __debug__:
        from .scanner import Scanner
        assert isinstance(type, basestring)
        assert issubclass(scanner, Scanner)
    validate (type)
    __types [type]['scanner'] = scanner
912794
def p_type_def_3(t):
    """"""
    id = t[2]
    body = t[3]
    lineno = t.lineno(1)
    if id_unique(id, 'struct', lineno):
        name_dict[id] = struct_info(id, body, lineno)
846709
def _slice(self, slicer):
        

        # slice the category
        # return same dims as we currently have

        if isinstance(slicer, tuple) and len(slicer) == 2:
            if not com.is_null_slice(slicer[0]):
                raise AssertionError("invalid slicing for a 1-ndim "
                                     "categorical")
            slicer = slicer[1]

        return self.values[slicer]
1186939
def _wrap_type_instantiation(self, type_cls):
        """"""
        def wrapper(*args, **kwargs):
            # use args for struct arguments??
            return type_cls(stream=self._null_stream)
        return wrapper
1239500
def set_variable_type(index, type)
      case type
      when :integer
        ret = LPSolve.set_int @ptr, index, 1
      when :binary
        ret = LPSolve.set_binary @ptr, index, 1
      when :continuous
        ret = LPSolve.set_int @ptr, index, 0
      else
        fail type
      end

      fail if ret != 1
    end
1293844
def visit_assign(self, node, parent):
        """"""
        type_annotation = self.check_type_comment(node)
        newnode = nodes.Assign(node.lineno, node.col_offset, parent)
        newnode.postinit(
            targets=[self.visit(child, newnode) for child in node.targets],
            value=self.visit(node.value, newnode),
            type_annotation=type_annotation,
        )
        return newnode
1130891
def slicing_singlevalue(arg, length):
    """"""
    if isinstance(arg, slice):
        start, stop, step = arg.indices(length)
        i = start
        if step > 0:
            while i < stop:
                yield i
                i += step
        else:
            while i > stop:
                yield i
                i += step
    else:
        try:
            i = arg.__index__()
        except AttributeError:
            raise TypeError("indices must be integers or slices, not " + arg.__class__.__name__)
        if i < 0:
            i += length
        yield i
1319304
def set_break(self, break_type):
        
        self._break_type = break_type
        self._break_level = self._scope.level()
957605
function(obj, type){
		if(!this.enabled){ return;}
		var relation = this.relation[type];
		if(!relation){ return;}

		this.modifyNodes = [];

		switch(relation){
			case 'node':      this.setEdgeByNodeObj(obj); break;
			case 'link':      this.setEdgeByLinkObj(obj); break;
			case 'separator': this.setEdgeBySeparator(obj); break;
			default:          this.modifyOtherInfo(obj,relation); break;
		}

		if(this.modifyNodes.length>0){ this.remakeComponent();}
	}
548462
def 
        
        for tunnel_type, (tunnel, callback) in tunnels.iteritems():
            if tunnel is None:
                continue
            self.set_tunnel(tunnel_type, tunnel, callback)
1270622
def set_type(self, sequence_type):
        ''''''
        if not(self.sequence_type):
            for id, r in self.sequence.iteritems():
                assert(r.residue_type == None)
                r.residue_type = sequence_type
            self.sequence_type = sequence_type
773511
def set_wrapped(self, wrapped):
        
        self.wrapped = wrapped
        functools.update_wrapper(self, self.wrapped, updated=())
        self.wrapped_func = False
        self.wrapped_class = False

        if inspect.isroutine(wrapped):
            self.wrapped_func = True

        elif isinstance(wrapped, type):
            self.wrapped_class = True
1177889
def do_node_set(self, element, decl, pseudo):
        """"""
        target = serialize(decl.value).strip()
        step = self.state[self.state['current_step']]
        elem = self.current_target().tree
        _, valstep = self.lookup('pending', target)
        if not valstep:
            step['pending'][target] = [('nodeset', elem)]
        else:
            self.state[valstep]['pending'][target] = [('nodeset', elem)]
3990
def set_typ(self, refobj, typ):
        
        try:
            enum = JB_ReftrackNode.types.index(typ)
        except ValueError:
            raise ValueError("The given type %s could not be found in available types: %" % (typ, JB_ReftrackNode.types))
        cmds.setAttr("%s.type" % refobj, enum)
1288362
def _non_reducing_slice(slice_):
    
    # default to column slice, like DataFrame
    # ['A', 'B'] -> IndexSlices[:, ['A', 'B']]
    kinds = (ABCSeries, np.ndarray, Index, list, str)
    if isinstance(slice_, kinds):
        slice_ = IndexSlice[:, slice_]

    def pred(part):
        # true when slice does *not* reduce, False when part is a tuple,
        # i.e. MultiIndex slice
        return ((isinstance(part, slice) or is_list_like(part))
                and not isinstance(part, tuple))

    if not is_list_like(slice_):
        if not isinstance(slice_, slice):
            # a 1-d slice, like df.loc[1]
            slice_ = [[slice_]]
        else:
            # slice(a, b, c)
            slice_ = [slice_]  # to tuplize later
    else:
        slice_ = [part if pred(part) else [part] for part in slice_]
    return tuple(slice_)