section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
Marketplace | LocalPackageList | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, Any, Dict, List, Optional
from PyQt6.QtCore import QObject, pyqtSlot
from UM.i18n import i18nCatalog
from UM.Logger import Logger
from UM.TaskManagement.HttpRequestManager import HttpReq... |
VersionUpgrade42to43 | VersionUpgrade42to43 | import configparser
import io
from typing import Dict, List, Tuple
from UM.VersionUpgrade import VersionUpgrade
_renamed_profiles = {
"generic_pla_0.4_coarse": "jbo_generic_pla_0.4_coarse",
"generic_pla_0.4_fine": "jbo_generic_pla_fine",
"generic_pla_0.4_medium": "jbo_generic_pla_medium",
"generic_pla... |
fta | dormantevent | """Dormant 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, IconBox, Text, draw_diamond
from gaphor.diagram.suppo... |
Scripts | subclassing_objective_c | #!/usr/bin/env python
# This is a doctest
"""
=========================================
Subclassing Objective-C classes in Python
=========================================
It is possible to subclass any existing Objective-C class in python.
We start by importing the interface to the Objective-C runtime, although
you'... |
calculix | write_constraint_tie | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
qltk | shortcuts | # Copyright 2016 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from gi.repository import Gtk
from ... |
femobjects | mesh_gmsh | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | historicfilms | from __future__ import unicode_literals
from ..utils import parse_duration
from .common import InfoExtractor
class HistoricFilmsIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?historicfilms\.com/(?:tapes/|play)(?P<id>\d+)"
_TEST = {
"url": "http://www.historicfilms.com/tapes/4728",
"md5"... |
operon | commands | # Copyright 2012,2013 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# TODO:
# RenameCommand
# Fill... |
widgets | main | from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
from .note_selector import NoteSelectorWidget
class main_widget:
def __init__(
self,
a_size,
a_rel_callback,
a_val_callback,
a_vol_port,
a_glide_port,
a_p... |
commands | populate_streams | """ Re-create user streams """
from bookwyrm import activitystreams, lists_stream, models
from django.core.management.base import BaseCommand
def populate_streams(stream=None):
"""build all the streams for all the users"""
streams = [stream] if stream else activitystreams.streams.keys()
print("Populating ... |
dataset-tools | create_pet_tf_record | # 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... |
cli | client | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import json
import click
import octoprint_client
from octoprint import FatalStartupError, init_settings
from octoprint.cli imp... |
vocoder | qa_gsm_full_rate | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest, vocoder
class test_gsm_vocoder(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.to... |
util | textencoding | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2004 Robert Kaye
# Copyright (C) 2006 Lukáš Lalinský
# Copyright (C) 2014 Sophist-UK
# Copyright (C) 2014, 2018, 2020-2021 Laurent Monin
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018-2019, 2021 Philipp Wolfer
# Copy... |
dialogs | addtopersonalchanneldialog | import json
from PyQt5 import QtWidgets, uic
from PyQt5.QtCore import pyqtSignal
from tribler.core.components.metadata_store.db.serialization import (
CHANNEL_TORRENT,
COLLECTION_NODE,
)
from tribler.gui.dialogs.dialogcontainer import DialogContainer
from tribler.gui.dialogs.new_channel_dialog import NewChanne... |
mobi | mobiml | '''
Transform XHTML/OPS-ish content into Mobipocket HTML 3.2.
'''
from __future__ import with_statement
__license__ = 'GPL v3'
__copyright__ = '2008, Marshall T. Vandegrift <llasram@gmail.cam>'
import copy
import re
from calibre.ebooks.oeb.base import (XHTML, XHTML_NS, barename, namespace,
... |
models | faster_rcnn_inception_resnet_v2_feature_extractor | # 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... |
modeling | stylesheet | from __future__ import annotations
import textwrap
from gaphor.core.modeling.element import Element
from gaphor.core.modeling.event import AttributeUpdated
from gaphor.core.modeling.properties import attribute
from gaphor.core.styling import CompiledStyleSheet, Style, StyleNode
SYSTEM_STYLE_SHEET = textwrap.dedent(
... |
events | synchronize_to_device | # Copyright 2018 Jan Korte
# 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 option) any later version.
import os... |
metrics-exporter | metrics_collectors | import re
import typing
from apps.alerts.constants import AlertGroupState
from apps.metrics_exporter.constants import (
ALERT_GROUPS_RESPONSE_TIME,
ALERT_GROUPS_TOTAL,
USER_WAS_NOTIFIED_OF_ALERT_GROUPS,
AlertGroupsResponseTimeMetricsDict,
AlertGroupsTotalMetricsDict,
RecalculateOrgMetricsDict,
... |
chardet | langcyrillicmodel | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
ModelChecker | ModelChecker | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os
from PyQt6.QtCore import QObject, QTimer, pyqtProperty, pyqtSignal, pyqtSlot
from UM.Application import Application
from UM.Extension import Extension
from UM.i18n import i18nCatalog
from UM.Logger import Logger
... |
windows | animation | """
@file
@brief This file loads the Animation dialog (i.e about Openshot Project)
@author Jonathan Thomas <jonathan@openshot.org>
@author Olivier Girard <olivier@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video ... |
context | combine | # -*- 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.... |
TableModelWithSearch | FilteringArrayController | #
# FilteringArrayController.py
# TableModelWithSearch
#
# Created by Bill Bumgarner on Sun Apr 04 2004.
# Copyright (c) 2004 __MyCompanyName__. All rights reserved.
#
import re
from Cocoa import *
kLiteralSearch = u'Literal Search'
kRegularExpressionSearch = u'Regular Expression Search'
def regexForSearchStrin... |
utils | invariants | """Functions to register auxiliary functions on a class' methods to check for invariants.
This is intended to be used in a test, whereby your test will setup a class to
automatically run invariant verification functions before and after each
function call, to ensure some extra sanity checks that wouldn't be used in
no... |
ops | pad | """Automatic padding of gaps between entries.
"""
__copyright__ = "Copyright (C) 2013-2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
from beancount.core import (
account,
amount,
data,
flags,
inventory,
position,
realization,
)
from beancount.ops import balance
from beanc... |
lexers | http | import re
import pygments
from httpie.output.lexers.common import precise
RE_STATUS_LINE = re.compile(r"(\d{3})( +)?(.+)?")
STATUS_TYPES = {
"1": pygments.token.Number.HTTP.INFO,
"2": pygments.token.Number.HTTP.OK,
"3": pygments.token.Number.HTTP.REDIRECT,
"4": pygments.token.Number.HTTP.CLIENT_ERR,
... |
commands | sync_replicated_schema | import logging
import re
from collections import defaultdict
from typing import Dict, Set
import structlog
from django.conf import settings
from django.core.management.base import BaseCommand
from posthog.clickhouse.schema import CREATE_TABLE_QUERIES, get_table_name
from posthog.client import sync_execute
from posthog... |
v22-webassets | plugin | # encoding: utf-8
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.common import CKANConfig
def most_popular_groups():
"""Return a sorted list of the groups with the most datasets."""
# Get a list of all the site's groups from CKAN, sorted by number of
# datasets.
grou... |
metadata | mod | # 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... |
gtk3 | filtertreeview | #
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# 2008 Andrew Resch <andrewresch@gmail.com>
# 2014 Calum Lind <calumlind@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 port... |
windows | release | # Run this script from Windows, not MSYS2
import json
import os
import shutil
import subprocess
CWD = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
"..",
),
)
os.chdir(CWD)
with open("meta.json") as f:
meta = json.load(f)
MAJOR_VERSION = meta["version"]["major"]
MINOR_VERSION ... |
ConfidentialStamper | ConfidentialStamper | """
Add a watermark to all pages in a PDF document
"""
import math
import os
import sys
from Foundation import *
from Quartz import *
def usage(name):
print >> sys.stderr, "Usage %s [inputfile]" % (name,)
class MyPDFData(object):
pdfDoc = None
mediaRect = None
# This is a simple function to create a ... |
engines | mixcloud | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Mixcloud (Music)
"""
from json import loads
from urllib.parse import urlencode
from dateutil import parser
# about
about = {
"website": "https://www.mixcloud.com/",
"wikidata_id": "Q6883832",
"official_api_documentation": "http://www.mixcloud.com/develope... |
ui | ui_options_maintenance | # -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MaintenanceOptionsPage(object):
def setupUi(self, MaintenanceOptionsPage):
MaintenanceOptionsPage.setObjectName("MaintenanceOptionsPage")
... |
mylar | cv | # This file is part of Mylar.
#
# Mylar 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.
#
# Mylar is distributed in the hope that... |
models | webhook | import json
import logging
import typing
from json import JSONDecodeError
import requests
from apps.webhooks.utils import (
OUTGOING_WEBHOOK_TIMEOUT,
InvalidWebhookData,
InvalidWebhookHeaders,
InvalidWebhookTrigger,
InvalidWebhookUrl,
apply_jinja_template_for_json,
parse_url,
)
from celery.... |
core | interpolate | """Code used to automatically complete postings without positions.
"""
__copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import copy
from decimal import Decimal
from beancount.core import convert, getters, inventory
from beancount.core.amount import Amount
from beanc... |
builders | anchor_generator_builder | # 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... |
cli | disable | #
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Disable blocks module """
import click
from ..core import ModToolDisable, get_block_candidates
from ..tools import SequenceCompleter
from .base import block_name, cli_input, comm... |
beetsplug | fetchart | # 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, ... |
beets | library | # 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, ... |
configmanager | configmanager_constants | # 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... |
src | class_sqlThread | """
sqlThread is defined here
"""
import os
import shutil # used for moving the messages.dat file
import sqlite3
import sys
import threading
import time
try:
import helper_sql
import helper_startup
import paths
import queues
import state
from addresses import encodeAddress
from bmconfigpa... |
migrations | 0102_dashboarditem_filters_hash | # Generated by Django 3.0.6 on 2020-11-24 11:39
import hashlib
from django.db import migrations, models
from posthog.models.filters import Filter
def generate_cache_key(stringified: str) -> str:
return "cache_" + hashlib.md5(stringified.encode("utf-8")).hexdigest()
def forward(apps, schema_editor):
Dashbo... |
extractor | livestream | from __future__ import unicode_literals
import itertools
import re
from ..compat import compat_str, compat_urlparse
from ..utils import (
determine_ext,
find_xpath_attr,
float_or_none,
int_or_none,
orderedSet,
parse_iso8601,
update_url_query,
xpath_attr,
xpath_text,
xpath_with_... |
Stats | setup | #
# Copyright (C) 2009 Ian Martin <ianmartin@cantab.net>
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is license... |
core | disable | #
# Copyright 2013, 2018, 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Disable blocks module """
import logging
import os
import re
import sys
from ..tools import CMakeFileEditor
from .base import ModTool, ModToolException
logger = logg... |
Resources | widgets | import math
import wx
from pyo.lib._wxwidgets import BACKGROUND_COLOUR
from Resources.constants import *
from wx.lib.embeddedimage import PyEmbeddedImage
KNOB = PyEmbeddedImage(
"iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABHNCSVQICAgIfAhkiAAAAAlw"
"SFlzAAALEgAACxIB0t1+/AAAABR0RVh0Q3JlYXRpb24gVGltZQA4Lzcv... |
filesystem-ajax | helpers | # 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 ... |
PathTests | TestRefactoredMach3Mach4Post | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2022 Larry Woestman <LarryWoestman2@gmail.com> *
# * ... |
projectedFit | add | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.projectedFit.add import CalcAddProjectedFitCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiAddProjectedFitsCommand(wx.Command):
def __init__(self, fitID... |
neubot | privacy | # neubot/privacy.py
#
# Copyright (c) 2011, 2013
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# 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 th... |
mopidy | httpclient | """Helpers for configuring HTTP clients used in Mopidy extensions."""
from __future__ import annotations
import platform
from typing import TYPE_CHECKING, Optional
import mopidy
if TYPE_CHECKING:
from mopidy.config import ProxyConfig
def format_proxy(proxy_config: ProxyConfig, auth: bool = True) -> Optional[s... |
requests | adapters | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import socket
from .auth import _basic_auth_str
from .compat import basestring, urlparse
from .cookies import extract_cookies_to_jar
from .exceptions... |
ui | infostatus | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2013, 2018, 2020-2022 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2019, 2021-2022 Philipp Wolfer
# Copyright (C) 2021 Gabriel Ferreira
#
# This program is free software; you can redistribute it and/o... |
qt | webkit | # pylint: disable=wildcard-import
"""Wrapped Qt imports for Qt WebKit.
All code in qutebrowser should use this module instead of importing from
PyQt/PySide directly. This allows supporting both Qt 5 and Qt 6
(though WebKit is only supported with Qt 5).
See machinery.py for details on how Qt wrapper selection works.
... |
classes | waveform | """
@file
@brief This file has code to generate audio waveform data structures
@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 open-source pr... |
cli | translation | # encoding: utf-8
from __future__ import annotations
import logging
import os
import re
from typing import Any, cast
import click
import polib
from ckan.common import config
from ckan.lib.i18n import build_js_translations
ckan_path = os.path.join(os.path.dirname(__file__), "..")
log = logging.getLogger(__name__)
... |
zeromq | qa_zeromq_sub | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import numpy
import zmq
from gnuradio import blocks, eng_notation, gr, gr_unittest, zeromq
class qa_zeromq_sub(gr_unittest.... |
tools | util_functions | #
# Copyright 2013, 2018, 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Utility functions for gr_modtool """
import re
import sys
try:
import readline
have_readline = True
except ImportError:
have_readline = False
# None of ... |
migrations | 0002_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import django.db.models.deletion
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("user_management", "0001_squashed_initial"),
("slack", "0... |
PyObjCTest | test_NULL | import objc
from PyObjCTools.TestSupport import *
setSignature = objc.setSignatureForSelector
# setSignature(b"OCTestNULL", "callOut:", "i@:o^i")
# setSignature(b"OCTestNULL", "callList:andInOut2:", "i@:@^i")
# setSignature(b"OCTestNULL", "callList:andInOut:", "i@:@N^i")
# setSignature(b"OCTestNULL", "callList:andIn:"... |
ui | collectionmenu | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2013 Michael Wiencek
# Copyright (C) 2014-2015, 2018, 2020-2022 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2018 Vishal Choudhary
# Copyright (C) 2018, 2022-2023 Philipp Wolfer
#
# This program is fr... |
mainwindow | windowundo | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Code for :undo --window."""
import collections
import dataclasses
from typing import TYPE_CHECKING, MutableSequence, cast
from qutebrowser.config import config
from qutebrowser.mainwindow i... |
misc | miscwidgets | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Misc. widgets used at different places."""
from typing import Optional
from qutebrowser.browser import inspector
from qutebrowser.config import config, configfiles
from qutebrowser.keyinput... |
lib | count | # 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, ... |
extractors | SevenZip | # -*- coding: utf-8 -*-
import os
import re
import subprocess
from pyload import PKGDIR
from pyload.core.utils.convert import to_str
from pyload.plugins.base.extractor import (
ArchiveError,
BaseExtractor,
CRCError,
PasswordError,
)
from pyload.plugins.helpers import renice
class SevenZip(BaseExtrac... |
contrib | pyopenssl | """SSL with SNI_-support for Python 2. Follow these instructions if you would
like to verify SSL certificates in Python 2. Note, the default libraries do
*not* do certificate checking; you need to do additional work to validate
certificates yourself.
This needs the following packages installed:
* pyOpenSSL (tested wi... |
lib | floodfill | # This file is part of MyPaint.
# Copyright (C) 2018-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... |
extractor | markiza | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import orderedSet, parse_duration, try_get
from .common import InfoExtractor
class MarkizaIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?videoarchiv\.markiza\.sk/(?:video/(?:[^/]+/)*|embed/)(?P<i... |
mixins | simplify | from typing import TYPE_CHECKING, Any, Dict, List, Literal, TypeVar, cast
from posthog.constants import PropertyOperatorType
from posthog.models.property import GroupTypeIndex, PropertyGroup
if TYPE_CHECKING: # Avoid circular import
from posthog.models import Property, Team
T = TypeVar("T")
class SimplifyFilt... |
gtk3 | menubar | #
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2011 Pedro Algarvio <pedro@algarvio.me>
#
# 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.
# S... |
pytz | tzfile | #!/usr/bin/env python
"""
$Id: tzfile.py,v 1.8 2004/06/03 00:15:24 zenzen Exp $
"""
try:
from cStringIO import StringIO
except ImportError:
from io import StringIO
from datetime import datetime, timedelta
from struct import calcsize, unpack
from pytz.tzinfo import (
DstTzInfo,
StaticTzInfo,
memor... |
negotiate | server_raw | # neubot/negotiate/server_raw.py
#
# Copyright (c) 2011-2012
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the... |
deluge-execute | gtkui | #
# 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
import gi # is... |
utilities | notifier | import inspect
import logging
from asyncio import AbstractEventLoop
from collections import defaultdict
from threading import Lock
from typing import Any, Callable, Dict, List, Optional, Tuple, TypeVar, cast
FuncT = TypeVar("FuncT", bound=Callable[..., Any])
class NotifierError(Exception):
pass
class Notifier:... |
bs4 | testing | """Helper classes for tests."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import copy
import functools
import pickle
import unittest
from unittest import TestCase
from bs4 import BeautifulSoup
from bs4.builder import HTMLParserTreeBuilde... |
downloaders | PornhostCom | # -*- coding: utf-8 -*-
import re
from ..base.downloader import BaseDownloader
class PornhostCom(BaseDownloader):
__name__ = "PornhostCom"
__type__ = "downloader"
__version__ = "0.27"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?pornhost\.com/\d+"
__config__ = [("enabled", "boo... |
Translate | Translate | import html
import inspect
import json
import logging
import os
import re
import string
from Config import config
translates = []
class EscapeProxy(dict):
# Automatically escape the accessed string values
def __getitem__(self, key):
val = dict.__getitem__(self, key)
if type(val) in (str, str... |
styling | compiler | """Compiler for CSS selectors.
Based on cssselect2.compiler, written by Simon Sapin and Guillaume
Ayoub.
"""
import re
from functools import singledispatch
from typing import Callable, Dict, Iterator, Literal, Tuple, Union
import tinycss2
from gaphor.core.styling import selectors
from gaphor.core.styling.declaration... |
qutebrowser | setup | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""setuptools installer script for qutebrowser."""
import ast
import os
import os.path
import re
import setuptools
from scripts import setupcommon as common
try:
B... |
util | Pooled | import gevent.pool
class Pooled(object):
def __init__(self, size=100):
self.pool = gevent.pool.Pool(size)
self.pooler_running = False
self.queue = []
self.func = None
def waiter(self, evt, args, kwargs):
res = self.func(*args, **kwargs)
if type(res) == gevent.e... |
archiver | rcreate_cmd | import argparse
from ..cache import Cache
from ..constants import * # NOQA
from ..crypto.key import key_argument_names, key_creator
from ..helpers import EXIT_WARNING, Location, location_validator, parse_storage_quota
from ..logger import create_logger
from ..manifest import Manifest
from ._common import Highlander, ... |
dialogs | palcoldlg | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 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.... |
validator | validator | # 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, ... |
migrations | 0158_auto_20220919_1634 | # Generated by Django 3.2.15 on 2022-09-19 16:34
import bookwyrm.models.fields
import django.utils.timezone
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0157_auto_20220909_2338"),
]
operations = [
migrations.AddField(
... |
lib | dicts | # 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 ... |
extractor | camdemy | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urllib_parse_urlencode, compat_urlparse
from ..utils import clean_html, parse_duration, str_to_int, unified_strdate
from .common import InfoExtractor
class CamdemyIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?ca... |
config | feature | __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"
from typing import List
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_attrs_docs
... |
backends | amidi | """Mido amidi backend
Very experimental backend using amidi to access the ALSA rawmidi
interface.
TODO:
* use parser instead of from_hex()?
* default port name
* do sysex messages work?
* starting amidi for every message sent is costly
"""
import os
import select
import subprocess
import threading
from ..messages i... |
engines | springer | # SPDX-License-Identifier: AGPL-3.0-or-later
"""Springer Nature (science)
"""
# pylint: disable=missing-function-docstring
from datetime import datetime
from json import loads
from urllib.parse import urlencode
from searx import logger
from searx.exceptions import SearxEngineAPIException
logger = logger.getChild("... |
utils | definitions | from pyparsing import *
IdentifierStart = oneOf(["$", "_"] + list(alphas))
Identifier = Combine(IdentifierStart + Optional(Word(alphas + nums + "$_")))
_keywords = [
"break",
"do",
"instanceof",
"typeof",
"case",
"else",
"new",
"var",
"catch",
"finally",
"return",
"void... |
PyObjCTest | helper_bridgesupport | import sys
sys.path.insert(0, sys.argv[1])
import objc
if not objc.__file__.startswith(sys.argv[1]):
print("Loaded objc from unexpected path")
sys.exit(1)
try:
unicode
except NameError:
unicode = str
passed = True
g = {}
objc.initFrameworkWrapper(
"AddressBook",
"/System/Library/Frameworks/... |
Scripts | Spring | #! python
# -*- coding: utf-8 -*-
# (c) 2011 Adrian Przekwas LGPL
from __future__ import division # allows floating point division from integers
import FreeCAD
import Part
from FreeCAD import Base
class MySpring:
def __init__(self, obj):
"""Add the properties: Pitch, Diameter, Height, BarDiameter"""
... |
controllers | paint_ctrl | # -*- 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.... |
migrations | 0036_session_recording_events_materialized_columns | from infi.clickhouse_orm import migrations
from posthog.client import sync_execute
from posthog.session_recordings.sql.session_recording_event_sql import (
MATERIALIZED_COLUMNS,
)
from posthog.settings import CLICKHOUSE_CLUSTER
def create_events_summary_mat_columns(database):
columns_to_add = [
"event... |
lib | archivematicaFunctions | # 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.