Remove internal variable names when moving from sub-workflow to main.
161707
def _extract_from_subworkflow(vs, step):
    
    substep_ids = set([x.name for x in step.workflow])
    out = []
    for var in vs:
        internal = False
        parts = var["id"].split("/")
        if len(parts) > 1:
            if parts[0] in substep_ids:
                internal = True
        if not internal:
            var.pop("source", None)
            out.append(var)
    return out
101510
def _clean_salt_variables(params, variable_prefix="__"):
    '''
    
    '''
    list(list(map(params.pop, [k for k in params if k.startswith(variable_prefix)])))
    return params
1071374
protected function removeLaravelCommands(): void
    {
        $devCommands = ['AuthMake', 'ControllerMake', 'MiddlewareMake',
            'NotificationTable', 'ExceptionMake', 'SessionTable',
            'ChannelMake',
            'ConsoleMake',
            'EventGenerate',
            'EventMake',
            'ExceptionMake',
            'FactoryMake',
            'JobMake',
            'ListenerMake',
            'MailMake',
            'MiddlewareMake',
            'ModelMake',
            'NotificationMake',
            'ObserverMake',
            'PolicyMake',
            'ProviderMake',
            'TestMake',
            'RequestMake',
            'ResourceMake',
            'RuleMake',
            'SeederMake',
        ];

        array_map(function ($item) {
            unset($this->devCommands[$item]);
        }, $devCommands);

        $commands = ['Optimize',
            'OptimizeClear', 'ClearResets', 'RouteCache',
            'RouteClear',
            'RouteList', 'Preset', 'ViewCache',
            'ViewClear', 'Serve', 'StorageLink', ];
        array_map(function ($item) {
            unset($this->commands[$item]);
        }, $commands);
    }
402561
def delete_local_variable(self, onnx_name):
        '''
        
        '''
        if onnx_name not in self.onnx_variable_names or onnx_name not in self.variables:
            raise RuntimeError('The variable to be removed not found')
        self.onnx_variable_names.discard(onnx_name)
        raw_name = self.variables[onnx_name].raw_name
        self.variable_name_mapping[raw_name].remove(onnx_name)
        del self.variables[onnx_name]
240358
function(_part){
        if (!_part||!_part.length) return;
        _part.shift(); // remove macro key word
        var _name = _part[0].split('(')[0];
        return 'var '+_name+' = function'+_part.join('').replace(_name,'')+'{var __OUT=[];';
    }
1204441
def reset(self):
        '''
        
        '''
        self.parameters = []
        self.transformed_parameters = []
        self.expressions = []
        self.data = []
        self.transformed_data = []
        self.X = {}
        self.model = []
        self.mu_cont = []
        self.mu_cat = []
        self._original_names = {}
        # variables to suppress in output. Stan uses limited set for variable
        # names, so track variable names we may need to simplify for the model
        # code and then sub back later.
        self._suppress_vars = ['yhat', 'lp__']
1147759
private void reflectionStrippedProcessing() {
        HashMap<Object, Object> newEntries = new HashMap<>();
        for (Map.Entry<Object, Object> entry : props.entrySet()) {
            String key = (String) entry.getKey();
            int index = key.lastIndexOf('.');
            if (index == -1 || index == 0 || index == key.length() - 1) {
                continue;
            }
            String prefix = key.substring(0, index);
            String suffix = key.substring(index + 1);
            String newKey = ReflectionUtil.getCamelCase(prefix) + "." + suffix;
            if (!props.containsKey(newKey)) {
                newEntries.put(newKey, entry.getValue());
            }
        }
        props.putAll(newEntries);
    }
598048
def remove_variable(self, name):
        """"""
        index = self._get_var_index(name)
        # Remove from matrix
        self._A = np.delete(self.A, index, 1)
        # Remove from bounds
        del self.bounds[name]
        # Remove from var list
        del self._variables[name]
        self._update_variable_indices()
        self._reset_solution()
750096
def remove_data_flows_with_data_port_id(self, data_port_id):
        
        # delete all data flows in parent related to data_port_id and self.state_id = external data flows
        # checking is_root_state_of_library is only necessary in case of scoped variables, as the scoped variables
        # they are not destroyed by the library state, as the library state does not have a reference to the scoped vars
        if not self.is_root_state and not self.is_root_state_of_library:
            data_flow_ids_to_remove = []
            for data_flow_id, data_flow in self.parent.data_flows.items():
                if data_flow.from_state == self.state_id and data_flow.from_key == data_port_id or \
                                        data_flow.to_state == self.state_id and data_flow.to_key == data_port_id:
                    data_flow_ids_to_remove.append(data_flow_id)

            for data_flow_id in data_flow_ids_to_remove:
                self.parent.remove_data_flow(data_flow_id)

        # delete all data flows in self related to data_port_id and self.state_id = internal data flows
        data_flow_ids_to_remove = []
        for data_flow_id, data_flow in self.data_flows.items():
            if data_flow.from_state == self.state_id and data_flow.from_key == data_port_id or \
                                    data_flow.to_state == self.state_id and data_flow.to_key == data_port_id:
                data_flow_ids_to_remove.append(data_flow_id)

        for data_flow_id in data_flow_ids_to_remove:
            self.remove_data_flow(data_flow_id)
