section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
raven | middleware | """
raven.middleware
~~~~~~~~~~~~~~~~~~~~~~~~
: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
from contextlib import contextmanager
from raven.utils.compat import Iterator, next
from raven.utils.wsgi i... |
sgui | shared | import datetime
import os
from sglib import constants
from sglib.lib import util
from sglib.log import LOG
from sgui.sgqt import *
AUDIO_ITEM_SCENE_HEIGHT = 900.0
AUDIO_ITEM_SCENE_WIDTH = 3600.0
AUDIO_ITEM_SCENE_RECT = QtCore.QRectF(
0.0,
0.0,
AUDIO_ITEM_SCENE_WIDTH,
AUDIO_ITEM_SCENE_HEIGHT,
)
# Thes... |
mainwin | artwork | # -*- coding: utf-8 -*-
import tempfile
from PyQt5.QtCore import QRect, Qt
from PyQt5.QtGui import QBrush, QFont, QFontMetrics, QPainter
from PyQt5.QtSvg import QSvgGenerator
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QWidget
from ..audioinfo.util import commonimages
from ..constants import BLANK, KEEP, RI... |
cli | archivebox_add | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox add"
import argparse
import sys
from typing import IO, List, Optional
from ..config import ONLY_NEW, OUTPUT_DIR
from ..logging_util import SmartFormatter, accept_stdin, stderr
from ..main import add
from ..parsers import PARSERS
from ..u... |
migrations | 0345_view_link_and_s3_table_update | # Generated by Django 3.2.19 on 2023-08-17 18:32
import django.db.models.deletion
import posthog.models.utils
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0344_add_new_export_type"),
]
operations = ... |
mail | validators | from .exceptions import APIKeyIncludedException
################################################################
# Various types of Validators
################################################################
class ValidateAPIKey(object):
"""Validates content to ensure SendGrid API key is not present"""
rege... |
GraphicsBindings | GraphicsBindingsDocument | #
# GraphicsBindingsDocument.py
# GraphicsBindings
#
# Converted by u.fiedler on feb 2005
# with great help from Bob Ippolito - Thank you Bob!
#
# The original version was written in Objective-C by Malcolm Crawford
# http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
import objc
from Cocoa import *
fro... |
polar | channel_construction | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
[0] Erdal Arikan: 'Channel Polarization: A Method for Constructing Capacity-Achieving Codes for Symmetric Binary-Input Memoryless Channels', 2009
foundational paper for polar codes.
"""
impor... |
web | json_api | #
# Copyright (C) 2009-2010 Damien Churchill <damoxc@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 cgi
import json
imp... |
xl | version | # Copyright (C) 2019 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it w... |
frescobaldi-app | debug | # This module helps with debugging Frescobaldi.
#
# Start a Python shell
# Enter: from frescobaldi_app.debug import *
# This runs Frescobaldi, installs some nice __repr__() methods, connects some
# signals to debug-print functions, and imports the most important modules such
# as app.
import sys
from frescobaldi_app... |
QT | WBG_Summary | import os
from Code import AperturasStd, Partida
from Code.QT import (
Colocacion,
Columnas,
Controles,
Delegados,
FormLayout,
Grid,
Iconos,
QTUtil,
QTUtil2,
QTVarios,
WBG_Comun,
)
from PyQt4 import QtGui
class WSummary(QtGui.QWidget):
def __init__(self, procesador, wi... |
mpris | mpris2 | # Copyright 2010,2012 Christoph Reiter <reiter.christoph@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 option) any later version.
i... |
OpenSCAD | OpenSCADUtils | # ***************************************************************************
# * Copyright (c) 2012 Sebastian Hoogen <github@sebastianhoogen.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
blocks | qa_tags_strobe | #!/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 math
import pmt
from gnuradio import blocks, gr, gr_unittest
class test_tags_strobe(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.to... |
classifiers | base_model | import hashlib
import json
import logging
import os
import random
import shutil
import subprocess
import tempfile
from pathlib import Path
import requests
from photonix.photos.utils.redis import redis_connection
from redis_lock import Lock
graph_cache = {}
logger = logging.getLogger(__name__)
class BaseModel:
... |
mail | open_tracking | class OpenTracking(object):
"""
Allows you to track whether the email was opened or not, by including a
single pixel image in the body of the content. When the pixel is loaded,
we log that the email was opened.
"""
def __init__(self, enable=None, substitution_tag=None):
"""Create an Ope... |
utils | http | """
raven.utils.http
~~~~~~~~~~~~~~~~
: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
import socket
import ssl
import sys
from raven.conf import defaults
from raven.utils.compat import httplib, urllib2... |
processors | offline | # SPDX-License-Identifier: AGPL-3.0-or-later
import threading
from time import time
from searx import logger
from searx.metrology.error_recorder import record_error, record_exception
from searx.search.processors.abstract import EngineProcessor
logger = logger.getChild("search.processor.offline")
class OfflineProce... |
settings | web | # Web app specific settings/middleware/apps setup
import os
from datetime import timedelta
from typing import List
from corsheaders.defaults import default_headers
from posthog.settings.base_variables import BASE_DIR, DEBUG, TEST
from posthog.settings.statsd import STATSD_HOST
from posthog.settings.utils import get_fr... |
TechDraw | InitGui | # ***************************************************************************
# * Copyright (c) 2002,2003 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
View | Setting | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# A GAE web application to aggregate rss and send it to your kindle.
# Visit https://github.com/cdhigh/KindleEar for the latest version
# Contributors:
# rexdf <https://github.com/rexdf>
import gettext
from collections import OrderedDict
import web
from apps.BaseHandler im... |
interface | preferences | #!/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 ... |
formats | xiph | # Copyright 2004-2005 Joe Wreschnig, Michael Urman
# 2009-2014 Christoph Reiter
# 2021 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 o... |
formats | vorbis | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2008, 2012 Lukáš Lalinský
# Copyright (C) 2008 Hendrik van Antwerpen
# Copyright (C) 2008-2010, 2014-2015, 2018-2023 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2012-2014 Wieland Hoffmann
# Cop... |
Sunflower | setup | #!/usr/bin/env python3
from pathlib import Path
from setuptools import find_packages, setup
def molist():
trdir = "translations/"
langs = [x.name for x in Path(trdir).iterdir() if x.is_dir()]
molist = [
(
f"share/locale/{l}/LC_MESSAGES/",
[f"translations/{l}/LC_MESSAGES/s... |
downloaders | MultishareCz | # -*- coding: utf-8 -*-
import json
import pycurl
from ..base.multi_downloader import MultiDownloader
class MultishareCz(MultiDownloader):
__name__ = "MultishareCz"
__type__ = "downloader"
__version__ = "0.49"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?multishare\.cz/stahnout/(?P<... |
Part | TestPartGui | # **************************************************************************
# Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
i18n | po_update | """
This small script creates a POT file ('frescobaldi.pot') for the translations
by extracting all messages from Python source files.
It also creates a POT file ('userguide.pot') for the translation of all
paragraphs of the user guide.
The userguide.pot does not contain translatable strings that also appear in
fres... |
forms | custom_form | """ Overrides django's default form class """
from collections import defaultdict
from django.forms import ModelForm
from django.forms.widgets import Textarea
class StyledForm(ModelForm):
"""add css classes to the forms"""
def __init__(self, *args, **kwargs):
css_classes = defaultdict(lambda: "")
... |
parsers | medium_rss | __package__ = "archivebox.parsers"
from datetime import datetime
from typing import IO, Iterable
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import enforce_types, htmldecode
@enforce_types
def parse_medium_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse Me... |
fec | qa_depuncture | #!/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 collections import deque
from gnuradio import blocks, fec, gr, gr_unittest
class test_depuncture(gr_unittest.TestCase):
def depuncture_setup(self):
... |
Messages | RemovedPrintersMessage | # Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from cura.CuraApplication import CuraApplication
from UM import i18nCatalog
from UM.Message import Message
class RemovedPrintersMessage(Message):
i18n_catalog = i18nCatalog("cura")
def __init__(self, removed_devices... |
parsers | djvu | # 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... |
metrics | arch | import itertools
import os
import re
from apatite.utils import run_cap
from boltons.dictutils import OMD
from boltons.iterutils import first
# from boltons.fileutils import iter_find_files # vendored to include dirs
RG_CMD = "rg"
VERSION_CMD = "vermin"
required_cmds = {
RG_CMD: "install from https://github.co... |
draftmake | make_wpproxy | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
builtinPreferenceViews | pyfaDatabasePreferences | import config
import wx
from eos.db.saveddata.queries import (
clearDamagePatterns,
clearPrices,
clearTargetProfiles,
)
from gui.bitmap_loader import BitmapLoader
from gui.preferenceView import PreferenceView
from gui.utils import helpers_wxPython as wxHelpers
_t = wx.GetTranslation
class PFGeneralPref(P... |
models | faster_rcnn_resnet_v1_feature_extractor | # 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... |
sunflower | toolbar | from __future__ import absolute_import
from gi.repository import Gtk
from sunflower.gui.input_dialog import CreateToolbarWidgetDialog
class ToolbarManager:
"""Manager for toolbar widget factories"""
def __init__(self, application):
self._application = application
self._config = None
... |
core | bind | #
# Copyright 2013, 2018, 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to call bindtool and create Python bindings """
import logging
import os
import subprocess
import warnings
try:
from gnuradio.bindtool import BindingGenera... |
PyObjCLauncher | MyDocument | import os
from AppKit import *
from doscript import doscript
from FileSettings import *
from Foundation import *
from PyObjCTools import NibClassBuilder
class MyDocument(NSDocument):
commandline = objc.IBOutlet()
debug = objc.IBOutlet()
honourhashbang = objc.IBOutlet()
inspect = objc.IBOutlet()
i... |
channels | phase_bal | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: IQ Phase Balancer
# Author: matt@ettus.com
# Generated: Thu Aug 1 11:49:41 2013
##################################################
from gnuradio import blocks, filter, gr
from gnuradio.filter import firdes
... |
lib | fileutils | # This file is part of MyPaint.
# Copyright (C) 2007-2018 by the MyPaint Development Team
# Copyright (C) 2007-2008 by Martin Renold <martinxyz@gmx.ch>
#
# 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 Foun... |
gtk3 | status_tab | #
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import deluge.... |
qtgui | togglebutton | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# 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
from PyQt5 import Qt
class ToggleButton(gr.sync_block, Qt.QPushButton):
"""
This block creat... |
pykakasi | j2h | # -*- coding: utf-8 -*-
# j2h.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original Copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software; y... |
downloaders | SmuleCom | # -*- coding: utf-8 -*-
import re
from pyload.core.utils.misc import eval_js
from ..base.simple_downloader import SimpleDownloader
class SmuleCom(SimpleDownloader):
__name__ = "SmuleCom"
__type__ = "downloader"
__version__ = "0.05"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?smule... |
ui | filemanager | """The file service is responsible for loading and saving the user data."""
from __future__ import annotations
import logging
import tempfile
from functools import partial
from pathlib import Path
from typing import Callable
from gaphas.decorators import g_async
from gaphor import UML
from gaphor.abc import ActionPr... |
meta-architectures | faster_rcnn_meta_arch_test | # 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... |
events | viewlyrics | #
# View Lyrics: a Quod Libet plugin for viewing lyrics.
# Copyright (C) 2008, 2011, 2012 Vasiliy Faronov <vfaronov@gmail.com>
# 2013-17 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
# ... |
clientScripts | trim_create_rights_entries | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 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... |
clickhouse | schema | # This file contains all CREATE TABLE queries, used to sync and test schema
import re
from posthog.clickhouse.dead_letter_queue import *
from posthog.clickhouse.log_entries import (
KAFKA_LOG_ENTRIES_TABLE_SQL,
LOG_ENTRIES_TABLE_MV_SQL,
LOG_ENTRIES_TABLE_SQL,
)
from posthog.clickhouse.plugin_log_entries im... |
extractor | vodpl | # coding: utf-8
from __future__ import unicode_literals
from .onet import OnetBaseIE
class VODPlIE(OnetBaseIE):
_VALID_URL = r"https?://vod\.pl/(?:[^/]+/)+(?P<id>[0-9a-zA-Z]+)"
_TESTS = [
{
"url": "https://vod.pl/filmy/chlopaki-nie-placza/3ep3jns",
"md5": "a7dc3b2f7faa2421aef... |
hardware | rpi | import os
import re
from subprocess import getstatusoutput
from sglib.log import LOG
__all__ = [
"is_rpi",
"gpu_mem",
]
def gpu_mem(
cmd: str = "vcgencmd get_mem gpu",
minimum: int = 256,
) -> bool:
"""Check that Raspberry Pi has allocated enough GPU memory to run a
desktop smoothly
"""
... |
engines | photon | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Photon (Map)
"""
from json import loads
from urllib.parse import urlencode
from searx.utils import searx_useragent
# about
about = {
"website": "https://photon.komoot.de",
"wikidata_id": None,
"official_api_documentation": "https://photon.komoot.de/",
... |
views | mods | import html
import json
import logging
import os
import random
import shutil
import tempfile
import zipfile
from collections import deque
from datetime import datetime
from os import scandir
from urllib.parse import urlencode, urljoin
import cddagl.constants as cons
import rarfile
from cddagl import __version__ as ver... |
migrations | 0002_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import django.db.models.deletion
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("user_management", "0001_squashed_initial"),
("schedules"... |
models | immutable | from __future__ import annotations
import copy
import itertools
import weakref
from typing import Any, ClassVar, Generic, TypeVar
from mopidy.models.fields import Field
T = TypeVar("T", bound="type")
# Registered models for automatic deserialization
_models = {}
class ImmutableObject:
"""Superclass for immuta... |
tasks | social | from __future__ import annotations
from datetime import datetime, timedelta
import html2text
from abilian.core.entities import Entity
from abilian.core.models.subjects import User
from abilian.core.util import md5
from abilian.i18n import render_template_i18n
from abilian.sbe.apps.communities.models import Community
... |
blocks | qa_throttle | #!/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 time
import pmt
from gnuradio import blocks, gr, gr_unittest
class test_throttle(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_bl... |
widgets | search_progress_bar | import time
from PyQt5.QtCore import QTimer, pyqtSignal
from PyQt5.QtWidgets import QProgressBar
from tribler.gui.utilities import connect
MAX_VALUE = 10000
UPDATE_DELAY = 0.5
REMOTE_DELAY = 0.25
class SearchProgressBar(QProgressBar):
ready_to_update_results = pyqtSignal()
def __init__(self, parent=None, t... |
PyObjCTest | test_cfdate | import time
from CoreFoundation import *
from Foundation import NSDate
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestDate(TestCase):
def testTypes(self):
self.assertIsCFType(CFDateRef)
self.assertIsCFType(CFTimeZoneRef)
def testTypeID(self):
... |
lib | locking | import datetime
class NeverExpires(object):
def expired(self):
return False
class Timer(object):
"""
A simple timer that will indicate when an expiration time has passed.
"""
def __init__(self, expiration):
"Create a timer that expires at `expiration` (UTC datetime)"
sel... |
publishers | romeo | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# 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 Licen... |
songsmenu | bookmarks | # Copyright 2006 Joe Wreschnig, 2010 Christoph Reiter
# 2016, 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... |
neubot | stream | # neubot/stream.py
#
# Copyright (c) 2010-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... |
gadgets | indenter | # 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
... |
widgets | channelcontentswidget | from base64 import b64encode
from psutil import LINUX
from PyQt5 import uic
from PyQt5.QtCore import QDir, Qt, QTimer, pyqtSignal
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QAction, QFileDialog
from tribler.core.components.metadata_store.db.orm_bindings.channel_node import (
DIRTY_STATUSES,
NEW,... |
QT | PantallaLearnPGN | import time
from Code import Partida, TrListas, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
FormLayout,
Grid,
Iconos,
PantallaPGN,
QTUtil,
QTUtil2,
QTVarios,
Tablero,
)
from PyQt4 import QtCore, QtGui
class LearnPGNs(Util.DicSQL):
def __init__(self, fic... |
settings | secret_template | # coding: utf-8
### Security key ###
# This is used by django to generate various things (mainly for
# authentication). Just pick a fairly random string and keep it
# secret.
SECRET_KEY = "40@!t4mmh7325-^wh+jo3teu^!yj3lfz5p%ok(8+7th8pg^hy1"
# Database
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
DA... |
PartDesignTests | TestLoft | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
extractor | pr0gramm | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import merge_dicts
from .common import InfoExtractor
class Pr0grammStaticIE(InfoExtractor):
# Possible urls:
# https://pr0gramm.com/static/5466437
_VALID_URL = r"https?://pr0gramm\.com/static/(?P<id>[0-9]+)"
_TEST = {
... |
streamlink | options | from typing import Any, Callable, ClassVar, Dict, Iterator, Mapping, Optional, Sequence, Union
class Options:
"""
For storing options to be used by the Streamlink session and plugins, with default values.
Note: Option names are normalized by replacing "_" with "-".
This means that the keys ``ex... |
clientScripts | load_labels_from_csv | #!/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... |
widgets | trustgraphpage | import math
import numpy as np
import pyqtgraph as pg
from PyQt5 import QtCore
from PyQt5.QtNetwork import QNetworkRequest
from PyQt5.QtWidgets import QWidget
from tribler.gui.defs import (
COLOR_DEFAULT,
COLOR_GREEN,
COLOR_NEUTRAL,
COLOR_RED,
COLOR_ROOT,
COLOR_SELECTED,
HTML_SPACE,
TB,... |
Quartz2DBasics | AppDrawing | import math
from Quartz import *
from UIHandling import *
kOurImageFile = "ptlobos.tif"
# For best performance make bytesPerRow a multiple of 16 bytes.
BEST_BYTE_ALIGNMENT = 16
def COMPUTE_BEST_BYTES_PER_ROW(bpr):
return ((bpr + (BEST_BYTE_ALIGNMENT-1)) & ~(BEST_BYTE_ALIGNMENT-1))
def DEGREES_TO_RADIANS(degrees... |
Plot | Plot | # ***************************************************************************
# * Copyright (c) 2011, 2012 Jose Luis Cercos Pita <jlcercos@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
mpdserver | tcpserver | # Copyright 2014 Christoph Reiter <reiter.christoph@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 option) any later version.
"""A r... |
dataset-tools | create_kitti_tf_record | # 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... |
config | system | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from typing import List, Optional
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_att... |
style | assemble_dataset | import argparse
import os
import shutil
import requests
# Mapping: (class, Name, groups)
STYLE_MAPPING = [
(0, "Bokeh", ["1543486@N25"]),
(1, "Bright", ["799643@N24"]),
(2, "Depth_of_Field", ["75418467@N00", "407825@N20"]),
(3, "Detailed", ["1670588@N24", "1131378@N23"]),
(4, "Ethereal", ["907784@... |
plugins | check_commodity | """A plugin that verifies that all seen commodities have a Commodity directive.
This is useful if you're a bit pedantic and like to make sure that you're
declared attributes for each of the commodities you use. It's useful if you use
the portfolio export, for example.
You can provide a mapping of (account-regexp, cur... |
CuraProfileReader | CuraProfileReader | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
import zipfile
from typing import List, Optional, Tuple
from cura.CuraApplication import CuraApplication
from cura.Machines.ContainerTree import ContainerTree
from cura.ReaderWriters.ProfileReader impor... |
fec | qa_fecapi_cc_buffer_overflow | #!/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
#
#
from gnuradio import analog, blocks, fec, gr, gr_unittest, pdu
# This test tries to checks for the kind of buffer overflows in the
# FECAPI convolutional decoder... |
webdav | views | from __future__ import annotations
import os.path
import uuid
from abilian.core.extensions import db
from abilian.services import get_service
from flask import Blueprint, request
from flask_login import current_user
from lxml.etree import XMLSyntaxError
from werkzeug.datastructures import Headers
from werkzeug.except... |
PyObjCTest | test_nspathutilties | from Foundation import *
from objc import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSPathUtilities(TestCase):
def testSearchPaths(self):
self.assert_(
NSSearchPathForDirectoriesInDomains(
NSAllLibrariesDirectory, NS... |
Op | Helix | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 Lorenz Hüdepohl <dev@stellardeath.org> *
# * *
# * This program is free software; you can redistribute it a... |
ingest | views_NormalizationReport | #!/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, ... |
models | link | # 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_lazy_import | import sys
import objc
import objc._lazyimport as lazyimport
from PyObjCTools.TestSupport import *
if sys.maxsize > 2**32:
def sel32or64(a, b):
return b
else:
def sel32or64(a, b):
return a
class TestLazyImport(TestCase):
def test_exports(self):
self.assertIs(objc.ObjCLazyModul... |
pyobjc-framework-Cocoa | setup | """
Wrappers for the core Cocoa frameworks: CoreFoundation, Foundation and
AppKit.
These wrappers don't include documentation, please check Apple's documention
for information on how to use these frameworks and PyObjC's documentation
for general tips and tricks regarding the translation between Python
and (Objective-)... |
migrations | 0040_directory_model | import main.models
from django.db import migrations, models
def data_migration(apps, schema_editor):
"""Creates the ``Directory`` model, primarily so that directories can be
assigned UUIDs and can be documented in the METS.
This migration modifies the workflow so that there are two new
micro-services... |
downloaders | NosuploadCom | # -*- coding: utf-8 -*-
import re
from ..base.xfs_downloader import XFSDownloader
class NosuploadCom(XFSDownloader):
__name__ = "NosuploadCom"
__type__ = "downloader"
__version__ = "0.38"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?nosupload\.com/\?d=\w{12}"
__config__ = [
... |
config-integrations | grafana_alerting | # Main
enabled = True
title = "Grafana Alerting"
slug = "grafana_alerting"
short_description = "Your current Grafana Cloud stack. Automatically create an alerting contact point and a route in Grafana"
description = None
is_displayed_on_web = True
is_featured = True
featured_tag_name = "Quick Connect"
is_able_to_autores... |
mutagenext | compatid3 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2005 Michael Urman
# Copyright (C) 2006-2008, 2011-2012 Lukáš Lalinský
# Copyright (C) 2013-2014 Sophist-UK
# Copyright (C) 2013-2014, 2018, 2020-2021 Laurent Monin
# Copyright (C) 2014, 2018-2021 Philipp Wolfer
# Copyright (C)... |
PathTests | TestPathToolBit | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
frescobaldi-app | about | # 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
... |
v1 | flags | from typing import List
from CTFd.api.v1.helpers.request import validate_args
from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic
from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse
from CTFd.constants import RawEnum
from CTFd.models import Flags, db
from CTFd.plugins.flags im... |
draftviewproviders | view_clone | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
diagram | copypaste | """Copy and paste data based on an element's `save()` and `load()` methods.
The `copy()` function will return all values serialized, either as string
values or reference id's.
The `paste_link()` function will resolve those values and place instances of
them on the diagram using the same defining element.
The `paste_f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.