section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
packages | ordered_dict | # Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy.
# Passes Python2.7's test suite and incorporates all the latest updates.
# Copyright 2009 Raymond Hettinger, released under the MIT License.
# http://code.activestate.com/recipes/576693/
try:
from thread import get_ident as _get_iden... |
network | announcethread | """
Announce myself (node address)
"""
import time
import state
from bmconfigparser import config
from network.assemble import assemble_addr
from network.connectionpool import BMConnectionPool
from node import Peer
from threads import StoppableThread
class AnnounceThread(StoppableThread):
"""A thread to manage r... |
qtui | dbus_service | # Copyright (C) 2018 Thomas Hess
#
# 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.
#
# This program is distributed in th... |
downloaders | LoadTo | # -*- coding: utf-8 -*-
import re
from ..anticaptchas.SolveMedia import SolveMedia
from ..base.simple_downloader import SimpleDownloader
#
# Test links:
# http://www.load.to/JWydcofUY6/random.bin
# http://www.load.to/oeSmrfkXE/random100.bin
class LoadTo(SimpleDownloader):
__name__ = "LoadTo"
__type__ = "dow... |
plugins | onetv | """
$description A state/privately owned Russian live TV channel.
$url 1tv.ru
$type live
$metadata title
$region Russia
"""
import logging
import random
import re
from urllib.parse import unquote
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls ... |
vimode | handlerbase | # vimode -- Vi Mode package for QPlainTextEdit
#
# Copyright (c) 2012 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
# of the License, or (at your option... |
PyObjCTest | test_nsthread | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSThread(TestCase):
def testMethods(self):
self.assertResultIsBOOL(NSThread.isMultiThreaded)
self.assertArgIsSEL(
NSThread.detachNewThreadSelector_toTarget_wit... |
lib | helpers | # The contents of this file are subject to the Common Public Attribution
# License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
PyObjCTest | test_cvopenglbuffer | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestCVOpenGLBuffer(TestCase):
def testConstants(self):
self.assertIsInstance(kCVOpenGLBufferWidth, unicode)
self.assertIsInstance(... |
QT | Tablero | import collections
import copy
import os
import LCEngine4 as LCEngine
import StringIO
from Code import TabVisual, Util, VarGen
from Code.Constantes import *
from Code.QT import (
Colocacion,
Controles,
Delegados,
Iconos,
Piezas,
QTUtil,
QTUtil2,
QTVarios,
TabElementos,
TabFlecha... |
declaration | serialize | # -*- coding: utf-8 -*-
"""This module defines the ways to serialize the config declaration into
different structures, such as: documentation string, config template,
validation schema.
New serializers can be defined in the following manner:
```python
from ckan.config.declaration.serialize import handler, serializer
... |
extractor | reuters | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, js_to_json, unescapeHTML
from .common import InfoExtractor
class ReutersIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?reuters\.com/.*?\?.*?videoId=(?P<id>[0-9]+)"
_TEST = {
"url": "http://www.re... |
api | 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 ... |
doc | conf | # -*- coding: utf-8 -*-
#
# CKAN documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 25 16:47:17 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that aren't pickleable... |
QuartzCore | _metadata | # This file is generated by objective.metadata
#
# Last update: Fri Jun 8 16:58:06 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:
... |
commands | update_tracker | #
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 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
# the additional special exception to link portions of this program with the OpenSSL library.
#... |
plugins | tv8 | """
$description Turkish live TV channel owned by Acun Medya Group.
$url tv8.com.tr
$type live
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream, HLSStreamReader, HLSStreamWriter
log = logging.getLog... |
forms | auth | from CTFd.forms import BaseForm
from CTFd.forms.fields import SubmitField
from CTFd.forms.users import (
attach_custom_user_fields,
attach_registration_code_field,
build_custom_user_fields,
build_registration_code_field,
)
from flask_babel import lazy_gettext as _l
from wtforms import PasswordField, Str... |
knowledge | knowledge_component | import tribler.core.components.metadata_store.metadata_store_component as metadata_store_component
from tribler.core.components.component import Component
from tribler.core.components.database.database_component import DatabaseComponent
from tribler.core.components.ipv8.ipv8_component import Ipv8Component
from tribler.... |
downloaders | DropboxCom | # -*- coding: utf-8 -*-
from ..base.simple_downloader import SimpleDownloader
class DropboxCom(SimpleDownloader):
__name__ = "DropboxCom"
__type__ = "downloader"
__version__ = "0.11"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?dropbox\.com/.+"
__config__ = [
("enabled",... |
deluge-client | tests | import os
import sys
import pytest
from .client import DelugeRPCClient, RemoteException
if sys.version_info > (3,):
long = int
@pytest.fixture
def client(request):
if sys.platform.startswith("win"):
auth_path = os.path.join(os.getenv("APPDATA"), "deluge", "auth")
else:
auth_path = os.pa... |
preferences | preference_panes | #
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# 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 deluge.commo... |
Resources | Biquad_Filter | """
Copyright 2009-2017 Olivier Belanger
This file is part of SoundGrain.
SoundGrain 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.
Sound... |
http | client | # neubot/http/client.py
#
# Copyright (c) 2010-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 P... |
utils | l10n | import locale
import logging
from typing import Optional
from pycountry import countries, languages # type: ignore[import]
DEFAULT_LANGUAGE = "en"
DEFAULT_COUNTRY = "US"
DEFAULT_LANGUAGE_CODE = f"{DEFAULT_LANGUAGE}_{DEFAULT_COUNTRY}"
log = logging.getLogger(__name__)
class Country:
def __init__(self, alpha2, ... |
PyObjCTest | test_sockaddr | import objc
from PyObjCTest.sockaddr import PyObjCTestSockAddr
from PyObjCTools.TestSupport import *
objc.registerMetaDataForSelector(
b"PyObjCTestSockAddr",
b"sockAddrToValue:",
dict(
arguments={
2 + 0: dict(type_modifier=objc._C_IN),
}
),
)
objc.registerMetaDataForSelector... |
fec | qa_fecapi_repetition | #!/usr/bin/env python
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from _qa_helper import _qa_helper
from _qa_helper_async import _qa_helper_async
from gnuradio import fec, gr, gr_unittest
class test_fecapi_repetition(gr_unitt... |
context | imageContext | import os
import AppKit
import Quartz
from drawBot.misc import DrawBotError
from .baseContext import Color
from .pdfContext import PDFContext
def _nsDataConverter(value):
if isinstance(value, AppKit.NSData):
return value
return AppKit.NSData.dataWithBytes_length_(value, len(value))
def _nsColorCon... |
cura | OneAtATimeIterator | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from functools import cmp_to_key
from typing import List
from UM.Scene.Iterator import Iterator
from UM.Scene.SceneNode import SceneNode
class OneAtATimeIterator(Iterator.Iterator):
"""Iterator that returns a list of... |
dialogs | aboutdlg_credits | # -*- coding: utf-8 -*-
CREDITS = """
Many thanks to everyone who has commented on sK1/Skencil, submitted
suggestions or bug reports, helped in the testing or
contributed to sK1/Skencil with code or through mini payments.
In particular, thanks to (in alphabetical order):
Aaron Digulla
Alexander Prokoudine
André P... |
accounts | EuroshareEu | # -*- coding: utf-8 -*-
import json
import re
import time
from ..base.account import BaseAccount
class EuroshareEu(BaseAccount):
__name__ = "EuroshareEu"
__type__ = "account"
__version__ = "0.12"
__status__ = "testing"
__description__ = """Euroshare.eu account plugin"""
__license__ = "GPLv3... |
migrations | 0123_alter_user_preferred_language | # Generated by Django 3.2.5 on 2022-01-04 22:31
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0122_alter_annualgoal_year"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_... |
plugins | reader_extras | # Reader extras
# by Jack Miller
# v1.0
# Designed to put extra interesting content in the reader output.
enabled_extras = ["datetime", "slashdot", "authors"]
hacks = {}
datetime_attrs = ["published_parsed", "updated_parsed"]
def datetime_extras(body, extra_content, attrs):
import time
if attrs["publishe... |
PyObjCTest | test_nsopenpanel | from AppKit import *
from PyObjCTools.TestSupport import *
class TestOpenPanel(TestCase):
def dont_testOpenPanelSignature(self):
"""
This test failed sometime after the 1.0b1 release (on Panther).
"""
o = NSOpenPanel.openPanel()
sig = o.beginSheetForDirectory_file_types_mo... |
communities | actions | from __future__ import annotations
from typing import Any
from abilian.web.action import Action, Endpoint, actions
from abilian.web.nav import NavItem
from flask import g
from flask import url_for as url_for_orig
from flask.blueprints import BlueprintSetupState
from flask_babel import lazy_gettext as _l
from flask_lo... |
blocks | qa_conjugate | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest
class test_conjugate(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
def te... |
extractor | ebaumsworld | from __future__ import unicode_literals
from .common import InfoExtractor
class EbaumsWorldIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)"
_TEST = {
"url": "http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/83367677/",
"info_dict"... |
options | general | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007, 2014 Lukáš Lalinský
# Copyright (C) 2008, 2018-2022 Philipp Wolfer
# Copyright (C) 2011, 2013 Michael Wiencek
# Copyright (C) 2011, 2019 Wieland Hoffmann
# Copyright (C) 2013-2014 Sophist-UK
# Copyright (C) 2013-2014... |
equations | magnetodynamic | # ***************************************************************************
# * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
general | comment | """CommentItem diagram item."""
from functools import partial
from gaphor.core.modeling import Comment
from gaphor.core.styling import TextAlign, VerticalAlign
from gaphor.diagram.presentation import ElementPresentation
from gaphor.diagram.shapes import Box, Text, stroke
from gaphor.diagram.support import represents
... |
tools | github_release | #!/usr/bin/env python3
"""
Prepare release and upload Windows and macOS artifacts
"""
import argparse
import hashlib
import os
import re
import sys
import magic # use python-magic (not compatible with filemagic)
import requests
from github3 import login
from jinja2 import Template
def debug_requests():
"""turn ... |
ui | tracker_icons | #
# Copyright (C) 2010 John Garland <johnnybg+deluge@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
import os
i... |
grafana-plugin | apps | import logging
import sys
from django.apps import AppConfig
from django.conf import settings
from django.db import OperationalError
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
STARTUP_COMMANDS = ["runserver", "uwsgi"]
class GrafanaPluginConfig(AppConfig):
name = "apps.grafana_plugin"
... |
models | book | """ database schema for books and shelves """
import re
from itertools import chain
from typing import Any
from bookwyrm import activitypub
from bookwyrm.isbn.isbn import hyphenator_singleton as hyphenator
from bookwyrm.preview_images import generate_edition_preview_image_task
from bookwyrm.settings import (
DEFAU... |
PartDesignTests | TestMirrored | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
chardet | cp949prober | ######################## 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... |
migrations | 0051_remove_verify_premis_checksums | """Migration to remove the "Verify checksums generated on ingest" (Ingest)
micro-service which is redundant. See
https://github.com/artefactual/archivematica/issues/918.
"""
from django.db import migrations
def data_migration(apps, schema_editor):
"""Remove the "Verify checksums generated on ingest" micro-service... |
models | datawarehouse_saved_query | import re
from typing import Dict
from django.core.exceptions import ValidationError
from django.db import models
from posthog.hogql.database.database import Database
from posthog.hogql.database.models import SavedQuery
from posthog.models.team import Team
from posthog.models.utils import CreatedMetaFields, DeletedMet... |
puddlestuff | shortcutsettings | import os
import sys
from PyQt5.QtCore import QEvent, QLineF, QRectF, Qt, pyqtRemoveInputHook
from PyQt5.QtGui import QBrush, QKeySequence, QPainter, QPalette, QPen
from PyQt5.QtWidgets import (
QAbstractItemDelegate,
QAbstractItemView,
QApplication,
QFrame,
QItemDelegate,
QLabel,
QTableWid... |
Path | GuiInit | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
versions | 089_23c92480926e_package_activity_migration_check | # encoding: utf-8
"""package activity migration check
Revision ID: 23c92480926e
Revises: 3537d5420e0e
Create Date: 2019-05-09 13:39:17.486611
"""
from __future__ import print_function
from alembic import op
from ckan.migration.migrate_package_activity import num_unmigrated
# revision identifiers, used by Alembic.
r... |
Debug | DebugHook | import importlib
import logging
import signal
import sys
import gevent
import gevent.hub
from Config import config
from . import Debug
last_error = None
def shutdown(reason="Unknown"):
logging.info("Shutting down (reason: %s)..." % reason)
import main
if "file_server" in dir(main):
try:
... |
extractor | spankwire | from __future__ import unicode_literals
import re
from ..utils import (
float_or_none,
int_or_none,
merge_dicts,
str_or_none,
str_to_int,
url_or_none,
)
from .common import InfoExtractor
class SpankwireIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
... |
app-metrics | sql | from django.conf import settings
from posthog.clickhouse.kafka_engine import KAFKA_COLUMNS_WITH_PARTITION, kafka_engine
from posthog.clickhouse.table_engines import (
AggregatingMergeTree,
Distributed,
ReplicationScheme,
)
from posthog.kafka_client.topics import KAFKA_APP_METRICS
SHARDED_APP_METRICS_TABLE_... |
actions | actionseditors | from gaphor import UML
from gaphor.diagram.instanteditors import instant_editor, popup_entry, show_popover
from gaphor.transaction import Transaction
from gaphor.UML.actions.activity import ActivityParameterNodeItem
from gaphor.UML.actions.activitynodes import ForkNodeItem
@instant_editor.register(ForkNodeItem)
def f... |
lib | tracking | # The contents of this file are subject to the Common Public Attribution
# License Version 1.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://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
meshroom | setup | import os
import platform
import meshroom
import setuptools # for bdist
from cx_Freeze import Executable, setup
currentDir = os.path.dirname(os.path.abspath(__file__))
class PlatformExecutable(Executable):
"""
Extend cx_Freeze.Executable to handle platform variations.
"""
Windows = "Windows"
L... |
sgui | util | import datetime
import os
import sys
from collections import deque
from xml.etree import ElementTree as xmltree
from sglib.hardware.rpi import is_rpi
from sglib.lib.translate import _
from sglib.lib.util import (
CPU_COUNT,
FONTS_DIR,
clear_file_setting,
get_file_setting,
set_file_setting,
)
from s... |
gui | layermodes | # This file is part of MyPaint.
# Copyright (C) 2014 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 your ... |
migrations | 0077_auto_20210623_2155 | # Generated by Django 3.2.4 on 2021-06-23 21:55
import django.contrib.postgres.indexes
import django.contrib.postgres.search
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0076_preview_images"),
]
operations = [
migrations.AddField(... |
twilioapp | gather | import logging
from apps.alerts.constants import ActionSource
from apps.twilioapp.models import TwilioPhoneCall
from common.api_helpers.utils import create_engine_url
from django.urls import reverse
from twilio.twiml.voice_response import Gather, VoiceResponse
logger = logging.getLogger(__name__)
def process_gather... |
snippet | model | # 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
... |
extractor | ellentube | # coding: utf-8
from __future__ import unicode_literals
from ..utils import clean_html, extract_attributes, float_or_none, int_or_none, try_get
from .common import InfoExtractor
class EllenTubeBaseIE(InfoExtractor):
def _extract_data_config(self, webpage, video_id):
details = self._search_regex(
... |
diagram | presentation | from __future__ import annotations
from dataclasses import replace
from math import atan2
import gaphas
from gaphas.connector import ConnectionSink
from gaphas.connector import Connector as ConnectorAspect
from gaphas.connector import Handle, LinePort, Position
from gaphas.constraint import constraint
from gaphas.geo... |
quodlibet | _import | # Copyright 2017 Christoph Reiter
# 2020 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.
impo... |
extractor | hellporno | from __future__ import unicode_literals
from ..utils import int_or_none, merge_dicts, remove_end, unified_timestamp
from .common import InfoExtractor
class HellPornoIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?hellporno\.(?:com/videos|net/v)/(?P<id>[^/]+)"
_TESTS = [
{
"url": "htt... |
image | toc | # -*- Mode: Python; test-case-name: whipper.test.test_image_toc -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Fr... |
versions | 025_b581622ad327_add_authorization_groups | # encoding: utf-8
"""025 Add authorization groups
Revision ID: b581622ad327
Revises: 12981fe12484
Create Date: 2018-09-04 18:48:57.649187
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "b581622ad327... |
chardet | mbcsgroupprober | ######################## 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... |
Models | MachineModelUtils | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING
from UM.Settings.SettingFunction import SettingFunction
if TYPE_CHECKING:
from cura.Machines.QualityGroup import QualityGroup
layer_height_unit = ""
def fetchLayerHeight(quality_gro... |
clientScripts | retry_normalize_remove_normalized | #!/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... |
gaphor | conftest | """Basic test case for Gaphor tests.
Everything is about services so the Case can define it's required
services and start off.
"""
from __future__ import annotations
# isort: skip_file
from io import StringIO
from pathlib import Path
import pytest
# Load gaphor.ui first, so GTK library versions are set corrently
i... |
PyObjCTest | test_nsinputserver | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSInputServerHelper(NSObject):
def doCommandBySelector_client_(self, sel, sender):
pass
def markedTextSelectionChanged_client_(self, sel, sender):
pass
def canBeDisabled(self):
return 1
def wantsToInterpret... |
migrations | 0028_idcommand_unique_enabled | """Make Siegfried the default IDCommand.
We've changed file format identification commands so only one object can be
enabled. This migration makes Siegfried the new default.
"""
from django.db import migrations
def data_migration_up(apps, schema_editor):
IDCommand = apps.get_model("fpr", "IDCommand")
# Disa... |
deluge | metafile | #
# Original file from BitTorrent-5.3-GPL.tar.gz
# Copyright (C) Bram Cohen
#
# Modifications for use in Deluge:
# Copyright (C) 2007 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 porti... |
digital | test_soft_decisions | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
import numpy
from gnuradio import digital
from matplotlib import pyplot
from .psk_constellations import (
psk_4_0,
psk_4_1,
psk_4_2,
... |
neubot | utils_rc | # neubot/utils_rc.py
#
# Copyright (c) 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 General Public Li... |
extractor | redbulltv | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_HTTPError
from ..utils import ExtractorError, float_or_none
from .common import InfoExtractor
class RedBullTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?redbull(?:\.tv|\.com(?:/[^/]+)?(?:/tv)?)(?:/events/[^/]+... |
api | hooks | from typing import cast
from urllib.parse import urlparse
from django.conf import settings
from ee.models.hook import Hook
from posthog.api.routing import StructuredViewSetMixin
from posthog.models.user import User
from posthog.permissions import (
OrganizationMemberPermissions,
TeamMemberAccessPermission,
)
f... |
commands | update_elasticsearch_mappings | """Update Elasticsearch mappings for Archivematica 1.12
This command updates the Elasticsearch mappings for the aips and
aipfiles indices for Archivematica 1.12 to enable sorting on all fields
displayed in the new Archival Storage DataTable and populates the new
filePath.raw subfield in the aipfiles index using an Upd... |
views | slack_channel | from apps.api.serializers.slack_channel import SlackChannelSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.slack.models import SlackChannel
from common.api_helpers.mixins import PublicPrimaryKeyMixin
from common.api_helpers.paginators import HundredPageSizePaginator
from rest_framework import... |
blender | ScenePreview | __version__ = "2.0"
import os.path
from meshroom.core import desc
currentDir = os.path.dirname(os.path.abspath(__file__))
class ScenePreview(desc.CommandLineNode):
commandLine = "{blenderCmdValue} -b --python {scriptValue} -- {allParams}"
size = desc.DynamicNodeSize("cameras")
parallelization = desc.Pa... |
extractor | umg | # coding: utf-8
from __future__ import unicode_literals
from ..utils import int_or_none, parse_filesize, parse_iso8601
from .common import InfoExtractor
class UMGDeIE(InfoExtractor):
IE_NAME = "umg:de"
IE_DESC = "Universal Music Deutschland"
_VALID_URL = (
r"https?://(?:www\.)?universal-music\.de... |
bittorrent | bitfield | # neubot/bittorrent/bitfield.py
#
# The contents of this file are subject to the Python Software Foundation
# License Version 2.3 (the License). You may not copy or use this file, in
# either source code or executable form, except in compliance with the License.
# You may obtain a copy of the License at http://www.py... |
utils | timer | import time
class Timer:
def __init__(self, name="", logger=None):
self.name = name
self.start = time.time()
self.__last = self.start
self.logger = logger
@property
def elapsed(self):
return (time.time() - self.start) * 1000
@property
def last(self):
... |
baseclass | qrcode | # pylint: disable=import-error, no-name-in-module, too-few-public-methods
"""
Generate QRcode of saved addresses in addressbook.
"""
import logging
from kivy.app import App
from kivy.properties import StringProperty
from kivy.uix.screenmanager import Screen
from kivy_garden.qrcode import QRCodeWidget
logger = loggi... |
MegaLight-V4 | CustomRMLayers | from fofix.game.guitarscene import Rockmeter
class CoOpMeter(Rockmeter.Group):
def __init__(self, stage, section):
super(CoOpMeter, self).__init__(stage, section)
self.ySpacingExpr = self.getexpr("yspacing", "0.0")
self.ySpacing = 0.0
self.condition = "True"
def updateLayer(s... |
extractor | funk | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, str_or_none
from .common import InfoExtractor
from .nexx import NexxIE
class FunkIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?funk\.net/(?:channel|playlist)/[^/]+/(?P<display_id>[0-9a-z-]+)-(?P<id>\d+)"
... |
sequencer | header_context_menu | from sglib import constants
from sglib.lib import util
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.math import clip_max, clip_min
from sglib.models import theme
from sglib.models.daw import *
from sgui import shared as sg_shared
from sgui.daw import shared
from sgui.daw.shared import *
fro... |
Gui | Vcarve | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
config-integrations | grafana | # Main
enabled = True
title = "Grafana"
slug = "grafana"
short_description = "Other Grafana"
description = None
is_displayed_on_web = True
is_featured = False
is_able_to_autoresolve = True
is_demo_alert_enabled = True
based_on_alertmanager = True
# Default templates
slack_title = """\
{# Usually title is located in p... |
PyObjCTest | test_cgdisplayfade | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
long
except NameError:
long = int
class TestCGDisplayFade(TestCase):
def testConstants(self):
self.assertEqual(kCGDisplayFadeReservationInvalidToken, 0)
self.assertEqual(kCGDisplayBlendNormal, 0.0)
self.a... |
activity | helpers | # -*- coding: utf-8 -*-
from __future__ import annotations
import datetime
from typing import Any, Optional
import ckan.plugins.toolkit as tk
import jinja2
from ckan.types import Context
from markupsafe import Markup
from . import changes
def dashboard_activity_stream(
user_id: str,
filter_type: Optional[... |
core | amount_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount.core import amount, display_context
from beancount.core.amount import Amount
from beancount.core.number import D
class TestAmount(unittest.TestCase):
def test_constructor(self):
amount = Amou... |
neubot | utils_version | # neubot/utils_version.py
#
# Copyright (c) 2011-2012
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# 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 ... |
examples | snr_estimators | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
try:
import scipy
from scipy import stats
except ImportError:
print("Error: Program requires scipy (www.scipy.org).")
sys.exit(1... |
containerprocessors | pstprocessor | import hashlib
import io
import re
from datetime import datetime
from hashlib import sha256
from os import path, walk
from subprocess import call
from model import AmbarFileContent, AmbarFileMeta
class PstProcessor:
def __init__(self, Logger, ApiProxy):
self.logger = Logger
self.apiProxy = ApiPro... |
sabnzbd | nzbstuff | #!/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... |
extractors | youtube | #!/usr/bin/env python
from xml.dom.minidom import parseString
from ..common import *
from ..extractor import VideoExtractor
class YouTube(VideoExtractor):
name = "YouTube"
# Non-DASH YouTube media encoding options, in descending quality order.
# http://en.wikipedia.org/wiki/YouTube#Quality_and_codecs. ... |
classes | associationpropertypages | from gaphor import UML
from gaphor.core.format import format, parse
from gaphor.diagram.propertypages import (
PropertyPageBase,
PropertyPages,
help_link,
unsubscribe_all_on_destroy,
)
from gaphor.transaction import transactional
from gaphor.UML.classes.association import AssociationItem
from gaphor.UML... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.