Remove the statement from a ProcmailRC structure, raise a
        RuntimeError if the statement is not inside a ProcmailRC structure
        return the parent id
327848
def delete(self):
        """"""
        if self.parent is None:
            raise RuntimeError(
                "Current statement has no parent, so it cannot "
                + "be deleted form a procmailrc structure"
            )
        elif self.id is None:
            raise RuntimeError("id not set but have a parent, this should not be happening")
        else:
            parent_id = self.parent.id
            index = int(self.id.split('.')[-1])
            self.parent.pop(index)
            self.parent = None
            self.id = None
            return parent_id
332115
def finalize(self) -> None:
        '''  '''
        self.wrap_script()
        if not self.statements:
            self.task = ''
            return
        # handle tasks
        input_directive = [
            idx for idx, statement in enumerate(self.statements)
            if statement[0] == ':' and statement[1] == 'input'
        ]
        task_directive = [
            idx for idx, statement in enumerate(self.statements)
            if statement[0] == ':' and statement[1] == 'task'
        ]
        if len(task_directive) > 1:
            raise ValueError('Only one task statement is allowed in a step')
        # handle parameter
        for idx, statement in enumerate(self.statements):
            if statement[0] == ':' and statement[1] == 'parameter':
                if task_directive and task_directive[0] < idx:
                    raise ValueError(
                        'Parameter statement is not allowed in tasks.')
                if '=' not in statement[2]:
                    if ':' in statement[2]:
                        if not is_type_hint(statement[2]):
                            raise ValueError(
                                f'Invalid type trait in parameter specification {statement[2]}'
                            )
                        name, value = statement[2].split(':')
                    else:
                        name = statement[2]
                        value = 'str'
                else:
                    name, value = statement[2].split('=', 1)
                    # ignore type trait if a default value is specified
                    name = name.split(':')[0]
                name = name.strip()
                if name.startswith('_'):
                    raise ValueError(
                        f'Invalid parameter name {name}: names with leading underscore is not allowed.'
                    )
                if not value.strip():
                    raise ValueError(
                        f'{self.step_name()}: Invalid parameter definition: {statement[2]}'
                    )
                # there is a possibility that value contains # so  sos_handle_parameter(name, val # aaa) will fail
                self.statements[idx] = [
                    '!',
                    f'#begin_parameter {name}\n{name} = sos_handle_parameter_({name.strip()!r}, {value}\n) #end_parameter {name}\n',
                    statement[2].strip()
                ]
                self.parameters[name] = (value, statement[3])
                if input_directive and input_directive[0] < idx:
                    self.substep_parameters.add(name)
        # handle tasks
        if not task_directive:
            self.task = ''
        else:
            start_task = task_directive[0] + 1
            # convert statement to task
            self.task = ''
            for statement in self.statements[start_task:]:
                if statement[0] == ':':
                    if statement[1] in ('input', 'output', 'depends'):
                        raise ValueError(
                            f'{self.step_name()}: Step task should be defined as the last item in a SoS step'
                        )
                    elif statement[1] == 'task':
                        raise ValueError(
                            f'{self.step_name()}: Only one task is allowed for a step'
                        )
                    elif statement[1] == 'parameter':
                        raise ValueError(
                            f'{self.step_name()}: Parameters should be defined before step task'
                        )
                    # ignore ...
                    self.task += '\n'
                else:
                    self.task += statement[1]
            self.task_params = self.statements[task_directive[0]][2]
            self.statements = self.statements[:task_directive[0]]
        # merge multiple statments at the end
        if len(self.statements) > 1 and self.statements[-1][0] == '!':
            starting = len(self.statements) - 1
            for idx in range(starting - 1, -1, -1):
                if self.statements[idx][0] == '!':
                    starting = idx
                else:
                    break
            # merge
            for idx in range(starting + 1, len(self.statements)):
                self.statements[starting][1] += self.statements[idx][1]
            # remove the rest of the statements
            self.statements = self.statements[:starting + 1]
        #
        # auto provides #859
        if not any(opt in self.options for opt in ('provides', 'shared')) and \
                len([x for x in self.statements if x[0] == ':' and x[1] == 'output']) == 1:
            output_stmt = [
                x for x in self.statements if x[0] == ':' and x[1] == 'output'
            ][0][2]
            output_names = get_names_of_kwargs(output_stmt)
            self.options['namedprovides'] = repr(output_names)
376137
def remove(self):
        
        if self.parent:
            for i, node in enumerate(self.parent.children):
                if node is self:
                    self.parent.changed()
                    del self.parent.children[i]
                    self.parent = None
                    return i
