section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
cli | dicts | from collections import OrderedDict
from multidict import CIMultiDict, MultiDict
class BaseMultiDict(MultiDict):
"""
Base class for all MultiDicts.
"""
class HTTPHeadersDict(CIMultiDict, BaseMultiDict):
"""
Headers are case-insensitive and multiple values are supported
through the `add()` A... |
femviewprovider | view_solver_ccxtools | # ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
scripts | Sample_PostProc | #!/usr/bin/python3
# Example Post-Processing Script for SABnzbd (3.0.0 and higher), written in Python.
# For Linux, MacOS, Windows and any other platform with Python
# See https://sabnzbd.org/wiki/scripts/post-processing-scripts for details
#
# Example test run on Linux:
# env SAB_VERSION=X.Y SAB_AVG_BPS=666 python3 ./... |
addons | UserAgentSwitcher | # -*- coding: utf-8 -*-
import pycurl
from pyload.core.network.browser import Browser
from pyload.core.network.http.http_request import HTTPRequest
from ..base.addon import BaseAddon
class UserAgentSwitcher(BaseAddon):
__name__ = "UserAgentSwitcher"
__type__ = "addon"
__version__ = "0.18"
__status__... |
disabled-Bootstrapper | BootstrapperDb | import re
import time
import gevent
from Config import config
from Db import Db
from util import helper
class BootstrapperDb(Db.Db):
def __init__(self):
self.version = 7
self.hash_ids = {} # hash -> id cache
super(BootstrapperDb, self).__init__(
{"db_name": "Bootstrapper"}, "... |
PyObjCTest | test_nsnumber | import operator
import os
import re
import sys
import objc
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
from Foundation import *
PLIST = b"""\
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/Prop... |
bleachbit | Action | # vim: ts=4:sw=4:expandtab
# -*- coding: UTF-8 -*-
# BleachBit
# Copyright (C) 2008-2023 Andrew Ziem
# https://www.bleachbit.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... |
gtk3 | connectionmanager | #
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import os
... |
Pipeline | logger | import sys
from datetime import datetime
from model import AmbarLogRecord
class AmbarLogger:
def __init__(self, ApiProxy, Name, Verbose=True):
"""SourceId - crawler id from AmbarCrawlerSettings"""
self.apiProxy = ApiProxy
self.name = Name
self.verbose = Verbose
def SendLogMes... |
oncall-gateway | oncall_gateway_client | import json
from dataclasses import dataclass
from urllib.parse import urljoin
import requests
from django.conf import settings
@dataclass
class OnCallConnector:
"""
OnCallConnector represents connection between oncall org and oncall-gateway
"""
oncall_org_id: str
backend: str
@dataclass
class... |
Draft | importDXF | # -*- coding: utf8 -*-
# Check code with
# flake8 --ignore=E226,E266,E401,W503
# ***************************************************************************
# * Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * *
# * ... |
PyObjCTest | test_nskeyvaluecoding | # NOTE: This file only contains basic tests of the keyvalue coding header definitions,
# test_keyvalue contains tests for the actualy KVC/KVO mechanisms.
from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSKeyValueCodingHelper(NSObject):
... |
calculix | write_constraint_force | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
util | type | """
"""
import inspect
from typing import Optional
from .key_swap import key_swap
from .marshal import unmarshal_dict
__all__ = [
"type_assert",
"type_assert_dict",
"type_assert_iter",
]
def _msg(
obj,
cls,
):
return "{0} is not an instance of {1}, is {2}".format(
obj,
cls,... |
PyInterpreter | PyInterpreter | import keyword
import sys
import time
import traceback
from code import InteractiveConsole, softspace
import sets
from AppKit import *
from Foundation import *
from objc import NO, YES, IBAction, IBOutlet, selector
from PyObjCTools import AppHelper
from StringIO import StringIO
try:
sys.ps1
except AttributeError:... |
PyObjCTest | test_cgaffinetransform | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
class TestCGAffineTransform(TestCase):
def testStruct(self):
v = CGAffineTransform()
self.assertTrue(hasattr(v, "a"))
self.assertTrue(hasattr(v, "b"))
self.assertTrue(hasattr(v, "c"))
self.assertTrue(ha... |
Marketplace | PackageList | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
import os.path
import tempfile
from typing import TYPE_CHECKING, Dict, Optional, Set, cast
from cura.CuraApplication import CuraApplication
from cura.CuraPackageManager import CuraPackageManager
from cura.Ulti... |
GraphicsBindings | RadiansToDegreesTransformer | #
# RadiansToDegreesTransformer.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
from Foundation import *
class... |
src | Utils | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from datetime import datetime, timedelta
from UM import i18nCatalog
def formatTimeCompleted(seconds_remaining: int) -> str:
completed = datetime.now() + timedelta(seconds=seconds_remaining)
return "{hour:02d}:{min... |
deployments | connectorconnect | """Connector connections.
Implemented using interface item in assembly connector mode, see
`gaphor.diagram.connector` module for details.
"""
from typing import Union
from gaphor import UML
from gaphor.diagram.connectors import BaseConnector, Connector
from gaphor.UML.classes.component import ComponentItem
from gaph... |
AMFReader | AMFReader | # Copyright (c) 2019 fieldOfView, Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os.path
import zipfile
import numpy
import trimesh
from cura.CuraApplication import CuraApplication
from cura.Scene.BuildPlateDecorator import BuildPlateDecorator
from cura.Scene.ConvexHullDecorator imp... |
Op | Custom | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... |
downloaders | SmoozedCom | # -*- coding: utf-8 -*-
import json
from ..base.multi_downloader import MultiDownloader
class SmoozedCom(MultiDownloader):
__name__ = "SmoozedCom"
__type__ = "downloader"
__version__ = "0.15"
__status__ = "testing"
#: Since we want to allow the user to specify the list of hoster to use we let Mu... |
transfer | outgoing | from __future__ import annotations
import math
from typing import Iterable
from tribler.core.components.ipv8.eva.payload import Data
from tribler.core.components.ipv8.eva.result import TransferResult
from tribler.core.components.ipv8.eva.transfer.base import Transfer
class OutgoingTransfer(Transfer):
def __init... |
gui | PropsDialog | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from gi.repository import Gdk, GObject, Gtk, Pango
from . import Actions, Constants, Utils
from .Dialogs import SimpleTextDisplay
class PropsDialog(Gtk.Dialog):
"""
A ... |
commands | revoke_preview_image_tasks | """ Actually let's not generate those preview images """
import json
from bookwyrm.tasks import app
from django.core.management.base import BaseCommand
class Command(BaseCommand):
"""Find and revoke image tasks"""
# pylint: disable=unused-argument
def handle(self, *args, **options):
"""revoke n... |
network | browser | # -*- coding: utf-8 -*-
from logging import getLogger
from pyload import APPID
from .http.http_download import HTTPDownload
from .http.http_request import HTTPRequest
class Browser:
def __init__(self, bucket=None, options={}):
self.log = getLogger(APPID)
self.options = options #: holds pycurl... |
clientScripts | archivematicaCreateMETSRights | #!/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, ... |
builtinContextMenus | implantSetApply | # noinspection PyPackageRequirements
import wx
from gui.contextMenu import ContextMenuUnconditional
from service.implantSet import ImplantSets as UserImplantSets
from service.precalcImplantSet import PrecalcedImplantSets
_t = wx.GetTranslation
class ImplantSetApply(ContextMenuUnconditional):
def display(self, c... |
extractor | helsinki | # coding: utf-8
from __future__ import unicode_literals
from ..utils import js_to_json
from .common import InfoExtractor
class HelsinkiIE(InfoExtractor):
IE_DESC = "helsinki.fi"
_VALID_URL = r"https?://video\.helsinki\.fi/Arkisto/flash\.php\?id=(?P<id>\d+)"
_TEST = {
"url": "http://video.helsink... |
configmanager | version_upgrading | # Copyright (C) 2011 Chris Dekter
# Copyright (C) 2018 Thomas Hess <thomas.hess@udo.edu>
# 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) a... |
beetsplug | bench | # 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, ... |
generator | cpp_top_block | import ast
import codecs
import operator
import os
import re
import tempfile
import textwrap
import yaml
from mako.template import Template
from .. import Messages, blocks
from ..Constants import TOP_BLOCK_FILE_MODE
from ..utils import expr_utils
from .FlowGraphProxy import FlowGraphProxy
from .top_block import TopBl... |
plugins | rtve | """
$description Live TV channels and video on-demand service from RTVE, a Spanish public, state-owned broadcaster.
$url rtve.es
$type live, vod
$metadata id
$region Spain
"""
import logging
import re
from base64 import b64decode
from io import BytesIO
from typing import Iterator, Sequence, Tuple
from urllib.parse imp... |
api | ee_property_definition | from django.utils import timezone
from ee.models.property_definition import EnterprisePropertyDefinition
from posthog.api.shared import UserBasicSerializer
from posthog.api.tagged_item import TaggedItemSerializerMixin
from posthog.models import PropertyDefinition
from posthog.models.activity_logging.activity_log import... |
tools | placement | import logging
from typing import Optional
from gaphas.decorators import g_async
from gaphas.handlemove import HandleMove
from gaphas.move import MoveType
from gaphas.view import GtkView
from gaphor.core.eventmanager import EventManager
from gaphor.diagram.diagramtoolbox import ItemFactory
from gaphor.diagram.event im... |
Arch | ArchPipe | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... |
utils | api_info | #!/usr/bin/env python3
import argparse
import os
import re
import requests
NYAA_HOST = "https://nyaa.si"
SUKEBEI_HOST = "https://sukebei.nyaa.si"
API_BASE = "/api"
API_INFO = API_BASE + "/info"
ID_PATTERN = "^[0-9]+$"
INFO_HASH_PATTERN = "^[0-9a-fA-F]{40}$"
environment_epillog = (
"You may also provide environ... |
base | ocr | # -*- coding: utf-8 -*-
import os
import subprocess
from PIL import Image
from pyload import PKGDIR
from .plugin import BasePlugin
# import tempfile
class BaseOCR(BasePlugin):
__name__ = "BaseOCR"
__type__ = "base"
__version__ = "0.28"
__status__ = "stable"
__description__ = """OCR base plugi... |
migrations | 0002_auto_20170711_2119 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("frontend", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Post",
fi... |
QT | PantallaKibitzers | import os
from Code import Books, EngineThread, Kibitzers
from Code.QT import (
Colocacion,
Columnas,
Controles,
Delegados,
FormLayout,
Grid,
Iconos,
QTUtil2,
QTVarios,
)
from PyQt4 import QtGui
class WKibitzers(QTVarios.WDialogo):
def __init__(self, wParent, procesador):
... |
lib | support_tickets | # 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, ... |
saveddata | mutator | # ===============================================================================
# Copyright (C) 2015 Ryan Holmes
#
# 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, e... |
draftviewproviders | view_shapestring | # ***************************************************************************
# * *
# * Copyright (c) 2022 Mario Passaglia *
# * *
# * Th... |
plugins | playorder | # Copyright 2007 Joe Wreschnig
# 2016-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
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from ty... |
util | bytes2human | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2013, 2019-2020 Laurent Monin
# Copyright (C) 2018 Wieland Hoffmann
#
# 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 Soft... |
comictaggerlib | imagehasher | """A class to manage creating image content hashes, and calculate hamming distances"""
# Copyright 2013 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
migrations | 0010_move_old_partitions | from datetime import datetime
from functools import cached_property
import structlog
from posthog.async_migrations.definition import (
AsyncMigrationDefinition,
AsyncMigrationOperationSQL,
)
from posthog.client import sync_execute
from posthog.cloud_utils import is_cloud
from posthog.constants import Analytics... |
addons | IRC | # -*- coding: utf-8 -*-
import re
import select
import socket
import ssl
import time
import pycurl
from pyload.core.utils.convert import to_bytes, to_str
from ..base.chat_bot import ChatBot
def parse_irc_msg(line):
"""
Breaks a message from an IRC server into its origin, command, and arguments.
"""
... |
command | cd | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# 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 General Public License as published by
# the Free Software Foundation, either version 3 of t... |
index | sql | __package__ = "archivebox.index"
import re
from io import StringIO
from pathlib import Path
from typing import Iterator, List, Tuple
from django.db import transaction
from django.db.models import QuerySet
from ..config import OUTPUT_DIR, TAG_SEPARATOR_PATTERN
from ..util import enforce_types, parse_date
from .schema... |
Dressup | Boundary | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
customize | profiles | # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = "GPL 3"
__copyright__ = "2009, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
from itertools import izip
from calibre.customize import Plugin as _Plugin
FONT_SIZES = [
("xx-small", 1... |
legecy-translators | translator | from constants import recover_constants, remove_constants
from flow import translate_flow
from functions import remove_functions, reset_inline_count
from jsparser import dbg, indent, inject_before_lval
from objects import (remove_arrays, remove_objects, set_func_translator,
translate_array, transla... |
femexamples | ccx_cantilever_ele_quad4 | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
trax | util | # 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... |
builtinShipBrowser | pfBitmapFrame | import wx
class PFBitmapFrame(wx.Frame):
def __init__(self, parent, pos, bitmap):
super().__init__(
parent,
id=wx.ID_ANY,
title=wx.EmptyString,
pos=pos,
size=wx.DefaultSize,
style=wx.NO_BORDER | wx.FRAME_NO_TASKBAR | wx.STAY_ON_TOP,
... |
command | offset | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# 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 General Public License as published by
# the Free Software Foundation, either version 3 of t... |
extractor | abcnews | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import parse_duration, parse_iso8601, try_get
from .amp import AMPIE
from .common import InfoExtractor
class AbcNewsVideoIE(AMPIE):
IE_NAME = "abcnews:video"
_VALID_URL = r"""(?x)
https?://
... |
gui | shortcuts_window | from gi.repository import Gdk, Gtk
class ShortcutsWindow:
"""Shortcuts display"""
def __init__(self, parent):
self._parent = parent
def _show(self, widget, data=None):
self._window = Gtk.ShortcutsWindow()
self._window.set_title(_("Keyboard shortcuts"))
self._window.set_de... |
beetsplug | the | # This file is part of beets.
# Copyright 2016, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitati... |
utils | localunzip | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:fdm=marker:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = "GPL v3"
__copyright__ = "2012, Kovid Goyal <kovid at kovidgoyal.net>"
__docformat__ = "restructuredtext en"
"""
Try to read invalid zip ... |
resources | users | from migrator.utils import find_by_id
def match_user(user: dict, oncall_users: list[dict]) -> None:
oncall_user = None
for candidate_user in oncall_users:
if user["email"].lower() == candidate_user["email"].lower():
oncall_user = candidate_user
break
user["oncall_user"] = ... |
ui | pluginupdatedialog | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2023 Bob Swift
# Copyright (C) 2023 Philipp Wolfer
#
# 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; ... |
paths | paths_actors | from typing import Dict, Optional, Tuple, cast
from posthog.models.filters.filter import Filter
from posthog.queries.actor_base_query import ActorBaseQuery
from posthog.queries.paths.paths import Paths
class PathsActors(Paths, ActorBaseQuery): # type: ignore
"""
`path_start_key`, `path_end_key`, and `path_d... |
feature | state | # The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
extractor | lecture2go | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import determine_ext, determine_protocol, int_or_none, parse_duration
from .common import InfoExtractor
class Lecture2GoIE(InfoExtractor):
_VALID_URL = r"https?://lecture2go\.uni-hamburg\.de/veranstaltungen/-/v/(?P<id>\d+)"
_TEST... |
femexamples | equation_deformation_spring_elmer | # ***************************************************************************
# * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | ccma | # coding: utf-8
from __future__ import unicode_literals
import calendar
import datetime
import re
from ..utils import (
clean_html,
extract_timezone,
int_or_none,
parse_duration,
parse_resolution,
try_get,
url_or_none,
)
from .common import InfoExtractor
class CCMAIE(InfoExtractor):
... |
extractor | streetvoice | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
int_or_none,
parse_iso8601,
str_or_none,
strip_or_none,
try_get,
urljoin,
)
from .common import InfoExtractor
class StreetVoiceIE(InfoExtractor):
_VALID_URL = r"https?://(?:.+?\.)?streetvoice\.com/[^/]+/songs/(?... |
i18n | util | #
# Copyright (C) 2007,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 builtins
import ct... |
database | _table_utils | # neubot/database/_table_utils.py
#
# Copyright (c) 2011-2012 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU... |
draftmake | make_polygon | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
library | base | # Copyright 2006 Joe Wreschnig
# 2011-2022 Nick Boultbee
# 2013,2014 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
# ... |
extractor | younow | # coding: utf-8
from __future__ import unicode_literals
import itertools
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none, try_get
from .common import InfoExtractor
CDN_API_BASE = "https://cdn.younow.com/php/api"
MOMENT_URL_FORMAT = "%s/moment/fetch/id=%%s" % CDN_API_BASE
class YouNo... |
widgets | filter | from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
_FILTER_LOOKUP = {
"LP2": (0, "2 pole lowpass filter"),
"LP4": (1, "4 pole lowpass filter"),
"HP2": (2, "2 pole highpass filter"),
"HP4": (3, "4 pole highpass filter"),
"BP2": (4, "2 pole bandpas... |
matchers | argmax_matcher | # 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... |
lib | base | # encoding: utf-8
"""The base functionality for web-views.
Provides functions for rendering templates, aborting the request, etc.
"""
from __future__ import annotations
import logging
from typing import Any, NoReturn, Optional
import ckan.lib.helpers as h
import ckan.plugins as p
from ckan.common import config, g,... |
utilities | patch_import | """ A helper mocking function to mask ImportError on a scoped code.
Failed imports will be ignored.
This module has been copied from https://github.com/posener/mock-import and modified by @drew2a
to allow `mock_import` ignore only packages included to the `packages` list.
Original module distributes under Apache Lice... |
commandFit | remove | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.commandFit.remove import CalcRemoveCommandFitCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiRemoveCommandFitsCommand(wx.Command):
def __init__(self, fi... |
downloaders | UpfileVn | # -*- coding: utf-8 -*-
import hashlib
import json
from ..base.simple_downloader import SimpleDownloader
class UpfileVn(SimpleDownloader):
__name__ = "UpfileVn"
__type__ = "downloader"
__version__ = "0.01"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?upfile\.vn/(?P<ID>.+?)/.+?\.html"... |
db | alter_db | # 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, ... |
datastore | interfaces | # encoding: utf-8
from __future__ import annotations
from typing import Any
import ckan.plugins.interfaces as interfaces
from ckan.types import Context
class IDatastore(interfaces.Interface):
"""Allow modifying Datastore queries"""
def datastore_validate(
self, context: Context, data_dict: dict[str... |
views | account | import binascii
import time
from datetime import datetime, timedelta
from ipaddress import ip_address
import flask
from nyaa import email, forms, models
from nyaa.extensions import db, limiter
from nyaa.utils import sha1_hash
from nyaa.views.users import (
get_activation_link,
get_password_reset_link,
get_... |
migrations | 0037_mediaconch_policy_checks | from django.db import migrations
def data_migration(apps, schema_editor):
"""Workflow migrations for policy checks on files using MediaConch.
Changes workflow so that, at a high-level the following micro-services are
created:
1. "Policy Checks on Preservation Derivatives" micro-service
2. "Polic... |
songsmenu | replaygain | # ReplayGain Album Analysis using gstreamer rganalysis element
# Copyright (C) 2005,2007,2009 Michael Urman
# 2012-2021 Nick Boultbee
# 2013 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU... |
mido | sockets | """
MIDI over TCP/IP.
"""
import select
import socket
from .parser import Parser
from .ports import BaseIOPort, MultiPort
from .py2 import PY2
def _is_readable(socket):
"""Return True if there is data to be read on the socket."""
timeout = 0
(rlist, wlist, elist) = select.select([socket.fileno()], [], [... |
serializers | live_setting | from apps.base.models import LiveSetting
from rest_framework import serializers
class LiveSettingSerializer(serializers.ModelSerializer):
id = serializers.CharField(read_only=True, source="public_primary_key")
value = serializers.JSONField(allow_null=True)
class Meta:
model = LiveSetting
... |
PyObjCTest | test_specialtypecodes_charbyte | """
Test handling of the private typecodes: _C_CHAR_AS_BYTE
This typecode doesn't actually exists in the ObjC runtime but
are private to PyObjC. We use these to simplify the bridge code
while at the same time getting a higher fidelity bridge.
- Add tests for calling methods from ObjC
"""
from __future__ import unico... |
base | multi_decrypter | # -*- coding: utf-8 -*-
from .simple_decrypter import SimpleDecrypter
class MultiDecrypter(SimpleDecrypter):
__name__ = "MultiDecrypter"
__type__ = "downloader"
__version__ = "0.11"
__status__ = "stable"
__pattern__ = r"^unmatchable$"
__config__ = [
("enabled", "bool", "Activated", T... |
draftguitools | gui_downgrade | # ***************************************************************************
# * (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> *
# * ... |
meshes | mesh_constraint_centrif_tetra10 | def create_nodes(femmesh):
# nodes
femmesh.addNode(102.5, -2.5e-14, 10.0, 1)
femmesh.addNode(102.5, -2.5e-14, 0.0, 2)
femmesh.addNode(3.0, -1e-15, 10.0, 3)
femmesh.addNode(-4.99999999999884, 97.3717104707524, 10.0, 4)
femmesh.addNode(-4.99999999999885, -97.3717104707523, 10.0, 5)
femmesh.add... |
migrations | 0001_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import uuid
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
linter.IgnoreMigration(),
migrations.CreateModel(
... |
events | notify_bookmarks | # Copyright 2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from collections import deque
from typ... |
example-iconfigurer | plugin_v2 | # encoding: utf-8
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.common import CKANConfig
from ckan.types import Schema
class ExampleIConfigurerPlugin(plugins.SingletonPlugin):
plugins.implements(plugins.IConfigurer)
# IConfigurer
def update_config(self, config: CKANCon... |
draftobjects | label | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-cas... |
chardet | utf8prober | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
migrations | 0049_auto_20210309_0156 | # Generated by Django 3.0.7 on 2021-03-09 01:56
import bookwyrm.models.fields
import django.db.models.deletion
import django.db.models.expressions
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0048_merge_202... |
VersionUpgrade41to42 | VersionUpgrade41to42 | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
import io
import os.path # To get the file ID.
from typing import Dict, List, Tuple
from UM.VersionUpgrade import VersionUpgrade
_renamed_settings = {
"support_minimal_diameter": "support_tower_ma... |
interface | notify | #!/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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.