Returns attributes formatted as markdown with optional
        format argument to determine order of attribute contents.
18133
def to_markdown(self, format='{id} {classes} {kvs}', surround=True):
        
        id = '#' + self.id if self.id else ''
        classes = ' '.join('.' + cls for cls in self.classes)
        kvs = ' '.join('{}={}'.format(k, v) for k, v in self.kvs.items())

        attrs = format.format(id=id, classes=classes, kvs=kvs).strip()

        if surround:
            return '{' + attrs + '}'
        elif not surround:
            return attrs
305920
public String asString()
    {
        TreeMap<Tag, Value> orderedAttributes = new TreeMap<Tag, Value>(attributes);
        StringBuilder result = new StringBuilder();
        for (Iterator<Map.Entry<Tag, Value>> entries = orderedAttributes.entrySet().iterator(); entries.hasNext(); )
        {
            Map.Entry<Tag, Value> mapEntry = entries.next();
            Tag tag = mapEntry.getKey();
            Value value = mapEntry.getValue();
            if (value.isPresenceType())
            {
                result.append(tag.tag);
            }
            else
            {
                result.append("(").append(tag.tag).append("=");
                if (value.multiValued)
                {
                    Object[] values = value.getValues();
                    for (int i = 0; i < values.length; ++i)
                    {
                        if (i > 0) result.append(",");
                        if (value.isOpaqueType())
                            result.append(bytesToOpaque((byte[])values[i]));
                        else
                            result.append(escapeValue(String.valueOf(values[i])));
                    }
                }
                else
                {
                    if (value.isOpaqueType())
                        result.append(bytesToOpaque((byte[])value.getValue()));
                    else
                        result.append(escapeValue(String.valueOf(value.getValue())));
                }
                result.append(")");
            }
            if (entries.hasNext()) result.append(",");
        }
        return result.toString();
    }
11041
function getAttrMap(attrs)
{
	var i;
	var map = {};
	var numAttrs = attrs.length;
	
	for (i=0; i<numAttrs; i++)
	{
		map[ attrs[i].name ] = attrs[i].value;
	}
	
	return map;
}
728044
def format(self, **kwargs):
        """"""
        attrs = self._attrs.copy()
        attrs.update({'width': self._width, 'height': self._height})
        attrs.update(kwargs)
        return Map(self._features, **attrs)
627854
def format_repr(obj, attributes) -> str:
    """"""

    attribute_repr = ', '.join(('{}={}'.format(attr, repr(getattr(obj, attr)))
                                for attr in attributes))
    return "{0}({1})".format(obj.__class__.__qualname__, attribute_repr)
658048
def to_format(self, attr):
        
        try:
            _attr = self._to[attr]
        except KeyError:
            try:
                _attr = self._to[attr.lower()]
            except:
                _attr = ''

        if _attr:
            return factory(saml.Attribute,
                           name=_attr,
                           name_format=self.name_format,
                           friendly_name=attr)
        else:
            return factory(saml.Attribute, name=attr)
1058820
def as_markdown(self):
        

        labels, data = self._get_table()
        table = MarkdownTable(labels, data)
        return str(table)
225096
def _get_optional_attrs(kws):
        """"""
        vals = OboOptionalAttrs.attributes.intersection(kws.keys())
        if 'sections' in kws:
            vals.add('relationship')
        if 'norel' in kws:
            vals.discard('relationship')
        return vals
223002
def attribute_string(self):
        
        escape_map = {ord('='): '%3D',
                      ord(','): '%2C',
                      ord(';'): '%3B',
                      ord('&'): '%26',
                      ord('\t'): '%09',
                     }

        list_type = type(list())

        attrs = self.attributes
        if type(attrs) is OrderedDict:
            reserved_attrs = []
            other_attrs = []

            for name, value in attrs.items():
                # Escape reserved characters
                name = name.translate(escape_map)

                if type(value) == list_type:
                    value = ','.join([i.translate(escape_map) for i in value])
                else:
                    value = value.translate(escape_map)

                # Regain original formatting of attribute column
                out_attr = '{0}={1}'.format(name, value)

                # Order attributes so that reserved tags are output first
                if name[0].isupper():
                    reserved_attrs.append(out_attr)
                else:
                    other_attrs.append(out_attr)

            out_attrs = ';'.join(reserved_attrs + other_attrs)

        else:
            out_attrs = attrs

        return out_attrs
