This commit is contained in:
Johannes Wilm 2022-07-16 23:18:09 +02:00
parent b7c8485f1e
commit 3dd349b577
3 changed files with 11 additions and 11 deletions

View file

@ -13,7 +13,7 @@ cached_funcs = set()
def get_username(user):
""" Return username of a User instance """
"""Return username of a User instance"""
if hasattr(user, "get_username"):
return user.get_username()
else:
@ -21,7 +21,7 @@ def get_username(user):
def get_user(username):
""" Return user from a username/ish identifier """
"""Return user from a username/ish identifier"""
return get_user_model().objects.get_by_natural_key(username)

View file

@ -40,8 +40,8 @@ source_suffix = ".txt"
master_doc = "index"
# General information about the project.
project = u"django-avatar"
copyright = u"2013, django-avatar developers"
project = "django-avatar"
copyright = "2013, django-avatar developers"
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
@ -187,8 +187,8 @@ latex_documents = [
(
"index",
"django-avatar.tex",
u"django-avatar Documentation",
u"django-avatar developers",
"django-avatar Documentation",
"django-avatar developers",
"manual",
),
]
@ -222,8 +222,8 @@ man_pages = [
(
"index",
"django-avatar",
u"django-avatar Documentation",
[u"django-avatar developers"],
"django-avatar Documentation",
["django-avatar developers"],
1,
)
]
@ -241,8 +241,8 @@ texinfo_documents = [
(
"index",
"django-avatar",
u"django-avatar Documentation",
u"django-avatar developers",
"django-avatar Documentation",
"django-avatar developers",
"django-avatar",
"One line description of project.",
"Miscellaneous",

View file

@ -53,7 +53,7 @@ def root_mean_square_difference(image1, image2):
"Calculate the root-mean-square difference between two images"
diff = ImageChops.difference(image1, image2).convert("L")
h = diff.histogram()
sq = (value * (idx ** 2) for idx, value in enumerate(h))
sq = (value * (idx**2) for idx, value in enumerate(h))
sum_of_squares = sum(sq)
rms = math.sqrt(sum_of_squares / float(image1.size[0] * image1.size[1]))
return rms