Return /etc/lsb-release in a dict
433021
def lsb_release():
    """"""
    d = {}
    with open('/etc/lsb-release', 'r') as lsb:
        for l in lsb:
            k, v = l.split('=')
            d[k.strip()] = v.strip()
    return d
943482
def release(*args):
    '''
    
    '''
    for i in args:
           win32api.keybd_event(VK_CODE[i],0 ,win32con.KEYEVENTF_KEYUP ,0)
1372381
def _format_return_data(retcode, stdout=None, stderr=None):
    '''
    
    '''
    ret = {'retcode': retcode}
    if stdout is not None:
        ret['stdout'] = stdout
    if stderr is not None:
        ret['stderr'] = stderr
    return ret
230818
def each
      callback = lambda do |key, value, _|
        yield [Base.typecast(key).retain.release_on_gc, Base.typecast(value).retain.release_on_gc]
      end
      CF.CFDictionaryApplyFunction(self, callback, nil)
      self
    end
1091652
def _parse_os_release(*os_release_files):
    '''
    
    '''
    ret = {}
    for filename in os_release_files:
        try:
            with salt.utils.files.fopen(filename) as ifile:
                regex = re.compile('^([\\w]+)=(?:\'|")?(.*?)(?:\'|")?$')
                for line in ifile:
                    match = regex.match(line.strip())
                    if match:
                        # Shell special characters ("$", quotes, backslash,
                        # backtick) are escaped with backslashes
                        ret[match.group(1)] = re.sub(
                            r'\\([$"\'\\`])', r'\1', match.group(2)
                        )
            break
        except (IOError, OSError):
            pass

    return ret
244167
def verbosedump(value, fn, compress=None):
    """"""
    print('Saving "%s"... (%s)' % (fn, type(value)))
    dump(value, fn, compress=compress)
25119
def release(self):
        """"""
        success, _ = self.etcd_client.transaction(
            compare=[
                self.etcd_client.transactions.value(self.key) == self.uuid
            ],
            success=[self.etcd_client.transactions.delete(self.key)],
            failure=[]
        )
        return success
313292
def smove(self, sourcekey, destkey, member):
        """"""
        return self.execute(b'SMOVE', sourcekey, destkey, member)
328587
def c_ls(api, args, verbose=False):
    
    obj = api.get_object(args['<URL>'].split('/')[-1])
    res = []
    for bitstream in obj.bitstreams:
        res.append((
            api.url(bitstream),
            bitstream._properties['content-type'],
            bitstream._properties['filesize'],
            datetime.fromtimestamp(bitstream._properties['last-modified'] / 1000.0)
        ))
    if args['-t']:
        res = sorted(res, key=lambda t: t[3], reverse=True)
    elif args['-s']:
        res = sorted(res, key=lambda t: t[2], reverse=True)
    if args['-r']:
        res = reversed(res)

    for r in res:
        yield '{0}\t{1}\t{2:>8}\t{3}'.format(*r) if verbose else r[0]
819553
def allowed(self, method, _dict, allow):
        
        for key in _dict.keys():
            if key not in allow:
                raise LunrError("'%s' is not an argument for method '%s'"
                                % (key, method))
39092
def ctx(self):
        '''
        
        '''
        if six.PY2:
            return contextlib.nested(
                self.functions.context_dict.clone(),
                self.returners.context_dict.clone(),
                self.executors.context_dict.clone(),
            )
        else:
            exitstack = contextlib.ExitStack()
            exitstack.enter_context(self.functions.context_dict.clone())
            exitstack.enter_context(self.returners.context_dict.clone())
            exitstack.enter_context(self.executors.context_dict.clone())
            return exitstack
491249
def _conditional_exits(self, block_addr):
        

        vex_block = self.project.factory.block(block_addr).vex
        lst = [ ]

        for i, stmt in enumerate(vex_block.statements):
            if isinstance(stmt, pyvex.IRStmt.Exit):
                lst.append(i)

        return lst
1152686
function restoreLib(err1)
    {
      fs.move(ORIG, LIB, {clobber: true}, function(err2)
      {
        callback(err1 || err2)
      })
    }
964089
def _lsb_release_info(self):
        
        if not self.include_lsb:
            return {}
        with open(os.devnull, 'w') as devnull:
            try:
                cmd = ('lsb_release', '-a')
                stdout = subprocess.check_output(cmd, stderr=devnull)
            except OSError:  # Command not found
                return {}
        content = stdout.decode(sys.getfilesystemencoding()).splitlines()
        return self._parse_lsb_release_content(content)
759342
def run_sls_remove(sls_cmd, env_vars):
    """"""
    sls_process = subprocess.Popen(sls_cmd,
                                   stdout=subprocess.PIPE,
                                   env=env_vars)
    stdoutdata, _stderrdata = sls_process.communicate()
    sls_return = sls_process.wait()
    print(stdoutdata)
    if sls_return != 0 and (sls_return == 1 and not (
            re.search(r"Stack '.*' does not exist", stdoutdata))):
        sys.exit(sls_return)
738005
def _flatten_ex_dict(self):
        """"""
        odict = {}
        for _, fdict in self._ex_dict.items():
            for (extype, exmsg), value in fdict.items():
                key = value["name"]
                odict[key] = copy.deepcopy(value)
                del odict[key]["name"]
                odict[key]["type"] = extype
                odict[key]["msg"] = exmsg
        return odict
702671
def format_single_dict(dictionary, output_name):
        '''
            
        '''
        output_payload = {}
        if dictionary:
            for (k, v) in dictionary.items():
                output_payload[output_name + '[' + k + ']'] = v
        return output_payload