1034717
def get_format(**kwargs):
    

    settings = foundations.data_structures.Structure(**{"format": QTextCharFormat(),
                                                        "background_color": None,
                                                        "color": None,
                                                        "font_weight": None,
                                                        "font_point_size": None,
                                                        "italic": False})
    settings.update(kwargs)

    format = QTextCharFormat(settings.format)

    settings.background_color and format.setBackground(settings.background_color)
    settings.color and format.setForeground(settings.color)
    settings.font_weight and format.setFontWeight(settings.font_weight)
    settings.font_point_size and format.setFontPointSize(settings.font_point_size)
    settings.italic and format.setFontItalic(True)

    return format
1078942
def get_ordered_attributes(self):
        
        attrs = self.get_attributes()
        attr_arr = np.array(attrs)
        poss = [self.chrPos, self.startPos, self.stopPos]
        if self.strandPos is not None:
            poss.append(self.strandPos)
        if self.otherPos:
            for o in self.otherPos:
                poss.append(o[0])

        idx_sort = np.array(poss).argsort()
        return attr_arr[idx_sort].tolist()
354845
def format(self):
        """"""
        if not self._ptr:
            raise BfdException("BFD not initialized")

        return _bfd.get_bfd_attribute(self._ptr, BfdAttributes.FORMAT)
465652
def attr_list(args):
    ''''''
    args.attributes = None
    result = attr_get(args)
    names = result.get("__header__",[])
    if names:
        names = names[1:]
    else:
        names = result.keys()
    return sorted(names)
149813
def make_attributes(s, gff3=True, keep_attr_order=True):
    
    if gff3:
        """
        hack: temporarily replace the '+' sign in the attributes column
        with the string 'PlusSign' to prevent urlparse.parse_qsl() from
        replacing the '+' sign with a space
        """
        s = s.replace('+', 'PlusSign')
        d = parse_qs(s, keep_attr_order=keep_attr_order)
        for key in d:
            d[key][0] = unquote(d[key][0].replace('PlusSign', '+').replace('"', ''))
    else:
        attributes = s.split(";")
        d = DefaultOrderedDict(list) if keep_attr_order else defaultdict(list)
        for a in attributes:
            a = a.strip()
            if ' ' not in a:
                continue
            key, val = a.split(' ', 1)
            val = unquote(val.replace('"', '').replace('=', ' ').strip())
            d[key].append(val)

    for key, val in d.items():
        d[key] = list(flatten([v.split(",") for v in val]))

    return d
356534
def get_attribute_values_string(self):
    
    attributes = []
    for attribute_name, attribute_value in sorted(self.__dict__.items()):
      # Not using startswith to improve performance.
      if attribute_name[0] == '_' or attribute_value is None:
        continue

      if isinstance(attribute_value, dict):
        attribute_value = sorted(attribute_value.items())

      elif isinstance(attribute_value, six.binary_type):
        attribute_value = repr(attribute_value)

      attribute_string = '{0:s}: {1!s}'.format(attribute_name, attribute_value)
      attributes.append(attribute_string)

    return ', '.join(attributes)
924717
def inspect
      attribute_list = @attributes.map do |attribute|
        attribute.to_inspect(many: many?, default: @default_sort_order)
      end.join(', ')

      if many?
        attribute_list = "[#{attribute_list}]"

        attribute_list << ", default_order: #{@default_sort_order.to_s.upcase}"
      end

      "Dux::Comparable(#{attribute_list})"
    end
739236
public function determine_format() {
        if ($this->grade->grade_item->load_scale()) {
            $scale = $this->grade->grade_item->load_scale();

            $options = array(-1 => get_string('nograde'));

            foreach ($scale->scale_items as $i => $name) {
                $options[$i + 1] = $name;
            }

            return new dropdown_attribute(
                $this->get_name(),
                $options,
                $this->get_label(),
                $this->get_value(),
                $this->is_disabled()
            );
        } else {
            return new text_attribute(
                $this->get_name(),
                $this->get_value(),
                $this->get_label(),
                $this->is_disabled()
            );
        }
    }