repo_full_name stringlengths 6 93 | repo_url stringlengths 25 112 | repo_api_url stringclasses 28
values | owner stringclasses 28
values | repo_name stringclasses 28
values | description stringclasses 28
values | stars int64 617 98.8k | forks int64 31 355 ⌀ | watchers int64 990 999 ⌀ | license stringclasses 2
values | default_branch stringclasses 2
values | repo_created_at timestamp[s]date 2012-07-24 23:12:50 2025-06-16 08:07:28 ⌀ | repo_updated_at timestamp[s]date 2026-02-23 15:23:15 2026-05-03 18:52:12 ⌀ | repo_topics listlengths 0 13 ⌀ | repo_languages unknown | is_fork bool 1
class | open_issues int64 3 104 ⌀ | file_path stringlengths 3 208 | file_name stringclasses 509
values | file_extension stringclasses 1
value | file_size_bytes int64 101 84k ⌀ | file_url stringclasses 627
values | file_raw_url stringclasses 627
values | file_sha stringclasses 624
values | language stringclasses 8
values | parsed_at stringdate 2026-05-04 01:12:36 2026-05-04 19:41:55 | text stringlengths 100 102k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/plot.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.189277 | import os
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import collections
import time
import cPickle as pickle
_since_beginning = collections.defaultdict(lambda: {})
_since_last_flush = collections.defaultdict(lambda: {})
_iter = [0]
output_dir = '.'
def tick():
_ite... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/linear.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.189939 | import tflib as lib
import numpy as np
import tensorflow as tf
_default_weightnorm = False
def enable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = True
def disable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = False
_weights_stdev = None
def set_wei... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/deconv2d.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.199211 | import tflib as lib
import numpy as np
import tensorflow as tf
_default_weightnorm = False
def enable_default_weightnorm():
global _default_weightnorm
_default_weightnorm = True
_weights_stdev = None
def set_weights_stdev(weights_stdev):
global _weights_stdev
_weights_stdev = weights_stdev
def unset... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/ops/layernorm.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.223567 | import tflib as lib
import numpy as np
import tensorflow as tf
def Layernorm(name, norm_axes, inputs):
mean, var = tf.nn.moments(inputs, norm_axes, keep_dims=True)
# Assume the 'neurons' axis is the first of norm_axes. This is the case for fully-connected and BCHW conv layers.
n_neurons = inputs.get_shap... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/save_images.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.224253 | """
Image grid saver, based on color_grid_vis from github.com/Newmu
"""
import numpy as np
import scipy.misc
from scipy.misc import imsave
def save_images(X, save_path):
# [0, 1] -> [0,255]
if isinstance(X.flatten()[0], np.floating):
X = (255.99*X).astype('uint8')
n_samples = X.shape[0]
rows ... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.822777 | import collections
import numpy as np
import re
def tokenize_string(sample):
return tuple(sample.lower().split(' '))
class NgramLanguageModel(object):
def __init__(self, n, samples, tokenize=False):
if tokenize:
tokenized_samples = []
for sample in samples:
toke... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | tflib/small_imagenet.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.823267 | import numpy as np
import scipy.misc
import time
def make_generator(path, n_files, batch_size):
epoch_count = [1]
def get_epoch():
images = np.zeros((batch_size, 3, 64, 64), dtype='int32')
files = range(n_files)
random_state = np.random.RandomState(epoch_count[0])
random_state.s... |
brannondorsey/PassGAN | https://github.com/brannondorsey/PassGAN | null | null | null | null | 1,979 | null | null | mit | null | null | null | null | null | null | null | train.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:20.851857 | import os, sys
sys.path.append(os.getcwd())
import time
import pickle
import argparse
import numpy as np
import tensorflow as tf
import utils
import tflib as lib
import tflib.ops.linear
import tflib.ops.conv1d
import tflib.plot
import models
def parse_args():
parser = argparse.ArgumentParser()
parser.add_ar... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/getComments2.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.653818 | import requests
from bs4 import BeautifulSoup
def printAll():
return comment
def _getComments2_(phone_number):
global comment
comment=[]
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0",
}
phone_number=phone_number.split("+")[... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/socialMedia1.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.664453 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
def printAll():
return faceAc
async def run(playwright,phone_number):
global page
global faceAc
firefox = playwright.firefox
browser = await firefox.launch(headless=True)
context ... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/getLinks.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.666022 | import requests
from bs4 import BeautifulSoup
def printAll():
return url
def getLinks_(phone_number):
global url
url=[]
headers = {
"User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0",
}
phone_number=phone_number.split("+")[1]
page = r... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/FindOwner2.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.668696 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
async def GoogleMail(email,password):
await page2.fill("#identifierId",email)
await page2.click("#identifierNext > div > button > span",timeout=3000)
await page2.locator("#password > div.aCsJod.... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/socialMedia4.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.673129 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
def printAll():
return goAc
async def run(playwright,phone_number):
global page
global goAc
display = Display(visible=0, size=(1600, 1200))
display.start()
firefox = playwright.fire... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/socialMedia2.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.675234 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
def printAll():
return instAc
async def run(playwright,phone_number):
global page
global instAc
firefox = playwright.firefox
browser = await firefox.launch(headless=True)
context = a... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/socialMedia3.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.676672 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
def printAll():
return twAc
async def run(playwright,phone_number):
global page
global twAc
display = Display(visible=0, size=(1600, 1200))
display.start()
firefox = playwright.fire... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/getComments.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.678295 | import requests
from bs4 import BeautifulSoup
def printAll():
return comment
def getComments_(phone_number):
global comment,comment_
comment=[]
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'
}
tr... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/general.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.690019 | import phonenumbers
from phonenumbers.timezone import time_zones_for_number
from phonenumbers import geocoder
from phonenumbers import carrier
import sys
from datetime import datetime
import pytz
def location(phone_number):
try:
global number,liste,country,operator,errNumber,currentTime
number=phon... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/FindOwner.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:26.695786 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
async def GoogleMail(email,password):
try:
await page.locator("#identifierId").fill(email)
await page.click("#identifierNext > div > button > span")
await page.locator("#password... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/socialMedia5.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:27.214925 | import asyncio
from playwright.async_api import async_playwright
from pyvirtualdisplay import Display
import time
def printAll():
return micAc
async def run(playwright,phone_number):
global page
global micAc
display = Display(visible=0, size=(1600, 1200))
display.start()
firefox = playwright.fi... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/spamControl2.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:27.240102 | import requests
from bs4 import BeautifulSoup
def returnValue():
return com
def getSpam(phone_number):
global com
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'
}
try:
print(phone_number)
... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | MoriartyProject.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:27.241958 |
__author__ = 'Aziz Kaplan'
import os
from gevent.pywsgi import WSGIServer
from flask import Flask, render_template,request,redirect,url_for
import re
from Investigation.FindOwner import main
from Investigation.FindOwner2 import main1
import Investigation.FindOwner
import Investigation.general
from Investigation.spa... |
AzizKpln/Moriarty-Project | https://github.com/AzizKpln/Moriarty-Project | null | null | null | null | 1,977 | null | null | mit | null | null | null | null | null | null | null | Investigation/spamControl.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:27.243989 | import requests
from bs4 import BeautifulSoup
def printAll():
return situationSpam,explanation,numberType
def spamMain(phone_number):
global situationSpam,explanation,numberType
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/contrib/flake8.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.051725 | from radon.complexity import add_inner_blocks
from radon.visitors import ComplexityVisitor
class Flake8Checker(object):
'''Entry point for the Flake8 tool.'''
name = 'radon'
version = __import__('radon').__version__
_code = 'R701'
_error_tmpl = 'R701 %r is too complex (%d)'
no_assert = False
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/cli/tools.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.054933 | '''This module contains various utility functions used in the CLI interface.
Attributes:
_encoding (str): encoding with all files will be opened. Configured by
environment variable RADONFILESENCODING
'''
import fnmatch
import hashlib
import json
import locale
import os
import platform
import re
import sys
impo... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/complexity.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.091575 | '''This module contains all high-level helpers function that allow to work with
Cyclomatic Complexity
'''
import math
from radon.visitors import GET_COMPLEXITY, ComplexityVisitor, code2ast
# sorted_block ordering functions
SCORE = lambda block: -GET_COMPLEXITY(block)
LINES = lambda block: block.lineno
ALPHA = lambda... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/cli/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.092261 | '''In this module the CLI interface is created.'''
import inspect
import os
import sys
from contextlib import contextmanager
from mando import Program
try:
# Python 3.11+
import tomllib
TOMLLIB_PRESENT = True
except ImportError:
try:
# Support for Python <3.11
import tomli as tomllib
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.910217 | '''This module contains the main() function, which is the entry point for the
command line interface.'''
__version__ = '6.0.1'
def main():
'''The entry point for Setuptools.'''
import sys
from radon.cli import program, log_error
if not sys.argv[1:]:
sys.argv.append('-h')
try:
pro... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/cli/harvest.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:31.911492 | '''This module holds the base Harvester class and all its subclassess.'''
import collections
import json
import sys
from builtins import super
from radon.cli.colors import MI_RANKS, RANKS_COLORS, RESET
from radon.cli.tools import (
_open,
cc_to_dict,
cc_to_terminal,
dict_to_codeclimate_issues,
dic... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/cli/colors.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:32.454064 | '''Module holding constants used to format lines that are printed to the
terminal.
'''
import os
import sys
def color_enabled():
COLOR_ENV = os.getenv('COLOR', 'auto')
if COLOR_ENV == 'auto' and sys.stdout.isatty():
return True
if COLOR_ENV == 'yes':
return True
return False
try:
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/run.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:32.526610 | if __name__ == '__main__':
import sys
import pytest
# see: https://docs.pytest.org/en/6.2.x/deprecations.html#the-strict-command-line-option
# This check can be removed once Python 2.x support is dropped as the new
# pytest option (--strict-markers) is available in pytest for all Python 3.x
fro... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/metrics.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:32.658568 | '''Module holding functions related to miscellaneous metrics, such as Halstead
metrics or the Maintainability Index.
'''
import ast
import collections
import math
from radon.raw import analyze
from radon.visitors import ComplexityVisitor, HalsteadVisitor
# Halstead metrics
HalsteadReport = collections.namedtuple(
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/raw.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:32.664048 | '''This module contains functions related to raw metrics.
The main function is :func:`~radon.raw.analyze`, and should be the only one
that is used.
'''
import collections
import operator
import tokenize
try:
import StringIO as io
except ImportError: # pragma: no cover
import io
__all__ = [
'OP',
'... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_cli_harvest.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.201366 | try:
import collections.abc as collections_abc
except ImportError:
import collections as collections_abc
import pytest
import radon.cli.harvest as harvest
import radon.complexity as cc_mod
from radon.cli import Config
BASE_CONFIG = Config(
exclude=r'test_[^.]+\.py',
ignore='tests,docs',
include_i... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_cli.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.239288 | import os
import sys
from configparser import ConfigParser
import pytest
import radon.cli as cli
import radon.complexity as cc_mod
from radon.cli.harvest import CCHarvester, Harvester, MIHarvester, RawHarvester
from radon.tests.test_cli_harvest import (
BASE_CONFIG,
CC_CONFIG,
MI_CONFIG,
RAW_CONFIG,
)... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_cli_colors.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.345478 | import radon.cli.colors as colors
def test_color_enabled_yes(monkeypatch):
monkeypatch.setenv("COLOR", "yes")
assert colors.color_enabled()
def test_color_enabled_no(monkeypatch):
monkeypatch.setenv("COLOR", "no")
assert not colors.color_enabled()
def test_color_enabled_auto(monkeypatch, mocker):
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_complexity_visitor.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.418387 | import sys
import textwrap
import pytest
from radon.visitors import *
dedent = lambda code: textwrap.dedent(code).strip()
SIMPLE_BLOCKS = [
(
'''
if a: pass
''',
2,
{},
),
(
'''
if a: pass
else: pass
''',
2,
{},
),
(
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_complexity_utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.426678 | import ast
import operator
import pytest
from radon.complexity import *
from radon.contrib.flake8 import Flake8Checker
from radon.visitors import Class, Function
from .test_complexity_visitor import GENERAL_CASES, dedent
get_index = lambda seq: lambda index: seq[index]
def _compute_cc_rank(score):
# This is r... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_cli_tools.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.471147 | import json
import locale
import os
import platform
import sys
import pytest
import radon.cli.tools as tools
from radon.raw import Module
from radon.visitors import Class, Function
def fake_isfile(filename):
if filename == 'file.py':
return True
return False
def fake_walk(start):
dirs = ['test... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_other_metrics.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.795087 | import textwrap
import pytest
from radon.metrics import *
dedent = lambda code: textwrap.dedent(code).strip()
def _compute_mi_rank(score):
if 0 <= score < 10:
res = 'C'
elif 10 <= score < 20:
res = 'B'
elif 20 <= score <= 100:
res = 'A'
else:
raise ValueError(score)
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_raw.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.900686 | import textwrap
import pytest
from radon.raw import *
dedent = lambda code: textwrap.dedent(code).strip()
FIND_CASES = [
(
'''
return 0
''',
None,
),
(
'''
# most useless comment :
''',
None,
),
(
'''
if a: pass
''',
... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/visitors.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.931315 | '''This module contains the ComplexityVisitor class which is where all the
analysis concerning Cyclomatic Complexity is done. There is also the class
HalsteadVisitor, that counts Halstead metrics.'''
import ast
import collections
import operator
# Helper functions to use in combination with map()
GET_COMPLEXITY = ope... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | setup.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:33.998735 | import os
from setuptools import setup, find_packages
import radon
with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as fobj:
readme = fobj.read()
setup(name='radon',
version=radon.__version__,
author='Michele Lacchia',
author_email='michelelacchia@gmail.com',
url='https://... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_halstead.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:34.265842 | import sys
import textwrap
import pytest
from radon.visitors import HalsteadVisitor
dedent = lambda code: textwrap.dedent(code).strip()
SIMPLE_BLOCKS = [
(
'''
if a and b: pass
''',
(1, 2, 1, 2),
),
(
'''
if a and b: pass
elif b or c: pass
''',
(... |
rubik/radon | https://github.com/rubik/radon | null | null | null | null | 1,976 | null | null | mit | null | null | null | null | null | null | null | radon/tests/test_ipynb.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:34.266442 | import json
import os
import pytest
import radon.cli as cli
from radon.cli.harvest import (
SUPPORTS_IPYNB,
CCHarvester,
Harvester,
MIHarvester,
RawHarvester,
)
from radon.cli.tools import _is_python_file
from radon.tests.test_cli_harvest import MI_CONFIG, RAW_CONFIG
BASE_CONFIG_WITH_IPYNB = cli.... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/bypass_bn.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.592464 | import torch
import torch.nn as nn
from torch.nn.modules.batchnorm import _BatchNorm
def disable_running_stats(model):
def _disable(module):
if isinstance(module, _BatchNorm):
module.backup_momentum = module.momentum
module.momentum = 0
model.apply(_disable)
def enable_runnin... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/loading_bar.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.624341 | class LoadingBar:
def __init__(self, length: int = 40):
self.length = length
self.symbols = ['┈', '░', '▒', '▓']
def __call__(self, progress: float) -> str:
p = int(progress * self.length*4 + 0.5)
d, r = p // 4, p % 4
return '┠┈' + d * '█' + ((self.symbols[r]) + max(0, s... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/train.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.634901 | import argparse
import torch
from model.wide_res_net import WideResNet
from model.smooth_cross_entropy import smooth_crossentropy
from data.cifar import Cifar
from utility.log import Log
from utility.initialize import initialize
from utility.step_lr import StepLR
from utility.bypass_bn import enable_running_stats, dis... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/data/cifar.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.637671 | import torch
import torchvision
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from utility.cutout import Cutout
class Cifar:
def __init__(self, batch_size, threads):
mean, std = self._get_statistics()
train_transform = transforms.Compose([
torchv... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/step_lr.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.638166 | class StepLR:
def __init__(self, optimizer, learning_rate: float, total_epochs: int):
self.optimizer = optimizer
self.total_epochs = total_epochs
self.base = learning_rate
def __call__(self, epoch):
if epoch < self.total_epochs * 3/10:
lr = self.base
elif epo... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/initialize.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.640301 | import random
import torch
def initialize(args, seed: int):
random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.cuda.manual_seed_all(seed)
torch.backends.cudnn.enabled = True
torch.backends.cudnn.benchmark = True
torch.backends.cudnn.deterministic = False
|
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/log.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.643476 | from utility.loading_bar import LoadingBar
import time
class Log:
def __init__(self, log_each: int, initial_epoch=-1):
self.loading_bar = LoadingBar(length=27)
self.best_accuracy = 0.0
self.log_each = log_each
self.epoch = initial_epoch
def train(self, len_dataset: int) -> Non... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/utility/cutout.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.651235 | import torch
class Cutout:
def __init__(self, size=16, p=0.5):
self.size = size
self.half_size = size // 2
self.p = p
def __call__(self, image):
if torch.rand([1]).item() > self.p:
return image
left = torch.randint(-self.half_size, image.size(1) - self.hal... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/model/smooth_cross_entropy.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.653920 | import torch
import torch.nn as nn
import torch.nn.functional as F
def smooth_crossentropy(pred, gold, smoothing=0.1):
n_class = pred.size(1)
one_hot = torch.full_like(pred, fill_value=smoothing / (n_class - 1))
one_hot.scatter_(dim=1, index=gold.unsqueeze(1), value=1.0 - smoothing)
log_prob = F.log_... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | example/model/wide_res_net.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:41.706021 | from collections import OrderedDict
import torch
import torch.nn as nn
import torch.nn.functional as F
class BasicUnit(nn.Module):
def __init__(self, channels: int, dropout: float):
super(BasicUnit, self).__init__()
self.block = nn.Sequential(OrderedDict([
("0_normalization", nn.Batch... |
davda54/sam | https://github.com/davda54/sam | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | sam.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:43.200107 | import torch
class SAM(torch.optim.Optimizer):
def __init__(self, params, base_optimizer, rho=0.05, adaptive=False, **kwargs):
assert rho >= 0.0, f"Invalid rho, should be non-negative: {rho}"
defaults = dict(rho=rho, adaptive=adaptive, **kwargs)
super(SAM, self).__init__(params, defaults)... |
BlankerL/DXY-COVID-19-Crawler | https://github.com/BlankerL/DXY-COVID-19-Crawler | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | service/nameMap.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:45.106768 | """
@ProjectName: DXY-2019-nCov-Crawler
@FileName: countryTypeMap.py
@Author: Jiabao Lin
@Date: 2020/1/22
"""
country_type_map = {
1: '中国'
}
city_name_map = {
'黑龙江': {
'engName': 'Heilongjiang',
'cities': {
'七台河': 'Qitaihe',
'伊春': 'Yichun',
'佳木斯': 'Jiamusi',
... |
BlankerL/DXY-COVID-19-Crawler | https://github.com/BlankerL/DXY-COVID-19-Crawler | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | main.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:45.110802 | """
@ProjectName: DXY-2019-nCoV-Crawler
@FileName: main.py
@Author: Jiabao Lin
@Date: 2020/1/27
"""
from service.crawler import Crawler
if __name__ == '__main__':
crawler = Crawler()
crawler.run()
|
BlankerL/DXY-COVID-19-Crawler | https://github.com/BlankerL/DXY-COVID-19-Crawler | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | service/userAgent.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:45.118042 | """
@ProjectName: DXY-COVID-19-Crawler
@FileName: userAgent.py
@Author: Jiabao Lin
@Date: 2020/3/9
"""
user_agent_list = [
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.132 Safari/537.36',
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:73.0) Gecko/2... |
BlankerL/DXY-COVID-19-Crawler | https://github.com/BlankerL/DXY-COVID-19-Crawler | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | service/db.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:45.121077 | """
@ProjectName: DXY-2019-nCov-Crawler
@FileName: db.py
@Author: Jiabao Lin
@Date: 2020/1/21
"""
from pymongo import MongoClient
uri = '**Confidential**'
client = MongoClient(uri)
db = client['2019-nCoV']
class DB:
def __init__(self):
self.db = db
def insert(self, collection, data):
self.d... |
BlankerL/DXY-COVID-19-Crawler | https://github.com/BlankerL/DXY-COVID-19-Crawler | null | null | null | null | 1,975 | null | null | mit | null | null | null | null | null | null | null | service/crawler.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:45.123179 | """
@ProjectName: DXY-2019-nCov-Crawler
@FileName: crawler.py
@Author: Jiabao Lin
@Date: 2020/1/21
"""
from bs4 import BeautifulSoup
from service.db import DB
from service.userAgent import user_agent_list
from service.nameMap import country_type_map, city_name_map, country_name_map, continent_name_map
import re
import ... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/base.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.423431 | from abc import ABC, abstractmethod
from dataclasses import dataclass
from typing import Any, Tuple, Sequence, Text
from pyannote.core import SlidingWindowFeature
from pyannote.metrics.base import BaseMetric
from .. import utils
from ..audio import FilePath, AudioLoader
@dataclass
class HyperParameter:
"""Repre... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.427225 | from .aggregation import (
AggregationStrategy,
HammingWeightedAverageStrategy,
AverageStrategy,
FirstOnlyStrategy,
DelayedAggregation,
)
from .clustering import OnlineSpeakerClustering
from .embedding import (
SpeakerEmbedding,
OverlappedSpeechPenalty,
EmbeddingNormalization,
Overla... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/audio.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.438073 | from pathlib import Path
from typing import Text, Union
import torch
import torchaudio
from torchaudio.functional import resample
torchaudio.set_audio_backend("soundfile")
FilePath = Union[Text, Path]
class AudioLoader:
def __init__(self, sample_rate: int, mono: bool = True):
self.sample_rate = sample... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | docs/conf.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.440678 | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/diarization.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.443129 | from __future__ import annotations
from typing import Sequence
import numpy as np
import torch
from pyannote.core import Annotation, SlidingWindowFeature, SlidingWindow, Segment
from pyannote.metrics.base import BaseMetric
from pyannote.metrics.diarization import DiarizationErrorRate
from typing_extensions import Lit... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/aggregation.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.444282 | from abc import ABC, abstractmethod
from typing import Optional, List
import numpy as np
from pyannote.core import Segment, SlidingWindow, SlidingWindowFeature
from typing_extensions import Literal
class AggregationStrategy(ABC):
"""Abstract class representing a strategy to aggregate overlapping buffers
Par... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/argdoc.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.450117 | SEGMENTATION = "Segmentation model name from pyannote"
EMBEDDING = "Embedding model name from pyannote"
DURATION = "Chunk duration (in seconds)"
STEP = "Sliding window step (in seconds)"
LATENCY = "System latency (in seconds). STEP <= LATENCY <= CHUNK_DURATION"
TAU = "Probability threshold to consider a speaker as acti... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/__init__.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.485658 | from .blocks import (
SpeakerDiarization,
Pipeline,
SpeakerDiarizationConfig,
PipelineConfig,
VoiceActivityDetection,
VoiceActivityDetectionConfig,
)
|
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/clustering.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:47.581069 | from typing import Optional, List, Iterable, Tuple
import numpy as np
import torch
from pyannote.core import SlidingWindowFeature
from ..mapping import SpeakerMap, SpeakerMapBuilder
class OnlineSpeakerClustering:
"""Implements constrained incremental online clustering of speakers and manages cluster centers.
... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.014824 | from typing import Text, Optional
import numpy as np
import torch
from pyannote.core import Annotation, Segment, SlidingWindowFeature
import torchaudio.transforms as T
from ..features import TemporalFeatures, TemporalFeatureFormatter
class Binarize:
"""
Transform a speaker segmentation from the discrete-tim... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/embedding.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.015389 | from typing import Optional, Union, Text
import torch
from einops import rearrange
from .. import functional as F
from ..features import TemporalFeatures, TemporalFeatureFormatter
from ..models import EmbeddingModel
class SpeakerEmbedding:
def __init__(self, model: EmbeddingModel, device: Optional[torch.device]... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/vad.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.036420 | from __future__ import annotations
from typing import Sequence
import numpy as np
import torch
from pyannote.core import (
Annotation,
Timeline,
SlidingWindowFeature,
SlidingWindow,
Segment,
)
from pyannote.metrics.base import BaseMetric
from pyannote.metrics.detection import DetectionErrorRate
fr... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/blocks/segmentation.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.048132 | from typing import Optional, Union, Text
import torch
from einops import rearrange
from ..features import TemporalFeatures, TemporalFeatureFormatter
from ..models import SegmentationModel
class SpeakerSegmentation:
def __init__(self, model: SegmentationModel, device: Optional[torch.device] = None):
self... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/console/client.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.059847 | import argparse
from pathlib import Path
from threading import Thread
from typing import Text, Optional
import rx.operators as ops
from websocket import WebSocket
from diart import argdoc
from diart import sources as src
from diart import utils
def send_audio(ws: WebSocket, source: Text, step: float, sample_rate: i... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/console/serve.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.106281 | import argparse
from pathlib import Path
import torch
from diart import argdoc
from diart import models as m
from diart import sources as src
from diart import utils
from diart.inference import StreamingInference
from diart.sinks import RTTMWriter
def run():
parser = argparse.ArgumentParser()
parser.add_arg... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/console/stream.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.127637 | import argparse
from pathlib import Path
import torch
from diart import argdoc
from diart import models as m
from diart import sources as src
from diart import utils
from diart.inference import StreamingInference
from diart.sinks import RTTMWriter
def run():
parser = argparse.ArgumentParser()
parser.add_arg... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/console/benchmark.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.150242 | import argparse
from pathlib import Path
import pandas as pd
import torch
from diart import argdoc
from diart import models as m
from diart import utils
from diart.inference import Benchmark, Parallelize
def run():
parser = argparse.ArgumentParser()
parser.add_argument(
"root",
type=Path,
... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/console/tune.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.162129 | import argparse
from pathlib import Path
import optuna
import torch
from optuna.samplers import TPESampler
from diart import argdoc
from diart import models as m
from diart import utils
from diart.blocks.base import HyperParameter
from diart.optim import Optimizer
def run():
parser = argparse.ArgumentParser()
... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/features.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.571945 | from typing import Union, Optional
from abc import ABC, abstractmethod
import numpy as np
import torch
from pyannote.core import SlidingWindow, SlidingWindowFeature
TemporalFeatures = Union[SlidingWindowFeature, np.ndarray, torch.Tensor]
class TemporalFeatureFormatterState(ABC):
"""
Represents the recorded ... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/functional.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.583923 | from __future__ import annotations
import torch
def overlapped_speech_penalty(
segmentation: torch.Tensor, gamma: float = 3, beta: float = 10
):
# segmentation has shape (batch, frames, speakers)
probs = torch.softmax(beta * segmentation, dim=-1)
weights = torch.pow(segmentation, gamma) * torch.pow(p... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/inference.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.599526 | import logging
from multiprocessing import Pool, freeze_support, RLock, current_process
from pathlib import Path
from traceback import print_exc
from typing import Union, Text, Optional, Callable, Tuple, List
import numpy as np
import pandas as pd
import rx
import rx.operators as ops
import torch
from pyannote.core im... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/mapping.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.654365 | from __future__ import annotations
from typing import Callable, Iterable, List, Optional, Text, Tuple, Union, Dict
from abc import ABC, abstractmethod
import numpy as np
from pyannote.core.utils.distance import cdist
from scipy.optimize import linear_sum_assignment as lsap
class MappingMatrixObjective(ABC):
def... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.661663 | from __future__ import annotations
from abc import ABC
from pathlib import Path
from typing import Optional, Text, Union, Callable, List
import numpy as np
import torch
import torch.nn as nn
from requests import HTTPError
try:
from pyannote.audio import Model
from pyannote.audio.pipelines.speaker_verificatio... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/operators.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.668724 | from dataclasses import dataclass
from typing import Callable, Optional, List, Any, Tuple
import numpy as np
import rx
from pyannote.core import Annotation, SlidingWindow, SlidingWindowFeature, Segment
from rx import operators as ops
from rx.core import Observable
Operator = Callable[[Observable], Observable]
@data... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/optim.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.684462 | from collections import OrderedDict
from pathlib import Path
from typing import Sequence, Text, Optional, Union
from optuna import TrialPruned, Study, create_study
from optuna.samplers import TPESampler
from optuna.trial import Trial, FrozenTrial
from pyannote.metrics.base import BaseMetric
from tqdm import trange, tq... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/sinks.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.730767 | from pathlib import Path
from typing import Union, Text, Optional, Tuple
import matplotlib.pyplot as plt
from pyannote.core import Annotation, Segment, SlidingWindowFeature, notebook
from pyannote.database.util import load_rttm
from pyannote.metrics.diarization import DiarizationErrorRate
from rx.core import Observer
... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/sources.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.784925 | from abc import ABC, abstractmethod
from pathlib import Path
from queue import SimpleQueue
from typing import Text, Optional, AnyStr, Dict, Any, Union, Tuple
import numpy as np
import sounddevice as sd
import torch
from einops import rearrange
from rx.subject import Subject
from torchaudio.io import StreamReader
from ... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/progress.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:48.805057 | from abc import ABC, abstractmethod
from typing import Optional, Text
import rich
from rich.progress import Progress, TaskID
from tqdm import tqdm
class ProgressBar(ABC):
@abstractmethod
def create(
self,
total: int,
description: Optional[Text] = None,
unit: Text = "it",
... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | tests/test_aggregation.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:49.594592 | import numpy as np
import pytest
from pyannote.core import SlidingWindow, SlidingWindowFeature
from diart.blocks.aggregation import (
AggregationStrategy,
HammingWeightedAverageStrategy,
FirstOnlyStrategy,
AverageStrategy,
DelayedAggregation,
)
def test_strategy_build():
strategy = Aggregatio... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | tests/conftest.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:49.595788 | import random
import pytest
import torch
from diart.models import SegmentationModel, EmbeddingModel
class DummySegmentationModel:
def to(self, device):
pass
def __call__(self, waveform: torch.Tensor) -> torch.Tensor:
assert waveform.ndim == 3
batch_size, num_channels, num_samples =... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | src/diart/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:49.596240 | import base64
import time
from typing import Optional, Text, Union
import matplotlib.pyplot as plt
import numpy as np
from pyannote.core import Annotation, Segment, SlidingWindowFeature, notebook
from . import blocks
from .progress import ProgressBar
class Chronometer:
def __init__(self, unit: Text, progress_ba... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | tests/utils.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:49.904255 | from __future__ import annotations
import random
import numpy as np
from pyannote.core import SlidingWindowFeature, SlidingWindow
def build_waveform_swf(
duration: float, sample_rate: int, start_time: float | None = None
) -> SlidingWindowFeature:
start_time = round(random.uniform(0, 600), 1) if start_time is... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | tests/test_end_to_end.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:50.723173 | import math
from pathlib import Path
import pytest
from pyannote.database.util import load_rttm
from diart import SpeakerDiarization, SpeakerDiarizationConfig
from diart.inference import StreamingInference
from diart.models import SegmentationModel, EmbeddingModel
from diart.sources import FileAudioSource
MODEL_DIR ... |
juanmc2005/diart | https://github.com/juanmc2005/diart | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | tests/test_diarization.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:50.723622 | from __future__ import annotations
import random
import pytest
from diart import SpeakerDiarizationConfig, SpeakerDiarization
from utils import build_waveform_swf
@pytest.fixture
def random_diarization_config(
segmentation_model, embedding_model
) -> SpeakerDiarizationConfig:
duration = round(random.unifor... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/rulesets.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:52.965841 | from .predicates import predicate
class RuleSet(dict):
def test_rule(self, name, *args, **kwargs):
return name in self and self[name].test(*args, **kwargs)
def rule_exists(self, name):
return name in self
def add_rule(self, name, pred):
if name in self:
raise KeyError... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/permissions.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:52.974878 | from .rulesets import RuleSet
permissions = RuleSet()
def add_perm(name, pred):
permissions.add_rule(name, pred)
def set_perm(name, pred):
permissions.set_rule(name, pred)
def remove_perm(name):
permissions.remove_rule(name)
def perm_exists(name):
return permissions.rule_exists(name)
def has_... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/contrib/views.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:52.976097 | from functools import wraps
from django.conf import settings
from django.contrib.auth import REDIRECT_FIELD_NAME, mixins
from django.contrib.auth.views import redirect_to_login
from django.core.exceptions import FieldError, ImproperlyConfigured, PermissionDenied
from django.shortcuts import get_object_or_404
from djan... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/contrib/models.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:52.993226 | from django.core.exceptions import ImproperlyConfigured
from django.db.models import Model
from django.db.models.base import ModelBase
from ..permissions import add_perm
class RulesModelBaseMixin:
"""
Mixin for the metaclass of Django's Model that allows declaring object-level
permissions in the model's ... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/predicates.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:52.993738 | import logging
import operator
import threading
from functools import partial, update_wrapper
from inspect import getfullargspec, isfunction, ismethod
from typing import Any, Callable, List, Optional, Tuple, Union
logger = logging.getLogger("rules")
def assert_has_kwonlydefaults(fn: Callable[..., Any], msg: str) -> ... |
dfunckt/django-rules | https://github.com/dfunckt/django-rules | null | null | null | null | 1,974 | null | null | mit | null | null | null | null | null | null | null | rules/contrib/admin.py | null | null | null | null | null | null | Python | 2026-05-04T01:42:53.002775 | from django.contrib import admin
from django.contrib.auth import get_permission_codename
from ..permissions import perm_exists
class ObjectPermissionsModelAdminMixin(object):
def has_view_permission(self, request, obj=None):
opts = self.opts
codename = get_permission_codename("view", opts)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.