section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
extractor | gfycat | # coding: utf-8
from __future__ import unicode_literals
from ..utils import ExtractorError, float_or_none, int_or_none, qualities
from .common import InfoExtractor
class GfycatIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:www|giant|thumbs)\.)?gfycat\.com/(?:ru/|ifr/|gifs/detail/)?(?P<id>[^-/?#\.]+)"
_TEST... |
download-manager | download_manager | """
A wrapper around libtorrent
Author(s): Egbert Bouman
"""
import asyncio
import logging
import os
import time as timemod
from asyncio import CancelledError, gather, iscoroutine, shield, sleep, wait_for
from binascii import unhexlify
from copy import deepcopy
from shutil import rmtree
from typing import Callable, Di... |
mixins | browsable_instruction_mixin | import json
from common.api_helpers.utils import create_engine_url
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
class BrowsableInstructionMixin:
def get(self, request, *args, **kwargs):
template = loader.get_template("integration_link.html")
... |
puddlestuff | action_shortcuts | # -*- coding: utf-8 -*-
import os
from functools import partial
from PyQt5.QtCore import QFileSystemWatcher, QItemSelectionModel, pyqtSignal
from PyQt5.QtWidgets import (
QAction,
QApplication,
QDialog,
QHBoxLayout,
QLabel,
QLineEdit,
QListWidgetItem,
QPushButton,
QVBoxLayout,
)
fr... |
PathTests | TestPathPreferences | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
Network | ZeroConfClient | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from queue import Queue
from threading import Event, Thread
from time import time
from typing import Optional
from cura.CuraApplication import CuraApplication
from UM.Logger import Logger
from UM.Signal import Signal
from z... |
extractors | sina | #!/usr/bin/env python
__all__ = ["sina_download", "sina_download_by_vid", "sina_download_by_vkey"]
import urllib.parse
from hashlib import md5
from random import randint
from time import time
from xml.dom.minidom import parseString
from ..common import *
from ..util.log import *
def api_req(vid):
rand = "0.{0}... |
seedbox | disseminator | """
This script scans the input directory and create a Tribler channel based on
torrents found.
For available parameters see "parse_args" function below.
Folder structure:
my channel
├ sub_directory
| ├ file1.torrent
| └ file2.torrent
├ file3.torrent
├ thumbnail.png
└ description.md
"""
import argparse
import loggi... |
common | renamer | # -*- Mode: Python; test-case-name: whipper.test.test_common_renamer -*-
# 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
# t... |
drone | projectedChangeAmount | import wx
from gui.fitCommands.helpers import DroneInfo
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcChangeProjectedDroneAmountCommand(wx.Command):
def __init__(self, fitID, itemID, amount):
wx.Command.__init__(self, True, "Change Projected Drone Amount")
... |
frescobaldi-app | highlight2html | # 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
... |
clientScripts | create_mets_v2 | #!/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, ... |
models | cc_mapping | class CCMapping:
def __init__(self, a_cc_num):
self.cc_num = int(a_cc_num)
self.ports = {} # port_num : (low, high)
def set_port(self, a_port, a_low=0.0, a_high=1.0):
"""Return None on success or the ports on failure"""
a_port = int(a_port)
if len(self.ports) >= 5 and a... |
settings | engine | # 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... |
ops | documents_test | """
Tests for documents.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import textwrap
import unittest
from os import path
from beancount import loader
from beancount.core import data
from beancount.ops import documents
from beancount.parser import cmptest
from ... |
archiver | check_cmd | import argparse
from ..archive import ArchiveChecker
from ..constants import * # NOQA
from ..helpers import EXIT_ERROR, EXIT_SUCCESS, EXIT_WARNING, yes
from ..logger import create_logger
from ._common import Highlander, with_repository
logger = create_logger()
class CheckMixIn:
@with_repository(exclusive=True,... |
canto-next | protocol | # -*- coding: utf-8 -*-
# Canto - RSS reader backend
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import errno
import... |
natsort | unicode_numbers | # -*- coding: utf-8 -*-
"""
Contains all possible non-ASCII unicode numbers.
"""
from __future__ import absolute_import, division, print_function, unicode_literals
# Std. lib imports.
import unicodedata
# Local imports.
from natsort.compat.py23 import py23_unichr
# Rather than determine this on the fly, which would ... |
mixins | interval | from typing import cast
from posthog.constants import INTERVAL
from posthog.models.filters.mixins.base import IntervalType
from posthog.models.filters.mixins.common import DateMixin
from posthog.models.filters.mixins.utils import cached_property, include_dict
class IntervalMixin(DateMixin): # Interval doesn't make ... |
VersionUpgrade32to33 | VersionUpgrade32to33 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # To parse preference files.
import io # To serialise the preference files afterwards.
from typing import Dict, List, Tuple
from UM.VersionUpgrade import VersionUpgrade # We're inheriting from this.
... |
CIBevelSample | CIBevelView | from math import sin
import objc
from Cocoa import *
from Quartz import *
from SampleCIView import SampleCIView
NUM_POINTS = 4
class CIBevelView(SampleCIView):
currentPoint = objc.ivar(type=objc._C_INT)
points = objc.ivar()
angleTime = objc.ivar(type=objc._C_FLT)
lineImage = objc.ivar()
twirlFil... |
frescobaldi-app | log | # 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
... |
extractor | roosterteeth | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_HTTPError, compat_str
from ..utils import ExtractorError, int_or_none, str_or_none, urlencode_postdata
from .common import InfoExtractor
class RoosterTeethIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:.+?\.)?roosterteet... |
sglib | constants | import os
import pathlib
import platform
import sys
__all__ = [
"CONFIG_DIR",
"DEFAULT_PROJECT_DIR",
"HOME",
"IS_LINUX",
"IS_MACOS",
"IS_WINDOWS",
"LOG_DIR",
"MAJOR_VERSION",
"PRESET_DIR",
"USER_HOME",
]
MAJOR_VERSION = "stargate"
MIDI_CHANNELS = [str(x) for x in range(1, 17)]... |
commands | import_pronom_ids | import os
import sys
import uuid
from django.core.management.base import BaseCommand
from django.db import connection
from fpr.models import Format, FormatGroup, FormatVersion, IDCommand, IDRule
from lxml import etree
# Introduced in fpr/migrations/0035_python3_compatibility.py
FILE_BY_EXTENSION_CMD_UUID = "8546b624-... |
model | tag | # encoding: utf-8
from __future__ import annotations
from typing import Any, Optional
import ckan # this import is needed
import ckan.lib.dictization
import ckan.lib.maintain as maintain
import ckan.logic
import ckan.model
import ckan.model.core as core
import ckan.model.domain_object as domain_object
import ckan.mo... |
migrations | 0001_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import datetime
import apps.user_management.models.organization
import apps.user_management.models.team
import apps.user_management.models.user
import django.core.validators
import django.db.models.deletion
import django_migration_linter as linter
import mirage.fields
f... |
extractor | nhl | from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import determine_ext, int_or_none, parse_duration, parse_iso8601
from .common import InfoExtractor
class NHLBaseIE(InfoExtractor):
def _real_extract(self, url):
site, tmp_id = re.match(self._VALID_URL, url).gr... |
graphs | height_change | # -*- coding: utf-8 -*-
import plotly.graph_objs as go
import plotly.offline as plotly
from django.utils.translation import gettext as _
from reports import utils
def height_change(objects):
"""
Create a graph showing height over time.
:param objects: a QuerySet of Height instances.
:returns: a tuple ... |
Mesh | InitGui | # Mesh gui init module
# (c) 2004 Werner Mayer
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
# ***************************************************************************
# * Copyright (c) 2004 Werner Mayer <werner.wm.mayer@... |
gui | task_surface | # --------------------------------------------------------------------------
# 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... |
ui | ui_options_attached_profiles | # -*- 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_AttachedProfilesDialog(object):
def setupUi(self, AttachedProfilesDialog):
AttachedProfilesDialog.setObjectName("AttachedProfilesDialog")
... |
builtinItemStatsViews | itemEffects | import os
import subprocess
import config
# noinspection PyPackageRequirements
import wx
from .helpers import AutoListCtrl
_t = wx.GetTranslation
class ItemEffects(wx.Panel):
def __init__(self, parent, stuff, item):
wx.Panel.__init__(self, parent)
self.item = item
mainSizer = wx.BoxSi... |
dev | src2asciidoc | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Generate asciidoc source for qutebrowser based on docstrings."""
import argparse
import inspect
import os
import os.path
import shutil
import subprocess
import sys
i... |
extractor | francetv | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str, compat_urlparse
from ..utils import (
ExtractorError,
clean_html,
determine_ext,
int_or_none,
parse_duration,
try_get,
url_or_none,
urljoin,
)
from .common import InfoExtractor
from .dai... |
po | check_babel | import re
import sys
from pathlib import Path
import babel.messages.pofile as pofile
def invalid(messages):
placeholders = re.compile(r"{\w*}")
html_entity = re.compile(r"&\w+;")
for message in messages:
if not message.string or message.fuzzy:
continue
if "%" in message.id:
... |
logic | action | # encoding: utf-8
from __future__ import annotations
import logging
from typing import Any
import ckan.lib.navl.dictization_functions
import ckan.lib.search as search
import ckan.logic as logic
import ckan.model as model
import ckan.plugins as p
import ckanext.datastore.helpers as datastore_helpers
import ckanext.dat... |
clientScripts | transcribe_file | #!/usr/bin/env python
import multiprocessing
import os
from uuid import uuid4
import django
from django.db import transaction
django.setup()
import databaseFunctions
import fileOperations
# archivematicaCommon
from dicts import ReplacementDict
from django.conf import settings as mcpclient_settings
# dashboard
from ... |
Arch | ArchWindowPresets | # ***************************************************************************
# * Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
Debug | DebugMedia | import functools
import logging
import os
import re
import subprocess
import time
from Config import config
from util import helper
# Find files with extension in path
def findfiles(path, find_ext):
def sorter(f1, f2):
f1 = f1[0].replace(path, "")
f2 = f2[0].replace(path, "")
if f1 == "":... |
gdist | icons | # Copyright 2012-2016 Christoph Reiter
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
#... |
extractor | dotsub | from __future__ import unicode_literals
from ..utils import float_or_none, int_or_none
from .common import InfoExtractor
class DotsubIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?dotsub\.com/view/(?P<id>[^/]+)"
_TESTS = [
{
"url": "https://dotsub.com/view/9c63db2a-fa95-4838-8e6e-13... |
core | keypoint_ops | # 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... |
localModule | fillClone | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.module.localAdd import CalcAddLocalModuleCommand
from gui.fitCommands.helpers import (
InternalCommandHistory,
ModuleInfo,
restoreRemovedDummies,
)
from service.fit import Fit
class GuiFillWithClonedL... |
cli | themes | # -*- coding: utf-8 -*-
"""
flaskbb.cli.themes
~~~~~~~~~~~~~~~~~~
This module contains all theme commands.
:copyright: (c) 2016 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import os
import shutil
import sys
import click
from flask import current_app
from flask_themes2 im... |
gui | gui_mocks | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
modelmerge | editor | from __future__ import annotations
from gaphas.decorators import nonrecursive
from gaphor.core import event_handler
from gaphor.core.changeset.apply import applicable, apply_change
from gaphor.core.modeling import PendingChange
from gaphor.event import (
ModelLoaded,
TransactionBegin,
TransactionCommit,
... |
bitmessageqt | address_dialogs | """
Dialogs that work with BM address.
"""
# pylint: disable=attribute-defined-outside-init,too-few-public-methods,relative-import
import hashlib
import queues
import widgets
from account import AccountMixin, GatewayAccount, MailchuckAccount, accountClass
from addresses import addBMIfNotPresent, decodeAddress, encode... |
qltk | controls | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# 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 ... |
core | eventmanager | """Event Manager."""
from collections import deque
from gaphor.abc import Service
from generic.event import Event, Handler
from generic.event import Manager as _Manager
def event_handler(*event_types):
"""Mark a function/method as an event handler for a particular type of
event."""
def wrapper(func):
... |
downloaders | OneFichierCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class OneFichierCom(SimpleDownloader):
__name__ = "OneFichierCom"
__type__ = "downloader"
__version__ = "1.19"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?(?:(?P<ID1>\w+)\.)?(?P<HOST>1fichier\.... |
sequencer | atm_item | from sglib.lib import util
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.math import clip_min, clip_value
from sglib.models import theme
from sglib.models.daw import *
from sgui.daw import shared
from sgui.daw.shared import *
from sgui.plugins import *
from sgui.sgqt import *
from . import ... |
xlgui | main | # 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... |
senf | _stdlib | # -*- coding: utf-8 -*-
# Copyright 2016 Christoph Reiter
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify... |
network | httpd | """
src/network/httpd.py
=======================
"""
import asyncore
import socket
from tls import TLSHandshake
class HTTPRequestHandler(asyncore.dispatcher):
"""Handling HTTP request"""
response = """HTTP/1.0 200 OK\r
Date: Sun, 23 Oct 2016 18:02:00 GMT\r
Content-Type: text/html; charset=UTF-8\r
... |
generateTemplates | templateCPPFile | #! python
# -*- coding: utf-8 -*-
# (c) 2006 Juergen Riegel
import generateBase.generateModel_Module
import generateBase.generateTools
import template
class TemplateCPPFile(template.ModelTemplate):
def Generate(self):
generateBase.generateTools.ensureDir(self.path)
print("Generate() App Dir")
T... |
comicapi | issuestring | # coding=utf-8
"""Support for mixed digit/string type Issue field
Class for handling the odd permutations of an 'issue number' that the
comics industry throws at us.
e.g.: "12", "12.1", "0", "-1", "5AU", "100-2"
"""
# Copyright 2012-2014 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "Licens... |
extractor | amp | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
mimetype2ext,
parse_iso8601,
unified_timestamp,
url_or_none,
)
from .common import InfoExtractor
class AMPIE(InfoExtractor):
# parse Akamai Adaptive Media Player f... |
extractor | tva | # coding: utf-8
from __future__ import unicode_literals
from ..utils import float_or_none, int_or_none, smuggle_url, strip_or_none
from .common import InfoExtractor
class TVAIE(InfoExtractor):
_VALID_URL = r"https?://videos?\.tva\.ca/details/_(?P<id>\d+)"
_TESTS = [
{
"url": "https://vide... |
models | theme | try:
from sg_py_vendor.pymarshal.json import *
except ImportError:
from pymarshal.json import *
import json
import os
import re
import shutil
import jinja2
import yaml
from sglib.constants import HOME, MAJOR_VERSION
from sglib.lib.util import (
IS_WINDOWS,
SHARE_DIR,
THEMES_DIR,
get_file_setti... |
migrations | 0012_auto_20230406_1010 | # Generated by Django 3.2.18 on 2023-04-06 10:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("alerts", "0011_auto_20230329_1617"),
]
operations = [
migrations.AlterField(
model_name="alertgrouplogrecord",
name=... |
extractor | localnews8 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class LocalNews8IE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?localnews8\.com/(?:[^/]+/)*(?P<display_id>[^/]+)/(?P<id>[0-9]+)"
_TEST = {
"url": "http://www.localnews8.com/news/rexburg-business-... |
extractor | toggle | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
parse_iso8601,
strip_or_none,
)
from .common import InfoExtractor
class ToggleIE(InfoExtractor):
IE_NAME = "toggle"
_VALID_UR... |
digital | qa_diff_phasor_cc | #!/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, digital, gr, gr_unittest
class test_diff_phasor(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.to... |
builtinPreferenceViews | pyfaMarketPreferences | # noinspection PyPackageRequirements
import gui.globalEvents as GE
import gui.mainFrame
import wx
from gui.bitmap_loader import BitmapLoader
from gui.preferenceView import PreferenceView
from service.fit import Fit
from service.price import Price
from service.settings import MarketPriceSettings
from wx.lib.intctrl impo... |
engines | apkmirror | # SPDX-License-Identifier: AGPL-3.0-or-later
"""APKMirror
"""
# pylint: disable=invalid-name, missing-function-docstring
from urllib.parse import urlencode
from lxml import html
from searx import logger
from searx.utils import eval_xpath_getindex, eval_xpath_list, extract_text
logger = logger.getChild("APKMirror en... |
util | Noparallel | import time
import gevent
from gevent.event import AsyncResult
from . import ThreadPool
class Noparallel: # Only allow function running once in same time
def __init__(
self, blocking=True, ignore_args=False, ignore_class=False, queue=False
):
self.threads = {}
self.blocking = (
... |
extractors | git | __package__ = "archivebox.extractors"
from pathlib import Path
from typing import Optional
from ..config import (
CHECK_SSL_VALIDITY,
GIT_ARGS,
GIT_BINARY,
GIT_DOMAINS,
GIT_VERSION,
SAVE_GIT,
TIMEOUT,
)
from ..index.schema import ArchiveError, ArchiveOutput, ArchiveResult, Link
from ..log... |
bs4 | diagnose | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import cProfile
import os
import pstats
import random
import sys
import tempfile
import time
import traceback
import bs4
from b... |
migrations | 0227_add_dashboard_tiles | # Generated by Django 3.2.12 on 2022-04-08 11:13
import json
import structlog
from django.db import connection, migrations, models
def migrate_dashboard_insight_relations(apps, _) -> None:
logger = structlog.get_logger(__name__)
logger.info("starting_0227_add_dashboard_tiles")
DashboardTile = apps.get_m... |
saveddata | implantSet | # ===============================================================================
# Copyright (C) 2016 Ryan Holmes
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, e... |
Trayicon | TrayiconPlugin | import atexit
import os
import sys
from Config import config
from Plugin import PluginManager
from Translate import Translate
allow_reload = False # No source reload supported in this plugin
plugin_dir = os.path.dirname(__file__)
if "_" not in locals():
_ = Translate(plugin_dir + "/languages/")
@PluginManag... |
QT | InfoBase | # -*- coding: latin-1 -*-
import collections
import random
from Code import Util
class ThanksTo:
def __init__(self):
d = self.dic = collections.OrderedDict()
d["Contributors"] = _("Contributors")
d["Translators"] = _("Translators")
d["Images"] = _("Images")
d["Themes"] =... |
extensions | mpris_listener | # -*- coding: utf-8 -*-
#
# gPodder extension for listening to notifications from MPRIS-capable
# players and translating them to gPodder's Media Player D-Bus API
#
# Copyright (c) 2013-2014 Dov Feldstern <dovdevel@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms ... |
digital | qa_diff_encoder_nrzi | #!/usr/bin/env python
#
# Copyright 2020-2021 Daniel Estevez <daniel@destevez.net>
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy as np
from gnuradio import blocks, digital, gr, gr_unittest
class test_nrzi(gr_unittest.TestCase):
def setUp(self):
test_siz... |
config | configutils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utilities and data structures used by various config code."""
import collections
import itertools
import operator
from typing import (
TYPE_CHECKING,
Any,
Dict,
Iterator,
... |
ui | copyservice | """Copy / Paste functionality."""
from __future__ import annotations
from typing import Callable, Collection
from gaphor.abc import ActionProvider, Service
from gaphor.core import Transaction, action
from gaphor.core.modeling import Diagram, Presentation
from gaphor.diagram.copypaste import Opaque, copy_full, paste_... |
socks5 | conversion | # Some constants used in the RFC 1928 specification
import logging
import socket
import struct
from ipv8.messaging.interfaces.udp.endpoint import DomainAddress, UDPv4Address
from ipv8.messaging.lazy_payload import VariablePayload, vp_compile
from ipv8.messaging.serialization import DefaultStruct, ListOf, Serializer
S... |
feminout | exportNastranMesh | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
lector | _main_ | #!/usr/bin/env python3
# This file is a part of Lector, a Qt based ebook reader
# Copyright (C) 2017-2019 BasioMeusPuga
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
versions | 056_11af3215ae89_add_related_table | # encoding: utf-8
"""056 Add related table
Revision ID: 11af3215ae89
Revises: 048f7db947bf
Create Date: 2018-09-04 18:49:08.239860
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "11af3215ae89"
down_... |
readability | encoding | import re
import sys
import chardet
RE_CHARSET = re.compile(rb'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)
RE_PRAGMA = re.compile(rb'<meta.*?content=["\']*;?charset=(.+?)["\'>]', flags=re.I)
RE_XML = re.compile(rb'^<\?xml.*?encoding=["\']*(.+?)["\'>]')
CHARSETS = {
"big5": "big5hkscs",
"gb2312": "gb18030... |
eos | capSim | import heapq
import time
from collections import Counter
from math import exp, sqrt
DAY = 24 * 60 * 60 * 1000
def lcm(a, b):
n = a * b
while b:
a, b = b, a % b
return n / a
class CapSimulator:
"""Entity's EVE Capacitor Simulator"""
def __init__(self):
# simulator defaults (chan... |
pmt | pmt_to_python | # Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import numpy
from . import pmt_python as pmt
# SWIG isn't taking in the #define PMT_NIL;
# getting the singleton locally.
PMT_NIL = pmt.get_PMT_NIL()
# define missing
def pmt_to... |
Arch | ArchIFCSchema | # ***************************************************************************
# * Copyright (c) 2019 Dion Moult <dion@thinkmoult.com> *
# * Copyright (c) 2019 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2019 FreeCAD Developers *
# * ... |
playorder | follow | # Copyright 2010 Christoph Reiter
# 2016,20 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... |
saveddata | mode | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
papers | search_indexes | from haystack import indexes
from papers.utils import remove_diacritics
from .models import Paper
# from https://github.com/django-haystack/django-haystack/issues/204#issuecomment-544579
class IntegerMultiValueField(indexes.MultiValueField):
field_type = "integer"
class PaperIndex(indexes.SearchIndex, indexes.... |
plugins | pixiv | """
$description Global live-streaming platform for the creative community.
$url sketch.pixiv.net
$type live
"""
import logging
import re
from streamlink.exceptions import FatalPluginError, NoStreamsError
from streamlink.plugin import Plugin, pluginargument, pluginmatcher
from streamlink.plugin.api import validate
fr... |
settings | celery | from datetime import timedelta
from kombu import Exchange, Queue
from posthog.settings.base_variables import TEST
from posthog.settings.data_stores import REDIS_URL
from posthog.settings.ee import EE_AVAILABLE
# Only listen to the default queue "celery", unless overridden via the CLI
CELERY_QUEUES = (Queue("celery", ... |
PyObjCTest | test_nsurl | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSURL(TestCase):
def testMethods(self):
self.assertArgIsBOOL(NSURL.initFileURLWithPath_isDirectory_, 1)
self.assertArgIsBOOL(NSURL.fileURLWithPath_isDirectory_, 1)
... |
AddonManager | addonmanager_installer_gui | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
formatters | def_json_formatter | import json
import re
from collections import OrderedDict
from pathlib import Path
from typing import Dict
from .formatter import FileFormatter
# Dictionary items with matching keys will be sorted as if they were the value
# Example: "version" will be sorted as if it was "0"
TOP_LEVEL_SORT_PRIORITY = {
"version":... |
app-metrics | serializers | from rest_framework import serializers
class AppMetricsRequestSerializer(serializers.Serializer):
category = serializers.ChoiceField(
# Keep in sync with plugin-server/src/worker/ingestion/app-metrics.ts
choices=["processEvent", "onEvent", "exportEvents", "scheduledTask"],
help_text="What ... |
protos | grid_anchor_generator_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/grid_anchor_generator.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pb2
from goo... |
comictaggerlib | autotagstartwindow | """A PyQT4 dialog to confirm and set options for auto-tag"""
# 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/LICENS... |
mmkeys | gnome | # Copyright 2014 Christoph Reiter
# 2018 Ludovic Druette
#
# 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.
im... |
accounts | views | # 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 ... |
engines | dictzone | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Dictzone
"""
from urllib.parse import urljoin
from lxml import html
from searx.utils import eval_xpath
# about
about = {
"website": "https://dictzone.com/",
"wikidata_id": None,
"official_api_documentation": None,
"use_official_api": False,
"requi... |
widgets | settings_page | from gi.repository import GObject, Gtk
class SettingsPage(Gtk.ScrolledWindow):
"""Abstract class used to build pages in preferences window."""
def __init__(self, parent, application, name, title):
Gtk.ScrolledWindow.__init__(self)
self._parent = parent
self._application = application... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.