section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
blocks | qa_repack_bits_bb | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import random
import pmt
from gnuradio import blocks, gr, gr_unittest
class qa_repack_bits_bb(gr_unittest.TestCase):
def setUp(self):
random.seed(... |
lib | encoding | import struct
import time
import cherrypy
from cherrypy._cpcompat import BytesIO, basestring, ntob, set, unicodestr
from cherrypy.lib import file_generator, is_closable_iterator, set_vary_header
def decode(encoding=None, default_encoding="utf-8"):
"""Replace or extend the list of charsets used to decode a reques... |
senf | _winansi | # -*- 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... |
extensions | rockbox_coverart | # Copies cover art to a file based device
#
# (c) 2014-04-10 Alex Mayer <magictrick4906@aim.com>
# Released under the same license terms as gPodder itself.
# Use a logger for debug output - this will be managed by gPodder
import logging
import os
import shutil
import gpodder
logger = logging.getLogger(__name__)
_ = ... |
CGShading-Demo | MyQuartzView | """
Example for using CGShading and CGFunction. This code is directly translated
from procedural C code and is definitely not good Python style.
"""
import array
import math
import random
import objc
from PyObjCTools import NibClassBuilder
from Quartz import *
NibClassBuilder.extractClasses("MainMenu")
# Global vari... |
v1 | awards | from typing import List
from CTFd.api.v1.helpers.request import validate_args
from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic
from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse
from CTFd.cache import clear_standings
from CTFd.constants import RawEnum
from CTFd.models impo... |
PyObjCTest | test_cgimage | import os
import sys
from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
long
except NameError:
long = int
if sys.version_info[0] != 2:
def buffer(value):
if isinstance(value, bytes):
return value
return value.encode("latin1")
class TestCGImage(Test... |
web | utils | import logging
import os
from django.core.management import utils
from photonix.photos.utils.redis import redis_connection
from redis_lock import Lock
logger = logging.getLogger("photonix")
def get_secret_key():
# To avoid each installation having the same Django SECERT_KEY we generate
# a random one and st... |
data | geometry | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br/
# http://www.cti.gov.br/invesalius
# Conta... |
core | exceptions | """
The Tribler-specifc Exceptions the Core may throw.
Author(s): Arno Bakker
"""
class TriblerException(Exception):
"""Super class for all Tribler-specific Exceptions the Tribler Core throws."""
class OperationNotPossibleAtRuntimeException(TriblerException):
"""The requested operation is not possible afte... |
songsmenu | duplicates | #
# Duplicates songs plugin.
#
# Copyright (C) 2011-2019 Nick Boultbee
#
# Finds "duplicates" of songs selected by searching the library for
# others with the same user-configurable "key", presenting a browser-like
# dialog for further interaction with these.
#
# This program is free software; you can re... |
gui | error_list | from __future__ import absolute_import
from gi.repository import Gdk, Gtk
class ErrorList:
"""Operation error list.
Error list is displayed only when errors occur during operation in
silent mode.
"""
def __init__(self, parent):
# create main window
self._window = Gtk.Window(typ... |
downloaders | BasketbuildCom | # -*- coding: utf-8 -*
#
# Test links:
# https://s.basketbuild.com/filedl/devs?dev=pacman&dl=pacman/falcon/RC-3/pac_falcon-RC-3-20141103.zip
# https://s.basketbuild.com/filedl/gapps?dl=gapps-gb-20110828-signed.zip
import re
from ..base.simple_downloader import SimpleDownloader
class BasketbuildCom(SimpleDownlo... |
extractor | ynet | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..compat import compat_urllib_parse_unquote_plus
from .common import InfoExtractor
class YnetIE(InfoExtractor):
_VALID_URL = r"https?://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html"
_TESTS = [
... |
migrations | 0008_action_actionstep | # Generated by Django 2.2.7 on 2020-01-26 21:16
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0007_element"),
]
operations = [
migrations.CreateModel(
... |
interaction-payloads | dialog_submission | """
[Documentation](https://api.slack.com/dialogs)
"""
import typing
from apps.slack.types.common import BaseEvent, PayloadType
class DialogSubmissionPayload(BaseEvent):
"""
[Documentation](https://api.slack.com/dialogs#:~:text=deeper%20at%20those-,attributes,-%2C%20which%20you%20might)
"""
type: ... |
db | thing | # 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, ... |
util | formats | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# SoundConverter - GNOME application for converting between audio formats.
# Copyright 2004 Lars Wirzenius
# Copyright 2005-2020 Gautier Portet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
simplejson | decoder | """Implementation of JSONDecoder
"""
import re
import struct
import sys
from simplejson.scanner import make_scanner
def _import_c_scanstring():
try:
from simplejson._speedups import scanstring
return scanstring
except ImportError:
return None
c_scanstring = _import_c_scanstring()
__a... |
widgets | togglebutton | from PyQt5.QtCore import QPropertyAnimation, QRectF, QSize, Qt, pyqtProperty
from PyQt5.QtGui import QPainter
from PyQt5.QtWidgets import QAbstractButton, QSizePolicy
# Toggle button in pure QT. Copy-pasted from StackOverflow answer https://stackoverflow.com/a/51825815/5553928
# Courtesy of Stefan Scherfke.
from tribl... |
engines | stackoverflow | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Stackoverflow (IT)
"""
from urllib.parse import urlencode, urljoin, urlparse
from lxml import html
from searx.exceptions import SearxEngineCaptchaException
from searx.utils import extract_text
# about
about = {
"website": "https://stackoverflow.com/",
"wikida... |
chardet | mbcharsetprober | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... |
extractor | hrfernsehen | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import int_or_none, unescapeHTML, unified_timestamp
from .common import InfoExtractor
class HRFernsehenIE(InfoExtractor):
IE_NAME = "hrfernsehen"
_VALID_URL = r"^https?://www\.(?:hr-fernsehen|hessenschau)\.de/.*,vide... |
documents | signals | from __future__ import annotations
from typing import Any
from abilian.sbe.apps.communities.models import VALID_ROLES, Community, Membership
from abilian.sbe.apps.communities.signals import membership_removed, membership_set
from abilian.services.security import Manager, Reader, Writer, security
from .search import ... |
pointscommands | commands | # ***************************************************************************
# * Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
accounts | signals | import logging
from components.helpers import generate_api_key
from django.conf import settings
from django.contrib.auth import get_user_model
from django.db import transaction
from django.dispatch import receiver
from django_auth_ldap.backend import populate_user
from django_cas_ng.signals import cas_user_authenticat... |
serializers | on_call_shifts | import time
from apps.schedules.models import CustomOnCallShift
from apps.user_management.models import User
from common.api_helpers.custom_fields import (
RollingUsersField,
TeamPrimaryKeyRelatedField,
TimeZoneField,
UsersFilteredByOrganizationField,
)
from common.api_helpers.exceptions import BadRequ... |
browser | navigate | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Implementation of :navigate."""
import posixpath
import re
from typing import Optional, Set
from qutebrowser.browser import webelem
from qutebrowser.config import config
from qutebrowser.ma... |
simplejson | encoder | """Implementation of JSONEncoder
"""
import re
from decimal import Decimal
def _import_speedups():
try:
from simplejson import _speedups
return _speedups.encode_basestring_ascii, _speedups.make_encoder
except ImportError:
return None, None
c_encode_basestring_ascii, c_make_encoder = _i... |
AddonManager | addonmanager_workers_startup | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * Copyright (c) 2019 Yorik van Havre ... |
config | tribler_config | from __future__ import annotations
import logging
import traceback
from pathlib import Path
from typing import Optional
import configobj
from configobj import ParseError
from pydantic import BaseSettings, Extra, PrivateAttr
from tribler.core.components.bandwidth_accounting.settings import (
BandwidthAccountingSet... |
migrations | 0001_initial | # Generated by Django 3.0.3 on 2020-02-19 06:43
import django.contrib.auth.models
import django.contrib.auth.validators
import django.core.validators
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.db import... |
builtinViewColumns | droneEhp | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa 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 ... |
widgets | treewidget | # 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
... |
canto-curses | subthread | # -*- coding: utf-8 -*-
# Canto-curses - ncurses RSS reader
# 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.
# SubThread i... |
decrypters | UlozToFolder | # -*- coding: utf-8 -*-
import re
from ..base.decrypter import BaseDecrypter
class UlozToFolder(BaseDecrypter):
__name__ = "UlozToFolder"
__type__ = "decrypter"
__version__ = "0.27"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?(uloz\.to|ulozto\.(cz|sk|net)|bagruj\.cz|zachowajto\.pl)/... |
friture | tilelayout | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2017 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... |
unihandecode | unicodepoints | # -*- coding: utf-8 -*-
__license__ = "GPL 3"
__copyright__ = "2009, John Schember <john@nachtimwald.com>"
__docformat__ = "restructuredtext en"
"""
Unicode code point dictionary.
Based on Text::Unidecode's xAB.pm lists. This combines all xAB.pm files into
a single dictionary.
"""
CODEPOINTS = {
"x20": [
... |
PyObjCTest | test_opaque | import sys
import objc
from PyObjCTest.opaque import *
from PyObjCTools.TestSupport import *
class TestFromPython(TestCase):
def testBasic(self):
tp = objc.createOpaquePointerType("BarHandle", BarEncoded, "BarHandle doc")
self.assertIsInstance(tp, type)
f = OC_OpaqueTest.createBarWithFi... |
fec | extended_decoder | #!/usr/bin/env python
#
# Copyright 2014 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
from . import fec_python as fec
from .bitflip import read_bitlist
from .capillary_threaded_decoder import capillary_thr... |
migrations | 0007_remove_urls_and_add_oairecord | # -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2016-11-26 13:42
import django.db.models.deletion
from django.db import migrations, models
def find_oairecords(apps, schema_editor):
DepositRecord = apps.get_model("deposit", "DepositRecord")
OaiRecord = apps.get_model("papers", "OaiRecord")
for d ... |
model | license | # encoding: utf-8
from __future__ import annotations
import datetime
import logging
import re
from typing import Any, Dict, Iterator, Optional, Union
import requests
from ckan.common import _, config, json
log = logging.getLogger(__name__)
class License:
"""Domain object for a license."""
def __init__(sel... |
lib | lazyjson | # encoding: utf-8
from typing import Any
from simplejson import RawJSON, dumps, loads
class LazyJSONObject(RawJSON):
"""
An object that behaves like a dict returned from json.loads
but when passed to simplejson.dumps will render original
string passed when possible. Accepts and produces only
uni... |
femexamples | truss_3d_cs_circle_ele_seg2 | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
gr | top_block | #
# Copyright 2007,2014 Free Software Foundation, Inc.
# Copyright 2023 Marcus Müller
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import threading
from .gr_python import (
logger,
top_block_pb, # , dot_graph_tb)
top_block_run_unlocked,
top_block_start_unlocke... |
userguide | page | # 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
... |
bitmessagekivy | identiconGeneration | """
Core classes for loading images and converting them to a Texture.
The raw image data can be keep in memory for further access
"""
import hashlib
from io import BytesIO
from kivy.core.image import Image as CoreImage
from kivy.uix.image import Image as kiImage
from PIL import Image
# constants
RESOLUTION = 300, 300... |
Code | ControlPGN | import collections
from Code import PGNreader, Util
from Code.Constantes import *
class ControlPGN:
def __init__(self, gestor):
self.gestor = gestor
self.siFigurines = gestor.configuracion.figurinesPGN
# self.partida = self.gestor.partida
self.siMostrar = True
self.showVar... |
decrypters | ChipDe | # -*- coding: utf-8 -*-
import re
from ..base.decrypter import BaseDecrypter
class ChipDe(BaseDecrypter):
__name__ = "ChipDe"
__type__ = "decrypter"
__version__ = "0.17"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?chip\.de/video/.+\.html"
__config__ = [
("enabled", "boo... |
core | listener | from __future__ import annotations
from typing import TYPE_CHECKING, Any, Literal
from mopidy import listener
if TYPE_CHECKING:
from mopidy.audio import PlaybackState
from mopidy.models import Playlist, TlTrack
from mopidy.types import DurationMs, Percentage, Uri
from typing_extensions import TypeAli... |
formatters | inst_cfg_formatter | import configparser
import json
import re
from collections import OrderedDict
from pathlib import Path
from .formatter import FileFormatter
class InstCfgFormatter(FileFormatter):
def formatFile(self, file: Path):
"""Format .inst.cfg files according to the rules in settings"""
config = configparse... |
gui | Notebook | """
Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import logging
import os
from gi.repository import Gdk, GObject, Gtk
from . import Actions
from .Constants import MIN_WINDOW_HEIGHT, MIN_WINDOW_WIDTH
from .DrawingArea import D... |
templatetags | forms | # 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 ... |
mystran | add_solver_control | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
context | bezier | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
preferences | playback | # 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... |
scenarios | resolution_note | import datetime
import json
import logging
import typing
from apps.api.permissions import RBACPermission
from apps.slack.constants import DIVIDER
from apps.slack.errors import (
SlackAPIChannelArchivedError,
SlackAPIChannelInactiveError,
SlackAPIChannelNotFoundError,
SlackAPIError,
SlackAPIInvalidA... |
result | logger | import hashlib
import re
import time
import whipper
from ruamel.yaml.comments import CommentedMap as OrderedDict
from whipper.common import common
from whipper.common.yaml import YAML
from whipper.result import result
class WhipperLogger(result.Logger):
_accuratelyRipped = 0
_inARDatabase = 0
_errors = F... |
neubot | runner_rendezvous | # neubot/runner_rendezvous.py
#
# Copyright (c) 2011-2012 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... |
draftmake | make_rectangle | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
qltk | x | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2020-22 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 ve... |
Web | Init | # ***************************************************************************
# * Copyright (c) 2001,2002 Jürgen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
app | test_metadata | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2023 FreeCAD Project Association *
# * ... |
grouptagger | gt_widgets | # Copyright (C) 2011 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... |
friture | longlevels | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?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 distribu... |
handlers | image_resource | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import datetime
from thumbor.engines import BaseEngine
from thumbor.... |
scripts | dump_data | #!/usr/bin/env python
"""
This script bootstraps Phobos from a supplied path and feeds it
information regarding EVE data paths and where to dump data. It then imports
some other scripts and uses them to convert the json data into a SQLite
database and then compare the new database to the existing one, producing a
diff ... |
wall | views | from __future__ import annotations
from datetime import date
from itertools import groupby, islice
from typing import Any
import whoosh
import whoosh.query as wq
from abilian.sbe.apps.communities.blueprint import Blueprint
from abilian.sbe.apps.documents.models import Document, icon_for
from abilian.sbe.apps.forum.mo... |
engines | xpath_flex | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
xPath Flex Engine (xpath_flex)
Aims to be a more flexible engine that covers xpath use cases for all categories
(as it allows to override the result template).
The engine configuration expects you to specify a 'field_definition' dictionary with the following proper... |
fcbt | DistSrc | # shell and operating system
import os
import sys
from . import DistTools, FileTools
# sys.path.append( "E:\\Develop\\Projekte\\FreeCADWin\\src\\Tools" )
# line separator
ls = os.linesep
# path separator
ps = os.pathsep
# dir separator
ds = os.sep
DistName = DistTools.BuildDistName()
DistSrc = DistName + "_src"
D... |
extractor | tagesschau | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import determine_ext, js_to_json, parse_filesize, parse_iso8601
from .common import InfoExtractor
class TagesschauPlayerIE(InfoExtractor):
IE_NAME = "tagesschau:player"
_VALID_URL = r"https?://(?:www\.)?tagesschau\.de/multimedia/... |
digital | qa_correlate_access_code | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013,2017 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
default_access_code = "\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC"
def string_to_1_0_list... |
util | version | """
This module provides a bunch of utility methods and helpers for version handling.
"""
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
import logging
import pkg_resources
from octoprint import __version__
def get_octoprint_version_string():
return __version__
def ge... |
config | paths | # 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, ... |
controllers | text_ctrl | # -*- 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.... |
mylar | Mylar | #!/usr/bin/env python
# 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 distri... |
gpio | gpio | import importlib
import logging
class Gpio:
"""
interface to raspi GPIO
"""
def __init__(self):
self._capture_pin = 4
self._status_pin = 2
self._logger = logging.getLogger(self.__class__.__name__)
self.gpio = None
try:
self.gpio = importlib.import_m... |
plover | steno_dictionary | # Copyright (c) 2013 Hesky Fisher.
# See LICENSE.txt for details.
"""StenoDictionary class and related functions.
A steno dictionary maps sequences of steno strokes to translations.
"""
import collections
import os
from plover.resource import (
ASSET_SCHEME,
resource_filename,
resource_timestamp,
r... |
conversions | releaseJan2020 | """
Conversion pack for January 2020 release
"""
CONVERSIONS = {
"Small C5-L Emergency Shield Overload I": "Small C5-L Compact Shield Booster",
"Small Clarity Ward Booster I": "Small Clarity Ward Enduring Shield Booster",
"Medium Clarity Ward Booster I": "Medium Clarity Ward Enduring Shield Booster",
"... |
draftviewproviders | view_orthoarray | # ***************************************************************************
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
cdn | cloudflare | # 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, ... |
extractor | ndr | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
merge_dicts,
parse_iso8601,
qualities,
try_get,
urljoin,
)
from .common import InfoExtractor
class NDR... |
cli | notify | # encoding: utf-8
from logging import getLogger
import click
from ckan.cli import error_shout
from ckan.logic import NotAuthorized, ValidationError
from ckan.model import DomainObjectOperation, Package, Session
from ckan.model.modification import DomainObjectModificationExtension
log = getLogger(__name__)
@click.g... |
aliceVision | ExportMaya | __version__ = "1.0"
from meshroom.core import desc
class ExportMaya(desc.AVCommandLineNode):
commandLine = "aliceVision_exportMeshroomMaya {allParams}"
category = "Export"
documentation = """
Export a scene for Autodesk Maya, with an Alembic file describing the SfM: cameras and 3D points.
It will export... |
sabnzbd | scheduler | #!/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... |
chardet | langbulgarianmodel | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
context | mp4Context | import os
import shutil
import tempfile
from drawBot.misc import warnings
from .imageContext import PNGContext
from .tools.mp4Tools import generateMP4
class MP4Context(PNGContext):
fileExtensions = ["mp4"]
saveImageOptions = [
(
"ffmpegCodec",
"The codec to be used by ffmpeg... |
plugins | tviplayer | """
$description Live TV channels and video on-demand service from TVI, a Portuguese free-to-air broadcaster.
$url tviplayer.iol.pt
$type live, vod
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
fr... |
v1 | comments | from typing import List
from CTFd.api.v1.helpers.request import validate_args
from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic
from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse
from CTFd.constants import RawEnum
from CTFd.models import (
ChallengeComments,
Comment... |
plugins | desktop_xdg | # -*- coding: utf-8 -*-
import os
from xdg import BaseDirectory, Exceptions, Menu
class DesktopXDG(object):
"""pyxdg Freedesktop desktop implementation"""
def __init__(self):
try:
self.desktop = (
Menu.parse()
.getMenu("Office")
.getMenuEn... |
VersionUpgrade27to30 | VersionUpgrade27to30 | # 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.
import os
import re
import urllib.parse
from typing import Dict, List, Tuple
from UM.VersionUpgrade import Versio... |
database | table_bittorrent_gen | # regress/neubot/database/table_bittorrent_gen.py
#
# Copyright (c) 2010-2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
# Copyright (c) 2011 Roberto D'Auria <everlastingfire@autistici.org>
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is... |
plugins | invintus | """
$description Global live streaming and video on-demand hosting platform.
$url player.invintus.com
$type live, vod
"""
import json
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.utils.url import up... |
views | relationships | """ Following and followers lists """
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.settings import PAGE_LENGTH
from django.core.exceptions import PermissionDenied
from django.core.paginator import Paginator
from django.db.models import Count, Q
from django.template.response import TemplateResponse... |
plugins | hiplayer | """
$description United Arab Emirates CDN hosting live content for various websites in The Middle East.
$url alwasat.ly
$url media.gov.kw
$type live
$region various
"""
import base64
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink... |
builtinContextMenus | ammoToDmgPattern | # noinspection PyPackageRequirements
import gui.globalEvents as GE
import gui.mainFrame
import wx
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class AmmoToDmgPattern(ContextMenuSingle):
visibilitySetting = "ammoPattern"
def __init__(self):
self.mai... |
ingestion-warnings | sql | from django.conf import settings
from posthog.clickhouse.kafka_engine import KAFKA_COLUMNS_WITH_PARTITION, kafka_engine
from posthog.clickhouse.table_engines import (
Distributed,
MergeTreeEngine,
ReplicationScheme,
)
from posthog.kafka_client.topics import KAFKA_INGESTION_WARNINGS
INGESTION_WARNINGS_TABLE... |
extractor | patreon | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
KNOWN_EXTENSIONS,
clean_html,
determine_ext,
int_or_none,
mimetype2ext,
parse_iso8601,
str_or_none,
try_get,
)
from .common import InfoExtractor
class PatreonIE(InfoExtractor):
_VALID_URL = r"https?://(?... |
Tools | updateppa | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012 Werner Mayer LGPL
import sys
from os import path
from tempfile import gettempdir
from bzrlib.branch import Branch
from bzrlib.workingtree import WorkingTree
def runUpdate(filename):
branch = "versioning.git"
REMOTE_URL = "bzr+ssh://bazaar.launchpad.net/~f... |
SceneDetails | VProperty | # /***************************************************************************
# * Copyright (c) 2019 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.