GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Pull Request — master (#68)
by Lambda
01:00
created

isiterable()   A

Complexity

Conditions 2

Size

Total Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
cc 2
c 2
b 0
f 0
dl 0
loc 2
rs 10
1
# coding=utf-8
2
import django
3
if django.VERSION >= (1, 9):
4
    add_to_builtins = None
5
else:
6
    try:
7
        from django.template.base import add_to_builtins
8
    except ImportError:
9
        from django.template.loader import add_to_builtins
10
11
try:
12
    # django.utils.importlib is removed from Django 1.9
13
    from importlib import import_module
14
except ImportError:
15
    from django.utils.importlib import import_module
16
17
try:
18
    # Django 1.7 or over use the new application loading system
19
    from django.apps import apps
20
    get_model = apps.get_model
21
except ImportError:
22
    from django.db.models.loading import get_model
23
24
try:
25
    from django.utils.module_loading import import_string
26
except ImportError:
27
    try:
28
        from django.utils.module_loading import import_by_path as import_string
29
    except ImportError:
30
        def import_string(dotted_path):
31
            try:
32
                module_path, class_name = dotted_path.rsplit('.', 1)
33
            except ValueError:
34
                raise ImportError(
35
                    "%s doesn't look like a module path" % dotted_path
36
                )
37
            module = import_module(module_path)
38
            try:
39
                return getattr(module, class_name)
40
            except AttributeError:
41
                raise ImportError(
42
                    'Module "%s" does not define a "%s" attribute/class' % (
43
                        module_path, class_name
44
                    ))
45
46
try:
47
    # Python 3
48
    from urllib.parse import urlparse
49
except ImportError:
50
    # Python 2
51
    from urlparse import urlparse
52
53
import sys
54
if sys.version_info >= (3, 0):
55
    def isstr(x):
56
        return isinstance(x, str)
57
else:
58
    def isstr(x):
59
        return isinstance(x, basestring)
60
61
try:
62
    from django.util import six
63
except ImportError:
64
    # Django 1.2/1.3 does not have six
65
    import six
66