Show flag names and handle dict size.
161901
def get_file_flags(flags):
    
    res = render_flags(flags & ~rf.RAR_FILE_DICTMASK, file_bits)

    xf = (flags & rf.RAR_FILE_DICTMASK) >> 5
    res += "," + file_parms[xf]
    return res
577980
def get_dimensions(self):
        """"""
        return FrozenOrderedDict((k, len(v)) for k, v in self.ds.dimensions.items())
853276
def _count_sizes(self):
        
        format_list = []
        header_sepa_format_list = []
        # actual widths of columns
        self.col_widths = {}

        for col in self.col_list:
            col_length = self.col_longest[col]
            col_width = col_length + self._separate()
            # -2 is for implicit separator -- spaces around
            format_list.append(" {%s:%d} " % (col, col_width - 2))
            header_sepa_format_list.append("{%s:%d}" % (col, col_width))
            self.col_widths[col] = col_width

        logger.debug("column widths %s", self.col_widths)

        self.format_str = "|".join(format_list)

        self.header_format_str = "+".join(header_sepa_format_list)
        self.header_data = {}
        for k in self.col_widths:
            self.header_data[k] = "-" * self.col_widths[k]
611227
def size(self):
        ''''''
        count = 0
        cursor = self._db_coll.find()
        for item in cursor:
            if item['origin'] == '@_abbreviations':
                continue
            count += len(item['rels'])
        return count
1260048
def flag_to_list(flagval, flagtype):
    """"""
    if flagtype == 'int':
        return [int(_) for _ in flagval.split(',') if _]

    elif flagtype == 'float':
        return [float(_) for _ in flagval.split(',') if _]

    elif flagtype == 'str':
        return [_ for _ in flagval.split(',') if _]

    else:
        raise Exception("incorrect type")
970424
def _len_dict(obj):
    '''
    '''
    n = len(obj)  # active items
    if n < 6:  # ma_smalltable ...
       n = 0  # ... in basicsize
    else:  # at least one unused
       n = _power2(n + 1)
    return n
25750
def sizes(self):
        
        json = self.request('/sizes', method='GET')
        status = json.get('status')
        if status == 'OK':
            sizes_json = json.get('sizes', [])
            sizes = [Size.from_json(s) for s in sizes_json]
            return sizes
        else:
            message = json.get('message')
            raise DOPException('[%s]: %s' % (status, message))
441605
def _GetFlagValues(self, flags):
    
    event_types = []
    for event_flag, description in self._FLAG_VALUES.items():
      if event_flag & flags:
        event_types.append(description)
    return ', '.join(event_types)
913210
def get_size_in_bytes(self, handle):
        """"""
        fpath = self._fpath_from_handle(handle)
        return os.stat(fpath).st_size
1169448
def flags_from_dict(kw):
    

    if len(kw) == 0:
        return ''

    flags = ''
    for (k, v) in kw.items():
        if v:
            flags += ' ' + str(k)
    # note that we want the leading space if there's at least one
    # flag.
    return flags
899144
def with_sizes(self, *headers):
        ''''''
        if len(headers) != 5:
            raise ValueError('You need to provide this headers: class, method, times, total, average')

        summary = self.summary()

        for row in summary.values():
            sizes = [len(header) for header in headers]
            # Benchmark/Class column
            sizes[0] = max(sizes[0], len(row['name']))
            # Method column
            max_length = max(len(r['name']) for r in row['runs'].values())
            sizes[1] = max(sizes[1], max_length)
            # Times column
            sizes[2] = max(sizes[2], len(str(row['times'])))
            # Float columns
            for idx, field in [(3, 'total'), (4, 'mean')]:
                float_len = lambda r: len(self.float(r[field]))
                max_length = max(float_len(r) for r in row['runs'].values())
                sizes[idx] = max(sizes[idx], max_length)
            row['sizes'] = sizes

        return summary
418485
def getnamedargs(*args, **kwargs):
    """"""
    adict = {}
    for arg in args:
        if isinstance(arg, dict):
            adict.update(arg)
    adict.update(kwargs)
    return adict
1321415
def to_dict(self):
        
        return dict((k, self.get(k)) for k in self.flags.keys())
91682
def _define_absl_flags(self, absl_flags):
    """"""
    key_flags = set(absl_flags.get_key_flags_for_module(sys.argv[0]))
    for name in absl_flags:
      if name in _BUILT_IN_FLAGS:
        # Do not inherit built-in flags.
        continue
      flag_instance = absl_flags[name]
      # Each flags with short_name appears in FLAGS twice, so only define
      # when the dictionary key is equal to the regular name.
      if name == flag_instance.name:
        # Suppress the flag in the help short message if it's not a main
        # module's key flag.
        suppress = flag_instance not in key_flags
        self._define_absl_flag(flag_instance, suppress)
117405
def tensor_size_guidance_from_flags(flags):
  """"""

  tensor_size_guidance = dict(DEFAULT_TENSOR_SIZE_GUIDANCE)
  if not flags or not flags.samples_per_plugin:
    return tensor_size_guidance

  for token in flags.samples_per_plugin.split(','):
    k, v = token.strip().split('=')
    tensor_size_guidance[k] = int(v)

  return tensor_size_guidance
672
def get_size(objects):
    """"""
    res = 0
    for o in objects:
        try:
            res += _getsizeof(o)
        except AttributeError:
            print("IGNORING: type=%s; o=%s" % (str(type(o)), str(o)))
    return res
489706
def get_flagged_names():
    """"""

    l = []
    for w in _widget_cache.values():
        if w.flagged:
            l.append(w.get_node().get_value())
    return l