section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
migrations | 0108_plugin_organization | # Generated by Django 3.0.6 on 2020-12-16 12:24
import django.db.models.deletion
from django.db import migrations, models
def set_plugin_organization(apps, schema_editor):
Plugin = apps.get_model("posthog", "Plugin")
Organization = apps.get_model("posthog", "Organization")
Plugin.objects.update(organizat... |
devtools | browser | # DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all modules.
#
# CDP version: v0.0.1156692
# CDP domain: Browser
from __future__ import annotations
import enum # noqa
import typing
from dataclasses import dataclass # no... |
plugins | bigo | """
$description Global live streaming platform for live video game broadcasts and individual live streams.
$url live.bigo.tv
$url bigoweb.co
$type live
"""
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import useragents, validate
from streamlink.stream.hls import HLSStream
... |
core | Resource | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Ky?stil? ... |
util | trash | # Copyright 2011 Christoph Reiter
# 2017 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... |
blocks | qa_moving_average | #!/usr/bin/env python
#
# Copyright 2013,2017 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import random
from gnuradio import blocks, gr, gr_unittest
def make_random_complex_tuple(L, scale=1):
result = []
for x in range(L):
... |
Quartz2DBasics | MyView | import math
import AppDrawing
from Cocoa import *
from PyObjCTools import NibClassBuilder
from UIHandling import *
_drawingCommand = kCommandStrokedAndFilledRects
_pdfDocument = None
class MyView(NibClassBuilder.AutoBaseClass):
def drawRect_(self, rect):
context = NSGraphicsContext.currentContext().grap... |
extractor | curiositystream | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import ExtractorError, compat_str, int_or_none, urlencode_postdata
from .common import InfoExtractor
class CuriosityStreamBaseIE(InfoExtractor):
_NETRC_MACHINE = "curiositystream"
_auth_token = None
_API_BASE_URL = "https://a... |
backends | _parser_queue | import time
from threading import RLock
from .. import ports
from ..parser import Parser
from ..py2 import PY2
if PY2:
import Queue as queue
else:
import queue
class ParserQueue:
"""
Thread safe message queue with built in MIDI parser.
This should be available to other backend implementations a... |
saveddata | citadel | # ===============================================================================
# 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, ... |
canto-curses | setup | #!/usr/bin/env python3
import glob
import os
import subprocess
from distutils.command.build_py import build_py
from distutils.command.install_data import install_data
from distutils.core import Extension, setup
string_version = "0.9.9"
class canto_curses_build_py(build_py):
def run(self):
os.utime("cant... |
draftguitools | gui_beziers | # ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
draftmake | make_shapestring | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
order | repeat | # Copyright 2016 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.
from quodlibet import _, print_d
from ... |
utilities | async_force_switch | import asyncio
import functools
async def switch():
"""Coroutine that yields control to the event loop."""
await asyncio.sleep(0)
def force_switch(func):
"""Decorator for forced coroutine switch. The switch will occur before calling the function.
For more information, see the example at the end of ... |
browser | webelem | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Generic web element related code."""
import collections.abc
from typing import TYPE_CHECKING, Dict, Iterator, Optional, Set, Union
from qutebrowser.config import config
from qutebrowser.key... |
RoundTransparentWindow | RoundTransparentWindow | import sys
from math import floor
from Cocoa import *
from PyObjCTools import AppHelper
class Controller(NSObject):
itsWindow = objc.IBOutlet()
@objc.IBAction
def changeTransparency_(self, sender):
"""."""
self.itsWindow.setAlphaValue_(sender.floatValue())
self.itsWindow.display(... |
auth | delete | # encoding: utf-8
import ckan.authz as authz
import ckan.logic as logic
from ckan.common import _
from ckan.logic.auth import get_group_object, get_resource_object
from ckan.types import AuthResult, Context, DataDict
def user_delete(context: Context, data_dict: DataDict) -> AuthResult:
# sysadmins only
retur... |
friture | octavespectrum | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?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 distribu... |
Crypt | CryptBitcoin | import base64
import binascii
import hashlib
import logging
import time
import util.OpensslFindPatch
from Config import config
from util.Electrum import dbl_format
lib_verify_best = "sslcrypto"
from lib import sslcrypto
sslcurve_native = sslcrypto.ecc.get_curve("secp256k1")
sslcurve_fallback = sslcrypto.fallback.ec... |
PyObjCTest | test_cfpropertylist | from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestPropertyList(TestCase):
def testFunctions(self):
dta = CFPropertyListCreateXMLData(
None, {b"key".decode("ascii"): 42, b"key2".decode("ascii"): 1}
)
self... |
team | team_caching | import json
from typing import TYPE_CHECKING, Optional
from django.core.cache import cache
from sentry_sdk import capture_exception
if TYPE_CHECKING:
from posthog.models.team import Team
FIVE_DAYS = 60 * 60 * 24 * 5 # 5 days in seconds
def set_team_in_cache(token: str, team: Optional["Team"] = None) -> None:
... |
deluge-notifications | gtkui | #
# Copyright (C) 2009-2010 Pedro Algarvio <pedro@algarvio.me>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is li... |
daw | item | import copy
import traceback
from sglib import constants
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.log import LOG
from sglib.math import clip_value
from sglib.models.multifx_settings import multifx_settings
from sglib.models.stargate import *
from . import _shared
from .audio_item impo... |
docsrc | offlinezip | # -*- coding: utf-8 -*-
import os
import shutil
import sys
puddlestuff_dir = os.path.join(
os.path.dirname(os.path.dirname(os.path.abspath(__file__))), "source"
)
sys.path.insert(0, puddlestuff_dir)
import puddlestuff
version = puddlestuff.version_string
from glob import glob
from subprocess import call
RST_BA... |
widgets | blink | # 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
... |
parts | artprovider | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2018 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 ver... |
widgets | adsr_main | from sglib import math as sg_math
from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
PMN_TOOLTIP = """\
Default value, "start" is the value at -100 per-note parameter,
"end" is the value at -100 per-note parameter. See the piano roll editor
in the item editor
"""
... |
PyObjCTest | test_nsmethodsignature | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSMethodSignature(TestCase):
def testTypes(self):
o = NSObject.instanceMethodSignatureForSelector_("description")
m = NSMethodSignature.signatureWithObjCTypes_.__metadata__()
self.assertEqual(m["arguments"][2]["type"... |
fofix | setup | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#####################################################################
# #
# Frets on Fire X #
# Copyright (C) 2009-2020 FoFiX Team ... |
comictaggerlib | imagepopup | """A PyQT4 widget to display a popup image"""
# Copyright 2012-2014 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless... |
Arch | ifc_objects | # ***************************************************************************
# * *
# * Copyright (c) 2022 Yorik van Havre <yorik@uncreated.net> *
# * *
# * Th... |
commands | purge_transient_processing_data | """Purge transient processing data.
This command purges package-related data that is generated during processing
from the Archivematica database. In some user workflows, this type of data is
considered discardable as long as the AIPs are successfully stored by the
Archivematica Storage Service.
It can be safely execu... |
gpodder | feedcore | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... |
preferences | documentation | # 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
... |
devscripts | check_porn | #!/usr/bin/env python
from __future__ import unicode_literals
"""
This script employs a VERY basic heuristic ('porn' in webpage.lower()) to check
if we are not 'age_limit' tagging some porn site
A second approach implemented relies on a list of porn domains, to activate it
pass the list filename as the only argument
... |
parsers | mobi | # This file is a part of Lector, a Qt based ebook reader
# Copyright (C) 2017-2019 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 o... |
pages | pages | # -*- coding: utf-8 -*-
# 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... |
resources | integrations | from migrator import oncall_api_client
from migrator.config import (
PAGERDUTY_TO_ONCALL_VENDOR_MAP,
UNSUPPORTED_INTEGRATION_TO_WEBHOOKS,
)
from migrator.utils import find_by_id
def match_integration(integration: dict, oncall_integrations: list[dict]) -> None:
oncall_integration = None
for candidate i... |
parsers | pdfparser | import io
import re
import sys
from jnius import autoclass, cast
from parsers.binarystringparser import BinaryStringParser
from parsers.fileparserresponse import FileParserResponse
from parsers.ocrproxy import OCRProxy, OCRProxyResponse
class PDFParser:
def __init__(
self,
Logger,
OcrSymb... |
versions | 8a6a7662eb37_add_user_preferences_table | """Add user preferences table
Revision ID: 8a6a7662eb37
Revises: f703f911d4ae
Create Date: 2018-11-20 17:02:26.408532
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "8a6a7662eb37"
down_revision = "f703f911d4ae"
branch_labels = None
depends_on = None
def upgra... |
Grady | MyBaseGradientView | from Cocoa import *
class MyBaseGradientView(NSView):
myGradient = objc.ivar()
myStartColor = objc.ivar()
myEndColor = objc.ivar()
forceColorChange = objc.ivar.bool()
myAngle = objc.ivar.double()
myIsRadial = objc.ivar.bool()
myOffsetPt = objc.ivar.NSPoint()
def resetGradient(self):
... |
archiver | prune_cmd | import argparse
import logging
import os
import re
from collections import OrderedDict
from datetime import datetime, timedelta, timezone
from operator import attrgetter
from ..archive import Archive, Statistics
from ..cache import Cache
from ..constants import * # NOQA
from ..helpers import (
ArchiveFormatter,
... |
writer2 | serializer | #!/usr/bin/env python
# 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__ = "restructuredtext en"
import re
import unicodedata
from collecti... |
drafttaskpanels | task_circulararray | # ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
SCL-output | config_control_design | # This file was generated by fedex_python. You probably don't want to edit
# it since your modifications will be lost if fedex_plus is used to
# regenerate it.
import sys
from SCL.AggregationDataTypes import *
from SCL.Builtin import *
from SCL.ConstructedDataTypes import *
from SCL.Rules import *
from SCL.SCLBase im... |
Test | StringHasher | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * Copyright (c) 2023 Mario Passaglia <mpassaglia[at]cbc.uba.ar> *
# * *
# * This file is part of FreeCAD. ... |
clientScripts | save_dublin_core | #!/usr/bin/env python
import json
import sys
import django
django.setup()
from django.db import transaction
# dashboard
from main import models
FIELDS = (
"title",
"is_part_of",
"creator",
"subject",
"description",
"publisher",
"contributor",
"date",
"type",
"format",
"id... |
commands | debug | #
# 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.
#... |
localDrone | mutatedConvert | import math
import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand
from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand
from gui.fitCommands.helpers import DroneInfo, InternalCommandHistory
from ... |
streamlink | cache | import json
import os
import shutil
import tempfile
from contextlib import suppress
from datetime import datetime
from pathlib import Path
from time import time
from typing import Any, Dict, Optional, Union
from streamlink.compat import is_win32
if is_win32:
xdg_cache = os.environ.get("APPDATA", os.path.expanduse... |
mystran | tasks | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | urplay | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
ExtractorError,
ISO639Utils,
dict_get,
int_or_none,
parse_age_limit,
try_get,
unified_timestamp,
)
from .common import InfoExtractor
class URPlayIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)... |
Generator | toolchange | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
aliceVision | SfMDistances | __version__ = "3.0"
from meshroom.core import desc
class SfMDistances(desc.AVCommandLineNode):
commandLine = "aliceVision_sfmDistances {allParams}"
size = desc.DynamicNodeSize("input")
documentation = """
"""
inputs = [
desc.File(
name="input",
label="Input",
... |
draftguitools | gui_edit | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2019, 2020 Carlo Pavan <carlopav@gmail.com> *
# * ... |
qmidi | player | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2011 - 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
... |
widgets | ramp_env | from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
class ramp_env_widget:
def __init__(
self,
a_size,
a_rel_callback,
a_val_callback,
a_port_dict,
a_time_port,
a_amt_port,
a_label=_("Ramp Env"),
... |
output | processing | import re
from typing import List, Optional
from ..context import Environment
from ..plugins import ConverterPlugin
from ..plugins.registry import plugin_manager
MIME_RE = re.compile(r"^[^/]+/[^/]+$")
def is_valid_mime(mime):
return mime and MIME_RE.match(mime)
class Conversion:
@staticmethod
def get_... |
examples | decimate | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
import time
import numpy
from gnuradio import blocks, filter, gr
from gnuradio.fft import window
try:
from gnuradio import analog
excep... |
accounts | backends | import json
from components.helpers import generate_api_key
from django.conf import settings
from django_auth_ldap.backend import LDAPBackend
from django_cas_ng.backends import CASBackend
from josepy.jws import JWS
from mozilla_django_oidc.auth import OIDCAuthenticationBackend
from shibboleth.backends import Shibbolet... |
mylar | filers | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 vers... |
views | organization | from contextlib import suppress
from apps.api.permissions import RBACPermission
from apps.api.serializers.organization import CurrentOrganizationSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.base.messaging import get_messaging_backend_from_id
from apps.mobile_app.auth import MobileAppAuthT... |
forms | models | import datetime
import hashlib
import hmac
import random
import pystache
from flask import g, render_template, render_template_string, url_for
from formspree import settings
from formspree.stuff import DB, TEMPLATES, redis_store
from formspree.users.models import Plan
from formspree.utils import (
IS_VALID_EMAIL,
... |
gui | factoryaction | # This file is part of MyPaint.
# Copyright (C) 2013 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 ... |
versions | 75e8ab9a0014_add_fields_and_fieldentries_tables | """Add Fields and FieldEntries tables
Revision ID: 75e8ab9a0014
Revises: 0366ba6575ca
Create Date: 2020-08-19 00:36:17.579497
"""
import sqlalchemy as sa
from alembic import op # noqa: I001
# revision identifiers, used by Alembic.
revision = "75e8ab9a0014"
down_revision = "0366ba6575ca"
branch_labels = None
depends... |
views | team | from apps.api.permissions import RBACPermission
from apps.api.serializers.team import TeamSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.mobile_app.auth import MobileAppAuthTokenAuthentication
from apps.user_management.models import Team
from common.api_helpers.mixins import PublicPrimaryKey... |
draftguitools | gui_base | # ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
controllers | front | # 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, ... |
extractor | mangomolo | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_b64decode, compat_urllib_parse_unquote
from ..utils import int_or_none
from .common import InfoExtractor
class MangomoloBaseIE(InfoExtractor):
_BASE_REGEX = r"https?://(?:admin\.mangomolo\.com/analytics/index\.php/customers/embed... |
extractor | vidbit | from __future__ import unicode_literals
from ..compat import compat_urlparse
from ..utils import int_or_none, js_to_json, remove_end, unified_strdate
from .common import InfoExtractor
class VidbitIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?vidbit\.co/(?:watch|embed)\?.*?\bv=(?P<id>[\da-zA-Z]+)... |
models | live_setting | from apps.base.utils import LiveSettingValidator
from common.public_primary_keys import (
generate_public_primary_key,
increase_public_primary_key_length,
)
from django.conf import settings
from django.core.validators import MinLengthValidator
from django.db import models
from django.db.models import JSONField
... |
css | csscharsetrule | """CSSCharsetRule implements DOM Level 2 CSS CSSCharsetRule."""
__all__ = ["CSSCharsetRule"]
__docformat__ = "restructuredtext"
__version__ = "$Id$"
import codecs
import xml.dom
import cssrule
import cssutils
class CSSCharsetRule(cssrule.CSSRule):
"""
The CSSCharsetRule interface represents an @charset rule... |
formats | _apev2 | # Copyright 2004-2005 Joe Wreschnig, Michael Urman
#
# 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 mutagen.ape... |
scripts | 4042_fix_resource_extras | # encoding: utf-8
"""
This script fixes resource extras affected by a bug introduced in #3425 and
raised in #4042
#3422 (implemented in #3425) introduced a major bug where if a resource was
deleted and the DataStore was active, extras from all resources on the site
where changed. This is now fixed starting from versio... |
extractor | pinkbike | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, remove_end, remove_start, str_to_int, unified_strdate
from .common import InfoExtractor
class PinkbikeIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:www\.)?pinkbike\.com/video/|es\.pinkbike\.org/i/kvid/kvid-y5\.... |
generateBase | generateDS | #!/usr/bin/env python
## LICENSE
## Copyright (c) 2003 Dave Kuhlman
## Permission is hereby granted, free of charge, to any person obtaining
## a copy of this software and associated documentation files (the
## "Software"), to deal in the Software without restriction, including
## without limitation the rights to us... |
blocks | qa_block_gateway | #
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy
import pmt
from gnuradio import blocks, gr, gr_unittest
class non_sync_block(gr.basic_block):
def __init__(self):
gr.basic_block.__init__(
s... |
cli | rename | #
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to rename blocks """
import re
import click
from ..core import ModToolRename, get_block_candidates, validate_name
from ..tools import SequenceCompleter
from .base import ... |
streamlink-cli | constants | import os
import tempfile
from pathlib import Path
from typing import List
from streamlink.compat import is_darwin, is_win32
from streamlink_cli.compat import DeprecatedPath
DEFAULT_STREAM_METADATA = {
"id": "Unknown ID",
"title": "Unknown Title",
"author": "Unknown Author",
"category": "No Category",... |
classes | marker | """
@file
@brief This file is for legacy support of OpenShot 1.x project files
@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... |
cddagl | launcher | import logging
import os
import sys
import traceback
from io import StringIO
from logging.handlers import RotatingFileHandler
from babel.core import Locale
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
### to avoid import errors when not setting PYTHONPATH
if not getattr(sys, "frozen", False)... |
Test | TestSiteDownload | import os
import time
import gevent
import gevent.event
import mock
import pytest
from Config import config
from Connection import ConnectionServer
from File import FileRequest, FileServer
from Site.Site import Site
from . import Spy
@pytest.mark.usefixtures("resetTempSettings")
@pytest.mark.usefixtures("resetSetti... |
nfoview | schemes | # -*- coding: utf-8 -*-
# Copyright (C) 2008 Osmo Salomaa
#
# 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 pr... |
lib | autodecoder | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
KindleEar网页解码器,综合判断HTTP响应包头,HTML文件META信息,chardet检测编码来解码
对于chardet检测的情况,则通过缓存解码结果到数据库,实现准确性和效率的平衡。
Author: cdhigh <https://github.com/cdhigh>
"""
import re
import chardet
import urlparse
from config import ALWAYS_CHAR_DETECT, TRUST_ENCODING_IN_HEADER_OR_META
from google.... |
Resources | FxBall | """
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... |
plot-tools | pyqt_filter | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_filter.ui'
#
# Created: Thu Mar 17 10:51:17 2011
# by: PyQt4 UI code generator 4.7.4
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui
from PyQt5.Qwt import QwtPlot
class Ui_MainWindow(obje... |
femexamples | ccx_cantilever_beam_rect | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
stargate | project | import collections
import datetime
import glob
import json
import os
import shutil
import tarfile
import tempfile
from sglib import constants
from sglib.constants import MAJOR_VERSION
from sglib.lib import *
from sglib.lib.util import *
from sglib.log import LOG
from sglib.models.project.abstract import AbstractProjec... |
PyObjCTest | test_nssavepanel | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSSavePanelHelper(NSObject):
def panel_shouldShowFilename_(self, p, f):
return 1
def panel_compareFilename_with_caseSensitive_(self, p, f1, f2, i):
return 1
def panel_isValidFilename_(self, p, f):
return 1
... |
Bup | conftest | from __future__ import absolute_import, print_function
import errno
import os
import re
import subprocess
import sys
import tempfile
from os.path import basename, dirname, realpath, relpath
from time import tzset
from traceback import extract_stack
import pytest
sys.path[:0] = ["lib"]
from bup import helpers
from b... |
server | watch_dirs | """
Watched directory handling.
Watched directories are configured in the workflow and start a specific chain
whenever a file or directory is placed in them. They are something we probably
want to remove in future; however, currently they are used extensively in all
workflows, as many chains start the next chain by mo... |
ops | validation | """Validation checks.
These checks are intended to be run after all the plugins have transformed the
list of entries, just before serving them or generating reports from them. The
idea is to ensure a reasonable set of invariants and generate errors if those
invariants are violated. They are not sanity checks--user dat... |
BasicDrawing | BitmapContext | import sys
import AppDrawing
import DrawingBasics
import objc
import Quartz
import Utilities
from LaunchServices import * # kUTType* constants
from Quartz import *
# import Carbon.QT
BEST_BYTE_ALIGNMENT = 16
def COMPUTE_BEST_BYTES_PER_ROW(bpr):
return (int(bpr) + BEST_BYTE_ALIGNMENT - 1) & ~(BEST_BYTE_ALIGNM... |
audio | actor | from __future__ import annotations
import logging
import os
import threading
from typing import TYPE_CHECKING, Any, Callable, Optional, cast
import pykka
from mopidy import exceptions
from mopidy.audio import tags as tags_lib
from mopidy.audio import utils
from mopidy.audio.constants import PlaybackState
from mopidy.... |
VersionUpgrade411to412 | VersionUpgrade411to412 | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
import io
import json
import os.path
from typing import List, Tuple
from UM.VersionUpgrade import VersionUpgrade
class VersionUpgrade411to412(VersionUpgrade):
"""
Upgrades configurations from ... |
PyObjCTest | test_nsuserscripttask | import Foundation
from PyObjCTools.TestSupport import *
NSUserScriptTaskCompletionHandler = b"v@"
NSUserUnixTaskCompletionHandler = b"v@"
NSUserAppleScriptTaskCompletionHandler = b"v@@"
NSUserAutomatorTaskCompletionHandler = b"@@"
class TestNSUserScriptTask(TestCase):
@min_os_level("10.8")
def testMethods10_... |
session-recordings | session_recording_extensions | # EE extended functions for SessionRecording model
import gzip
import json
from datetime import datetime, timedelta
from typing import Optional, cast
import structlog
from django.utils import timezone
from posthog import settings
from posthog.event_usage import report_team_action
from posthog.session_recordings.models... |
tools | random_link | import datetime
import random
import re
import urllib
import bs4
import requests
SITEMAP_URL = "https://pyvideo.org/sitemap.xml"
PATTERN = re.compile(r"^/(?!speaker)(?!tag)(?!events)(?!pages).*/.+$")
def get_video_links():
response = requests.get(SITEMAP_URL)
soup = bs4.BeautifulSoup(response.content, "lxml... |
core | Camera | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.