

@grammar(((int, dict) + str_types))
def padding(value):
    "int or dict : Padding around visualization\n\n        The padding defines the distance between the edge of the\n        visualization canvas to the visualization box. It does not count as\n        part of the visualization width/height. Values cannot be negative.\n\n        If a dict, padding must have all keys ``''top'``, ``'left'``,\n        ``'right'``, and ``'bottom'`` with int values.\n        "
    if isinstance(value, dict):
        required_keys = ['top', 'left', 'right', 'bottom']
        for key in required_keys:
            if (key not in value):
                error = 'Padding must have keys "{0}".'.format('", "'.join(required_keys))
                raise ValueError(error)
            _assert_is_type('padding: {0}'.format(key), value[key], int)
            if (value[key] < 0):
                raise ValueError('Padding cannot be negative.')
    elif isinstance(value, int):
        if (value < 0):
            raise ValueError('Padding cannot be negative.')
    elif (value not in ('auto', 'strict')):
        raise ValueError('Padding can only be auto or strict.')

dataset/ETHPy150Open wrobstory/vincent/vincent/visualization.py Visualization.padding/original