section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
decrypters | FilefactoryComFolder | # -*- coding: utf-8 -*-
from ..base.simple_decrypter import SimpleDecrypter
class FilefactoryComFolder(SimpleDecrypter):
__name__ = "FilefactoryComFolder"
__type__ = "decrypter"
__version__ = "0.38"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?filefactory\.com/(?:f|folder)/\w+"
... |
urllib3 | exceptions | ## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
pass
class HTTPWarning(Warning):
"Base warning used by this module."
pass
class PoolError(HTTPError):
"Base exception for errors caused within a pool."
def __init__(self, pool, message):
self.po... |
models | query_cache | # 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, ... |
views | author | """ the good people stuff! the authors! """
from bookwyrm import forms, models
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.connectors import connector_manager
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.views.helpers import is_api_request, maybe_redirect_local_path
from django.contrib... |
frescobaldi-app | textedit | # 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
... |
signal | online_linear_2D_resampler | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 21 16:12:12 2012
@author: timothee
"""
import numpy as np
from friture_extensions.linear_interp import pyx_linear_interp_2D
from .scipy_resample import resample
class Online_Linear_2D_resampler:
def __init__(self, interp_factor_L=1, decim_factor_M=1, height=1):
... |
extractor | brightcove | # coding: utf-8
from __future__ import unicode_literals
import base64
import re
import struct
from ..compat import (
compat_etree_fromstring,
compat_HTTPError,
compat_parse_qs,
compat_urllib_parse_urlparse,
compat_urlparse,
compat_xml_parse_error,
)
from ..utils import (
ExtractorError,
... |
migrations | 0107_auto_20211016_0639 | # Generated by Django 3.2.5 on 2021-10-16 06:39
import bookwyrm.models.fields
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0106_user_preferred_language"),
]
operati... |
canvas | colors | """
Copyright 2008,2013 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from gi.repository import Gdk, Gtk, cairo
from .. import Constants
# import pycairo
def get_color(color_code):
color = Gdk.RGBA()
color.parse(color_code)
return color.r... |
legecy-translators | functions | """This module removes JS functions from source code"""
from jsparser import *
from utils import *
INLINE_NAME = 'PyJsLvalInline%d_'
INLINE_COUNT = 0
PRE_EXP_STARTS = {'return', 'new', 'void', 'throw', 'typeof', 'in', 'instanceof'}
PRE_ALLOWED = IDENTIFIER_PART.union({';', '{', '}', ']', ')', ':'})
INCREMENTS = {'++'... |
scripts | rrf_post | # -*- coding: utf-8 -*-
# *****************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2018-2019 Gauthier Briere *
# * Copyright (c) 2019-2020 Schildkroet ... |
metadata | mp4 | # 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... |
extractor | neteasemusic | # coding: utf-8
from __future__ import unicode_literals
import json
import re
import time
from base64 import b64encode
from binascii import hexlify
from datetime import datetime
from hashlib import md5
from random import randint
from ..aes import aes_ecb_encrypt, pkcs7_padding
from ..compat import compat_itertools_co... |
migrations | 0001_initial | import django_extensions.db.fields
import main.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("fpr", "__first__")]
operations = [
migrations.CreateModel(
name="Access",
fields=[
(
"id"... |
deluge-notifications | core | #
# Copyright (C) 2009-2010 Pedro Algarvio <pedro@algarvio.me>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is li... |
QT | PantallaArbolBook | import os
from Code import Books, ControlPosicion, Partida, VarGen
from Code.QT import Colocacion, Controles, Iconos, QTUtil2, QTVarios, Tablero
from PyQt4 import QtCore, QtGui
class UnMove:
def __init__(self, listaMovesPadre, book, fenBase, movBook):
self.listaMovesPadre = listaMovesPadre
self.l... |
localDrone | changeMutation | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localChangeMutation import (
CalcChangeLocalDroneMutationCommand,
)
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiChangeLocalDroneMutationCommand(wx.Com... |
dialogs | docinfodlg | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 by Maxim S. Barabash
#
# 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 versio... |
api | views_tasks_api | #
# Quru Image Server
#
# Document: views_tasks_api.py
# Date started: 29 Jan 2013
# By: Matt Fozard
# Purpose: Admin API for running system tasks
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
... |
PyObjCTest | test_cfrunloop | import CoreFoundation
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestRunLoop(TestCase):
def testTypes(self):
self.assertIsCFType(CFRunLoopRef)
self.assertIsCFType(CF... |
PyObjCTest | test_nsregularexpression | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSRegularExpression(TestCase):
@min_os_level("10.7")
def testConstants10_7(self):
self.assertEqual(NSRegularExpressionCaseInsensitive, 1 << 0)
self.assertEqual(NSRegularExpressionAllowCommentsAndWhitespace, 1 << 1)
... |
extractor | cda | # coding: utf-8
from __future__ import unicode_literals
import codecs
import re
from ..compat import compat_chr, compat_ord, compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
merge_dicts,
multipart_encode,
parse_duration,
random_birthday,
url... |
queries | groups_join_query | from typing import Dict, Optional, Tuple, Union
from ee.clickhouse.queries.column_optimizer import EnterpriseColumnOptimizer
from posthog.models import Filter
from posthog.models.filters.path_filter import PathFilter
from posthog.models.filters.retention_filter import RetentionFilter
from posthog.models.filters.sticki... |
parser | parser_test | """
Tests for parser.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import io
import sys
import tempfile
import textwrap
import unittest
from beancount.core import data
from beancount.core.number import D
from beancount.parser import _parser, grammar, lexer, parser
class Test... |
digital | cpm | #
# CPM modulation and demodulation.
#
#
# Copyright 2005-2007,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
# See gnuradio-examples/python/digital for examples
from math import pi
import numpy
from gnuradio import analog, blocks, filter, g... |
fec | qa_ecc_ccsds_27 | #!/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
#
#
import numpy as np
from gnuradio import blocks, fec, gr, gr_unittest
class test_ccsds_27(gr_unittest.TestCase):
def setUp(self):
sel... |
dictionary | json_dict | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
"""Parsing a json formatted dictionary.
"""
try:
import simplejson as json
except ImportError:
import json
from plover.dictionary.helpers import StenoNormalizer
from plover.steno import steno_to_sort_key
from plover.steno_dictionary import Ste... |
api | authentication | from typing import Any, Dict, List, Union
from django.core.exceptions import ValidationError as DjangoValidationError
from django.http.response import HttpResponse
from django.urls.base import reverse
from posthog.constants import AvailableFeature
from posthog.models.organization import OrganizationMembership
from pos... |
module | localReplace | import eos.db
import wx
from gui.fitCommands.helpers import ModuleInfo, activeStateLimit, restoreCheckedStates
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcReplaceLocalModuleCommand(wx.Command):
def __init__(
self,
fitID,
position,
ne... |
gui | dicom_preview_panel | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
utils | wsgi | """
This module implements WSGI related helpers adapted from ``werkzeug.wsgi``
:copyright: (c) 2010 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from raven.utils.compat import iteritems, urllib_quote
# `get_headers` comes... |
core | update | #
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to convert XML bindings to YAML bindings """
import glob
import logging
import os
import re
from ..tools import get_modname
from .base import ModTool, ModToolException
lo... |
classes | generalization | """Generalization --"""
from __future__ import annotations
from gaphor import UML
from gaphor.core.modeling import DrawContext
from gaphor.core.modeling.diagram import Diagram
from gaphor.diagram.presentation import LinePresentation
from gaphor.diagram.shapes import Box, Text
from gaphor.diagram.support import repres... |
PyObjCTest | test_nskeyvalueobservering | # NOTE: This file only contains basic tests of the keyvalue observing header definitions,
# test_keyvalue contains tests for the actualy KVC/KVO mechanisms.
from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSKeyValueObserving(TestCase):
... |
Gui | Sanity | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system.... |
client | execute_async | import hashlib
import json
import time
from dataclasses import asdict as dataclass_asdict
from dataclasses import dataclass
from time import perf_counter
from typing import Any, Optional
from clickhouse_driver import Client as SyncClient
from django.conf import settings as app_settings
from posthog import celery, redi... |
clientScripts | assign_uuids_to_directories | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 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... |
downloaders | FileStoreTo | # -*- coding: utf-8 -*-
import random
import re
from pyload.core.network.http.exceptions import BadHeader
from ..base.simple_downloader import SimpleDownloader
class FileStoreTo(SimpleDownloader):
__name__ = "FileStoreTo"
__type__ = "downloader"
__version__ = "0.16"
__status__ = "testing"
__pat... |
utils | infodict_mysql2file | #!/usr/bin/python
import os
import sys
import MySQLdb
import MySQLdb.cursors
if len(sys.argv) != 3:
print("Usage: {0} <prefix(nyaa|sukebei)> <outdir(info_dicts)>".format(sys.argv[0]))
sys.exit(1)
prefix = sys.argv[1]
outdir = sys.argv[2]
if not os.path.exists(outdir):
os.makedirs(outdir)
db = MySQLdb.c... |
image-resizing | imgix | # 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, ... |
Scripts | DistanceBolt | #! python
# -*- coding: utf-8 -*-
# (c) 2010 Werner Mayer LGPL
"""
An example for a high-level custom feature object to form a full-parametric distance bolt.
"""
__author__ = "Werner Mayer <wmayer@users.sourceforge.net>"
import math
import FreeCAD
import Part
from FreeCAD import Base
class DistanceBolt:
def _... |
extractor | sbs | # coding: utf-8
from __future__ import unicode_literals
from ..utils import ExtractorError, smuggle_url
from .common import InfoExtractor
class SBSIE(InfoExtractor):
IE_DESC = "sbs.com.au"
_VALID_URL = r"https?://(?:www\.)?sbs\.com\.au/(?:ondemand(?:/video/(?:single/)?|.*?\bplay=|/watch/)|news/(?:embeds/)?vi... |
addons | BypassCaptcha | # -*- coding: utf-8 -*-
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.network.request_factory import get_request
from ..base.addon import BaseAddon, threaded
class BypassCaptchaException(Exception):
def __init__(self, err):
self.err = err
def get_code(sel... |
logtool | errors | # 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
... |
digital | qa_diff_encoder | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import random
from gnuradio import blocks, digital, gr, gr_unittest
def make_random_int_list(L, min, max):
result = []
for x in ra... |
apatite | formatting | from boltons.iterutils import soft_sorted
# house = u"\u2302"
BULLET = "1."
INDENT = " " * 4
# sort of document the expected ones, even when they match the
# .title() pattern
_URL_LABEL_MAP = {
"wp": "WP",
"gh": "gh",
"home": "Home",
"repo": "Repo",
"docs": "Docs",
"pypi": "PyPI",
}
_URL_ORDE... |
views | resource | # encoding: utf-8
from __future__ import annotations
import cgi
import json
import logging
from typing import Any, Optional, Union
import ckan.lib.base as base
import ckan.lib.datapreview as lib_datapreview
import ckan.lib.helpers as h
import ckan.lib.navl.dictization_functions as dict_fns
import ckan.lib.uploader as... |
mixins | ratelimit_mixin | import logging
from abc import ABC, abstractmethod
from functools import wraps
from apps.integrations.tasks import start_notify_about_integration_ratelimit
from django.core.cache import cache
from django.http import HttpRequest, HttpResponse
from django.views import View
from ratelimit import ALL
from ratelimit.except... |
PyObjCTest | test_nsfileversion | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSFileVersion(TestCase):
@min_os_level("10.7")
def testContants10_7(self):
self.assertEqual(NSFileVersionAddingByMoving, 1 << 0)
self.assertEqual(NSFileVersionReplacingByMoving, 1 << 0)
@min_os_level("10.7")
def ... |
torrentlist | search_mode | #
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
from deluge.decor... |
beetsplug | plexupdate | """Updates an Plex library whenever the beets library is changed.
Plex Home users enter the Plex Token to enable updating.
Put something like the following in your config.yaml to configure:
plex:
host: localhost
port: 32400
token: token
"""
from urllib.parse import urlencode, urljoin
from ... |
clientScripts | identify_dspace_files | #!/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... |
draftviewproviders | view_polararray | # ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
apatite | dal | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import copy
import datetime
import io
import os
import attr
import schema
from boltons.dictutils import OMD
from boltons.fileutils import atomic_save, iter_find_files
from boltons.iterutils import redundant, soft_sorted, unique
from boltons.strutils imp... |
utils | file | # coding:utf-8
import gzip
import hashlib
import io
import os
import subprocess
from cactus.utils.helpers import checksum
from six import BytesIO, text_type
class FakeTime:
"""
Monkey-patch gzip.time to avoid changing files every time we deploy them.
"""
def time(self):
return 1111111111.111... |
mylar | updater | # 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... |
PostProcessingPlugin | Script | # Copyright (c) 2015 Jaime van Kessel
# Copyright (c) 2018 Ultimaker B.V.
# The PostProcessingPlugin is released under the terms of the LGPLv3 or higher.
import collections
import json
import re
from typing import TYPE_CHECKING, Any, Dict, List, Optional
# Setting stuff import
from UM.Application import Application
fr... |
frescobaldi-app | musicpreview | # 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
... |
queries | util | import json
from datetime import datetime, timedelta
from enum import Enum, auto
from typing import Any, Dict, Optional, Union
from zoneinfo import ZoneInfo
from django.utils import timezone
from posthog.cache_utils import cache_for
from posthog.models.event import DEFAULT_EARLIEST_TIME_DELTA
from posthog.models.team ... |
output | models | import argparse
from typing import Any, Dict, List, NamedTuple, Optional, Union
from httpie.cli.argtypes import PARSED_DEFAULT_FORMAT_OPTIONS
from httpie.cli.constants import PRETTY_MAP, PRETTY_STDOUT_TTY_ONLY, PrettyOptions
from httpie.context import Environment
from httpie.output.formatters.colors import AUTO_STYLE
... |
src | TaskSystem | """
Here are all subprocess, threading etc related utilities,
most of them quite low level.
"""
from __future__ import print_function
import os
import sys
from threading import Condition, Lock, RLock, Thread, currentThread
import Logging
from utils import *
try:
from StringIO import StringIO
except ImportError:... |
dev | rewrite_find_enums | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Find all PyQt enum instances."""
import ast
import pathlib
import PyQt5
def find_enums(tree):
"""Find all PyQt enums in an AST tree."""
for node in ast.walk(tree):
if not... |
PathTests | TestPathDrillGenerator | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
util | remotecommands | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2022-2023 Bob Swift
# Copyright (C) 2023 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundat... |
web | pluginmanager | #
# 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 os
from ... |
gpodder | log | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... |
linters | defintion | import json
import re
from pathlib import Path
from typing import Iterator
from ..diagnostic import Diagnostic
from ..replacement import Replacement
from .linter import Linter
class Definition(Linter):
"""Finds issues in definition files, such as overriding default parameters"""
def __init__(self, file: Pat... |
builders | preprocessor_builder_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... |
friture | ballistic_peak | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Timothée Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distri... |
eva | settings | from dataclasses import dataclass, field
@dataclass
class Retransmission:
# A limit for retransmit attempts
attempts: int = 3
# An interval after which the next attempt to retransmit will perform
interval: float = 3.0
@dataclass
class Termination:
# An interval after which the transfer will be c... |
Connection | ConnectionServer | import logging
import socket
import sys
import time
from collections import defaultdict
import gevent
import msgpack
import util
from Config import config
from Crypt import CryptConnection, CryptHash
from Debug import Debug
from gevent.pool import Pool
from gevent.server import StreamServer
from Site import SiteManage... |
HotKeyPython | HotKey | """HotKey.py
An example that shows how to use Carbon HotKeys from a PyObjC application,
and how to use an NSApplication subclass.
To build the demo program, run this line in Terminal.app:
$ python setup.py py2app -A
This creates a directory "dist" containing HotKey.app. (The
-A option causes the files to be sym... |
filters | convolution | # -*- 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
from thumbor.ext.filters import _convolution
from thumbor.filters import BaseFilter, f... |
utils | snoop_test | __copyright__ = "Copyright (C) 2014, 2016 Martin Blais"
__license__ = "GNU GPLv2"
import re
import unittest
from beancount.utils import snoop
class TestSnoop(unittest.TestCase):
def test_snoop(self):
history_len = 4
snoo = snoop.Snoop(history_len)
snoo(6)
self.assertEqual(6, sno... |
cddagl | win32 | import functools
import locale
import os
import sys
from ctypes import *
from ctypes.wintypes import *
from uuid import UUID
import win32api
import win32con
import win32event
import win32file
import win32gui
import win32pipe
import win32process
from pywintypes import error as WinError
from win32com.shell import shell,... |
downloaders | PorntrexCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class PorntrexCom(SimpleDownloader):
__name__ = "PorntrexCom"
__type__ = "downloader"
__version__ = "0.01"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?porntrex\.com/video/.+"
__config__ = ... |
RemotePyInterpreter | remote_console | import keyword
import os
import sys
import time
import traceback
from code import InteractiveConsole, softspace
import __builtin__
from StringIO import StringIO
try:
set
except NameError:
from sets import Set as set
class RemoteConsole(InteractiveConsole):
def __init__(self, pipe, **kw):
self.pip... |
Models | ConfigurationChangeModel | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt6.QtCore import QObject, pyqtProperty
BLOCKING_CHANGE_TYPES = ["material_insert", "buildplate_change"]
class ConfigurationChangeModel(QObject):
def __init__(
self, type_of_change: str, index: int, tar... |
migrations | 0097_auto_20210917_1858 | # Generated by Django 3.2.4 on 2021-09-17 18:58
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0096_merge_20210912_0044"),
]
operations = [
migrations.CreateModel(
name="IPBlocklist",
fields=[
... |
widgets | window | #
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# 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 li... |
autotag | match | # 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, ... |
extractor | peekvids | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
get_element_by_class,
int_or_none,
merge_dicts,
url_or_none,
)
from .common import InfoExtractor
class PeekVidsIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://(?:www\.)?peekvids\... |
gui | import_bitmap_panel | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
Code | ControlPosicion | import LCEngine4 as LCEngine
from Code import TrListas
FEN_INICIAL = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1"
class ControlPosicion:
def __init__(self):
self.liExtras = []
def posInicial(self):
"""
Se situa en el comienzo normal.
"""
self.leeFen(FEN_... |
comictaggerlib | exportwindow | """A PyQT4 dialog to confirm and set options for export to zip"""
# Copyright 2012-2014 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/L... |
datastore | helpers | # encoding: utf-8
from __future__ import annotations
import json
import logging
from typing import Any, Iterable, Optional, Sequence, Union, cast, overload
import ckan.common as converters
import ckan.plugins.toolkit as tk
import sqlparse
from ckan.types import Context
from typing_extensions import Literal
log = log... |
KindleUnpack | mobi_opf | #!/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 uuid
from datetime import datetime
from xml.sax.saxutils import escape as xmlescape
from .compatibility_utils import lzip,... |
extensions | rockbox_convert2mp4 | # -*- coding: utf-8 -*-
# Requirements: apt-get install python-kaa-metadata ffmpeg python-dbus
# To use, copy it as a Python script into ~/.config/gpodder/extensions/rockbox_mp4_convert.py
# See the module "gpodder.extensions" for a description of when each extension
# gets called and what the parameters of each exten... |
css | cssmediarule | """CSSMediaRule implements DOM Level 2 CSS CSSMediaRule."""
__all__ = ["CSSMediaRule"]
__docformat__ = "restructuredtext"
__version__ = "$Id$"
import xml.dom
import cssrule
import cssutils
class CSSMediaRule(cssrule.CSSRuleRules):
"""
Objects implementing the CSSMediaRule interface can be identified by the
... |
scenarios | slack_channel | import typing
from contextlib import suppress
from apps.slack.scenarios import scenario_step
from apps.slack.tasks import clean_slack_channel_leftovers
from apps.slack.types import EventPayload, EventType, PayloadType, ScenarioRoute
from django.utils import timezone
if typing.TYPE_CHECKING:
from apps.slack.models... |
mylar | weeklypull | # 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... |
WebServicesTool-CocoaBindings | WSTConnectionWindowControllerClass | """
Instances of WSTConnectionWindowController are the controlling object
for the document windows for the Web Services Tool application.
Implements a standard toolbar.
"""
from AppKit import *
from RPCMethod import *
from twisted.internet import defer
from twisted.web.xmlrpc import Proxy
# from twisted.python impor... |
src | UltimakerNetworkedPrinterAction | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional, cast
from cura.CuraApplication import CuraApplication
from cura.MachineAction import MachineAction
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal, pyqtSlot
from UM import i18nCatalog... |
misc | elf | # SPDX-FileCopyrightText: Florian Bruhin (The-Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Simplistic ELF parser to get the QtWebEngine/Chromium versions.
I know what you must be thinking when reading this: "Why on earth does qutebrowser have
an ELF parser?!". For one, because wri... |
widgets | _shared | from sglib.models import theme
from sgui.sgqt import *
KC_INTEGER = 0
KC_DECIMAL = 1
KC_PITCH = 2
KC_NONE = 3
KC_127_PITCH = 4
KC_127_ZERO_TO_X = 5
KC_LOG_TIME = 6
KC_127_ZERO_TO_X_INT = 7
KC_TIME_DECIMAL = 8
KC_HZ_DECIMAL = 9
KC_INT_PITCH = 10
KC_TENTH = 11
KC_MILLISECOND = 12
KC_127_PITCH_MIN_MAX = 13
KC_TEXT = 14
... |
puddlestuff | confirmations | # -*- coding: utf-8 -*-
import os
from PyQt5.QtWidgets import QApplication, QCheckBox, QVBoxLayout, QWidget
from .constants import CONFIGDIR
from .puddleobjects import PuddleConfig
from .translations import translate
NAME = "name"
DESC = "description"
SECTION = "Config"
VALUE = "value"
_filename = os.path.join(CONF... |
UiFileManager | UiFileManagerPlugin | import io
import os
import re
import urllib
from Config import config
from Plugin import PluginManager
from Translate import Translate
plugin_dir = os.path.dirname(__file__)
if "_" not in locals():
_ = Translate(plugin_dir + "/languages/")
@PluginManager.registerTo("UiRequest")
class UiFileManagerPlugin(object... |
lib | elasticSearchFunctions | # This file is part of Archivematica.
#
# Copyright 2010-2012 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 ... |
migrations | 0030_update_jhove_command | """Allow JHOVE bytestream to convey partial pass message instead of fail."""
from django.db import migrations
JHOVE_TOOL_UUID = "085d8690-93b7-4d31-84f7-2c5f4cbf6735"
OLD_JHOVE_CMD_UUID = "fe9e3046-29fb-4cc6-b71c-db50b0aac127"
NEW_JHOVE_CMD_UUID = "11036e14-78d9-4449-8360-e2da394279ad"
VALIDATE_WITH_JHOVE_RULES = (
... |
midifile | event | # Python midifile package -- parse, load and play MIDI files.
# Copyright (c) 2011 - 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
# of the License... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.