section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
documents | repository | from __future__ import annotations
from typing import TYPE_CHECKING
import sqlalchemy as sa
from abilian.core.models.subjects import User
from abilian.services.security import READ, Permission, security
from .models import BaseContent, CmisObject, Document, Folder
if TYPE_CHECKING:
from abilian.sbe.app import A... |
queries | column_optimizer | from typing import Counter as TCounter
from typing import Set, cast
from posthog.clickhouse.materialized_columns.column import ColumnName
from posthog.constants import TREND_FILTER_TYPE_ACTIONS, FunnelCorrelationType
from posthog.models.action.util import get_action_tables_and_properties
from posthog.models.filters.mi... |
sabnzbd | SABnzbd | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
thumbor | utils | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import logging
from functools import wraps
from io import BytesIO
f... |
CloudSync | LicensePresenter | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os
from typing import Any, Dict, List, Optional
from cura.CuraApplication import CuraApplication
from PyQt6.QtCore import QObject, pyqtSlot
from UM.i18n import i18nCatalog
from UM.Logger import Logger
from UM.Packag... |
migrations | 0011_mediaconch_validation | import os
from django.db import migrations
HERE = os.path.dirname(os.path.abspath(__file__))
MIGR_DATA = os.path.join(os.path.dirname(HERE), "migrations-data")
VALIDATE_CMD_FNM = os.path.join(MIGR_DATA, "mc_validate_cmd.py")
def data_migration(apps, schema_editor):
"""Create an FPR tool, command, and rule for M... |
Arch | ArchPrecast | # ***************************************************************************
# * Copyright (c) 2016 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
mainwin | funcs | import json
import os
import pickle
from collections import OrderedDict
from PyQt5.QtCore import QByteArray, QMimeData, QObject, pyqtSignal
from PyQt5.QtWidgets import QApplication
from .. import about as about
from .. import actiondlg, findfunc, functions, helperwin, musiclib
from ..audioinfo import DIRPATH, FILETAG... |
insight-log | maintenance_insight_log | import enum
import json
import logging
from .insight_logs_enabled_check import is_insight_logs_enabled
insight_logger = logging.getLogger("insight_logger")
logger = logging.getLogger(__name__)
class MaintenanceEvent(enum.Enum):
STARTED = "started"
FINISHED = "finished"
def write_maintenance_insight_log(in... |
grouptagger | gt_mass | # Copyright (C) 2014 Dustin Spicuzza
#
# 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... |
cssutils | _fetch | """Default URL reading functions"""
__all__ = ['_defaultFetcher']
__docformat__ = 'restructuredtext'
__version__ = '$Id: tokenize2.py 1547 2008-12-10 20:42:26Z cthedot $'
import cssutils
import encutils
import errorhandler
import urllib2
from cssutils import VERSION
log = errorhandler.ErrorHandler()
def _defaultFetc... |
audioinfo | tag_versions | import struct
import mutagen.id3
from mutagen.id3 import ParseID3v1
from . import apev2, id3
APEv2_Tag = apev2.Tag
_v2_nums = set([2, 3, 4])
ID3_V1 = "id3_v1"
ID3_V2 = "id3_v2"
APEv2 = "ape_v2"
TAG_TYPES = [ID3_V1, ID3_V2, APEv2]
def apev2_values(fn):
assert isinstance(fn, str)
return APEv2_Tag(fn).use... |
parts | woodwind | # 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
... |
pwidgets | patterns | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
commandFit | toggleStates | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.commandFit.toggleStates import (
CalcToggleCommandFitStatesCommand,
)
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiToggleCommandFitStatesCommand(wx.Command):... |
channels | phase_noise_gen | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Phase Noise Generator
# Author: mettus
# Generated: Thu Aug 1 11:59:39 2013
##################################################
from gnuradio import analog, blocks, filter, gr
from gnuradio.filter import fird... |
models | session_recording_event | from django.db import models
from django.utils import timezone
from posthog.models.team import Team
# DEPRECATED: PostHog model is no longer supported or used
class SessionRecordingEvent(models.Model):
class Meta:
indexes = [
models.Index(fields=["team_id", "session_id"]),
models.I... |
templatetags | cards | # -*- coding: utf-8 -*-
from datetime import date, datetime, time
from core import models
from django import template
from django.db.models import Avg, Count, Q, Sum
from django.db.models.functions import TruncDate
from django.utils import timezone
from django.utils.translation import gettext as _
register = template... |
PartDesign | TestPartDesignGui | # **************************************************************************
# Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
updater | unix | # neubot/updater/unix.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publi... |
plugins | atresplayer | """
$description Spanish live TV channels from Atresmedia Television, including Antena 3 and laSexta.
$url atresplayer.com
$type live
$region Spain
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.dash import DASHStream
... |
lastfm | rest | # code under public domain
"""
A simple JSON REST request abstraction layer that is used by the
lastfm.client and lastfm.session modules. You shouldn't need to use this.
"""
import os
import re
import socket
import ssl
import sys
import urllib
import httplib
import urlparse
mydir = os.path.dirname(__file__)
try:
... |
models | annotation | from typing import Optional
from django.db import models
from django.utils import timezone
class Annotation(models.Model):
class Scope(models.TextChoices):
INSIGHT = "dashboard_item", "insight"
PROJECT = "project", "project"
ORGANIZATION = "organization", "organization"
class Creatio... |
kibitzr | setup | #!/usr/bin/env python
import os
from setuptools import setup
with open("README.rst", encoding="utf-8") as readme_file:
readme = readme_file.read()
try:
# Might be missing if no pandoc installed
with open("CHANGELOG.rst", encoding="utf-8") as history_file:
history = history_file.read()
except IOE... |
dev | cleanup | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Script to clean up the mess made by Python/setuptools/PyInstaller."""
import fnmatch
import glob
import os
import os.path
import shutil
import sys
sys.path.insert(0,... |
social | restapi | """
NOTE: this code is a legacy from the early days of the application,
and currently not used.
"""
from __future__ import annotations
import json
from abilian.core.extensions import db
from abilian.core.models.subjects import Group, User
from abilian.core.util import get_params
from flask import Blueprint, make_res... |
analog | nbfm_tx | #
# Copyright 2005,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import filter, gr
from . import analog_python as analog
from .fm_emph import fm_preemph
class nbfm_tx(gr.hier_block2):
"""
Narrow Band FM Tr... |
modes | torrentdetail | #
# 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 deluge.com... |
settings | sentry | import logging
import os
import sentry_sdk
from posthog.settings import get_from_env
from posthog.settings.base_variables import TEST
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
... |
digital | qa_ofdm_carrier_allocator_cvc | #!/usr/bin/env python
# Copyright 2012, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
class qa_digital_carrier_allocator_cvc(gr_unittest.TestCase):
def setUp(self):
... |
widgets | restartmessage | # 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
... |
communities | blueprint | from __future__ import annotations
from typing import Any
from abilian.i18n import _l
from abilian.web.action import Endpoint
from abilian.web.nav import BreadcrumbItem
from flask import Blueprint as BaseBlueprint
from flask import g
from werkzeug.exceptions import NotFound
from . import security
from .models import... |
mylar | Failed | # This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that... |
xl | hal | # Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
hogql | timings | from contextlib import contextmanager
from dataclasses import dataclass, field
from time import perf_counter
from typing import Dict, List
from posthog.schema import QueryTiming
from sentry_sdk import start_span
@dataclass
class HogQLTimings:
# Completed time in seconds for different parts of the HogQL query
... |
daw | audio_item | import numpy
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.math import clip_value, db_to_lin, np_resample
from sglib.models.stargate import *
class DawAudioItem(SgAudioItem):
def clip_at_sequence_end(
self, a_sequence_length, a_tempo, a_sample_length_seconds, a_truncate=True
... |
extractors | vimeo | #!/usr/bin/env python
__all__ = [
"vimeo_download",
"vimeo_download_by_id",
"vimeo_download_by_channel",
"vimeo_download_by_channel_id",
]
import urllib.error
import urllib.parse
from json import loads
from ..common import *
from ..extractor import VideoExtractor
from ..util.log import *
access_toke... |
examples | pyqt_const_c | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import blocks, filter, gr
try:
import sip
from gnuradio import qtgui
from PyQt5 import Qt, QtWidgets
except Impor... |
routing | midi | class MIDIRoute:
def __init__(self, a_on, a_track_num, a_device_name, channel=0):
self.on = int(a_on)
self.track_num = int(a_track_num)
self.device_name = str(a_device_name)
self.channel = int(channel)
def __str__(self):
return "|".join(
str(x)
fo... |
QT | Pelicula | from Code.Constantes import *
from Code.QT import FormLayout, Iconos
def paramPelicula(configuracion, parent):
nomVar = "PARAMPELICULA"
dicVar = configuracion.leeVariables(nomVar)
# Datos
liGen = [(None, None)]
# # Segundos
liGen.append((_("Number of seconds between moves") + ":", dicVar.get... |
engines | bandcamp | """
Bandcamp (Music)
@website https://bandcamp.com/
@provide-api no
@results HTML
@parse url, title, content, publishedDate, embedded, thumbnail
"""
from urllib.parse import parse_qs, urlencode, urlparse
from dateutil.parser import parse as dateparse
from lxml import html
from searx.utils import extrac... |
torrentlist | filtersidebar | #
# Copyright (C) 2016 bendikro <bro.devel+deluge@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import curses
import logging
... |
Connection | Connection | import socket
import time
import gevent
try:
from gevent.coros import RLock
except:
from gevent.lock import RLock
from Config import config
from Crypt import CryptConnection
from Debug import Debug
from util import Msgpack, helper
class Connection(object):
__slots__ = (
"sock",
"sock_wr... |
migrations | upgrade43 | """
Migration 43
- Shield booster amplifier tiericide
"""
CONVERSIONS = {
16533: ( # Stalwart Restrained Shield Boost Amplifier
16531, # 5a Prototype Shield Support I
),
16535: ( # Copasetic Compact Shield Boost Amplifier
16529, # Ionic Field Accelerator I
),
}
def upgrade(savedd... |
cmd | drecurse | from __future__ import absolute_import, print_function
import sys
from os.path import relpath
from bup import drecurse, options
from bup.compat import argv_bytes
from bup.helpers import log, parse_excludes, parse_rx_excludes, saved_errors
from bup.io import byte_stream
optspec = """
bup drecurse <path>
--
x,xdev,one... |
prefs | prefs_general | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015-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... |
data | volume | # --------------------------------------------------------------------------
# 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.gov.br
# License: GNU... |
base | simple_downloader | # -*- coding: utf-8 -*-
import os
import re
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.utils import parse
from ..helpers import replace_patterns, search_pattern
from .downloader import BaseDownloader
class SimpleDownloader(BaseDownloader):
__name__ = "SimpleDownloader"
__type... |
feminout | importZ88O2Results | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
ui | ui_options_interface | # -*- 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_InterfaceOptionsPage(object):
def setupUi(self, InterfaceOptionsPage):
InterfaceOptionsPage.setObjectName("InterfaceOptionsPage")
In... |
docs | conf | AUTHOR = "Adrian Sampson"
# General configuration
extensions = ["sphinx.ext.autodoc", "sphinx.ext.extlinks"]
exclude_patterns = ["_build"]
source_suffix = ".rst"
master_doc = "index"
project = "beets"
copyright = "2016, Adrian Sampson"
version = "1.6"
release = "1.6.1"
pygments_style = "sphinx"
# External links ... |
posthog | conftest | from typing import Any, Tuple
import pytest
from django.conf import settings
from infi.clickhouse_orm import Database
from posthog.client import sync_execute
from posthog.test.base import TestMixin, run_clickhouse_statement_in_parallel
def create_clickhouse_tables(num_tables: int):
# Create clickhouse tables to ... |
widgets | downloadprogressbar | import base64
import math
from PyQt5.QtCore import QRect
from PyQt5.QtGui import QColor, QPainter
from PyQt5.QtWidgets import QStyle, QStyleOption, QWidget
from tribler.core.utilities.simpledefs import DownloadStatus
class DownloadProgressBar(QWidget):
"""
The DownloadProgressBar is visible in the download d... |
stpa | controlaction | """Control Action item definition."""
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, Text, draw_border
from gaphor.diagram.support import... |
scripts | directories_test | __copyright__ = "Copyright (C) 2014, 2016-2017 Martin Blais"
__license__ = "GNU GPLv2"
import os
import shutil
import tempfile
import unittest
from os import path
from beancount.scripts import directories
class TestScriptCheckDirectories(unittest.TestCase):
def setUp(self):
self.tmpdir = tempfile.mkdte... |
data | mask | # --------------------------------------------------------------------------
# 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.gov.br
# License: GNU... |
preferences | widgets | # Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
net | stream | # neubot/net/stream.py
#
# There are tons of pylint warnings in this file, disable
# the less relevant ones for now.
#
# pylint: disable=C0111
#
#
# 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.... |
migrations | 0068_auto_20200629_1322 | # Generated by Django 3.0.7 on 2020-06-29 13:22
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0067_team_updated_at"),
]
operations = [
migrations.CreateModel(... |
AddonManager | NetworkManager | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
vidcutter | about | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#######################################################################
#
# VidCutter - media cutter & joiner
#
# copyright © 2018 Pete Alexandrou
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... |
fec | _qa_helper_async | #!/usr/bin/env python
#
# Copyright 2014 Free Software Foundation, Inc.
# Copyright 2023 Daniel Estevez <daniel@destevez.net>
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
# This is similar to _qa_helper.py but uses async_encoder and async_decoder
# instead of extended_encoder an... |
devscripts | make_supportedsites | #!/usr/bin/env python
from __future__ import unicode_literals
import optparse
import os.path
import sys
# Import youtube_dl
dirn = os.path.dirname
sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
import youtube_dl
from utils import write_file
def main():
parser = optparse.OptionParser(usage="%prog OU... |
lib | captcha | # encoding: utf-8
import requests
from ckan.common import config
from ckan.types import Request
def check_recaptcha(request: Request) -> None:
"""Check a user\'s recaptcha submission is valid, and raise CaptchaError
on failure."""
recaptcha_private_key = config.get("ckan.recaptcha.privatekey")
if not... |
settings | ci_test | # flake8: noqa
from .base import *
SECRET_KEY = (
"u5/IIbuiJR3Y9FQMBActk+btReZ5oOxu+l8MIJQWLfVzESoan5REE6UNSYYEQdjBOcty9CDak2X"
)
MIRAGE_SECRET_KEY = (
"V9u7DqZ6SrZHP+SvBT19dbB85NZJGgllpwYQ77BSr9kZ6n8ggXMfGd4sCll1TDcAPEolbVD8YbF"
)
MIRAGE_CIPHER_IV = "X+VFcDqtxJ5bbU+V"
BASE_URL = "http://localhost"
if DATA... |
extractor | gputechconf | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class GPUTechConfIE(InfoExtractor):
_VALID_URL = (
r"https?://on-demand\.gputechconf\.com/gtc/2015/video/S(?P<id>\d+)\.html"
)
_TEST = {
"url": "http://on-demand.gputechconf.com/gtc/2015/video/S5156.... |
ui | ui_provider_options_local | # -*- 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_LocalOptions(object):
def setupUi(self, LocalOptions):
LocalOptions.setObjectName("LocalOptions")
LocalOptions.resize(472, 215)
... |
blocks | pdu_compatibility | #
# Copyright 2021 Jacob Gilbert
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Compatibility layer for transition to gr-pdu. Scheduled for removal in 3.11.
"""
from gnuradio import gr, network, pdu
######## PDU BLOCKS MOVED TO GR-PDU ########
class pdu_filter(pdu.pdu_fil... |
PyObjCTools | KeyValueCoding | """
Support for Key-Value Coding in Python. This provides a simple functional
interface to Cocoa's Key-Value coding that also works for regular Python
objects.
Public API:
setKey(obj, key, value) -> None
setKeyPath (obj, keypath, value) -> None
getKey(obj, key) -> value
getKeyPath (obj, keypath) -> v... |
qtgui | msgpushbutton | #!/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 MsgPushButton(gr.sync_block, Qt.QPushButton):
"""
This block creat... |
extractor | footyroom | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .streamable import StreamableIE
class FootyRoomIE(InfoExtractor):
_VALID_URL = r"https?://footyroom\.com/matches/(?P<id>\d+)"
_TESTS = [
{
"url": "http://footyroom.com/matches/79922154/hull-city... |
PyObjCTest | test_cvimagebuffer | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
class TestCVImageBuffer(TestCase):
def testFunctions(self):
self.assertResultHasType(CVImageBufferGetEncodedSize, CGSize.__typestr__)
self.assertResultHasType(CVImageBufferGetDisplaySiz... |
api | organization_member | from typing import cast
from django.db.models import Model, Prefetch
from django.shortcuts import get_object_or_404
from django_otp.plugins.otp_totp.models import TOTPDevice
from posthog.api.routing import StructuredViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.constants import INTERNAL_... |
supysonic | covers | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2018-2020 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import os.path
import re
import warnings
from os import scandir
from PIL import Image
EXTENSIONS = (".jpg", ".jpe... |
migrations | 0138_automod | # Generated by Django 3.2.12 on 2022-02-24 18:59
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0137_alter_sitesettings_allow_registration"),
]
operations = [
... |
QT | Columnas | import copy
from Code import VarGen
from PyQt4 import QtCore, QtGui
class Columna:
"""
Definicion de cada columna del grid.
"""
def __init__(
self,
clave,
cabecera,
ancho=100,
siCentrado=False,
siDerecha=False,
rgbTexto=None,
rgbFondo=N... |
cura | LayerData | # Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from UM.Mesh.MeshData import MeshData
class LayerData(MeshData):
"""Class to holds the layer mesh and information about the layers.
Immutable, use :py:class:`cura.LayerDataBuilder.LayerDataBuilder` to create one o... |
lib | cookies | # 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, ... |
gaphor | i18n | """Internationalization (i18n) support for Gaphor.
Translate text in to your native language using the gettext() function.
"""
from __future__ import annotations
import functools
import gettext as _gettext
import importlib.resources
import locale
import logging
import os
import sys
import defusedxml.ElementTree as e... |
classes | effect | """
@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... |
stargate | midi_events | from sglib.lib import *
from sglib.lib.util import *
from sglib.math import clip_value
class AbstractMIDIEvent:
def __lt__(self, other):
return self.start < other.start
class MIDINote(AbstractMIDIEvent):
__slots__ = [
"start",
"length",
"velocity",
"pan",
"att... |
qltk | chooser | # Copyright 2017 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import contextlib
import os
from g... |
backfill | gilded_by_subreddit | from collections import defaultdict
from datetime import datetime
from pylons import app_globals as g
from r2.lib.db.operators import desc
from r2.lib.utils import fetch_things2
from r2.models import Comment, Link, Subreddit, calculate_server_seconds
LINK_GILDING_START = datetime(2014, 2, 1, 0, 0, tzinfo=g.tz)
COMMEN... |
deluge-autoadd | core | #
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
# Copyright (C) 2011 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 <dam... |
PyObjCTest | test_nsdecimalnumber | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
bytes
except NameError:
bytes = str
class Behaviour(NSObject):
def exceptionDuringOperation_error_leftOperand_rightOperand_(self, exc, err, l, r):
pass
class TestNSDecimalNu... |
document | ruler | # -*- 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... |
http | ssi | # neubot/http/ssi.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Li... |
widgets | ordered_table | from sglib.lib import util
from sglib.lib.translate import _
from sglib.math import clip_max
from sglib.models import theme
from sgui.sgqt import *
from . import _shared
class OrderedTable(QGraphicsView):
def __init__(
self,
a_item_labels,
a_item_height,
a_item_width,
):
... |
accounts | MultishareCz | # -*- coding: utf-8 -*-
import json
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_account import MultiAccount
class MultishareCz(MultiAccount):
__name__ = "MultishareCz"
__type__ = "account"
__version__ = "0.15"
__status__ = "testing"
__config__ = [
... |
example-idatasetform | plugin | # encoding: utf-8
from __future__ import annotations
import logging
from typing import Any, cast
import ckan.plugins as plugins
import ckan.plugins.toolkit as tk
from ckan.common import CKANConfig
from ckan.types import Context, Schema, Validator, ValidatorFactory
def create_country_codes():
"""Create country_c... |
xlgui | progress | # Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
PyObjCTest | test_nstextcontainer | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSTextContainer(TestCase):
def testConstants(self):
self.assertEqual(NSLineSweepLeft, 0)
self.assertEqual(NSLineSweepRight, 1)
self.assertEqual(NSLineSweepDown, 2)
self.assertEqual(NSLineSweepUp, 3)
self.a... |
downloader | rtsp | from __future__ import unicode_literals
import os
import subprocess
from ..utils import check_executable, encodeFilename
from .common import FileDownloader
class RtspFD(FileDownloader):
def real_download(self, filename, info_dict):
url = info_dict["url"]
self.report_destination(filename)
... |
draftguitools | gui_togglemodes | # ***************************************************************************
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
mopidy | exceptions | class MopidyException(Exception): # noqa: N818
def __init__(self, message, *args, **kwargs):
super().__init__(message, *args, **kwargs)
self._message = message
@property
def message(self):
"""Reimplement message field that was deprecated in Python 2.6."""
return self._messa... |
pynocchio | comic_page_handler | from PyQt5 import QtGui
class ComicPageHandler:
def __init__(self, comic, index=0):
self.comic = comic
self._current_page_index = index
def get_current_page(self):
return self.comic.pages[self.current_page_index]
def go_next_page(self):
raise NotImplementedError("Must sub... |
mobile-app | views | from apps.mobile_app.auth import (
MobileAppAuthTokenAuthentication,
MobileAppVerificationTokenAuthentication,
)
from apps.mobile_app.models import MobileAppAuthToken, MobileAppUserSettings
from apps.mobile_app.serializers import MobileAppUserSettingsSerializer
from fcm_django.api.rest_framework import (
FC... |
utils | format_utils | #
# 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 re
from collections import... |
process | win32 | """Windows service. Requires pywin32."""
import os
import win32api
import win32con
import win32event
import win32service
import win32serviceutil
from cherrypy.process import plugins, wspbus
class ConsoleCtrlHandler(plugins.SimplePlugin):
"""A WSPBus plugin for handling Win32 console events (like Ctrl-C)."""
... |
vendor | flask_principal | # -*- coding: utf-8 -*-
"""
flask_principal
~~~~~~~~~~~~~~~
Identity management for Flask.
:copyright: (c) 2012 by Ali Afshar.
:license: MIT, see LICENSE for more details.
"""
from __future__ import with_statement
__version__ = "0.4.0"
import sys
from collections import deque, namedtuple
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.