Git Product home page Git Product logo

os-traits's Introduction

os-traits

A library containing standardized trait strings.

Traits are strings that represent a feature of some resource provider. This library contains the catalog of constants that have been standardized in the OpenStack community to refer to a particular hardware, virtualization, storage, network, or device trait.

Usage

os-traits is primarily composed of a set of constants that may be referenced by simply importing the os_traits module and referencing one of the module's traits constants:

$ python
Python 2.7.11+ (default, Apr 17 2016, 14:00:29)
[GCC 5.3.1 20160413] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os_traits as ot
>>> print ot.HW_CPU_X86_SSE42
hw:cpu:x86:sse42

Don't know what the symbol names are for the os_traits module? There's a helper method for that:

>>> import pprint
>>> pprint.pprint(ot.get_symbol_names())
[...
<snip>
'HW_CPU_X86_AVX2',
'HW_CPU_X86_SGX',
'HW_CPU_X86_AVX',
'HW_CPU_X86_AVX512BW',
'HW_CPU_X86_AVX512DQ',
'HW_CPU_X86_SSE',
'HW_CPU_X86_SHA',
'HW_CPU_X86_AVX512F',
'HW_CPU_X86_F16C',
'HW_CPU_X86_SSE41',
'HW_CPU_X86_SSE42',
'HW_CPU_X86_VMX',
'HW_CPU_X86_ASF',
'HW_CPU_X86_BMI2',
'HW_CPU_X86_CLMUL',
'HW_CPU_X86_AVX512VL',
'HW_CPU_X86_AVX512PF',
'HW_CPU_X86_XOP',
'HW_CPU_X86_BMI',
'HW_CPU_X86_ABM',
'HW_CPU_X86_3DNOW']

Want to see the trait strings for a subset of traits? There's a method for that too:

>>> pprint.pprint(ot.get_traits(ot.NAMESPACES['x86']))
['hw:cpu:x86:aes-ni',
'hw:cpu:x86:avx512er',
'hw:cpu:x86:avx512cd',
'hw:cpu:x86:tbm',
'hw:cpu:x86:tsx',
'hw:cpu:x86:fma3',
'hw:cpu:x86:svm',
'hw:cpu:x86:fma4',
'hw:cpu:x86:mpx',
'hw:cpu:x86:sse2',
'hw:cpu:x86:sse3',
'hw:cpu:x86:mmx',
'hw:cpu:x86:ssse3',
'hw:cpu:x86:sse4a',
'hw:cpu:x86:avx2',
'hw:cpu:x86:sgx',
'hw:cpu:x86:avx',
'hw:cpu:x86:avx512bw',
'hw:cpu:x86:avx512dq',
'hw:cpu:x86:sse',
'hw:cpu:x86:sha',
'hw:cpu:x86:avx512f',
'hw:cpu:x86:f16c',
'hw:cpu:x86:sse41',
'hw:cpu:x86:sse42',
'hw:cpu:x86:vmx',
'hw:cpu:x86:asf',
'hw:cpu:x86:bmi2',
'hw:cpu:x86:clmul',
'hw:cpu:x86:avx512vl',
'hw:cpu:x86:avx512pf',
'hw:cpu:x86:xop',
'hw:cpu:x86:bmi',
'hw:cpu:x86:abm',
'hw:cpu:x86:3dnow']

os-traits's People

Contributors

cyx1231st avatar jaypipes avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.