values needed to display the inode in ls-style format.
481242
@Override
  void visit(ImageElement element, String value) throws IOException {
    if(inInode) {
      switch(element) {
      case INODE_PATH:
        if(value.equals("")) path = "/";
        else path = value;
        break;
      case PERMISSION_STRING:
        perms = value;
        break;
      case REPLICATION:
        replication = value;
        break;
      case USER_NAME:
        username = value;
        break;
      case GROUP_NAME:
        group = value;
        break;
      case NUM_BYTES:
        filesize += Long.valueOf(value);
        break;
      case MODIFICATION_TIME:
        modTime = value;
        break;
      case SYMLINK:
        linkTarget = value;
        break;
      case INODE_TYPE:
        type = value;
        break;
      case INODE_HARDLINK_ID:
        hardlinkId = value;
        break;
      default:
        // This is OK.  We're not looking for all the values.
        break;
      }
    }
  }
1177639
def ls(self, what):
        """"""
        for i in getattr(self.system, what):
            self.logger.info('%s: %s: %s', i.__class__.__name__, i, i.status)
        return True
825260
def Lr(self,value):
        
        assert value.shape[0]==self._N, 'dimension mismatch'
        assert value.shape[1]==self._N, 'dimension mismatch'
        self._Lr = value
        self.clear_cache('Fstar','Ystar1','Ystar','Yhat','Xstar','Xhat',
                         'Areml','Areml_eigh','Areml_chol','Areml_inv','beta_hat','B_hat',
                         'LRLdiag_Xhat_tens','LRLdiag_Yhat','Areml_grad',
                         'beta_grad','Xstar_beta_grad',
                         'LRLdiag_Xhat_tens','LRLdiag_Yhat','Areml_grad',
                         'beta_grad','Xstar_beta_grad','Zstar','DLZ')
255972
def parse_ls(out):
    

    # assumed ls -lR line format:
    # -rw-r--r-- root     shell           0 2013-07-05 02:26 tasks
    # drwxr-xr-x root     root              2013-07-05 02:26 log
    # brw------- root     root     179,   0 2013-07-05 02:26 mmcblk0
    # lrwxrwxrwx root     root              2013-07-05 02:34 subsystem -> ../class/bdi

    # CAVE: format may change through versions.
    # TODO: implement plausibility test.

    mode = r'^(.)'
    field = r'([^ ]+) +'
    dev = r'(\d+), +(\d+) '
    date = r'(\d{4}\-\d{2}\-\d{2} \d{2}:\d{2}) '
    name = r'(.+)$'
    link = r'(.+) -> (.+)$'

    logger = get_default_logger()

    # adb returns newline as \r\n
    # but mozdevice uses \n
    for dirstr in out[2:-2].split('\r\n\r\n'):
        lines = dirstr.split('\r\n')
        dirname = lines[0][:-1]
        if len(lines) == 2 and lines[1].startswith("opendir failed"):
            continue
        for filestr in lines[1:]:
            if filestr.endswith(": No such file or directory"):
                continue
            if filestr.endswith(": Permission denied"):
                continue
            specs = None
            if filestr[0] in 'dsp':  # directory, socket, pipe
                regexp = mode + field * 3 + date + name
                m = re.search(regexp, filestr)
                specs = {
                'mode': m.group(1),
                'perm': m.group(2),
                'uid': m.group(3),
                'gid': m.group(4),
                'date': m.group(5),
                'name': m.group(6)
                }
            elif filestr[0] == 'l':  # symbolic link
                regexp = mode + field * 3 + date + link
                m = re.search(regexp, filestr)
                specs = {
                'mode': m.group(1),
                'perm': m.group(2),
                'uid': m.group(3),
                'gid': m.group(4),
                'date': m.group(5),
                'name': m.group(6),
                'link': m.group(7)
                }
            elif filestr[0] in 'cb':  # device
                regexp = mode + field * 3 + dev + date + name
                m = re.search(regexp, filestr)
                specs = {
                'mode': m.group(1),
                'perm': m.group(2),
                'uid': m.group(3),
                'gid': m.group(4),
                'major': m.group(5),
                'minor': m.group(6),
                'date': m.group(7),
                'name': m.group(8)
                }
            else:  # rest
                try:
                    regexp = mode + field * 4 + date + name
                    m = re.search(regexp, filestr)
                    specs = {
                    'mode': m.group(1),
                    'perm': m.group(2),
                    'uid': m.group(3),
                    'gid': m.group(4),
                    'size': m.group(5),
                    'date': m.group(6),
                    'name': m.group(7)
                    }
                except:
                    logger.error("parse error on %s" % filestr)

            try:
                specs['name'] = '/' + os.path.relpath("%s/%s" % (dirname, specs['name']), '/')
                if 'link' in specs.keys():
                    specs['link'] = '/' + os.path.relpath("%s/%s" % (dirname, specs['link']), '/')
            except:
                logger.warning("no name from %s" % filestr)

            yield specs
