Completed
Push — master ( 0ec915...ef1a4f )
by Chris
01:17
created

bs3_cols()   A

Complexity

Conditions 3

Size

Total Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 23
rs 9.0856
cc 3
1
"""Filters for generating random data."""
2
3
from __future__ import absolute_import
4
5
6
def bs3_cols(num_entries):
7
    """Return the appropriate bootstrap framework column width.
8
9
    Args:
10
        num_entries (int): The number of entries to determine column width for.
11
12
    Returns:
13
        int: The integer value for column width.
14
    """
15
    if not isinstance(num_entries, int):
16
        return 12
17
    mappings = {
18
        1: 12,
19
        2: 6,
20
        3: 4,
21
        4: 3,
22
        5: 2,
23
        6: 2,
24
    }
25
    try:
26
        return mappings[num_entries]
27
    except KeyError:
28
        return 12
29