id int64 0 458k | file_name stringlengths 4 119 | file_path stringlengths 14 227 | content stringlengths 24 9.96M | size int64 24 9.96M | language stringclasses 1
value | extension stringclasses 14
values | total_lines int64 1 219k | avg_line_length float64 2.52 4.63M | max_line_length int64 5 9.91M | alphanum_fraction float64 0 1 | repo_name stringlengths 7 101 | repo_stars int64 100 139k | repo_forks int64 0 26.4k | repo_open_issues int64 0 2.27k | repo_license stringclasses 12
values | repo_extraction_date stringclasses 433
values |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41,000 | Port.py | SECFORCE_sparta/parsers/Port.py | #!/usr/bin/python
__author__ = 'SECFORCE'
__version__= '0.1'
import parsers.Service as Service
import parsers.Script as Script
class Port:
portId = ''
protocol= ''
state=''
def __init__( self, PortNode ):
if not (PortNode is None):
self.port_node = PortNode
self.por... | 955 | Python | .py | 26 | 28.653846 | 88 | 0.627063 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,001 | Parser.py | SECFORCE_sparta/parsers/Parser.py | #!/usr/bin/python
'''this module used to parse nmap xml report'''
__author__ = 'yunshu(wustyunshu@hotmail.com)'
__version__= '0.2'
__modified_by = 'ketchup'
__modified_by = 'SECFORCE'
import parsers.Session as Session
import parsers.Host as Host
import xml.dom.minidom
class Parser:
'''Parser class, parse a xm... | 2,886 | Python | .py | 68 | 31.441176 | 92 | 0.54086 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,002 | OS.py | SECFORCE_sparta/parsers/OS.py | #!/usr/bin/python
__author__ = 'ketchup'
__version__= '0.1'
__modified_by = 'ketchup'
class OS:
name = ''
family = ''
generation = ''
os_type = ''
vendor = ''
accuracy = 0
def __init__( self, OSNode ):
if not (OSNode is None):
self.name = OSNode.getAttribute('name')
... | 608 | Python | .py | 19 | 25.157895 | 59 | 0.580205 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,003 | Service.py | SECFORCE_sparta/parsers/Service.py | #!/usr/bin/python
__author__ = 'yunshu(wustyunshu@hotmail.com)'
__version__= '0.2'
__modified_by = 'ketchup'
class Service:
extrainfo = ''
name = ''
product = ''
fingerprint = ''
version = ''
def __init__( self, ServiceNode ):
self.extrainfo = ServiceNode.getAttribute('extrainfo')
... | 555 | Python | .py | 16 | 29.5 | 64 | 0.654851 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,004 | Script.py | SECFORCE_sparta/parsers/Script.py | #!/usr/bin/python
__author__ = 'ketchup'
__version__= '0.1'
__modified_by = 'ketchup'
class Script:
scriptId = ''
output = ''
def __init__( self, ScriptNode ):
if not (ScriptNode is None):
self.scriptId = ScriptNode.getAttribute('id')
self.output = ScriptNode.getAttribut... | 332 | Python | .py | 11 | 24.909091 | 59 | 0.603774 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,005 | Session.py | SECFORCE_sparta/parsers/Session.py | #!/usr/bin/python
__author__ = 'yunshu(wustyunshu@hotmail.com)'
__version__= '0.2'
class Session:
def __init__( self, SessionHT ):
self.start_time = SessionHT.get('start_time', '')
self.finish_time = SessionHT.get('finish_time', '')
self.nmap_version = SessionHT.get('nmap_version', '')
... | 547 | Python | .py | 12 | 39.416667 | 61 | 0.609756 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,006 | Host.py | SECFORCE_sparta/parsers/Host.py | #!/usr/bin/python
__author__ = 'yunshu(wustyunshu@hotmail.com)'
__version__= '0.2'
__modified_by = 'ketchup'
import parsers.Service as Service
import parsers.Script as Script
import parsers.OS as OS
import parsers.Port as Port
class Host:
ipv4 = ''
ipv6 = ''
macaddr = ''
status = 'none'
hostnam... | 4,074 | Python | .py | 87 | 36.942529 | 140 | 0.621642 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,007 | settings.py | SECFORCE_sparta/app/settings.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2020 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 28,662 | Python | .py | 377 | 66.159151 | 546 | 0.670103 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,008 | processmodels.py | SECFORCE_sparta/app/processmodels.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2020 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 7,973 | Python | .py | 153 | 39 | 243 | 0.564763 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,009 | hostmodels.py | SECFORCE_sparta/app/hostmodels.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2020 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 8,090 | Python | .py | 137 | 43.153285 | 243 | 0.522817 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,010 | auxiliary.py | SECFORCE_sparta/app/auxiliary.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2019 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 16,483 | Python | .py | 318 | 42.544025 | 243 | 0.574515 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,011 | logic.py | SECFORCE_sparta/app/logic.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2020 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 40,009 | Python | .py | 578 | 53.854671 | 301 | 0.575193 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,012 | servicemodels.py | SECFORCE_sparta/app/servicemodels.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2020 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 10,506 | Python | .py | 168 | 48.839286 | 243 | 0.53201 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,013 | scriptmodels.py | SECFORCE_sparta/app/scriptmodels.py | #!/usr/bin/env python
'''
SPARTA - Network Infrastructure Penetration Testing Tool (http://sparta.secforce.com)
Copyright (c) 2014 SECFORCE (Antonio Quina and Leonidas Stavliotis)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published... | 4,131 | Python | .py | 73 | 44.424658 | 243 | 0.58386 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,014 | ms08-067_check.py | SECFORCE_sparta/scripts/ms08-067_check.py | #!/usr/bin/env python
'''
Name: Microsoft Server Service Remote Path Canonicalization Stack Overflow Vulnerability
Description:
Anonymously check if a target machine is affected by MS08-067 (Vulnerability in Server Service Could Allow Remote Code Execution)
Author: Bernardo Damele A. G. <bernardo.damele@gmail.com>
... | 8,769 | Python | .py | 208 | 34.644231 | 129 | 0.630184 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,015 | ndr.py | SECFORCE_sparta/scripts/ndr.py | #!/usr/bin/env python
'''
This file is part of the PyMSRPC project and is licensed under the
project license.
ndr.py
This are the functions that provide all the NDR data types. It handles
serialization and everything. I have spent a shit load of time on this and
yet they are not 100%. ... | 35,836 | Python | .py | 998 | 24.985972 | 105 | 0.530938 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,016 | snmpbrute.py | SECFORCE_sparta/scripts/snmpbrute.py | #!/usr/bin/env python
# SNMP Bruteforce & Enumeration Script
# Requires metasploit, snmpwalk, snmpstat and john the ripper
__version__ = 'v1.0b'
from socket import socket, SOCK_DGRAM, AF_INET, timeout
from random import randint
from time import sleep
import optparse, sys, os
from subprocess import Popen, PIPE
import st... | 27,302 | Python | .py | 666 | 37.780781 | 1,902 | 0.625175 | SECFORCE/sparta | 1,607 | 445 | 20 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,017 | easy-install.py | frappe_bench/easy-install.py | #!/usr/bin/env python3
import argparse
import fileinput
import logging
import os
import platform
import subprocess
import sys
import time
import urllib.request
from shutil import move, unpack_archive, which
from typing import Dict
logging.basicConfig(
filename="easy-install.log",
filemode="w",
format="%(asctime)s ... | 9,743 | Python | .py | 320 | 26.765625 | 154 | 0.676574 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,018 | cli.py | frappe_bench/bench/cli.py | # imports - standard imports
import atexit
from contextlib import contextmanager
from logging import Logger
import os
import pwd
import sys
# imports - third party imports
import click
# imports - module imports
import bench
from bench.bench import Bench
from bench.commands import bench_command
from bench.config.comm... | 6,483 | Python | .py | 208 | 28.538462 | 85 | 0.715573 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,019 | app.py | frappe_bench/bench/app.py | # imports - standard imports
import json
import logging
import os
import re
import shutil
import subprocess
import sys
import uuid
import tarfile
import typing
from collections import OrderedDict
from datetime import date
from functools import lru_cache
from pathlib import Path
from typing import Optional
from urllib.p... | 30,393 | Python | .py | 899 | 30.461624 | 90 | 0.708931 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,020 | __init__.py | frappe_bench/bench/__init__.py | VERSION = "5.0.0-dev"
PROJECT_NAME = "frappe-bench"
FRAPPE_VERSION = None
current_path = None
updated_path = None
LOG_BUFFER = []
def set_frappe_version(bench_path="."):
from .utils.app import get_current_frappe_version
global FRAPPE_VERSION
if not FRAPPE_VERSION:
FRAPPE_VERSION = get_current_frappe_version(ben... | 340 | Python | .py | 11 | 29.181818 | 68 | 0.769939 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,021 | exceptions.py | frappe_bench/bench/exceptions.py | class InvalidBranchException(Exception):
pass
class InvalidRemoteException(Exception):
pass
class PatchError(Exception):
pass
class CommandFailedError(Exception):
pass
class BenchNotFoundError(Exception):
pass
class ValidationError(Exception):
pass
class AppNotInstalledError(ValidationError):
pass
... | 528 | Python | .py | 22 | 21.590909 | 51 | 0.886831 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,022 | bench.py | frappe_bench/bench/bench.py | # imports - standard imports
import subprocess
from functools import lru_cache
import os
import shutil
import json
import sys
import logging
from typing import List, MutableSequence, TYPE_CHECKING, Union
# imports - module imports
import bench
from bench.exceptions import AppNotInstalledError, InvalidRemoteException, ... | 13,559 | Python | .py | 395 | 30.96962 | 98 | 0.711157 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,023 | redis.py | frappe_bench/bench/config/redis.py | # imports - standard imports
import os
import re
import subprocess
# imports - module imports
import bench
def generate_config(bench_path):
from urllib.parse import urlparse
from bench.bench import Bench
config = Bench(bench_path).conf
redis_version = get_redis_version()
ports = {}
for key in ("redis_cache",... | 2,418 | Python | .py | 68 | 32.970588 | 80 | 0.716187 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,024 | site_config.py | frappe_bench/bench/config/site_config.py | # imports - standard imports
import json
import os
from collections import defaultdict
def get_site_config(site, bench_path="."):
config_path = os.path.join(bench_path, "sites", site, "site_config.json")
if not os.path.exists(config_path):
return {}
with open(config_path) as f:
return json.load(f)
def put_si... | 3,589 | Python | .py | 93 | 35.849462 | 88 | 0.725723 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,025 | production_setup.py | frappe_bench/bench/config/production_setup.py | # imports - standard imports
import contextlib
import os
import logging
import sys
# imports - module imports
import bench
from bench.config.nginx import make_nginx_conf
from bench.config.supervisor import (
generate_supervisor_config,
check_supervisord_config,
)
from bench.config.systemd import generate_systemd_con... | 5,574 | Python | .py | 162 | 31.666667 | 104 | 0.739568 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,026 | procfile.py | frappe_bench/bench/config/procfile.py | import os
import platform
import click
import bench
from bench.app import use_rq
from bench.bench import Bench
from bench.utils import which
def setup_procfile(bench_path, yes=False, skip_redis=False):
config = Bench(bench_path).conf
procfile_path = os.path.join(bench_path, "Procfile")
is_mac = platform.system(... | 872 | Python | .py | 31 | 25.354839 | 84 | 0.723022 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,027 | __init__.py | frappe_bench/bench/config/__init__.py | """Module for setting up system and respective bench configurations"""
def env():
from jinja2 import Environment, PackageLoader
return Environment(loader=PackageLoader("bench.config"))
| 190 | Python | .py | 4 | 45.25 | 70 | 0.814208 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,028 | common_site_config.py | frappe_bench/bench/config/common_site_config.py | # imports - standard imports
import getpass
import json
import os
default_config = {
"restart_supervisor_on_update": False,
"restart_systemd_on_update": False,
"serve_default_site": True,
"rebase_on_pull": False,
"frappe_user": getpass.getuser(),
"shallow_clone": True,
"background_workers": 1,
"use_redis_auth"... | 3,841 | Python | .py | 104 | 34.240385 | 89 | 0.737355 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,029 | supervisor.py | frappe_bench/bench/config/supervisor.py | # imports - standard imports
import getpass
import logging
import os
# imports - third party imports
import click
# imports - module imports
import bench
from bench.app import use_rq
from bench.bench import Bench
from bench.config.common_site_config import (
compute_max_requests_jitter,
get_config,
get_default_max... | 5,050 | Python | .py | 134 | 34.835821 | 89 | 0.737047 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,030 | nginx.py | frappe_bench/bench/config/nginx.py | # imports - standard imports
import hashlib
import os
import random
import string
# imports - third party imports
import click
# imports - module imports
import bench
import bench.config
from bench.bench import Bench
from bench.utils import get_bench_name
def make_nginx_conf(bench_path, yes=False, logging=None, log... | 8,544 | Python | .py | 235 | 32.846809 | 112 | 0.697646 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,031 | lets_encrypt.py | frappe_bench/bench/config/lets_encrypt.py | # imports - standard imports
import os
# imports - third party imports
import click
# imports - module imports
import bench
from bench.config.nginx import make_nginx_conf
from bench.config.production_setup import service
from bench.config.site_config import get_domains, remove_domain, update_site_config
from bench.be... | 5,423 | Python | .py | 150 | 33.36 | 142 | 0.738282 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,032 | systemd.py | frappe_bench/bench/config/systemd.py | # imports - standard imports
import getpass
import os
# imports - third partyimports
import click
# imports - module imports
import bench
from bench.app import use_rq
from bench.bench import Bench
from bench.config.common_site_config import (
get_gunicorn_workers,
update_config,
get_default_max_requests,
compute_... | 9,848 | Python | .py | 257 | 35.754864 | 92 | 0.72754 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,033 | cli.py | frappe_bench/bench/utils/cli.py | from typing import List
import click
from click.core import _check_multicommand
def print_bench_version(ctx, param, value):
"""Prints current bench version"""
if not value or ctx.resilient_parsing:
return
import bench
click.echo(bench.VERSION)
ctx.exit()
class MultiCommandGroup(click.Group):
def add_comma... | 2,320 | Python | .py | 68 | 30.926471 | 81 | 0.723519 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,034 | app.py | frappe_bench/bench/utils/app.py | # imports - standard imports
import os
import pathlib
import re
import sys
import subprocess
from typing import List, Optional
from functools import lru_cache
# imports - module imports
from bench.exceptions import (
InvalidRemoteException,
InvalidBranchException,
CommandFailedError,
VersionNotFound,
)
from bench.... | 8,965 | Python | .py | 231 | 35.965368 | 88 | 0.727252 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,035 | __init__.py | frappe_bench/bench/utils/__init__.py | # imports - standard imports
import json
import logging
import os
import re
import subprocess
import sys
import hashlib
from functools import lru_cache
from glob import glob
from pathlib import Path
from shlex import split
from tarfile import TarInfo
from typing import List, Optional, Tuple
# imports - third party imp... | 15,820 | Python | .py | 469 | 30.8742 | 116 | 0.710587 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,036 | system.py | frappe_bench/bench/utils/system.py | # imports - standard imports
import grp
import os
import pwd
import shutil
import sys
# imports - module imports
import bench
from bench.utils import (
exec_cmd,
get_process_manager,
log,
run_frappe_cmd,
sudoers_file,
which,
is_valid_frappe_branch,
)
from bench.utils.bench import build_assets, clone_apps_from
f... | 5,151 | Python | .py | 170 | 27.588235 | 92 | 0.728875 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,037 | render.py | frappe_bench/bench/utils/render.py | # imports - standard imports
import sys
from io import StringIO
# imports - third party imports
import click
# imports - module imports
import bench
class Capturing(list):
"""
Util to consume the stdout encompassed in it and push it to a list
with Capturing() as output:
subprocess.check_output("ls", sh... | 2,890 | Python | .py | 98 | 26 | 89 | 0.683599 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,038 | translation.py | frappe_bench/bench/utils/translation.py | # imports - standard imports
import itertools
import json
import os
def update_translations_p(args):
import requests
try:
update_translations(*args)
except requests.exceptions.HTTPError:
print("Download failed for", args[0], args[1])
def download_translations_p():
import multiprocessing
pool = multiproce... | 1,333 | Python | .py | 41 | 29.95122 | 66 | 0.735686 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,039 | bench.py | frappe_bench/bench/utils/bench.py | # imports - standard imports
import contextlib
import json
import logging
import os
import re
import shutil
import subprocess
import sys
from functools import lru_cache
from glob import glob
from json.decoder import JSONDecodeError
from pathlib import Path
# imports - third party imports
import click
# imports - modu... | 21,945 | Python | .py | 588 | 34.35034 | 122 | 0.715912 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,040 | __init__.py | frappe_bench/bench/patches/__init__.py | import os
import importlib
def run(bench_path):
source_patch_file = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "patches.txt"
)
target_patch_file = os.path.join(os.path.abspath(bench_path), "patches.txt")
with open(source_patch_file) as f:
patches = [
p.strip()
for p in f.read().splitline... | 914 | Python | .py | 30 | 27.033333 | 77 | 0.691781 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,041 | update_archived_sites.py | frappe_bench/bench/patches/v5/update_archived_sites.py | """
Deprecate archived_sites folder for consistency. This change is
only for Frappe v14 benches. If not a v14 bench yet, skip this
patch and try again later.
1. Rename folder `./archived_sites` to `./archived/sites`
2. Create a symlink `./archived_sites` => `./archived/sites`
Corresponding changes in frappe/frappe vi... | 1,342 | Python | .py | 35 | 36.085714 | 86 | 0.772868 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,042 | fix_backup_cronjob.py | frappe_bench/bench/patches/v5/fix_backup_cronjob.py | from bench.config.common_site_config import get_config
from crontab import CronTab
def execute(bench_path):
"""
This patch fixes a cron job that would backup sites every minute per 6 hours
"""
user = get_config(bench_path=bench_path).get("frappe_user")
user_crontab = CronTab(user=user)
for job in user_crontab... | 425 | Python | .py | 11 | 36.363636 | 82 | 0.765854 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,043 | fix_user_permissions.py | frappe_bench/bench/patches/v5/fix_user_permissions.py | # imports - standard imports
import getpass
import os
import subprocess
# imports - module imports
from bench.cli import change_uid_msg
from bench.config.production_setup import get_supervisor_confdir, is_centos7, service
from bench.config.common_site_config import get_config
from bench.utils import exec_cmd, get_benc... | 1,806 | Python | .py | 44 | 38.522727 | 92 | 0.755301 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,044 | test_utils.py | frappe_bench/bench/tests/test_utils.py | import os
import shutil
import subprocess
import unittest
from bench.app import App
from bench.bench import Bench
from bench.exceptions import InvalidRemoteException
from bench.utils import is_valid_frappe_branch
class TestUtils(unittest.TestCase):
def test_app_utils(self):
git_url = "https://github.com/frappe/fr... | 2,869 | Python | .py | 86 | 29.744186 | 87 | 0.685487 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,045 | test_setup_production.py | frappe_bench/bench/tests/test_setup_production.py | # imports - standard imports
import getpass
import os
import pathlib
import re
import subprocess
import time
import unittest
# imports - module imports
from bench.utils import exec_cmd, get_cmd_output, which
from bench.config.production_setup import get_supervisor_confdir
from bench.tests.test_base import TestBenchBas... | 5,505 | Python | .py | 148 | 33.195946 | 123 | 0.703926 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,046 | test_base.py | frappe_bench/bench/tests/test_base.py | # imports - standard imports
import getpass
import json
import os
import shutil
import subprocess
import sys
import traceback
import unittest
# imports - module imports
from bench.utils import paths_in_bench, exec_cmd
from bench.utils.system import init
from bench.bench import Bench
PYTHON_VER = sys.version_info
FRA... | 3,747 | Python | .py | 109 | 30.633028 | 114 | 0.698865 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,047 | test_init.py | frappe_bench/bench/tests/test_init.py | # imports - standard imports
import json
import os
import subprocess
import unittest
# imports - third paty imports
import git
# imports - module imports
from bench.utils import exec_cmd
from bench.app import App
from bench.tests.test_base import FRAPPE_BRANCH, TestBenchBase
from bench.bench import Bench
# changed ... | 6,719 | Python | .py | 169 | 36.414201 | 88 | 0.709395 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,048 | setup.py | frappe_bench/bench/commands/setup.py | # imports - standard imports
import os
import sys
# imports - third party imports
import click
# imports - module imports
from bench.utils import exec_cmd, run_playbook, which
from bench.utils.cli import SugaredOption
@click.group(help="Setup command group for enabling setting up a Frappe environment")
def setup():... | 12,750 | Python | .py | 348 | 34.594828 | 134 | 0.761522 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,049 | config.py | frappe_bench/bench/commands/config.py | # imports - module imports
from bench.config.common_site_config import update_config, put_config
# imports - third party imports
import click
@click.group(help="Change bench configuration")
def config():
pass
@click.command(
"restart_supervisor_on_update",
help="Enable/Disable auto restart of supervisor process... | 2,838 | Python | .py | 73 | 36.931507 | 87 | 0.753195 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,050 | git.py | frappe_bench/bench/commands/git.py | # imports - standard imports
import os
import subprocess
# imports - module imports
from bench.bench import Bench
from bench.app import get_repo_dir
from bench.utils import set_git_remote_url
from bench.utils.app import get_remote
# imports - third party imports
import click
@click.command('remote-set-url', help="S... | 1,009 | Python | .py | 27 | 35.37037 | 113 | 0.735597 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,051 | utils.py | frappe_bench/bench/commands/utils.py | # imports - standard imports
import os
# imports - third party imports
import click
@click.command("start", help="Start Frappe development processes")
@click.option("--no-dev", is_flag=True, default=False)
@click.option(
"--no-prefix",
is_flag=True,
default=False,
help="Hide process name from bench start log",
)... | 5,331 | Python | .py | 140 | 36.157143 | 89 | 0.765531 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,052 | __init__.py | frappe_bench/bench/commands/__init__.py | # imports - third party imports
import click
# imports - module imports
from bench.utils.cli import (
MultiCommandGroup,
print_bench_version,
use_experimental_feature,
setup_verbosity,
)
@click.group(cls=MultiCommandGroup)
@click.option(
"--version",
is_flag=True,
is_eager=True,
callback=print_bench_version,... | 3,033 | Python | .py | 111 | 25.666667 | 76 | 0.816552 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,053 | make.py | frappe_bench/bench/commands/make.py | # imports - third party imports
import click
@click.command("init", help="Initialize a new bench instance in the specified path")
@click.argument("path")
@click.option(
"--version",
"--frappe-branch",
"frappe_branch",
default=None,
help="Clone a particular branch of frappe",
)
@click.option(
"--ignore-exist", i... | 7,178 | Python | .py | 234 | 28.568376 | 98 | 0.747611 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,054 | update.py | frappe_bench/bench/commands/update.py | # imports - third party imports
import click
# imports - module imports
from bench.app import pull_apps
from bench.utils.bench import post_upgrade, patch_sites, build_assets
@click.command(
"update",
help="Performs an update operation on current bench. Without any flags will backup, pull, setup requirements, build... | 2,798 | Python | .py | 89 | 29.595506 | 213 | 0.759362 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,055 | install.py | frappe_bench/bench/commands/install.py | # imports - module imports
from bench.utils import run_playbook
from bench.utils.system import setup_sudoers
# imports - third party imports
import click
extra_vars = {"production": True}
@click.group(help="Install system dependencies for setting up Frappe environment")
def install():
pass
@click.command(
"pre... | 3,435 | Python | .py | 94 | 34.638298 | 128 | 0.764191 | frappe/bench | 1,348 | 1,189 | 101 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,056 | setup.py | pollen-robotics_dtw/setup.py | #!/usr/bin/env python
from importlib.machinery import SourceFileLoader
from setuptools import setup, find_packages
version = SourceFileLoader('dtw.version', 'dtw/version.py').load_module()
long_description = '''
Dtw is a Python Module for computing Dynamic Time Warping distance. It can be used as a similarity measu... | 1,113 | Python | .py | 25 | 39 | 135 | 0.708449 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,057 | speech-recognition.ipynb | pollen-robotics_dtw/examples/speech-recognition.ipynb | {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Speech recognition"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Simple sppeech recognition system can be implemented using DTW + MFCC. "
]
},
{
"cell_type": "code",
"execution_count":... | 4,772 | Python | .py | 214 | 18.074766 | 270 | 0.508776 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,058 | simple example.ipynb | pollen-robotics_dtw/examples/simple example.ipynb | {
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# DTW simple example"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy a... | 33,849 | Python | .py | 163 | 203.116564 | 25,128 | 0.927715 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,059 | MFCC + DTW.ipynb | pollen-robotics_dtw/examples/MFCC + DTW.ipynb | {
"metadata": {
"name": "",
"signature": "sha256:74e0ad2f4b638e46c9fecaa6826bb4546730cdb2ae9c6231b77fef300bfe434e"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Using DTW to compare sound... | 21,568 | Python | .py | 174 | 117.729885 | 10,413 | 0.86987 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,060 | publish_pypi.yml | pollen-robotics_dtw/.github/workflows/publish_pypi.yml | name: Upload Python Package on Pypi.
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upg... | 601 | Python | .py | 23 | 20.217391 | 52 | 0.627383 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,061 | test_simple_2d_data.py | pollen-robotics_dtw/tests/test_simple_2d_data.py | import numpy as np
from dtw import dtw
def l2_norm(x, y):
return (x - y) ** 2
def test_simple_2d_data():
x = np.array([2, 0, 1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)
y = np.array([1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)
dist, cost_matrix, acc_cost_matrix, path = dtw(x, y, dist=l2_norm)
assert ... | 1,469 | Python | .py | 35 | 34.342857 | 70 | 0.34059 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,062 | test_import.py | pollen-robotics_dtw/tests/test_import.py | import unittest
class ImportTestCase(unittest.TestCase):
def test_import(self):
import dtw
from dtw import dtw as dist
from dtw import accelerated_dtw
def test_has_version(self):
from dtw import __version__
| 250 | Python | .py | 8 | 24.875 | 40 | 0.690377 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,063 | test.py | pollen-robotics_dtw/tests/test.py | import unittest
import numpy as np
from dtw import dtw
class Test(unittest.TestCase):
def test_distance(self):
x = np.array([0, 0, 1, 1, 2, 4, 2, 1, 2, 0]).reshape(-1, 1)
y = np.array([1, 1, 1, 2, 2, 2, 2, 3, 2, 0]).reshape(-1, 1)
dist, cost, acc, path = dtw(x, y, dist=lambda x, y: np.lin... | 1,326 | Python | .py | 28 | 39.071429 | 89 | 0.500775 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,064 | test_fastvsnormal.py | pollen-robotics_dtw/tests/test_fastvsnormal.py | import unittest
import numpy as np
from dtw import dtw, accelerated_dtw
class FastVsNormalTestCase(unittest.TestCase):
def test_fast_vs_normal_1D(self):
x = np.random.rand(np.random.randint(2, 100))
y = np.random.rand(np.random.randint(2, 100))
d1, c1, acc1, p1 = dtw(x, y, dist=lambda x,... | 1,782 | Python | .py | 37 | 40 | 79 | 0.565242 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,065 | dtw.py | pollen-robotics_dtw/dtw/dtw.py | from numpy import array, zeros, full, argmin, inf, ndim
from scipy.spatial.distance import cdist
from math import isinf
def dtw(x, y, dist, warp=1, w=inf, s=1.0):
"""
Computes Dynamic Time Warping (DTW) of two sequences.
:param array x: N1*M array
:param array y: N2*M array
:param func dist: dist... | 5,818 | Python | .py | 145 | 32.724138 | 343 | 0.536913 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,066 | __init__.py | pollen-robotics_dtw/dtw/__init__.py | from .dtw import dtw, accelerated_dtw
from .version import version as __version__
| 82 | Python | .py | 2 | 40 | 43 | 0.7875 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,067 | publish_pypi.yml | pollen-robotics_dtw/.github/workflows/publish_pypi.yml | name: Upload Python Package on Pypi.
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upg... | 601 | Python | .pyp | 23 | 20.217391 | 52 | 0.627383 | pollen-robotics/dtw | 1,149 | 232 | 16 | GPL-3.0 | 9/5/2024, 5:15:46 PM (Europe/Amsterdam) |
41,068 | setup.py | lanjelot_patator/setup.py | from setuptools import setup, find_packages
def parse_requirements(file):
required = []
with open(file) as f:
for req in f.read().splitlines():
if not req.strip().startswith('#'):
required.append(req)
return required
requirements = parse_requirements('requirements.txt')... | 1,753 | Python | .py | 38 | 39.789474 | 422 | 0.678571 | lanjelot/patator | 3,538 | 775 | 32 | GPL-2.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,069 | patator.py | lanjelot_patator/patator.py | #!/usr/bin/env python3
# Copyright (C) 2012 Sebastien MACKE
#
# This program is free software; you can redistribute it and/or modify it under
# the terms of the GNU General Public License version 2, as published by the
# Free Software Foundation
#
# This program is distributed in the hope that it will be useful, but W... | 169,223 | Python | .py | 4,119 | 35.505462 | 268 | 0.612545 | lanjelot/patator | 3,538 | 775 | 32 | GPL-2.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,070 | setup.py | nabla-c0d3_sslyze/setup.py | import sys
from os import path, listdir
from pathlib import Path
from typing import List, Tuple, Dict
from setuptools import find_packages
# Setup file based on https://github.com/pypa/sampleproject/blob/master/setup.py
root_path = Path(__file__).parent.absolute()
# For cx_freeze builds, we need a special setup() fu... | 4,079 | Python | .py | 93 | 37.956989 | 112 | 0.646851 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,071 | api_sample.py | nabla-c0d3_sslyze/api_sample.py | from datetime import datetime
from pathlib import Path
from typing import List
from sslyze import (
Scanner,
ServerScanRequest,
SslyzeOutputAsJson,
ServerNetworkLocation,
ScanCommandAttemptStatusEnum,
ServerScanStatusEnum,
ServerScanResult,
ServerScanResultAsJson,
)
from sslyze.errors i... | 7,086 | Python | .py | 133 | 44.62406 | 120 | 0.692652 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,072 | tasks.py | nabla-c0d3_sslyze/tasks.py | import json
from pathlib import Path
from sys import platform
from invoke.context import Context
from invoke.tasks import task
from sslyze import __version__
root_path = Path(__file__).parent.absolute()
@task
def test(ctx: Context) -> None:
ctx.run("pytest --cov=sslyze --cov-fail-under 80 --durations 5")
@task... | 1,959 | Python | .py | 55 | 31.545455 | 97 | 0.671269 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,073 | conf.py | nabla-c0d3_sslyze/docs/conf.py | # -*- coding: utf-8 -*-
#
# sslyze documentation build configuration file, created by
# sphinx-quickstart on Sun Jan 15 12:41:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# Al... | 4,991 | Python | .py | 119 | 40.159664 | 108 | 0.701551 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,074 | running-a-scan-in-python.rst | nabla-c0d3_sslyze/docs/running-a-scan-in-python.rst |
Running a Scan in Python
########################
Overview
********
SSLyze's Python API can be used to run scans and process results in an automated fashion.
Every SSLyze class has typing annotations, which allows IDEs such as VS Code and PyCharms to auto-import modules
and auto-complete field names. Make sure to l... | 3,618 | Python | .py | 70 | 48.428571 | 155 | 0.734246 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,075 | running-a-scan-in-python.html | nabla-c0d3_sslyze/docs/documentation/running-a-scan-in-python.html | <!DOCTYPE html>
<html lang="en" data-content_root="./">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" />
<title>Running a Scan in Python — SSLyze 6.0.0 docum... | 80,195 | Python | .py | 613 | 127.616639 | 2,014 | 0.697921 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,076 | run_tests_with_lowest_pydantic_version.yml | nabla-c0d3_sslyze/.github/workflows/run_tests_with_lowest_pydantic_version.yml | name: Run tests with lowest supported version of pydantic
on:
push:
branches: [release]
pull_request:
branches: [ release, dev ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
... | 739 | Python | .py | 25 | 22.84 | 58 | 0.628006 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,077 | errors.py | nabla-c0d3_sslyze/sslyze/errors.py | from abc import ABC
from dataclasses import dataclass
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from sslyze.server_setting import ServerNetworkLocation, ServerNetworkConfiguration
class InvalidServerNetworkConfigurationError(Exception):
"""Raised when trying to create a ServerNetworkConfiguration wi... | 2,216 | Python | .py | 52 | 39.076923 | 120 | 0.821295 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,078 | __main__.py | nabla-c0d3_sslyze/sslyze/__main__.py | import sys
from datetime import datetime
from typing import Optional, TextIO
from sslyze.cli.console_output import ObserverToGenerateConsoleOutput
from sslyze.__version__ import __version__
from sslyze.cli.command_line_parser import CommandLineParsingError, CommandLineParser
from sslyze import (
Scanner,
Serv... | 5,970 | Python | .py | 121 | 40.61157 | 118 | 0.687307 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,079 | __version__.py | nabla-c0d3_sslyze/sslyze/__version__.py | __title__ = "SSLyze"
__version__ = "6.0.0"
__description__ = "Fast and powerful SSL/TLS scanning library."
__author__ = "Alban Diquet"
__author_email__ = "nabla.c0d3@gmail.com"
__url__ = "https://github.com/nabla-c0d3/sslyze"
__license__ = "AGPL"
__copyright__ = "Copyright 2024 Alban Diquet"
| 293 | Python | .py | 8 | 35.625 | 63 | 0.663158 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,080 | server_connectivity.py | nabla-c0d3_sslyze/sslyze/server_connectivity.py | import socket
from enum import Enum, unique
from pathlib import Path
from typing import Optional
from dataclasses import dataclass
from nassl import _nassl
from nassl.ssl_client import ClientCertificateRequested, SslClient
from sslyze.server_setting import ServerNetworkLocation, ServerNetworkConfiguration
from sslyz... | 20,138 | Python | .py | 406 | 40.805419 | 120 | 0.699008 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,081 | __init__.py | nabla-c0d3_sslyze/sslyze/__init__.py | # flake8: noqa
# Classes for configuring the servers to scan
from sslyze.server_setting import (
ServerNetworkLocation,
ConnectionTypeEnum,
HttpProxySettings,
ClientAuthenticationCredentials,
ServerNetworkConfiguration,
)
from sslyze.connection_helpers.opportunistic_tls_helpers import ProtocolWithO... | 3,051 | Python | .py | 72 | 39.722222 | 98 | 0.86471 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,082 | server_setting.py | nabla-c0d3_sslyze/sslyze/server_setting.py | import socket
from base64 import b64encode
from enum import Enum
from pathlib import Path
from typing import Optional
from urllib.parse import quote
from dataclasses import dataclass
from urllib.parse import urlparse
from nassl.ssl_client import OpenSslFileTypeEnum, SslClient
from sslyze.connection_helpers.opportun... | 8,636 | Python | .py | 162 | 45.17284 | 120 | 0.701542 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,083 | pydantic_utils.py | nabla-c0d3_sslyze/sslyze/json/pydantic_utils.py | from typing import Any
try:
# Python 3.9+
from typing import Annotated # type: ignore
except ImportError:
# Python 3.8
from typing_extensions import Annotated
from pydantic import BaseModel, BeforeValidator, ConfigDict
class BaseModelWithOrmMode(BaseModel):
model_config = ConfigDict(from_attrib... | 790 | Python | .py | 19 | 37.526316 | 112 | 0.772668 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,084 | json_output.py | nabla-c0d3_sslyze/sslyze/json/json_output.py | from datetime import datetime
from pathlib import Path
from typing import List, Optional, Any
from uuid import UUID
from pydantic import BaseModel, model_validator
from sslyze import (
ServerNetworkConfiguration,
ProtocolWithOpportunisticTlsEnum,
ServerScanStatusEnum,
ServerConnectivityStatusEnum,
... | 9,205 | Python | .py | 178 | 45.168539 | 112 | 0.773173 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,085 | scan_attempt_json.py | nabla-c0d3_sslyze/sslyze/json/scan_attempt_json.py | from abc import ABC
from typing import Optional
from pydantic import BaseModel, ConfigDict
from sslyze.scanner.scan_command_attempt import ScanCommandAttemptStatusEnum, ScanCommandErrorReasonEnum
# Must be subclassed in order to add the result field
class ScanCommandAttemptAsJson(BaseModel, ABC):
model_config = ... | 596 | Python | .py | 13 | 41.769231 | 105 | 0.806563 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,086 | tls_connection.py | nabla-c0d3_sslyze/sslyze/connection_helpers/tls_connection.py | import socket
from pathlib import Path
from typing import Optional, TYPE_CHECKING
from nassl.legacy_ssl_client import LegacySslClient
from sslyze.server_setting import (
ServerNetworkLocation,
ServerNetworkConfiguration,
ConnectionTypeEnum,
)
from sslyze.errors import (
ConnectionToServerTimedOut,
... | 16,534 | Python | .py | 310 | 42.093548 | 118 | 0.664462 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,087 | opportunistic_tls_helpers.py | nabla-c0d3_sslyze/sslyze/connection_helpers/opportunistic_tls_helpers.py | import socket
import struct
from abc import abstractmethod, ABC
from enum import Enum
from typing import ClassVar, Optional
class ProtocolWithOpportunisticTlsEnum(str, Enum):
"""The list of plaintext protocols supported by SSLyze for opportunistic TLS upgrade (such as STARTTLS).
This allows SSLyze to figure ... | 8,463 | Python | .py | 173 | 42.300578 | 119 | 0.704739 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,088 | http_request_generator.py | nabla-c0d3_sslyze/sslyze/connection_helpers/http_request_generator.py | from sslyze import __version__
class HttpRequestGenerator:
HTTP_GET_FORMAT = (
"GET {path} HTTP/1.1\r\n"
"Host: {host}\r\n"
"User-Agent: {user_agent}\r\n"
"Accept: */*\r\n"
"Connection: close\r\n\r\n"
)
DEFAULT_USER_AGENT = (
"Mozilla/5.0 (Windows NT 6.1; W... | 657 | Python | .py | 16 | 34.3125 | 114 | 0.605965 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,089 | http_response_parser.py | nabla-c0d3_sslyze/sslyze/connection_helpers/http_response_parser.py | from io import BytesIO
from socket import socket
from typing import Callable
from http.client import HTTPResponse
from nassl.ssl_client import BaseSslClient
class _FakeSocket(BytesIO):
def makefile(self, *args, **kw): # type: ignore
return self
class NotAValidHttpResponseError(Exception):
pass
cl... | 1,359 | Python | .py | 32 | 35.71875 | 108 | 0.693536 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,090 | models.py | nabla-c0d3_sslyze/sslyze/scanner/models.py | from dataclasses import dataclass, fields, field
from enum import Enum
from traceback import TracebackException
from typing import Set, Optional, Type
from uuid import UUID, uuid4
from sslyze import ServerNetworkConfiguration
from sslyze.plugins.elliptic_curves_plugin import SupportedEllipticCurvesScanResult
from ss... | 7,635 | Python | .py | 142 | 48.28169 | 120 | 0.796909 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,091 | scan_command_attempt.py | nabla-c0d3_sslyze/sslyze/scanner/scan_command_attempt.py | from dataclasses import dataclass
from enum import Enum
from traceback import TracebackException
from typing import Generic, Optional, TypeVar
# These are in a separate file to avoid cyclic imports
_ScanCommandResultTypeVar = TypeVar("_ScanCommandResultTypeVar")
class ScanCommandAttemptStatusEnum(str, Enum):
ER... | 1,501 | Python | .py | 31 | 43.548387 | 117 | 0.766118 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,092 | _mass_scanner.py | nabla-c0d3_sslyze/sslyze/scanner/_mass_scanner.py | import threading
from dataclasses import dataclass, fields
import queue
from time import sleep
from traceback import TracebackException
from typing import Dict, List, Tuple, Union
from uuid import UUID
from nassl.ssl_client import ClientCertificateRequested
from sslyze import ServerTlsProbingResult, ScanCommandAttemp... | 16,719 | Python | .py | 305 | 44.157377 | 119 | 0.684201 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,093 | _mass_connectivity_tester.py | nabla-c0d3_sslyze/sslyze/scanner/_mass_connectivity_tester.py | import queue
import threading
from typing import Tuple, Union, List, Callable
from sslyze import ServerScanRequest, ServerTlsProbingResult
from sslyze.errors import ConnectionToServerFailed
from sslyze.server_connectivity import check_connectivity_to_server
try:
# Python 3.10+
from typing import TypeAlias # ... | 4,952 | Python | .py | 100 | 39.68 | 105 | 0.675166 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,094 | _jobs_worker_thread.py | nabla-c0d3_sslyze/sslyze/scanner/_jobs_worker_thread.py | import threading
from dataclasses import dataclass
import queue
from typing import Optional, Any, Callable, Sequence, Union
from uuid import UUID
from sslyze.plugins.scan_commands import ScanCommand
try:
# Python 3.10+
from typing import TypeAlias # type: ignore
except ImportError:
# Python 3.9 and befo... | 2,623 | Python | .py | 60 | 33.1 | 114 | 0.638649 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,095 | scanner_observer.py | nabla-c0d3_sslyze/sslyze/scanner/scanner_observer.py | from abc import ABC, abstractmethod
from sslyze import ServerScanRequest, ServerTlsProbingResult, ServerScanResult
from sslyze.errors import ConnectionToServerFailed
# Could be turned into a typing.Protocol once we stop supporting Python 3.7
class ScannerObserver(ABC):
@abstractmethod
def server_connectivity... | 1,182 | Python | .py | 21 | 50.809524 | 118 | 0.75671 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,096 | scanner.py | nabla-c0d3_sslyze/sslyze/scanner/scanner.py | import queue
from traceback import TracebackException
from typing import List, Optional, Generator, Sequence
from sslyze import ServerTlsProbingResult
from sslyze.errors import ConnectionToServerFailed
from sslyze.scanner._mass_connectivity_tester import MassConnectivityTester
from sslyze.scanner._mass_scanner import ... | 6,072 | Python | .py | 116 | 42.051724 | 107 | 0.694772 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,097 | command_line_parser.py | nabla-c0d3_sslyze/sslyze/cli/command_line_parser.py | from dataclasses import dataclass
from argparse import ArgumentParser
from pathlib import Path
from nassl.ssl_client import OpenSslFileTypeEnum
from typing import Set, List, Optional, Dict
from typing import Tuple
from sslyze.cli.server_string_parser import (
InvalidServerStringError,
CommandLineServerStringP... | 21,082 | Python | .py | 407 | 39.550369 | 120 | 0.63103 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,098 | console_output.py | nabla-c0d3_sslyze/sslyze/cli/console_output.py | from dataclasses import fields
from datetime import datetime
from pathlib import Path
from typing import TextIO, Optional
from sslyze import __version__, ServerScanRequest, ScanCommandAttemptStatusEnum, ScanCommandErrorReasonEnum
from sslyze.cli.command_line_parser import ParsedCommandLine
from sslyze.errors import C... | 8,898 | Python | .py | 150 | 50.393333 | 117 | 0.687005 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |
41,099 | server_string_parser.py | nabla-c0d3_sslyze/sslyze/cli/server_string_parser.py | import socket
from dataclasses import dataclass
from typing import Tuple, Optional
@dataclass(frozen=True)
class InvalidServerStringError(Exception):
"""Exception raised when SSLyze was unable to parse a hostname:port string supplied via the command line."""
server_string: str
error_message: str
class ... | 2,686 | Python | .py | 59 | 35.983051 | 120 | 0.613175 | nabla-c0d3/sslyze | 3,226 | 445 | 30 | AGPL-3.0 | 9/5/2024, 5:15:54 PM (Europe/Amsterdam) |