section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
widgets | tab_label | from gi.repository import Gdk, Gtk, Pango
class TabLabel:
"""Tab label wrapper class"""
MAX_CHARS = 20
def __init__(self, application, parent):
self._container = Gtk.EventBox.new()
self._application = application
self._parent = parent
# initialize tab events
sel... |
conf | remote | from __future__ import absolute_import
import logging
import os
import warnings
from raven.exceptions import InvalidDsn
from raven.utils.compat import PY2, text_type
from raven.utils.encoding import to_string
from raven.utils.urlparse import parse_qsl, urlparse
ERR_UNKNOWN_SCHEME = "Unsupported Sentry DSN scheme: {0... |
renderers | message | from apps.alerts.incident_appearance.renderers.telegram_renderer import (
AlertGroupTelegramRenderer,
AlertTelegramRenderer,
)
from apps.alerts.incident_log_builder import IncidentLogBuilder
from apps.alerts.models import AlertGroup, AlertGroupLogRecord
from apps.base.models import UserNotificationPolicyLogReco... |
cli | tests | #!/usr/bin/env python3
__package__ = "archivebox.cli"
import os
import shutil
import sys
import unittest
from contextlib import contextmanager
from pathlib import Path
TEST_CONFIG = {
"USE_COLOR": "False",
"SHOW_PROGRESS": "False",
"OUTPUT_DIR": "data.tests",
"SAVE_ARCHIVE_DOT_ORG": "False",
"SA... |
draftguitools | gui_subelements | # ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
sabnzbd | interface | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
clientScripts | copy_transfers_metadata_and_logs | #!/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... |
gdist | zsh_completions | # Copyright 2016 Christoph Reiter
#
# 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, modify, merge, publish,
# dist... |
logtool | logwidget | # 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
... |
urllib3 | poolmanager | import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, port_by_scheme
from .exceptions import LocationValueError, MaxRetryError
from .... |
core | start_core | import asyncio
import logging
import logging.config
import os
import signal
import sys
from pathlib import Path
from typing import List, Optional
from tribler.core import notifications
from tribler.core.check_os import check_and_enable_code_tracing, set_process_priority
from tribler.core.components.bandwidth_accountin... |
PyObjCTest | test_leaks | """
Check if we manage retainCounts correctly.
"""
import gc
import objc
from PyObjCTest.fnd import *
from PyObjCTools.TestSupport import *
LeaksDel = 0
class LeaksClass(NSObject):
def init(self):
self = super(LeaksClass, self).init()
return self
def __del__(self):
global LeaksDel
... |
json | encoding | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
import json
from collections import OrderedDict
from typing import Any, Callable, Dict
try:
from typing import OrderedDict... |
colors | changers | # This file is part of MyPaint.
# Copyright (C) 2015 by Andrew Chadwick <a.t.chadwick@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, or
# (at your ... |
tools | gen_bazel_rule | #!/usr/bin/env python3
"""Generate a Bazel rule from source code, mainly to automatically (mostly) compute deps.
"""
import argparse
import re
import textwrap
from os import path
def get_deps(filename):
deps = set()
for line in open(filename):
if "beancount" not in line:
continue
... |
qltk | icons | # Copyright 2014 Christoph Reiter
# 2016 Nick Boultbee
# 2020 Daniel Petrescu
#
# 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... |
program | cdrdao | import logging
import os
import re
import shutil
import subprocess
import tempfile
from subprocess import PIPE, Popen
from whipper.common.common import truncate_filename
from whipper.extern import asyncsub
from whipper.extern.task import task
from whipper.image.toc import TocFile
logger = logging.getLogger(__name__)
... |
migrations | upgrade35 | """
Migration 35
- Remove builtin damage patterns and target profiles from the database
"""
import sqlalchemy
dmgPatterns = (
"Uniform",
"[Bombs]Concussion Bomb",
"[Bombs]Electron Bomb",
"[Bombs]Scorch Bomb",
"[Bombs]Shrapnel Bomb",
"[Exotic Plasma]Baryon",
"[Exotic Plasma]Meson",
"[E... |
scenarios | slack_renderer | import typing
import humanize
from apps.alerts.incident_log_builder import IncidentLogBuilder
if typing.TYPE_CHECKING:
from apps.alerts.models import AlertGroup
class AlertGroupLogSlackRenderer:
@staticmethod
def render_incident_log_report_for_slack(alert_group: "AlertGroup"):
from apps.alerts.m... |
songsmenu | console | # Copyright (C) 2006 - Steve Frécinaux
# 2016-17 - Nick Boultbee
# 2021 - halfbrained@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 Li... |
activitypub | base_activity | """ basics for an activitypub serializer """
from __future__ import annotations
import logging
from dataclasses import MISSING, dataclass, fields
from json import JSONEncoder
from typing import Any, Optional, TypeVar, Union, overload
import requests
from bookwyrm import models
from bookwyrm.connectors import Connecto... |
sk1 | app_cms | # -*- 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.... |
Http | ClusterPrintJobConfigurationChange | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from ..BaseModel import BaseModel
class ClusterPrintJobConfigurationChange(BaseModel):
"""Model for the types of changes that are needed before a print job can start"""
def __init__(
... |
stpa | stpatoolbox | """The definition for the STPA section of the RAAML toolbox."""
from gaphor.diagram.diagramtoolbox import ToolDef, ToolSection, new_item_factory
from gaphor.i18n import gettext
from gaphor.RAAML import diagramitems, raaml
from gaphor.SysML import diagramitems as sysml_items
from gaphor.UML import diagramitems as uml_i... |
scripts | fanuc_post | # ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2021 shadowbane1000 <tyler@colberts.us> *
# * *
# * Th... |
query | _parser | # Copyright 2004-2005 Joe Wreschnig, Michael Urman
# 2016 Ryan Dellenbaugh
# 2017-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 o... |
frescobaldi-app | cachedproperty | # cachedproperty.py -- a property that caches its asynchronously computed value
#
# Copyright (c) 2012 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
# o... |
widgets | shortcuteditdialog | # 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
... |
widgets | multifx_tooltips | class MultiFXInfo:
def __init__(
self,
index: int,
tooltip: str,
):
self.index = index
self.tooltip = tooltip
MULTIFX_INFO = {
"Off": MultiFXInfo(0, "No effect in this slot"),
"LP2": MultiFXInfo(1, "2 pole lowpass filter"),
"LP4": MultiFXInfo(2, "4 pole lowp... |
v0 | ldap_dev_code | from abc import ABCMeta
import ldap # @UnresolvedImport
# LDAP settings
class LDAP_settings:
# fields and their defaults
#
f_uri = "ldap://192.168.2.233"
f_base = "dc=opensusepdc,dc=quru,dc=com"
f_scope = ldap.SCOPE_SUBTREE
# bind credentials, if required
#f_bind_dn = "cn=james bond,cn... |
migrations | 0004_auto_20230425_1033 | # Generated by Django 3.2.18 on 2023-04-25 10:33
from django.db import migrations, models
from django_add_default_value import AddDefaultValue
class Migration(migrations.Migration):
dependencies = [
("mobile_app", "0003_mobileappusersettings"),
]
operations = [
migrations.AddField(
... |
MeshPart | InitGui | # MeshPart gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
# ***************************************************************************
# * Copyright (c) 2002 Juergen Riegel <juergen.... |
lib | tiledsurface | # This file is part of MyPaint.
# Copyright (C) 2009-2018 by the MyPaint Development Team.
# Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch>
#
# 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 Fou... |
src | debug | """
Logging and debuging facility
-----------------------------
Levels:
DEBUG
Detailed information, typically of interest only when diagnosing problems.
INFO
Confirmation that things are working as expected.
WARNING
An indication that something unexpected happened, or indicative of
some problem ... |
gui | cursor | # This file is part of MyPaint.
# Copyright (C) 2012-2018 by the MyPaint Development Team
# Copyright (C) 2009-2013 by Martin Renold <martinxyz@gmx.ch>
#
# 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 Foun... |
heartbeat | webhook | from pathlib import PurePath
from apps.integrations.metadata.heartbeat._heartbeat_text_creator import (
HeartBeatTextCreator,
)
integration_verbal = PurePath(__file__).stem
creator = HeartBeatTextCreator(integration_verbal)
heartbeat_text = creator.get_heartbeat_texts()
heartbeat_expired_title = heartbeat_text.h... |
extractor | medialaan | from __future__ import unicode_literals
import re
from ..utils import extract_attributes, int_or_none, mimetype2ext, parse_iso8601
from .common import InfoExtractor
class MedialaanIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
(?:
(?:em... |
configmanager | predefined_user_files | # 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... |
mylar | moveit | import ast
import os
import shutil
import mylar
from mylar import db, filechecker, helpers, logger, updater
def movefiles(comicid, comlocation, imported):
# comlocation is destination
# comicid is used for rename
files_moved = []
try:
imported = ast.literal_eval(imported)
except ValueErro... |
syncserver | staticnode | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
"""
Simple node-assignment backend using a single, static node.
This is a greatly-simplified node-assignment backend. I... |
docs | ext_github | """Creates Github links from @user and #issue text.
Bascially a much simplified version of sphinxcontrib.issuetracker
with support for @user.
"""
import re
from docutils import nodes
from docutils.transforms import Transform
GITHUB_ISSUE_URL = "https://github.com/{0}/issues/{1}"
GITHUB_USER_URL = "https://github.co... |
sabnzbd | downloader | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
PyObjCTest | test_nsdocument | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSDocument(TestCase):
def testConstants(self):
self.assertEqual(NSChangeDone, 0)
self.assertEqual(NSChangeUndone, 1)
self.assertEqual(NSChangeCleared, 2)
self.assertEqual(NSChangeRedone, 5)
self.assertEqua... |
downloader | common | from __future__ import division, unicode_literals
import os
import random
import re
import sys
import time
from ..compat import compat_os_name
from ..utils import (
decodeArgument,
encodeFilename,
error_to_compat_str,
format_bytes,
shell_quote,
timeconvert,
)
class FileDownloader(object):
... |
old | convert_doc | #!/usr/bin/env python3
"""Download and convert a single Google Docs to a nice Markdown doc.
This downloads one or more exports of a Google Docs document and converts it
through Pandoc and possibly other tools in order to produce the most faithful
conversion to Markdown. Unfortunately, Google's Markdown export is insuf... |
css | csspagerule | """CSSPageRule implements DOM Level 2 CSS CSSPageRule."""
__all__ = ["CSSPageRule"]
__docformat__ = "restructuredtext"
__version__ = "$Id$"
import xml.dom
from itertools import chain
import cssrule
import cssutils
from cssstyledeclaration import CSSStyleDeclaration
from marginrule import MarginRule
class CSSPageRul... |
extensions | ted_subtitles | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
import json
import logging
import os
import re
from datetime import timedelta
import gpodder
from gpodder import util
logger = logging.getLogger(__name__)
_ = gpodder.gettext
__title__ = _("Subtitle Downloader for TED Talks")
__description__ = _("Downloads .srt su... |
clientScripts | has_packages | #!/usr/bin/env python
import django
django.setup()
# dashboard
from fpr.models import FPRule
from main.models import Event, File, FileFormatVersion, Transfer
def is_extractable(f):
"""
Returns True if this file can be extracted, False otherwise.
"""
# Check if an extract FPRule exists
try:
... |
puddlestuff | genres | # -*- coding: utf-8 -*-
import os
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QHBoxLayout, QListWidgetItem, QWidget
from . import audioinfo
from .constants import CONFIGDIR
from .puddleobjects import ListBox, ListButtons
def load_genres(filepath=None):
if not filepath:
filepath = os.path.joi... |
Op | SurfaceSupport | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 russ4262 <russ4262@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
lib | system_messages | # 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, ... |
interface | filelist | #!/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 ... |
core | interpolate_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import textwrap
import unittest
from beancount import loader
from beancount.core import convert, data, interpolate, inventory, position
from beancount.core.amount import ZERO, A
from beancount.core.data import create_sim... |
flowblade-trunk | setup | #!/usr/bin/python3
"""
Flowblade Movie Editor is a nonlinear video editor.
Copyright 2012 Janne Liljeblad.
This file is part of Flowblade Movie Editor <https://github.com/jliljebl/flowblade/>.
Flowblade Movie Editor is free software: you can redistribute it and/or modify
it under the terms of the ... |
gui | pyqt_filter_stacked | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'pyqt_filter_stacked.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from . import icons_rc
from .bandgraphicsview import BandGraphicsVie... |
migrations | 0008_alter_alertgrouplogrecord_type | # Generated by Django 3.2.16 on 2023-01-19 18:06
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("alerts", "0007_populate_web_title_cache"),
]
operations = [
linter.IgnoreMigration(),
migra... |
engines | elasticsearch | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Elasticsearch
"""
from json import dumps, loads
from requests.auth import HTTPBasicAuth
from searx.exceptions import SearxEngineAPIException
base_url = "http://localhost:9200"
username = ""
password = ""
index = ""
search_url = base_url + "/" + index + "/_search"
que... |
devscripts | fish_completion | #!/usr/bin/env python
from __future__ import unicode_literals
import optparse
import os
import sys
from os.path import dirname as dirn
sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
import youtube_dl
from utils import read_file, write_file
from youtube_dl.utils import shell_quote
FISH_COMPLETION_FILE = "... |
PyObjCTest | test_nsatstypesetter | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSATSTypesetterHelper(NSATSTypesetter):
def willSetLineFragmentRect_forGlyphRange_usedRect_baselineOffset_(
self, lineRect, glyphRange, usedRect, offset
):
return None
def shouldBreakLineByWordBeforeCharacterAtIndex_(sel... |
fpr | utils | from django.apps import apps
from django.contrib import messages
from django.utils.translation import ugettext as _
# ########## DEPENDENCIES ############
def dependent_objects(object_):
"""Returns all the objects that rely on 'object_'."""
related_objects = [
f
for f in object_._meta.get_fie... |
plover | translation | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""Stenography translation.
This module handles translating streams of strokes in translations. Two classes
compose this module:
Translation -- A data model class that encapsulates a sequence of Stroke objects
in the context of a particular dictionary.... |
3MFReader | ThreeMFWorkspaceReader | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
import os
import xml.etree.ElementTree as ET
import zipfile
from configparser import ConfigParser
from typing import Any, Dict, List, Optional, Set, Tuple, cast
from cura.CuraApplication import CuraApplication
... |
cdn | fastly | # 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, ... |
Lector | setup | import codecs
from os import path
from lector.logger import VERSION
from setuptools import find_packages, setup
HERE = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with codecs.open(path.join(HERE, "README.md"), encoding="utf-8") as f:
LONG_DESC = f.read()
INSTALL_DEPS = [... |
channels | iqbal_gen | #!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: IQ Imbalance Generator
# Author: mettus
# Generated: Thu Aug 1 12:08:07 2013
##################################################
import math
from gnuradio import blocks, gr
from gnuradio.filter import firdes... |
archiver | info_cmd | import argparse
import textwrap
from datetime import timedelta
from ..archive import Archive
from ..constants import * # NOQA
from ..helpers import basic_json_data, format_timedelta, json_print
from ..logger import create_logger
from ..manifest import Manifest
from ._common import with_repository
logger = create_log... |
parts | palettepanel | # -*- 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.... |
gr | gateway | #
# Copyright 2011-2012, 2018, 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import ctypes
import numpy
from . import gr_python as gr
from .gr_python import io_signature # , io_signaturev
from .gr_python import block_gateway
#############... |
CGRotation | CGImageUtils | import math
from LaunchServices import * # UT info
from Quartz import *
class ImageInfo(object):
__slots__ = (
"fRotation",
"fScaleX",
"fScaleY",
"fTranslateX",
"fTranslateY",
"fImageRef",
"fProperties",
"fOrientation",
)
def __init__(self... |
views | users | from __future__ import annotations
import logging
import pkgutil
from html import escape
import sqlalchemy as sa
import sqlalchemy.exc
import sqlalchemy.orm
from abilian.core.extensions import db
from abilian.core.models.subjects import User
from abilian.i18n import _, _l
from abilian.sbe.apps.communities.models impo... |
OpenSCAD | tokrules | # -*- coding: utf8 -*-
# ***************************************************************************
# * Copyright (c) 2012 Keith Sloan <keith@sloan-home.co.uk> *
# * *
# * This program is free software; you can redistribute it a... |
views | views | from __future__ import annotations
import hashlib
import logging
from collections import Counter
from datetime import datetime
from functools import wraps
from io import BytesIO
from operator import attrgetter
from pathlib import Path
from time import gmtime, strftime
from typing import Any, Callable
import openpyxl
... |
KindleUnpack | mobi_ncx | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import, division, print_function, unicode_literals
import os
import re
from .mobi_index import MobiIndex
from .mobi_utils import toBase32
from .unipath import pathof
# note: re requites the... |
widgets | pysound | import os
from sglib.lib import util
from sgui.sgqt import *
PYSOUND_FOLDER = os.path.join(util.HOME, "presets")
class pysound_file:
"""Pre-production, work in progress..."""
def __init__(self, **kwargs):
self.name = None
self.hash = None
self.tags = []
self.plugin = None
... |
imageserver | imaging | #
# Quru Image Server
#
# Document: imaging.py
# Date started: 22 May 2018
# By: Matt Fozard
# Purpose: Front-end interface to the supported imaging back-ends
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify... |
preferences | commands | from gi.repository import Gtk
from sunflower.widgets.settings_page import SettingsPage
class Column:
TITLE = 0
COMMAND = 1
class CommandsOptions(SettingsPage):
"""Commands options extension class"""
def __init__(self, parent, application):
SettingsPage.__init__(self, parent, application, "c... |
AddonManager | install_to_toolbar | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
models | recommend | # 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, ... |
deluge-blocklist | core | #
# Copyright (C) 2008 Andrew Resch <andrewresch@gmail.com>
# 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... |
core | changesets | # -*- coding: utf-8 -*-
"""
flaskbb.core.changesets
~~~~~~~~~~~~~~~~~~~~~
Core interfaces for handlers, services, etc.
:copyright: (c) 2018 the FlaskBB Team
:license: BSD, see LICENSE for more details
"""
from abc import ABC, abstractmethod
from inspect import isclass
empty = None
class EmptyV... |
webpageview | plugin | # encoding: utf-8
from __future__ import annotations
import logging
from typing import Any
import ckan.plugins as p
from ckan.common import CKANConfig
from ckan.types import Context
log = logging.getLogger(__name__)
ignore_empty = p.toolkit.get_validator("ignore_empty")
unicode_safe = p.toolkit.get_validator("unicod... |
quickinsert | articulations | # 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
... |
utils | learning_schedules | # 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... |
extensions | exif_orientation_editor | import struct
from io import BytesIO
PREFIXES = [
b"MM\x00\x2A", # Valid TIFF header with big-endian byte order
b"II\x2A\x00", # Valid TIFF header with little-endian byte order
b"MM\x2A\x00", # Invalid TIFF header, assume big-endian
b"II\x00\x2A", # Invalid TIFF header, assume little-endian
]
EXIF... |
src | appinfo | # MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
from __future__ import print_function
import os
import sys
progname = "MusicPlayer"
appi... |
draftutils | groups | # -*- coding: utf-8 -*-
# ***************************************************************************
# * (c) 2009, 2010 *
# * Yorik van Havre <yorik@uncreated.net>, Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.... |
extractor | foxnews | from __future__ import unicode_literals
import re
from .amp import AMPIE
from .common import InfoExtractor
class FoxNewsIE(AMPIE):
IE_NAME = "foxnews"
IE_DESC = "Fox News and Fox Business Video"
_VALID_URL = r"https?://(?P<host>video\.(?:insider\.)?fox(?:news|business)\.com)/v/(?:video-embed\.html\?vide... |
examples | synth_to_chan | #!/usr/bin/env python
#
# Copyright 2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
import numpy
from gnuradio import blocks, filter, gr
try:
from gnuradio import analog
except ImportError:
sys.stderr.write("Error: ... |
lib | loid | import string
from datetime import datetime, timedelta
from urllib import quote, unquote
import pytz
from dateutil.parser import parse as date_parse
from pylons import app_globals as g
from . import hooks
from .utils import randstr, to_epoch_milliseconds
LOID_COOKIE = "loid"
LOID_CREATED_COOKIE = "loidcreated"
# how... |
playlist | remove_duplicates | # 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... |
versions | 061_338d460bc460_add_follower_group_table | # encoding: utf-8
"""061 Add follower group_table
Revision ID: 338d460bc460
Revises: 31ad11c518fc
Create Date: 2018-09-04 18:49:09.925977
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "338d460bc46... |
config-integrations | inbound_email | from django.conf import settings
# Main
enabled = True
title = "Inbound Email"
slug = "inbound_email"
short_description = None
description = None
is_displayed_on_web = settings.FEATURE_INBOUND_EMAIL_ENABLED
is_featured = False
is_able_to_autoresolve = True
is_demo_alert_enabled = True
# Default templates
slack_title... |
parser | version | """Implement common options across all programs."""
__copyright__ = "Copyright (C) 2018 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import re
import beancount
from beancount.parser import _parser
def compute_version_string(version, changeset, timestamp):
"""Compute a version string from the change... |
executors | asyncio | from __future__ import absolute_import
import sys
from apscheduler.executors.base import BaseExecutor, run_job
try:
from asyncio import iscoroutinefunction
from apscheduler.executors.base_py3 import run_coroutine_job
except ImportError:
from trollius import iscoroutinefunction
run_coroutine_job = N... |
posthog | celery | import os
import time
from random import randrange
from typing import Optional
from uuid import UUID
from celery import Celery
from celery.canvas import Signature
from celery.schedules import crontab
from celery.signals import (
setup_logging,
task_failure,
task_postrun,
task_prerun,
task_retry,
... |
win | setup_nsis | #!/usr/bin/env python
#
# Copyright (C) 2012-2015 Calum Lind <calumlind@gmail.com>
# Copyright (C) 2010 Damien Churchill <damoxc@gmail.com>
# Copyright (C) 2009-2010 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Jesper Lund <mail@jesperlund.com>
#
# This file is part of Deluge and is licensed under GNU Gene... |
internal | process | import _thread
import logging
import threading
import pykka
logger = logging.getLogger(__name__)
def exit_process():
logger.debug("Interrupting main...")
_thread.interrupt_main()
logger.debug("Interrupted main")
def sigterm_handler(_signum, _frame):
"""A :mod:`signal` handler which will exit the p... |
beetsplug | mpdupdate | # 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, ... |
migrations | 0270_add_uploaded_media | # Generated by Django 3.2.15 on 2022-10-13 10:24
import django.db.models.deletion
import posthog.models.utils
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0269_soft_delete_tiles"),
]
operations = [
... |
thumbor | doctor | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
# pylint: disable=no-member,line-too-long
import argparse
import sy... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.