# colour_hdri.utilities.common Module

## Common Utilities

Defines common utilities objects that don’t fall in any specific category.

`colour_hdri.utilities.common.``vivification`()

  Implements supports for vivification of the underlying dict like data-structure, magical!

  Returns: |
  Return type: | defaultdict

  Examples

      >>> vivified = vivification()
      >>> vivified['my']['attribute'] = 1
      >>> vivified['my']
      defaultdict(<function vivification at 0x...>, {u'attribute': 1})
      >>> vivified['my']['attribute']
      1

`colour_hdri.utilities.common.``vivified_to_dict`(vivified)

  Converts given vivified data-structure to dictionary.

  Parameters: | vivified (defaultdict) – Vivified data-structure.
  Returns: |
  Return type: | dict

  Examples

      >>> vivified = vivification()
      >>> vivified['my']['attribute'] = 1
      >>> vivified_to_dict(vivified)
      {u'my': {u'attribute': 1}}

`colour_hdri.utilities.common.``path_exists`(path)

  Returns if given path exists.

  Parameters: | path (unicode) – Path to check the existence.
  Returns: |
  Return type: | bool

  Examples

      >>> path_exists(__file__)
      True
      >>> path_exists('')
      False

`colour_hdri.utilities.common.``filter_files`(directory, extensions)

  Filters given directory for files matching given extensions.

  Parameters: | directory (unicode) – Directory to filter. extensions (tuple or list) – Extensions to filter on.
  Returns: | Filtered files.
  Return type: | list