index
int64
repo_name
string
branch_name
string
path
string
content
string
import_graph
string
31,337
moremoban/moban-jinja2-github
refs/heads/master
/moban_jinja2_github/__init__.py
# flake8: noqa import moban_jinja2_github.issues from moban_jinja2_github._version import __author__, __version__ from moban.plugins.jinja2.extensions import jinja_global from moban_jinja2_github.contributors import get_contributors jinja_global("moban_jinja2_contributors", get_contributors)
{"/moban_jinja2_github/__init__.py": ["/moban_jinja2_github/_version.py", "/moban_jinja2_github/contributors.py"], "/tests/test_contributors.py": ["/moban_jinja2_github/contributors.py"]}
31,338
moremoban/moban-jinja2-github
refs/heads/master
/moban_jinja2_github/contributors.py
from gease.exceptions import UrlNotFound from gease.contributors import EndPoint def get_contributors(user, repo, exclude_contributors=()): repo = EndPoint(user, repo) try: user_list = repo.get_all_contributors() user_list = [ detail for detail in user_list ...
{"/moban_jinja2_github/__init__.py": ["/moban_jinja2_github/_version.py", "/moban_jinja2_github/contributors.py"], "/tests/test_contributors.py": ["/moban_jinja2_github/contributors.py"]}
31,339
moremoban/moban-jinja2-github
refs/heads/master
/tests/test_contributors.py
from mock import MagicMock, patch from nose.tools import eq_ from gease.exceptions import UrlNotFound @patch("moban_jinja2_github.contributors.EndPoint") def test_get_contributors(fake_end_point): sample_contributors = [ {"login": "author"}, {"login": "ok", "url": "contributors"}, ] fake_a...
{"/moban_jinja2_github/__init__.py": ["/moban_jinja2_github/_version.py", "/moban_jinja2_github/contributors.py"], "/tests/test_contributors.py": ["/moban_jinja2_github/contributors.py"]}
31,340
moremoban/moban-jinja2-github
refs/heads/master
/moban_jinja2_github/_version.py
__version__ = "0.0.4" __author__ = "chfw"
{"/moban_jinja2_github/__init__.py": ["/moban_jinja2_github/_version.py", "/moban_jinja2_github/contributors.py"], "/tests/test_contributors.py": ["/moban_jinja2_github/contributors.py"]}
31,342
cuboids/rl-assignments
refs/heads/main
/RepeatGames.py
from time import perf_counter from HexBoard import Agent, Human, HexBoard def play_hex(ngames=None, player1=Agent(name="Alice"), player2=Agent(name="Bob"), board_size=3, show_midgame=False, show_endgame=True, seed=0, analysis=False): # Docstring needs to be revised! """ Script to repeat n gam...
{"/RepeatGames.py": ["/HexBoard.py"]}
31,343
cuboids/rl-assignments
refs/heads/main
/HexBoard.py
import copy import hashlib import math import names # For giving random names to agents. See https://pypi.org/project/names/ import numpy as np import random import string import time from itertools import permutations from itertools import product # For evalue_fun from trueskill import Rating, rate_1vs1 import matpl...
{"/RepeatGames.py": ["/HexBoard.py"]}
31,344
rheitz/FoodServer
refs/heads/master
/Project/FoodServer.py
# Food Server # Ideaventions Academy # 7th Grade 2017-2018 # imports import time from Project.Functions import * # variables # Turn on/off times for light # Target temperature and humidity (76 F and 70% RH) TEMP_FAN = 76 TIME_OFF = 21 # 9 pm at night turn off TIME_ON = 6 # 6 am turn on MAX_TEMP = 76 # Max T MIN_T...
{"/Project/FoodServer.py": ["/Project/Functions.py"]}
31,345
rheitz/FoodServer
refs/heads/master
/Project/testprogram.py
import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(27) for i in range(2,11): GPIO.setup(i,GPIO.OUT) lights = [27,2,3,4,5,6,7,8,9,10] for pins in lights: GPIO.output(pins,GPIO.HIGH) sleep(10) lights = [27,2,3,4,5,6,7,8,9,10] for pins in lights: GPIO.output(pins,GPIO.LOW)
{"/Project/FoodServer.py": ["/Project/Functions.py"]}
31,346
rheitz/FoodServer
refs/heads/master
/Project/Functions.py
import RPi.GPIO as GPIO # Setup GPIO (2-27) GPIO.setmode(GPIO.BCM) GPIO.setup(27,GPIO.OUT) for i in range(2,21): GPIO.setup(i,GPIO.OUT) def fanOn(): GPIO.output(11, GPIO.HIGH) def fanOff(): GPIO.output(11, GPIO.LOW) def humidifierFanOn(): GPIO.output(12, GPIO.HIGH) def humidifierFanOff(): GPIO....
{"/Project/FoodServer.py": ["/Project/Functions.py"]}
31,351
tux2603/WG
refs/heads/master
/SpriteLibraries.py
import pyglet import numpy as np from math import sin, cos, atan2, sqrt class Sprite(pyglet.sprite.Sprite): # TODO drawBoundingRectangle # TODO isClicked # TODO getBoundingRectangle # TODO reflect # TODO isCollided # The maximum speed at which the sprite can travel, used for acceleration meth...
{"/WG.py": ["/SpriteLibraries.py"]}
31,352
tux2603/WG
refs/heads/master
/WG.py
import pyglet import numpy as np from SpriteLibraries import Sprite from pyglet.window import key GRAVITY = -2.0 gameWindow = pyglet.window.Window(width=800, height=600, fullscreen=False) keyboard = key.KeyStateHandler() fpsDisplay = None # Sprite batches backgroundBatch = None terrainBatch = None mainBatch = None f...
{"/WG.py": ["/SpriteLibraries.py"]}
31,357
Shahid313/Python
refs/heads/main
/applicatioin/forms/forms.py
from flask_wtf import FlaskForm from wtforms import TextAreaField,SubmitField from wtforms.validators import DataRequired from flask_wtf.file import FileField, FileAllowed, FileRequired class InputForm(FlaskForm): input_field_one = TextAreaField('Write An Essay') input_field_two = TextAreaField('Write An Essay') ge...
{"/applicatioin/__init__.py": ["/applicatioin/Views/View.py"], "/applicatioin/Views/View.py": ["/applicatioin/__init__.py", "/applicatioin/forms/forms.py", "/applicatioin/Builders/ModelBuilder.py"]}
31,358
Shahid313/Python
refs/heads/main
/applicatioin/__init__.py
from flask import Flask, url_for from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate app = Flask(__name__) app.config['SECRET_KEY'] = "secret key" app.config['SQLALCHEMY_DATABASE_URI'] = 'mysql+pymysql://root:''@localhost/NLP' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(...
{"/applicatioin/__init__.py": ["/applicatioin/Views/View.py"], "/applicatioin/Views/View.py": ["/applicatioin/__init__.py", "/applicatioin/forms/forms.py", "/applicatioin/Builders/ModelBuilder.py"]}
31,359
Shahid313/Python
refs/heads/main
/applicatioin/Views/View.py
from flask_classful import FlaskView, route from applicatioin import db from flask import render_template, request from flask import redirect, url_for from applicatioin.forms.forms import InputForm from fuzzywuzzy import fuzz import re from applicatioin.Builders.ModelBuilder import * class InputView(FlaskView): def c...
{"/applicatioin/__init__.py": ["/applicatioin/Views/View.py"], "/applicatioin/Views/View.py": ["/applicatioin/__init__.py", "/applicatioin/forms/forms.py", "/applicatioin/Builders/ModelBuilder.py"]}
31,360
Shahid313/Python
refs/heads/main
/applicatioin/Builders/ModelBuilder.py
import pandas as pd import numpy as np import nltk import re from nltk.corpus import stopwords from nltk.stem import WordNetLemmatizer # from gensim.models import Word2Vec # from keras.layers import Embedding, LSTM, Dense, Dropout, Lambda, Flatten # from keras.models import Sequential, load_model, model_from_config #...
{"/applicatioin/__init__.py": ["/applicatioin/Views/View.py"], "/applicatioin/Views/View.py": ["/applicatioin/__init__.py", "/applicatioin/forms/forms.py", "/applicatioin/Builders/ModelBuilder.py"]}
31,361
xdf020168/test-information-platform
refs/heads/master
/manage.py
# coding=utf-8 # author: Zeng YueTian # manage script of hera system # how to use it: nohup python manage.py runserver --host 0.0.0.0 >/dev/null 2>&1 & # please see run.sh import os import threading from flask import Flask, render_template from flask_script import Manager from flask_script import Shell from app import...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,362
xdf020168/test-information-platform
refs/heads/master
/app/main/const.py
# coding=utf-8 # common constant # jenkins master server url,port jenkins_server_url = 'http://10.4.0.1:8080/' # User Id API Token user_id = 'jenkins_user' api_token = 'a36ea26fdd50a32f652e8d56d7cb86e3' # need to be updated # job_name job_names = [ ########################## # sdk test ################...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,363
xdf020168/test-information-platform
refs/heads/master
/app/main/test_flask_sql.py
# just for function test !!!! from manage import app from flask_sqlalchemy import SQLAlchemy # import sqlalchemy.orm as orm MYSQL_HOST = "localhost" MYSQL_PORT = 3306 MYSQL_UE_USER = "root" MYSQL_PASSWORD = "rootPass" MYSQL_DB = "hera" # dialect+driver://username:password@host:port/database?charset=utf8 app.config['...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,364
xdf020168/test-information-platform
refs/heads/master
/app/main/test_link_parser.py
# coding=utf-8 # author: zengyuetian # get test case and plan info from test link from testlink import * url = 'http://sub.site.com/lib/api/xmlrpc/v1/xmlrpc.php' # ip地址为安装的testlink ip key = 'a16641a2cea5d780ae685beea32dcef1' # API key def get_manual_case_info(): """ get test suite and case number :retu...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,365
xdf020168/test-information-platform
refs/heads/master
/app/main/views.py
# coding=utf-8 # author: zengyuetian # add sqlalchemy function by dh import json import pickle from flask import render_template, redirect, url_for, request, flash, jsonify from lib import get_root_path, sort_by_status from const import EVERY_PAGE_SIZE from app.database.database import db, Machines, Features import ...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,366
xdf020168/test-information-platform
refs/heads/master
/app/main/jenkins_ut.py
# coding=utf-8 # author: zengyuetian # get ut information from jenkins builds import sys import re import urllib2 import urllib import requests import cookielib from bs4 import BeautifulSoup # 这段代码是用于解决中文报错的问题 reload(sys) sys.setdefaultencoding("utf8") login_url = 'http://10.4.0.1:8080/j_acegi_security_check' build...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,367
xdf020168/test-information-platform
refs/heads/master
/app/main/__init__.py
# coding=utf-8 # author: zengyuetian # Flask 用 蓝图(blueprints) 的概念来在一个应用中或跨应用制作应用组件和支持通用的模式。 from flask import Blueprint main = Blueprint('main', __name__) # 放在末尾是为了避免循环导入依赖 from . import views, errors
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,368
xdf020168/test-information-platform
refs/heads/master
/app/main/zentao_parser.py
# coding=utf-8 # author: zengyuetian import cookielib import sys import urllib import urllib2 from bs4 import BeautifulSoup from app.main.const import * # 这段代码是用于解决中文报错的问题 reload(sys) sys.setdefaultencoding("utf8") login_url = 'http://192.168.0.1:8080/zentao/user-login.html' referer_url = "http://192.168.0.1:8080...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,369
xdf020168/test-information-platform
refs/heads/master
/app/database/database.py
# coding=utf-8 # feature test db lib from flask_sqlalchemy import SQLAlchemy from manage import app MYSQL_HOST = "localhost" MYSQL_PORT = 3306 MYSQL_USER = "root" MYSQL_PASSWORD = "rootPass" MYSQL_DB = "hera" # dialect+driver://username:password@host:port/database?charset=utf8 app.config['SQLALCHEMY_DATABASE_URI'] = ...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,370
xdf020168/test-information-platform
refs/heads/master
/app/main/lib.py
# coding=utf-8 # author: zengyuetian # common lib for hera import os import inspect import sys def get_root_path(): """ 获得自动测试框架根目录 :return: """ file_path = os.path.abspath(inspect.getfile(sys.modules[__name__])) main_path = os.path.dirname(file_path) app_path = os.path.dirname(main_path)...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,371
xdf020168/test-information-platform
refs/heads/master
/app/models.py
# coding=utf-8 # author: zengyuetian from . import db
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,372
xdf020168/test-information-platform
refs/heads/master
/app/main/threads_function.py
# coding=utf-8 # author: dh # common functions import time from app.main.jenkins_ut import * from app.main.robot_parser import * from app.main.test_link_parser import * from app.main.zentao_parser import * # threads variable failed_build_dict = dict() newly_bug = dict() bug_status = dict() ut_info = dict() manual_c...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,373
xdf020168/test-information-platform
refs/heads/master
/app/main/robot_parser.py
# coding=utf-8 # author: donghao # get build status from jenkins build jobs import jenkins from app.main.const import * def get_failed_data_set(server): """ entry function :param server: :return: """ job_dict = dict() last_failed_jobs = list() for job in job_names: try: ...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,374
xdf020168/test-information-platform
refs/heads/master
/app/__init__.py
# coding=utf-8 # author: zengyuetian # 使用工厂函数延迟创建程序实例 from flask import Flask from flask_sqlalchemy import SQLAlchemy from config import config db = SQLAlchemy() def create_app(config_name): """ 工厂函数 :param config_name: 配置名 :return: """ app = Flask(__name__) app.config.from_object(confi...
{"/manage.py": ["/app/__init__.py", "/app/main/views.py", "/app/main/threads_function.py"], "/app/main/views.py": ["/app/database/database.py", "/app/main/__init__.py"], "/app/models.py": ["/app/__init__.py"], "/app/main/threads_function.py": ["/app/main/jenkins_ut.py", "/app/main/robot_parser.py", "/app/main/test_link...
31,375
beancount/fava
refs/heads/main
/src/fava/plugins/tag_discovered_documents.py
"""Beancount plugin to tag discovered documents. It looks through all Document entries that were added by Beancount automatically through file discovery and adds the tag "#discovered". """ from __future__ import annotations from typing import TYPE_CHECKING from fava.beans.abc import Document from fava.beans.helpers ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,376
beancount/fava
refs/heads/main
/src/fava/application.py
"""Fava's main WSGI application. you can use `create_app` to create a Fava WSGI app for a given list of files. To start a simple server:: from fava.application import create_app app = create_app(['/path/to/file.beancount']) app.run('localhost', 5000) """ from __future__ import annotations from dataclas...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,377
beancount/fava
refs/heads/main
/src/fava/core/query_shell.py
"""For using the Beancount shell from Fava.""" from __future__ import annotations import contextlib import io import textwrap from typing import Any from typing import TYPE_CHECKING from beancount.parser.options import OPTIONS_DEFAULTS from beancount.query import query_compile from beancount.query.query_compile impor...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,378
beancount/fava
refs/heads/main
/src/fava/cli.py
"""The command-line interface for Fava.""" from __future__ import annotations import errno import os import click from cheroot.wsgi import Server from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.middleware.profiler import ProfilerMiddleware from fava import __version__ from fava.applicat...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,379
beancount/fava
refs/heads/main
/src/fava/ext/portfolio_list/__init__.py
"""Portfolio list extension for Fava. This is a simple example of Fava's extension reports system. """ from __future__ import annotations import re from dataclasses import dataclass from decimal import Decimal from typing import NamedTuple from typing import TYPE_CHECKING from fava.context import g from fava.ext imp...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,380
beancount/fava
refs/heads/main
/src/fava/beans/types.py
"""Typing helpers.""" from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover from typing import TypedDict from beancount.core.display_context import DisplayContext from fava.beans.abc import Directive from fava.helpers import BeancountError cla...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,381
beancount/fava
refs/heads/main
/tests/test_application.py
"""Tests for Fava's main Flask app.""" from __future__ import annotations from typing import TYPE_CHECKING from urllib.parse import urljoin import pytest from beancount import __version__ as beancount_version from fava import __version__ as fava_version from fava.application import create_app from fava.application i...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,382
beancount/fava
refs/heads/main
/tests/test_core_fava_options.py
from __future__ import annotations import datetime import re from typing import TYPE_CHECKING from fava.core.charts import dumps from fava.core.fava_options import InsertEntryOption from fava.core.fava_options import parse_options from fava.util.date import FiscalYearEnd if TYPE_CHECKING: # pragma: no cover fro...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,383
beancount/fava
refs/heads/main
/src/fava/json_api.py
"""JSON API. This module contains the url endpoints of the JSON API that is used by the web interface for asynchronous functionality. """ from __future__ import annotations import shutil from dataclasses import dataclass from functools import wraps from inspect import Parameter from inspect import signature from path...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,384
beancount/fava
refs/heads/main
/src/fava/beans/flags.py
"""Beancount entry flags.""" from __future__ import annotations from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover from typing import TypeAlias Flag: TypeAlias = str FLAG_CONVERSIONS = "C" FLAG_MERGING = "M" FLAG_OKAY = "*" FLAG_PADDING = "P" FLAG_RETURNS = "R" FLAG_SUMMARIZE = "S" FLAG_...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,385
beancount/fava
refs/heads/main
/tests/test_serialisation.py
from __future__ import annotations import datetime from decimal import Decimal from typing import TYPE_CHECKING import pytest from beancount.core.number import MISSING from beancount.core.position import CostSpec from fava.beans import create from fava.beans.helpers import replace from fava.beans.str import to_strin...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,386
beancount/fava
refs/heads/main
/src/fava/core/documents.py
"""Document path related helpers.""" from __future__ import annotations from os import altsep from os import sep from pathlib import Path from typing import TYPE_CHECKING from fava.helpers import FavaAPIError if TYPE_CHECKING: # pragma: no cover from fava.core import FavaLedger def is_document_or_import_file(...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,387
beancount/fava
refs/heads/main
/tests/test_template_filters.py
from __future__ import annotations from decimal import Decimal from typing import TYPE_CHECKING from fava.template_filters import basename from fava.template_filters import format_currency if TYPE_CHECKING: # pragma: no cover from flask import Flask def test_format_currency(app: Flask) -> None: with app.t...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,388
beancount/fava
refs/heads/main
/src/fava/beans/__init__.py
"""Types, functions and wrappers to deal with Beancount types."""
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,389
beancount/fava
refs/heads/main
/tests/test_util_ranking.py
from __future__ import annotations from datetime import date from fava.util.ranking import ExponentialDecayRanker def test_ranker() -> None: list_ = ["1", "2", "3"] ranker = ExponentialDecayRanker(list_) ranker.update("1", date(2015, 1, 1)) ranker.update("2", date(2014, 1, 1)) ranker.update("3",...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,390
beancount/fava
refs/heads/main
/src/fava/core/number.py
"""Formatting numbers.""" from __future__ import annotations import copy from decimal import Decimal from typing import Callable from typing import TYPE_CHECKING from babel.core import Locale from beancount.core.display_context import Precision from fava.core.module_base import FavaModule if TYPE_CHECKING: # pragm...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,391
beancount/fava
refs/heads/main
/src/fava/internal_api.py
"""Internal API. This is used to pre-process some data that is used in the templates, allowing this part of the functionality to be tested and allowing some end-to-end tests for the frontend data validation. """ from __future__ import annotations from copy import copy from dataclasses import dataclass from typing imp...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,392
beancount/fava
refs/heads/main
/src/fava/beans/load.py
"""Load Beancount files and strings.""" from __future__ import annotations from typing import TYPE_CHECKING from beancount.loader import load_string as load_string_bc if TYPE_CHECKING: # pragma: no cover from fava.beans.types import LoaderResult def load_string(value: str) -> LoaderResult: """Load a Beanc...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,393
beancount/fava
refs/heads/main
/tests/test_util_date.py
from __future__ import annotations from datetime import date from datetime import datetime from unittest import mock import pytest from fava.util.date import FiscalYearEnd from fava.util.date import get_fiscal_period from fava.util.date import get_next_interval from fava.util.date import get_prev_interval from fava....
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,394
beancount/fava
refs/heads/main
/tests/test_json_api.py
from __future__ import annotations import datetime import hashlib import re from io import BytesIO from pathlib import Path from typing import Any from typing import TYPE_CHECKING import pytest from fava.beans.funcs import hash_entry from fava.context import g from fava.core.charts import dumps from fava.core.fava_o...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,395
beancount/fava
refs/heads/main
/contrib/pythonanywhere/favadev/favadev_pythonanywhere_com_wsgi.py
"""fava wsgi application""" from __future__ import annotations from fava.application import create_app application = create_app( [ "/home/favadev/example.beancount", "/home/favadev/budgets-example.beancount", "/home/favadev/huge-example.beancount", ], )
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,396
beancount/fava
refs/heads/main
/src/fava/plugins/link_documents.py
"""Beancount plugin to link entries to documents. It goes through all entries with a `document` metadata-key, and tries to associate them to Document entries. For transactions, it then also adds a link from the transaction to documents, as well as the "#linked" tag. """ from __future__ import annotations from collect...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,397
beancount/fava
refs/heads/main
/src/fava/beans/helpers.py
"""Helpers for Beancount entries.""" from __future__ import annotations from typing import Any from typing import TypeVar from fava.beans.abc import Directive from fava.beans.abc import Posting T = TypeVar("T", Directive, Posting) def replace(entry: T, **kwargs: Any) -> T: """Create a copy of the given directi...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,398
beancount/fava
refs/heads/main
/src/fava/beans/abc.py
"""Abstract base classes for Beancount types.""" from __future__ import annotations from abc import ABC from abc import abstractmethod from typing import Any from typing import TYPE_CHECKING from beancount.core import amount from beancount.core import data from beancount.core import position if TYPE_CHECKING: # pra...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,399
beancount/fava
refs/heads/main
/tests/__init__.py
"""Fava tests."""
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,400
beancount/fava
refs/heads/main
/src/fava/beans/account.py
"""Account name helpers.""" from __future__ import annotations from typing import TYPE_CHECKING from beancount.core.account import TYPE as ACCOUNT_TYPE from fava.beans.abc import Custom from fava.beans.abc import Pad from fava.beans.abc import Transaction if TYPE_CHECKING: # pragma: no cover from fava.beans.ab...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,401
beancount/fava
refs/heads/main
/src/fava/helpers.py
"""Exceptions and module base class.""" from __future__ import annotations from typing import NamedTuple from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover from fava.beans.abc import Directive from fava.beans.abc import Meta class BeancountError(NamedTuple): """NamedTuple base for a ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,402
beancount/fava
refs/heads/main
/src/fava/serialisation.py
"""(De)serialisation of entries. When adding entries, these are saved via the JSON API - using the functionality of this module to obtain the appropriate data structures from `beancount.core.data`. Similarly, for the full entry completion, a JSON representation of the entry is provided. This is not intended to work w...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,403
beancount/fava
refs/heads/main
/docs/generate.py
"""Generate the reST-files for the API documentation. sphinx-apidoc is not customizeable enough to do this. """ from __future__ import annotations import pkgutil from pathlib import Path import fava MODULES = list(pkgutil.walk_packages(fava.__path__, fava.__name__ + ".")) RST_PATH = Path(__file__).parent / "api" i...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,404
beancount/fava
refs/heads/main
/src/fava/core/commodities.py
"""Attributes for auto-completion.""" from __future__ import annotations from contextlib import suppress from typing import TYPE_CHECKING from fava.core.module_base import FavaModule if TYPE_CHECKING: # pragma: no cover from fava.core import FavaLedger class CommoditiesModule(FavaModule): """Details about...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,405
beancount/fava
refs/heads/main
/src/fava/core/file.py
"""Reading/writing Beancount files.""" from __future__ import annotations import re import threading from codecs import decode from codecs import encode from dataclasses import replace from hashlib import sha256 from operator import attrgetter from pathlib import Path from typing import Iterable from typing import TYP...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,406
beancount/fava
refs/heads/main
/tests/test_core_file.py
from __future__ import annotations import re from datetime import date from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING import pytest from fava.beans import create from fava.beans.helpers import replace from fava.core.fava_options import InsertEntryOption from fava.core.file impo...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,407
beancount/fava
refs/heads/main
/src/fava/util/__init__.py
"""Some small utility functions.""" from __future__ import annotations import logging import re import time from functools import wraps from pathlib import Path from typing import Any from typing import Callable from typing import Iterable from typing import TYPE_CHECKING from typing import TypeVar from unicodedata im...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,408
beancount/fava
refs/heads/main
/tests/test_extensions.py
"""Tests for the extension system.""" from __future__ import annotations from typing import TYPE_CHECKING from fava.core.extensions import ExtensionDetails if TYPE_CHECKING: # pragma: no cover from .conftest import GetFavaLedger def test_report_page_globals(get_ledger: GetFavaLedger) -> None: """Extension...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,409
beancount/fava
refs/heads/main
/tests/test_util_excel.py
from __future__ import annotations from typing import TYPE_CHECKING import pytest from fava.beans.funcs import run_query from fava.util import excel if TYPE_CHECKING: # pragma: no cover from fava.core import FavaLedger def test_to_csv(example_ledger: FavaLedger) -> None: types, rows = run_query( ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,410
beancount/fava
refs/heads/main
/src/fava/plugins/__init__.py
"""Some Beancount plugins.""" from __future__ import annotations
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,411
beancount/fava
refs/heads/main
/src/fava/beans/prices.py
"""Price helpers.""" from __future__ import annotations import datetime from bisect import bisect from collections import Counter from collections import defaultdict from decimal import Decimal from typing import Iterable from typing import Sequence from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cov...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,412
beancount/fava
refs/heads/main
/src/fava/beans/str.py
"""Convert Beancount types to string.""" from __future__ import annotations from decimal import Decimal from functools import singledispatch from beancount.core.position import CostSpec from beancount.parser.printer import format_entry # type: ignore[import] from fava.beans.abc import Amount from fava.beans.abc imp...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,413
beancount/fava
refs/heads/main
/tests/test_core_query_shell.py
from __future__ import annotations from typing import Any from typing import TYPE_CHECKING import pytest from fava.beans.funcs import run_query from fava.helpers import FavaAPIError if TYPE_CHECKING: # pragma: no cover from .conftest import GetFavaLedger from .conftest import SnapshotFunc def test_query(...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,414
beancount/fava
refs/heads/main
/src/fava/core/budgets.py
"""Parsing and computing budgets.""" from __future__ import annotations from collections import Counter from collections import defaultdict from decimal import Decimal from typing import Dict from typing import List from typing import NamedTuple from typing import TYPE_CHECKING from fava.core.module_base import FavaM...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,415
beancount/fava
refs/heads/main
/src/fava/ext/__init__.py
"""Fava's extension system.""" from __future__ import annotations import ast import importlib import inspect import sys from functools import cached_property from pathlib import Path from typing import Any from typing import TYPE_CHECKING import jinja2 from flask import current_app from fava.helpers import Beancount...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,416
beancount/fava
refs/heads/main
/src/fava/ext/auto_commit.py
"""Auto-commit hook for Fava. This mainly serves as an example how Fava's extension systems, which only really does hooks at the moment, works. """ from __future__ import annotations from pathlib import Path from subprocess import call from subprocess import DEVNULL from typing import Any from typing import TYPE_CHEC...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,417
beancount/fava
refs/heads/main
/tests/data/import_config.py
"""Test importer for Fava.""" from __future__ import annotations import csv import datetime from decimal import Decimal from pathlib import Path from beancount.core import amount from beancount.core import data from beancount.ingest import importer from dateutil.parser import parse from fava.beans import create # m...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,418
beancount/fava
refs/heads/main
/src/fava/util/excel.py
"""Writing query results to CSV and spreadsheet documents.""" from __future__ import annotations import csv import datetime import io from decimal import Decimal from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover from fava.beans.funcs import ResultRow from fava.beans.funcs import ResultTyp...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,419
beancount/fava
refs/heads/main
/tests/test_ext.py
from __future__ import annotations from pathlib import Path from fava.ext import find_extensions def test_find_extensions() -> None: classes, errors = find_extensions(Path(), "NOMODULENAME") assert not classes assert len(errors) == 1 assert ( errors[0].message == 'Importing module "N...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,420
beancount/fava
refs/heads/main
/src/fava/util/sets.py
"""Utils for Python sets.""" from __future__ import annotations from typing import AbstractSet def add_to_set(set_: AbstractSet[str] | None, new: str) -> set[str]: """Add an entry to a set (or create it if doesn't exist). Args: set_: The (optional) set to add an element to. new: The string t...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,421
beancount/fava
refs/heads/main
/src/fava/template_filters.py
"""Template filters for Fava. All functions in this module will be automatically added as template filters. """ from __future__ import annotations from decimal import Decimal from pathlib import Path from typing import Callable from typing import TYPE_CHECKING from unicodedata import normalize from fava.beans import...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,422
beancount/fava
refs/heads/main
/src/fava/context.py
"""Specify types for the flask application context.""" from __future__ import annotations from typing import TYPE_CHECKING from flask import g as flask_g if TYPE_CHECKING: # pragma: no cover from fava.core import FavaLedger from fava.core import FilteredLedger from fava.ext import FavaExtensionBase ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,423
beancount/fava
refs/heads/main
/tests/test_core_budgets.py
"""Fava's budget syntax.""" from __future__ import annotations from datetime import date from decimal import Decimal from typing import TYPE_CHECKING from fava.core.budgets import calculate_budget from fava.core.budgets import calculate_budget_children from fava.core.budgets import parse_budgets if TYPE_CHECKING: #...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,424
beancount/fava
refs/heads/main
/src/fava/help/__init__.py
"""List of all available help pages.""" from __future__ import annotations HELP_PAGES = { "_index": "Index", "budgets": "Budgets", "import": "Import", "options": "Options", "beancount_syntax": "Beancount Syntax", "features": "Fava's features", "filters": "Filtering entries", "extensions...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,425
beancount/fava
refs/heads/main
/src/fava/util/ranking.py
"""Ranking utilities.""" from __future__ import annotations import math from typing import TYPE_CHECKING if TYPE_CHECKING: # pragma: no cover import datetime ZERO = 0.0 DEFAULT_RATE = math.log(2) * 1 / 365 class ExponentialDecayRanker: """Rank a list by exponential decay. Maintains scores for the ite...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,426
beancount/fava
refs/heads/main
/tests/test_beans.py
from __future__ import annotations import datetime from decimal import Decimal from typing import TYPE_CHECKING from fava.beans.abc import Price from fava.beans.account import parent from fava.beans.prices import FavaPriceMap if TYPE_CHECKING: # pragma: no cover from fava.beans.abc import Directive def test_a...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,427
beancount/fava
refs/heads/main
/tests/test_core_misc.py
from __future__ import annotations import datetime from typing import TYPE_CHECKING from fava.beans.load import load_string from fava.core.misc import sidebar_links from fava.core.misc import upcoming_events if TYPE_CHECKING: # pragma: no cover from fava.beans.abc import Custom def test_sidebar_links(load_doc...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,428
beancount/fava
refs/heads/main
/tests/test_core_inventory.py
from __future__ import annotations from decimal import Decimal from fava.beans import create from fava.core.inventory import CounterInventory def test_add() -> None: inv = CounterInventory() key = ("KEY", None) inv.add(key, Decimal("10")) assert len(inv) == 1 inv.add(key, Decimal("-10")) ass...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,429
beancount/fava
refs/heads/main
/src/fava/core/ingest.py
"""Ingest helper functions.""" from __future__ import annotations import datetime import sys import traceback from dataclasses import dataclass from os import altsep from os import sep from pathlib import Path from runpy import run_path from typing import Any from typing import TYPE_CHECKING from beancount.ingest imp...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,430
beancount/fava
refs/heads/main
/tests/test_util_sets.py
from __future__ import annotations from fava.util.sets import add_to_set def test_add_to_set_basic() -> None: assert add_to_set(None, "test") == {"test"} assert add_to_set(set(), "test") == {"test"} assert add_to_set({"test"}, "test") == {"test"} def test_add_to_set_no_mutation() -> None: test_set ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,431
beancount/fava
refs/heads/main
/src/fava/core/__init__.py
"""This module provides the data required by Fava's reports.""" from __future__ import annotations from datetime import date from datetime import timedelta from functools import cached_property from functools import lru_cache from pathlib import Path from typing import Iterable from typing import TYPE_CHECKING from ty...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,432
beancount/fava
refs/heads/main
/src/fava/core/fava_options.py
"""Fava's options. Options for Fava can be specified through Custom entries in the Beancount file. This module contains a list of possible options, the defaults and the code for parsing the options. """ from __future__ import annotations import re from dataclasses import dataclass from dataclasses import field from ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,433
beancount/fava
refs/heads/main
/src/fava/core/inventory.py
"""Alternative implementation of Beancount's Inventory.""" from __future__ import annotations from decimal import Decimal from typing import Callable from typing import Dict from typing import NamedTuple from typing import Optional from typing import Tuple from typing import TYPE_CHECKING from fava.beans import creat...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,434
beancount/fava
refs/heads/main
/src/fava/core/extensions.py
"""Fava extensions.""" from __future__ import annotations from dataclasses import dataclass from pathlib import Path from typing import TYPE_CHECKING from fava.core.module_base import FavaModule from fava.ext import find_extensions if TYPE_CHECKING: # pragma: no cover from fava.beans.abc import Custom from ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,435
beancount/fava
refs/heads/main
/src/fava/beans/funcs.py
"""Various functions to deal with Beancount data.""" from __future__ import annotations from typing import Any from typing import TYPE_CHECKING from beancount.core import compare # type: ignore[attr-defined] from beancount.query import query # type: ignore[attr-defined] from beancount.query import query_execute # ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,436
beancount/fava
refs/heads/main
/src/fava/beans/create.py
"""Helpers to create entries.""" from __future__ import annotations from decimal import Decimal from typing import TYPE_CHECKING from beancount.core import data from beancount.core.amount import A as BEANCOUNT_A # type: ignore[attr-defined] from beancount.core.amount import Amount as BeancountAmount from beancount...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,437
beancount/fava
refs/heads/main
/docs/conf.py
from __future__ import annotations extensions = [ "sphinx.ext.extlinks", "sphinx.ext.napoleon", "sphinx.ext.autodoc", "sphinx.ext.intersphinx", ] intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # General information about the project. project = "Fava" copyright = "2016, Dominik A...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,438
beancount/fava
refs/heads/main
/src/fava/core/watcher.py
"""A simple file and folder watcher.""" from __future__ import annotations from os import walk from pathlib import Path from typing import Iterable class Watcher: """A simple file and folder watcher. For folders, only checks mtime of the folder and all subdirectories. So a file change won't be noticed, ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,439
beancount/fava
refs/heads/main
/src/fava/core/tree.py
"""Account balance trees.""" from __future__ import annotations import collections from dataclasses import dataclass from operator import attrgetter from typing import Dict from typing import Iterable from typing import TYPE_CHECKING from fava.beans.abc import Open from fava.beans.account import parent as account_par...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,440
beancount/fava
refs/heads/main
/tests/test_plugins_link_documents.py
from __future__ import annotations from pathlib import Path from textwrap import dedent from typing import TYPE_CHECKING from beancount.loader import load_file from fava.beans.abc import Document from fava.beans.abc import Transaction from fava.beans.load import load_string from fava.plugins.link_documents import Do...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,441
beancount/fava
refs/heads/main
/src/fava/core/misc.py
"""Some miscellaneous reports.""" from __future__ import annotations import datetime import io import re from typing import TYPE_CHECKING from beancount.core.amount import CURRENCY_RE from fava.core.module_base import FavaModule from fava.helpers import BeancountError if TYPE_CHECKING: # pragma: no cover from ...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,442
beancount/fava
refs/heads/main
/tests/test_core_ingest.py
from __future__ import annotations import datetime from pathlib import Path from typing import Any from typing import TYPE_CHECKING import pytest from beancount.ingest.importer import ImporterProtocol # type: ignore[import] from fava.beans.abc import Amount from fava.beans.abc import Note from fava.beans.abc import...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,443
beancount/fava
refs/heads/main
/tests/test_cli.py
from __future__ import annotations import sys from socket import socket from subprocess import PIPE from subprocess import Popen from subprocess import STDOUT from time import sleep from time import time from typing import TYPE_CHECKING import pytest if TYPE_CHECKING: # pragma: no cover from pathlib import Path...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,444
beancount/fava
refs/heads/main
/src/fava/core/conversion.py
"""Commodity conversion helpers for Fava. All functions in this module will be automatically added as template filters. """ from __future__ import annotations from typing import overload from typing import TYPE_CHECKING from fava.beans import create if TYPE_CHECKING: # pragma: no cover import datetime fro...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....
31,445
beancount/fava
refs/heads/main
/tests/conftest.py
"""Test fixtures.""" # pylint: disable=redefined-outer-name from __future__ import annotations import datetime import os import re from pathlib import Path from pprint import pformat from textwrap import dedent from typing import Any from typing import Callable from typing import Counter from typing import TYPE_CHECKI...
{"/tests/test_application.py": ["/tests/conftest.py"], "/tests/test_serialisation.py": ["/tests/conftest.py"], "/tests/test_json_api.py": ["/tests/conftest.py"], "/tests/test_core_file.py": ["/tests/conftest.py"], "/tests/test_extensions.py": ["/tests/conftest.py"], "/tests/test_core_query_shell.py": ["/tests/conftest....