remove refs/ from "refs/heads/ping/foo-bar"
332268
def remove_prefix_refs(ref)
      regex = %r{\Arefs/(?<stripped_ref>.+)\Z}
      match = regex.match(ref)
      fail InvalidRefPrefixError, "ref: #{ref}" unless match
      match[:stripped_ref]
    end
601146
def remove(src, rel, dst):
    
    smt = 'DELETE FROM %s' % rel
    queries = []
    params = []

    if src is not None:
        queries.append('src = ?')
        params.append(src)

    if dst is not None:
        queries.append('dst = ?')
        params.append(dst)

    if not queries:
        return smt, params
    smt = '%s WHERE %s' % (smt, ' AND '.join(queries))
    return smt, params
690850
private function clearSigHandlers() {
        pcntl_signal(SIGTERM, SIG_DFL);
        pcntl_signal(SIGINT,  SIG_DFL);
        pcntl_signal(SIGQUIT, SIG_DFL);
        pcntl_signal(SIGUSR1, SIG_DFL);
        pcntl_signal(SIGUSR2, SIG_DFL);
        pcntl_signal(SIGCONT, SIG_DFL);
    }
1163087
def delete(*keys, **connection_args):
    '''
    
    '''
    # Get connection args from keywords if set
    conn_args = {}
    for arg in ['host', 'port', 'db', 'password']:
        if arg in connection_args:
            conn_args[arg] = connection_args[arg]

    server = _connect(**conn_args)
    return server.delete(*keys)
398325
def remove_unnecessary_stuff(self):
        

        glibc_functions_blacklist = {
            '_start',
            '_init',
            '_fini',
            '__gmon_start__',
            '__do_global_dtors_aux',
            'frame_dummy',
            'atexit',
            'deregister_tm_clones',
            'register_tm_clones',
            '__x86.get_pc_thunk.bx',
            '__libc_csu_init',
            '__libc_csu_fini',
        }

        glibc_data_blacklist = {
            '__TMC_END__',
            '_GLOBAL_OFFSET_TABLE_',
            '__JCR_END__',
            '__dso_handle',
            '__init_array_start',
            '__init_array_end',

            #
            'stdout',
            'stderr',
            'stdin',
            'program_invocation_short_',
            'program_invocation_short_name',
            'program_invocation_name',
            '__progname_full',
            '_IO_stdin_used',
            'obstack_alloc_failed_hand',
            'optind',
            'optarg',
            '__progname',
            '_environ',
            'environ',
            '__environ',
        }

        glibc_references_blacklist = {
            'frame_dummy',
            '__do_global_dtors_aux',
        }

        self.procedures = [p for p in self.procedures if p.name not in glibc_functions_blacklist and not p.is_plt]

        self.data = [d for d in self.data if not any(lbl.name in glibc_data_blacklist for _, lbl in d.labels)]

        for d in self.data:
            if d.sort == 'pointer-array':
                for i in range(len(d.content)):
                    ptr = d.content[i]
                    if isinstance(ptr, Label) and ptr.name in glibc_references_blacklist:
                        d.content[i] = 0
498476
def clean_meta(meta, including_info=False, logger=None):
    
    modified = set()

    for key in meta.keys():
        if [key] not in METAFILE_STD_KEYS:
            if logger:
                logger("Removing key %r..." % (key,))
            del meta[key]
            modified.add(key)

    if including_info:
        for key in meta["info"].keys():
            if ["info", key] not in METAFILE_STD_KEYS:
                if logger:
                    logger("Removing key %r..." % ("info." + key,))
                del meta["info"][key]
                modified.add("info." + key)

        for idx, entry in enumerate(meta["info"].get("files", [])):
            for key in entry.keys():
                if ["info", "files", key] not in METAFILE_STD_KEYS:
                    if logger:
                        logger("Removing key %r from file #%d..." % (key, idx + 1))
                    del entry[key]
                    modified.add("info.files." + key)

            # Remove crap that certain PHP software puts in paths
            entry["path"] = [i for i in entry["path"] if i]

    return modified
955865
def remove_headerReference(self, type_):
        """"""
        headerReference = self.get_headerReference(type_)
        rId = headerReference.rId
        self.remove(headerReference)
        return rId
