當前位置: 首頁>>代碼示例>>Python>>正文


Python botocore.shape方法代碼示例

本文整理匯總了Python中botocore.shape方法的典型用法代碼示例。如果您正苦於以下問題:Python botocore.shape方法的具體用法?Python botocore.shape怎麽用?Python botocore.shape使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在botocore的用法示例。


在下文中一共展示了botocore.shape方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _generate_skeleton

# 需要導入模塊: import botocore [as 別名]
# 或者: from botocore import shape [as 別名]
def _generate_skeleton(self, shape, stack, name=''):
        stack.append(shape.name)
        try:
            if shape.type_name == 'structure':
                return self._generate_type_structure(shape, stack)
            elif shape.type_name == 'list':
                return self._generate_type_list(shape, stack)
            elif shape.type_name == 'map':
                return self._generate_type_map(shape, stack)
            elif shape.type_name == 'string':
                if self._use_member_names:
                    return name
                if shape.enum:
                    return random.choice(shape.enum)
                return ''
            elif shape.type_name in ['integer', 'long']:
                return 0
            elif shape.type_name == 'float':
                return 0.0
            elif shape.type_name == 'boolean':
                return True
            elif shape.type_name == 'timestamp':
                return datetime.datetime(1970, 1, 1, 0, 0, 0)
        finally:
            stack.pop() 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:27,代碼來源:utils.py

示例2: is_json_value_header

# 需要導入模塊: import botocore [as 別名]
# 或者: from botocore import shape [as 別名]
def is_json_value_header(shape):
    """Determines if the provided shape is the special header type jsonvalue.

    :type shape: botocore.shape
    :param shape: Shape to be inspected for the jsonvalue trait.

    :return: True if this type is a jsonvalue, False otherwise
    :rtype: Bool
    """
    return (hasattr(shape, 'serialization') and
            shape.serialization.get('jsonvalue', False) and
            shape.serialization.get('location') == 'header' and
            shape.type_name == 'string') 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:15,代碼來源:utils.py

示例3: generate_skeleton

# 需要導入模塊: import botocore [as 別名]
# 或者: from botocore import shape [as 別名]
def generate_skeleton(self, shape):
        """Generate a sample input.

        :type shape: ``botocore.model.Shape``
        :param shape: The input shape.

        :return: The generated skeleton input corresponding to the
            provided input shape.

        """
        stack = []
        return self._generate_skeleton(shape, stack) 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:14,代碼來源:utils.py

示例4: _generate_type_structure

# 需要導入模塊: import botocore [as 別名]
# 或者: from botocore import shape [as 別名]
def _generate_type_structure(self, shape, stack):
        if stack.count(shape.name) > 1:
            return {}
        skeleton = OrderedDict()
        for member_name, member_shape in shape.members.items():
            skeleton[member_name] = self._generate_skeleton(
                member_shape, stack, name=member_name)
        return skeleton 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:10,代碼來源:utils.py

示例5: _generate_type_list

# 需要導入模塊: import botocore [as 別名]
# 或者: from botocore import shape [as 別名]
def _generate_type_list(self, shape, stack):
        # For list elements we've arbitrarily decided to
        # return two elements for the skeleton list.
        name = ''
        if self._use_member_names:
            name = shape.member.name
        return [
            self._generate_skeleton(shape.member, stack, name),
        ] 
開發者ID:QData,項目名稱:deepWordBug,代碼行數:11,代碼來源:utils.py


注:本文中的botocore.shape方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。