466376
def remove(self, matcher, obj):
        '''
        
        '''
        current = self.subtree(matcher, False)
        if current is None:
            return
        # Assume that this pair only appears once
        if current._use_dict:
            try:
                del current.matchers_dict[(obj, matcher)]
            except KeyError:
                pass
        else:
            if len(current.matchers_list) > 10:
                # Convert to dict
                current.matchers_dict = OrderedDict((v, None) for v in current.matchers_list
                                                    if v != (obj, matcher))
                current.matchers_list = None
                current._use_dict = True
            else:
                try:
                    current.matchers_list.remove((obj, matcher))
                except ValueError:
                    pass
        while ((not current.matchers_dict) if current._use_dict
               else (not current.matchers_list))\
                and not current.matchers_dict\
                and not hasattr(current,'any')\
                and not current.index and current.parent is not None:
            # remove self from parents
            ind = current.parentIndex
            if ind is None:
                del current.parent.any
            else:
                del current.parent.index[ind]
            p = current.parent
            current.parent = None
            current = p
766493
@Override
	public void removeByC_NotST(long CPDefinitionId, int status) {
		for (CPInstance cpInstance : findByC_NotST(CPDefinitionId, status,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpInstance);
		}
	}
467702
def cancel(id)
      pipeline = Base.find(id)
      pipeline.cancel
    rescue ActiveRecord::RecordNotFound
      raise InvalidPipelineError.new("Invalid pipeline")
    end
140465
def delete(self, id, seq, line): # pylint: disable=invalid-name,redefined-builtin
        
        return self.service.delete_id(self._base(id, seq), line)
944278
def process_defs(exp, parent)
      inside_new_context(Context::SingletonMethodContext, exp, parent) do
        increase_statement_count_by(exp.body)
        process(exp)
      end
    end
666621
def close_statement(self, connection_id, statement_id):
        
        request = requests_pb2.CloseStatementRequest()
        request.connection_id = connection_id
        request.statement_id = statement_id

        self._apply(request)
1258633
def delete_branch(cls, resource_id=None, db_session=None, *args, **kwargs):
        
        tablename = cls.model.__table__.name

        # lets lock rows to prevent bad tree states
        resource = ResourceService.lock_resource_for_update(
            resource_id=resource_id, db_session=db_session
        )
        parent_id = resource.parent_id
        ordering = resource.ordering
        raw_q = """
            WITH RECURSIVE subtree AS (
                    SELECT res.resource_id
                    FROM {tablename} AS res WHERE res.resource_id = :resource_id
                  UNION ALL
                    SELECT res_u.resource_id
                    FROM {tablename} res_u, subtree st
                    WHERE res_u.parent_id = st.resource_id
            )
            DELETE FROM resources where resource_id in (select * from subtree);
        """.format(
            tablename=tablename
        )  # noqa
        db_session = get_db_session(db_session)
        text_obj = sa.text(raw_q)
        db_session.execute(text_obj, params={"resource_id": resource_id})
        cls.shift_ordering_down(parent_id, ordering, db_session=db_session)
        return True
106498
def link p, c, overwrite=false
    if p == c || p.descendant_of?(c) || c.descendant_of?(p) # would create a loop
      #puts "*** linking parent #{p.id} and child #{c.id} would create a loop"
      return
    end

    #puts "in link for #{p.id} to #{c.id}, perform? #{c.parent.nil?} || #{overwrite}"

    return unless c.parent.nil? || overwrite
    remove_container c
    p.children << c
    c.parent = p

    ## if the child was previously a top-level container, it now ain't,
    ## so ditch our thread and kill it if necessary
    prune_thread_of c
  end
834601
def removeID(self, attr):
        
        if attr is None: attr__o = None
        else: attr__o = attr._o
        ret = libxml2mod.xmlRemoveID(self._o, attr__o)
        return ret
817981
def remove(self, pointer):
        
        doc = deepcopy(self.document)
        parent, obj = None, doc
        try:
            # fetching
            for token in Pointer(pointer):
                parent, obj = obj, token.extract(obj, bypass_ref=True)

            # removing
            if isinstance(parent, Mapping):
                del parent[token]

            if isinstance(parent, MutableSequence):
                parent.pop(int(token))
        except Exception as error:
            raise Error(*error.args)

        return Target(doc)
