This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Amun | |
# Copyright(C) 2019 Fridolin Pokorny | |
# | |
# This program is free software: you can redistribute it and / or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
import random | |
import sys | |
def random_termial(n: int) -> int: | |
"""Get index to an item from a list of size n. |
![profile.gif](https://gist.github.com/fridex/c871361104a23ed7841902efbbce394a/raw/dc367bf176597089f71f74a4712da604c0d2776a/profile.gif)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Based on https://gist.github.com/fridex/8a2442f7e187914af715968097688aa3 | |
import math | |
import random | |
import sys | |
def random_termial(n: int) -> int: | |
"""Get index to an item from a list of size n. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
import os | |
import random | |
import sys | |
import timeit | |
_ROUNDS = int(os.getenv("TERMIAL_DEFAULT_ROUNDS", 3)) | |
_ITERATIONS = int(os.getenv("TERMIAL_ITERATIONS", 1000000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import math | |
import os | |
import random | |
import sys | |
import timeit | |
_ROUNDS = int(os.getenv("TERMIAL_DEFAULT_ROUNDS", 3)) | |
_ITERATIONS = int(os.getenv("TERMIAL_ITERATIONS", 1000000)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from thoth.storages import GraphDatabase | |
>>> graph = GraphDatabase() | |
>>> graph.connect() | |
The database schema is not in sync with library revisions, the current library revision heads: {'83e2900c3721'}, database heads: {'7c261487d4d4'} | |
>>> from pprint import pprint | |
>>> # The dict returned is formed out of extras name (None if no extra) and a list of possible direct dependencies respecting version range specification of packages. | |
>>> pprint(graph.get_depends_on("tensorflow", "2.2.0", "https://pypi.org/simple")) | |
{None: [('absl-py', '0.7.0'), | |
('absl-py', '0.7.1'), | |
('absl-py', '0.8.0'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# pip install termial-random | |
from termial_random import random as termial_random | |
from termial_random import seed as termial_seed | |
import math | |
import os | |
import random | |
import sys | |
import timeit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_meta": { | |
"hash": { | |
"sha256": "4eee0da583a3e934b6f42c73441c40d91cf7ee1b46602bdc4851279a4e15dccc" | |
}, | |
"pipfile-spec": 6, | |
"requires": { | |
"python_version": "3.8" | |
}, | |
"sources": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_meta": { | |
"hash": { | |
"sha256": "82a12ed290169de6cf3ff88bf420740a5c4e04c69736ce73270409106ce98dd8" | |
}, | |
"pipfile-spec": 6, | |
"requires": { | |
"python_version": "3.6" | |
}, | |
"sources": [ |
OlderNewer