section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
modeling | elementdispatcher | """"""
from __future__ import annotations
import logging
from gaphor.abc import Service
from gaphor.core import event_handler
from gaphor.core.modeling.element import Element, Handler
from gaphor.core.modeling.event import (
AssociationAdded,
AssociationDeleted,
AssociationSet,
ElementUpdated,
Mo... |
commands | start_telegram_polling | import logging
import telegram.error
from apps.telegram.client import TelegramClient
from apps.telegram.updates.update_manager import UpdateManager
from django.core.management.base import BaseCommand
from telegram.ext import CallbackQueryHandler, Filters, MessageHandler, Updater
logger = logging.getLogger(__name__)
l... |
extractor | freshlive | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none, try_get, unified_timestamp
from .common import InfoExtractor
class FreshLiveIE(InfoExtractor):
_VALID_URL = r"https?://freshlive\.tv/[^/]+/(?P<id>\d+)"
_TEST = {
"u... |
PyObjCTest | test_nsinvocation | import Foundation
from Foundation import *
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestNSInvocation(TestCase):
def test_dummy(self):
value = NSMutableArray.arrayWithArray_([1, 2, 3])
invocation = NSInvocation.invocationWithMethodSignature_(
... |
admin | views_pages | #
# Quru Image Server
#
# Document: views_pages.py
# Date started: 11 Aug 2011
# By: Matt Fozard
# Purpose: Administration web page URLs and views
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
... |
planet | cache | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""Item cache.
Between runs of Planet we need somewhere to store the feed information
we parsed, this is so we don't lose information when a particular feed
goes away or is too short to hold enough items.
This module provides the code to handle this cache transparently en... |
example-blanket-implementation | plugin | # -*- coding: utf-8 -*-
import ckan.plugins as p
import ckan.plugins.toolkit as tk
import ckanext.example_blanket_implementation.views as views
from ckanext.example_blanket_implementation.logic import action, auth
from ckanext.example_blanket_implementation.logic.validators import is_blanket
_validators = {"is_blanke... |
plugins | ard_live | """
$description Live TV channels and video on-demand service from ARD, a German public, independent broadcaster.
$url daserste.de
$type live, vod
$metadata title
$region Germany
"""
import logging
import re
from urllib.parse import urljoin
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streaml... |
KindleUnpack | mobi_uncompress | #!/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
from .compatibility_utils import PY2, bchr, bstr, lmap
if PY2:
range = xrange
import struct
# note: struct pack, unpack, unpack_from... |
pdu | qa_take_skip_to_pdu | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018-2021 National Technology & Engineering Solutions of Sandia, LLC
# (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government
# retains certain rights in this software.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import time
fro... |
ui | hostlist | #
# Copyright (C) Calum Lind 2017 <calumlind+deluge@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import os
im... |
lib | jsonresponse | # 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, ... |
beets | logging | # This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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, ... |
OLD | mlinear | from collections import Counter
from pylab import *
from scipy.optimize.optimize import fmin_bfgs
###
### Helper classes.
###
class Err:
def __init__(self,n=10000):
self.n = n
self.total = 0.0
self.count = 0
def add(self,x):
l = 1.0/self.n
self.total = (self.total*(1.0... |
i18n | md2pot | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 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
... |
femexamples | material_nl_platewithhole | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com *
# * *
# * Th... |
draftobjects | patharray | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2013 WandererFan <wandererfan@gmail.com> *
# * Co... |
scripts | upload_static_files_to_s3 | #!/usr/bin/python
# 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
# Lic... |
saveddata | cargo | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
downloaders | Ftp | # -*- coding: utf-8 -*-
import re
import urllib.parse
import pycurl
from pyload.core.utils import parse
from ..base.downloader import BaseDownloader
class Ftp(BaseDownloader):
__name__ = "Ftp"
__type__ = "downloader"
__version__ = "0.61"
__status__ = "testing"
__pattern__ = r"(?:ftps?|sftp)://(... |
neubot | utils_random | # neubot/utils_random.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... |
PyObjCTest | test_cfstring | import array
import sys
import AppKit
import CoreFoundation
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
try:
unichr
except NameError:
unichr = chr
try:
from Foundation import __NS... |
digital | qa_hdlc_framer | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from time import sleep
import numpy
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
class test_hdlc_framer(gr_unittest.Te... |
tools | plugin_tool | #!/usr/bin/env python3
import os
import re
import sys
from os.path import abspath, dirname, exists, join
v_re1 = re.compile(r"^Version='(.*)'$")
v_re2 = re.compile(r'^Version="(.*)"$')
def _find_bad_plugin_versions(plugins_dir):
for pname in os.listdir(plugins_dir):
p = join(plugins_dir, pname, "PLUGINI... |
common | accurip | # -*- Mode: Python; test-case-name: whipper.test.test_common_accurip -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2017 Samantha Baldwin
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... |
profiles | extensionconnect | from gaphor import UML
from gaphor.diagram.connectors import Connector, DirectionalRelationshipConnect
from gaphor.diagram.presentation import Classified
from gaphor.UML.profiles.extension import ExtensionItem
from gaphor.UML.recipes import owner_package
@Connector.register(Classified, ExtensionItem)
class ExtensionC... |
compression | palmdoc | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = "GPL v3"
__copyright__ = "2008, Kovid Goyal <kovid at kovidgoyal.net>"
from struct import pack
from cStringIO import StringIO
# from calibre.constants import plugins
# cPalmdoc = plugins['cPalmdoc'][0]
# if not cPalmdoc:
# ra... |
tz | tz | # -*- coding: utf-8 -*-
"""
This module offers timezone implementations subclassing the abstract
:py:`datetime.tzinfo` type. There are classes to handle tzfile format files
(usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ
environment string (in all known formats), given ranges (with help fr... |
serializers | custom_button | from collections import defaultdict
from apps.alerts.models import CustomButton
from apps.base.utils import live_settings
from common.api_helpers.custom_fields import TeamPrimaryKeyRelatedField
from common.api_helpers.utils import (
CurrentOrganizationDefault,
CurrentTeamDefault,
URLValidatorWithoutTLD,
)
... |
extractor | moviezine | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class MoviezineIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?moviezine\.se/video/(?P<id>[^?#]+)"
_TEST = {
"url": "http://www.moviezine.se/video/205866",
"info_dict": {
"id... |
mutagenext | aac | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2018-2019 Philipp Wolfer
# Copyright (C) 2020-2021 Laurent Monin
#
# 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 Softwar... |
bup | git | """Git interaction library.
bup repositories are in Git format. This library allows us to
interact with the Git data structures.
"""
import glob
import os
import re
import stat
import struct
import subprocess
import sys
import zlib
from array import array
from binascii import hexlify, unhexlify
from collections import... |
awesome-slugify | main | # coding=utf8
import sys
import regex as re
from unidecode import unidecode
# Don't set regex.DEFAULT_VERSION to regex.VERSION1 cause
# this option will influence on 3rd party libs. E.g. `mailgun` and `flanker`.
# Use regex.VERSION1 regex flag.
# re.VERSION1 - New enhanced behaviour with nested sets and set operati... |
scripts | check_examples_test | """Just make sure that all the example files can be processed without errors.
"""
__copyright__ = "Copyright (C) 2015-2016 Martin Blais"
__license__ = "GNU GPLv2"
import os
import unittest
from os import path
from beancount.scripts import check
from beancount.utils import test_utils
def find_example_files():
"... |
trends | sql | VOLUME_SQL = """
SELECT
{aggregate_operation} AS total,
{timestamp_truncated} AS date
{event_query_base}
GROUP BY date
"""
VOLUME_AGGREGATE_SQL = """
SELECT {aggregate_operation} AS total
{event_query_base}
"""
VOLUME_PER_ACTOR_SQL = """
SELECT {aggregate_operation} AS total, date FROM (
SELECT
co... |
vidcutter | videolist | #!/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... |
filters | retention_filter | import json
from typing import Any, Dict, Optional, Tuple, Union
from posthog.constants import INSIGHT_RETENTION
from rest_framework.request import Request
from .base_filter import BaseFilter
from .mixins.common import (
BreakdownMixin,
ClientQueryIdMixin,
DisplayDerivedMixin,
FilterTestAccountsMixin,... |
core | utils | #!/usr/bin/python
# -*- coding: utf-8 -*-
import functools
import warnings
import six
def deprecated(deprecated_in=None, removed_in=None, details=""):
"""Decorator for deprecation
See https://pypi.org/project/deprecation/
"""
def _function_wrapper(func):
@functools.wraps(func)
def ... |
mylar | webviewer | import os
import re
import stat
import zipfile
import cherrypy
import mylar
from lib.rarfile import rarfile
try:
from PIL import Image
except ImportError:
logger.debug(
"WebReader Requested, but PIL or pillow libraries must be installed. Please execute 'pip install pillow', then restart Mylar."
)
... |
errorreport | logdump | # 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 os
import platform
import sy... |
models | user | import datetime
import json
import logging
import typing
from urllib.parse import urljoin
import pytz
from apps.api.permissions import (
LegacyAccessControlCompatiblePermission,
LegacyAccessControlRole,
RBACPermission,
user_is_authorized,
)
from apps.schedules.tasks import drop_cached_ical_for_custom_e... |
imageserver | api_util | #
# Quru Image Server
#
# Document: api_util.py
# Date started: 06 Dec 2011
# By: Matt Fozard
# Purpose: Developer API public interface definitions and utilities
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or mod... |
beetsplug | mbcollection | # This file is part of beets.
# Copyright (c) 2011, Jeffrey Aylesworth <mail@jeffrey.red>
#
# 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... |
contrib | rcssmin | #!/usr/bin/env python
# -*- coding: ascii -*-
#
# Copyright 2011, 2012
# Andr\xe9 Malo or his licensors, as applicable
#
# 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.apach... |
logic | action | # encoding: utf-8
from __future__ import annotations
import datetime
import json
import logging
import time
from typing import Any
from urllib.parse import urljoin
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions
import ckan.logic as logic
import ckan.plugins as p
import ckanext.datapusher.inte... |
PyObjCTest | test_nsdragging | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSDraggingHelper(NSObject):
def draggingFormation(self):
return 1
def setDraggingFormation(self, v):
return 1
def animatesToDestination(self):
return 1
def setAnimatesToDestination_(self, v):
return... |
utilities | unicode | """
Conversions to unicode.
Author(s): Arno Bakker
"""
import binascii
import chardet
def ensure_unicode(s, encoding, errors="strict"):
"""Similar to six.ensure_text() except that the encoding parameter is *not* optional"""
if isinstance(s, bytes):
return s.decode(encoding, errors)
elif isinstan... |
PyObjCTest | test_callbacks | import objc
from PyObjCTools.TestSupport import *
objc.registerMetaDataForSelector(
b"OC_CallbackTest",
b"selWithSEL:SEL:andObject:",
{
"arguments": {
2: {
"sel_of_type": b"q@:q",
},
3: {
"sel_of_type": b"v@:@@^v",
},
... |
web | application | """
Web application
(from web.py)
"""
import itertools
import os
import sys
import traceback
import types
import urllib
import debugerror
import httpserver
import utils
import webapi
import webapi as web
import wsgi
from exceptions import SystemExit
from utils import lstrips, safeunicode
try:
import wsgiref.handl... |
communities | forms | from __future__ import annotations
import imghdr
import sqlalchemy as sa
from abilian.core.models.subjects import Group
from abilian.web.forms import Form
from abilian.web.forms.fields import FileField, Select2Field
from abilian.web.forms.validators import length
from abilian.web.forms.widgets import BooleanWidget, I... |
plugins | theme_default | # Canto Default Theme
# Defined as a plugin to use as a base for other themes.
FORCE_COLORS = False
FORCE_STYLE = False
from canto_next.plugins import check_program
check_program("canto-curses")
from canto_curses.color import cc
from canto_curses.story import StoryPlugin
from canto_curses.tag import TagPlugin
from... |
Code | GestorPerson | from Code import DGT, Apertura, GestorEntMaq, Jugada, Util, VarGen, XMotorRespuesta
from Code.Constantes import *
from Code.QT import Iconos, PantallaEntMaq, QTUtil2
class GestorPerson(GestorEntMaq.GestorEntMaq):
def inicio(self, dic, aplazamiento=None, siPrimeraJugadaHecha=False):
if aplazamiento:
... |
migrations | 0042_directory_uuids_all_transfer_types | from django.db import migrations
def data_migration(apps, schema_editor):
"""Creates "Assign UUIDs to Directories" micro-service chain links for the
remaining four transfer types. The migration at 0040_directory_model
incorrectly only created the relevant links for Standard transfer types.
This adds t... |
serializers | escalation_chain | from apps.alerts.models import EscalationChain
from common.api_helpers.custom_fields import TeamPrimaryKeyRelatedField
from common.api_helpers.utils import CurrentOrganizationDefault, CurrentTeamDefault
from rest_framework import serializers
class EscalationChainSerializer(serializers.ModelSerializer):
id = seria... |
downloaders | GetTwentyFourOrg | # -*- coding: utf-8 -*-
import json
import pycurl
from ..base.multi_downloader import MultiDownloader
class GetTwentyFourOrg(MultiDownloader):
__name__ = "GetTwentyFourOrg"
__type__ = "downloader"
__version__ = "0.04"
__status__ = "testing"
__pattern__ = r"^unmatchable$"
__config__ = [
... |
downloaders | FilerioCom | # -*- coding: utf-8 -*-
from ..base.xfs_downloader import XFSDownloader
class FilerioCom(XFSDownloader):
__name__ = "FilerioCom"
__type__ = "downloader"
__version__ = "0.14"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?filerio\.(in|com)/\w{12}"
__config__ = [
("enabled",... |
plotting | frequency_scales | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Clo Yun-Hee Dufour
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is dist... |
accounts | DebridplanetCom | # -*- coding: utf-8 -*-
import hashlib
import json
import time
import pycurl
from pyload.core.utils.convert import to_bytes
from ..base.multi_account import MultiAccount
class DebridplanetCom(MultiAccount):
__name__ = "DebridplanetCom"
__type__ = "account"
__version__ = "0.01"
__status__ = "testing... |
preferences | helpers | # 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
... |
preferences | paths | # 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
... |
snippet | edit | # 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
... |
clientScripts | archivematica_clamscan | #!/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... |
devel | example_pubsub | # Publisher and subscriber design pattern example.
# More information about this design pattern can be found at:
# http://wiki.wxpython.org/ModelViewController
# http://wiki.wxpython.org/PubSub
from invesalius.pubsub import pub as Publisher
# The maintainer of Pubsub module is Oliver Schoenborn.
# Since the end of 20... |
utils | variables_helper_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... |
equations | flow | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2022 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * Th... |
musicview | contextmenu | # 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
... |
QT | PantallaSingularM | from Code import SingularMoves
from Code.QT import Colocacion, Columnas, Controles, Grid, Iconos, QTUtil2, QTVarios
class WSingularM(QTVarios.WDialogo):
def __init__(self, owner, configuracion):
self.configuracion = configuracion
titulo = "%s: %s" % (_("Singular moves"), _("Calculate your strength... |
model | package | # encoding: utf-8
from __future__ import annotations
import datetime
import logging
from typing import TYPE_CHECKING, Any, ClassVar, Iterable, Optional
import ckan.lib.maintain as maintain
import ckan.model.core as core
import ckan.model.domain_object as domain_object
import ckan.model.license as _license
import ckan... |
migrations | 0030_rights_import | from django.db import migrations
def data_migration(apps, schema_editor):
StandardTaskConfig = apps.get_model("main", "StandardTaskConfig")
TaskConfig = apps.get_model("main", "TaskConfig")
MicroServiceChainLink = apps.get_model("main", "MicroServiceChainLink")
MicroServiceChainLinkExitCode = apps.get... |
core | realization_test | """Unit tests for realizations.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import copy
import datetime
import operator
import unittest
from beancount import loader
from beancount.core import (
account_types,
data,
display_context,
inventory,
position,
... |
extractor | thescene | from __future__ import unicode_literals
from ..compat import compat_urlparse
from .common import InfoExtractor
class TheSceneIE(InfoExtractor):
_VALID_URL = r"https?://thescene\.com/watch/[^/]+/(?P<id>[^/#?]+)"
_TEST = {
"url": "https://thescene.com/watch/vogue/narciso-rodriguez-spring-2013-ready-to... |
src | DigitalFactoryProjectModel | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, Optional
from PyQt6.QtCore import Qt, pyqtSignal
from UM.Logger import Logger
from UM.Qt.ListModel import ListModel
from .DigitalFactoryProjectResponse import DigitalFactoryProjectResponse
PROJECT... |
src | debug | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
# This is the debug module: tools to debug MusicPlayer.
# This is... |
gstreamer | pitch | # Copyright 2012 Christoph Reiter
# 2018 Ludovic Druette
#
# 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.
fr... |
mobile-app | models | from __future__ import annotations # https://stackoverflow.com/a/33533514
import typing
from apps.auth_token import constants, crypto
from apps.auth_token.models import BaseAuthToken
from apps.mobile_app.types import MessageType, Platform
from django.core import validators
from django.db import models
from django.ut... |
borg | archive | import base64
import json
import os
import stat
import sys
import time
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
from datetime import timedelta
from functools import partial
from getpass import getuser
from io import BytesIO
from itertools import groupby, zip_longest
from sh... |
saveddata | user | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
slack | test_slack_message | from unittest.mock import patch
import pytest
from apps.slack.client import SlackClient
from apps.slack.errors import SlackAPIError
from apps.slack.tests.conftest import build_slack_response
@pytest.fixture
def slack_message_setup(
make_organization_and_user_with_slack_identities,
make_alert_receive_channel,... |
widgets | imageviewer | # 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
... |
filter | qa_hilbert | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import blocks, fft, filter, gr, gr_unittest
def sig_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_... |
scorewiz | settings | # 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
... |
hogql | ai | from typing import TYPE_CHECKING, Optional
import openai
from posthog.event_usage import report_user_action
from posthog.hogql.context import HogQLContext
from posthog.hogql.errors import HogQLException
from posthog.hogql.parser import parse_select
from posthog.hogql.printer import print_ast
from posthog.utils import ... |
PyObjCTest | test_corefoundation | """
Testcases for the CoreFoundation wrappers introduced in 1.5
"""
import re
import sys
import objc
from PyObjCTest.corefoundation import *
from PyObjCTools.TestSupport import *
# registerCFSignature(name, encoding, typeId [, tollfreeName]) -> type
CFUUIDRef = objc.registerCFSignature(
"CFUUIDRef",
OC_TestC... |
songsmenu | exact_rating | # Copyright 2014 Jan Path
# 2014 Christoph Reiter
# 2016 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option... |
ckan | common | # encoding: utf-8
# This file contains commonly used parts of external libraries. The idea is
# to help in removing helpers from being used as a dependency by many files
# but at the same time making it easy to change for example the json lib
# used.
#
# NOTE: This file is specificaly created for
# from ckan.common i... |
PyObjCTest | test_cfattributedstring | from CoreFoundation import *
from Foundation import NSCFAttributedString
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestAttributedString(TestCase):
def testTypes(self):
try:
NSCFAttributedString = objc.lookUpClass("__NSCFAttributedString")
... |
plotting | canvasWidget | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Timothée Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distri... |
uic-files | not_found_dialog_ui | # Form implementation generated from reading ui file 'forms/not_found_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.11.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from . import main_window_view_rc
class Ui_NotFoundDialog(object):
def setupUi(self,... |
PyObjCTest | test_nsurlconnection | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSURLConnectionHelper(NSObject):
def connection_canAuthenticateAgainstProtectionSpace_(self, a, b):
return 1
def connectionShouldUseCredentialStorage_(self, a):
return 1
def connection_didSendBodyData_totalBytesWrit... |
extractor | ora | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urlparse
from ..utils import get_element_by_attribute, qualities, unescapeHTML
from .common import InfoExtractor
class OraTVIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?(?:ora\.tv|unsafespeech\.com)/(... |
qtgui | levelgauge | #!/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 sys
from threading import Lock
import pmt
from gnuradio import gr
from PyQt5.QtCore import Qt as Qtc
from PyQt5.QtCore import pyqt... |
modeling | event | """The core modeling events."""
from gaphor.event import ServiceEvent
class RevertibleEvent:
"""Base type for all events that can be reversed.
This event can be used as "low level" event for anything that should
be revertible/undoable.
"""
requires_transaction = True
def __init__(self, elem... |
migrations | 0006_auto_20200221_1702_squashed_0064_merge_20201101_1913 | # Generated by Django 3.0.7 on 2020-11-03 00:05
import uuid
import bookwyrm.models.connector
import bookwyrm.models.site
import django.contrib.postgres.operations
import django.core.validators
import django.db.models.deletion
import django.db.models.expressions
import django.utils.timezone
from django.conf import set... |
extractors | UnRar | # -*- coding: utf-8 -*-
import os
import re
import subprocess
from pyload import PKGDIR
from pyload.core.utils.convert import to_str
from pyload.plugins.base.extractor import (
ArchiveError,
BaseExtractor,
CRCError,
PasswordError,
)
from pyload.plugins.helpers import renice
class UnRar(BaseExtractor... |
TechDrawTools | TaskShareView | # ***************************************************************************
# * Copyright (c) 2022 Wanderer Fan <wandererfan@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
fcgear | fcgear | # (c) 2014 David Douard <david.douard@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License (LGPL)
# as published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version.... |
tagsources | discogs | import gzip
import json
import numbers
import re
import socket
import time
import urllib.error
import urllib.parse
import urllib.request
from copy import deepcopy
from io import StringIO
from puddlestuff.audioinfo import DATA, isempty
from puddlestuff.constants import CHECKBOX, COMBO, TEXT
from puddlestuff.tagsources ... |
PyObjCTest | test_nsarraycontroller | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSArrayControler(TestCase):
def testMethods(self):
self.assertResultIsBOOL(NSArrayController.automaticallyRearrangesObjects)
self.assertResultIsBOOL(NSArrayController.clearsFilterPredicateOnInsertion)
self.assertArgIsBOO... |
panel | device | # 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... |
songsmenu | ape2id3 | # Copyright 2005 Joe Wreschnig
# 2016 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.