section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
model
group
# encoding: utf-8 from __future__ import annotations import datetime from typing import Any, Optional, Union, overload import ckan.model.core as core import ckan.model.domain_object as domain_object import ckan.model.meta as meta import ckan.model.package as _package import ckan.model.types as _types from ckan.types ...
accounts
RPNetBiz
# -*- coding: utf-8 -*- import json from ..base.multi_account import MultiAccount class RPNetBiz(MultiAccount): __name__ = "RPNetBiz" __type__ = "account" __version__ = "0.22" __status__ = "testing" __config__ = [ ("mh_mode", "all;listed;unlisted", "Filter downloaders to use", "all"), ...
queries
session_recording_events
import json from datetime import datetime from typing import Dict, List, Optional, Tuple from posthog.client import sync_execute from posthog.models import Team from posthog.session_recordings.models.metadata import ( DecompressedRecordingData, SessionRecordingEvent, SnapshotDataTaggedWithWindowId, ) from ...
downloaders
FilecloudIo
# -*- coding: utf-8 -*- import json import re from ..anticaptchas.ReCaptcha import ReCaptcha from ..base.simple_downloader import SimpleDownloader class FilecloudIo(SimpleDownloader): __name__ = "FilecloudIo" __type__ = "downloader" __version__ = "0.17" __status__ = "testing" __pattern__ = ( ...
builtinStatsViews
miningyieldViewFull
# ============================================================================= # Copyright (C) 2014 Alexandros Kosiaris # # 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, ...
Arch
ArchIFCView
# *************************************************************************** # * Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
decorators
visibility
import functools from CTFd.constants.config import ( AccountVisibilityTypes, ChallengeVisibilityTypes, ConfigTypes, RegistrationVisibilityTypes, ScoreVisibilityTypes, ) from CTFd.utils import get_config from CTFd.utils.user import authed, is_admin from flask import abort, redirect, render_template,...
console
consolewindow
#!/usr/bin/env python import logging from gaphor.abc import ActionProvider from gaphor.action import action from gaphor.i18n import gettext from gaphor.plugins.console.console import GTKInterpreterConsole from gaphor.services.properties import get_config_dir from gaphor.ui.abc import UIComponent from gi.repository im...
python-bindings
gen_swig_hpp
#!/usr/bin/python TREE_TYPES = [(dim, "int", "unsigned long long", "i", "L") for dim in range(2, 7)] + [ (dim, "float", "unsigned long long", "f", "L") for dim in range(2, 7) ] def write_swig_file(tmpl_fn_name, swig_fn_name): TMPL_SEPARATOR_DEF = """\ ////////////////////////////////////////////////////////...
frescobaldi-app
editinplace
# 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 ...
plugins
core
# encoding: utf-8 """ Provides plugin services to the CKAN """ from __future__ import annotations import logging import warnings from contextlib import contextmanager from typing import Any, Generic, Iterator, Optional, Type, TypeVar, Union import ckan.plugins.interfaces as interfaces from ckan.common import config ...
states
transition
"""State transition implementation.""" from gaphor import UML from gaphor.diagram.presentation import LinePresentation, Named from gaphor.diagram.shapes import Box, Text, draw_arrow_tail from gaphor.diagram.support import represents from gaphor.UML.recipes import stereotypes_str @represents(UML.Transition, head=UML....
term2048
ui
# -*- coding: UTF-8 -*- """ UI-related functions """ from __future__ import print_function import argparse import sys from term2048.game import Game def print_version_and_exit(): """print term2048's current version and exit""" from term2048 import __version__ print("term2048 v%s" % __version__) s...
plugin-base
terminal
from __future__ import absolute_import import gi gi.require_version("Vte", "2.91") from gi.repository import Gdk, Gio, Gtk, Pango, Vte from sunflower.accelerator_group import AcceleratorGroup from sunflower.common import get_monospace_font_string from sunflower.plugin_base.plugin import PluginBase class TerminalTy...
frontend
playlist
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2013-2022 Alban 'spl0k' Féron # # Distributed under terms of the GNU AGPLv3 license. import uuid from functools import wraps from flask import Response, flash, redirect, render_template, request, url...
example-igroupform
plugin
# encoding: utf-8 import ckan.plugins as plugins import ckan.plugins.toolkit as tk from ckan.common import CKANConfig # I did try unicode in the group_type, but Routes wasn't happy with unicode in # the route name, so it would require encoding everywhere we do url_for, so # I've left it. # group_type = u'gr\xc3\xb6up...
modes
basemode
# # Copyright (C) 2011 Nick Lanham <nick@afternight.org> # Copyright (C) 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 LICE...
neubot
updater_utils
# neubot/updater_utils.py # # Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Publ...
blocks
interfaceblock
from gaphor.core.modeling.properties import attribute from gaphor.diagram.presentation import ( Classified, ElementPresentation, from_package_str, ) from gaphor.diagram.shapes import ( Box, JustifyContent, Text, TextAlign, draw_border, draw_top_separator, ) from gaphor.diagram.suppor...
httpie
core
import argparse import os import platform import socket import sys from typing import Callable, List, Optional, Union import requests from pygments import __version__ as pygments_version from requests import __version__ as requests_version from . import __version__ as httpie_version from .cli.constants import OUT_REQ...
snippet
import_export
# 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 ...
bup
vint
"""Binary encodings for bup.""" # Copyright (C) 2010 Rob Browning # # This code is covered under the terms of the GNU Library General # Public License as described in the bup LICENSE file. # Variable length integers are encoded as vints -- see lucene. from __future__ import absolute_import from io import BytesIO f...
classes
component
"""Component item.""" from gaphor import UML from gaphor.core.modeling.properties import attribute from gaphor.core.styling import FontWeight, JustifyContent from gaphor.diagram.presentation import Classified, ElementPresentation from gaphor.diagram.shapes import Box, Text, cairo_state, draw_border from gaphor.diagram...
neubot
runner_api
# neubot/runner_api.py # # Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public ...
cssvendor
cssvendor
import re def prefix(content): content = re.sub( b"@keyframes (.*? {.*?}\s*})", b"@keyframes \\1\n@-webkit-keyframes \\1\n@-moz-keyframes \\1\n", content, flags=re.DOTALL, ) content = re.sub( b"([^-\*])(border-radius|box-shadow|appearance|transition|animation|box-si...
utils
metrics_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...
osd
osd_preferences
# Copyright (C) 2012 Mathias Brodala # # 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...
octoprint
events
__author__ = "Gina Häußge <osd@foosel.net>, Lars Norpchen" __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import collections import datetime import logging import queue impor...
cli
sysadmin
# encoding: utf-8 from __future__ import annotations import ckan.model as model import click from ckan.cli import error_shout from ckan.cli.user import add_user @click.group( short_help="Gives sysadmin rights to a named user.", invoke_without_command=True, ) @click.pass_context def sysadmin(ctx: click.Contex...
migrations
0238_exportedasset
# Generated by Django 3.2.12 on 2022-05-25 13:59 import django.db.models.deletion import posthog.models.exported_asset from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0237_remove_timezone_from_teams"), ] operations = [ migrati...
core
Settings
##################################################################### # -*- coding: utf-8 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä ...
util
bitreader
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2014, 2020 Christoph Reiter # Copyright (C) 2019, 2021 Philipp Wolfer # Copyright (C) 2021 Laurent Monin # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Li...
Code
Jugada
import cPickle from Code import ControlPosicion, TrListas, VarGen NOABANDONO, ABANDONO, ABANDONORIVAL = "N", "S", "R" # def creaDicHTML(): # base = '<img src="IntFiles/Figs/%s%s.png">' # dic = {} # for x in "nbrqk": # dic[x.upper()] = base % ("w", x) # dic[x] = base % ("b", x) # return...
src
DFFileUploader
# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Any, Callable, Optional, Union, cast from PyQt6.QtNetwork import QNetworkReply, QNetworkRequest from UM.Logger import Logger from UM.TaskManagement.HttpRequestManager import HttpRequestManager from .DFL...
widgets
file_select
import os from sglib.lib.translate import _ from sgui.sgqt import * class file_select_widget: def __init__( self, a_load_callback, ): """ @a_load_callback: function to call when loading that accepts a single argument of [list of paths,...] """...
Code
GestorMate
import time from Code import ControlPosicion, Gestor, Jugada, Partida, TrListas, Util from Code.Constantes import * from Code.QT import FormLayout, Iconos, QTUtil2 class ConfigNivel: def __init__(self, mate): self.mate = mate eduardo = Util.listfiles("Trainings", "Checkmates by Eduardo Sadier", ...
src
DFPrintJobUploadResponse
# Copyright (c) 2021 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from .BaseModel import BaseModel # Model that represents the response received from the cloud after requesting to upload a print job class DFPrintJobUploadResponse(BaseModel): def __init__(...
backend
address_generator
""" Common methods and functions for kivy and qt. """ from pybitmessage import queues from pybitmessage.bmconfigparser import config from pybitmessage.defaults import ( networkDefaultPayloadLengthExtraBytes, networkDefaultProofOfWorkNonceTrialsPerByte, ) class AddressGenerator(object): """ "Base class fo...
src
DriveApiService
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Any, Callable, Dict, List, Optional from cura.CuraApplication import CuraApplication from cura.UltimakerCloud.UltimakerCloudScope import UltimakerCloudScope from PyQt6.QtNetwork import QNetworkReply from...
utils
hash
# -*- encoding: utf-8 -*- import codecs import hashlib from hashlib import pbkdf2_hmac as pbkdf2 def _TypeError(name, expected, val): return TypeError( "'{0}' must be {1}, not {2}".format(name, expected, val.__class__.__name__) ) class Hash(object): func = None salt = b"Eech7co8Ohloopo9Ol6b...
engines
google_news
# SPDX-License-Identifier: AGPL-3.0-or-later """Google (News) For detailed description of the *REST-full* API see: `Query Parameter Definitions`_. Not all parameters can be applied: - num_ : the number of search results is ignored - save_ : is ignored / Google-News results are always *SafeSearch* .. _Query Paramete...
lib
portmidi
""" Created using h2xml and xml2py """ from ctypes import * STRING = c_char_p pmBufferMaxSize = -9992 pmBadPtr = -9995 pmInternalError = -9993 pmBadData = -9994 pmNoData = 0 pmBufferTooSmall = -9997 pmInsufficientMemory = -9998 pmBufferOverflow = -9996 pmInvalidDeviceId = -9999 pmHostError = -10000 pmGotData = 1 pm...
formats
spc
# Copyright 2007 Joe Wreschnig # # 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 from senf import fsn2text, ...
PyObjCTest
test_nsscriptwhosetests
from Foundation import * from PyObjCTools.TestSupport import * class TestNSScriptWhoseTestsHelper(NSObject): def isEqualTo_(self, o): return 1 def isLessThanOrEqualTo_(self, o): return 1 def isLessThan_(self, o): return 1 def isGreaterThanOrEqualTo_(self, o): return ...
AddonManager
addonmanager_git
# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** # * * # * Copyright (c) 2022 FreeCAD Project Association * # * ...
installer
deploy
""" @file @brief Script used to deploy and publish openshot-qt @author Jonathan Thomas <jonathan@openshot.org> @section LICENSE Copyright (c) 2008-2016 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Video Editor (http://www.openshot.org), an open-source project dedicated...
community
payload
from typing import List from ipv8.messaging.lazy_payload import VariablePayload, vp_compile from ipv8.messaging.payload_dataclass import dataclass from ipv8.messaging.serialization import default_serializer from tribler.core.components.torrent_checker.torrent_checker.dataclasses import ( HealthInfo, ) @vp_compil...
dialogs
filelogviewer
# -*- coding: utf-8 -*- # # Copyright (C) 2013 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....
tornado
websocket
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals from urllib.parse import urlparse import tornado from tornado import escape, gen, websocket class SockJSWebSocketHandler(websocket.WebSocketHandler): if tornado.version_info[0] == 4 and tornado.version_inf...
svgview
view
# 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 ...
transfer
incoming
from __future__ import annotations import asyncio from typing import List, Optional from tribler.core.components.ipv8.eva.payload import Acknowledgement from tribler.core.components.ipv8.eva.result import TransferResult from tribler.core.components.ipv8.eva.transfer.base import Transfer from tribler.core.components.i...
ui
layout
"""Layout code from a simple XML description.""" from typing import Callable, Dict from defusedxml.ElementTree import fromstring from gi.repository import Gtk def is_maximized(window: Gtk.Window) -> bool: return window.is_maximized() or window.is_fullscreen() # type: ignore[no-any-return] widget_factory: Dic...
migrations
0292_property_definitions_persons_and_groups_support
# Generated by Django 3.2.16 on 2023-01-18 12:56 import posthog.models.utils from django.db import migrations, models class Migration(migrations.Migration): atomic = False dependencies = [ ("posthog", "0291_create_person_override_model"), ] operations = [ migrations.AddField( ...
lector
settings
# This file is a part of Lector, a Qt based ebook reader # Copyright (C) 2017-2019 BasioMeusPuga # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
declaration
key
# -*- coding: utf-8 -*- """This module defines utilitis for manipulations with the name of config option. """ import fnmatch from typing import Any, Iterable, Tuple, Union class Wildcard(str): """Dynamic part of the Pattern. Behaves as basic strings but adds angles around the value in human-readable for...
Scripts
findPython
#!/usr/bin/pythonw """ Find the library name for the current Python interpreter """ import sys import objc from Foundation import * def S(*args): return ''.join(args) # these are void* NSSymbol = 'I' NSModule = 'I' FUNCTIONS=[ ( u'NSIsSymbolNameDefined', S(objc._C_BOOL, objc._C_CHARPTR) ), ( u'NSLookup...
extractor
comedycentral
from __future__ import unicode_literals from .mtv import MTVServicesInfoExtractor class ComedyCentralIE(MTVServicesInfoExtractor): _VALID_URL = ( r"https?://(?:www\.)?cc\.com/(?:episodes|video(?:-clips)?)/(?P<id>[0-9a-z]{6})" ) _FEED_URL = "http://comedycentral.com/feeds/mrss/" _TESTS = [ ...
extractor
americastestkitchen
# coding: utf-8 from __future__ import unicode_literals import json import re from ..utils import clean_html, int_or_none, try_get, unified_strdate, unified_timestamp from .common import InfoExtractor class AmericasTestKitchenIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?(?:americastestkitchen|cooks(?:co...
Code
XMotorRespuesta
# -*- coding: utf-8 -*- import codecs import random from Code import ControlPosicion, Partida, VarGen from Code.Constantes import * class RespuestaMotor: def __init__(self, nombre, si_blancas): self.nombre = nombre self.sinInicializar = True self.mate = 0 self.puntos = 0 ...
meshes
mesh_plate_mystran_quad4
def create_nodes(femmesh): # nodes femmesh.addNode(0.0, 0.0, 0.0, 1) femmesh.addNode(2.0, 0.0, 0.0, 2) femmesh.addNode(4.0, 0.0, 0.0, 3) femmesh.addNode(6.0, 0.0, 0.0, 4) femmesh.addNode(8.0, 0.0, 0.0, 5) femmesh.addNode(10.0, 0.0, 0.0, 6) femmesh.addNode(0.0, 2.0, 0.0, 7) femmesh.ad...
logic
schema
# encoding: utf-8 import json from typing import Any, cast import ckan.lib.navl.dictization_functions as df import ckan.plugins as p from ckan.types import ( Context, FlattenDataDict, FlattenErrorDict, FlattenKey, Schema, Validator, ValidatorFactory, ) get_validator = p.toolkit.get_valida...
neubot
server
# neubot/server.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 General Public...
supysonic
config
# This file is part of Supysonic. # Supysonic is a Python implementation of the Subsonic server API. # # Copyright (C) 2013-2020 Alban 'spl0k' Féron # 2017 Óscar García Amor # # Distributed under terms of the GNU AGPLv3 license. import os import sys import tempfile from configparser import RawConfig...
utils
check
# -*- coding: utf-8 -*- import imp from collections.abc import Iterable, Mapping def is_bits_set(value, bits): """Checks if all bits are set in value or some bits are zero.""" return bits == (value & bits) def cmp(x, y): """Compare the two objects x and y and return an integer according to the outc...
utils
per_image_evaluation
# 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...
extractor
teletask
from __future__ import unicode_literals import re from ..utils import unified_strdate from .common import InfoExtractor class TeleTaskIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?tele-task\.de/archive/video/html5/(?P<id>[0-9]+)" _TEST = { "url": "http://www.tele-task.de/archive/video/html5/2...
commands
rebuild_elasticsearch_aip_index_from_files
"""Recreate the Elasticsearch index from AIPs stored on disk. This is a copy of: https://github.com/artefactual/archivematica-devtools/blob/1fd49faf2b415a4f4229da832445d22b35c262f4/tools/rebuild-elasticsearch-aip-index-from-files. This is useful if the Elasticsearch index has been deleted or damaged, but you still ha...
books
WenXue72
#!/usr/bin/env python # -*- coding:utf-8 -*- from base import BaseFeedBook # 继承基类BaseFeedBook from bs4 import BeautifulSoup # 导入BeautifulSoup处理模块 from bs4 import element from lib.urlopener import URLOpener # 导入请求URL获取页面内容的模块 # 返回此脚本定义的类名 def getBook(): return WenXue72 # 继承基类BaseFeedBook class WenXue72(BaseF...
paned
util
# Copyright 2013 Christoph Reiter # 2020 Nick Boultbee # 2021 Jej@github # # 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 opti...
Assembly
Preferences
# SPDX-License-Identifier: LGPL-2.1-or-later # /**************************************************************************** # * # Copyright (c) 2023 Ondsel <development@ondsel.com> * # ...
views
report
""" moderation via flagged posts and users """ from bookwyrm import emailing, forms, models from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.decorators import method_decorator from d...
draftguitools
gui_offset
# *************************************************************************** # * (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> * # * ...
migrations
upgrade44
""" Migration 44 - Signal distortion amplifier tiericide """ CONVERSIONS = { 25565: ( # Hypnos Compact Signal Distortion Amplifier I 25571, # Initiated Signal Distortion Amplifier I 25569, # Induced Signal Distortion Amplifier I 25567, # Compulsive Signal Distortion Amplifier I ), ...
Code
GestorResistance
from Code import Apertura, Gestor, Jugada, Util, XMotorRespuesta from Code.Constantes import * from Code.QT import QTUtil2 class GestorResistance(Gestor.Gestor): def inicio(self, resistance, numEngine, clave): self.tipoJuego = kJugBoxing self.resistance = resistance self.numEngine = numEn...
PyObjCTest
test_cgfunction
import os import Quartz from PyObjCTools.TestSupport import * from Quartz import * try: long except NameError: long = int class TestCGFunction(TestCase): def testFunctions(self): values = [] def evaluate(info, input, output): values.append(input) return input * 4...
usecases
usecase
"""Use case diagram item.""" from gaphor import UML from gaphor.diagram.presentation import Classified, ElementPresentation from gaphor.diagram.shapes import Box, Text, draw_ellipse from gaphor.diagram.support import represents from gaphor.diagram.text import FontStyle, FontWeight from gaphor.UML.recipes import stereo...
gui
mounts_manager_window
from gi.repository import Gdk, Gio, GLib, GObject, Gtk from sunflower.parameters import Parameters from sunflower.plugin_base.mount_manager_extension import ( ExtensionFeatures, MountManagerExtension, ) class MountsColumn: ICON = 0 NAME = 1 MARKUP_NAME = 2 URI = 3 OBJECT = 4 SYSTEM_WID...
osx
log
import objc NSUserNotification = objc.lookUpClass("NSUserNotification") NSUserNotificationCenter = objc.lookUpClass("NSUserNotificationCenter") NSObject = objc.lookUpClass("NSObject") import logging from plover import __name__ as __software_name__ from plover import log class NotificationHandler(logging.Handler): ...
gui
brushselectionwindow
# This file is part of MyPaint. # -*- coding: utf-8 -*- # Copyright (C) 2007-2013 by Martin Renold <martinxyz@gmx.ch> # Copyright (C) 2009-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...
Post
Processor
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it a...
extractor
dumpert
# coding: utf-8 from __future__ import unicode_literals from ..utils import int_or_none, qualities from .common import InfoExtractor class DumpertIE(InfoExtractor): _VALID_URL = r"(?P<protocol>https?)://(?:(?:www|legacy)\.)?dumpert\.nl/(?:mediabase|embed|item)/(?P<id>[0-9]+[/_][0-9a-zA-Z]+)" _TESTS = [ ...
util
Cached
import time class Cached(object): def __init__(self, timeout): self.cache_db = {} self.timeout = timeout def __call__(self, func): def wrapper(*args, **kwargs): key = "%s %s" % (args, kwargs) cached_value = None cache_hit = False if key ...
clientScripts
remove_directories
#!/usr/bin/env python # This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, ei...
xlgui
properties
# 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...
Models
GenericMaterialsModel
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from cura.Machines.Models.BaseMaterialsModel import BaseMaterialsModel class GenericMaterialsModel(BaseMaterialsModel): def __init__(self, parent=None): super().__init__(parent) self._onChanged() ...
puddlestuff
translations
import logging import re from PyQt5.QtWidgets import QApplication class UnicodeMod(str): """Emulates the arg method of QStrings. Not meant for use anywhere other than the translate function above.""" def arg(self, value): matches = [z for z in re.finditer(r"%(\d+)", self)] if not matches...
httpie
config
import json import os from pathlib import Path from typing import Any, Dict, Union from . import __version__ from .compat import is_windows from .encoding import UTF8 ENV_XDG_CONFIG_HOME = "XDG_CONFIG_HOME" ENV_HTTPIE_CONFIG_DIR = "HTTPIE_CONFIG_DIR" DEFAULT_CONFIG_DIRNAME = "httpie" DEFAULT_RELATIVE_XDG_CONFIG_HOME ...
migrations
0193_auto_20211222_0912
# Generated by Django 3.2.5 on 2021-12-22 09:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0192_event_properties"), ] operations = [ migrations.AddField( model_name="propertydefinition", name="prop...
osx
keyboardlayout
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Author: @abarnert, @willwade, and @morinted # Code taken and modified from # <https://github.com/willwade/PyUserInput/blob/master/pykeyboard/mac_keycode.py> # <https://stackoverflow.com/questions/1918841/how-to-convert-ascii-character-to-cgkeycode> import ctypes import ...
Start
Init
# *************************************************************************** # * Copyright (c) 2001,2002 Juergen Riegel <juergen.riegel@web.de> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
lib
env_configparser
import configparser import functools import os def fallback_option(fn): def wrapper(*args, **kwargs): fallback = kwargs.pop("fallback", None) try: return fn(*args, **kwargs) except (configparser.NoSectionError, configparser.NoOptionError): if fallback: ...
dom
interface
from bs4 import BeautifulSoup from constants import * from js2py.base import * from StringIO import StringIO try: import lxml def parse(source): return BeautifulSoup(source, 'lxml') except: def parse(source): return BeautifulSoup(source) x = '''<table> <tbody> <tr> <td>Sh...
user-management
sync
import logging from apps.grafana_plugin.helpers.client import GcomAPIClient, GrafanaAPIClient from apps.user_management.models import Organization, Team, User from apps.user_management.signals import org_sync_signal from celery.utils.log import get_task_logger from django.conf import settings from django.utils import ...
scripts
doctor_test
__copyright__ = "Copyright (C) 2014-2016 Martin Blais" __license__ = "GNU GPLv2" import os import re import tempfile import textwrap import unittest from os import path from beancount.parser import cmptest from beancount.scripts import directories_test from beancount.scripts.doctor import doctor from beancount.utils...
requests
models
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .auth import HTTPBasicAuth from .compat import ( StringIO, basestring, builtin_str, bytes...
Http
ClusterPrinterStatus
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from itertools import product from typing import Any, Dict, List, Optional, Union from cura.PrinterOutput.Models.PrinterConfigurationModel import ( PrinterConfigurationModel, ) from cura.PrinterOutput.Models.PrinterOutp...
calculix
write_constraint_transform
# *************************************************************************** # * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
rights
forms
# 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, either version 3 of the ...
process-manager
manager
from __future__ import annotations import logging import sqlite3 import sys from contextlib import contextmanager from pathlib import Path from threading import Lock from typing import ContextManager, List, Optional from tribler.core.utilities.process_manager import sql_scripts from tribler.core.utilities.process_man...
widgets
hardware_dialog
#!/usr/bin/env python3 """ This file is part of the Stargate project, Copyright Stargate 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; version 3 of the License. This program is distributed i...