repo_name stringlengths 7 65 | path stringlengths 5 185 | copies stringlengths 1 4 | size stringlengths 4 6 | content stringlengths 977 990k | license stringclasses 14
values | hash stringlengths 32 32 | line_mean float64 7.18 99.4 | line_max int64 31 999 | alpha_frac float64 0.25 0.95 | ratio float64 1.5 7.84 | autogenerated bool 1
class | config_or_test bool 2
classes | has_no_keywords bool 2
classes | has_few_assignments bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mozilla/normandy | contract-tests/v3_api/test_group_update.py | 1 | 1210 | import uuid
from support.assertions import assert_valid_schema
from urllib.parse import urljoin
def test_group_update(conf, requests_session, headers):
# Create a new group
data = {"name": str(uuid.uuid4())}
response = requests_session.post(
urljoin(conf.getoption("server"), "/api/v3/group/"), he... | mpl-2.0 | 305dad0d6a7a428344d25835b0331542 | 33.571429 | 96 | 0.661983 | 3.74613 | false | false | false | false |
mozilla/normandy | normandy/conftest.py | 1 | 3099 | from django.core.management import call_command
from django.db import connection
from django.db.migrations.executor import MigrationExecutor
import pytest
import requests_mock
from graphene.test import Client as GrapheneClient
from rest_framework.test import APIClient
from normandy.schema import schema as normandy_sc... | mpl-2.0 | 6ff28baceb93bf94e973dfee7c503caa | 26.669643 | 83 | 0.695708 | 3.868914 | false | true | false | false |
mozilla/normandy | normandy/recipes/migrations/0005_auto_20180503_2146.py | 1 | 2487 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-05-03 21:46
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [("recip... | mpl-2.0 | 84226085f1856f60fffbc7d1658a6032 | 35.043478 | 95 | 0.577805 | 4.605556 | false | false | false | false |
mozilla/normandy | contract-tests/v3_api/test_approval_request_close.py | 1 | 1496 | from support.assertions import assert_valid_schema
from support.helpers import new_recipe
from urllib.parse import urljoin
def test_approval_request_close(conf, requests_session, headers):
# Get an action we can work with
action_response = requests_session.get(
urljoin(conf.getoption("server"), "/api/... | mpl-2.0 | b8e6270987f62beaf396fe2b9ce6e9d0 | 31.521739 | 95 | 0.637032 | 4.021505 | false | false | false | false |
mozilla/normandy | normandy/recipes/migrations/0014_auto_20190228_1128.py | 1 | 2576 | # Generated by Django 2.0.13 on 2019-02-28 11:28
import json
import sys
from urllib.parse import unquote_plus, urlparse
from django.db import migrations
def get_filename_from_url(url):
return unquote_plus(urlparse(url).path.split("/")[-1])
def add_extension_id(apps, schema_editor):
Action = apps.get_mode... | mpl-2.0 | 0a2d391270318e7b0286c7f6cc490d0f | 30.802469 | 93 | 0.634705 | 4.088889 | false | false | false | false |
developmentseed/landsat-util | setup.py | 1 | 1158 | #!/usr/bin/env python
# Landsat Util
# License: CC0 1.0 Universal
try:
from setuptools import setup
setup_kwargs = {'entry_points': {'console_scripts':['landsat=landsat.landsat:__main__']}}
except ImportError:
from distutils.core import setup
setup_kwargs = {'scripts': ['bin/landsat']}
from land... | cc0-1.0 | 21e308a331aa8210e6c3216ad6ef8e17 | 25.930233 | 93 | 0.66753 | 3.436202 | false | true | false | false |
developmentseed/landsat-util | landsat/mixins.py | 3 | 2950 | # Pansharpened Image Process using Rasterio
# Landsat Util
# License: CC0 1.0 Universal
from __future__ import print_function, division, absolute_import
import sys
import subprocess
from termcolor import colored
class VerbosityMixin(object):
"""
Verbosity Mixin that generates beautiful stdout outputs.
"... | cc0-1.0 | a023114dc73545a6f35664a0aba26973 | 24.652174 | 104 | 0.554237 | 4.689984 | false | false | false | false |
rmmh/skybot | core/irc.py | 3 | 10652 | from __future__ import print_function
from builtins import map
from builtins import object
import re
import socket
import time
import _thread
import queue
from ssl import wrap_socket, CERT_NONE, CERT_REQUIRED, SSLError
DEFAULT_NAME = "skybot"
DEFAULT_REALNAME = "Python bot - http://github.com/rmmh/skybot"
DEFAULT_NI... | unlicense | 8a5ef5e7c64db739c054b8d67d63de1f | 30.329412 | 88 | 0.556515 | 3.705043 | false | false | false | false |
rmmh/skybot | plugins/util/http.py | 3 | 5942 | from future.standard_library import hooks
from lxml import etree, html
import binascii
import collections
import hmac
import json
import random
import time
from hashlib import sha1
from builtins import str
from builtins import range
try:
from http.cookiejar import CookieJar
except:
from future.backports.ht... | unlicense | 8d528fae968f41036b202e03cfa36487 | 23.861925 | 87 | 0.619152 | 3.560216 | false | false | false | false |
pytube/pytube | pytube/query.py | 1 | 12622 | """This module provides a query interface for media streams and captions."""
from collections.abc import Mapping, Sequence
from typing import Callable, List, Optional, Union
from pytube import Caption, Stream
from pytube.helpers import deprecated
class StreamQuery(Sequence):
"""Interface for querying the availab... | unlicense | 4cd3b1805a5fb6ff5a344f4ebe671490 | 28.980998 | 81 | 0.552131 | 4.29612 | false | false | false | false |
pytube/pytube | pytube/innertube.py | 1 | 11658 | """This module is designed to interact with the innertube API.
This module is NOT intended to be used directly by end users, as each of the
interfaces returns raw results. These should instead be parsed to extract
the useful information for the end user.
"""
# Native python imports
import json
import os
import pathlib... | unlicense | ba0aec650f36c17aa80c51e0edb576d3 | 31.473538 | 93 | 0.556613 | 3.81979 | false | false | false | false |
pytube/pytube | pytube/contrib/playlist.py | 1 | 14204 | """Module to download a complete playlist from a youtube channel."""
import json
import logging
from collections.abc import Sequence
from datetime import date, datetime
from typing import Dict, Iterable, List, Optional, Tuple, Union
from pytube import extract, request, YouTube
from pytube.helpers import cache, Deferre... | unlicense | a750825a6ad36ac1a7782e70397c068b | 32.899761 | 89 | 0.558857 | 4.542373 | false | false | false | false |
mozilla-iam/cis | python-modules/cis_crypto/cis_crypto/cli.py | 1 | 3035 | #!/usr/bin/env python3
import argparse
import jose
import logging
import sys
from cis_crypto import common
from cis_crypto import operation
class cli:
def __init__(self):
self.config = None
self.prog = sys.argv[0].split("/")[-1]
def parse_args(self, args):
parser = argparse.ArgumentP... | mpl-2.0 | 6e4ea185859404dd312ca4ca6712d897 | 40.013514 | 107 | 0.604942 | 4.062918 | false | true | false | false |
mozilla-iam/cis | python-modules/cis_notifications/cis_notifications/event.py | 1 | 5547 | import logging
import time
import requests
from cis_notifications import common
from cis_notifications import secret
logger = logging.getLogger(__name__)
def expired(ts, leeway=0):
return ts < time.time() + leeway
class Event(object):
"""Handle events from lambda and generate hooks out to publishers."""
... | mpl-2.0 | 0d336f640d1dc4f3cb7fa7d1034befed | 38.340426 | 119 | 0.597801 | 4.381517 | false | false | false | false |
mozilla-iam/cis | python-modules/cis_profile_retrieval_service/cis_profile_retrieval_service/schema.py | 1 | 1800 | import json
import graphene
import cis_profile.graphene
from cis_identity_vault.models import user
from cis_profile_retrieval_service.common import get_table_resource
def is_json(payload):
"""Check if a payload is valid JSON."""
try:
json.loads(payload)
except (TypeError, ValueError):
retu... | mpl-2.0 | 2d73a38b2f7944d0edc6af411dde9e66 | 32.333333 | 104 | 0.618889 | 4.026846 | false | false | false | false |
mozilla-iam/cis | python-modules/cis_crypto/setup.py | 1 | 1388 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
with open("README.md", "r") as fh:
long_description = fh.read()
requirements = [
"python-jose[cryptography]",
"cryptography",
"everett",
"everett[ini]",
"configobj",
"boto3",
"boto",
"botocor... | mpl-2.0 | 1c316fc1356dd8d975ed5651133bf6c5 | 26.215686 | 116 | 0.64121 | 3.435644 | false | true | false | false |
ibm-watson-iot/iot-python | test/test_api_registry_devicetypes.py | 2 | 6161 | # *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | epl-1.0 | 03ebfc866c44dd5b025dafca891c805b | 38 | 114 | 0.627333 | 4.388177 | false | true | false | false |
ibm-watson-iot/iot-python | samples/deviceFactory/deviceStatus.py | 2 | 3130 | #!/usr/bin/env python
# *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompa... | epl-1.0 | 0436ee43d53172ed8b41cd5cf2c4b40d | 30.938776 | 153 | 0.555911 | 3.927227 | false | false | false | false |
ibm-watson-iot/iot-python | src/wiotp/sdk/device/managedClient.py | 2 | 27070 | # *****************************************************************************
# Copyright (c) 2014, 2018 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distrib... | epl-1.0 | 145ea361c0c78a021c0675ca9b269ad6 | 40.774691 | 137 | 0.590137 | 4.221772 | false | false | false | false |
ibm-watson-iot/iot-python | src/wiotp/sdk/gateway/messages.py | 2 | 2136 | # *****************************************************************************
# Copyright (c) 2019 IBM Corporation and other Contributors.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution,... | epl-1.0 | 0945e4c78d6be15cc3d53a501d7b2024 | 39.301887 | 107 | 0.594569 | 4.377049 | false | false | false | false |
mbj4668/pyang | pyang/transforms/edit.py | 1 | 12718 | """Edit transform plugin
This plugin currently has quite limited functionality. Only some specific
top-level items can be edited, and only existing statements are edited.
"""
import copy
import optparse
import re
import sys
from pyang import error
from pyang import plugin
from pyang import statements
plugin_name = ... | isc | c7fe489f489e7470546c470f3f6a8e4f | 36.296188 | 79 | 0.551109 | 4.419041 | false | false | false | false |
mbj4668/pyang | pyang/syntax.py | 1 | 15064 | """Description of YANG & YIN syntax."""
import os
import re
import shlex
import sys
import datetime
### Regular expressions - constraints on arguments
# keywords and identifiers
identifier = r"[_A-Za-z][._\-A-Za-z0-9]*"
prefix = identifier
keyword = '((' + prefix + '):)?(' + identifier + ')'
comment = r'(/\*([^*]|[\... | isc | 433a69ad9ffd4ba16f37c8f4cb504c13 | 37.925065 | 79 | 0.497411 | 3.225696 | false | false | false | false |
mbj4668/pyang | pyang/translators/yin.py | 1 | 6251 | """YIN output plugin"""
from xml.sax.saxutils import quoteattr
from xml.sax.saxutils import escape
import optparse
import re
from .. import plugin
from .. import util
from .. import grammar
from .. import syntax
from .. import statements
yin_namespace = "urn:ietf:params:xml:ns:yang:yin:1"
def pyang_plugin_init():
... | isc | 9a2d0ef23d5688834407018ea4306364 | 37.58642 | 80 | 0.503279 | 3.976463 | false | false | false | false |
rdegges/django-twilio | test_project/settings.py | 1 | 6114 | # -*- coding: utf-8 -*-
import sys
# Django settings for test_project project.
import os
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import django
import packaging.version
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
DEBUG = True
ADMINS = (
# ('Your Na... | unlicense | 69e54dec409d3927e831977f003e6393 | 31.870968 | 84 | 0.697089 | 3.73945 | false | false | false | false |
mozilla-services/buildhub | jobs/tests/test_lambda_s3_event_functional.py | 1 | 4418 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at http://mozilla.org/MPL/2.0/.
import unittest
import os
import json
import kinto_http
from decouple import config
from buildhub import lambda_s3_eve... | mpl-2.0 | 1517965c5c64a352e8b73259eff50045 | 34.629032 | 78 | 0.463105 | 3.571544 | false | false | false | false |
pikepdf/pikepdf | src/pikepdf/models/encryption.py | 1 | 5651 | # SPDX-FileCopyrightText: 2022 James R. Barlow
# SPDX-License-Identifier: MPL-2.0
"""For managing PDF encryption."""
from __future__ import annotations
import sys
from typing import TYPE_CHECKING, Any, NamedTuple, cast
if sys.version_info >= (3, 8):
from typing import Literal
else:
from typing_extensions im... | mpl-2.0 | 21e03933294d545d53727875d93a860f | 31.107955 | 81 | 0.660414 | 4.418296 | false | false | false | false |
mail-in-a-box/mailinabox | management/dns_update.py | 1 | 46993 | #!/usr/local/lib/mailinabox/env/bin/python
# Creates DNS zone files for all of the domains of all of the mail users
# and mail aliases and restarts nsd.
########################################################################
import sys, os, os.path, urllib.parse, datetime, re, hashlib, base64
import ipaddress
import... | cc0-1.0 | 5089a4b6c97af446d26ec3b31e59c3b1 | 41.412455 | 531 | 0.683059 | 3.293363 | false | false | false | false |
mcedit/pymclevel | mce.py | 2 | 47597 | #!/usr/bin/env python
import mclevelbase
import mclevel
import materials
import infiniteworld
import sys
import os
from box import BoundingBox, Vector
import numpy
from numpy import zeros, bincount
import logging
import itertools
import traceback
import shlex
import operator
import codecs
from math import floor
try:
... | isc | 7ec8fe21588c28e8ea9ce5995d342c5d | 30.773698 | 127 | 0.536609 | 4.232349 | false | false | false | false |
mcedit/pymclevel | box.py | 3 | 6660 | from collections import namedtuple
import itertools
import math
_Vector = namedtuple("_Vector", ("x", "y", "z"))
class Vector(_Vector):
__slots__ = ()
def __add__(self, other):
return Vector(self[0] + other[0], self[1] + other[1], self[2] + other[2])
def __sub__(self, other):
return Vec... | isc | 86e79510841bc3a5781cfe434696133b | 27.220339 | 117 | 0.554204 | 3.592233 | false | false | false | false |
mcedit/mcedit | albow/file_dialogs.py | 1 | 9481 | # -*- coding: utf-8 -*-
#
# Albow - File Dialogs
#
import os
from pygame import draw, Rect
from pygame.locals import *
from albow.widget import Widget
from albow.dialogs import Dialog, ask, alert
from albow.controls import Label, Button
from albow.fields import TextField
from albow.layout import Row, Column
from alb... | isc | cb8b6206c1453db370a106d742224366 | 27.217262 | 81 | 0.580213 | 3.726808 | false | false | false | false |
mozilla-services/tecken | tecken/upload/views.py | 1 | 18470 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
import re
import logging
import fnmatch
import zipfile
import hashlib
import os
import time
import concurrent.futures
... | mpl-2.0 | 4f6d74f10b6a0d8efdd103705a3ce078 | 39.862832 | 103 | 0.601354 | 4.292354 | false | false | false | false |
mozilla-services/tecken | tecken/api/urls.py | 1 | 1554 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
from django.urls import path
from . import views
app_name = "api"
# NOTE(peterbe): The endpoints that start with a ... | mpl-2.0 | 00a39feb79b02fea9df5b35c8e15d0a0 | 38.846154 | 88 | 0.671171 | 3.656471 | false | false | false | false |
mozilla-services/tecken | bin/debug-sym-file.py | 1 | 1332 | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Prints information about a sym file including whether it kicks up
# a parse error.
# Usage: d... | mpl-2.0 | d8f1fe08f944220497e222d7f64b1937 | 26.183673 | 84 | 0.647147 | 3.609756 | false | false | false | false |
pimutils/todoman | todoman/formatters.py | 1 | 9862 | import json
from datetime import date
from datetime import datetime
from datetime import timedelta
from time import mktime
from typing import Iterable
from typing import Optional
from typing import Union
import click
import humanize
import parsedatetime
import pytz
from dateutil.tz import tzlocal
from todoman.model i... | isc | d7abd37a0c7881a902a95755c83ae461 | 30.70418 | 87 | 0.549899 | 4.199319 | false | false | false | false |
pimutils/todoman | todoman/model.py | 1 | 35300 | from __future__ import annotations
import logging
import os
import socket
import sqlite3
from datetime import date
from datetime import datetime
from datetime import time
from datetime import timedelta
from os.path import normpath
from os.path import split
from typing import Iterable
from uuid import uuid4
import ica... | isc | d6ddf7058541586aba68dc51a6483120 | 29.589255 | 87 | 0.525014 | 4.229571 | false | false | false | false |
mozilla-services/autopush | autopush/logging.py | 1 | 9732 | """Custom Logging Setup
"""
import io
import json
import Queue
import pkg_resources
import socket
import sys
import time
import threading
from typing import Any # noqa
import boto3
import raven
from raven.transport.twisted import TwistedHTTPTransport
from raven.utils.stacks import iter_stack_frames
from twisted.inter... | mpl-2.0 | df1cf21c7895a731db9c97a39f8e2d54 | 28.852761 | 76 | 0.561241 | 4.070263 | false | false | false | false |
mozilla-services/autopush | autopush/jwt.py | 1 | 4878 | import base64
import binascii
import json
import os
from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.primitives.asymmetric import ec, utils
from cryptography.hazmat.primitives import hashes
from pyasn1.error import PyAsn1Error
from twisted.logger import Logger
from typing import Tuple # n... | mpl-2.0 | 237d5e819bac273b9eccf4727a5a1386 | 32.875 | 78 | 0.625666 | 4.309187 | false | false | false | false |
mozilla-services/autopush | autopush/ssl.py | 1 | 5050 | """Custom SSL configuration"""
from __future__ import absolute_import
import socket # noqa
import ssl
from typing import ( # noqa
Any,
Dict,
FrozenSet,
Optional,
Tuple,
)
from OpenSSL import SSL
from twisted.internet.ssl import DefaultOpenSSLContextFactory
try:
SSL_PROTO = ssl.PROTOCOL_TLS
e... | mpl-2.0 | 5b02ead5f4ae3980a592fd56f5466c32 | 30.5625 | 76 | 0.6 | 3.344371 | false | false | false | false |
mozilla-services/autopush | autopush/router/apns2.py | 1 | 7384 | import json
from collections import deque
from decimal import Decimal
import hyper.tls
from hyper import HTTP20Connection
from hyper.http20.exceptions import HTTP20Error
from autopush.exceptions import RouterException
SANDBOX = 'api.development.push.apple.com'
SERVER = 'api.push.apple.com'
APNS_MAX_CONNECTIONS = 2... | mpl-2.0 | a22058220f1dc18d18425799194e9155 | 38.913514 | 79 | 0.585861 | 4.558025 | false | false | false | false |
unitedstates/congress | congress/tasks/bill_info.py | 1 | 50773 | from congress.tasks import utils
import logging
import re
import json
from lxml import etree
import copy
import datetime
def create_govtrack_xml(bill, options):
govtrack_type_codes = {'hr': 'h', 's': 's', 'hres': 'hr', 'sres': 'sr', 'hjres': 'hj', 'sjres': 'sj', 'hconres': 'hc', 'sconres': 'sc'}
root = etree.... | cc0-1.0 | 298f2600bf22574d79701dcf5fa65269 | 40.8229 | 346 | 0.581983 | 3.558024 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/mock_helpers.py | 1 | 1924 | from unittest.mock import Mock
class DynamicObject:
pass
class MockFilter(object): # This is the ONE parameter constructor
def __init__(self):
self._count = 0
self._first = DynamicObject()
def first(self): # This is the another method that's just coming along for the ride.
ret... | cc0-1.0 | d4dfdf00d27fbc89ac3eda967c2aaef0 | 26.485714 | 89 | 0.630457 | 3.96701 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/c42d328ef2fa_add_frec_code_to_submission_model.py | 1 | 1050 | """add frec_code to submission model
Revision ID: c42d328ef2fa
Revises: 4d8408c33fee
Create Date: 2017-07-10 13:16:56.855163
"""
# revision identifiers, used by Alembic.
revision = 'c42d328ef2fa'
down_revision = '4d8408c33fee'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
d... | cc0-1.0 | ca18fbce7807457ac2411d85b4d334a0 | 22.863636 | 81 | 0.671429 | 3.291536 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/4a1988f74a78_add_detached_d2_submission_models.py | 1 | 7389 | """add detached D2 submission models
Revision ID: 4a1988f74a78
Revises: 4bf29ae16467
Create Date: 2017-01-20 11:40:50.782401
"""
# revision identifiers, used by Alembic.
revision = '4a1988f74a78'
down_revision = '4bf29ae16467'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
d... | cc0-1.0 | 53b84f20fffd4fb8e83c6655c6e24e67 | 55.838462 | 153 | 0.696711 | 3.168525 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/2ae156c8f46d_update_d1_and_d2_for_daims_v1_1.py | 1 | 4727 | """update d1 and d2 for daims v1.1
Revision ID: 2ae156c8f46d
Revises: 4b1ee78268fb
Create Date: 2017-08-28 15:16:00.926683
"""
# revision identifiers, used by Alembic.
revision = '2ae156c8f46d'
down_revision = '4b1ee78268fb'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def... | cc0-1.0 | 5046dca887b28fe685a5997b789fe7b4 | 58.0875 | 124 | 0.721811 | 3.077474 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/4be5e411246b_adding_principle_place_street_to_.py | 1 | 1093 | """Adding principle place street to subaward
Revision ID: 4be5e411246b
Revises: 87d7a9b0ea7b
Create Date: 2019-08-07 15:13:50.092991
"""
# revision identifiers, used by Alembic.
revision = '4be5e411246b'
down_revision = '87d7a9b0ea7b'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy a... | cc0-1.0 | 7d4d818bddfc23ec5a4da73ab58cdb0d | 25.02381 | 97 | 0.696249 | 3.15896 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactbroker/routes/file_routes.py | 1 | 14201 | from flask import request
from webargs import fields as webargs_fields, validate as webargs_validate
from webargs.flaskparser import use_kwargs
from dataactbroker.handlers.fileHandler import (
FileHandler, get_status, list_submissions as list_submissions_handler,
list_published_files as list_published_files_ha... | cc0-1.0 | c3dcf5ecda1eb8bff5efd4c6511c1a3e | 45.408497 | 120 | 0.67108 | 3.746966 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/3b9dffe063a6_create_zips_grouped_table_and_add_.py | 1 | 2745 | """Create zips_grouped table and add multicolumn index to zips table
Revision ID: 3b9dffe063a6
Revises: be4dcb9eede6
Create Date: 2020-08-03 11:48:55.068356
"""
# revision identifiers, used by Alembic.
revision = '3b9dffe063a6'
down_revision = 'be4dcb9eede6'
branch_labels = None
depends_on = None
from alembic impor... | cc0-1.0 | 3be9db389d7f7fc2475573d2df485544 | 33.3125 | 139 | 0.62623 | 3.465909 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/1e0b1d3e3cca_d_model_to_text.py | 2 | 3725 | """d-model-to-text
Revision ID: 1e0b1d3e3cca
Revises: 1ae491ca0925
Create Date: 2016-09-08 09:34:56.153584
"""
# revision identifiers, used by Alembic.
revision = '1e0b1d3e3cca'
down_revision = '1ae491ca0925'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engine_... | cc0-1.0 | 74726afb40f8e62139b8483759fa6a92 | 35.519608 | 79 | 0.587114 | 3.770243 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactbroker/helpers/filters_helper.py | 1 | 6379 | from sqlalchemy import or_, and_
from flask import g
from dataactcore.models.lookups import FILE_TYPE_DICT_LETTER_ID, RULE_SEVERITY_DICT
from dataactcore.models.domainModels import CGAC, FREC
from dataactcore.models.errorModels import PublishedErrorMetadata, ErrorMetadata
from dataactcore.models.jobModels import Submi... | cc0-1.0 | 20df9b222bf9caa9aa5f5cb7b4421671 | 45.904412 | 116 | 0.649318 | 3.806086 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/a98cd1871ea9_remove_user_status_id_from_user.py | 1 | 1073 | """remove user_status_id from user
Revision ID: a98cd1871ea9
Revises: e97127c44797
Create Date: 2016-12-22 11:59:35.173573
"""
# revision identifiers, used by Alembic.
revision = 'a98cd1871ea9'
down_revision = 'e97127c44797'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def... | cc0-1.0 | 98f6512f4c3b8fcbb730ef7c93f83dda | 24.547619 | 118 | 0.684995 | 3.261398 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_script_read_zips.py | 1 | 6618 | from io import StringIO
from dataactvalidator.scripts.read_zips import update_state_congr_table_census, group_zips
from dataactcore.models.domainModels import StateCongressional, Zips, ZipsGrouped
def test_parse_census_district_file(database):
census_file_mock = StringIO("""state_code,congressional_district_no,c... | cc0-1.0 | 0e8fb45dd235711f6bef273140a381bf | 47.306569 | 116 | 0.68359 | 3.079572 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/c4d42e86c655_add_descriptions_to_published_.py | 1 | 3105 | """Add descriptions to (Published)AwardFinancialAssistance
Revision ID: c4d42e86c655
Revises: 668d9fa93acb
Create Date: 2018-04-04 11:00:18.103961
"""
# revision identifiers, used by Alembic.
revision = 'c4d42e86c655'
down_revision = '668d9fa93acb'
branch_labels = None
depends_on = None
from alembic import op
impor... | cc0-1.0 | 32bf360dee2da2c2da20d37c614e686f | 49.080645 | 124 | 0.732045 | 3.251309 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/backfill_ppop_scope_fabs.py | 1 | 2049 | import logging
from dataactcore.interfaces.db import GlobalDB
from dataactcore.broker_logging import configure_logging
from dataactvalidator.health_check import create_app
logger = logging.getLogger(__name__)
BACKFILL_FABS_PPOP_SCOPE_SQL_1 = """
UPDATE published_fabs
SET place_of_performance_scope =
... | cc0-1.0 | 83b42b368ab3ea3d846adf7ce02c7fa6 | 33.728814 | 103 | 0.607125 | 3.426421 | false | false | true | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs34_2.py | 1 | 1873 | from tests.unit.dataactcore.factories.staging import FABSFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs34_2'
def test_column_headers(database):
expected_subset = {'row_number', 'period_of_performance_star', 'period_of_performance_curr',
... | cc0-1.0 | 170a2ca7be7e4e98dd4bb36a50fa7a2a | 45.825 | 118 | 0.687667 | 3.814664 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/populate_published_comments.py | 1 | 2470 | import logging
from sqlalchemy import func
from dataactcore.interfaces.db import GlobalDB
from dataactcore.broker_logging import configure_logging
from dataactcore.models.jobModels import Submission, PublishHistory, Comment, PublishedComment
from dataactvalidator.health_check import create_app
from dataactcore.mode... | cc0-1.0 | 6b96bedf5afd113f9382c7a8a6deab17 | 41.586207 | 112 | 0.664372 | 4.207836 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs38_2_1.py | 1 | 2802 | from tests.unit.dataactcore.factories.domain import OfficeFactory
from tests.unit.dataactcore.factories.staging import FABSFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs38_2_1'
def test_column_headers(database):
expected_subset = {'row_number', 'funding_office... | cc0-1.0 | d9d7474fc0ff9e6dbe64c7f945598bde | 48.157895 | 116 | 0.697716 | 3.506884 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/models/lookups.py | 1 | 22140 | # This file defines a series of constants that represent the values used in the
# broker's "helper" tables. Rather than define the values in the db setup scripts
# and then make db calls to lookup the surrogate keys, we'll define everything
# here, in a file that can be used by the db setup scripts *and* the applicatio... | cc0-1.0 | b0baca212b53c28d12a073bf561b8a40 | 56.506494 | 120 | 0.661698 | 3.216153 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/778cabef7323_rename_and_add_office_type_booleans_in_.py | 1 | 1561 | """Rename and add office type booleans in office table
Revision ID: 778cabef7323
Revises: 7dd3f4b007e5
Create Date: 2019-05-10 10:01:26.888903
"""
# revision identifiers, used by Alembic.
revision = '778cabef7323'
down_revision = '5f29b283f23e'
branch_labels = None
depends_on = None
from alembic import op
import sq... | cc0-1.0 | 96cf6a454ee6ff09e084adf7d9e8b0d7 | 32.934783 | 131 | 0.736067 | 3.555809 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs39_2.py | 1 | 2847 | from tests.unit.dataactcore.factories.staging import FABSFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs39_2'
def test_column_headers(database):
expected_subset = {'row_number', 'record_type', 'place_of_performance_code', 'place_of_perform_country_c',
... | cc0-1.0 | b7b04a9465d6c9ce067fe3378e6458dd | 55.94 | 112 | 0.662803 | 3.393325 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | tests/integration/integration_test_helper.py | 1 | 3026 | import calendar
from datetime import datetime
from dataactcore.models.jobModels import Submission, Job
def insert_submission(sess, submission_user_id, cgac_code=None, frec_code=None, start_date=None, end_date=None,
is_quarter=False, number_of_errors=0, publish_status_id=1, is_fabs=False,
... | cc0-1.0 | 5d65528c4c2d25e7dee32e0262672798 | 39.891892 | 111 | 0.590879 | 3.796738 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/361fbffcf08b_added_named_job_dep_fks.py | 2 | 1044 | """added_named_job_dep_fks
Revision ID: 361fbffcf08b
Revises: 9058e0136aba
Create Date: 2016-08-26 10:33:18.803848
"""
# revision identifiers, used by Alembic.
revision = '361fbffcf08b'
down_revision = '9058e0136aba'
branch_labels = None
depends_on = None
from alembic import op
def upgrade(engine_name):
globa... | cc0-1.0 | 60852055d545a13fe2d75825b7577a88 | 24.463415 | 103 | 0.66954 | 3.144578 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/populate_subaward_table.py | 1 | 6271 | import os
import argparse
import datetime
import logging
import json
import sys
from dataactcore.interfaces.db import GlobalDB
from dataactcore.config import CONFIG_BROKER
from dataactcore.broker_logging import configure_logging
from dataactvalidator.health_check import create_app
from dataactbroker.fsrs import GRANT,... | cc0-1.0 | 39a382b66d70a56110769674eb701ef2 | 40.256579 | 115 | 0.646946 | 3.667251 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_a7_appropriations.py | 1 | 2660 | from dataactcore.models.stagingModels import Appropriation
from dataactcore.models.domainModels import SF133
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'a7_appropriations'
_TAS = 'a7_appropriations_tas'
def test_column_headers(database):
expected_subset = {'uniqueid_TA... | cc0-1.0 | 32ab0dee0ec6eda2091d97880839c5d0 | 46.5 | 117 | 0.67594 | 2.96544 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/da2e50d423ff_create_frec_table.py | 1 | 1237 | """create FREC table
Revision ID: da2e50d423ff
Revises: aa10ae595d3e
Create Date: 2017-07-06 10:27:04.738865
"""
# revision identifiers, used by Alembic.
revision = 'da2e50d423ff'
down_revision = 'aa10ae595d3e'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engin... | cc0-1.0 | a4daa93e171e0f4f8860beff155c9bab | 24.244898 | 82 | 0.665319 | 3.115869 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/449ab366f333_adding_fiscal_year_and_period_to_submission.py | 2 | 1089 | """adding fiscal year and period to submission
Revision ID: 449ab366f333
Revises: a0a4f1ef56ae
Create Date: 2016-08-11 13:21:49.526346
"""
# revision identifiers, used by Alembic.
revision = '449ab366f333'
down_revision = '5a9051f9bfc5'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy... | cc0-1.0 | 023d3341884b4a6b4a6c47bb9449cdfe | 24.928571 | 119 | 0.699725 | 3.468153 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/52b3c1a122ce_add_certified_files_history_table_and_update_certify_history_table.py | 1 | 2380 | """Add certified_files_history table and update certify_history table
Revision ID: 52b3c1a122ce
Revises: 204e2cf584cd
Create Date: 2017-06-05 12:37:10.724212
"""
# revision identifiers, used by Alembic.
revision = '52b3c1a122ce'
down_revision = '204e2cf584cd'
branch_labels = None
depends_on = None
from alembic impo... | cc0-1.0 | 1c1ffac479b969928ad335e2cf7edf8f | 40.034483 | 152 | 0.687395 | 3.505155 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactvalidator/scripts/load_submission_window_schedule.py | 1 | 2825 | import os
import logging
import boto3
import pandas as pd
from datetime import datetime, timedelta
from dataactcore.broker_logging import configure_logging
from dataactcore.interfaces.db import GlobalDB
from dataactcore.config import CONFIG_BROKER
from dataactcore.models.jobModels import SubmissionWindowSchedule
fro... | cc0-1.0 | e532656ec0fe5c04b71a9c1a89bd4dc9 | 37.175676 | 117 | 0.614513 | 4.197623 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/5dbc09749ce0_published_fabs_index_on_true.py | 1 | 1029 | """published fabs index on true
Revision ID: 5dbc09749ce0
Revises: 605bcaf99c01
Create Date: 2018-01-09 10:04:40.991666
"""
# revision identifiers, used by Alembic.
revision = '5dbc09749ce0'
down_revision = '605bcaf99c01'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def up... | cc0-1.0 | baed6f8d49ea2f2ec8d680b0d7c890b5 | 24.725 | 188 | 0.713314 | 3.319355 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactvalidator/app.py | 1 | 17035 | import logging
import csv
import ddtrace
import inspect
import time
import traceback
from ddtrace.constants import ANALYTICS_SAMPLE_RATE_KEY
from ddtrace.ext import SpanTypes
from flask import Flask, g, current_app
from dataactcore.aws.sqsHandler import sqs_queue
from dataactcore.config import CONFIG_BROKER, CONFIG_S... | cc0-1.0 | 1d1102fa9081c6e5fb32f91d637414df | 41.5875 | 118 | 0.575991 | 4.405224 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/1fabe0bdd48c_adding_parent_duns_number_and_name_to_.py | 1 | 1579 | """Adding parent duns number and name to (Published)AwardFinancialAssistance
Revision ID: 1fabe0bdd48c
Revises: 6973101b6853
Create Date: 2018-03-27 15:07:45.721751
"""
# revision identifiers, used by Alembic.
revision = '1fabe0bdd48c'
down_revision = '6973101b6853'
branch_labels = None
depends_on = None
from alemb... | cc0-1.0 | 5131f69ce80dbd3193c6675132151ea6 | 33.326087 | 124 | 0.723876 | 3.215886 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactbroker/decorators.py | 1 | 2184 | from flask import g
from functools import wraps
from webargs import fields as webargs_fields
from webargs.flaskparser import parser as webargs_parser
from dataactbroker.handlers.agency_handler import get_sub_tiers_from_perms
from dataactbroker.permissions import requires_login, separate_affiliations
from dataactcore.... | cc0-1.0 | a4ced95bdca7f7b418976c3c6139f282 | 41 | 119 | 0.692766 | 3.886121 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_c9_award_financial.py | 1 | 11665 | from tests.unit.dataactcore.factories.staging import AwardFinancialFactory
from tests.unit.dataactcore.factories.staging import AwardFinancialAssistanceFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'c9_award_financial'
_TAS = 'c9_award_financial_tas'
def test_column_h... | cc0-1.0 | ed40010346de9e3841390b5e5e4a0a4b | 51.545045 | 119 | 0.629061 | 3.268423 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/8ce3d6d070da_add_session_table.py | 1 | 1155 | """add_session_table
Revision ID: 8ce3d6d070da
Revises: 885280875a1c
Create Date: 2016-10-27 20:04:26.845536
"""
# revision identifiers, used by Alembic.
revision = '8ce3d6d070da'
down_revision = '885280875a1c'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgrade(engin... | cc0-1.0 | 8126c6a37fb212dd7f016aa2bfbcf826 | 23.0625 | 63 | 0.671861 | 3.33815 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs4_2.py | 1 | 1489 | from tests.unit.dataactcore.factories.staging import FABSFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs4_2'
def test_column_headers(database):
expected_subset = {'row_number', 'action_date', 'uniqueid_AssistanceTransactionUniqueKey'}
actual = set(query_col... | cc0-1.0 | 35eac370bfc8b303496761980b0575e1 | 42.794118 | 118 | 0.714574 | 3.272527 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/fix_county_data.py | 1 | 14033 | import logging
import argparse
from dataactcore.interfaces.db import GlobalDB
from dataactcore.broker_logging import configure_logging
from dataactvalidator.health_check import create_app
logger = logging.getLogger(__name__)
def create_matviews(sess):
logger.info("Creating zip_county temporary view")
# zip... | cc0-1.0 | 46fce4baf8364689effa0695801f03ab | 41.783537 | 114 | 0.581344 | 3.717351 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/e9c556a9f344_create_certified_comment_table.py | 1 | 1590 | """Create certified_comment table
Revision ID: e9c556a9f344
Revises: 0dc4a1fbb52e
Create Date: 2019-08-29 12:12:13.196702
"""
# revision identifiers, used by Alembic.
revision = 'e9c556a9f344'
down_revision = 'b998d20b46e6'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def ... | cc0-1.0 | 2fcd10522a1cd66171d4a475dbda3754 | 30.176471 | 123 | 0.669182 | 3.479212 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/4d64c79360af_add_upper_uei_indexes_to_tables.py | 1 | 1715 | """Add upper UEI indexes to tables
Revision ID: 4d64c79360af
Revises: 9e295cff8733
Create Date: 2021-08-05 12:27:08.745832
"""
# revision identifiers, used by Alembic.
revision = '4d64c79360af'
down_revision = '9e295cff8733'
branch_labels = None
depends_on = None
from alembic import op
from sqlalchemy import text
... | cc0-1.0 | bfb9b316af61f0982881fc3b63f486eb | 34.729167 | 147 | 0.699125 | 2.825371 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/ea8fbaa044d7_remove_first_quarter_flag.py | 2 | 1601 | """remove_first_quarter_flag
Revision ID: ea8fbaa044d7
Revises: 0c857b50962a
Create Date: 2016-10-14 14:04:16.207464
"""
# revision identifiers, used by Alembic.
revision = 'ea8fbaa044d7'
down_revision = '0c857b50962a'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
def upgra... | cc0-1.0 | 544ded8d6d2d821fe7ac3c07fbaa4f4c | 33.804348 | 165 | 0.71143 | 3.321577 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/config.py | 1 | 5488 | import logging
import os.path
from os.path import expanduser, normpath, dirname, abspath
import yaml
import re
CONFIG_BROKER = {}
CONFIG_SERVICES = {}
CONFIG_DB = {}
CONFIG_LOGGING = {}
CONFIG_CATEGORIES = {"broker": CONFIG_BROKER, "services": CONFIG_SERVICES, "db": CONFIG_DB,
"logging": CONFIG_LO... | cc0-1.0 | 7efadc44d15e2d3c6aa8392236ed2971 | 39.651852 | 111 | 0.668367 | 3.440752 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | tests/unit/dataactvalidator/test_fabs42_2.py | 1 | 2936 | from tests.unit.dataactcore.factories.staging import FABSFactory
from tests.unit.dataactvalidator.utils import number_of_errors, query_columns
_FILE = 'fabs42_2'
def test_column_headers(database):
expected_subset = {'row_number', 'place_of_performance_forei', 'place_of_perform_country_c', 'record_type',
... | cc0-1.0 | d8fa0aacdf4eaead04e031c4f183c7d5 | 54.396226 | 119 | 0.675068 | 3.541616 | false | true | false | false |
fedspendingtransparency/data-act-broker-backend | dataactbroker/handlers/account_handler.py | 1 | 21072 | import logging
from operator import attrgetter
import requests
import xmltodict
from flask import g
from dataactbroker.handlers.aws.sesEmail import SesEmail
from dataactbroker.handlers.aws.session import LoginSession
from dataactcore.utils.jsonResponse import JsonResponse
from dataactcore.utils.requestDictionary impo... | cc0-1.0 | 395ee65e4ad25d5cb5a2974b8248d03f | 39.996109 | 119 | 0.627563 | 4.266451 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/remove_fabs_duplicate_submissions.py | 1 | 4636 | import logging
from dataactcore.interfaces.db import GlobalDB
from dataactcore.broker_logging import configure_logging
from dataactcore.models.jobModels import PublishedFilesHistory, CertifyHistory, PublishHistory, Submission
from dataactcore.models.userModel import User # noqa
from dataactcore.models.lookups import... | cc0-1.0 | 2bd3cc2c51c8a9f36995efd2b961be49 | 50.511111 | 116 | 0.600518 | 5.0282 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/migrations/versions/de5e3fa1d2d2_adding_display_tas_to_staging_tables_sf133.py | 1 | 1322 | """ Adding display_tas to staging tables and SF133 table
Revision ID: de5e3fa1d2d2
Revises: d753553fa79b
Create Date: 2019-10-29 17:43:50.519330
"""
# revision identifiers, used by Alembic.
revision = 'de5e3fa1d2d2'
down_revision = 'd753553fa79b'
branch_labels = None
depends_on = None
from alembic import op
import ... | cc0-1.0 | de7d032990204d0c51189987cde31b99 | 27.73913 | 87 | 0.687595 | 3.232274 | false | false | false | false |
fedspendingtransparency/data-act-broker-backend | dataactcore/scripts/clean_expired_submissions.py | 1 | 3262 | import logging
import argparse
import json
from datetime import datetime
from dateutil.relativedelta import relativedelta
from dataactcore.interfaces.db import GlobalDB
from dataactcore.broker_logging import configure_logging
from dataactbroker.handlers.submission_handler import delete_all_submission_data
from dataac... | cc0-1.0 | a7bf6d051d74bc735e03bfaca40ddbbe | 38.301205 | 114 | 0.683936 | 4.144854 | false | false | false | false |
purduesigbots/pros-cli | pros/cli/upload.py | 1 | 9685 | from sys import exit
from unicodedata import name
import pros.common.ui as ui
import pros.conductor as c
from .common import *
from pros.ga.analytics import analytics
@pros_root
def upload_cli():
pass
@upload_cli.command(aliases=['u'])
@click.option('--target', type=click.Choice(['v5', 'cortex']), default=None... | mpl-2.0 | 7f70578b1e365d28c5544b96ec43866a | 45.5625 | 143 | 0.62096 | 3.699389 | false | false | false | false |
purduesigbots/pros-cli | pros/common/utils.py | 1 | 4701 | import logging
import os
import os.path
import sys
from functools import lru_cache, wraps
from typing import *
import click
import pros
@lru_cache(1)
def get_version():
try:
ver = open(os.path.join(os.path.dirname(__file__), '..', '..', 'version')).read().strip()
if ver is not None:
... | mpl-2.0 | d9f2c83cf71dc20ef925644ce437568d | 30.550336 | 100 | 0.582004 | 4.087826 | false | false | false | false |
purduesigbots/pros-cli | pros/conductor/interactive/components.py | 1 | 1846 | from collections import defaultdict
from typing import *
from pros.common.ui.interactive import components, parameters
from pros.conductor.interactive.parameters import TemplateParameter
class TemplateListingComponent(components.Container):
def _generate_components(self) -> Generator[components.Component, None, ... | mpl-2.0 | f70a6628f22ede8ae9d2d4be54677e33 | 44.02439 | 101 | 0.631636 | 4.770026 | false | false | false | false |
purduesigbots/pros-cli | pros/conductor/depots/http_depot.py | 1 | 1585 | import os
import zipfile
from datetime import datetime
import jsonpickle
import pros.common.ui as ui
from pros.common import logger
from pros.common.utils import download_file
from .depot import Depot
from ..templates import BaseTemplate, ExternalTemplate
class HttpDepot(Depot):
def __init__(self, name: str, lo... | mpl-2.0 | 97273cc19256294b290f2fcb8392b46b | 37.658537 | 111 | 0.639117 | 4.193122 | false | false | false | false |
purduesigbots/pros-cli | pros/conductor/conductor.py | 1 | 11642 | import os.path
import shutil
from pathlib import Path
from typing import *
import click
from semantic_version import Spec, Version
from pros.common import *
from pros.conductor.project import TemplateAction
from pros.conductor.project.template_resolution import InvalidTemplateException
from pros.config import Config
... | mpl-2.0 | 6c24790d24a1216a6b8b79b730aeee0a | 47.508333 | 119 | 0.613812 | 4.313449 | false | false | false | false |
purduesigbots/pros-cli | pros/conductor/project/ProjectTransaction.py | 1 | 7498 | import itertools as it
import os
import tempfile
import zipfile
from typing import *
import pros.common.ui as ui
import pros.conductor as c
from pros.conductor.project.template_resolution import InvalidTemplateException, TemplateAction
class Action(object):
def execute(self, conductor: c.Conductor, project: c.Pr... | mpl-2.0 | c43844cf4d763cc35dfab833c72655b2 | 42.091954 | 117 | 0.630168 | 4.09503 | false | false | false | false |
purduesigbots/pros-cli | pros/cli/interactive.py | 1 | 1454 | import os
from typing import *
import click
import pros.conductor as c
from .common import PROSGroup, default_options, project_option, pros_root
from pros.ga.analytics import analytics
@pros_root
def interactive_cli():
pass
@interactive_cli.group(cls=PROSGroup, hidden=True)
@default_options
def interactive():
... | mpl-2.0 | 8e9a06907720c1cb3eeb389d996707cb | 31.311111 | 94 | 0.788858 | 3.826316 | false | false | false | false |
requests/requests-oauthlib | docs/conf.py | 1 | 8699 | # -*- coding: utf-8 -*-
#
# Requests-OAuthlib documentation build configuration file, created by
# sphinx-quickstart on Fri May 10 11:49:01 2013.
#
# 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 fil... | isc | c10cdefc2677aeb20d4f0dfdb95ae7d3 | 31.099631 | 80 | 0.692034 | 3.85765 | false | true | false | false |
eregs/regulations-parser | regparser/tree/depth/heuristics.py | 3 | 3172 | """Set of heuristics for trimming down the set of solutions. Each heuristic
works by penalizing a solution; it's then up to the caller to grab the
solution with the least penalties."""
from collections import defaultdict
from itertools import takewhile
from regparser.tree.depth import markers
def prefer_multiple_chi... | cc0-1.0 | 912ffab79acf6b211a10f0b7eccf9fb3 | 35.045455 | 79 | 0.625158 | 4.092903 | false | false | false | false |
eregs/regulations-parser | regparser/notice/build.py | 3 | 4798 | import logging
from lxml import etree
from regparser.grammar.unified import notice_cfr_p
from regparser.notice.amendments.fetch import fetch_amendments
from regparser.notice.dates import fetch_dates
from regparser.notice.sxs import (build_section_by_section,
find_section_by_section)
... | cc0-1.0 | 52609f538c659550642b043ee8501ce4 | 35.348485 | 78 | 0.630054 | 3.610233 | false | false | false | false |
eregs/regulations-parser | regparser/web/settings/base.py | 3 | 3882 | """
Django settings for regparser.web project.
Generated by 'django-admin startproject' using Django 1.9.7.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.9/ref/settings/
"""
import... | cc0-1.0 | c57a75a22eba2b638cfc56a6b4346793 | 25.958333 | 78 | 0.685987 | 3.47538 | false | false | false | false |
eregs/regulations-parser | regparser/commands/preprocess_notice.py | 3 | 3678 | import click
from regparser import federalregister
from regparser.commands.dependency_resolver import DependencyResolver
from regparser.index import entry
from regparser.notice.build import split_doc_num
from regparser.notice.xml import TitlePartsRef, notice_xmls_for_url
def convert_cfr_refs(refs=None):
"""
... | cc0-1.0 | b26f667840c23522e5d15e53e3626f8f | 35.058824 | 78 | 0.610114 | 3.641584 | false | false | false | false |
eregs/regulations-parser | interpparser/layers.py | 3 | 2437 | from collections import defaultdict
from interpparser.tree import text_to_labels
from regparser.citations import Label
from regparser.layer.layer import Layer
from regparser.tree import struct
class Interpretations(Layer):
"""Supplement I (interpretations) provides (sometimes very lengthy) extra
information ... | cc0-1.0 | 4f9a50749ddb1558e5fad81e22003ce3 | 41.017241 | 78 | 0.612228 | 4.47156 | false | false | false | false |
eregs/regulations-parser | regparser/web/jobs/views.py | 2 | 13335 | import abc
import hashlib
import six
from django.http import HttpResponse
from rest_framework import generics, mixins, status
from rest_framework.parsers import FileUploadParser, MultiPartParser
from rest_framework.renderers import BrowsableAPIRenderer, JSONRenderer
from rest_framework.response import Response
from r... | cc0-1.0 | 93b4002184c3cfd165d6f809949d81a0 | 36.248603 | 79 | 0.625572 | 4.414101 | false | false | false | false |
eregs/regulations-parser | regparser/tree/paragraph.py | 3 | 6581 | import hashlib
import re
from regparser.search import segments
from regparser.tree import struct
from regparser.tree.depth import markers as mtypes
p_levels = [list(mtypes.lower), list(mtypes.ints), list(mtypes.roman),
list(mtypes.upper), list(mtypes.em_ints), list(mtypes.em_roman)]
def p_level_of(marke... | cc0-1.0 | 0063e715e1ec1862b3a8fac3cdcd609d | 40.13125 | 78 | 0.590792 | 3.933652 | false | false | false | false |
eregs/regulations-parser | tests/layer_internal_citations_tests.py | 3 | 15457 | # vim: set encoding=utf-8
from unittest import TestCase
from regparser.layer import internal_citations
from regparser.tree.struct import Node
class ParseTest(TestCase):
def setUp(self):
self.parser = internal_citations.InternalCitationParser(
None, cfr_title=None)
self.parser.verify_c... | cc0-1.0 | a9b037befed4a0cbb25fd3a6e111a831 | 46.10061 | 78 | 0.521846 | 3.362133 | false | true | false | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.