section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
stream | filtered | from threading import Event
from streamlink.buffers import Buffer
from streamlink.stream.stream import StreamIO
class FilteredStream(StreamIO):
"""StreamIO mixin for being able to pause read calls while filtering content"""
buffer: Buffer
def __init__(self, *args, **kwargs):
self._event_filter ... |
draftgeoutils | arcs | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * *
# * Th... |
gui | project_properties | # --------------------------------------------------------------------
# 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 - GPL... |
cargo | changeMetas | import math
import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.cargo.add import CalcAddCargoCommand
from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand
from gui.fitCommands.helpers import CargoInfo, InternalCommandHistory
from service.fit import F... |
event | query_event_list | from datetime import timedelta
from typing import Dict, List, Optional, Tuple, Union
from zoneinfo import ZoneInfo
from dateutil.parser import isoparse
from django.utils.timezone import now
from posthog.api.utils import get_pk_or_uuid
from posthog.clickhouse.client.connection import Workload
from posthog.hogql.constan... |
language-names | generate | #!/usr/bin/env python
import codecs
import collections
import re
"""
This script van generate a dictionary of language names.
This dictionary looks as follows:
language_names = {
"C": {
"nl": "Dutch",
"de": "German",
"en": "English",
},
"nl": {
"nl": "Nederlands",
... |
extractor | kommunetv | # coding: utf-8
from __future__ import unicode_literals
from ..utils import update_url
from .common import InfoExtractor
class KommunetvIE(InfoExtractor):
_VALID_URL = r"https://(\w+).kommunetv.no/archive/(?P<id>\w+)"
_TEST = {
"url": "https://oslo.kommunetv.no/archive/921",
"md5": "5f102be30... |
bup | index | import errno
import os
import stat
import struct
from contextlib import ExitStack
from bup import metadata, xstat
from bup._helpers import UINT_MAX, bytescmp
from bup.compat import pending_raise
from bup.helpers import (
add_error,
atomically_replaced_file,
log,
merge_iter,
mmap_readwrite,
prog... |
app | mocks | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
extractor | dbtv | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
class DBTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?dagbladet\.no/video/(?:(?:embed|(?P<display_id>[^/]+))/)?(?P<id>[0-9A-Za-z_-]{11}|[a-zA-Z0-9]{8})"
_TESTS = [
{
"url": "https... |
blocks | qa_pack_k_bits | #!/usr/bin/env python
#
# Copyright 2006,2010,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 test_pack(gr_unittest.TestCase):
def setUp(self):
random.see... |
reclineview | plugin | # encoding: utf-8
from __future__ import annotations
import os
from logging import getLogger
from typing import Any, Callable, Container
import ckan.plugins as p
import ckan.plugins.toolkit as toolkit
import yaml
from ckan.common import CKANConfig, config, json
from ckan.plugins.toolkit import _
from ckan.types impor... |
aliceVision | SfMTransfer | __version__ = "2.1"
import os.path
from meshroom.core import desc
class SfMTransfer(desc.AVCommandLineNode):
commandLine = "aliceVision_sfmTransfer {allParams}"
size = desc.DynamicNodeSize("input")
category = "Utils"
documentation = """
This node allows to transfer poses and/or intrinsics form one ... |
filter | qa_fft_filter | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import random
import sys
from gnuradio import blocks, filter, gr, gr_unittest
def make_random_complex_tuple(L):
return [complex(2... |
bpd | gstplayer | # 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, ... |
femviewprovider | view_base_femconstraint | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
logic | schema | # encoding: utf-8
import inspect
from functools import wraps
from typing import Any, Callable, Iterable, cast
import ckan.model
import ckan.plugins as plugins
from ckan.logic import get_validator
from ckan.types import (
ComplexSchemaFunc,
PlainSchemaFunc,
Schema,
Validator,
ValidatorFactory,
)
... |
Op | Waterline | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 Russell Johnson (russ4262) <russ4262@gmail.com> *
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * ... |
s3 | domain | import logging
import types
from boto.route53.connection import Route53Connection
from boto.route53.record import ResourceRecordSets
from boto.s3.connection import S3Connection
from boto.s3.website import RedirectLocation
# Generic steps for custom domains can be found here
# http://docs.aws.amazon.com/AmazonS3/lates... |
builtinMarketBrowser | marketTree | import wx
from gui.builtinMarketBrowser.events import RECENTLY_USED_MODULES
from gui.cachingImageList import CachingImageList
from logbook import Logger
pyfalog = Logger(__name__)
_t = wx.GetTranslation
class MarketTree(wx.TreeCtrl):
def __init__(self, parent, marketBrowser):
wx.TreeCtrl.__init__(self, p... |
Mesh | Init | # FreeCAD init script of the Mesh module
# (c) 2004 Werner Mayer LGPL
import FreeCAD
# Append the open handler
FreeCAD.addImportType("STL Mesh (*.stl *.ast)", "Mesh")
FreeCAD.addImportType("Binary Mesh (*.bms)", "Mesh")
FreeCAD.addImportType("Alias Mesh (*.obj)", "Mesh")
FreeCAD.addImportType("Object File Format Mesh... |
playlist | export_to_squeezebox | # Copyright 2014-2021 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 quodlibet import _, app, qlt... |
pykakasi | kakasi | # -*- coding: utf-8 -*-
# kakasi.py
#
# Copyright 2011 Hiroshi Miura <miurahr@linux.com>
#
# Original Copyright:
# * KAKASI (Kanji Kana Simple inversion program)
# * $Id: jj2.c,v 1.7 2001-04-12 05:57:34 rug Exp $
# * Copyright (C) 1992
# * Hironobu Takahashi (takahasi@tiny.or.jp)
# *
# * This program is free software... |
templatetags | timers | # -*- coding: utf-8 -*-
from core.models import Child, Timer
from django import template
from django.urls import reverse
register = template.Library()
@register.inclusion_tag("core/timer_nav.html", takes_context=True)
def timer_nav(context):
"""
Get a list of Timer instances to include in the nav menu.
:... |
PyObjCTest | test_nsmenu | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSMenuHelper(NSObject):
def validateMenuItem_(self, item):
return 1
def numberOfItemsInMenu_(self, menu):
return 1
def menu_updateItem_atIndex_shouldCancel_(self, m,... |
babybuddy | urls | # -*- coding: utf-8 -*-
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import include, path, reverse_lazy
from . import views
app_patterns = [
path("login/", auth_views.LoginView.as_v... |
downloader | niconico | # coding: utf-8
from __future__ import unicode_literals
try:
import threading
except ImportError:
threading = None
from ..downloader import get_suitable_downloader
from ..extractor.niconico import NiconicoIE
from ..utils import sanitized_Request
from .common import FileDownloader
class NiconicoDmcFD(FileDow... |
libtorrent | settings | from enum import Enum
from typing import Optional
from pydantic import validator
from tribler.core.config.tribler_config_section import TriblerConfigSection
from tribler.core.utilities.network_utils import NetworkUtils
from tribler.core.utilities.osutils import get_home_dir
from tribler.core.utilities.path_util import... |
auth | views | # -*- coding: utf-8 -*-
"""
flaskbb.auth.views
~~~~~~~~~~~~~~~~~~
This view provides user authentication, registration and a view for
resetting the password of a user if he has lost his password
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import l... |
navigation | iterativeclosestpoint | # --------------------------------------------------------------------------
# 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... |
hogql | parse_string | from antlr4 import ParserRuleContext
from posthog.hogql.errors import HogQLException
def parse_string(text: str) -> str:
"""Converts a string received from antlr via ctx.getText() into a Python string"""
if text.startswith("'") and text.endswith("'"):
text = text[1:-1]
text = text.replace("''"... |
searx | testing | # -*- coding: utf-8 -*-
# SPDX-License-Identifier: AGPL-3.0-or-later
"""Shared testing code."""
# pylint: disable=missing-function-docstring,consider-using-with
import os
import subprocess
import traceback
from os.path import abspath, dirname, join, realpath
from unittest import TestCase
from splinter import Browser... |
ToDos | ToDosDocument | #
# ToDosDocument.py
# ToDos
#
# Converted by u.fiedler on 09.02.05.
#
# The original version was written in Objective-C by Malcolm Crawford
# at http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
from AppKit import *
from Category import Category
from OverdueTransformer import OverdueTransformer
from P... |
session | _xsmp | # Copyright 2018 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import ctypes
import enum
from gi.... |
snippet | actions | # 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
... |
versions | 018_05a0778051ca_adjust_licenses | # encoding: utf-8
"""018 Adjust licenses
Revision ID: 05a0778051ca
Revises: 1250b2ff3e36
Create Date: 2018-09-04 18:48:54.288030
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "05a0778051ca"
down_re... |
PyObjCTest | test_nslayoutconstraint | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSLayoutContraintManual(TestCase):
def testNSDictionaryOfVariableBindings(self):
var1 = "foo"
var2 = "bar"
self.assertEqual(
NSDictionaryOfVariableBindings("var1", "var2"),
{"var1": "foo", "var2":... |
Gui | FreeCADGuiInit | # ***************************************************************************
# * Copyright (c) 2002,2003 Jürgen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
utils | http_utils | # 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, ... |
plugins | htv | """
$description Vietnamese live TV channels owned by the People's Committee of Ho Chi Minh City.
$url htv.com.vn
$type live
$region Vietnam
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from stre... |
utils | fields | # -*- coding: utf-8 -*-
"""
flaskbb.utils.fields
~~~~~~~~~~~~~~~~~~~~
Additional fields and widgets for wtforms.
The reCAPTCHA Field was taken from Flask-WTF and modified
to use our own settings system.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
... |
hogql | constants | from datetime import date, datetime
from typing import List, Literal, Optional, Tuple, TypeAlias
from uuid import UUID
from pydantic import BaseModel, ConfigDict
ConstantDataType: TypeAlias = Literal[
"int",
"float",
"str",
"bool",
"array",
"tuple",
"date",
"datetime",
"uuid",
... |
comicapi | comicinfoxml | """A class to encapsulate ComicRack's ComicInfo.xml data"""
# 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/LICENSE... |
dialogs | filldlg | # -*- 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.... |
updaters | pip | __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import collections
import logging
import threading
from octoprint.util.pip import... |
gst | sink_windows | # Copyright (C) 2013-2015 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... |
src | helper_sent | """
Insert values into sent table
"""
import time
import uuid
from addresses import decodeAddress
from bmconfigparser import config
from helper_ackPayload import genAckPayload
from helper_sql import sqlExecute, sqlQuery
# pylint: disable=too-many-arguments
def insert(
msgid=None,
toAddress="[Broadcast subsc... |
writer8 | header | #!/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 random
from collections import Orde... |
preferences | general | # 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
... |
mylar | rsscheck | # This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that it wi... |
Import | stepZ | # -*- coding: utf-8 -*-
# ****************************************************************************
# * Copyright (c) 2018 Maurice <easyw@katamail.com> *
# * *
# * StepZ Import Export compressed STEP files for FreeCAD ... |
FeatureHole | ViewProviderHole | # /******************************************************************************
# * Copyright (c) 2012 Jan Rheinländer <jrheinlaender@users.sourceforge.net> *
# * *
# * This file is part of the FreeCAD CAx development system. ... |
src | utils | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
import sys
import time
import types
from collections import deque... |
Pyfa | db_update | #!/usr/bin/env python3
# ======================================================================
# Copyright (C) 2012 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 Softwar... |
objecteditor | widget | # 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
... |
dialogs | aboutdlg | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-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 ver... |
api | urls | from common.api_helpers.optional_slash_router import (
OptionalSlashRouter,
optional_slash_path,
)
from django.urls import include, path, re_path
from .views import UserNotificationPolicyView, auth
from .views.alert_group import AlertGroupView
from .views.alert_receive_channel import AlertReceiveChannelView
fr... |
extractor | cammodels | # coding: utf-8
from __future__ import unicode_literals
from ..utils import int_or_none, url_or_none
from .common import InfoExtractor
class CamModelsIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?cammodels\.com/cam/(?P<id>[^/?#&]+)"
_TESTS = [
{
"url": "https://www.cammodels.com/ca... |
migrations | 0003_add_refresh_help_text | # Generated by Django 2.0.5 on 2018-07-15 14:16
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0002_add_settings"),
]
operations = [
migrations.AlterField(
model_name="settings",
nam... |
femtaskpanels | task_constraint_magnetization | # ***************************************************************************
# * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
OptionalManager | UiWebsocketPlugin | import html
import os
import re
import time
import gevent
from Config import config
from Plugin import PluginManager
from Translate import Translate
from util import helper
from util.Flag import flag
plugin_dir = os.path.dirname(__file__)
if "_" not in locals():
_ = Translate(plugin_dir + "/languages/")
bigfile... |
femobjects | solver_ccxtools | # ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | tudou | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TudouPlaylistIE(InfoExtractor):
IE_NAME = "tudou:playlist"
_VALID_URL = r"https?://(?:www\.)?tudou\.com/listplay/(?P<id>[\w-]{11})\.html"
_TESTS = [
{
"url": "http://www.tudou.com/listplay... |
signal | decimate | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2018 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... |
gnuradio | _cmake_format | # Copyright 2021 Marcus Müller
# SPDX-License-Identifier: LGPL-3.0-or-later
class _clang_format_options:
def __init__(self, clangfile=None):
if not clangfile:
clangfile = ".clang-format"
self.lines = []
with open(clangfile, encoding="utf-8") as opened:
for line in ope... |
dictionary | rtfcre_parse | import re
import sys
from collections import deque
from plover import log
from rtf_tokenize import RtfTokenizer
class RtfParseError(Exception):
def __init__(self, lnum, cnum, fmt, *fmt_args):
msg = "line %u, column %u: %s" % (lnum + 1, cnum + 1, fmt % fmt_args)
super().__init__(msg)
class BadRt... |
canvas | flowgraph | """
Copyright 2007-2011, 2016q Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import ast
import functools
import random
from itertools import count
from shutil import which as find_executable
from gi.repository import GLib, Gtk
from ...core import Messa... |
TaskManagement | OnExitCallbackManager | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, Callable, List
from UM.Logger import Logger
if TYPE_CHECKING:
from cura.CuraApplication import CuraApplication
#
# This class manages all registered upon-exit checks
# that need to ... |
context | base | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
network | bmobject | """
BMObject and it's exceptions.
"""
import logging
import time
import protocol
import state
from addresses import calculateInventoryHash
from inventory import Inventory
from network.dandelion import Dandelion
logger = logging.getLogger("default")
class BMObjectInsufficientPOWError(Exception):
"""Exception ind... |
migrations | 0337_more_session_recording_fields | # Generated by Django 3.2.19 on 2023-07-15 08:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0336_alter_survey_type"),
]
operations = [
migrations.AddField(
model_name="sessionrecording",
name="acti... |
core | admin | __package__ = "archivebox.core"
from contextlib import redirect_stdout
from datetime import datetime, timezone
from io import StringIO
from pathlib import Path
from config import OUTPUT_DIR, SNAPSHOTS_PER_PAGE
from core.forms import AddLinkForm
from core.mixins import SearchResultsAdminMixin
from core.models import A... |
gui | pyfa_gauge | # ===============================================================================
# PyfaGauge is a generic Gauge implementation tailored for pyfa (the Python
# Fitting Assistant). It uses the easeOutQuad equation from
# caurina.transitions.Tweener to do animations
#
# ToDo: make SetGradient(<value, colour start, colour... |
Arch | importGBXML | # ***************************************************************************
# * Copyright (c) 2015 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
utils | numberFormatter | import math
from eos.utils.round import roundDec, roundToPrec
def formatAmount(
val, prec=3, lowest=0, highest=0, currency=False, forceSign=False, unitName=None
):
"""
Add suffix to value, transform value to match new suffix and round it.
Keyword arguments:
val -- value to process
prec -- pr... |
filter | pfb | #!/usr/bin/env python
#
# Copyright 2009,2010,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import blocks, fft, gr
from . import fft
from . import filter_python as filter
from . import optfir
class channelizer_ccf... |
bleachbit | Windows | # vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2023 Andrew Ziem
# https://www.bleachbit.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 3 of the License, or
# ... |
design | fir_design | # Copyright 2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import scipy
from gnuradio import fft, filter
from PyQt5 import QtGui, QtWidgets
# Filter design functions using a window
def design_win_lpf(fs, gain, wintype, mainwin):
ret = True... |
writer2 | indexer | #!/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
# from future_builtins import filter, map
__license__ = "GPL v3"
__copyright__ = "2011, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
... |
chardet | codingstatemachine | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
server | workflow | """Workflow decoder and validator.
The main function to start working with this module is ``load``. It decodes the
JSON-encoded bytes and validates the document against the schema.
>>> import workflow
>>> with open("workflow.json") as file_object:
wf = workflow.load(file_object)
If the document c... |
versions | 0366ba6575ca_add_table_for_comments | """Add table for comments
Revision ID: 0366ba6575ca
Revises: 1093835a1051
Create Date: 2020-08-14 00:46:54.161120
"""
import sqlalchemy as sa
from alembic import op # noqa: I001
# revision identifiers, used by Alembic.
revision = "0366ba6575ca"
down_revision = "1093835a1051"
branch_labels = None
depends_on = None
... |
example-iauthfunctions | plugin_v4 | # encoding: utf-8
from typing import Optional, cast
import ckan.plugins as plugins
import ckan.plugins.toolkit as toolkit
from ckan.types import AuthResult, Context, ContextValidator, DataDict
def group_create(context: Context, data_dict: Optional[DataDict] = None) -> AuthResult:
# Get the user name of the logg... |
aliceVision | StructureFromMotion | __version__ = "3.3"
from meshroom.core import desc
class StructureFromMotion(desc.AVCommandLineNode):
commandLine = "aliceVision_incrementalSfM {allParams}"
size = desc.DynamicNodeSize("input")
category = "Sparse Reconstruction"
documentation = """
This node will analyze feature matches to understan... |
PyObjCTest | test_cfsocket | import socket
import struct
import sys
import time
import CoreFoundation
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
try:
buffer
except NameError:
buffer = memoryview
def onTheNetwor... |
gui | scratchwindow | # This file is part of MyPaint.
# Copyright (C) 2011-2018 by the MyPaint Development Team.
# Copyright (C) 2011 by Ben O'Steen <bosteen@gmail.com>
#
# 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 Foundatio... |
soundconverter | setup | #!/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 ... |
network | request | from __future__ import annotations
import json
import logging
from time import time
from typing import TYPE_CHECKING, Callable, Dict, List, Optional, Union
from urllib.parse import urlencode
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtNetwork import QNetworkReply, QNetworkRequest
from tribler.gui.utilit... |
extractor | atttechchannel | from __future__ import unicode_literals
from ..utils import unified_strdate
from .common import InfoExtractor
class ATTTechChannelIE(InfoExtractor):
_VALID_URL = r"https?://techchannel\.att\.com/play-video\.cfm/([^/]+/)*(?P<id>.+)"
_TEST = {
"url": "http://techchannel.att.com/play-video.cfm/2014/1/27... |
utils | cleantext | __license__ = "GPL 3"
__copyright__ = "2010, sengian <sengian1@gmail.com>"
__docformat__ = "restructuredtext en"
import re
import htmlentitydefs
from future_builtins import map
_ascii_pat = None
def clean_ascii_chars(txt, charlist=None):
r"""
Remove ASCII control chars.
This is all control chars except... |
migrations | 0005_auto_20220704_1947 | # Generated by Django 3.2.5 on 2022-07-04 19:47
import django.db.models.deletion
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("schedules", "0004_customoncallshift_until"),
]
operations = [
linte... |
scripts | example_post | # ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
plugin | preset | try:
from sg_py_vendor.pymarshal import type_assert, type_assert_dict, type_assert_iter
except ImportError:
from pymarshal import type_assert, type_assert_dict, type_assert_iter
__all__ = [
"Preset",
"PresetBank",
]
class Preset:
def __init__(
self,
name,
controls,
... |
hogql | placeholders | from typing import Dict, List, Optional
from posthog.hogql import ast
from posthog.hogql.errors import HogQLException
from posthog.hogql.visitor import CloningVisitor, TraversingVisitor
def replace_placeholders(
node: ast.Expr, placeholders: Optional[Dict[str, ast.Expr]]
) -> ast.Expr:
return ReplacePlacehol... |
network | assemble | """
Create bitmessage protocol command packets
"""
import struct
import addresses
from network.constants import MAX_ADDR_COUNT
from network.node import Peer
from protocol import CreatePacket, encodeHost
def assemble_addr(peerList):
"""Create address command"""
if isinstance(peerList, Peer):
peerList ... |
process-manager | sql_scripts | CREATE_TABLES = """
CREATE TABLE IF NOT EXISTS processes (
rowid INTEGER PRIMARY KEY AUTOINCREMENT,
row_version INTEGER NOT NULL DEFAULT 0, -- incremented every time the row is updated
pid INTEGER NOT NULL, -- process ID
kind TEXT NOT NULL, -- process type, 'core' or 'gui'
"p... |
installer | middleware | # 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 ... |
utils | jinja | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utilities related to jinja2."""
import contextlib
import functools
import html
import os
import os.path
import posixpath
from typing import Any, Callable, FrozenSet, Iterator, List, Set, Tup... |
qtui | common | # 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) any later version.
# This program ... |
workflows | batch_exports | import collections.abc
import csv
import dataclasses
import datetime as dt
import gzip
import json
import logging
import logging.handlers
import queue
import tempfile
import typing
import uuid
from string import Template
import brotli
from asgiref.sync import sync_to_async
from posthog.batch_exports.service import (
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.