section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
PyObjCTest | test_nsmovieview | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSMovieView(TestCase):
@onlyOn32Bit
def testConstants(self):
self.assertEqual(NSQTMovieNormalPlayback, 0)
self.assertEqual(NSQTMovieLoopingPlayback, 1)
self.assertEqual(NSQTMovieLoopingBackAndForthPlayback, 2)
@o... |
tornado | stats | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import deque
from tornado import ioloop
class MovingAverage(object):
"""Moving average class implementation"""
def __init__(self, period=10):
"""Constructor.
`period`... |
downloaders | Http | # -*- coding: utf-8 -*-
import fnmatch
import re
import urllib.parse
from pyload.core.network.http.exceptions import BadHeader
from ..base.downloader import BaseDownloader
class Http(BaseDownloader):
__name__ = "Http"
__type__ = "downloader"
__version__ = "0.14"
__status__ = "testing"
__patter... |
utils | sync | #! /usr/bin/python
# Dispatch - synchronize two folders
from __future__ import print_function
import filecmp
import os
import shutil
from stat import *
class Dispatch:
"""This class represents a synchronization object"""
def __init__(self, name=""):
self.name = name
self.node_list = []
... |
sandbox | log2_scale_engine | # -*- coding: utf-8 -*-
# A scale engine for logarithmic (base 10) scales
#
# The step size is measured in *decades*
# and the major step size will be adjusted to fit the pattern
# \f$\left\{ 1,2,3,5\right\} \cdot 10^{n}\f$, where n is a natural number
# including zero.
#
# \warning the step size as well as the margin... |
builtinStatsViews | outgoingViewMinimal | # ===============================================================================
# Copyright (C) 2014 Alexandros Kosiaris
#
# This file is part of pyfa.
#
# pyfa 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... |
api | websocket | import json
import logging
from threading import RLock, Thread, current_thread
from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import unquote_plus, urlparse
from certifi import where as certify_where
from streamlink.logger import TRACE
from streamlink.logger import root as rootlogger
from ... |
gui | toggle_panel | # ===============================================================================
# TogglePanel is based on PyCollapsiblePane - includes a few improvements
# such as adding items to header, lack of button implementation ("GTK
# expander" style is implemented with plain text with unicode arrows rather
# than drawn geome... |
blocks | qa_matrix_interleaver | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2021 Caliola Engineering, LLC.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
from gnuradio import blocks, gr, gr_unittest
class qa_matrix_interleaver(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_b... |
PyObjCTest | test_nsfontdescriptor | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSFontDescriptor(TestCase):
def testConstants(self):
self.assertEqual(NSFontUnknownClass, (0 << 28))
self.assertEqual(NSFontOldStyleSerifsClass, (1 << 28))
self.assert... |
clientScripts | verify_checksums_in_file_sec_of_dspace_mets_files | #!/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... |
PyObjCTest | test_nspanel | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSPanel(TestCase):
def testFunctions(self):
self.assertArgIsPrintf(NSRunAlertPanel, 1)
self.assertArgIsPrintf(NSRunInformationalAlertPanel, 1)
self.assertArgIsPrintf(NSRunCriticalAlertPanel, 1)
self.assertArgIsPri... |
utils | img | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = "GPL v3"
__copyright__ = "2010, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
import os
from calibre.utils.imghdr import what
from PIL import Image
from StringIO import StringIO
def identify_data(data... |
lib | notificationicon | # Pure ctypes windows taskbar notification icon
# via https://gist.github.com/jasonbot/5759510
# Modified for ZeroNet
import ctypes
import ctypes.wintypes
import os
import threading
import time
import uuid
import gevent
try:
from queue import Empty as queue_Empty # Python 3
except ImportError:
from Queue im... |
extractor | metacafe | from __future__ import unicode_literals
import json
import re
from ..compat import compat_parse_qs, compat_urllib_parse, compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
determine_ext,
get_element_by_attribute,
int_or_none,
mimetype2ext,
)
from .common import InfoExtractor
class... |
extractor | odnoklassniki | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import (
compat_etree_fromstring,
compat_parse_qs,
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
qualities,
unescapeHTML,
unified_strdat... |
deluge | generate_pot | #!/usr/bin/env python
#
# Copyright (C) 2011-2013 Calum Lind <calumlind@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 O... |
diagram | _connector | """Gaphas connectors.
This module ties connectors in Gaphas -- on presentation -- to model
level connectors (gaphor.connectors).
"""
import logging
from gaphas.connector import Connector as ConnectorAspect
from gaphas.connector import ItemConnector, LineConnector
from gaphor.core import transactional
from gaphor.cor... |
providers | local | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2015, 2018-2021 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2017 Ville Skyttä
# Copyright (C) 2019-2021 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it un... |
extractors | kakao | #!/usr/bin/env python
from ..common import *
from .universal import *
__all__ = ["kakao_download"]
def kakao_download(url, output_dir=".", info_only=False, **kwargs):
json_request_url = "https://videofarm.daum.net/controller/api/closed/v1_2/IntegratedMovieData.json?vid={}"
# in this implementation playlist... |
rtorrent | tracker | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
KindleUnpack | mobi_sectioner | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import, division, print_function, unicode_literals
import datetime
from .compatibility_utils import PY2, bchar, bord, bstr, hexlify
if PY2:
range = xrange
# note: struct pack, unpack,... |
metadata-store | utils | import random
import time
from faker import Faker
from ipv8.keyvault.crypto import default_eccrypto
from pony.orm import db_session
from tribler.core.components.database.db.tribler_database import (
Operation,
ResourceType,
TriblerDatabase,
)
from tribler.core.components.knowledge.community.knowledge_paylo... |
Test | Document | # ***************************************************************************
# * Copyright (c) 2003 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
scripts | findNonMarket | #!/usr/bin/env python3
import copy
import os.path
import re
import sqlite3
script_dir = os.path.dirname(str(__file__, sys.getfilesystemencoding()))
# Connect to database and set up cursor
db = sqlite3.connect(os.path.join(script_dir, "..", "eve.db"))
cursor = db.cursor()
# Queries to get raw data
QUERY_ALLEFFECTS =... |
postprocessor | ffmpeg | from __future__ import unicode_literals
import os
import re
import subprocess
import time
from ..compat import compat_open as open
from ..utils import (
ISO639Utils,
PostProcessingError,
dfxp2srt,
encodeArgument,
encodeFilename,
get_exe_version,
is_outdated_version,
prepend_extension,
... |
transports | requests_ | import requests as requests
import requests.auth as requestsauth
import xmlrpclib
class RequestsTransport(xmlrpclib.Transport):
def __init__(self, secure, auth=None, proxies=None, verify_ssl=True):
xmlrpclib.Transport.__init__(self)
self.secure = secure
# Construct session
self.s... |
commands | move | #
# 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
import os.path
im... |
messagetypes | message | import logging
logger = logging.getLogger("default")
class MsgBase(object): # pylint: disable=too-few-public-methods
"""Base class for message types"""
def __init__(self):
self.data = {"": type(self).__name__.lower()}
class Message(MsgBase):
"""Encapsulate a message"""
# pylint: disable=... |
subscriptions | slack_subscriptions | from typing import Dict, List
import structlog
from django.conf import settings
from posthog.models.exported_asset import ExportedAsset
from posthog.models.integration import Integration, SlackIntegration
from posthog.models.subscription import Subscription
logger = structlog.get_logger(__name__)
UTM_TAGS_BASE = "ut... |
migrations | 0154_alter_user_preferred_language | # Generated by Django 3.2.14 on 2022-07-15 19:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0153_merge_20220706_2141"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_l... |
migrations | 0032_dashboardsetting_scope | import ast
from django.db import migrations, models
from main.models import DashboardSetting, DashboardSettingManager, Job
def data_migration_atom_to_dict(apps, schema_editor):
"""
Convert old settings into a new DashboardSetting dict, e.g. in the
scenario where the user had the following settings in the... |
femviewprovider | view_mesh_group | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
lector | contentwidgets | # 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... |
port | muta | # =============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# This file is part of pyfa.
#
# pyfa 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 v... |
beetsplug | zero | # This file is part of beets.
# Copyright 2016, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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 limitati... |
oeb | parse_utils | #!/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
from calibre import force_unico... |
Fem | Init | # ***************************************************************************
# * Copyright (c) 2001 Juergen Riegel <juergen.riegel@web.de> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
canto-next | fetch | # -*- coding: utf-8 -*-
# Canto - RSS reader backend
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import json
import l... |
ebooks | BeautifulSoup | """Beautiful Soup
Elixir and Tonic
"The Screen-Scraper's Friend"
http://www.crummy.com/software/BeautifulSoup/
Beautiful Soup parses a (possibly invalid) XML or HTML document into a
tree representation. It provides methods and Pythonic idioms that make
it easy to navigate, search, and modify the tree.
A well-formed X... |
downloaders | FiregetCom | # -*- coding: utf-8 -*-
from ..base.xfs_downloader import XFSDownloader
class FiregetCom(XFSDownloader):
__name__ = "FiregetCom"
__type__ = "downloader"
__version__ = "0.05"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?fireget\.com/(?P<ID>\w{12})/.+"
__config__ = [
("ena... |
digital | qa_costas_loop_cc | #!/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 cmath
import random
from gnuradio import blocks, digital, gr, gr_unittest
from gnuradio.digital import psk
class test_costas_loop_cc(gr_unittest.T... |
core | widgets | import datetime
from typing import Any, Dict, Optional
from django.forms import RadioSelect, widgets
from . import models
class TagsEditor(widgets.Widget):
"""
Custom widget that provides an alternative editor for tags provided by the
taggit library.
The widget makes use of bootstrap v4 and its bad... |
Surface | TestSurfaceApp | # ***************************************************************************
# * *
# * Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
# * *
# * Th... |
PyObjCTest | test_nsfilepresenter | from Foundation import *
from PyObjCTools.TestSupport import *
class Presenter(NSObject):
def relinquishPresentedItemToReader_(self, a):
pass
def relinquishPresentedItemToWriter_(self, a):
pass
def savePresentedItemChangesWithCompletionHandler_(self, a):
pass
def accommodate... |
settings | object_storage | import os
from typing import Optional
from posthog.settings import get_from_env
from posthog.settings.base_variables import DEBUG, TEST
from posthog.utils import str_to_bool
if TEST or DEBUG:
OBJECT_STORAGE_ENDPOINT = os.getenv(
"OBJECT_STORAGE_ENDPOINT", "http://localhost:19000"
)
OBJECT_STORAGE_... |
ui | ui_widget_taglisteditor | # -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TagListEditor(object):
def setupUi(self, TagListEditor):
TagListEditor.setObjectName("TagListEditor")
TagListEditor.resize(400, 300)... |
views | custom_button | from apps.alerts.models import CustomButton
from apps.api.permissions import RBACPermission
from apps.api.serializers.custom_button import CustomButtonSerializer
from apps.auth_token.auth import PluginAuthentication
from common.api_helpers.filters import (
ByTeamModelFieldFilterMixin,
ModelFieldFilterMixin,
... |
PathTests | TestPathGeom | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
extractor | unistra | from __future__ import unicode_literals
import re
from ..utils import qualities
from .common import InfoExtractor
class UnistraIE(InfoExtractor):
_VALID_URL = (
r"https?://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)"
)
_TESTS = [
{
"url": "http://utv.unistra... |
windows | freeze | #! python
# This script freezes Frescobaldi to a standalone application without
# needing to install any dependencies.
#
# Usage:
# C:\Python27\Python freeze.py
#
# How it works:
# It creates, using cx_Freeze, a frescobaldi executable inside the frozen/
# directory, along with all used (manually specified) Python modu... |
blocks | property | """Property item."""
from typing import Sequence, Union
from gaphor import UML
from gaphor.core.modeling.properties import attribute
from gaphor.core.styling import FontWeight, JustifyContent
from gaphor.diagram.presentation import ElementPresentation, Named
from gaphor.diagram.shapes import Box, Text, draw_border
fr... |
blocks | var_to_msg | #!/usr/bin/env python
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import pmt
from gnuradio import gr
class var_to_msg_pair(gr.sync_block):
"""
This block has a callback that will emit a message pair with the updated va... |
femexamples | square_pipe_end_twisted_edgeforces | # ***************************************************************************
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
sabnzbd | skintext | #!/usr/bin/python3 -OO
# -*- coding: UTF-8 -*-
# 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 yo... |
pykakasi | jisyo | # -*- coding: utf-8 -*-
# jisyo.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
import marshal
from zlib import decompress
import cPickle
class jisyo(object):
kanwadict = None
itaijidict = None
kanadict = None
jisyo_table = {}
# this class is Borg
_shared_state = {}
def __new__... |
plugins | bloomberg | """
$description America-based television network centred towards business and capital market programming.
$url bloomberg.com
$type live, vod
$metadata title
"""
import logging
import re
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.... |
chardet | escsm | ######################## 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... |
photos | models | from __future__ import unicode_literals
from pathlib import Path
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import models, transaction
from django.utils import timezone
from photonix.common.models import UUIDModel, VersionedModel
from photonix.web.utils import logge... |
qt | webkitwidgets | # pylint: disable=wildcard-import,no-else-raise
"""Wrapped Qt imports for Qt WebKit Widgets.
All code in qutebrowser should use this module instead of importing from
PyQt/PySide directly. This allows supporting both Qt 5 and Qt 6
(though WebKit is only supported with Qt 5).
See machinery.py for details on how Qt wra... |
Site | SiteAnnouncer | import collections
import hashlib
import random
import re
import time
import gevent
import util
from Config import config
from Debug import Debug
from greenlet import GreenletExit
from Plugin import PluginManager
from util import helper
class AnnounceError(Exception):
pass
global_stats = collections.defaultdic... |
utils | query_date_range | import re
from datetime import datetime
from functools import cached_property
from typing import Dict, Optional
from zoneinfo import ZoneInfo
from dateutil.relativedelta import relativedelta
from posthog.hogql.parser import ast
from posthog.models.team import Team
from posthog.queries.util import get_earliest_timestam... |
ConcurrentLogHandler | stresstest | #!/usr/bin/env python
""" stresstest.py: A stress-tester for ConcurrentRotatingFileHandler
This utility spawns a bunch of processes that all try to concurrently write to
the same file. This is pretty much the worst-case scenario for my log handler.
Once all of the processes have completed writing to the log file, the... |
accounts | FilerNet | # -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
class FilerNet(BaseAccount):
__name__ = "FilerNet"
__type__ = "account"
__version__ = "0.13"
__status__ = "testing"
__description__ = """Filer.net account plugin"""
__license__ = "GPLv3"
__authors__ = [
... |
Scripts | rendezvous | #!/usr/bin/env python
"""
This script using NSNetServiceBrowser to look for local HTTP servers.
"""
import objc
from Foundation import *
class PrintingResolverDelegate(NSObject):
def netServiceDidResolveAddress_(self, service):
addresses = service.addresses()
if len(addresses) == 0:
r... |
gtk3 | torrentdetails | #
# 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 portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""The torrent details compon... |
QT | PantallaTabVFlechas | import copy
from Code import TabVisual, Util, VarGen
from Code.QT import (
Colocacion,
Columnas,
Controles,
FormLayout,
Grid,
Iconos,
QTUtil,
QTUtil2,
QTVarios,
TabFlechas,
Tablero,
TabTipos,
)
from PyQt4 import QtCore, QtGui
def tiposDestino():
li = (
(_("... |
neubot | main_common | # neubot/main_common.py
#
# Copyright (c) 2011 Roberto D'Auria <everlastingfire@autistici.org>
# Copyright (c) 2011-2012 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can re... |
PyObjCTest | test_cgdisplayconfiguration | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
long
except NameError:
long = int
class TestCGDisplayConfiguration(TestCase):
def testTypes(self):
self.assertIsOpaquePointer(CGDisplayConfigRef)
err, config = CGBeginDisplayConfiguration(None)
self.asse... |
src | ExportFileJob | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import io
from typing import List, Optional, Union
from UM.FileHandler.FileHandler import FileHandler
from UM.FileHandler.FileWriter import FileWriter
from UM.FileHandler.WriteFileJob import WriteFileJob
from UM.Logger imp... |
AddonManager | addonmanager_update_all_gui | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
plugins | cdnbg | """
$description Bulgarian CDN hosting live content for various websites in Bulgaria.
$url armymedia.bg
$url bgonair.bg
$url bloombergtv.bg
$url bnt.bg
$url live.bstv.bg
$url i.cdn.bg
$url nova.bg
$url mu-vi.tv
$type live
$region Bulgaria
"""
import logging
import re
from urllib.parse import urlparse
from streamlink.... |
models | fields | from __future__ import annotations
import sys
from typing import (
TYPE_CHECKING,
Any,
Callable,
Generic,
Optional,
TypeVar,
Union,
cast,
overload,
)
from mopidy.types import Uri
if TYPE_CHECKING:
from collections.abc import Iterable
T = TypeVar("T")
TField = TypeVar("TField"... |
metrics | tf_example_parser | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# 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 applica... |
gr | qa_tag_utils | #!/usr/bin/env python
#
# Copyright 2007,2010 Free Software Foundation, Inc.
# Copyright 2021 Marcus Müller
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import pmt
from gnuradio import gr, gr_unittest
class test_tag_utils(gr_unittest.TestCase):
def setUp(self):
se... |
scripting | mouse | # Copyright (C) 2011 Chris Dekter
#
# 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 t... |
util | settings | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# SoundConverter - GNOME application for converting between audio formats.
# Copyright 2004 Lars Wirzenius
# Copyright 2005-2020 Gautier Portet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
views | shift_swap | import logging
from apps.api.permissions import AuthenticatedRequest, IsOwner, RBACPermission
from apps.api.serializers.shift_swap import (
ShiftSwapRequestExpandedUsersListSerializer,
ShiftSwapRequestExpandedUsersSerializer,
ShiftSwapRequestListSerializer,
ShiftSwapRequestSerializer,
)
from apps.auth_... |
events | clock | # Copyright 2006 Joe Wreschnig
# 2016,18 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.
import ... |
posthog | renderers | import math
from typing import Dict, Tuple
from rest_framework.renderers import JSONRenderer
CleaningMarker = bool | Dict[int, "CleaningMarker"]
def clean_data_for_json(data) -> Tuple[CleaningMarker, CleaningMarker]:
"""Replace NaNs and Infinities with None, in-place, marking which fields had to be scrubbed.
... |
async-deletion | delete | from abc import ABC, abstractmethod
from collections import defaultdict
from typing import Dict, List, Tuple
import structlog
from django.utils import timezone
from posthog.models.async_deletion import AsyncDeletion, DeletionType
logger = structlog.get_logger(__name__)
class AsyncDeletionProcess(ABC):
CLICKHOUS... |
neubot | poller | #!/usr/bin/env python
#
# 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 L... |
ClassBrowser | ClassBrowser | """ClassBrowser.py -- A simple class browser, demonstrating the use of an NSBrowser.
To build the demo program, run this line in Terminal.app:
$ python setup.py py2app -A
This creates a directory "dist" containing ClassBrowser.app. (The
-A option causes the files to be symlinked to the .app bundle instead
of cop... |
transport | base | """
raven.transport.base
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
# Helper for external transports
has_newstyle_transports = True
class Transport:
"""
All transport... |
engines | deviantart | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Deviantart (Images)
"""
# pylint: disable=missing-function-docstring
from urllib.parse import urlencode
from lxml import html
# about
about = {
"website": "https://www.deviantart.com/",
"wikidata_id": "Q46523",
"official_api_documentation": "https://www.d... |
prototypes | jsstring | # -*- coding: utf-8 -*-
import re
from .jsregexp import Exec
DIGS = set("0123456789")
WHITE = "\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF"
def replacement_template(rep, source, span, npar):
"""Takes... |
gui | data_notebook | # -*- coding: UTF-8 -*-
# --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.go... |
processor | ffmpeg | #!/usr/bin/env python
import logging
import os
import subprocess
import sys
from ..common import print_more_compatible as print
from ..util.strings import parameterize
try:
from subprocess import DEVNULL
except ImportError:
# Python 3.2 or below
import atexit
import os
DEVNULL = os.open(os.devnu... |
gui-qt | trayicon | from plover import _
from plover import __name__ as __software_name__
from plover import log
from plover.machine.base import (
STATE_ERROR,
STATE_INITIALIZING,
STATE_RUNNING,
STATE_STOPPED,
)
from plover.oslayer.config import PLATFORM
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtGui import ... |
serializers | schedule_calendar | from apps.api.serializers.schedule_base import ScheduleBaseSerializer
from apps.schedules.models import OnCallScheduleCalendar
from apps.schedules.tasks import (
schedule_notify_about_empty_shifts_in_schedule,
schedule_notify_about_gaps_in_schedule,
)
from apps.slack.models import SlackChannel, SlackUserGroup
f... |
extractor | xhamster | # coding: utf-8
from __future__ import unicode_literals
import itertools
import re
from ..compat import compat_str
from ..utils import (
ExtractorError,
clean_html,
determine_ext,
dict_get,
extract_attributes,
float_or_none,
int_or_none,
parse_duration,
str_or_none,
try_get,
... |
chardet | escprober | ######################## 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... |
requests | cookies | # -*- coding: utf-8 -*-
"""
Compatibility code to be able to use `cookielib.CookieJar` with requests.
requests.utils imports from here, so be careful with imports.
"""
import collections
import copy
import time
from .compat import Morsel, cookielib, urlparse, urlunparse
try:
import threading
# grr, pyflak... |
views | annual_summary | """end-of-year read books stats"""
from datetime import date
from uuid import uuid4
from bookwyrm import models
from django.contrib.auth.decorators import login_required
from django.db.models import Avg, Case, Min, Sum, When
from django.http import Http404
from django.shortcuts import redirect
from django.template.res... |
extractor | southpark | # coding: utf-8
from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class SouthParkIE(MTVServicesInfoExtractor):
IE_NAME = "southpark.cc.com"
_VALID_URL = r"https?://(?:www\.)?(?P<url>southpark(?:\.cc|studios)\.com/(?:clips|(?:full-)?episodes|collections)/(?P<id>.+?)(\?|#|$))"
... |
AddonManager | Addon | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
frescobaldi-app | debuginfo | # 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
... |
migrations | 0168_auto_20221205_2331 | """ I added two new permission types and a new group to the management command that
creates the database on install, this creates them for existing instances """
# Generated by Django 3.2.16 on 2022-12-05 23:31
from django.db import migrations
def create_groups_and_perms(apps, schema_editor):
"""create the new "... |
downloaders | MyfastfileCom | # -*- coding: utf-8 -*-
import json
from ..base.multi_downloader import MultiDownloader
class MyfastfileCom(MultiDownloader):
__name__ = "MyfastfileCom"
__type__ = "downloader"
__version__ = "0.16"
__status__ = "testing"
__pattern__ = r"http://\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/dl/"
__config... |
PyObjCTools | MachSignals | """
Substitute for the signal module when using a CFRunLoop.
This module is generally only used to support:
PyObjCTools.AppHelper.installMachInterrupt()
A mach port is opened and registered to the CFRunLoop.
When a signal occurs the signal number is sent in a mach
message to the CFRunLoop. The handler then cause... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.