1221464
def _key_values(self, sn: "SequenceNode") -> Union[EntryKeys, EntryValue]:
        """"""
        try:
            keys = self.up_to("/")
        except EndOfInput:
            keys = self.remaining()
        if not keys:
            raise UnexpectedInput(self, "entry value or keys")
        if isinstance(sn, LeafListNode):
            return EntryValue(unquote(keys))
        ks = keys.split(",")
        try:
            if len(ks) != len(sn.keys):
                raise UnexpectedInput(self, f"exactly {len(sn.keys)} keys")
        except AttributeError:
            raise BadSchemaNodeType(sn.qual_name, "list")
        sel = {}
        for j in range(len(ks)):
            knod = sn.get_data_child(*sn.keys[j])
            val = unquote(ks[j])
            sel[(knod.name, None if knod.ns == sn.ns else knod.ns)] = val
        return EntryKeys(sel)
598958
def read_lsm_positions(fh):
    """"""
    size = struct.unpack('<I', fh.read(4))[0]
    return fh.read_array('<2f8', count=size)
1247920
def _pstorestr(ins):
    
    output = []
    temporal = False

    # 2nd operand first, because must go into the stack
    value = ins.quad[2]

    if value[0] == '*':
        value = value[1:]
        indirect = True
    else:
        indirect = False

    if value[0] == '_':
        output.append('ld de, (%s)' % value)

        if indirect:
            output.append('call __LOAD_DE_DE')
            REQUIRES.add('lddede.asm')

    elif value[0] == '#':
        output.append('ld de, %s' % value[1:])
    else:
        output.append('pop de')
        temporal = value[0] != '$'
        if indirect:
            output.append('call __LOAD_DE_DE')
            REQUIRES.add('lddede.asm')

    # Now 1st operand
    value = ins.quad[1]
    if value[0] == '*':
        value = value[1:]
        indirect = True
    else:
        indirect = False

    I = int(value)
    if I >= 0:
        I += 4  # Return Address + "push IX"

    output.append('ld bc, %i' % I)

    if not temporal:
        if indirect:
            output.append('call __PISTORE_STR')
            REQUIRES.add('storestr.asm')
        else:
            output.append('call __PSTORE_STR')
            REQUIRES.add('pstorestr.asm')
    else:
        if indirect:
            output.append('call __PISTORE_STR2')
            REQUIRES.add('storestr2.asm')
        else:
            output.append('call __PSTORE_STR2')
            REQUIRES.add('pstorestr2.asm')

    return output
697120
def ini2value(ini_content):
    
    from mo_future import ConfigParser, StringIO

    buff = StringIO(ini_content)
    config = ConfigParser()
    config._read(buff, "dummy")

    output = {}
    for section in config.sections():
        output[section]=s = {}
        for k, v in config.items(section):
            s[k]=v
    return wrap(output)
750972
def _values(self):
        """"""
        if self.interpolate:
            return [
                val[0] for serie in self.series for val in serie.interpolated
            ]
        else:
            return super(Line, self)._values
808854
private static String getFullPathName(INode[] inodes, int pos) {
    StringBuilder fullPathName = new StringBuilder();
    for (int i=1; i<=pos; i++) {
      fullPathName.append(Path.SEPARATOR_CHAR).append(inodes[i].getLocalName());
    }
    return fullPathName.toString();
  }
728645
private String formatMDLInt(int i, int l) {
        String s = "", fs = "";
        NumberFormat nf = NumberFormat.getNumberInstance(Locale.ENGLISH);
        nf.setParseIntegerOnly(true);
        nf.setMinimumIntegerDigits(1);
        nf.setMaximumIntegerDigits(l);
        nf.setGroupingUsed(false);
        s = nf.format(i);
        l = l - s.length();
        for (int f = 0; f < l; f++)
            fs += " ";
        fs += s;
        return fs;
    }