867097
def forget(element_id)
      unless is_parent_layout?
        return parent_layout.remove(element_id)
      end
      removed = nil
      context(self.view) do
        removed = all(element_id)
        @elements[element_id] = nil
      end
      removed
    end
673026
def removeParent(self):
        

        self.log.debug("Try to remove the parent workitem from current "
                       "<Workitem %s>",
                       self)

        headers = copy.deepcopy(self.rtc_obj.headers)
        headers["Content-Type"] = self.OSLC_CR_JSON
        req_url = "".join([self.url,
                           "?oslc_cm.properties=com.ibm.team.workitem.",
                           "linktype.parentworkitem.parent"])

        parent_tag = ("rtc_cm:com.ibm.team.workitem.linktype."
                      "parentworkitem.parent")
        parent_original = {parent_tag: []}

        self.put(req_url,
                 verify=False,
                 proxies=self.rtc_obj.proxies,
                 headers=headers,
                 data=json.dumps(parent_original))
        self.log.info("Successfully remove the parent workitem of current "
                      "<Workitem %s>",
                      self)
615907
def _handle_statement(self, state, successors, stmt):
        
        if type(stmt) == pyvex.IRStmt.IMark:
            # TODO how much of this could be moved into the imark handler
            ins_addr = stmt.addr + stmt.delta
            state.scratch.ins_addr = ins_addr

            # Raise an exception if we're suddenly in self-modifying code
            for subaddr in range(stmt.len):
                if subaddr + stmt.addr in state.scratch.dirty_addrs:
                    raise SimReliftException(state)
            state._inspect('instruction', BP_AFTER)

            l.debug("IMark: %#x", stmt.addr)
            state.scratch.num_insns += 1
            state._inspect('instruction', BP_BEFORE, instruction=ins_addr)

        # process it!
        try:
            stmt_handler = self.stmt_handlers[stmt.tag_int]
        except IndexError:
            l.error("Unsupported statement type %s", (type(stmt)))
            if o.BYPASS_UNSUPPORTED_IRSTMT not in state.options:
                raise UnsupportedIRStmtError("Unsupported statement type %s" % (type(stmt)))
            state.history.add_event('resilience', resilience_type='irstmt', stmt=type(stmt).__name__, message='unsupported IRStmt')
            return None
        else:
            exit_data = stmt_handler(self, state, stmt)

        # for the exits, put *not* taking the exit on the list of constraints so
        # that we can continue on. Otherwise, add the constraints
        if exit_data is not None:
            l.debug("%s adding conditional exit", self)

            target, guard, jumpkind = exit_data

            # Produce our successor state!
            # Let SimSuccessors.add_successor handle the nitty gritty details

            cont_state = None
            exit_state = None

            if o.COPY_STATES not in state.options:
                # very special logic to try to minimize copies
                # first, check if this branch is impossible
                if guard.is_false():
                    cont_state = state
                elif o.LAZY_SOLVES not in state.options and not state.solver.satisfiable(extra_constraints=(guard,)):
                    cont_state = state

                # then, check if it's impossible to continue from this branch
                elif guard.is_true():
                    exit_state = state
                elif o.LAZY_SOLVES not in state.options and not state.solver.satisfiable(extra_constraints=(claripy.Not(guard),)):
                    exit_state = state
                else:
                    exit_state = state.copy()
                    cont_state = state
            else:
                exit_state = state.copy()
                cont_state = state

            if exit_state is not None:
                successors.add_successor(exit_state, target, guard, jumpkind,
                                         exit_stmt_idx=state.scratch.stmt_idx, exit_ins_addr=state.scratch.ins_addr)

            if cont_state is None:
                return False

            # Do our bookkeeping on the continuing state
            cont_condition = claripy.Not(guard)
            cont_state.add_constraints(cont_condition)
            cont_state.scratch.guard = claripy.And(cont_state.scratch.guard, cont_condition)

        return True
1094845
function getThrowStatementOwner(throwStatement) {
                    var child = throwStatement;
                    while (child.parent) {
                        var parent_22 = child.parent;
                        if (ts.isFunctionBlock(parent_22) || parent_22.kind === 256 /* SourceFile */) {
                            return parent_22;
                        }
                        // A throw-statement is only owned by a try-statement if the try-statement has
                        // a catch clause, and if the throw-statement occurs within the try block.
                        if (parent_22.kind === 216 /* TryStatement */) {
                            var tryStatement = parent_22;
                            if (tryStatement.tryBlock === child && tryStatement.catchClause) {
                                return child;
                            }
                        }
                        child = parent_22;
                    }
                    return undefined;
                }