section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
components
component
from __future__ import annotations import logging import sys import time from asyncio import Event from typing import TYPE_CHECKING, Optional, Set, Type, Union from tribler.core.components.exceptions import ( ComponentStartupException, MissedDependency, NoneComponent, ) from tribler.core.components.report...
core
middleware
__package__ = "archivebox.core" import ipaddress from django.contrib.auth.middleware import RemoteUserMiddleware from django.core.exceptions import ImproperlyConfigured from django.utils import timezone from ..config import ( PUBLIC_SNAPSHOTS, REVERSE_PROXY_USER_HEADER, REVERSE_PROXY_WHITELIST, ) def d...
cmd
bloom
from __future__ import absolute_import import glob import os import sys from bup import bloom, git, options from bup.compat import argv_bytes, hexstr from bup.helpers import add_error, debug1, log, progress, qprogress, saved_errors from bup.io import path_msg optspec = """ bup bloom [options...] -- ruin ruin t...
clickhouse
kafka_engine
# Note for the vary: these engine definitions (and many table definitions) are not in sync with cloud! from django.conf import settings STORAGE_POLICY = ( lambda: "SETTINGS storage_policy = 'hot_to_cold'" if settings.CLICKHOUSE_ENABLE_STORAGE_POLICY else "" ) KAFKA_ENGINE = "Kafka('{kafka_host}', '{topic...
core
data_test
__copyright__ = "Copyright (C) 2014-2017 Martin Blais" __license__ = "GNU GPLv2" import datetime import pickle import unittest from datetime import date from beancount.core import data from beancount.core.amount import A META = data.new_metadata("beancount/core/testing.beancount", 12345) FLAG = "*" class TestData...
api
formatters
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2018 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. from xml.etree import ElementTree from flask import json, jsonify, make_response from . import API_VERSION class Bas...
network
receivequeuethread
""" Process data incoming from network """ import errno import socket import Queue import state from network.advanceddispatcher import UnknownStateError from network.connectionpool import BMConnectionPool from queues import receiveDataQueue from threads import StoppableThread class ReceiveQueueThread(StoppableThread...
PyObjCTest
test_framework
import objc from PyObjCTools.TestSupport import * class TestFramework(TestCase): def test_normal_lib(self): self.assertIsNone(objc.infoForFramework("/usr/lib/libSystem.dylib")) self.assertIsNone(objc.infoForFramework("/usr/lib/libSystem.B.dylib")) self.assertIsNone(objc.infoForFramework("/...
changeset
compare
from __future__ import annotations from operator import setitem from typing import Iterable from gaphor.core.modeling import ( Element, ElementChange, ElementFactory, Presentation, RefChange, StyleSheet, ValueChange, ) from gaphor.core.modeling.collection import collection class Unmatcha...
scripts
diag
#!/usr/bin/python3 """ This file is part of the Stargate project, Copyright Stargate Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 3 of the License. This program is distributed in the ...
plugins
onecommodity
"""A plugin that issues errors when more than one commodity is used in an account. For investments or trading accounts, it can make it easier to filter the action around a single stock by using the name of the stock as the leaf of the account name. Notes: - The plugin will automatically skip accounts that have expli...
downloaders
LetsuploadCo
# -*- coding: utf-8 -*- import os import re from ..base.simple_downloader import SimpleDownloader class LetsuploadCo(SimpleDownloader): __name__ = "LetsuploadCo" __type__ = "downloader" __version__ = "0.03" __status__ = "testing" __pattern__ = r"https?://(?:www\.)?letsupload\.co/\w+" __conf...
network
tls
""" SSL/TLS negotiation. """ import logging import os import socket import ssl import sys import network.asyncore_pollchoose as asyncore import paths from network.advanceddispatcher import AdvancedDispatcher from queues import receiveDataQueue logger = logging.getLogger("default") _DISCONNECTED_SSL = frozenset((ssl....
booster
add
import wx from logbook import Logger from service.fit import Fit pyfalog = Logger(__name__) class CalcAddBoosterCommand(wx.Command): def __init__(self, fitID, boosterInfo, position=None): wx.Command.__init__(self, True, "Add Booster") self.fitID = fitID self.newBoosterInfo = boosterInfo ...
gui
main_window
from __future__ import absolute_import import fcntl import os import re import shlex import signal import subprocess import sys import webbrowser import zipfile from builtins import filter, map from functools import partial from importlib import import_module from operator import contains from pathlib import Path fro...
src
urls
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the ...
api
scan
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2020 Alban 'spl0k' Féron # 2020 Vincent Ducamps # # Distributed under terms of the GNU AGPLv3 license. from flask import current_app, request from ..daemon.client import DaemonClient fr...
actions
pin
from gaphor import UML from gaphor.diagram.presentation import AttachedPresentation, Named from gaphor.diagram.shapes import ( Box, IconBox, Text, TextAlign, VerticalAlign, draw_border, ) from gaphor.diagram.support import represents from gaphor.UML.recipes import stereotypes_str from gaphor.UML...
notes
editor
from sglib.lib import scales from sglib.lib import strings as sg_strings from sglib.lib import util from sglib.lib.translate import _ from sglib.lib.util import * from sglib.log import LOG from sglib.math import clip_value, pitch_to_hz from sglib.models import stargate as sg_project from sglib.models import theme from ...
views
teams
from apps.auth_token.auth import ApiTokenAuthentication from apps.public_api.serializers.teams import TeamSerializer from apps.public_api.tf_sync import is_request_from_terraform, sync_teams_on_tf_request from apps.public_api.throttlers.user_throttle import UserThrottle from apps.user_management.models import Team from...
api
permissions
import enum import typing from common.utils import getattrd from django.conf import settings from django.contrib.auth.models import AbstractUser from rest_framework import permissions from rest_framework.authentication import BasicAuthentication, SessionAuthentication from rest_framework.request import Request from re...
draftmake
make_polararray
# *************************************************************************** # * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
datatypes
pypackage
# -*- coding: utf-8 -*- from ..managers.event_manager import UpdateEvent from ..utils.old import safepath class PyPackage: """ Represents a package object at runtime. """ def __init__(self, manager, id, name, folder, site, password, queue, order): self.m = self.manager = manager sel...
update-handlers
button_press
import logging from dataclasses import dataclass from typing import Callable, Optional, Tuple from apps.alerts.constants import ActionSource from apps.alerts.models import AlertGroup from apps.api.permissions import RBACPermission, user_is_authorized from apps.telegram.models import TelegramToUserConnector from apps.t...
pynocchio
comic_path_filter
import glob from .exception import NoDataFindException from .utility import join_path class ComicPathFilter: def __init__(self, extension_list): self.file_list = [] self.current_path = None self.extension_list = extension_list self.current_index = None def parse(self, path, i...
extractor
tver
# coding: utf-8 from __future__ import unicode_literals import re from ..compat import compat_str from ..utils import int_or_none, remove_start, smuggle_url, try_get from .common import InfoExtractor class TVerIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?tver\.jp/(?P<path>(?:corner|episode|feature)/(?P<...
beancount
loader_test
__copyright__ = "Copyright (C) 2014-2016 Martin Blais" __license__ = "GNU GPLv2" import functools import importlib import logging import os import tempfile import textwrap import unittest from os import path from unittest import mock from beancount import loader from beancount.parser import parser from beancount.uti...
docsrc
update_checksums
TEMPLATE = """.. |source_link| replace:: puddletag-{version}.tar.gz .. _source_link: https://github.com/puddletag/puddletag/releases/download/{version}/puddletag-{version}.tar.gz .. |beta_source_link| replace:: puddletag-{version}.tar.gz .. _beta_source_link: https://github.com/puddletag/puddletag/releases/download/{v...
ControlledPreferences
FontSampleDisplayView
# # FontSampleDisplayView.py # ControlledPreferences # # Converted by u.fiedler on 04.02.05. # with great help from Bob Ippolito - Thank you Bob! # # The original version was written in Objective-C by Malcolm Crawford # at http://homepage.mac.com/mmalc/CocoaExamples/controllers.html from AppKit import * from Fou...
PyObjCTools
Conversion
""" Conversion.py -- Tools for converting between Python and Objective-C objects. Conversion offers API to convert between Python and Objective-C instances of various classes. Currently, the focus is on Python and Objective-C collections. """ __all__ = [ "pythonCollectionFromPropertyList", "propertyListFrom...
builtinViewColumns
baseIcon
# noinspection PyPackageRequirements import wx from eos.const import FittingSlot from eos.saveddata.drone import Drone from eos.saveddata.fit import Fit from eos.saveddata.implant import Implant from eos.saveddata.module import Module, Rack from eos.saveddata.targetProfile import TargetProfile from graphs.wrapper impor...
beetsplug
lyrics
# This file is part of beets. # Copyright 2016, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
AddonManager
addonmanager_pyside_interface
# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** # * * # * Copyright (c) 2022 FreeCAD Project Association * # * ...
python-bindings
py_kdtree_test
# # $Id: py-kdtree_test.py 2268 2008-08-20 10:08:58Z richert $ # import unittest from kdtree import KDTree_2Int, KDTree_3Float, KDTree_4Float, KDTree_4Int, KDTree_6Float class KDTree_2IntTestCase(unittest.TestCase): def test_empty(self): nn = KDTree_2Int() self.assertEqual(0, nn.size()) ...
deployments
connector
"""Implementation of connector from Composite Structures and Components. Only assembly connector (see chapter Components in UML specification) is supported at the moment. The implementation is based on `ConnectorItem` class and `InterfaceItem` class in assembly connector mode. Assembly Connector ================== To...
chardet
latin1prober
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Universal charset detector code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 2001 # the Initial Developer. All R...
lib
datapreview
# encoding: utf-8 """Data previewer functions Functions and data structures that are needed for the ckan data preview. """ from __future__ import annotations import logging from typing import Any, Iterable, Optional from urllib.parse import urlparse import ckan.plugins as p from ckan import logic from ckan.common i...
plugins
nounused
"""This plugin validates that there are no unused accounts. """ __copyright__ = "Copyright (C) 2014, 2016-2017 Martin Blais" __license__ = "GNU GPLv2" import collections from beancount.core import data, getters __plugins__ = ("validate_unused_accounts",) UnusedAccountError = collections.namedtuple("UnusedAccountE...
accounts
MegaCoNz
# -*- coding: utf-8 -*- import hashlib from pyload.core.utils.convert import to_bytes, to_str from ..base.account import BaseAccount from ..downloaders.MegaCoNz import MegaClient, MegaCrypto class MegaCoNz(BaseAccount): __name__ = "MegaCoNz" __type__ = "account" __version__ = "0.08" __status__ = "t...
localModule
clone
import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.module.localClone import CalcCloneLocalModuleCommand from gui.fitCommands.helpers import InternalCommandHistory, restoreRemovedDummies from service.fit import Fit class GuiCloneLocalModuleCommand(wx.Command): ...
gtkui
main
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the Licens...
core
makeyaml
# # Copyright 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Automatically create YAML bindings for GRC from block code """ import glob import logging import os import re from collections import OrderedDict import yaml try: from yaml ...
usecases
extend
"""Use case extension relationship.""" from gaphor import UML from gaphor.diagram.presentation import LinePresentation, Named from gaphor.diagram.shapes import Box, Text, draw_arrow_head from gaphor.diagram.support import represents from gaphor.UML.recipes import stereotypes_str @represents(UML.Extend, head=UML.Exte...
utils
anim
# noinspection PyPackageRequirements import gui.utils.color as colorUtils import wx class LoadAnimation(wx.Window): def __init__( self, parent, id=wx.ID_ANY, label="", pos=wx.DefaultPosition, size=wx.DefaultSize, style=0, ): wx.Window.__init__(se...
bookwyrm
preview_images
""" Generate social media preview images for twitter/mastodon/etc """ import colorsys import logging import math import os import textwrap from io import BytesIO from uuid import uuid4 from bookwyrm import models, settings from bookwyrm.tasks import IMAGES, app from colorthief import ColorThief from django.core.files....
converter
flow_graph
# Copyright 2017,2018 Free Software Foundation, Inc. # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-2.0-or-later # import ast from collections import OrderedDict from ..core.io import yaml from . import xml def from_xml(filename): """Load flow graph from xml file""" element, version_info...
gui
frame
# -------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU - GPL...
widgets
info
# -*- coding: utf-8 -*- # Copyright (C) 2008-2010 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is dist...
comictaggerlib
progresswindow
"""A PyQT4 dialog to show ID log and progress""" # Copyright 2012-2014 Anthony Beville # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unl...
utils
rarvolinfo
#!/usr/bin/python3 -OO # Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later ver...
ext
pygmentplugin
# ext/pygmentplugin.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php from mako import compat from pygments import highlight from pygments.formatters.html import H...
plugins
manager
import os import sys import warnings from contextlib import contextmanager, nullcontext from itertools import groupby from operator import attrgetter from pathlib import Path from typing import ContextManager, Dict, Iterable, Iterator, List, Optional, Type from ..compat import find_entry_points, get_dist_name, importl...
flaskbb
app
# -*- coding: utf-8 -*- """ flaskbb.app ~~~~~~~~~~~ manages the app creation and configuration process :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import logging import logging.config import os import sys import time import warnings from datetime impo...
experiments
trend_experiment_result
from dataclasses import asdict, dataclass from datetime import datetime from functools import lru_cache from math import exp, lgamma, log from typing import List, Optional, Tuple, Type from zoneinfo import ZoneInfo from ee.clickhouse.queries.experiments import ( CONTROL_VARIANT_KEY, FF_DISTRIBUTION_THRESHOLD, ...
futures
thread
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Implements ThreadPoolExecutor.""" import atexit import sys import threading import weakref from concurrent.futures import _base import Queue as queue try: from multiprocessing import cpu_count except ImportE...
picard
cluster
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2004 Robert Kaye # Copyright (C) 2006-2008, 2011 Lukáš Lalinský # Copyright (C) 2008 Hendrik van Antwerpen # Copyright (C) 2008 Will # Copyright (C) 2010-2011, 2014, 2018-2022 Philipp Wolfer # Copyright (C) 2011-2013 Michael Wi...
addons
AndroidPhoneNotify
# -*- coding: utf-8 -*- from ..base.notifier import Notifier class AndroidPhoneNotify(Notifier): __name__ = "AndroidPhoneNotify" __type__ = "addon" __version__ = "0.17" __status__ = "testing" __config__ = [ ("enabled", "bool", "Activated", False), ("apikey", "str", "API key", "")...
ui
utils
import os import time from PySide2.QtCore import Property, QFileSystemWatcher, QObject, QTimer, QUrl, Slot from PySide2.QtQml import QQmlApplicationEngine try: from PySide2 import shiboken2 except: import shiboken2 class QmlInstantEngine(QQmlApplicationEngine): """ QmlInstantEngine is an utility cla...
lucaschess
Lucas
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- # ============================================================================== # Author : Lucas Monge, lukasmonk@gmail.com # Web : http://lucaschess.pythonanywhere.com/ # Blog : http://lucaschess.blogspot.com # Licence : GPL # =============================================...
Op
MillFace
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
models
alert
import hashlib import logging import typing from functools import partial from uuid import uuid4 from apps.alerts import tasks from apps.alerts.constants import TASK_DELAY_SECONDS from apps.alerts.incident_appearance.templaters import TemplateLoader from common.jinja_templater import apply_jinja_template from common.j...
server
queues
""" The PackageQueue class handles job queueing, as it relates to packages. """ import functools import logging import queue as Queue import threading from django.conf import settings from server import metrics from server.jobs import DecisionJob from server.packages import DIP, SIP logger = logging.getLogger("archiv...
ui
itemviews
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2006-2008, 2011-2012 Lukáš Lalinský # Copyright (C) 2007 Robert Kaye # Copyright (C) 2008 Gary van der Merwe # Copyright (C) 2008 Hendrik van Antwerpen # Copyright (C) 2008-2011, 2014-2015, 2018-2023 Philipp Wolfer # Copyright ...
meshes
mesh_constraint_tie_tetra10
def create_nodes(femmesh): # nodes femmesh.addNode(1235.0, 0.0, 1005.0, 1) femmesh.addNode(0.0, 1235.0, 1005.0, 2) femmesh.addNode(1.51e-13, -1235.0, 1005.0, 3) femmesh.addNode(1234.81190351814, -21.5537219500452, 1005.0, 4) femmesh.addNode(1099.83246467203, -19.1976470810119, 0.0, 5) femmes...
scorewiz
scoreproperties
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
retention
actors_query
import dataclasses from typing import Any, Dict, List, Optional, Tuple from posthog.models.filters.retention_filter import RetentionFilter from posthog.models.team import Team from posthog.queries.actor_base_query import ActorBaseQuery from posthog.queries.insight import insight_sync_execute from posthog.queries.reten...
upgrade
upgrade
import logging import os import shutil import time from configparser import MissingSectionHeaderError, ParsingError from types import SimpleNamespace from typing import List, Optional, Tuple from ipv8.keyvault.private.libnaclkey import LibNaCLSK from pony.orm import db_session, delete from tribler.core.components.band...
migrations
0003_auto_20200630_1034
# Generated by Django 3.0.7 on 2020-06-30 10:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0002_auto_20200625_1521"), ] operations = [ migrations.AlterField( model_name="snapshot", name="added", ...
hedgebox
taxonomy
# URLs SITE_URL = "https://hedgebox.net" URL_HOME = f"{SITE_URL}/" URL_MARIUS_TECH_TIPS = f"{SITE_URL}/mariustechtips/" URL_PRICING = f"{SITE_URL}/pricing/" URL_SIGNUP = f"{SITE_URL}/signup/" URL_LOGIN = f"{SITE_URL}/login/" dyn_url_invite = lambda invite_id: f"{SITE_URL}/invite/{invite_id}/" URL_FILES = f"{SITE_UR...
PyObjCTest
test_nsorderedset
from Foundation import * from PyObjCTools.TestSupport import * class TestNSOrderedSet(TestCase): @min_os_level("10.7") def testMethods10_7(self): self.assertResultIsBOOL(NSOrderedSet.isEqualToOrderedSet_) self.assertResultIsBOOL(NSOrderedSet.containsObject_) self.assertResultIsBOOL(NSO...
commands
create_user
import sys from getpass import getpass from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from photonix.photos.models import Library, LibraryUser User = get_user_model() class Command(BaseCommand): """Management command to create user and assign them to libararies...
chardet
big5prober
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
importers
final_cut_pro
""" @file @brief This file is used to import a Final Cut Pro XML file @author Jonathan Thomas <jonathan@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project de...
extractor
bfi
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import extract_attributes from .common import InfoExtractor class BFIPlayerIE(InfoExtractor): IE_NAME = "bfi:player" _VALID_URL = r"https?://player\.bfi\.org\.uk/[^/]+/film/watch-(?P<id>[\w-]+)-online" _TEST = { "url"...
api
printer
__author__ = "Gina Häußge <osd@foosel.net>" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import re from flask import Response, abort, jsonify, request from octoprint.acces...
lib
MultipartPostHandler
#!/usr/bin/python #### # 06/2010 Nic Wolfe <nic@wolfeden.ca> # 02/2006 Will Holcomb <wholcomb@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the Li...
scripts
example
__copyright__ = "Copyright (C) 2014-2017 Martin Blais" __license__ = "GNU GPLv2" import calendar import collections import datetime import decimal import functools import io import itertools import logging import math import operator import random import re import sys import textwrap import click from beancount impo...
downloaders
LibgenIo
# -*- coding: utf-8 -*- import json import re import time import urllib.parse from bs4 import BeautifulSoup from pyload.core.network.http.exceptions import BadHeader from ..base.downloader import BaseDownloader class LibgenIo(BaseDownloader): __name__ = "LibgenIo" __type__ = "downloader" __version__ = ...
chardet
euckrprober
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
caching
caching
"""Centralized mechanism for all caching. This module contains functions and common utilities for cache files located by default under a single directory. In particular, this is used for: * Load Cache: Caches the parsing and processing of a top-level Beancount file to a pickle. * Price Cache: Caches previous...
extractor
rmcdecouverte
# coding: utf-8 from __future__ import unicode_literals import re from ..compat import compat_parse_qs, compat_urlparse from ..utils import smuggle_url from .brightcove import BrightcoveLegacyIE from .common import InfoExtractor class RMCDecouverteIE(InfoExtractor): _VALID_URL = r"https?://rmcdecouverte\.bfmtv\...
extractor
gazeta
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class GazetaIE(InfoExtractor): _VALID_URL = r"(?P<url>https?://(?:www\.)?gazeta\.ru/(?:[^/]+/)?video/(?:main/)*(?:\d{4}/\d{2}/\d{2}/)?(?P<id>[A-Za-z0-9-_.]+)\.s?html)" _TESTS = [ { "url": ...
widgets
lazytableview
import json from typing import Dict, List from PyQt5.QtCore import QEvent, QModelIndex, QRect, Qt, QTimer, pyqtSignal from PyQt5.QtGui import QGuiApplication, QMouseEvent, QMovie from PyQt5.QtWidgets import ( QAbstractItemView, QApplication, QHeaderView, QLabel, QTableView, ) from tribler.core.comp...
python
mono_tone
#!/usr/bin/env python # # Copyright 2004,2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from argparse import ArgumentParser from gnuradio import audio, gr from gnuradio.eng_arg import eng_float try: from gnuradio import analog ex...
helpers
datastruct
from .errors import Error class StableDict(dict): """A dict subclass with stable items() ordering""" def items(self): return sorted(super().items()) class Buffer: """ Provides a managed, resizable buffer. """ class MemoryLimitExceeded(Error, OSError): """Requested buffer si...
m3u
translator
from __future__ import annotations import os import urllib.parse from collections.abc import Iterable from pathlib import Path from typing import IO, Optional, Union from mopidy.internal import path from mopidy.models import Playlist, Ref, Track from mopidy.types import Uri from . import Extension def path_to_uri(...
extractor
nytimes
# coding: utf-8 from __future__ import unicode_literals import base64 import hashlib import hmac from ..utils import ( determine_ext, float_or_none, int_or_none, js_to_json, mimetype2ext, parse_iso8601, remove_start, ) from .common import InfoExtractor class NYTimesBaseIE(InfoExtractor):...
draftguitools
gui_polygons
# *************************************************************************** # * (c) 2009 Yorik van Havre <yorik@uncreated.net> * # * (c) 2010 Ken Cline <cline@frii.com> * # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * ...
commands
remove_field
from common.migrations.remove_field import RemoveFieldDB, RemoveFieldState from django.core.management import BaseCommand from django.db import connection from django.db.migrations import Migration from django.db.migrations.autodetector import MigrationAutodetector from django.db.migrations.loader import MigrationLoade...
deluge-client
rencode
# Original bencode module by Petru Paler, et al. # # Modifications by Connelly Barnes: # # - Added support for floats (sent as 32-bit or 64-bit in network # order), bools, None. # - Allowed dict keys to be of any serializable type. # - Lists/tuples are always decoded as tuples (thus, tuples can be # used as di...
api
errors
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2018-2022 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. from peewee import DoesNotExist from werkzeug.exceptions import BadRequestKeyError from . import api from .excepti...
PyObjCTest
test_nsevent
from AppKit import * from PyObjCTools.TestSupport import * try: unichr except NameError: unichr = chr class TestNSEvent(TestCase): def testConstants(self): self.assertEqual(NSLeftMouseDown, 1) self.assertEqual(NSLeftMouseUp, 2) self.assertEqual(NSRightMouseDown, 3) self.as...
engines
flickr_noapi
# SPDX-License-Identifier: AGPL-3.0-or-later """ Flickr (Images) """ import re from json import loads from time import time from urllib.parse import urlencode from searx.engines import logger from searx.utils import ecma_unescape, html_to_text logger = logger.getChild("flickr-noapi") # about about = { "website...
Dressup
Utils
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
heartbeat
_heartbeat_text_creator
from dataclasses import dataclass from common.api_helpers.utils import create_engine_url from django.conf import settings @dataclass class IntegrationHeartBeatText: heartbeat_expired_title: str = "heartbeat_expired" heartbeat_expired_message: str = "heartbeat_expired" heartbeat_restored_title: str = "hea...
parsers
generic_rss
__package__ = "archivebox.parsers" from datetime import datetime from typing import IO, Iterable from ..index.schema import Link from ..util import enforce_types, htmldecode, str_between @enforce_types def parse_generic_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]: """Parse RSS XML-format files i...
extensions
sphinx
from __future__ import annotations import functools from pathlib import Path import sphinx.util.docutils from docutils import nodes from docutils.parsers.rst import directives from docutils.parsers.rst.directives import images from gaphor.core.modeling import Diagram, ElementFactory from gaphor.diagram.export import ...
digital
qa_constellation_encoder_bc
#!/usr/bin/env python # # Copyright 2004,2007,2010-2013,2020 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import numpy as np from gnuradio import blocks, digital, gr, gr_unittest class test_constellation_encoder(gr_unittest.TestCase): def se...
draftguitools
gui_planeproxy
# *************************************************************************** # * Copyright (c) 2019 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
forms
books
""" using django model forms """ from bookwyrm import models from bookwyrm.models.fields import ClearableFileInputWithWarning from django import forms from .custom_form import CustomForm from .widgets import ArrayWidget, Select, SelectDateWidget # pylint: disable=missing-class-docstring class CoverForm(CustomForm): ...