Unpack nonstandard attributes while representing an OpenAPIOperation
348853
def representCleanOpenAPIOperation(dumper, data):
    
    dct = _orderedCleanDict(data)
    if '_extended' in dct:
        for k, ext in list(data._extended.items()):
            dct[k] = ext
        del dct['_extended']

    return dumper.yaml_representers[type(dct)](dumper, dct)
386264
def unpack_attribute(att):
    """"""
    if att.unsigned:
        log.warning('Unsupported unsigned attribute!')

    # TDS 5.0 now has a dataType attribute that takes precedence
    if att.len == 0:  # Empty
        val = None
    elif att.dataType == stream.STRING:  # Then look for new datatype string
        val = att.sdata
    elif att.dataType:  # Then a non-zero new data type
        val = np.frombuffer(att.data,
                            dtype='>' + _dtypeLookup[att.dataType], count=att.len)
    elif att.type:  # Then non-zero old-data type0
        val = np.frombuffer(att.data,
                            dtype=_attrConverters[att.type], count=att.len)
    elif att.sdata:  # This leaves both 0, try old string
        val = att.sdata
    else:  # Assume new datatype is Char (0)
        val = np.array(att.data, dtype=_dtypeLookup[att.dataType])

    if att.len == 1:
        val = val[0]

    return att.name, val
919585
def as_ompenv(cls, obj):
        """"""
        if isinstance(obj, cls): return obj
        if obj is None: return cls()
        return cls(**obj)
149581
function buildOpeningElementAttributes(attribs, file) {
    let _props = []
    let objs = []

    function pushProps() {
      if (_props.length === 0) return
      objs.push(t.objectExpression(_props))
      _props = []
    }

    while (attribs.length) {
      const prop = attribs.shift()
      if (t.isJSXSpreadAttribute(prop)) {
        pushProps()
        prop.argument._isSpread = true
        objs.push(prop.argument)
      } else {
        _props.push(convertAttribute(prop))
      }
    }

    pushProps()

    objs = objs.map(o => {
      return o._isSpread ? o : groupProps(o.properties, t)
    })

    if (objs.length === 1) {
      // Only one object
      attribs = objs[0]
    } else if (objs.length > 0) {
      // Add prop merging helper
      const helper = file.addImport('babel-helper-vue-jsx-merge-props', 'default', '_mergeJSXProps')
      // Spread it
      attribs = t.callExpression(
        helper,
        [t.arrayExpression(objs)]
      )
    }
    return attribs
  }
980212
def _ConvertAttributeValueToDict(cls, attribute_value):
    
    if isinstance(attribute_value, py2to3.BYTES_TYPE):
      encoded_value = binascii.b2a_qp(attribute_value)
      encoded_value = codecs.decode(encoded_value, 'ascii')
      attribute_value = {
          '__type__': 'bytes',
          'stream': '{0:s}'.format(encoded_value)
      }

    elif isinstance(attribute_value, (list, tuple)):
      json_list = []
      for list_element in attribute_value:
        json_dict = cls._ConvertAttributeValueToDict(list_element)
        json_list.append(json_dict)

      if isinstance(attribute_value, list):
        attribute_value = json_list
      else:
        attribute_value = {
            '__type__': 'tuple',
            'values': json_list
        }

    elif isinstance(attribute_value, collections.Counter):
      attribute_value = cls._ConvertCollectionsCounterToDict(attribute_value)

    elif isinstance(attribute_value, dfvfs_path_spec.PathSpec):
      attribute_value = cls._ConvertPathSpecToDict(attribute_value)

    elif isinstance(attribute_value, containers_interface.AttributeContainer):
      attribute_value = cls._ConvertAttributeContainerToDict(attribute_value)

    return attribute_value