513279
def _ltf(ins):
    ''' 
    '''
    op1, op2 = tuple(ins.quad[2:])
    output = _float_oper(op1, op2)
    output.append('call __LTF')
    output.append('push af')
    REQUIRES.add('ltf.asm')
    return output
403414
def _retstr(ins):
    
    tmp, output = _str_oper(ins.quad[1], no_exaf=True)

    if not tmp:
        output.append('call __LOADSTR')
        REQUIRES.add('loadstr.asm')

    output.append('#pragma opt require hl')
    output.append('jp %s' % str(ins.quad[2]))
    return output
288761
static byte[][] getINodeByteArray(INode inode) throws IOException {
    // calculate the depth of this inode from root
    int depth = getPathDepth(inode);
    
    byte[][] names = new byte[depth][];

    // fill up the inodes in the path from this inode to root
    for (int i = 0; i < depth; i++) {
      names[depth-i-1] = inode.getLocalNameBytes();
      inode = inode.parent;
    }
    return names;
  }
848988
def _write_ini(source_dict, namespace_name=None, level=0, indent_size=4,
                   output_stream=sys.stdout):
        """"""
        options = [
            value
            for value in source_dict.values()
            if isinstance(value, Option)
        ]
        options.sort(key=lambda x: x.name)
        indent_spacer = " " * (level * indent_size)
        for an_option in options:
            print("%s# %s" % (indent_spacer, an_option.doc),
                  file=output_stream)
            option_value = to_str(an_option)

            if an_option.reference_value_from:
                print(
                    '%s# see "%s.%s" for the default or override it here' % (
                        indent_spacer,
                        an_option.reference_value_from,
                        an_option.name
                    ),
                    file=output_stream
                )

            if an_option.likely_to_be_changed or an_option.has_changed:
                option_format = '%s%s=%s\n'
            else:
                option_format = '%s#%s=%s\n'

            if isinstance(option_value, six.string_types) and \
                    ',' in option_value:
                # quote lists unless they're already quoted
                if option_value[0] not in '\'"':
                    option_value = '"%s"' % option_value

            print(option_format % (indent_spacer, an_option.name,
                                   option_value),
                  file=output_stream)
        next_level = level + 1
        namespaces = [
            (key, value)
            for key, value in source_dict.items()
            if isinstance(value, Namespace)
        ]
        namespaces.sort(key=ValueSource._namespace_reference_value_from_sort)
        for key, namespace in namespaces:
            next_level_spacer = " " * next_level * indent_size
            print("%s%s%s%s\n" % (indent_spacer, "[" * next_level, key,
                                  "]" * next_level),
                  file=output_stream)
            if namespace._doc:
                print("%s%s" % (next_level_spacer, namespace._doc),
                      file=output_stream)
            if namespace._reference_value_from:
                print("%s#+include ./common_%s.ini\n"
                      % (next_level_spacer, key), file=output_stream)

            if namespace_name:
                ValueSource._write_ini(
                    source_dict=namespace,
                    namespace_name="%s.%s" % (namespace_name, key),
                    level=level+1,
                    indent_size=indent_size,
                    output_stream=output_stream
                )
            else:
                ValueSource._write_ini(
                    source_dict=namespace,
                    namespace_name=key,
                    level=level+1,
                    indent_size=indent_size,
                    output_stream=output_stream
                )
735901
def node_to_ini(node, output=sys.stdout):
    
    for subnode in node:
        output.write(u'\n[%s]\n' % subnode.tag)
        for name, value in sorted(subnode.attrib.items()):
            output.write(u'%s=%s\n' % (name, value))
    output.flush()
970553
def display(self):
        
        for line in self.adb_shell('dumpsys display').splitlines():
            m = _DISPLAY_RE.search(line, 0)
            if not m:
                continue
            w = int(m.group('width'))
            h = int(m.group('height'))
            return collections.namedtuple('Display', ['width', 'height'])(w, h)
        else:
            w, h = self.info['displayWidth'], self.info['displayHeight']
            return collections.namedtuple('Display', ['width', 'height'])(w, h)