1295791
public function resetStaticVariables()
    {
        \oxArticleHelper::cleanup();
        \oxSeoEncoderHelper::cleanup();
        \oxDeliveryHelper::cleanup();
        \oxManufacturerHelper::cleanup();
        \oxAdminViewHelper::cleanup();
        \oxVendorHelper::cleanup();
    }
1204937
def stripped_name(self):
        """"""

        name = self.name

        # Strip function parameters from name by recursively removing paired parenthesis
        while True:
            name, n = self._parenthesis_re.subn('', name)
            if not n:
                break

        # Strip const qualifier
        name = self._const_re.sub('', name)

        # Strip template parameters from name by recursively removing paired angles
        while True:
            name, n = self._angles_re.subn('', name)
            if not n:
                break

        return name
1015127
private void restoreNestedVariables() {
	if (nestedVars != null) {
	    Iterator iter = nestedVars.iterator();
	    while (iter.hasNext()) {
		String varName = (String) iter.next();
		varName = findAlias(varName);
		Object obj = originalNestedVars.get(varName);
		if (obj != null) {
		    invokingJspCtxt.setAttribute(varName, obj);
		} else {
		    invokingJspCtxt.removeAttribute(varName, PAGE_SCOPE);
		}
	    }
	}
    }
940104
def trim(self):
        """"""
        for key, value in list(iteritems(self.counters)):
            if value.empty():
                del self.counters[key]
953748
private void handleMainMethodIfPresent(List methods) {
        boolean found = false;
        for (Iterator iter = methods.iterator(); iter.hasNext();) {
            MethodNode node = (MethodNode) iter.next();
            if(node.getName().equals("main")) {
                if (node.isStatic() && node.getParameters().length == 1) {
                    boolean retTypeMatches, argTypeMatches;
                    ClassNode argType = node.getParameters()[0].getType();
                    ClassNode retType = node.getReturnType();

                    argTypeMatches = (argType.equals(ClassHelper.OBJECT_TYPE) || argType.getName().contains("String[]"));
                    retTypeMatches = (retType == ClassHelper.VOID_TYPE || retType == ClassHelper.OBJECT_TYPE);
                    
                    if(retTypeMatches && argTypeMatches) {
                        if(found) {
                            throw new RuntimeException("Repetitive main method found.");
                        } else {
                            found = true;
                        }
                        // if script has both loose statements as well as main(), then main() is ignored
                        if(statementBlock.isEmpty()) {
                            addStatement(node.getCode());
                        }
                        iter.remove();
                    }
                }
            }
        }
    }
1227112
def _rebind_variables(self, new_inputs):
        
        expr = self._expr

        # If we have 11+ variables, some of our variable names may be
        # substrings of other variable names. For example, we might have x_1,
        # x_10, and x_100. By enumerating in reverse order, we ensure that
        # every variable name which is a substring of another variable name is
        # processed after the variable of which it is a substring. This
        # guarantees that the substitution of any given variable index only
        # ever affects exactly its own index. For example, if we have variables
        # with indices going up to 100, we will process all of the x_1xx names
        # before x_1x, which will be before x_1, so the substitution of x_1
        # will not affect x_1x, which will not affect x_1xx.
        for idx, input_ in reversed(list(enumerate(self.inputs))):
            old_varname = "x_%d" % idx
            # Temporarily rebind to x_temp_N so that we don't overwrite the
            # same value multiple times.
            temp_new_varname = "x_temp_%d" % new_inputs.index(input_)
            expr = expr.replace(old_varname, temp_new_varname)
        # Clear out the temp variables now that we've finished iteration.
        return expr.replace("_temp_", "_")
1224247
def clear(self):
        
        vname = self.varname
        if self.path.exists():
            logger.debug('deleting cached work: {}'.format(self.path))
            self.path.unlink()
        if self.owner is not None and hasattr(self.owner, vname):
            logger.debug('removing instance var: {}'.format(vname))
            delattr(self.owner, vname)
        self.clear_global()
407386
public void removeName(int i)
   {
      Object name = indexes.remove(i);
      names.remove(name);
      dirty = true;
   }