747846
function buildAPIs(vueObj) {
  const funcArray = [propsAPIObject, methodsAPIObject, eventsAPIObject, slotsAPIObject]

  const compAPIObj = funcArray.reduce((apiObj, curFn) => {
    const obj = curFn(vueObj)

    if (obj !== null) {
      Object.assign(apiObj, obj)
    }
    return apiObj
  }, {})
  
  return compAPIObj
}
1255215
def deserialize_attribute(serialized_attribute):  # noqa: C901 pylint: disable=too-many-locals
    # type: (bytes) -> dynamodb_types.RAW_ATTRIBUTE
    

    def _transform_binary_value(value):
        # (bytes) -> bytes
        """Transforms a serialized binary value.

        :param bytes value: Raw deserialized value
        :rtype: bytes
        """
        if isinstance(value, Binary):
            return value.value
        return value

    def _deserialize_binary(stream):
        # type: (io.BytesIO) -> Dict[Text, bytes]
        """Deserializes a binary object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.BINARY.dynamodb_tag: _transform_binary_value(value)}

    def _transform_string_value(value):
        # (bytes) -> dynamodb_types.STRING
        """Transforms a serialized string value.

        :param bytes value: Raw deserialized value
        :rtype: dynamodb_encryption_sdk.internal.dynamodb_types.STRING
        """
        return codecs.decode(value, TEXT_ENCODING)

    def _deserialize_string(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.STRING]
        """Deserializes a string object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.STRING.dynamodb_tag: _transform_string_value(value)}

    def _transform_number_value(value):
        # (bytes) -> dynamodb_types.STRING
        """Transforms a serialized number value.

        :param bytes value: Raw deserialized value
        :rtype: dynamodb_encryption_sdk.internal.dynamodb_types.STRING
        """
        raw_value = codecs.decode(value, TEXT_ENCODING)
        decimal_value = Decimal(to_str(raw_value)).normalize()
        return "{0:f}".format(decimal_value)

    def _deserialize_number(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.STRING]
        """Deserializes a number object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_value(stream)
        return {Tag.NUMBER.dynamodb_tag: _transform_number_value(value)}

    _boolean_map = {TagValues.FALSE.value: False, TagValues.TRUE.value: True}

    def _deserialize_boolean(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.BOOLEAN]
        """Deserializes a boolean object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        value = decode_byte(stream)
        return {Tag.BOOLEAN.dynamodb_tag: _boolean_map[value]}

    def _deserialize_null(stream):  # we want a consistent API but don't use stream, so pylint: disable=unused-argument
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.BOOLEAN]
        """Deserializes a null object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.NULL.dynamodb_tag: True}

    def _deserialize_set(stream, member_transform):
        # type: (io.BytesIO, Callable) -> List[Union[dynamodb_types.BINARY, dynamodb_types.STRING]]
        """Deserializes contents of serialized set.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: list
        """
        member_count = decode_length(stream)
        return sorted([member_transform(decode_value(stream)) for _ in range(member_count)])

    def _deserialize_binary_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.BINARY]]
        """Deserializes a binary set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.BINARY_SET.dynamodb_tag: _deserialize_set(stream, _transform_binary_value)}

    def _deserialize_string_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.STRING]]
        """Deserializes a string set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.STRING_SET.dynamodb_tag: _deserialize_set(stream, _transform_string_value)}

    def _deserialize_number_set(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.SET[dynamodb_types.STRING]]
        """Deserializes a number set object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        return {Tag.NUMBER_SET.dynamodb_tag: _deserialize_set(stream, _transform_number_value)}

    def _deserialize_list(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.LIST]
        """Deserializes a list object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        member_count = decode_length(stream)
        return {Tag.LIST.dynamodb_tag: [_deserialize(stream) for _ in range(member_count)]}

    def _deserialize_map(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.MAP]
        """Deserializes a map object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        member_count = decode_length(stream)
        members = {}  # type: dynamodb_types.MAP
        for _ in range(member_count):
            key = _deserialize(stream)
            if Tag.STRING.dynamodb_tag not in key:
                raise DeserializationError(
                    'Malformed serialized map: found "{}" as map key.'.format(list(key.keys())[0])
                )

            value = _deserialize(stream)
            members[key[Tag.STRING.dynamodb_tag]] = value

        return {Tag.MAP.dynamodb_tag: members}

    def _deserialize_function(tag):
        # type: (bytes) -> Callable
        """Identifies the correct deserialization function based on the provided tag.

        :param tag: Identifying tag, read from start of serialized object
        :type tag: dynamodb_encryption_sdk.internal.identifiers.Tag
        :rtype: callable
        """
        deserialize_functions = {
            Tag.BINARY.tag: _deserialize_binary,
            Tag.BINARY_SET.tag: _deserialize_binary_set,
            Tag.NUMBER.tag: _deserialize_number,
            Tag.NUMBER_SET.tag: _deserialize_number_set,
            Tag.STRING.tag: _deserialize_string,
            Tag.STRING_SET.tag: _deserialize_string_set,
            Tag.BOOLEAN.tag: _deserialize_boolean,
            Tag.NULL.tag: _deserialize_null,
            Tag.LIST.tag: _deserialize_list,
            Tag.MAP.tag: _deserialize_map,
        }
        try:
            return deserialize_functions[tag]
        except KeyError:
            raise DeserializationError('Unsupported tag: "{}"'.format(tag))

    def _deserialize(stream):
        # type: (io.BytesIO) -> Dict[Text, dynamodb_types.RAW_ATTRIBUTE]
        """Deserializes a serialized object.

        :param stream: Stream containing serialized object
        :type stream: io.BytesIO
        :rtype: dict
        """
        try:
            tag = decode_tag(stream)
            return _deserialize_function(tag)(stream)
        except struct.error:
            raise DeserializationError("Malformed serialized data")

    if not serialized_attribute:
        raise DeserializationError("Empty serialized attribute data")

    stream = io.BytesIO(serialized_attribute)
    return _deserialize(stream)
