Page MenuHomeDevCentral

D2625.id6636.diff
No OneTemporary

D2625.id6636.diff

diff --git a/_modules/network_utils.py b/_modules/network_utils.py
--- a/_modules/network_utils.py
+++ b/_modules/network_utils.py
@@ -18,7 +18,7 @@
def is_valid_netmask(netmask):
# "255.255.255.240" → "11111111111111111111111111110000"
- bits = ''.join([format(int(octet), 'b') for octet in netmask.split(".")])
+ bits = "".join([format(int(octet), "b") for octet in netmask.split(".")])
# A netmask is valid if the suite of bits:
# - starts by contiguous 1, e.g. here 1111111111111111111111111111
diff --git a/_tests/modules/test_network.py b/_tests/modules/test_network.py
--- a/_tests/modules/test_network.py
+++ b/_tests/modules/test_network.py
@@ -30,7 +30,6 @@
invalid_netmasks = lambda: (
# In binary, it's not a suite of 1 then a suite of 0
("255.255.255.209",),
-
# By definition, netmask MUST be strictly greater than 0
("0.0.0.0",),
)
diff --git a/roles/devserver/userland-home/files/dereckson/bin/http2pls b/roles/devserver/userland-home/files/dereckson/bin/http2pls
--- a/roles/devserver/userland-home/files/dereckson/bin/http2pls
+++ b/roles/devserver/userland-home/files/dereckson/bin/http2pls
@@ -7,14 +7,18 @@
def get_url(base_url, tag):
- relative_url = tag.get('href')
+ relative_url = tag.get("href")
return parse.urljoin(base_url, relative_url)
def is_media_extension(extension):
valid_extensions = [
# Videos
- ".avi", ".flv", ".mp4", ".wmv", ".mkv",
+ ".avi",
+ ".flv",
+ ".mp4",
+ ".wmv",
+ ".mkv",
]
return extension in valid_extensions
@@ -35,7 +39,7 @@
i = 0
for link in links:
i += 1
- print('File{:d}={:s}'.format(i, link))
+ print("File{:d}={:s}".format(i, link))
print("")
print("NumberOfEntries={:d}".format(i))
@@ -51,8 +55,8 @@
with request.urlopen(url) as response:
body = response.read()
- soup = BeautifulSoup(body, 'html.parser')
- return [get_url(url, link) for link in soup.find_all('a')]
+ soup = BeautifulSoup(body, "html.parser")
+ return [get_url(url, link) for link in soup.find_all("a")]
except ValueError:
print("No valid URL: " + url, file=stderr)
return []
diff --git a/roles/devserver/userland-home/files/dereckson/bin/hypergeometric_distribution b/roles/devserver/userland-home/files/dereckson/bin/hypergeometric_distribution
--- a/roles/devserver/userland-home/files/dereckson/bin/hypergeometric_distribution
+++ b/roles/devserver/userland-home/files/dereckson/bin/hypergeometric_distribution
@@ -21,7 +21,10 @@
def usage():
- print(f"Usage: {sys.argv[0]} <population size> <number of success states> <number of draws> <number of observed successes>", file=sys.stderr)
+ print(
+ f"Usage: {sys.argv[0]} <population size> <number of success states> <number of draws> <number of observed successes>",
+ file=sys.stderr,
+ )
def help():

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 00:47 (21 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2248304
Default Alt Text
D2625.id6636.diff (2 KB)

Event Timeline