file_path stringlengths 8 88 | content stringlengths 0 466k | extension stringclasses 4
values | size_bytes int64 0 466k |
|---|---|---|---|
conftest.py | #SPDX-License-Identifier: MIT
import pytest
import re
import logging
import sqlalchemy as s
import psycopg2
from psycopg2 import sql
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
import uuid
from sqlalchemy.pool import StaticPool
from augur.application.db.session import DatabaseSession
from augur.applica... | py | 7,940 |
metadata.py | #SPDX-License-Identifier: MIT
__name__ = "augur"
__slug__ = "augur"
__url__ = "https://github.com/chaoss/augur"
__short_description__ = "Python 3 package for free/libre and open-source software community metrics, models & data collection"
__version__ = "0.85.2"
__release__ = "v0.85.2 (Eurovision: Fire Saga)"
__licen... | py | 457 |
schema-updates.sql | -- DO NOT IMPLEMENT YET .. trying to figure out why this happened. Running again.
--
-- 10/1/2022: SPG - Got an error on this login constraint, which actually makes no sense. So, trying this change.
/*
Traceback (most recent call last):
File "/home/sean/github/virtualenv/k12/lib/python3.8/site-packages/celery/app/tr... | sql | 4,151 |
setup.py | #SPDX-License-Identifier: MIT
"""
SPDX-License-Identifier: MIT
Install augur package with pip.
"""
from setuptools import setup, find_packages
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, "README.md"), encoding="utf-8") as f... | py | 3,407 |
run_http.sh | #!/bin/bash
export AUGUR_DEV=1
(nohup augur backend start &)
| sh | 62 |
jumpstart/Logging.py | import logging
from pathlib import Path
def init_logging(logger = logging.Logger("jumpstart") , errlog_file = Path("logs/jumpstart.error"), stdout_file = Path("logs/jumpstart.log")) -> logging.Logger:
errlog = logging.FileHandler(errlog_file, "w")
stdout = logging.FileHandler(stdout_file, "w")
formatter =... | py | 851 |
jumpstart/Server.py | import socket
import threading
from pathlib import Path
from .API import Status
from .Logging import console
from .Client import JumpstartClient as Client
from .utils import synchronized, CallbackCollection
class JumpstartServer:
def __init__(self, callbacks: CallbackCollection,
socketfile = Path... | py | 2,569 |
jumpstart/procman.py | from .API import Status
from .API import Component
from .Logging import console
from .utils import synchronized
from .utils import UniversalPlaceholder
from .Client import JumpstartClient as Client
import signal
from time import sleep
from typing import Union
from pathlib import Path
from threading import Lock
from s... | py | 5,108 |
jumpstart/Client.py | import json
import socket
import threading
from .Logging import console
from .API import spec, Status, Command
from .utils import synchronized, CallbackCollection
class JumpstartClient:
def __init__(self, sock: socket.socket, wake_lock: threading.Lock, ID: int, callbacks: CallbackCollection):
self.socket ... | py | 2,459 |
jumpstart/API.py | from enum import Enum, EnumMeta, auto
class Component(Enum):
all = auto()
frontend = auto()
api = auto()
collection = auto()
@staticmethod
def from_str(s):
if isinstance(s, Component):
return s
try:
return Component[s]
except:
re... | py | 4,444 |
jumpstart/utils.py | from functools import wraps
from threading import RLock
def synchronized(func):
lock = RLock()
@wraps(func)
def call_sync(*args, **kwargs):
with lock:
return func(*args, **kwargs)
return call_sync
class CallbackCollection:
def __init__(self, **cbs) -> None:
for name, cb... | py | 991 |
jumpstart/tui.py | import socket as sockets
from socket import socket
import json
import asyncio
import logging
from sys import argv
from pathlib import Path
from datetime import datetime
from textual import work
from textual.app import App, on
from textual.binding import Binding
from textual.message import Message
from textual.events ... | py | 13,201 |
jumpstart/jumpstart.py | import os
import sys
import time
import json
import socket
import signal
import logging
import threading
from pathlib import Path
from subprocess import Popen, PIPE, STDOUT
from .API import Status
from .API import Component
from .Logging import console
from .procman import ProcessManager
from .Server import Jumpstart... | py | 1,485 |
docker/database/augur-new-schema.sql | --
-- PostgreSQL database dump
--
-- Dumped from database version 16.3 (Homebrew)
-- Dumped by pg_dump version 16.3 (Homebrew)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config(... | sql | 465,940 |
docker/rabbitmq/update_config.py | from os import environ as env
import json, subprocess
from pathlib import Path
rabbit_user = env.get("RABBIT_MQ_DEFAULT_USER")
rabbit_pass = env.get("RABBIT_MQ_DEFAULT_PASSWORD")
rabbit_vhost = env.get("RABBIT_MQ_DEFAULT_VHOST")
if not rabbit_user:
raise ValueError("No default user set")
if not rabbit_pass:
... | py | 1,176 |
docker/backend/init.sh | #!/bin/bash
#SPDX-License-Identifier: MIT
set -e
if [[ "$AUGUR_DB_SCHEMA_BUILD" == "1" ]]; then
augur db create-schema
fi
if [ ! -v AUGUR_NO_CONFIG ]; then
./scripts/install/config.sh docker
fi
if [[ -f /repo_groups.csv ]]; then
augur db add-repo-groups /repo_groups.csv
fi
if [[ -f /repos.csv ]]; then
... | sh | 483 |
docker/backend/graphical.sh | #!/bin/bash
#SPDX-License-Identifier: MIT
set -e
source /opt/venv/bin/activate
export AUGUR_FACADE_REPO_DIRECTORY=/augur/facade/
export AUGUR_DOCKER_DEPLOY="1"
echo "Running with $AUGUR_FLAGS"
# Run the graphical startup wizard at port 5000
# -u option specifies unbuffered output
python -u ./scripts/install/wizard.... | sh | 328 |
docker/backend/entrypoint.sh | #!/bin/bash
#SPDX-License-Identifier: MIT
set -e
source /opt/venv/bin/activate
if [[ "$AUGUR_DB" == *"localhost"* ]]; then
echo "localhost db connection"
export AUGUR_DB="${AUGUR_DB/localhost/host.docker.internal}"
elif [[ "$AUGUR_DB" == *"127.0.0.1"* ]]; then
echo "localhost db connection"
export AU... | sh | 810 |
keyman/__init__.py | py | 0 | |
keyman/KeyOrchestrationAPI.py |
""" This is a hybrid-fixed specification
The names of the channels *MUST NOT* change,
but the channel IDs are free to
"""
spec = {
"channels": [
{
"name": "ANNOUNCE",
"id": "augur-oauth-announce",
"message_types": {
"PUBLISH": {
"key_... | py | 2,415 |
keyman/Orchestrator.py | from augur.tasks.init.redis_connection import redis_connection as conn
from augur.application.logs import AugurLogger
import json, random, time
from keyman.KeyOrchestrationAPI import spec, WaitKeyTimeout
class KeyOrchestrator:
def __init__(self) -> None:
self.stdin = conn.pubsub(ignore_subscribe_messages ... | py | 6,872 |
keyman/KeyClient.py | from augur.tasks.init.redis_connection import redis_connection as conn
from redis.client import PubSub
from logging import Logger
from os import getpid
import time, json
from keyman.KeyOrchestrationAPI import spec, WaitKeyTimeout
class KeyClient:
""" NOT THREAD SAFE!
Only one KeyClient can exist at a... | py | 8,736 |
tests/key_manager.py | from keyman.KeyClient import KeyClient, KeyPublisher
from augur.application.logs import AugurLogger
from multiprocessing import Process, current_process
from subprocess import Popen, PIPE
import random, time, atexit
keys = {
"github": [
"key1",
"key2",
"key3",
"key4"
],
"g... | py | 3,009 |
tests/entire_db.sql | --
-- PostgreSQL database dump
--
-- Dumped from database version 12.14 (Ubuntu 12.14-0ubuntu0.20.04.1)
-- Dumped by pg_dump version 12.14 (Ubuntu 12.14-0ubuntu0.20.04.1)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming... | sql | 464,455 |
tests/__init__.py | #SPDX-License-Identifier: MIT
server_port = "5005" | py | 51 |
tests/stop_server.py | import time
import subprocess
import os
import pytest
import sys
FNULL = open(os.devnull, "w")
subprocess.Popen(["augur", "backend", "kill"], stdout=FNULL, stderr=subprocess.STDOUT)
print("Server successfully shutdown.")
| py | 223 |
tests/test_application.py | #SPDX-License-Identifier: MIT
import pytest
import augur.application
import sqlalchemy as s
import json
# from augur.application import Application
# def test_init_augur_regular():
# augur_app = Application(disable_logs=True)
# assert augur_app is not None
# def test_connect_to_database(monkeypatch):
# d... | py | 649 |
tests/test_helpers.py | import pytest
import sqlalchemy as s
import logging
from augur.application.db.session import DatabaseSession
TEST_DB_STRING = "postgresql+psycopg2://augur:mcguire18@chaoss.tv:5432/augur-test"
@pytest.fixture
def db_session():
engine = s.create_engine(TEST_DB_STRING)
@event.listens_for(engine, "connect", inse... | py | 2,849 |
tests/start_server.py | import time
import subprocess
import os
import sys
from tests import server_port
FNULL = open(os.devnull, "w")
start = subprocess.Popen(["augur", "backend", "start", "--disable-collection", "--port", server_port], stdout=FNULL, stderr=subprocess.STDOUT)
print("Waiting for the server to start...")
time.sleep(10) | py | 316 |
tests/test_tasks/runner.py | import time
import subprocess
import os
import pytest
import sys
FNULL = open(os.devnull, "w")
start = subprocess.Popen(["celery", "-A", "tasks.celery_init.celery_app worker ", "--loglevel=info", "--concurrency=1"], stdout=FNULL, stderr=subprocess.STDOUT)
print("Waiting for the celery to start...")
time.sleep(5)
pr... | py | 892 |
tests/test_tasks/test_task_routine.py | # #SPDX-License-Identifier: MIT
# from augur.tasks.init.celery_app import celery_app as celery
# from augur.tasks.github import *
# import pytest
# from tests.test_tasks.runner import *
# from augur.tasks.start_tasks import *
# from augur.tasks.git.facade_tasks import *
# def test_augur_task_routine_no_dependencies(c... | py | 1,221 |
tests/test_tasks/test_github_tasks/test_pull_requests.py | import pytest
import httpx
import logging
from sqlalchemy.sql import text
from augur.tasks.github.pull_requests.core import *
from augur.application.db.session import DatabaseSession
from augur.application.db.models import Config
from augur.tasks.util.AugurUUID import GithubUUID
from augur.application.db.data_parse ... | py | 16,868 |
tests/test_tasks/test_task_utlities/test_paginators/test_github_paginator.py | import pytest
import logging
import httpx
from augur.tasks.github.util.github_paginator import GithubPaginator, GithubApiResult
from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
# from augur.tasks.util.random_key_auth import RandomKeyAuth
from augur.application.db.session import DatabaseSe... | py | 2,891 |
tests/test_tasks/test_task_utlities/test_redis/test_redis_list.py | import pytest
from augur.tasks.init.redis_connection import redis_connection as redis
from augur.tasks.util.redis_list import RedisList
list_name = "list"
@pytest.fixture()
def redis_list():
redis_list = RedisList(list_name)
yield redis_list
redis.flushdb()
def test_redis_list_append(redis_list):
... | py | 1,654 |
tests/test_tasks/test_task_utlities/test_key_auth/test_random_key_auth.py | import pytest
import httpx
import random
import time
import logging
from augur.tasks.util.random_key_auth import RandomKeyAuth
logger = logging.getLogger(__name__)
def test_if_header_is_set():
key = "asubasdfobhaosf"
key_auth = RandomKeyAuth([key], "Authorization", logger)
with httpx.Client() as c... | py | 2,974 |
tests/test_tasks/test_task_utlities/test_key_auth/test_github_random_key_auth.py | import pytest
import httpx
import random
import time
import logging
from augur.tasks.github.util.github_random_key_auth import GithubRandomKeyAuth
from augur.application.db.session import DatabaseSession
logger = logging.getLogger(__name__)
@pytest.fixture
def github_random_key_auth():
session = DatabaseSession... | py | 770 |
tests/test_tasks/test_task_utlities/test_key_handler/test_github_api_key_handler.py | import logging
import os
import json
import httpx
import pytest
from sqlalchemy.sql import text
logger = logging.getLogger(__name__)
from augur.tasks.github.util.github_api_key_handler import GithubApiKeyHandler
from augur.application.db.session import DatabaseSession
from augur.tasks.init.redis_connection import red... | py | 3,773 |
tests/test_tasks/test_task_utlities/test_util/test_worker_util.py | import logging
import pytest
import sqlalchemy as s
from augur.tasks.util.worker_util import *
logger = logging.getLogger(__name__)
def test_remove_duplicates_by_uniques(test_db_engine):
data_1 = {"cntrb_login": "Bob", "gh_user_id": 4, "gh_login": "bob", "cntrb_id": "01003f7a-8500-0000-0000-000000000000"}
d... | py | 1,719 |
tests/test_metrics/test_contributor_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.contributor import *
def test_contributors():
# repo group
assert contributors(20).iloc[0]['total'] > 0
# repo id
assert contributors(
10, repo_id=25430).iloc[0]['total'] > 0
# test begin_date and end... | py | 1,419 |
tests/test_metrics/test_repo_meta_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.repo_meta import *
def test_code_changes():
#repo_id
assert code_changes(10, 25430, period='year').isin([pd.Timestamp('2019-01-01T00:00:00+00:00'), 2]).any().any()
# repo_group_id
assert code_changes(10, period='... | py | 3,587 |
tests/test_metrics/test_pull_request_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.pull_request import *
def test_pull_requests_merge_contributor_new():
# repo id
assert pull_requests_merge_contributor_new(10, repo_id=25430, period='year').isin(
[pd.Timestamp('2019-01-01 00:00:00', tz='UTC')]).an... | py | 1,357 |
tests/test_metrics/test_commit_metrics.py | #SPDX-License-Identifier: MIT
import pytest
from augur.api.metrics.commit import *
def test_annual_commit_count_ranked_by_repo_in_repo_group():
assert annual_commit_count_ranked_by_repo_in_repo_group(10).iloc[0].net > 0
assert annual_commit_count_ranked_by_repo_in_repo_group(10, 25430).iloc[0].net > 0
def te... | py | 1,148 |
tests/test_metrics/test_issue_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.issue import *
def test_issues_new():
#repo_id
assert issues_new(1, 1 , period='year').iloc[0]['issues'] > 0
#repo_group_id
assert issues_new(10, period='year').iloc[1]['issues'] > 0
#begin_date & end_date
... | py | 5,198 |
tests/test_metrics/test_metrics_data/test_contributor_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.contributor import *
df_type = type(pd.DataFrame())
def test_contributors():
# repo group
assert contributors(20).iloc[0]['total'] > 0
# repo id
assert contributors(
10, repo_id=25430).iloc[0]['total'] >... | py | 1,452 |
tests/test_metrics/test_metrics_data/test_repo_meta_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.repo_meta import *
from augur.api.metrics.contributor import lines_changed_by_author
def test_code_changes():
#repo_id
assert code_changes(10, 25430, period='year').isin([pd.Timestamp('2019-01-01T00:00:00+00:00'), 2]).any... | py | 3,653 |
tests/test_metrics/test_metrics_data/test_pull_request_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.pull_request import *
def test_pull_requests_merge_contributor_new():
# repo id
assert pull_requests_merge_contributor_new(10, repo_id=25430, period='year').isin(
[pd.Timestamp('2019-01-01 00:00:00', tz='UTC')]).an... | py | 1,357 |
tests/test_metrics/test_metrics_data/test_commit_metrics.py | #SPDX-License-Identifier: MIT
import pytest
from augur.api.metrics.commit import *
def test_annual_commit_count_ranked_by_repo_in_repo_group():
assert annual_commit_count_ranked_by_repo_in_repo_group(10).iloc[0].net > 0
assert annual_commit_count_ranked_by_repo_in_repo_group(10, 25430).iloc[0].net > 0
def te... | py | 1,148 |
tests/test_metrics/test_metrics_data/test_issue_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.issue import *
def test_issues_new():
#repo_id
assert issues_new(1, 1 , period='year').iloc[0]['issues'] > 0
#repo_group_id
assert issues_new(10, period='year').iloc[1]['issues'] > 0
#begin_date & end_date
... | py | 5,198 |
tests/test_metrics/test_metrics_functionality/test_contributor_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.contributor import *
df_type = type(pd.DataFrame())
def test_contributors():
# repo group
assert isinstance(contributors(20), df_type)
# repo id
assert isinstance(contributors(
10, repo_id=25430), df_type)... | py | 1,252 |
tests/test_metrics/test_metrics_functionality/test_repo_meta_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.repo_meta import *
from augur.api.metrics.contributor import lines_changed_by_author
df_type = type(pd.DataFrame())
def test_code_changes():
#repo_id
assert isinstance(code_changes(10, 25430, period='year'), df_type)
... | py | 3,245 |
tests/test_metrics/test_metrics_functionality/test_pull_request_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.pull_request import *
df_type = type(pd.DataFrame())
def test_pull_requests_merge_contributor_new():
# repo id
assert isinstance(pull_requests_merge_contributor_new(10, repo_id=25430, period='year'), df_type)
# repo_g... | py | 1,231 |
tests/test_metrics/test_metrics_functionality/test_commit_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.commit import *
df_type = type(pd.DataFrame())
def test_annual_commit_count_ranked_by_repo_in_repo_group():
assert isinstance(annual_commit_count_ranked_by_repo_in_repo_group(10), df_type)
assert isinstance(annual_commit_c... | py | 1,211 |
tests/test_metrics/test_metrics_functionality/test_issue_metrics.py | #SPDX-License-Identifier: MIT
import pytest
import pandas as pd
from augur.api.metrics.issue import *
df_type = type(pd.DataFrame())
def test_issues_new():
#repo_id
assert isinstance(issues_new(1, 1 , period='year'), df_type)
#repo_group_id
assert isinstance(issues_new(10, period='year'), df_type)
... | py | 4,849 |
tests/test_workers/test_set_up_fixtures.py | import pytest
import docker
import subprocess
import json
import os
from workers.worker_git_integration import *
from workers.facade_worker.contributor_interfaceable.contributor_interface import *
# utility functions
def poll_database_connection(database_string):
print("Attempting to create db engine")
db = ... | py | 7,438 |
tests/test_workers/worker_persistance/test_enrich_cntrb_id.py | #SPDX-License-Identifier: MIT
from tests.test_workers.worker_persistance.util_persistance import *
#WIP
def test_enrich_cntrb_id_standard_input(database_connection, sample_source_data_standard_github_comments, sample_source_data_enriched, sample_source_data_unenriched):
#create class for testing
dummy = ... | py | 2,777 |
tests/test_workers/worker_persistance/test_enrich_data_primary_keys.py | #SPDX-License-Identifier: MIT
from tests.test_workers.worker_persistance.util_persistance import *
def test_enrich_data_primary_keys_standard_input(database_connection, sample_source_data_enriched, sample_source_data_unenriched):
print(sample_source_data_enriched)
print(sample_source_data_unenriched)
... | py | 11,128 |
tests/test_workers/worker_persistance/util_persistance.py | #SPDX-License-Identifier: MIT
#import pytest
#from tests.test_workers.test_data import *
from tests.test_workers.test_set_up_fixtures import *
#Sample source data generation that pulls json data that has contributions listed
@pytest.fixture
def sample_source_data_enriched():
jsonFile = open("tests/test_workers/w... | py | 1,312 |
tests/test_workers/test_facade/test_facade_contributor_interface/test_endpoints.py | #SPDX-License-Identifier: MIT
from tests.test_workers.worker_persistance.util_persistance import *
import pandas as pd
#from augur.cli import add_repos
#from augur.cli import add_repo_groups
#Function to add repo_groups without starting an augur app instance
@pytest.fixture
def set_up_repo_groups(database_connection)... | py | 6,368 |
tests/test_routes/runner.py | #SPDX-License-Identifier: MIT
import time
import subprocess
import os
import pytest
import sys
from tests import server_port
FNULL = open(os.devnull, "w")
start = subprocess.Popen(["augur", "backend", "start", "--disable-collection", "--port", server_port])
print("Waiting for the server to start...")
time.sleep(10)... | py | 658 |
tests/test_routes/test_util_routes.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from conftest import create_full_routes
util_routes = [\
"repos",\
"repo-groups",\
"repo-groups/<default_repo_group_id>/repos",\
"dosocs/repos",\
"repo-groups/<default_repo_group_id>/aggregate-summary",\
"repo-groups/<default_repo_group_id>/repos/<default_re... | py | 591 |
tests/test_routes/test_complexity_routes.py | #SPDX-License-Identifier: MIT
import requests
import pytest
def test_complexity_languages(metrics):
response = requests.get('http://localhost:5000/api/unstable/complexity/languages')
data = response.json()
assert response.status_code == 200
assert len(data) >= 1
def test_complexity_files(metrics):
... | py | 1,419 |
tests/test_routes/test_routes_data/test_contributor_routes_data.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_contributors_by_group_api_data():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/contributors')
assert response is not None
data = response.json()
assert response.st... | py | 1,390 |
tests/test_routes/test_routes_data/test_issue_routes_data.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_issues_new_by_group_api_data():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/issues-new')
assert response is not None
data = response.json()
assert response.status... | py | 11,055 |
tests/test_routes/test_routes_data/test_pull_request_routes_data.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_pull_requests_merge_contributor_new_by_group_api_data():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/pull-requests-merge-contributor-new')
assert response is not None
... | py | 1,132 |
tests/test_routes/test_routes_data/test_commit_routes_data.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_annual_commit_count_ranked_by_new_repo_in_repo_group_api_data():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/annual-commit-count-ranked-by-new-repo-in-repo-group/')
asse... | py | 3,190 |
tests/test_routes/test_routes_data/test_repo_meta_routes_data.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_code_changes_by_group_api_data():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/code-changes')
assert response is not None
data = response.json()
assert response.st... | py | 5,887 |
tests/test_routes/test_api_functionality/test_issue_routes_api.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_issues_new_by_group_api_is_functional():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/issues-new')
assert response is not None
assert response.status_code == 200
de... | py | 8,628 |
tests/test_routes/test_api_functionality/test_pull_request_routes_api.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_pull_requests_merge_contributor_new_by_group_api_is_functional():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/pull-requests-merge-contributor-new')
assert response is n... | py | 908 |
tests/test_routes/test_api_functionality/test_contributor_routes_api.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_contributors_by_group_api_is_functional():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/contributors')
assert response is not None
assert response.status_code == 200... | py | 1,050 |
tests/test_routes/test_api_functionality/test_repo_meta_routes_api.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_code_changes_by_group_api_is_functional():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/code-changes')
assert response is not None
assert response.status_code == 20... | py | 4,700 |
tests/test_routes/test_api_functionality/test_commit_routes_api.py | #SPDX-License-Identifier: MIT
import requests
import pytest
from tests import server_port
def test_annual_commit_count_ranked_by_new_repo_in_repo_group_api_is_functional():
response = requests.get(f'http://localhost:{server_port}/api/unstable/repo-groups/10/annual-commit-count-ranked-by-new-repo-in-repo-group/')... | py | 2,591 |
tests/test_applicaton/test_repo_load_controller/test_adding_orgs.py | import pytest
import logging
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.tasks.github.util.github_task_session import GithubTaskSession
from augur.util.repo_load_controller import RepoLoadController, DEFAULT_REPO_GROUP_IDS, CLI_USER_ID
from augur.application.db.models import UserRe... | py | 364 |
tests/test_applicaton/test_repo_load_controller/util.py | ######## Helper Functions to Get Delete statements #################
def get_delete_statement(schema, table):
return """DELETE FROM "{}"."{}";""".format(schema, table)
def get_repo_delete_statement():
return get_delete_statement("augur_data", "repo")
def get_repo_group_delete_statement():
return get_d... | py | 5,553 |
tests/test_applicaton/test_repo_load_controller/helper.py | import sqlalchemy as s
import logging
from augur.util.repo_load_controller import ORG_REPOS_ENDPOINT
from augur.application.db.session import DatabaseSession
from augur.application.db.models import Config, User
from augur.tasks.github.util.github_paginator import hit_api
from augur.application.db.util import execute_... | py | 6,217 |
tests/test_applicaton/test_repo_load_controller/test_helper_functions.py | import logging
import pytest
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from augur.tasks.github.util.github_task_session import GithubTaskSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.application.db.models import Repo, RepoGroup, UserRepo,... | py | 7,714 |
tests/test_applicaton/test_repo_load_controller/test_adding_repos.py | import pytest
import logging
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.tasks.github.util.github_task_session import GithubTaskSession
from augur.util.repo_load_controller import RepoLoadController, DEFAULT_REPO_GROUP_IDS, CLI_USER_ID
logger = logging.getLogger(__name__)
def ... | py | 9,325 |
tests/test_applicaton/test_db/test_session.py | import logging
import pytest
import uuid
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from augur.application.db.models import Contributor, Issue
logger = logging.getLogger(__name__)
not_provided_cntrb_id = '00000000-0000-0000-0000-000000000000'
nan_cntrb_id = '01000000-0000-0000-000... | py | 22,539 |
tests/test_applicaton/test_db/test_models/test_augur_data/test_repo_group.py | import logging
import pytest
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.application.db.models import RepoGroup
logger = logging.getLogger(__name__)
def test_is_valid_repo_group_id(test_db_engine):
... | py | 1,814 |
tests/test_applicaton/test_db/test_models/test_augur_data/test_repo.py |
import logging
import pytest
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from augur.tasks.github.util.github_task_session import GithubTaskSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.application.db.models import Repo
logger = logging.getL... | py | 4,968 |
tests/test_applicaton/test_db/test_models/test_augur_operations/test_user.py | import logging
import pytest
import sqlalchemy as s
from werkzeug.security import check_password_hash
from augur.application.db.session import DatabaseSession
from augur.tasks.github.util.github_task_session import GithubTaskSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.applic... | py | 6,454 |
tests/test_applicaton/test_db/test_models/test_augur_operations/test_user_repo.py | import logging
import pytest
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from augur.tasks.github.util.github_task_session import GithubTaskSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.application.db.models import UserRepo
logger = logging... | py | 13,481 |
tests/test_applicaton/test_db/test_models/test_augur_operations/test_user_group.py | import logging
import pytest
import sqlalchemy as s
from augur.application.db.session import DatabaseSession
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.application.db.models import UserGroup
logger = logging.getLogger(__name__)
def test_add_user_group(test_db_engine):
clear... | py | 8,201 |
tests/test_applicaton/test_cli/test_cli_functionality.py | import os
import pytest
import subprocess
def test_augur():
FNULL = open(os.devnull, "w")
command = "augur --help"
process = subprocess.run(command.split(" "), stdout=FNULL, stderr=subprocess.STDOUT)
assert process.returncode == 0
def test_main_dependency_install():
FNULL = open(os.devnull, "w"... | py | 774 |
tests/test_applicaton/test_cli/test_add_cli_repos.py | import pytest
import logging
from tests.test_applicaton.test_repo_load_controller.helper import *
from augur.tasks.github.util.github_task_session import GithubTaskSession
from augur.util.repo_load_controller import RepoLoadController, CLI_USER_ID
DEFAULT_REPO_GROUP_ID = 1
VALID_ORG = {"org": "CDCgov", "repo_count": ... | py | 5,142 |
tests/test_applicaton/test_config/test_config.py | from augur.application.config import AugurConfig
import logging
import os
import json
from sqlalchemy.sql import text
logger = logging.getLogger(__name__)
def test_config_get_value(test_db_config, test_db_engine):
try:
data = {"section_name": "Network", "setting_name": "ip_standard", "value": "ipv4"}
... | py | 15,104 |
docs/source/conf.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Augur documentation build configuration file, created by
# sphinx-quickstart on Tue Oct 24 12:27:08 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
# auto... | py | 5,729 |
augur/__init__.py | import uuid
instance_id = uuid.uuid4().hex
| py | 49 |
augur/tasks/frontend.py | import logging
import re
import sqlalchemy as s
import urllib.parse
from time import sleep
from augur.tasks.init.celery_app import celery_app as celery
from augur.tasks.github.util.github_task_session import GithubTaskSession
from augur.tasks.github.util.github_graphql_data_access import GithubGraphQlDataAccess
from a... | py | 13,239 |
augur/tasks/__init__.py | py | 0 | |
augur/tasks/test.py | from augur.tasks.init.celery_app import celery_app as celery
@celery.task()
def successful_task():
pass
@celery.task()
def failure_task():
raise Exception("ERROR")
| py | 176 |
augur/tasks/start_tasks.py | from __future__ import annotations
import logging
import os
#from celery.result import AsyncResult
from celery import group, chain
from sqlalchemy import and_,update
from augur.tasks.github import *
if os.environ.get('AUGUR_DOCKER_DEPLOY') != "1":
from augur.tasks.data_analysis import *
from augur.tasks.github.de... | py | 16,646 |
augur/tasks/init/celery_app.py | """Defines the Celery app."""
from celery.signals import worker_process_init, worker_process_shutdown
import logging
from typing import List, Dict
import os
import datetime
import traceback
import celery
from celery import Celery
from celery import current_app
from celery.signals import after_setup_logger
from augur... | py | 11,410 |
augur/tasks/init/__init__.py | import logging
from augur.application.db.session import DatabaseSession
from augur.application.db.engine import DatabaseEngine
from augur.application.config import AugurConfig
def get_redis_conn_values():
logger = logging.getLogger(__name__)
with DatabaseEngine() as engine, DatabaseSession(logger, engine) a... | py | 958 |
augur/tasks/init/redis_connection.py | """Defines the redis connection."""
import redis
from augur.tasks.init import get_redis_conn_values
redis_db_number, redis_conn_string = get_redis_conn_values()
redis_connection= redis.from_url(f'{redis_conn_string}{redis_db_number+2}', decode_responses=True)
| py | 262 |
augur/tasks/data_analysis/__init__.py | from celery import chain
import logging
def machine_learning_phase(repo_git, full_collection):
from augur.tasks.data_analysis.clustering_worker.tasks import clustering_task
from augur.tasks.data_analysis.discourse_analysis.tasks import discourse_analysis_task
from augur.tasks.data_analysis.insight_worker.... | py | 983 |
augur/tasks/data_analysis/clustering_worker/tasks.py | import logging
import os
import time
import traceback
import re
import pickle
import sqlalchemy as s
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import nltk
from sklearn.feature_extraction.text import TfidfVectorizer, CountVectorizer
from sklearn.cluster import KMeans
from sklearn.decomposi... | py | 18,961 |
augur/tasks/data_analysis/clustering_worker/__init__.py | py | 0 | |
augur/tasks/data_analysis/clustering_worker/setup.py | import io
import os
import re
from setuptools import find_packages
from setuptools import setup
def read(filename):
filename = os.path.join(os.path.dirname(__file__), filename)
text_type = type(u"")
with io.open(filename, mode="r", encoding='utf-8') as fd:
return re.sub(text_type(r':[a-z]+:`~?(.*?... | py | 1,329 |
augur/tasks/data_analysis/contributor_breadth_worker/tasks.py | py | 0 | |
augur/tasks/data_analysis/contributor_breadth_worker/__init__.py | #SPDX-License-Identifier: MIT | py | 29 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.