98657
def repr_assist(obj, remap=None):
    
    if not remap:
        remap = {}
    data = []
    for arg in inspect.getargspec(getattr(obj.__class__, '__init__'))[0]:
        if arg == 'self':
            continue
        elif arg in remap:
            value = remap[arg]
        else:
            try:
                value = getattr(obj, arg)
            except AttributeError:
                value = getattr(obj, '_%s' % arg)
        if isinstance(value, (type(None), list, basestring, datetime.date,
                              datetime.time)):
            data.append(repr(value))
        else:
            data.append(str(value))
    return "%s(%s)" % (obj.__class__.__name__, ', '.join(data))
1232820
def method_missing(name, *args, &block)
      return attributes[name.to_sym] if attributes.include?(name.to_sym)
      return super
    end
415471
def MoveToAttributeNs(self, localName, namespaceURI):
        
        ret = libxml2mod.xmlTextReaderMoveToAttributeNs(self._o, localName, namespaceURI)
        return ret
788442
def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw):
        '''
        

        '''
        raise EvaluateException("Unimplemented evaluation", sw.Backtrace(elt))
717116
function readParameters(obj, scope) {
    var result = {},
      attrs = obj.$attr,
      option, value;

    for (var key in attrs) {
      option = lcfirst(key.substr(attrName.length));
      value = obj[key];
      // Check if the given key is a valid string type, not empty and starts with the attribute name
      if ((option.length > 0) && (key.substring(0, attrName.length) === attrName)) {
        result[option] = value;
        if (typeof scope[value] === 'function') {
          result[option] = scope[value];
        }
      }
    }

    return result;
  }
922808
def convert(self, args, handler=None):
        """"""
        name = args
        field = attr = None
        opts = ()
        if isinstance(args, (list, tuple)):
            name, *opts = args
            if opts:
                attr = opts.pop()
            if opts:
                field = opts.pop()

        if not field and handler and handler.Schema:
            field = handler.Schema._declared_fields.get(attr or name) or \
                self.FILTER_CLASS.field_cls()
            field.attribute = field.attribute or attr or name
        return self.FILTER_CLASS(name, attr=attr, field=field, *opts)
1164051
def _serialize_attributes(attributes):
    """"""
    result = ''
    for name, value in attributes.items():
        if not value:
            continue
        result += ' ' + _unmangle_attribute_name(name)
        result += '="' + escape(value, True) + '"'
    return result
1258200
def getEncodableAttributes(self, obj, **kwargs):
        
        attrs = pyamf.ClassAlias.getEncodableAttributes(self, obj, **kwargs)

        if not self.exclude_sa_key:
            # primary_key_from_instance actually changes obj.__dict__ if
            # primary key properties do not already exist in obj.__dict__
            attrs[self.KEY_ATTR] = self.mapper.primary_key_from_instance(obj)

        if not self.exclude_sa_lazy:
            lazy_attrs = []

            for attr in self.properties:
                if attr not in obj.__dict__:
                    lazy_attrs.append(attr)

            attrs[self.LAZY_ATTR] = lazy_attrs

        return attrs
1064709
def _serialize(self, value, key, obj):
        
        param_values = {}
        for name, attr_tpl in iteritems(self.params):
            attr_name = _tpl(str(attr_tpl))
            if attr_name:
                attribute_value = _get_value(obj, attr_name, default=missing)
                if attribute_value is None:
                    return None
                if attribute_value is not missing:
                    param_values[name] = attribute_value
                else:
                    raise AttributeError(
                        "{attr_name!r} is not a valid "
                        "attribute of {obj!r}".format(attr_name=attr_name, obj=obj)
                    )
            else:
                param_values[name] = attr_tpl
        return url_for(self.endpoint, **param_values)
435930
def yaml_to_param(obj, name):
	
	return from_pyvalue(u"yaml:%s" % name, unicode(yaml.dump(obj)))