section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
scripts | hash_sizes | """
Compute hashtable sizes with nices properties
- prime sizes (for small to medium sizes)
- 2 prime-factor sizes (for big sizes)
- fast growth for small sizes
- slow growth for big sizes
Note:
this is just a tool for developers.
within borgbackup, it is just used to generate hash_sizes definition for _hash... |
extractor | spankbang | from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
determine_ext,
merge_dicts,
parse_duration,
parse_resolution,
str_to_int,
url_or_none,
urlencode_postdata,
urljoin,
)
from .common import InfoExtractor
class SpankBangIE(InfoExtractor):
_V... |
web | net | """
Network Utilities
(from web.py)
"""
__all__ = [
"validipaddr", "validipport", "validip", "validaddr",
"urlquote",
"httpdate", "parsehttpdate",
"htmlquote", "htmlunquote", "websafe",
]
import time
import urllib
try: import datetime
except ImportError: pass
def validipaddr(address):
"""
Returns ... |
anchor-generators | multiple_grid_anchor_generator | # 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... |
cherrypy | _cperror | """Exception classes for CherryPy.
CherryPy provides (and uses) exceptions for declaring that the HTTP response
should be a status other than the default "200 OK". You can ``raise`` them like
normal Python exceptions. You can also call them and they will raise
themselves; this means you can set an
:class:`HTTPError<ch... |
extensions | panel | # 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
... |
femviewprovider | view_element_rotation1D | # ***************************************************************************
# * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
bup | bloom | """Discussion of bloom constants for bup:
There are four basic things to consider when building a bloom filter:
The size, in bits, of the filter
The capacity, in entries, of the filter
The probability of a false positive that is tolerable
The number of bits readily available to use for addressing filter bits
There is... |
extractor | tvigle | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
parse_age_limit,
try_get,
url_or_none,
)
from .common import InfoExtractor
class TvigleIE(InfoExtractor):
IE_NAME = "tvigle"
IE_DESC = "Интернет-телевид... |
blocks | qa_packed_to_unpacked | #!/usr/bin/env python
#
# Copyright 2005,2007,2010,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, gr, gr_unittest
class test_packing(gr_unittest.TestCase):
def setUp(self):
random.seed(0... |
gui | meta | # -*- coding: utf-8 -*-
# This file is part of MyPaint.
# Copyright (C) 2007-2015 by Martin Renold <martinxyz@gmx.ch>
# Copyright (C) 2015-2016 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
... |
scripts | estlcam_post | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2018, 2019 Gauthier Briere *
# * Copyright (c) 2019, 2020 Schildkroet ... |
dev | check_coverage | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Enforce perfect coverage on some files."""
import dataclasses
import enum
import os
import os.path
import subprocess
import sys
from xml.etree import ElementTree
sy... |
equations | electricforce | # ***************************************************************************
# * Copyright (c) 2020 Wilfried Hortschitz <w.hortschitz@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
openssl | aes | import ctypes
import threading
from .._aes import AES
from ..fallback.aes import aes as fallback_aes
from .library import lib, openssl_backend
# Initialize functions
try:
lib.EVP_CIPHER_CTX_new.restype = ctypes.POINTER(ctypes.c_char)
except AttributeError:
pass
lib.EVP_get_cipherbyname.restype = ctypes.POINTE... |
gui | tribler_app | import logging
import os
import os.path
import sys
from typing import List
from PyQt5.QtCore import QCoreApplication, QEvent, Qt
from tribler.core.utilities.rest_utils import path_to_url
from tribler.core.utilities.unicode import ensure_unicode
from tribler.gui.code_executor import CodeExecutor
from tribler.gui.single... |
songsmenu | refresh | # Copyright 2013 Christoph Reiter
# 2016 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... |
Code | BMT | import copy
import Code.SQL.Base as SQLBase
class BMT(SQLBase.DBBase):
def __init__(self, nomFichero):
SQLBase.DBBase.__init__(self, nomFichero)
self.tabla = "DATOS"
if not self.existeTabla(self.tabla):
cursor = self.conexion.cursor()
for sql in (
... |
models | changelog_model | """
@file
@brief This file contains the git changelog model, used by the about window
@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-so... |
parser | booking_test | __copyright__ = "Copyright (C) 2015-2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import re
import textwrap
import unittest
from beancount.core.data import Booking
from beancount.parser import booking, cmptest, parser
BookingTestError = collections.namedtuple("BookingTestError", "source message en... |
adapter | amixr_recurring_ical_events_adapter | import datetime
import re
import typing
from collections import defaultdict
from apps.schedules.constants import (
ICAL_DATETIME_END,
ICAL_DATETIME_STAMP,
ICAL_DATETIME_START,
ICAL_RRULE,
ICAL_UID,
ICAL_UNTIL,
RE_EVENT_UID_V1,
RE_EVENT_UID_V2,
)
from apps.schedules.ical_events.proxy.ica... |
blocks | qa_tsb_vector_sink_X | #!/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 pmt
from gnuradio import blocks, gr, gr_unittest
class qa_tsb_vector_sink(gr_unittest.TestCase):
def setUp(self):
se... |
versions | 042_da65e2877034_user_revision_indexes | # encoding: utf-8
"""042 User revision indexes
Revision ID: da65e2877034
Revises: 6817d4e3bdc3
Create Date: 2018-09-04 18:49:03.380103
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "da65e2877034"
d... |
PyObjCTest | test_cfuuid | import re
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestCFUUIDAPI(TestCase):
def testTypes(self):
self.assertIsCFType(CFUUIDRef)
def testTypeID(self):
v = CFU... |
daw | shared | from collections import defaultdict
from sglib import constants
from sglib.lib import util
from sglib.lib.translate import _
from sglib.log import LOG
from sglib.math import clip_min
from sglib.models import theme
from sglib.models.daw import *
from sglib.models.daw.project import DawProject
from sgui import shared as... |
Sketcher | TestSketcherGui | # **************************************************************************
# Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
aliceVision | FeatureRepeatability | __version__ = "1.1"
from meshroom.core import desc
class FeatureRepeatability(desc.AVCommandLineNode):
commandLine = "aliceVision_samples_repeatabilityDataset {allParams}"
size = desc.DynamicNodeSize("input")
# parallelization = desc.Parallelization(blockSize=40)
# commandLineRange = '--rangeStart {r... |
bootstrap | archive | # coding:utf-8
import os
import shutil
import tarfile
import zipfile
from six.moves import urllib
class Folder(object):
def __init__(self, from_path):
self.from_path = from_path
def extractall(self, path):
os.rmdir(path)
shutil.copytree(self.from_path, path)
def close(self):
... |
cover | http | # Copyright 2013 Simonas Kazlauskas
# 2016-2023 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.
fr... |
dialogs | startdownloaddialog | import json
import logging
from binascii import unhexlify
from pathlib import PurePosixPath
from urllib.parse import unquote_plus
from PyQt5 import uic
from PyQt5.QtCore import QTimer, pyqtSignal
from PyQt5.QtWidgets import QFileDialog, QSizePolicy
from tribler.core.utilities.rest_utils import (
FILE_SCHEME,
M... |
duplicates | algwin | import os
import sys
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QDoubleValidator
from PyQt5.QtWidgets import (
QAction,
QApplication,
QCheckBox,
QComboBox,
QDialog,
QFrame,
QHBoxLayout,
QInputDialog,
QLabel,
QLineEdit,
QMessageBox,
QToolButton,
Q... |
beetsplug | types | # This file is part of beets.
# Copyright 2016, Thomas Scholtes.
#
# 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,... |
commands | rescan_photos | from django.conf import settings
from django.core.management.base import BaseCommand
from photonix.photos.utils.organise import rescan_photo_libraries
from photonix.photos.utils.redis import redis_connection
from photonix.photos.utils.system import missing_system_dependencies
from photonix.web.utils import logger
from ... |
AutoAdd | setup | #
# Copyright (C) 2009 GazpachoKing <chase.sterling@gmail.com>
# Copyright (C) 2011 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 <dam... |
classes | association | """
Association item - graphical representation of an association.
Plan:
- transform AssociationEnd in a (dumb) data class
- for association name and direction tag, use the same trick as is used
for line ends.
"""
from math import pi
from typing import Optional
from gaphas.connector import Handle
from gaphas.ge... |
meshes | mesh_eigenvalue_of_elastic_beam_tetra10 | def create_nodes(femmesh):
# nodes
femmesh.addNode(0.0, 0.0, 100.0, 1)
femmesh.addNode(0.0, 0.0, 0.0, 2)
femmesh.addNode(0.0, 200.0, 100.0, 3)
femmesh.addNode(0.0, 200.0, 0.0, 4)
femmesh.addNode(1000.0, 0.0, 100.0, 5)
femmesh.addNode(1000.0, 0.0, 0.0, 6)
femmesh.addNode(1000.0, 200.0, 10... |
util | pipeline | # 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, ... |
processors | abstract | # SPDX-License-Identifier: AGPL-3.0-or-later
from abc import ABC, abstractmethod
from searx import logger
logger = logger.getChild("searx.search.processor")
class EngineProcessor(ABC):
def __init__(self, engine, engine_name):
self.engine = engine
self.engine_name = engine_name
def get_para... |
bittorrent | client | # neubot/bittorrent/client.py
#
# Copyright (c) 2010-2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gen... |
aliceVision | PanoramaWarping | __version__ = "1.1"
import json
import os
from meshroom.core import desc
class PanoramaWarping(desc.AVCommandLineNode):
commandLine = "aliceVision_panoramaWarping {allParams}"
size = desc.DynamicNodeSize("input")
parallelization = desc.Parallelization(blockSize=5)
commandLineRange = "--rangeStart {r... |
extractor | rockstargames | # coding: utf-8
from __future__ import unicode_literals
from ..utils import int_or_none, parse_iso8601
from .common import InfoExtractor
class RockstarGamesIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?rockstargames\.com/videos(?:/video/|#?/?\?.*\bvideo=)(?P<id>\d+)"
_TESTS = [
{
"... |
context | markup | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
xl | radio | # 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... |
macosx | file_open_eventhandler | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 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
... |
accounts | DepositfilesCom | # -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
class DepositfilesCom(BaseAccount):
__name__ = "DepositfilesCom"
__type__ = "account"
__version__ = "0.39"
__status__ = "testing"
__description__ = """Depositfiles.com account plugin"""
__license__ = "GPLv3... |
UML | uml | # This file is generated by coder.py. DO NOT EDIT!
# ruff: noqa: F401, E402, F811
# fmt: off
from __future__ import annotations
from typing import Callable
from gaphor.core.modeling.element import Element
from gaphor.core.modeling.properties import association
from gaphor.core.modeling.properties import attribute as... |
extractor | jeuxvideo | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class JeuxVideoIE(InfoExtractor):
_VALID_URL = r"https?://.*?\.jeuxvideo\.com/.*/(.*?)\.htm"
_TESTS = [
{
"url": "http://www.jeuxvideo.com/reportages-videos-jeux/0004/00046170/tearaway-p... |
downloaders | QuickshareCz | # -*- coding: utf-8 -*-
import re
from datetime import timedelta
from ..base.simple_downloader import SimpleDownloader
class QuickshareCz(SimpleDownloader):
__name__ = "QuickshareCz"
__type__ = "downloader"
__version__ = "0.64"
__status__ = "testing"
__pattern__ = r"http://(?:[^/]*\.)?quickshar... |
PyObjCTest | test_nsdecimal | #
# Some tests for NSDecimal (C type) and NSDecimalNumber (Objective-C class)
#
import operator
import sys
import objc
from Foundation import *
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
if 0:
class TestNSDecimal(TestCase):
def testConstants(self):
s... |
plugins | sync_rsync | # Canto rsync Plugin
# by Jack Miller
# v1.1
# This implements a lightweight remote sync based around rsync to a remote
# server, or copying to mounted filesystem, etc.
ENABLED = False
# ENABLED = True
# SSH
# For ssh based rsync (remote hosts) you should have key authentication setup
# so it runs without prompting ... |
fighter | localRemove | import wx
from gui.fitCommands.helpers import FighterInfo
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcRemoveLocalFighterCommand(wx.Command):
def __init__(self, fitID, position):
wx.Command.__init__(self, True, "Remove Fighter")
self.fitID = fitID
... |
misc | httpclient | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""An HTTP client based on QNetworkAccessManager."""
import functools
import urllib.parse
from typing import MutableMapping
from qutebrowser.qt.core import QObject, QTimer, pyqtSignal
from qut... |
extractor | tvnet | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, unescapeHTML, url_or_none
from .common import InfoExtractor
class TVNetIE(InfoExtractor):
_VALID_URL = r"https?://(?:[^/]+)\.tvnet\.gov\.vn/[^/]+/(?:\d+/)?(?P<id>\d+)(?:/|$)"
_TESTS = [
{
#... |
apps | handlemail | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
# cdhigh <https://github.com/cdhigh>
"""
将发到string@appid.appspotmail.com的邮件正文转成附件发往kindle邮箱。
"""
import base64
import logging
import re
import urllib
import zlib
from email.Header import decode_header
from email.utils import collapse_rfc2231_value, parseaddr
impor... |
examples | example_costas | #!/usr/bin/env python
#
# Copyright 2011-2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from argparse import ArgumentParser
import numpy
from gnuradio import blocks, channels, digital, eng_notation, filter, gr
from gnuradio.eng_arg ... |
pdu | pdu_lambda | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015,2021 Tim O'Shea, Jacob Gilbert.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import time
import numpy as np
import pmt
from gnuradio import gr
class pdu_lambda(gr.basic_block):
"""
PDU Lambda Block
This block allows stat... |
xlgui | panels | # Copyright (C) 2014 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
lib | baseplate_integration | # 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 | tucao | #!/usr/bin/env python
__all__ = ["tucao_download"]
# import re
import random
import time
from xml.dom import minidom
from ..common import *
# possible raw list types
# 1. <li>type=tudou&vid=199687639</li>
# 2. <li>type=tudou&vid=199506910|</li>
# 3. <li>type=video&file=http://xiaoshen140731.qiniudn.com/lovestage04.f... |
translators | translator | import hashlib
import re
# from pyesprima import esprima
from . import pyjsparser, translating_nodes
# the re below is how we'll recognise numeric constants.
# it finds any 'simple numeric that is not preceded with an alphanumeric character
# the numeric can be a float (so a dot is found) but
# it does not recognise ... |
migrations | 0056_auto_20210321_0303 | # Generated by Django 3.1.6 on 2021-03-21 03:03
import bookwyrm.models.fields
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0055_auto_20210321_0101"),
]
operations = [
migrations.AddField(
... |
extractor | ntvru | # coding: utf-8
from __future__ import unicode_literals
from ..utils import int_or_none, strip_or_none, unescapeHTML, xpath_text
from .common import InfoExtractor
class NTVRuIE(InfoExtractor):
IE_NAME = "ntv.ru"
_VALID_URL = r"https?://(?:www\.)?ntv\.ru/(?:[^/]+/)*(?P<id>[^/?#&]+)"
_TESTS = [
{
... |
libtorrent | conftest | from unittest.mock import MagicMock
import pytest
from aiohttp import web
from tribler.core.components.libtorrent.download_manager.download import Download
from tribler.core.components.libtorrent.download_manager.download_config import (
DownloadConfig,
)
from tribler.core.components.libtorrent.torrentdef import T... |
ops | balance | """Automatic padding of gaps between entries.
"""
__copyright__ = "Copyright (C) 2013-2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
from beancount.core import account, amount, getters, realization
from beancount.core.data import Balance, Transaction
from beancount.core.number import ONE, ZERO
__pl... |
imageserver | filesystem_sync | #
# Quru Image Server
#
# Document: filesystem_sync.py
# Date started: 6 Dec 2012
# By: Matt Fozard
# Purpose: File system - Database synchronisation
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it u... |
inference | detection_inference | # 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... |
plugins | aggregations | """
This plugin provides the data for the "latest"-boxes on the frontpage. It has
to come after the event_info plugin as this is prepares the event data which
is used here.
"""
from collections import defaultdict
from pelican import generators, signals
from pelican.contents import Article
_categories = defaultdict(di... |
Resources | CommandFrame | """
Copyright 2009-2017 Olivier Belanger
This file is part of SoundGrain.
SoundGrain 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.
Sound... |
downloaders | BayfilesCom | # -*- coding: utf-8 -*-
import json
import re
from ..base.simple_downloader import SimpleDownloader
class BayfilesCom(SimpleDownloader):
__name__ = "BayfilesCom"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r"https://bayfiles.com/(?P<ID>\w+)"
__config__ ... |
restapi | knowledge_endpoint | import binascii
from typing import Optional, Tuple
from aiohttp import web
from aiohttp_apispec import docs
from ipv8.REST.schema import schema
from marshmallow.fields import Boolean, List, String
from pony.orm import db_session
from tribler.core.components.database.db.tribler_database import (
Operation,
Reso... |
ReaderWriters | ProfileWriter | # Copyright (c) 2015 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from UM.PluginObject import PluginObject
class ProfileWriter(PluginObject):
"""Base class for profile writer plugins.
This class defines a write() function to write profiles to files with.
"""
def __i... |
api | views_portfolios_api | #
# Quru Image Server
#
# Document: views_portfolios_api.py
# Date started: 7 Mar 2018
# By: Matt Fozard
# Purpose: API for managing and handling portfolios
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/... |
lib | paulstretch | #!/usr/bin/env python3
#
# Paul's Extreme Sound Stretch (Paulstretch) - Python version
# originally by Nasca Octavian PAUL, Targu Mures, Romania
#
# Forked to allow better integration with Stargate
"""
This file is part of the Stargate project, Copyright Stargate Team
This program is free software; you can redistribut... |
Machines | QualityNode | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, Union
import UM.FlameProfiler
from cura.Machines.ContainerNode import ContainerNode
from cura.Machines.IntentNode import IntentNode
from UM.Settings.ContainerRegistry import ContainerRegis... |
PathPythonGui | simple_edit_panel | import FreeCAD
import FreeCADGui
from PySide import QtGui
translate = FreeCAD.Qt.translate
PROP_TYPE_QTYES = ["App::PropertyDistance", "App::PropertyAngle"]
PROP_TYPE_NUMERIC = PROP_TYPE_QTYES + ["App::PropertyPercent", "App:PropertyFloat"]
class SimpleEditPanel:
"""A simple property edit panel for a FreeCAD ob... |
utils | qtutils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Misc. utilities related to Qt.
Module attributes:
MAXVALS: A dictionary of C/Qt types (as string) mapped to their maximum
value.
MINVALS: A dictionary of C/Qt types (as ... |
core | node | #!/usr/bin/env python
# coding:utf-8
import atexit
import copy
import datetime
import json
import logging
import os
import platform
import re
import shutil
import time
import types
import uuid
from collections import defaultdict, namedtuple
from enum import Enum
import meshroom
from meshroom.common import (
BaseOb... |
common | common | # -*- Mode: Python; test-case-name: whipper.test.test_common_common -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... |
extractor | fifa | # coding: utf-8
from __future__ import unicode_literals
from ..utils import int_or_none, traverse_obj, unified_timestamp
from .common import InfoExtractor
if not callable(getattr(InfoExtractor, "_match_valid_url", None)):
BaseInfoExtractor = InfoExtractor
import re
class InfoExtractor(BaseInfoExtractor)... |
common | l10n | import logging
import typing
from babel.core import UnknownLocaleError
from babel.dates import format_datetime, format_time
from django.utils import timezone
logger = logging.getLogger(__name__)
FALLBACK_LOCALE = "en"
def _format_dt(
func: typing.Callable[[timezone.datetime, typing.Optional[str]], str],
dt... |
downloaders | FastshareCz | # -*- coding: utf-8 -*-
import re
from datetime import timedelta
from pyload.core.utils.convert import to_bytes
from ..base.simple_downloader import SimpleDownloader
class FastshareCz(SimpleDownloader):
__name__ = "FastshareCz"
__type__ = "downloader"
__version__ = "0.45"
__status__ = "testing"
... |
draftguitools | gui_split | # ***************************************************************************
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
gui | gui | import importlib
import io
import logging
import sys
import time
from pathlib import Path
import PIL.Image
import remi.gui as gui
from app.drawing_dataset import DrawingDataset
from app.image_processor import ImageProcessor, model_path, tensorflow_model_name
from app.workflow import Workflow
from remi import App
cla... |
sabnzbd | config | #!/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... |
diagram | diagramtoolbox | """This module contains the actions used in the Toolbox (lower left section of
the main window).
We bind the Toolbox to a diagram. When a diagram page (tab) is switched,
the actions bound to the toolbuttons should change as well.
"""
import getpass
import time
from typing import (
Callable,
Collection,
Na... |
commands | backfill_persons_and_groups_on_events | import logging
from time import sleep
from typing import Any
from uuid import uuid4
import structlog
from django.conf import settings
from django.core.management.base import BaseCommand
from posthog.clickhouse.query_tagging import reset_query_tags, tag_queries
from posthog.client import sync_execute
from posthog.model... |
models | faster_rcnn_inception_resnet_v2_feature_extractor_test | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
extractor | radiocanada | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_HTTPError
from ..utils import ExtractorError, determine_ext, int_or_none, unified_strdate
from .common import InfoExtractor
class RadioCanadaIE(InfoExtractor):
IE_NAME = "radiocanada"
_VALID_URL = r"(?:radiocanada:... |
network | factory | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2019 Iván de Paz Centeno
#
# 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 l... |
reader | mobi8 | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = "GPL v3"
__copyright__ = "2012, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
import os
import re
import struct
from col... |
digital | qa_ofdm_chanest_vcvc | #!/usr/bin/env python3
# Copyright 2012-2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import random
import numpy
import pmt
from gnuradio import analog, blocks, digital, gr, gr_unittest
def shift_tuple(vec, N):
"""Shifts a vector by N el... |
sunflower | menus | from gi.repository import Gtk
class MenuManager:
"""Menu handling class
This class also supports local cache for menus used in 'Open With'
menu.
"""
_named_items = {}
_accel_group = None
def __init__(self, application):
self._application = application
def _item_normal(self... |
api | saved_query | from typing import Any, List
from posthog.api.routing import StructuredViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.hogql.context import HogQLContext
from posthog.hogql.database.database import SerializedField, serialize_fields
from posthog.hogql.errors import HogQLException
from postho... |
imageserver | counter | #
# Counter class (Python recipe)
# Bag/multiset class for convenient tallying of hashable objects
# http://code.activestate.com/recipes/576611-counter-class/
#
# Created by Raymond Hettinger on Mon, 12 Jan 2009
# Licensed under the MIT License
#
from heapq import nlargest
from operator import itemgetter
class Count... |
daw | transport | from sglib import constants
from sglib.lib import util
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.models.daw import *
from sglib.models.theme import get_asset_path
from sgui import shared as glbl_shared
from sgui.daw import shared
from sgui.daw import strings as daw_strings
from sgui.daw.... |
linux | keyboardcontrol_x11 | # -*- coding: utf-8 -*-
#
# Copyright (c) 2010 Joshua Harlan Lifton.
# See LICENSE.txt for details.
#
# keyboardcontrol.py - capturing and injecting X keyboard events
#
# This code requires the X Window System with the 'XInput2' and 'XTest'
# extensions and python-xlib with support for said extensions.
"""Keyboard cap... |
nested-json | tokens | from enum import Enum, auto
from typing import List, NamedTuple, Optional, Union
EMPTY_STRING = ""
HIGHLIGHTER = "^"
OPEN_BRACKET = "["
CLOSE_BRACKET = "]"
BACKSLASH = "\\"
class TokenKind(Enum):
TEXT = auto()
NUMBER = auto()
LEFT_BRACKET = auto()
RIGHT_BRACKET = auto()
PSEUDO = auto() # Not a r... |
localDrone | add | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand
from gui.fitCommands.helpers import DroneInfo, InternalCommandHistory
from service.fit import Fit
from service.market import Market
class GuiAddLocalDroneCommand(wx.... |
extractor | nonktube | from __future__ import unicode_literals
from .nuevo import NuevoBaseIE
class NonkTubeIE(NuevoBaseIE):
_VALID_URL = r"https?://(?:www\.)?nonktube\.com/(?:(?:video|embed)/|media/nuevo/embed\.php\?.*?\bid=)(?P<id>\d+)"
_TESTS = [
{
"url": "https://www.nonktube.com/video/118636/sensual-wife-u... |
clientScripts | manual_normalization_identify_files_included | #!/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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.