section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
UML | informationflow | """Support functions for information flow
And by extension SysML item flow.
"""
from gaphor.core.format import format
from gaphor.diagram.presentation import Presentation
from gaphor.diagram.shapes import Text, cairo_state
from gaphor.UML.classes.association import get_center_pos
from gaphor.UML.recipes import stereo... |
picard | collection | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2013 Michael Wiencek
# Copyright (C) 2014 Lukáš Lalinský
# Copyright (C) 2014, 2017 Sophist-UK
# Copyright (C) 2014, 2017-2021 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2019, 2021 Philipp Wolfer
#
... |
cover | manager | # Copyright 2013 Simonas Kazlauskas
# 2014-2021 Nick Boultbee
#
# 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 version.
fr... |
engines | doku | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Doku Wiki
"""
from urllib.parse import urlencode
from lxml.html import fromstring
from searx.utils import eval_xpath, extract_text
# about
about = {
"website": "https://www.dokuwiki.org/",
"wikidata_id": "Q851864",
"official_api_documentation": "https://w... |
archiver | tar_cmds | import argparse
import base64
import logging
import os
import stat
import tarfile
import time
from ..archive import Archive, ChunksProcessor, TarfileObjectProcessors
from ..compress import CompressionSpec
from ..constants import * # NOQA
from ..helpers import (
ChunkerParams,
ChunkIteratorFileWrapper,
Har... |
openshot-qt | setup | """
@file
@brief Setup script to install OpenShot (on Linux and without any dependencies such as libopenshot)
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2016 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.o... |
PathTests | TestPathLog | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
scripts | fix_translation_memory | ##% Script to fix a corrupted Translation memory from existing po files
import argparse
import os
import re
import xml.etree.ElementTree as ET
from pathlib import Path
from xml.sax.saxutils import escape, quoteattr, unescape
from fuzzywuzzy import fuzz, process
def load_existing_xmtm(path: Path) -> ET.Element:
... |
PyObjCTest | test_nspathcontrol | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSPathControlHelper(NSObject):
def pathControl_shouldDragPathComponentCell_withPasteboard_(self, pc, c, pb):
return 1
def pathControl_validateDrop_(self, pc, dr):
return 1
def pathControl_acceptDrop_(self, pc, dr):
... |
requests | api | # -*- coding: utf-8 -*-
"""
requests.api
~~~~~~~~~~~~
This module implements the Requests API.
:copyright: (c) 2012 by Kenneth Reitz.
:license: Apache2, see LICENSE for more details.
"""
from . import sessions
def request(method, url, **kwargs):
"""Constructs and sends a :class:`Request <Request>`.
:par... |
extractor | nick | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import update_url_query
from .mtv import MTVServicesInfoExtractor
class NickIE(MTVServicesInfoExtractor):
# None of videos on the website are still alive?
IE_NAME = "nick.com"
_VALID_URL = r"https?://(?P<domain>(?:(?:www|beta... |
search | utils | from archivebox.config import ANSI
from archivebox.util import enforce_types
from django.db.models import QuerySet
def log_index_started(url):
print("{green}[*] Indexing url: {} in the search index {reset}".format(url, **ANSI))
print()
def get_file_result_content(res, extra_path, use_pwd=False):
if use_... |
3MFReader | ThreeMFReader | # Copyright (c) 2021-2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os.path
import zipfile
from typing import TYPE_CHECKING, List, Optional, Union, cast
import numpy
import pySavitar as Savitar
from cura.CuraApplication import CuraApplication
from cura.Machines.ContainerTree ... |
activitypub | verbs | """ activities that do things """
from dataclasses import dataclass, field
from typing import List
from django.apps import apps
from .base_activity import ActivityObject, Signature, resolve_remote_id
from .ordered_collection import CollectionItem
@dataclass(init=False)
class Verb(ActivityObject):
"""generic fie... |
migrations | 201711180953_7c3fcf8a3335_add_plugin_tables | """Add plugin tables
Revision ID: 7c3fcf8a3335
Revises:
Create Date: 2017-11-18 09:53
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "7c3fcf8a3335"
down_revision = "d0ffadc3ea48"
branch_labels = ()
depends_on = None
def upgrade():
# ### commands auto gene... |
friture | ui_settings | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui\settings.ui'
#
# Created: Sat Feb 14 20:44:20 2015
# by: PyQt5 UI code generator 5.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from . import friture_rc
class Ui_Settings_D... |
mp3tag | funcs | import re
from copy import deepcopy
from html.parser import HTMLParser
from puddlestuff.audioinfo import CaselessDict
from puddlestuff.functions import replace_regex
conditionals = set(["if", "ifnot"])
def debug(cursor, flag, filename=None, maxsize=None):
if flag == "on":
cursor.debug = True
cur... |
extractor | hrti | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
clean_html,
int_or_none,
parse_age_limit,
sanitized_Request,
try_get,
)
from .common import InfoExtractor
class HRTiBaseIE(InfoExtractor):... |
extractor | tenplay | # coding: utf-8
from __future__ import unicode_literals
from ..utils import HEADRequest, parse_age_limit, parse_iso8601 # smuggle_url,
from .common import InfoExtractor
class TenPlayIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?10play\.com\.au/(?:[^/]+/)+(?P<id>tpv\d{6}[a-z]{5})"
)
_TES... |
addons | ExpertDecoders | # -*- coding: utf-8 -*-
import base64
import uuid
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.network.request_factory import get_request
from ..base.addon import BaseAddon, threaded
class ExpertDecoders(BaseAddon):
__name__ = "ExpertDecoders"
__type__ = "addon"
... |
viewers | contextmenu | # 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
... |
tagsources | amg | import json
import os
import re
import sys
import time
import urllib.error
import urllib.parse
import urllib.request
from puddlestuff.audioinfo import CaselessDict, isempty
from puddlestuff.constants import CHECKBOX
from puddlestuff.puddleobjects import ratio
from puddlestuff.tagsources import (
RetrievalError,
... |
neubot | background_rendezvous | # neubot/background_rendezvous.py
#
# Copyright (c) 2011-2012 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
core | Theme | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2006 Sami Kyöstilä ... |
xinebe | cdefs | # Copyright 2006 Lukas Lalinsky
#
# 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 version.
import ctypes
from quodlibet.util im... |
bitmessagekivy | kivy_state | # pylint: disable=too-many-instance-attributes, too-few-public-methods
"""
Kivy State variables are assigned here, they are separated from state.py
=================================
"""
import os
import threading
class KivyStateVariables(object):
"""This Class hold all the kivy state variables"""
def __ini... |
posthog | apps | import os
import posthoganalytics
import structlog
from django.apps import AppConfig
from django.conf import settings
from posthog.settings import SELF_CAPTURE, SKIP_ASYNC_MIGRATIONS_SETUP
from posthog.utils import (
get_git_branch,
get_git_commit,
get_machine_id,
get_self_capture_api_token,
)
from pos... |
readability | debug | import re
# FIXME: use with caution, can leak memory
uids = {}
uids_document = None
def describe_node(node):
global uids
if node is None:
return ""
if not hasattr(node, "tag"):
return "[%s]" % type(node)
name = node.tag
if node.get("id", ""):
name += "#" + node.get("id")
... |
commands | rescan_photos_periodically | from time import sleep
from django.conf import settings
from django.core.management.base import BaseCommand
from photonix.photos.utils.organise import rescan_photo_libraries
from photonix.photos.utils.redis import redis_connection
from photonix.photos.utils.system import missing_system_dependencies
from photonix.web.u... |
ui | treemodel | from __future__ import annotations
from unicodedata import normalize
from gaphor import UML
from gaphor.core.format import format
from gaphor.core.modeling import Diagram, Element
from gaphor.diagram.iconname import icon_name
from gaphor.i18n import gettext
from gi.repository import Gio, GObject, Pango
_no_value = o... |
meshes | mesh_canticcx_tria3 | def create_nodes(femmesh):
# nodes
femmesh.addNode(0.0, 500.0, 0.0, 1)
femmesh.addNode(0.0, 500.0000000000002, 1000.0, 2)
femmesh.addNode(8000.0, 500.0, 0.0, 3)
femmesh.addNode(8000.0, 500.0000000000002, 1000.0, 4)
femmesh.addNode(0.0, 500.00000000000006, 142.8571428571426, 5)
femmesh.addNod... |
frescobaldi-app | copy2image | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2019 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
... |
lib | configobj | # configobj.py
# A config file reader/writer that supports nested sections in config files.
# Copyright (C) 2005-2010 Michael Foord, Nicola Larosa
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# nico AT tekNico DOT net
# ConfigObj 4
# http://www.voidspace.org.uk/python/configobj.html
# Released subject to th... |
migrations | 0002_hook | # Generated by Django 3.0.6 on 2020-08-18 12:10
import django.db.models.deletion
import posthog.models.utils
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0082_personalapikey"),
migrations.swappable_d... |
borg | xattr | """A basic extended attributes (xattr) implementation for Linux, FreeBSD and macOS."""
import errno
import os
import re
import subprocess
import sys
import tempfile
from packaging.version import parse as parse_version
from .helpers import prepare_subprocess_env
from .logger import create_logger
logger = create_logg... |
events | seekbar | # Copyright 2016 Christoph Reiter
#
# 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 version.
import contextlib
from gi.reposito... |
SQL | Base | import atexit
import sqlite3
import DBF
import DBFcache
from Code import Util
class DBBase:
"""
Hace referencia a una base de datos.
Establece la conexion y permite cerrarla.
"""
def __init__(self, nomFichero):
self.nomFichero = unicode(nomFichero)
existe = Util.existeFichero(nom... |
ui | item | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007 Lukáš Lalinský
# Copyright (C) 2010, 2018, 2020-2022 Philipp Wolfer
# Copyright (C) 2011-2012 Michael Wiencek
# Copyright (C) 2012 Chad Wilson
# Copyright (C) 2013, 2020-2021 Laurent Monin
# Copyright (C) 2014 Sophist... |
PartDesignTests | TestShapeBinder | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
frescobaldi-app | checks | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2020 - 2020 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
... |
core | Shader | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2009 Vlad Emelyanov ... |
extractor | expotv | from __future__ import unicode_literals
from ..utils import int_or_none, unified_strdate
from .common import InfoExtractor
class ExpoTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?expotv\.com/videos/[^?#]*/(?P<id>[0-9]+)($|[?#])"
_TEST = {
"url": "http://www.expotv.com/videos/reviews/3/40/NYX... |
PyObjCTest | test_dict_property | import objc
from PyObjCTest.test_object_property import OCObserve
from PyObjCTools.TestSupport import *
NSObject = objc.lookUpClass("NSObject")
class TestDictPropertyHelper(NSObject):
aDict = objc.dict_property()
class TestDictProperty(TestCase):
# objc.dict_property is currently just an object_property wi... |
engine | views | from apps.integrations.mixins import AlertChannelDefiningMixin
from django.conf import settings
from django.core.cache import cache
from django.http import HttpResponse, JsonResponse
from django.views.generic import View
class HealthCheckView(View):
"""
This view is used in k8s liveness probe.
k8s periodi... |
database | table_bittorrent | # neubot/database/table_bittorrent.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
# Copyright (c) 2011 Alessio Palmero Aprosio <alessio@apnetwork.it>,
# Universita` degli Studi di Milano
#
# This file is part of Neubot <http://www.neubot.... |
plugins | interfaces | # encoding: utf-8
"""A collection of interfaces that CKAN plugins can implement to customize and
extend CKAN.
"""
from __future__ import annotations
from typing import (
TYPE_CHECKING,
Any,
Callable,
ClassVar,
Iterable,
Mapping,
Optional,
Sequence,
Type,
Union,
)
from ckan.mo... |
plugins | pitchglitch | # -*- coding: utf-8 -*-
"""
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... |
options | dialog | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2008, 2011 Lukáš Lalinský
# Copyright (C) 2008-2009 Nikolai Prokoschenko
# Copyright (C) 2008-2009, 2018-2022 Philipp Wolfer
# Copyright (C) 2011 Pavan Chander
# Copyright (C) 2011-2012, 2019 Wieland Hoffmann
# Copyright (... |
utils | objreg | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""The global object registry and related utility functions."""
import collections
import functools
from typing import (
TYPE_CHECKING,
Any,
Callable,
MutableMapping,
Mutab... |
network | tcp | """
TCP protocol handler
"""
import logging
import math
import random
import socket
import time
import addresses
import asyncore_pollchoose as asyncore
import connectionpool
import helper_random
import knownnodes
# pylint: disable=too-many-ancestors
import l10n
import protocol
import state
from bmconfigparser import ... |
feminout | importPyMesh | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
mainwin | logdialog | from PyQt5.QtCore import QMutex
from PyQt5.QtGui import QTextOption
from PyQt5.QtWidgets import (
QApplication,
QHBoxLayout,
QPushButton,
QTextEdit,
QVBoxLayout,
QWidget,
)
from ..constants import RIGHTDOCK
from ..translations import translate
mutex = QMutex()
class LogDialog(QWidget):
d... |
plugins | va1 | # -*- coding: utf-8 -*-
"""
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... |
scripts | dynapath_4060_post | # ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2022 luvtofish <luvtofish@gmail.com> *
# * *
# * Th... |
Gui | PropertyEditor | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
mystran | add_femelement_geometry | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
frescobaldi-app | matcher | # 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
... |
commands | create_batch_export_from_app | import datetime as dt
import json
from django.core.management.base import BaseCommand, CommandError
from posthog.batch_exports.models import BatchExport, BatchExportDestination
from posthog.batch_exports.service import backfill_export, sync_batch_export
from posthog.models.plugin import PluginConfig
from posthog.tempo... |
midifiles | midifiles | """
MIDI file reading and playback.
References:
http://home.roadrunner.com/~jgglatt/
http://home.roadrunner.com/~jgglatt/tech/miditech.htm
http://home.roadrunner.com/~jgglatt/tech/midifile.htm
http://www.sonicspot.com/guide/midifiles.html
http://www.ccarh.org/courses/253/assignment/midifile/
https://code.google.com/... |
views | helpers | """ helper functions used in various views """
import re
from datetime import datetime, timedelta
import dateutil.parser
import dateutil.tz
from bookwyrm import activitypub, models, settings
from bookwyrm.connectors import ConnectorException, get_data
from bookwyrm.status import create_generated_note
from bookwyrm.uti... |
songsmenu | editplaycount | # Copyright 2012-2015 Ryan "ZDBioHazard" Turner <zdbiohazard2@gmail.com>
# 2016-22 Nick Boultbee
#
# 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... |
AddonManager | change_branch | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
clientScripts | change_sip_name | #!/usr/bin/env python
# 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, ei... |
python | client | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import sys
import time
from argparse import ArgumentParser
from threading import Thread
import numpy
# import zeromq
##################################################################... |
femviewprovider | view_constraint_electrostaticpotential | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
qltk | filesel | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# 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 version.
impor... |
PathTests | TestPathVoronoi | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
PyObjCTest | test_dict_proxy | """
Minimal tests for sequence proxies
NOTE: this file is very, very incomplete and just tests copying at the moment.
"""
import sys
import objc
from PyObjCTest.fnd import (
NSDictionary,
NSMutableDictionary,
NSNull,
NSObject,
NSPredicate,
)
from PyObjCTest.pythonset import OC_TestSet
from PyObjCT... |
zeromq | qa_zeromq_req_msg_source | #!/usr/bin/env python
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""Unit tests for ZMQ REQ Message Source block"""
import sys
import time
import pmt
import zmq
from gnuradio import blocks, gr, gr_unittest, zeromq
class qa_ze... |
parser | options | """
Declaration of options and their default values.
"""
__copyright__ = "Copyright (C) 2013-2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import io
import re
import textwrap
from beancount.core import account, account_types, data, display_context
from beancount.core.number import D
def options_v... |
equations | equation | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
conversions | releaseApril2016 | """
Conversion pack for Citadel release
"""
CONVERSIONS = {
# Renamed items
"Capital Inefficient Armor Repair Unit": "CONCORD Capital Armor Repairer",
"Capital Neutron Saturation Injector I": "CONCORD Capital Shield Booster",
"Limited Mega Ion Siege Blaster I": "CONCORD Ion Siege Blaster",
"Dual 10... |
draftgeoutils | geo_arrays | # ***************************************************************************
# * Copyright (c) 2020 three_d *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * Th... |
wsgiserver | ssl_pyopenssl | """A library for integrating pyOpenSSL with CherryPy.
The OpenSSL module must be importable for SSL functionality.
You can obtain it from `here <https://launchpad.net/pyopenssl>`_.
To use this module, set CherryPyWSGIServer.ssl_adapter to an instance of
SSLAdapter. There are two ways to use SSL:
Method One
---------... |
graphs | bmi_change | # -*- coding: utf-8 -*-
import plotly.graph_objs as go
import plotly.offline as plotly
from django.utils.translation import gettext as _
from reports import utils
def bmi_change(objects):
"""
Create a graph showing bmi over time.
:param objects: a QuerySet of BMI instances.
:returns: a tuple of the th... |
community | knowledge_community | import random
from binascii import unhexlify
from cryptography.exceptions import InvalidSignature
from ipv8.keyvault.private.libnaclkey import LibNaCLSK
from ipv8.lazy_community import lazy_wrapper
from ipv8.types import Key
from pony.orm import db_session
from tribler.core.components.database.db.tribler_database impo... |
utils | parse | import json
import re
from urllib.parse import parse_qsl
from lxml.etree import HTML, XML
from streamlink.plugin import PluginError
def _parse(parser, data, name, exception, schema, *args, **kwargs):
try:
parsed = parser(data, *args, **kwargs)
except Exception as err:
snippet = repr(data)
... |
operon | util | # Copyright 2012,2013 Christoph Reiter
#
# 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 version.
import os
import shlex
import ... |
Op | PocketBase | # ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2020 russ4262 (Russell Johnson) *
# * *
# * Th... |
PrinterOutput | NetworkedPrinterOutputDevice | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import gzip
import os # To get the username
from enum import IntEnum
from time import time
from typing import Callable, Dict, List, Optional, Union
from cura.API import Account
from cura.CuraApplication import CuraApplica... |
extractors | instagram | #!/usr/bin/env python
__all__ = ["instagram_download"]
from ..common import *
def instagram_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
url = r1(r"([^?]*)", url)
cont = get_content(url, headers=fake_headers)
vid = r1(r"instagram.com/\w+/([^/]+)", url)
description = r1(r'<m... |
signal | scipy_resample | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Timothée Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distri... |
bup | io | import mmap as py_mmap
from bup.compat import pending_raise
def byte_stream(file):
return file.buffer
def path_msg(x):
"""Return a string representation of a path."""
# FIXME: configurability (might git-config quotePath be involved?)
return x.decode(errors="backslashreplace")
assert not hasattr(p... |
bpm | bpmdetect | """
Simple program that uses the 'bpmdetect' GStreamer plugin to detect
the BPM of a song, and outputs that to console.
Requires GStreamer 1.x, PyGObject 1.x, and gst-plugins-bad
Copyright (C) 2015 Dustin Spicuzza
This program is free software; you can redistribute it and/or modify
it under t... |
ext | extract | import re
from mako import compat, lexer, parsetree
class MessageExtractor(object):
def process_file(self, fileobj):
template_node = lexer.Lexer(
fileobj.read(), input_encoding=self.config["encoding"]
).parse()
for extracted in self.extract_nodes(template_node.get_children()):... |
extractor | youku | # coding: utf-8
from __future__ import unicode_literals
import random
import re
import string
import time
from ..utils import (
ExtractorError,
get_element_by_class,
js_to_json,
str_or_none,
strip_jsonp,
)
from .common import InfoExtractor
class YoukuIE(InfoExtractor):
IE_NAME = "youku"
... |
ui | codeEditor | import re
import sys
from keyword import kwlist
import AppKit
from objc import super
from pygments.lexers import Python3Lexer, get_lexer_by_name
from pygments.style import Style
from pygments.styles.default import DefaultStyle
from pygments.token import *
try:
import jedi
hasJedi = True
except Exception:
... |
connectors | openlibrary_languages | """ key lookups for openlibrary languages """
languages = {
"/languages/eng": "English",
"/languages/fre": "French",
"/languages/spa": "Spanish",
"/languages/ger": "German",
"/languages/rus": "Russian",
"/languages/ita": "Italian",
"/languages/chi": "Chinese",
"/languages/jpn": "Japanese... |
audio | item_context_menu | import shutil
from sglib import constants
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.models.daw import *
from sgui import shared as glbl_shared
from sgui.daw import shared
from sgui.daw.lib import item as item_lib
fro... |
math | gen_sine_table | #!/usr/bin/env python
#
# Copyright 2004 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import sys
def gen_approx_table(f, nentries, min_x, max_x):
"""return a list of nentries containing tuples of the form:
(m, c). min_x and m... |
frescobaldi-app | documenticon | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2015 - 2015 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
... |
heartbeat | grafana | from pathlib import PurePath
from apps.integrations.metadata.heartbeat._heartbeat_text_creator import (
HeartBeatTextCreatorForTitleGrouping,
)
integration_verbal = PurePath(__file__).stem
creator = HeartBeatTextCreatorForTitleGrouping(integration_verbal)
heartbeat_text = creator.get_heartbeat_texts()
heartbeat... |
parts | tools | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 by Ihor E. Novikov
#
# 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 3 of the License, or
# (at your option) any later version.... |
lib | databaseFunctions | # 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 ... |
downloaders | RealdebridCom | # -*- coding: utf-8 -*-
import json
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_downloader import MultiDownloader
def args(**kwargs):
return kwargs
class RealdebridCom(MultiDownloader):
__name__ = "RealdebridCom"
__type__ = "downloader"
__version__ = ... |
settings | celery_task_routes | CELERY_TASK_ROUTES = {
# DEFAULT
"apps.alerts.tasks.sync_grafana_alerting_contact_points.disconnect_integration_from_alerting_contact_points": {
"queue": "default"
},
"apps.alerts.tasks.delete_alert_group.delete_alert_group": {"queue": "default"},
"apps.alerts.tasks.invalidate_web_cache_for_... |
docs-rst | copy_docs | #!/usr/bin/env python3
"""
"""
__copyright__ = "Copyright (C) 2018 Martin Blais"
__license__ = "GNU GPLv2"
import argparse
import logging
import shutil
from os import path
# Maintained by hand.
FILE_PAIRS = [
(
"1e4Vz3wZB_8-ZcAwIFde8X5CjzKshE4-OXtVVHm4RQ8s/Beancount-Motivation.rst",
"users/cl_acc... |
mail | bypass_list_management | class BypassListManagement(object):
"""Setting for Bypass List Management
Allows you to bypass all unsubscribe groups and suppressions to ensure that
the email is delivered to every single recipient. This should only be used
in emergencies when it is absolutely necessary that every recipient
receiv... |
core | Config | """Copyright 2021 The GNU Radio Contributors
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import os
from collections import OrderedDict
from os.path import exists, expanduser, expandvars, normpath
from . import Constants
class Config(object):
name = "GNU Radio Companion (no gui... |
docs | conf | # 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 version.
import os
import sys
import types
dir_ = os.path.dirname(os.path.realp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.