section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
gui
preferenceView
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
extractor
radiobremen
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import parse_duration from .common import InfoExtractor class RadioBremenIE(InfoExtractor): _VALID_URL = r"http?://(?:www\.)?radiobremen\.de/mediathek/(?:index\.html)?\?id=(?P<id>[0-9]+)" IE_NAME = "radiobremen" _TEST = { ...
downloaders
HostujeNet
# -*- coding: utf-8 -*- import re from ..base.simple_downloader import SimpleDownloader class HostujeNet(SimpleDownloader): __name__ = "HostujeNet" __type__ = "downloader" __version__ = "0.06" __status__ = "testing" __pattern__ = r"http://(?:www\.)?hostuje\.net/\w+" __config__ = [ ("...
util
Platform
import logging import sys def setMaxfilesopened(limit): try: if sys.platform == "win32": import ctypes dll = None last_err = None for dll_name in ["msvcr100", "msvcr110", "msvcr120"]: try: dll = getattr(ctypes.cdll, dll_n...
logic
validators
# encoding: utf-8 from __future__ import annotations import collections import datetime import json import mimetypes import re import string from itertools import count from typing import Any, Container, Optional, Union from urllib.parse import urlparse import ckan.authz as authz import ckan.lib.helpers as h import c...
configs
testing
""" flaskbb.configs.testing ~~~~~~~~~~~~~~~~~~~~ This is the FlaskBB's testing config. :copyright: (c) 2014 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ from flaskbb.configs.default import DefaultConfig class TestingConfig(DefaultConfig): # Indicates that it is a tes...
modes
add_util
# # Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com> # Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com> # 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 li...
views
social
"""The blueprint for this app.""" from __future__ import annotations from abilian.core.extensions import db from abilian.core.util import get_params from abilian.sbe.apps.social.models import Message from abilian.sbe.apps.wall.presenters import ActivityEntryPresenter from abilian.sbe.apps.wall.util import get_recent_...
squeezebox
util
# Copyright 2014 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 gi.repository import Gtk from quo...
moodbar
generator
# moodbar - Replace Exaile's seekbar with a moodbar # Copyright (C) 2015 Johannes Sasongko <sasongko@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License...
deluge-blocklist
readers
# # Copyright (C) 2009-2010 John Garland <johnnybg+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...
extractor
mit
from __future__ import unicode_literals import json import re from ..utils import ExtractorError, clean_html, get_element_by_id from .common import InfoExtractor from .youtube import YoutubeIE class TechTVMITIE(InfoExtractor): IE_NAME = "techtv.mit.edu" _VALID_URL = r"https?://techtv\.mit\.edu/(?:videos|emb...
extensions
notification_win32
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
mixins
retention
import json from datetime import datetime, timedelta from typing import Literal, Optional, Tuple, Union from dateutil.relativedelta import relativedelta from django.utils import timezone from posthog.constants import ( PERIOD, RETENTION_RECURRING, RETENTION_TYPE, RETURNING_ENTITY, SELECTED_INTERVAL...
fta
intermediateevent
"""Intermediate Event 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 im...
sql
functions
import os import threading from alembic import command from alembic.config import Config from cddagl.sql.model import ConfigValue, GameBuild, GameVersion from sqlalchemy import create_engine from sqlalchemy.exc import OperationalError from sqlalchemy.orm import joinedload, sessionmaker class ThreadSafeSessionManager...
channels
conj_fs_iqcorr
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Conj FS IQBal # Author: matt@ettus.com # Description: Frequency Selective Conjugate Method IQ Balance Corrector # Generated: Thu Aug 1 13:00:27 2013 ################################################## from gn...
TableModelWithSearch
ToolbarCreator
# # ToolbarCreator.py # TableModelWithSearch # # Created by Bill Bumgarner on Sun Apr 04 2004. # Copyright (c) 2004 __MyCompanyName__. All rights reserved. # from Cocoa import * kToolbarIdentifier = "TableModel Toolbar Identifier" kSearchFieldItemIdentifier = "TableModel Search Field Identifier" from FilteringAr...
retention
retention_events_query
from typing import Any, Dict, Literal, Optional, Tuple, Union, cast from posthog.constants import ( PAGEVIEW_EVENT, TREND_FILTER_TYPE_ACTIONS, TREND_FILTER_TYPE_EVENTS, TRENDS_LINEAR, RetentionQueryType, ) from posthog.models import Entity from posthog.models.action.util import Action, format_actio...
Settings
ActiveQuality
from dataclasses import dataclass from typing import List from UM import i18nCatalog catalog = i18nCatalog("cura") @dataclass class ActiveQuality: """Represents the active intent+profile combination, contains all information needed to display active quality.""" intent_category: str = ( "" # Name o...
isso
core
# -*- encoding: utf-8 -*- import logging import multiprocessing import threading import time try: import uwsgi except ImportError: uwsgi = None import _thread as thread from isso.utils.cache import NullCache, SimpleCache logger = logging.getLogger("isso") class Cache: """Wrapper around werkzeug's cac...
exports
exporter_utils
from datetime import datetime, timedelta from typing import Optional import requests import structlog from django.conf import settings logger = structlog.get_logger(__name__) _site_reachable = None _site_reachable_exception: Optional[Exception] = None _site_reachable_checked_at: Optional[datetime] = None def is_s...
views
users
from apps.api.permissions import LegacyAccessControlRole from apps.auth_token.auth import ( ApiTokenAuthentication, UserScheduleExportAuthentication, ) from apps.public_api.custom_renderers import CalendarRenderer from apps.public_api.serializers import FastUserSerializer, UserSerializer from apps.public_api.tf...
migrations
0313_early_access_feature
# Generated by Django 3.2.16 on 2023-04-27 09:04 import django.db.models.deletion import posthog.models.utils from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0312_organization_available_product_features"), ] operations = [ mig...
decrypters
TNTVillageScambioeticoOrg
# -*- coding: utf-8 -*- from ..base.simple_decrypter import SimpleDecrypter class TNTVillageScambioeticoOrg(SimpleDecrypter): __name__ = "TNTVillageScambioeticoOrg" __type__ = "decrypter" __version__ = "0.07" __status__ = "testing" __pattern__ = r"http://(?:www\.)?forum\.tntvillage\.scambioetico...
TemplatePyMod
Texture
# (c) 2012 Werner Mayer LGPL import FreeCAD import FreeCADGui from pivy import coin class Texture: def __init__(self, obj, source): "Add some custom properties to our box feature" obj.addProperty( "App::PropertyLink", "Source", "Texture", "Link to the shape" ).Source = source ...
managers
addon_manager
# -*- coding: utf-8 -*- from _thread import start_new_thread from functools import wraps from threading import RLock from types import MethodType from ..threads.addon_thread import AddonThread from ..utils.struct.lock import lock from .plugin_manager import literal_eval def try_catch(func): @wraps(func) de...
data
orientation
# -------------------------------------------------------------------------- # 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...
SysML
propertypages
from __future__ import annotations from gaphor import UML from gaphor.core import transactional from gaphor.diagram.propertypages import ( PropertyPageBase, PropertyPages, handler_blocking, new_resource_builder, unsubscribe_all_on_destroy, ) from gaphor.SysML import sysml from gaphor.SysML.blocks.b...
commands
create_ch_migration
import os from django.core.management.base import BaseCommand from django.utils.timezone import now MIGRATION_PATH = "ee/clickhouse/migrations" FILE_DEFAULT = """ from infi.clickhouse_orm import migrations # type: ignore operations = [] """ # ex: python manage.py create_ch_migration <name of migration> class Comma...
extractor
aliexpress
# coding: utf-8 from __future__ import unicode_literals from ..compat import compat_str from ..utils import float_or_none, try_get from .common import InfoExtractor class AliExpressLiveIE(InfoExtractor): _VALID_URL = r"https?://live\.aliexpress\.com/live/(?P<id>\d+)" _TEST = { "url": "https://live.al...
qtui
popupmenu
# Copyright (C) 2011 Chris Dekter # Copyright (C) 2018 Thomas Hess # # 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. # #...
data
editor
# -------------------------------------------------------------------------- # 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...
legecy-translators
utils
import sys import unicodedata from collections import defaultdict def is_lval(t): """Does not chceck whether t is not resticted or internal""" if not t: return False i = iter(t) if i.next() not in IDENTIFIER_START: return False return all(e in IDENTIFIER_PART for e in i) def is_v...
validator
preferences
# 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, ...
comictaggerlib
autotagmatchwindow
"""A PyQT4 dialog to select from automated issue matches""" # Copyright 2012-2014 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.apache.org/licenses/LICENSE...
extractor
podomatic
from __future__ import unicode_literals import json import re from ..utils import int_or_none from .common import InfoExtractor class PodomaticIE(InfoExtractor): IE_NAME = "podomatic" _VALID_URL = r"""(?x) (?P<proto>https?):// (?: (?P<c...
data
styles_3d
# -------------------------------------------------------------------------- # 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...
models
ssd_mobilenet_v1_feature_extractor_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...
comictaggerlib
settings
"""Settings class for ComicTagger app""" # Copyright 2012-2014 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.apache.org/licenses/LICENSE-2.0 # Unless requ...
AddonManager
package_details
# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** # * * # * Copyright (c) 2022-2023 FreeCAD Project Association * # * ...
commons
distance
import numpy as np def findCosineDistance(source_representation, test_representation): a = np.matmul(np.transpose(source_representation), test_representation) b = np.sum(np.multiply(source_representation, source_representation)) c = np.sum(np.multiply(test_representation, test_representation)) return ...
colors
util
# This file is part of MyPaint. # Copyright (C) 2012-2018 by the MyPaint Development Team. # # 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...
tools
magnet
"""Magnet tool pulls or pushes the right or bottom side depending on mouse movement.""" import contextlib from gaphas.canvas import ancestors from gaphas.move import Move from gaphas.view import GtkView from gaphor.diagram.event import ToolCompleted from gi.repository import Gtk def magnet_tool(view: GtkView, even...
util
scripttofilename
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2004 Robert Kaye # Copyright (C) 2006 Lukáš Lalinský # Copyright (C) 2018-2020, 2022 Philipp Wolfer # Copyright (C) 2019-2021 Laurent Monin # # This program is free software; you can redistribute it and/or # modify it under the...
stylesheets
medialist
"""MediaList implements DOM Level 2 Style Sheets MediaList. TODO: - delete: maybe if deleting from all, replace *all* with all others? - is unknown media an exception? """ __all__ = ["MediaList"] __docformat__ = "restructuredtext" __version__ = "$Id$" import xml.dom import cssutils from cssutils.css import c...
bitmessageqt
settingsmixin
#!/usr/bin/python2.7 """ src/settingsmixin.py ==================== """ from PyQt4 import QtCore, QtGui class SettingsMixin(object): """Mixin for adding geometry and state saving between restarts.""" def warnIfNoObjectName(self): """ Handle objects which don't have a name. Currently it ignor...
PyObjCTest
test_cgbitmapcontext
import array from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * try: long except NameError: long = int class TestCGBitmapContext(TestCase): def testFunctions(self): bytes_val = array.array("B", (0 for i in range(100 * 80 * 4))) self.assertIsInstance(bytes_val, array....
actions
actionsgroup
from gaphor.diagram.group import group, ungroup from gaphor.UML.uml import ( Activity, ActivityNode, ActivityParameterNode, ActivityPartition, ) @group.register(Activity, ActivityNode) def activity_node_group(activity, node): activity.node = node return True @ungroup.register(Activity, Activ...
processor
join_mp4
#!/usr/bin/env python # reference: c041828_ISO_IEC_14496-12_2005(E).pdf ################################################## # reader and writer ################################################## import struct from io import BytesIO def skip(stream, n): stream.seek(stream.tell() + n) def skip_zeros(stream, n):...
file-list
dialogs
from gi.repository import Gtk class SambaResult: NAME = 0 SERVER = 1 SHARE = 2 DIRECTORY = 3 DOMAIN = 4 USERNAME = 5 PASSWORD = 6 class FtpResult: NAME = 0 SERVER = 1 DIRECTORY = 2 USERNAME = 3 PASSWORD = 4 class DavResult: NAME = 0 SERVER = 1 SERVER_TYP...
lib
eotf
# Copyright (C) 2019 by the MyPaint Development Team. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. """A configurab...
calculix
write_footer
# *************************************************************************** # * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
extractor
viddler
from __future__ import unicode_literals import re from ..utils import float_or_none, int_or_none from .common import InfoExtractor class ViddlerIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?viddler\.com/(?:v|embed|player)/(?P<id>[a-z0-9]+)(?:.+?\bsecret=(\d+))?" _TESTS = [ { "url"...
extensions
episode_website_context_menu
# -*- coding: utf-8 -*- # Add a context menu to show the episode/podcast website (bug 1958) # (c) 2014-10-20 Thomas Perl <thp.io/about> # Released under the same license terms as gPodder itself. import logging import gpodder from gpodder import util logger = logging.getLogger(__name__) _ = gpodder.gettext __title_...
windows
title_editor
""" @file @brief This file loads the title editor dialog (i.e SVG creator) @author Jonathan Thomas <jonathan@openshot.org> @author Andy Finch <andy@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://...
analog
qa_frequency_modulator
#!/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 analog, blocks, gr, gr_unittest def sincos(x): return math.cos(x) + math.sin(x) * 1j class test_fre...
versions
97ddefed1834_initial_database_state
"""Initial database state Revision ID: 97ddefed1834 Revises: Create Date: 2017-05-26 18:46:14.440040 """ import sqlalchemy as sa import sqlalchemy_utils from alembic import op from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = "97ddefed1834" down_revision = None branch_labels ...
gtkui
desktopfile
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder 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 Licens...
papers
api
# -*- encoding: utf-8 -*- # Dissemin: open access policy enforcement tool # Copyright (C) 2014 Antonin Delpeuch # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as published by the Free Software Foundation; either version 2 # of th...
datatablesview
blueprint
# encoding: utf-8 from __future__ import annotations import re from typing import Any from urllib.parse import urlencode from ckan.common import json from ckan.lib.helpers import decode_view_request_filters from ckan.plugins.toolkit import get_action, h, request from flask import Blueprint datatablesview = Blueprint...
player
engine
# Copyright (C) 2008-2010 Adam Olsen # Copyright (C) 2014-2015 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. # # Th...
Scripts
Gear
# Involute Gears Generation Script # by Marcin Wanczyk (dj_who) # (c) 2011 LGPL import math import Draft import FreeCAD import FreeCADGui import Mesh import MeshPart import Part from PySide import QtCore, QtGui App = FreeCAD Gui = FreeCADGui def proceed(): try: compute() except Exception: ...
extractor
miomio
# coding: utf-8 from __future__ import unicode_literals import random from ..compat import compat_urlparse from ..utils import ExtractorError, int_or_none, sanitized_Request, xpath_text from .common import InfoExtractor class MioMioIE(InfoExtractor): IE_NAME = "miomio.tv" _VALID_URL = r"https?://(?:www\.)?m...
gui
brushmanip
# This file is part of MyPaint. # -*- coding: utf-8 -*- # Copyright (C) 2020 by the Mypaint Development Team # # 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...
models
properties_model
""" @file @brief This file contains the clip properties model, used by the properties view @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 op...
extractor
digg
from __future__ import unicode_literals from ..utils import js_to_json from .common import InfoExtractor class DiggIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?digg\.com/video/(?P<id>[^/?#&]+)" _TESTS = [ { # JWPlatform via provider "url": "http://digg.com/video/sci-fi...
database
table_speedtest_gen
# regress/neubot/database/table_speedtest_gen.py # # Copyright (c) 2010-2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # Copyright (c) 2011 Roberto D'Auria <everlastingfire@autistici.org> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is ...
sslcrypto
_ripemd
# Copyright (c) 2001 Markus Friedl. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and th...
drawBot
pipInstaller
import os import re import select import shlex import subprocess import sys import threading import AppKit from drawBot.ui.codeEditor import OutPutEditor as OutputEditor from PyObjCTools.AppHelper import callAfter from vanilla import * from vanilla.dialogs import message welcomeText = """\ Welcome to pip! Pip install...
extractor
bongacams
# coding: utf-8 from __future__ import unicode_literals import re from ..compat import compat_str from ..utils import int_or_none, try_get, urlencode_postdata from .common import InfoExtractor class BongaCamsIE(InfoExtractor): _VALID_URL = ( r"https?://(?P<host>(?:[^/]+\.)?bongacams\d*\.(?:com|net))/(?P...
utils
isni
"""ISNI author checking utilities""" import xml.etree.ElementTree as ET from typing import Optional, Union import requests from bookwyrm import activitypub, models def get_element_text(element: Optional[ET.Element]) -> str: """If the element is not None and there is a text attribute return this""" if element...
widgets
spectrum
from sglib.lib import util from sglib.math import clip_value, lin_to_db, pitch_to_hz from sgui.sgqt import * from . import _shared class spectrum(QGraphicsPathItem): def __init__(self, a_height, a_width): self.spectrum_height = float(a_height) self.spectrum_width = float(a_width) QGraphic...
align
align
from __future__ import annotations from gaphor.abc import ActionProvider, Service from gaphor.core import action, event_handler from gaphor.diagram.presentation import ElementPresentation from gaphor.i18n import gettext from gaphor.transaction import Transaction from gaphor.ui.event import DiagramSelectionChanged cl...
schedulers
asyncio
from __future__ import absolute_import from functools import wraps from apscheduler.schedulers.base import BaseScheduler from apscheduler.util import maybe_ref try: import asyncio except ImportError: # pragma: nocover try: import trollius as asyncio except ImportError: raise ImportError(...
disabled-UiPassword
UiPasswordPlugin
import json import os import random import re import string import time from Config import config from Plugin import PluginManager from util import helper plugin_dir = os.path.dirname(__file__) if "sessions" not in locals().keys(): # To keep sessions between module reloads sessions = {} whitelisted_client_i...
scripts
FilamentChange
# Copyright (c) 2023 Ultimaker B.V. # The PostProcessingPlugin is released under the terms of the LGPLv3 or higher. # Modification 06.09.2020 # add checkbox, now you can choose and use configuration from the firmware itself. from typing import List from UM.Application import Application # To get the current printer...
web
web
# # Copyright (C) 2009 Damien Churchill <damoxc@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # import logging from deluge.com...
qltk
searchbar
# Copyright 2010-2011 Christoph Reiter, Steven Robertson # 2016-2018 Nick Boultbee # 2018-2019 Peter Strulo # # 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...
Zeroname
SiteManagerPlugin
import logging import re import time from Config import config from Plugin import PluginManager allow_reload = False # No reload supported log = logging.getLogger("ZeronamePlugin") @PluginManager.registerTo("SiteManager") class SiteManagerPlugin(object): site_zeroname = None db_domains = {} db_domains...
Bookmarks
BookmarksDocument
# # BookmarksDocument.py # Bookmarks # # Converted by u.fiedler on 10.02.05. # # The original version was written in Objective-C by Malcolm Crawford # at http://homepage.mac.com/mmalc/CocoaExamples/controllers.html import objc from Cocoa import * # BookmarksDocument defines this as it may be used for copy and pa...
widgets
dialogs
# 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...
tzlocal
unix
from __future__ import with_statement import os import re import pytz _cache_tz = None def _tz_from_env(tzenv): if tzenv[0] == ":": tzenv = tzenv[1:] # TZ specifies a file if os.path.exists(tzenv): with open(tzenv, "rb") as tzfile: return pytz.tzfile.build_tzinfo("local", t...
Foundation
_metadata
# This file is generated by objective.metadata # # Last update: Wed Nov 14 10:54:38 2012 import sys import objc if sys.maxsize > 2**32: def sel32or64(a, b): return b else: def sel32or64(a, b): return a if sys.byteorder == "little": def littleOrBig(a, b): return a else: ...
host
jseval
import inspect from js2py.base import * try: from js2py.translators.translator import translate_js except: pass @Js def Eval(code): local_scope = inspect.stack()[3][0].f_locals["var"] global_scope = this.GlobalObject # todo fix scope - we have to behave differently if called through variable oth...
extractor
flickr
from __future__ import unicode_literals from ..compat import compat_str, compat_urllib_parse_urlencode from ..utils import ExtractorError, int_or_none, qualities from .common import InfoExtractor class FlickrIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.|secure\.)?flickr\.com/photos/[\w\-_@]+/(?P<id>\d+)" ...
sunflower
history
import os class HistoryManager: """Class used for management and maintenance of item list history.""" def __init__(self, parent, storage_list): self._list = storage_list self._index = 0 self._parent = parent def _change_to_index(self, index): """Change parent path to spec...
cli
server
# encoding: utf-8 from __future__ import annotations import logging import warnings from typing import Optional import click from ckan.common import config from ckan.exceptions import CkanDeprecationWarning from werkzeug.middleware.dispatcher import DispatcherMiddleware from werkzeug.serving import run_simple from ....
GUITests
test_modalsession
""" Check if NSModalSessions are properly wrapped. XXX: This is not a proper unittest, it requires human eyes to check if the output is correct. """ import time import objc from AppKit import * from Foundation import * def doTest(): alertPanel = None modalSession = None app = NSApplication.sharedApplica...
PyObjCTest
test_nssplitview
from AppKit import * from PyObjCTools.TestSupport import * try: unicode except NameError: unicode = str class TestNSSplitViewHelper(NSObject): def splitView_canCollapseSubview_(self, sp, sv): return 1 def splitView_shouldCollapseSubview_forDoubleClickOnDividerAtIndex_( self, sp, sv, ...
channels
impairments
#!/usr/bin/env python ################################################## # Gnuradio Python Flow Graph # Title: Radio Impairments Model # Author: mettus # Generated: Thu Aug 1 12:46:10 2013 ################################################## import math from gnuradio import analog, blocks, gr from gnuradio.filter impo...
printdlg
kbd_proc
# -*- coding: utf-8 -*- # # Copyright (C) 2016 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....
blocks
qa_rms
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math from gnuradio import blocks, gr, gr_unittest def sig_source_f(samp_rate, freq, amp, N): t = [float(x) / samp_rate for x in range(N)] y = [...
draftgeoutils
offsets
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * * # * Th...
gui
additionsPane
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
management
merge
from django.db.models import ManyToManyField def update_related(canonical, obj): """update all the models with fk to the object being removed""" # move related models to canonical related_models = [ (r.remote_field.name, r.related_model) for r in canonical._meta.related_objects ] for relat...
PyObjCTest
test_cffilesecurity
import CoreFoundation from PyObjCTools.TestSupport import * try: long except NameError: long = int class TestCFFileSecurity(TestCase): @min_os_level("10.7") def testTypes(self): self.assertIsCFType(CoreFoundation.CFFileSecurityRef) @min_os_level("10.7") def testTypeID(self): ...
plugins
bbciplayer
""" $description Live TV channels and video on-demand service from the BBC, a British public, state-owned broadcaster. $url bbc.co.uk/iplayer $type live, vod $region United Kingdom """ import base64 import logging import re from collections import defaultdict from hashlib import sha1 from urllib.parse import urlparse,...
lexers
metadata
import pygments from httpie.models import ELAPSED_TIME_LABEL from httpie.output.lexers.common import precise SPEED_TOKENS = { 0.45: pygments.token.Number.SPEED.FAST, 1.00: pygments.token.Number.SPEED.AVG, 2.50: pygments.token.Number.SPEED.SLOW, } def speed_based_token(lexer, match, ctx): try: ...
externals
maildirToMbox
#!/usr/bin/env python # source: https://gist.github.com/1709069 # author/owner: nyergler github gist """ Frédéric Grosshans, 19 January 2012 Nathan R. Yergler, 6 June 2010 This file does not contain sufficient creative expression to invoke assertion of copyright. No warranty is expressed or implied; use at your own ri...