section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
sabnzbd | encoding | #!/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... |
engines | freesound | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Freesound (Sound)
"""
from datetime import datetime
from json import loads
from urllib.parse import urlencode
disabled = True
api_key = ""
# about
about = {
"website": "https://freesound.org",
"wikidata_id": "Q835703",
"official_api_documentation": "https:... |
logic | auth | # encoding: utf-8
import ckan.plugins as p
from ckan.types import AuthResult, Context, DataDict
def datastore_auth(
context: Context, data_dict: DataDict, privilege: str = "resource_update"
) -> AuthResult:
if "id" not in data_dict:
data_dict["id"] = data_dict.get("resource_id")
user = context.g... |
parsers | comicbooks | # This file is a part of Lector, a Qt based ebook reader
# Copyright (C) 2017-19 BasioMeusPuga
# 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 opt... |
plugins | manager | # -*- coding: utf-8 -*-
"""
flaskbb.plugins.manager
~~~~~~~~~~~~~~~~~~~~~~~
Plugin Manager for FlaskBB
:copyright: 2017, the FlaskBB Team
:license: BSD, see LICENSE for more details
"""
import logging
import pluggy
from flaskbb.utils.helpers import parse_pkg_metadata
from pkg_resources import Dis... |
archiver | create_cmd | import argparse
import errno
import logging
import os
import stat
import subprocess
import sys
import time
from io import TextIOWrapper
from .. import helpers
from ..archive import (
Archive,
BackupError,
BackupOSError,
ChunksProcessor,
FilesystemObjectProcessors,
MetadataCollector,
OsOpen,... |
Start | TestStartGui | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 Chris Hennes <chennes@pioneerlibrarysystem.org> *
# * *
# * This program is free software; you can redistribute it a... |
xl | providers | # 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 distributed in the hope that... |
server | metrics | """
Exposes various metrics via Prometheus.
"""
import functools
import os
from common_metrics import TASK_DURATION_BUCKETS
from django.conf import settings
from prometheus_client import Counter, Gauge, Histogram, Info, start_http_server
from version import get_full_version
gearman_active_jobs_gauge = Gauge(
"mcp... |
aliceVision | LdrToHdrSampling | __version__ = "4.0"
import json
import math
import os
from collections import Counter
from meshroom.core import desc
def findMetadata(d, keys, defaultValue):
v = None
for key in keys:
v = d.get(key, None)
k = key.lower()
if v is not None:
return v
for dk, dv in d.... |
conversions | releaseJun2020 | """
Conversion pack for June 2020 release
"""
CONVERSIONS = {
# Renamed items, extracted via diff file
"Basic EM Ward Amplifier": "'Basic' EM Shield Amplifier",
"Basic Thermal Dissipation Amplifier": "'Basic' Thermal Shield Amplifier",
"Basic Kinetic Deflection Amplifier": "'Basic' Kinetic Shield Ampli... |
urllib3 | _collections | from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
try: # Python 2.7+
fro... |
version-checks | jsondata | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2020 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import requests
from ..exceptions import CannotCheckOffline, ConfigurationInvalid, NetworkError
logger = logg... |
optimizers | jpegtran | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from os.path import exists
from subprocess import PIPE, Popen
from ... |
extractor | zdf | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (
NO_DEFAULT,
ExtractorError,
determine_ext,
extract_attributes,
float_or_none,
int_or_none,
merge_dicts,
parse_codecs,
qualities,
str_or_none,
try_get,
... |
utils | debug | # -*- coding: utf-8 -*-
import inspect
import io
import os
import pprint
import sys
import traceback
from .check import proprieties
from .fs import makefile
def report(value, dirname):
frame = inspect.currentframe()
try:
filename = f"{frame.f_back.f_code.co_name}_line{frame.f_back.f_lineno}.report"
... |
core | Mod | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Ky?stil? ... |
widgets | tagslineedit | from dataclasses import dataclass
from typing import List, Tuple
from PyQt5.QtCore import (
QLineF,
QPoint,
QPointF,
QRectF,
QSizeF,
Qt,
QTimerEvent,
pyqtSignal,
)
from PyQt5.QtGui import (
QColor,
QGuiApplication,
QKeyEvent,
QKeySequence,
QMouseEvent,
QPainter,
... |
migrations | 0206_global_tags_setup | # Generated by Django 3.2.5 on 2022-02-11 23:56
import django.db.models.deletion
import posthog.models.utils
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0205_auto_20220204_1748"),
]
operations = [
migrations.CreateModel(
... |
dictionary | loading_manager | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""Centralized place for dictionary loading operation."""
import threading
import time
from plover import log
from plover.dictionary.base import load_dictionary
from plover.exception import DictionaryLoaderException
from plover.resource import resource... |
transports | pollingbase | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.transports.pollingbase
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Polling transports base
"""
from octoprint.vendor.sockjs.tornado import basehandler
from octoprint.vendor.sockjs.torna... |
parser | options_test | """
Test various options.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount.core import account_types
from beancount.parser import options, parser
class TestOptions(unittest.TestCase):
def test_get_account_types(self):
options_ = options... |
sql | sql_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import tempfile
import unittest
from os import path
from beancount.utils import test_utils
from experiments.sql import sql
ONE_OF_EACH_TYPE = """
2012-01-01 open Expenses:Restaurant
2012-01-01 open Expenses:Movie
2012-01-01 open Asset... |
extractor | twentymin | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, try_get
from .common import InfoExtractor
class TwentyMinutenIE(InfoExtractor):
IE_NAME = "20min"
_VALID_URL = r"""(?x)
https?://
(?:www\.)?20min\.ch/
... |
daw | midi_file | from typing import List
from sglib.lib.midi import load_midi_file
from sglib.lib.util import *
from sglib.log import LOG
from sglib.models.daw import _shared
from sglib.models.stargate import *
try:
import mido
except ImportError:
from sg_py_vendor import mido
import math
class MIDIFileAnalysis:
"""Pro... |
AnnounceLocal | AnnounceLocalPlugin | import time
import gevent
from Config import config
from Plugin import PluginManager
from . import BroadcastServer
@PluginManager.registerTo("SiteAnnouncer")
class SiteAnnouncerPlugin(object):
def announce(self, force=False, *args, **kwargs):
local_announcer = self.site.connection_server.local_announcer... |
extractor | adn | # coding: utf-8
from __future__ import unicode_literals
import base64
import binascii
import json
import os
import random
from ..aes import aes_cbc_decrypt
from ..compat import compat_b64decode, compat_HTTPError, compat_ord
from ..utils import (
ExtractorError,
bytes_to_intlist,
bytes_to_long,
float_o... |
femtaskpanels | task_result_mechanical | # ***************************************************************************
# * Copyright (c) 2015 Qingfeng Xia <qingfeng.xia()eng.ox.ac.uk> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
sabnzbd | nzbparser | #!/usr/bin/python3 -OO
# Copyright 2008-2017 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... |
components | decorators | # 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 ... |
kafka-client | client | import json
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple
import kafka.errors
from django.conf import settings
from kafka import KafkaConsumer as KC
from kafka import KafkaProducer as KP
from kafka.producer.future import (
FutureProduceResult,
FutureRecordMetadata,
Rec... |
radio-crawler | dump_taglist | #!/usr/bin/env python2
# Copyright 2011,2014 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.
"""
Tak... |
multialarmclock | macprefs | # Copyright (C) 2010 Brian Parma
#
# 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 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it ... |
engines | 1337x | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
1337x
"""
from urllib.parse import quote, urljoin
from lxml import html
from searx.utils import (
eval_xpath,
eval_xpath_getindex,
eval_xpath_list,
extract_text,
get_torrent_size,
)
# about
about = {
"website": "https://1337x.to/",
"wikida... |
anticaptchas | UlozTo | # -*- coding: utf-8 -*-
import os.path
from ..base.ocr import BaseOCR
try:
import adecaptcha.clslib as clslib
except ImportError:
pass
class UlozTo(BaseOCR):
__name__ = "UlozTo"
__type__ = "anticaptcha"
__version__ = "0.05"
__status__ = "testing"
__description__ = """UlozTo audio captch... |
sglib | math | try:
from sg_py_vendor.pymarshal import pm_assert
except ImportError:
from pymarshal import pm_assert
import math
from math import log, pow
import numpy
__all__ = [
"clip_max",
"clip_min",
"clip_value",
"color_interpolate",
"cosine_interpolate",
"db_to_lin",
"hz_to_pitch",
"li... |
xlgui | playlist_container | # Copyright (C) 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 distributed in the hope that it w... |
options | cdlookup | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006-2007 Lukáš Lalinský
# Copyright (C) 2008, 2019-2021 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2013, 2018-2021 Laurent Monin
# Copyright (C) 2017 Sambhav Kotha... |
addons | ExtractArchive | # -*- coding: utf-8 -*-
import os
from builtins import NameError
from pyload.core.utils.old import safename
from pyload.core.utils.purge import uniquify
from ..base.addon import BaseAddon, expose, threaded
from ..base.extractor import ArchiveError, CRCError, PasswordError
from ..helpers import exists
try:
impor... |
plot-tools | plot_fft_base | #!/usr/bin/env python
#
# Copyright 2007,2008,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy
try:
from pylab import (
Button,
ceil,
connect,
draw,
figtext,
figure,
get_cu... |
examples | pyqt_freq_f | #!/usr/bin/env python
#
# Copyright 2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import blocks, filter, gr
from gnuradio.fft import window
try:
import sip
from gnuradio import qtgui
from PyQt5 import... |
filters | path_filter | from typing import Any, Dict, Optional
from posthog.constants import INSIGHT_PATHS
from rest_framework.request import Request
from .base_filter import BaseFilter
from .mixins.common import (
BreakdownMixin,
ClientQueryIdMixin,
DateMixin,
EntitiesMixin,
FilterTestAccountsMixin,
IncludeRecording... |
downloaders | XFileSharing | # -*- coding: utf-8 -*-
import re
from ..base.xfs_downloader import XFSDownloader
class XFileSharing(XFSDownloader):
__name__ = "XFileSharing"
__type__ = "downloader"
__version__ = "0.67"
__status__ = "testing"
__pattern__ = r"^unmatchable$"
__config__ = [
("enabled", "bool", "Activ... |
Models | GlobalStacksModel | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, Optional
from cura.PrinterOutput.PrinterOutputDevice import ConnectionType
from cura.Settings.CuraContainerRegistry import CuraContainerRegistry
from cura.Settings.GlobalStack import GlobalStack
fr... |
lib | plugins | # encoding: utf-8
from __future__ import annotations
import logging
import os
import sys
from typing import TYPE_CHECKING, Any, Optional, TypeVar, cast
import ckan.authz
import ckan.logic.schema as schema
from ckan import logic, model, plugins
from ckan.common import g
from ckan.types import Context, DataDict, Schema... |
colors | paletteview | # This file is part of MyPaint.
# Copyright (C) 2012-2019 by the MyPaint Development 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; either version 2 of the License, or
# (at your option... |
wavelet | qa_classify | #!/usr/bin/env python
#
# Copyright 2008,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import copy
# import pygsl.wavelet as wavelet # FIXME: pygsl not checked for in config
import math
import numpy
from gnuradio import analog, blocks, ... |
PyObjCTest | test_nsbundle | import Foundation
from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSBundle(TestCase):
def testOutput(self):
obj = NSBundle.mainBundle()
m = obj.preflightAndReturnError_.__metadata__()
self.assertTrue(m["argumen... |
user | forms | # -*- coding: utf-8 -*-
"""
flaskbb.user.forms
~~~~~~~~~~~~~~~~~~
It provides the forms that are needed for the user views.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import logging
from flask_babelplus import lazy_gettext as _
from flaskbb.utils.fo... |
comictaggerlib | versionchecker | """Version checker"""
# Copyright 2013 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
# Unless required by applicable law o... |
lib | pixbuf | # This file is part of MyPaint.
# Copyright (C) 2014-2015 by Andrew Chadwick <a.t.chadwick@gmail.com>
#
# 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 ... |
metrology | error_recorder | import inspect
import logging
import typing
from json import JSONDecodeError
from urllib.parse import urlparse
from requests.exceptions import RequestException
from searx import logger
from searx.exceptions import (
SearxEngineAccessDeniedException,
SearxEngineAPIException,
SearxEngineXPathException,
S... |
engines | google_scholar | # SPDX-License-Identifier: AGPL-3.0-or-later
"""Google (Scholar)
For detailed description of the *REST-full* API see: `Query Parameter
Definitions`_.
.. _Query Parameter Definitions:
https://developers.google.com/custom-search/docs/xml_results#WebSearch_Query_Parameter_Definitions
"""
# pylint: disable=invalid-na... |
serializers | schedules_base | import datetime
from apps.schedules.ical_utils import list_users_to_notify_from_ical
from apps.slack.models import SlackUserGroup
from common.api_helpers.custom_fields import TeamPrimaryKeyRelatedField
from common.api_helpers.exceptions import BadRequest
from django.utils import timezone
from rest_framework import ser... |
clientScripts | restructure_bag_aip_to_sip | #!/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... |
parts | toolbar | # -*- 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.... |
sgui | project | import os
import shutil
from sglib.constants import DEFAULT_PROJECT_DIR, IS_PORTABLE_INSTALL, MAJOR_VERSION
from sglib.lib import portable
from sglib.lib.translate import _
from sglib.lib.util import (
META_DOT_JSON,
PROJECT_FILE_TYPE,
get_file_setting,
pi_path,
read_file_text,
set_file_setting... |
sandbox | filter_design_fir | # -*- coding: utf-8 -*-
import scipy
from numpy import arange, cos, exp, log, ones, pi, sin, sqrt, zeros
# the three following lines are a workaround for a bug with scipy and py2exe
# together. See http://www.pyinstaller.org/ticket/83 for reference.
from scipy.special import factorial
scipy.factorial = factorial
fro... |
ui | moveable_list_view | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2018 Sambhav Kothari
# Copyright (C) 2018, 2020-2022 Laurent Monin
# Copyright (C) 2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Lice... |
ingest | views_as | import json
import logging
from functools import wraps
from agentarchives.archivesspace import (
ArchivesSpaceClient,
ArchivesSpaceError,
AuthenticationError,
ConnectionError,
)
from components import advanced_search
from components.ingest import pair_matcher
from contrib.mcp.client import MCPClient
fr... |
src | guiCocoa | # MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import os
import sys
if sys.platform != "darwin":
print "GUI: your platform is probably... |
eos | gamedata | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos 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, ... |
Generator | drill | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
ui | sessionproxy | #
# Copyright (C) 2010 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
from time import... |
plugins | cmmedia | """
$description Live TV channel and video on-demand service from CMM, a Spanish public, state-owned broadcaster.
$url cmmedia.es
$type live, vod
$metadata id
$metadata author
$metadata category
$metadata title
$notes Content not licensed for digital distribution is unavailable via the live channel stream.
"""
import ... |
formats | asf | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007, 2011 Lukáš Lalinský
# Copyright (C) 2009-2011, 2014, 2018-2021, 2023 Philipp Wolfer
# Copyright (C) 2011-2014 Wieland Hoffmann
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2013 Calvin Walton
# Copyright ... |
quickinsert | spanners | # 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
... |
mylar | readinglist | # This file is part of Mylar.
#
# Mylar 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.
#
# Mylar is distributed in the hope that... |
draftguitools | gui_labels | # ***************************************************************************
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
ImageKit | _metadata | # This file is generated by objective.metadata
#
# Last update: Fri Jun 8 16:58:05 2012
import sys
import objc
if sys.maxsize > 2**32:
def sel32or64(a, b):
return b
else:
def sel32or64(a, b):
return a
if sys.byteorder == "little":
def littleOrBig(a, b):
return a
else:
... |
bittorrent | stream | #!/usr/bin/env python
#
# Copyright (c) 2011 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 General Public L... |
Gui | MillFace | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
isso | dispatch | # -*- encoding: utf-8 -*-
import logging
import os
import sys
from glob import glob
from isso import config, make_app, wsgi
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.wrappers import Response
logger = logging.getLogger("isso")
class Dispatcher(DispatcherMiddleware):
"""
A... |
plover-build-utils | trim | #!/usr/bin/env python3
import glob
import os
import shutil
import sys
def trim(directory, patterns_file, verbose=True, dry_run=False):
if dry_run:
verbose = True
# Build list of patterns.
pattern_list = []
exclude_list = []
subdir = directory
with open(patterns_file) as fp:
fo... |
inbound | app | """Receiver module for processing SendGrid Inbound Parse messages.
See README.txt for usage instructions."""
try:
from config import Config
except:
# Python 3+, Travis
from sendgrid.helpers.inbound.config import Config
try:
from parse import Parse
except:
# Python 3+, Travis
from sendgrid.help... |
cli | utils | import argparse
from typing import Any, Callable, Generic, Iterable, Iterator, Optional, TypeVar
T = TypeVar("T")
class Manual(argparse.Action):
def __init__(
self,
option_strings,
dest=argparse.SUPPRESS,
default=argparse.SUPPRESS,
help=None,
):
super().__init_... |
python | audio_play | #!/usr/bin/env python
#
# Copyright 2004,2005,2007 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, blocks, gr
from gnuradio.eng_arg import eng_float
class my_top_block(gr.top_block):
... |
src | Preferences | import Traits
from UserAttrib import UserAttrib
from utils import safe_property
class Preferences(object):
def __init__(self):
self._sampleRateStr = None
self.lastFm_update(self.__class__.lastFm)
@UserAttrib(type=Traits.OneLineText, autosizeWidth=True)
@property
def soundDeviceLabel(s... |
thumbor | point | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
class FocalPoint:
ALIGNMENT_PERCENTAGES = {
"left": 0.0... |
migrations | 0015_auto_20230508_1641 | # Generated by Django 3.2.18 on 2023-05-08 16:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("alerts", "0014_alertreceivechannel_restricted_at"),
]
operations = [
migrations.AlterField(
model_name="alertgroup",
... |
models | effects_model | """
@file
@brief This file contains the effects model, used by the main window
@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 pr... |
youtube-dl | aes | from __future__ import unicode_literals
from math import ceil
from .compat import compat_b64decode
from .utils import bytes_to_intlist, intlist_to_bytes
BLOCK_SIZE_BYTES = 16
def pkcs7_padding(data):
"""
PKCS#7 padding
@param {int[]} data cleartext
@returns {int[]} padding data
... |
Todo | ToDoDocument | from Foundation import *
from SelectionNotifyMatrix import *
from ToDoCell import *
from ToDoItem import *
ToDoItemChangedNotification = "ToDoItemChangedNotification"
class ToDoDocument (NSDocument):
calendar = objc.IBOutlet()
dayLabel = objc.IBOutlet()
itemList = objc.IBOutlet()
statusList = objc.IB... |
PySide | mainwindow3 | import ctypes
import sys
import FreeCAD
import FreeCADGui
from PySide import QtCore, QtGui
from ui_mainwindow import Ui_MainWindow
# sys.path.append("")
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
from PySide import QtNetwork
... |
core | compare | """Comparison helpers for data objects.
"""
__copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import hashlib
from beancount.core import data
from beancount.core.data import Price
CompareError = collections.namedtuple("CompareError", "source message entry")
# A list... |
css | cssunknownrule | """CSSUnknownRule implements DOM Level 2 CSS CSSUnknownRule."""
__all__ = ["CSSUnknownRule"]
__docformat__ = "restructuredtext"
__version__ = "$Id$"
import xml.dom
import cssrule
import cssutils
class CSSUnknownRule(cssrule.CSSRule):
"""
Represents an at-rule not supported by this user agent, so in
effe... |
deluge-scheduler | core | #
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
... |
PartDesign | Init | # ***************************************************************************
# * Copyright (c) 2001,2002 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
pyelliptic | eccblindchain | """
Blind signature chain with a top level CA
"""
from .eccblind import ECCBlind
class ECCBlindChain(object): # pylint: disable=too-few-public-methods
"""
# Class for ECC Blind Chain signature functionality
"""
def __init__(self, ca=None, chain=None):
self.chain = []
self.ca = []
... |
libtorrent | libtorrent_component | from tribler.core.components.component import Component
from tribler.core.components.key.key_component import KeyComponent
from tribler.core.components.libtorrent.download_manager.download_manager import (
DownloadManager,
)
from tribler.core.components.socks_servers.socks_servers_component import (
SocksServer... |
analog | qa_sig_source | #!/usr/bin/env python
#
# Copyright 2004, 2007, 2010, 2012, 2013, 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import pmt
from gnuradio import analog, blocks, gr, gr_unittest
class test_sig_source(gr_unittest.TestCase):
def... |
Op | ThreadMilling | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
downloaders | FourSharedCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class FourSharedCom(SimpleDownloader):
__name__ = "FourSharedCom"
__type__ = "downloader"
__version__ = "0.37"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?4shared(-china)?\.com/(account/)?(down... |
webengine | interceptor | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""A request interceptor taking care of adblocking and custom headers."""
from qutebrowser.browser import shared
from qutebrowser.config import config, websettings
from qutebrowser.extensions i... |
examples | pyqt_time_c | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import blocks, gr
try:
import sip
from gnuradio import qtgui
from PyQt5 import Qt, QtWidgets
except ImportError:
... |
jobstores | sqlalchemy | from __future__ import absolute_import
from apscheduler.job import Job
from apscheduler.jobstores.base import BaseJobStore, ConflictingIdError, JobLookupError
from apscheduler.util import (
datetime_to_utc_timestamp,
maybe_ref,
utc_timestamp_to_datetime,
)
try:
import cPickle as pickle
except ImportEr... |
migrations | 0045_auto_20210210_2114 | # Generated by Django 3.0.7 on 2021-02-10 21:14
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0044_auto_20210207_1924"),
]
operations = [
migrations.RemoveCo... |
writer2 | main | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (absolute_import, division, print_function,
unicode_literals)
__license__ = 'GPL v3'
__copyright__ = '2011, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredt... |
restapi | metadata_schema | from marshmallow import Schema
from marshmallow.fields import Boolean, Float, Integer, List, String
class MetadataParameters(Schema):
first = Integer(default=1, description="Limit the range of the query")
last = Integer(default=50, description="Limit the range of the query")
sort_by = String(
desc... |
extractor | trovo | # coding: utf-8
from __future__ import unicode_literals
import json
from ..utils import ExtractorError, int_or_none, str_or_none, try_get
from .common import InfoExtractor
class TrovoBaseIE(InfoExtractor):
_VALID_URL_BASE = r"https?://(?:www\.)?trovo\.live/"
def _extract_streamer_info(self, data):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.