1355412
def _cleanup(self, ref):
        ''
        self.transitor_states[self._weakref_holder[ref]] -= 1
        del self._weakref_holder[ref]
1198032
function cleanup()
    {
      if(chan.timer) clearTimeout(chan.timer);
      chan.timer = setTimeout(function(){
        chan.state = "gone"; // in case an app has a reference
        x.channels[chan.id] = {state:"gone"}; // remove our reference for gc
      }, chan.timeout);
    }
484113
def disable(name, **kwargs):
    '''
    
    '''
    osmajor = _osrel()[0]
    if osmajor < '6':
        cmd = 'update-rc.d -f {0} remove'.format(name)
    else:
        cmd = 'update-rc.d {0} disable'.format(name)
    return not __salt__['cmd.retcode'](cmd)
842839
def clear(self):
        """"""
        super(Router, self).clear()
        for name in self.todo:
            filename = os.path.join(self.migrate_dir, name + '.py')
            os.remove(filename)
5057
function handleFindRefs (refsResp) {
            if (!refsResp || !refsResp.references || !refsResp.references.refs) {
                return;
            }

            var inlineWidget = EditorManager.getFocusedInlineWidget(),
                editor = EditorManager.getActiveEditor(),
                refs = refsResp.references.refs,
                type = refsResp.references.type;

            //In case of inline widget if some references are outside widget's text range then don't allow for rename
            if (inlineWidget) {
                var isInTextRange  = !refs.find(function(item) {
                    return (item.start.line < inlineWidget._startLine || item.end.line > inlineWidget._endLine);
                });
                
                if (!isInTextRange) {
                    editor.displayErrorMessageAtCursor(Strings.ERROR_RENAME_QUICKEDIT);
                    return;
                }
            }

            var currentPosition = editor.posFromIndex(refsResp.offset),
                refsArray = refs;
            if (type !== "local") {
                refsArray = refs.filter(function (element) {
                    return isInSameFile(element, refsResp);
                });
            }

            // Finding the Primary Reference in Array
            var primaryRef = refsArray.find(function (element) {
                return ((element.start.line === currentPosition.line || element.end.line === currentPosition.line)
                        && currentPosition.ch <= element.end.ch && currentPosition.ch >= element.start.ch);
            });
            // Setting the primary flag of Primary Refence to true
            primaryRef.primary = true;

            editor.setSelections(refsArray);
        }
79061
def disable(cls):
        
        # Skip if not on Windows.
        if not IS_WINDOWS:
            return False

        # Restore default colors.
        if hasattr(sys.stderr, '_original_stream'):
            getattr(sys, 'stderr').color = None
        if hasattr(sys.stdout, '_original_stream'):
            getattr(sys, 'stdout').color = None

        # Restore original streams.
        changed = False
        if hasattr(sys.stderr, '_original_stream'):
            changed = True
            sys.stderr = getattr(sys.stderr, '_original_stream')
        if hasattr(sys.stdout, '_original_stream'):
            changed = True
            sys.stdout = getattr(sys.stdout, '_original_stream')

        return changed
1227059
def cleanup():
    
    script_dir = os.path.dirname(__file__) if not os.path.islink(__file__) else os.path.dirname(os.readlink(__file__))
    script_dir = os.path.realpath(os.path.join(script_dir, ".."))
    shutil.rmtree(os.path.join(script_dir, "dist"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "tmp"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh.egg-info"), ignore_errors=True)
    shutil.rmtree(os.path.join(script_dir, "src", "urh", "tmp"), ignore_errors=True)
213321
protected function removePhars()
    {
        $path = \Yii::getAlias($this->module->path);

        foreach (['', '.gz', '.bz2'] as $extension) {
            $fullPath = $path . DIRECTORY_SEPARATOR . $extension;
            if (file_exists($fullPath) === true) {
                \Phar::unlinkArchive($fullPath);
            }
        }
    }
536016
def remove_defaults(self, *args):
        '''
        
        '''
        rms = set(arg for aa in args for arg in ([aa] if isinstance(aa, six.string_types) else aa))
        for arg in rms:
            if arg not in self.defaults:
                raise KeyError('{0}'.format(arg))
        return self.discard_defaults(*args)
455116
function removeChecksum(fs, path, callback) {
  removeAttr(fs, path, constants.attributes.checksum, callback);
}