section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
mixins | stickiness | from datetime import datetime
from typing import TYPE_CHECKING, Callable, Optional, Union
from posthog.constants import DATE_FROM, DATE_TO, STICKINESS_DAYS
from posthog.models.filters.mixins.common import BaseParamMixin, DateMixin
from posthog.models.filters.mixins.interval import IntervalMixin
from posthog.models.fil... |
versions | 004_f92ee205e46d_add_group_object | # encoding: utf-8
"""Add group object
Revision ID: f92ee205e46d
Revises: f22b4f5241a5
Create Date: 2018-09-04 17:22:50.675045
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "f92ee205e46d"
down_revis... |
Path | TestPathApp | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
caching | insight_caching_state | from datetime import timedelta
from enum import Enum
from functools import cached_property
from typing import List, Optional, Union
import structlog
from django.core.paginator import Paginator
from django.utils.timezone import now
from posthog.caching.calculate_results import calculate_cache_key
from posthog.caching.u... |
deposit | conftest | import os
import pytest
from deposit.models import DDC, License, LicenseChooser, UserPreferences
from lxml import etree
from papers.models import Paper, Researcher
@pytest.fixture(params=[True, False])
def abstract_required(db, request):
"""
Sets abstract as required or not and returns value.
"""
req... |
config | serial | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from enum import Enum
from typing import List, Optional
from octoprint.schema import BaseModel
from octoprint.vendor.with_attr... |
controllers | listingcontroller | # -*- coding: utf-8 -*-
# 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... |
handlers | logbook | """
raven.handlers.logbook
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import sys
import traceback
import logbook
from raven.base import Client
from raven.ut... |
gui | history | # This file is part of MyPaint.
# Copyright (C) 2011-2018 by the MyPaint Development Team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option... |
migrations | 0287_add_session_recording_model | # Generated by Django 3.2.16 on 2022-12-23 10:07
import django.db.models.deletion
import posthog.models.utils
from django.conf import settings
from django.core.paginator import Paginator
from django.db import migrations, models
def migrate_playlist_item_recording_relations(apps, _) -> None:
Recording = apps.get_... |
containers | RSDF | # -*- coding: utf-8 -*-
import base64
import os
import re
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
from pyload.core.utils.convert import to_str
from ..base.container import BaseContainer
class RSDF(BaseContainer):
__nam... |
friture | controlbar | #!/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... |
draftguitools | gui_edit_base_object | # ***************************************************************************
# * Copyright (c) 2019, 2020 Carlo Pavan <carlopav@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
migrations | 0156_alter_user_preferred_language | # Generated by Django 3.2.14 on 2022-08-02 18:05
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0155_user_show_guided_tour"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred... |
batch-exports | http | import datetime as dt
from typing import Any
from django.db import transaction
from django.utils.timezone import now
from posthog.api.routing import StructuredViewSetMixin
from posthog.batch_exports.models import (
BATCH_EXPORT_INTERVALS,
BatchExportLogEntry,
BatchExportLogEntryLevel,
fetch_batch_expor... |
migrations | 0024_extend_letter_of_declaration | # Generated by Django 2.2.7 on 2020-01-21 08:00
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("deposit", "0023_green_oa_service"),
]
operations = [
migrations.CreateModel(
name="LetterOfDecla... |
accounts | ArchiveOrg | # -*- coding: utf-8 -*-
import json
from pyload.core.network.http.exceptions import BadHeader
from ..base.account import BaseAccount
class ArchiveOrg(BaseAccount):
__name__ = "ArchiveOrg"
__type__ = "account"
__version__ = "0.01"
__status__ = "testing"
__description__ = """Archive.org account ... |
api | media | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2022 Alban 'spl0k' Féron
# 2018-2019 Carey 'pR0Ps' Metcalfe
#
# Distributed under terms of the GNU AGPLv3 license.
import hashlib
import json
import logging
import mimetypes
import ... |
extractors | pdf | __package__ = "archivebox.extractors"
from pathlib import Path
from typing import Optional
from ..config import CHROME_VERSION, SAVE_PDF, TIMEOUT
from ..index.schema import ArchiveError, ArchiveOutput, ArchiveResult, Link
from ..logging_util import TimedProgress
from ..system import chmod_file, run
from ..util import... |
scripts | lionbridge_import | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import argparse # To get the source directory from command line arguments.
import io # To fix encoding issues in Windows
import os # To find files from the source.
import os.path # To find files from the source and the ... |
lib | fileOperations | # 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 ... |
extractor | rte | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
float_or_none,
parse_iso8601,
str_or_none,
try_get,
unescapeHTML,
url_or_none,
)
from .common import InfoExtractor
class RteBaseIE(InfoExtractor):... |
protos | preprocessor_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/preprocessor.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 google.proto... |
models | slack_auth_token | from typing import Tuple
from apps.auth_token import constants, crypto
from apps.auth_token.models import BaseAuthToken
from apps.user_management.models import Organization, User
from django.db import models
from django.utils import timezone
from settings.base import SLACK_AUTH_TOKEN_TIMEOUT_SECONDS
def get_expire_d... |
scripts | importer | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Claude (longneck) <longneck@scratchbook.ch>
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Tool to import data from other browsers.
Currently importing bookmarks from Netscape HTML Bookm... |
meta-architectures | faster_rcnn_meta_arch_test_lib | # 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... |
ui | tagsfromfilenames | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007 Lukáš Lalinský
# Copyright (C) 2009, 2014, 2019-2022 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2014, 2017 Sophist-UK
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2017 Ville ... |
extractor | tube8 | from __future__ import unicode_literals
import re
from ..utils import int_or_none, str_to_int
from .keezmovies import KeezMoviesIE
class Tube8IE(KeezMoviesIE):
_VALID_URL = (
r"https?://(?:www\.)?tube8\.com/(?:[^/]+/)+(?P<display_id>[^/]+)/(?P<id>\d+)"
)
_TESTS = [
{
"url": "... |
BOPTools | JoinAPI | # /***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
snapshots | convert_legacy_snapshots | import json
from typing import Dict
import structlog
from posthog.session_recordings.models.session_recording import SessionRecording
from posthog.session_recordings.session_recording_helpers import decompress
from posthog.storage import object_storage
from prometheus_client import Histogram
logger = structlog.get_lo... |
migrations | 0218_uniqueness_constraint_tagged_items | # Generated by Django 3.2.5 on 2022-03-03 17:28
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
("posthog", "0217_team_primary_dashboard"),
]
operations = [
migrations.RunSQL(
sql="""
DELETE ... |
backends | backend | import importlib
import os
from .. import ports
DEFAULT_BACKEND = "mido.backends.rtmidi"
class Backend(object):
"""
Wrapper for backend module.
A backend module implements classes for input and output ports for
a specific MIDI library. The Backend object wraps around the
object and provides con... |
accounts | PorntrexCom | # -*- coding: utf-8 -*-
from ..base.account import BaseAccount
from ..helpers import parse_html_form
class PorntrexCom(BaseAccount):
# Actually not needed
__name__ = "PorntrexCom"
__type__ = "account"
__version__ = "0.01"
__status__ = "testing"
__description__ = """Porntrex.com account plugi... |
util | imagelist | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2017 Antonio Larrosa
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018, 2020-2022 Philipp Wolfer
# Copyright (C) 2019-2021 Laurent Monin
# Copyright (C) 2021 Gabriel Ferreira
#
# This program is free software; you can r... |
calendar | actions | from __future__ import annotations
from abilian.i18n import _l
from abilian.services import get_service
from abilian.services.security import Admin
from abilian.web.action import Action, FAIcon, actions
from flask import g, url_for
from flask_login import current_user
class CalendarAction(Action):
def url(self, ... |
downloaders | RapiduNet | # -*- coding: utf-8 -*-
import json
import re
import time
import pycurl
from pyload.core.utils import seconds
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.simple_downloader import SimpleDownloader
class RapiduNet(SimpleDownloader):
__name__ = "RapiduNet"
__type__ = "downloader"
__version_... |
extractor | skylinewebcams | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SkylineWebcamsIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html"
_TEST = {
"url": "https://www.skylinewebcams.com/it/webcam/italia/lazio/r... |
downloaders | UploadshipCom | # -*- coding: utf-8 -*-
import re
from ..base.xfs_downloader import XFSDownloader
class UploadshipCom(XFSDownloader):
__name__ = "UploadshipCom"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?uploadship\.com/\w{16}"
__config__ = [
... |
draftguitools | gui_dimensions | # ***************************************************************************
# * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
widgets | listedit | # 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
... |
analog | qa_noise | #!/usr/bin/env python
#
# Copyright 2007,2010,2012 Free Software Foundation, Inc.
# Copyright 2022 Marcus Müller
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import analog, gr, gr_unittest
class test_noise_source(gr_unittest.TestCase):
def setUp(self):
... |
gpodder | config | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... |
states | group | from __future__ import annotations
from gaphor.diagram.group import group, ungroup
from gaphor.UML.uml import Region, State, StateMachine, Transition, Vertex
@group.register(State, Vertex)
@group.register(StateMachine, Vertex)
def state_machine_vertex_group(state_machine: State | StateMachine, vertex: Vertex):
"... |
css | cssrulelist | """CSSRuleList implements DOM Level 2 CSS CSSRuleList.
Partly also http://dev.w3.org/csswg/cssom/#the-cssrulelist."""
__all__ = ["CSSRuleList"]
__docformat__ = "restructuredtext"
__version__ = "$Id$"
class CSSRuleList(list):
"""The CSSRuleList object represents an (ordered) list of statements.
The items in t... |
booster | toggleStates | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.booster.toggleStates import CalcToggleBoosterStatesCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiToggleBoosterStatesCommand(wx.Command):
def __init__(... |
comictaggerlib | optionalmsgdialog | """A PyQt4 dialog to show a message and let the user check a box
Example usage:
checked = OptionalMessageDialog.msg(self, "Disclaimer",
"This is beta software, and you are using it at your own risk!",
)
said_yes, checked = OptionalMessageDialog.question(self, "Que... |
searx | setup | # -*- coding: utf-8 -*-
"""Installer for Searx package."""
import os
import sys
from searx import brand
from searx.version import VERSION_STRING
from setuptools import find_packages, setup
with open("README.rst", encoding="utf-8") as f:
long_description = f.read()
with open("requirements.txt") as f:
require... |
ui | ui_options_script | # -*- 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_ScriptingOptionsPage(object):
def setupUi(self, ScriptingOptionsPage):
ScriptingOptionsPage.setObjectName("ScriptingOptionsPage")
Sc... |
core | Font | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
versions | 073_011f51208be3_update_resource_view_resource_id_ | # encoding: utf-8
"""073 Update resource view resource_id_constraint
Revision ID: 011f51208be3
Revises: 08dcb9233ad7
Create Date: 2018-09-04 18:49:14.072410
"""
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "011f51208be3"
dow... |
SimulationView | SimulationViewProxy | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.FlameProfiler import pyqtSlot
if TYPE_CHECKING:
from .SimulationView import Sim... |
lib | cache | # This file is part of MyPaint.
# Copyright (C) 2014-2018 by Andrew Chadwick <a.t.chadwick@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 Foundation; either version 2 of the License, or
# (at ... |
service | update | # =============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# 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 v... |
PartDesign | InitGui | # ***************************************************************************
# * Copyright (c) 2002,2003 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
commands | install | # This file is part of Archivematica.
#
# Copyright 2010-2016 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 ... |
extractors | zhihu | #!/usr/bin/env python
__all__ = ["zhihu_download", "zhihu_download_playlist"]
import json
from ..common import *
def zhihu_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
paths = url.split("/")
# question or column
if len(paths) < 3 and len(paths) < 6:
raise TypeError(
... |
anticaptchas | SolveMedia | # -*- coding: utf-8 -*-
import re
from pyload.core.network.exceptions import Fail
from ..base.captcha_service import CaptchaService
class SolveMedia(CaptchaService):
__name__ = "SolveMedia"
__type__ = "anticaptcha"
__version__ = "0.22"
__status__ = "testing"
__description__ = """SolveMedia cap... |
drawing-dataset | drawingdataset | import logging
import struct
from pathlib import Path
from struct import unpack
import click
import jsonlines
import six.moves.urllib as urllib
class DrawingDataset(object):
"""
interface to the drawing dataset
"""
def __init__(self, path_to_drawing_dataset, path_to_label_mapping):
self._pat... |
schemas | pages | from CTFd.models import Pages, ma
from CTFd.utils import string_types
from marshmallow import pre_load, validate
from marshmallow_sqlalchemy import field_for
class PageSchema(ma.ModelSchema):
class Meta:
model = Pages
include_fk = True
dump_only = ("id",)
title = field_for(
Pa... |
models | urlmodel | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Function to return the url completion model for the `open` command."""
from typing import Dict, Sequence
from qutebrowser.browser import history
from qutebrowser.completion.models import (
... |
VersionUpgrade45to46 | VersionUpgrade45to46 | # Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser
import io
from typing import List, Tuple
from UM.VersionUpgrade import VersionUpgrade
_removed_settings = {
"machine_filament_park_distance",
}
class VersionUpgrade45to46(VersionUpgrade):
def... |
viewers | abstractviewwidget | # 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
... |
Messages | MaterialSyncMessage | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING
from UM import i18nCatalog
from UM.Message import Message
if TYPE_CHECKING:
from ..UltimakerNetworkedPrinterOutputDevice import (
UltimakerNetworkedPrinterOutputDevice,
)
... |
lilydoc | documentation | # 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
... |
UML | modelinglanguage | """The UML Modeling Language module is the entrypoint for UML related
assets."""
from typing import Iterable
from gaphor.abc import ModelingLanguage
from gaphor.core import gettext
from gaphor.diagram.diagramtoolbox import (
DiagramType,
ElementCreateInfo,
ToolboxDefinition,
)
from gaphor.UML import diagr... |
sandbox | pink | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 14 14:43:13 2011
@author: timothee
"""
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import mlab
def one_over_f(f, knee, alpha):
desc = np.ones_like(f)
desc[f < KNEE] = np.abs((f[f < KNEE] / KNEE) ** (-alpha))
desc[0] = 1
return des... |
extractors | interest | #!/usr/bin/env python
from json import loads
from ..common import *
def interest_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
# http://ch.interest.me/zhtv/VOD/View/114789
# http://program.interest.me/zhtv/sonja/8/Vod/View/15794
html = get_content(url)
# get title
title =... |
widgets | common | # Copyright (C) 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 it w... |
lib | menus | # 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, ... |
Settings | SettingVisibilityPreset | import os
import urllib.parse
from configparser import ConfigParser
from typing import List
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
from UM.Logger import Logger
from UM.MimeTypeDatabase import MimeTypeDatabase
class SettingVisibilityPreset(QObject):
onSettingsChanged = pyqtSignal()
onNameC... |
decrypters | WorkuploadComFolder | # -*- coding: utf-8 -*-
import re
from pyload.core.utils.purge import uniquify
from ..base.simple_decrypter import SimpleDecrypter
class WorkuploadComFolder(SimpleDecrypter):
__name__ = "WorkuploadComFolder"
__type__ = "decrypter"
__version__ = "0.01"
__status__ = "testing"
__pattern__ = r"http... |
archival-storage | 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 ... |
utils | checkdir | #!/usr/bin/python3
"""
Functions to check if the path filesystem uses FAT
"""
import os
import sys
debug = False
def getcmdoutput(cmd):
"""execectue cmd, and give back output lines as array"""
with os.popen(cmd) as p:
outputlines = p.readlines()
return outputlines
def isFAT(check_dir):
""... |
fec | bercurve_generator | #!/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
#
#
import numpy
from gnuradio import blocks, gr
from .fec_test import fec_test
class bercurve_generator(gr.hier_block2):
def __init__(
self,
e... |
trayicon | menu | # Copyright 2004-2009 Joe Wreschnig, Michael Urman, Steven Robertson
# 2011-2017 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
# (... |
extractor | yourupload | # coding: utf-8
from __future__ import unicode_literals
from ..utils import urljoin
from .common import InfoExtractor
class YourUploadIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?(?:yourupload\.com/(?:watch|embed)|embed\.yourupload\.com)/(?P<id>[A-Za-z0-9]+)"
_TESTS = [
{
"url": "... |
filter | qa_file_taps_loader | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import inspect
import os
import numpy as np
from file_taps_loader import file_taps_loader
from gnuradio import filter, gr, gr_unittest
... |
utils | dataset_util | # 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... |
lib | recommender | # 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 | time | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2021 Gabriel Ferreira
# Copyright (C) 2021 Laurent Monin
# Copyright (C) 2021, 2023 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
... |
libs | munch | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
""" Munch is a subclass of dict with attribute-style access.
>>> b = Munch()
>>> b.hello = 'world'
>>> b.hello
'world'
>>> b['hello'] += "!"
>>> b.hello
'world!'
>>> b.foo = Munch(lol=True)
>>> b.foo.lol
True
>>> b.foo is b['fo... |
QT | PantallaAperturas | import copy
import os
import subprocess
from Code import AperturasStd, ControlPosicion, Jugada, Partida, Util, VarGen, Variantes
from Code.QT import (
Colocacion,
Columnas,
Controles,
Delegados,
FormLayout,
Grid,
Iconos,
QTUtil2,
QTVarios,
Tablero,
)
from PyQt4 import QtCore, Qt... |
users | helpers | from flask import render_template, render_template_string
from formspree import settings
from formspree.stuff import TEMPLATES, celery
from formspree.utils import send_email
from werkzeug.security import check_password_hash, generate_password_hash
def hash_pwd(password):
return generate_password_hash(password)
... |
SCL-output | ifc4 | # This file was generated by fedex_python. You probably don't want to edit
# it since your modifications will be lost if fedex_plus is used to
# regenerate it.
import sys
from SCL.AggregationDataTypes import *
from SCL.Builtin import *
from SCL.ConstructedDataTypes import *
from SCL.Rules import *
from SCL.SCLBase im... |
desktop | episodeselector | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... |
nfoview | action | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Osmo Salomaa
#
# 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 pr... |
extractor | sverigesradio | # coding: utf-8
from __future__ import unicode_literals
from ..utils import determine_ext, int_or_none, str_or_none
from .common import InfoExtractor
class SverigesRadioBaseIE(InfoExtractor):
_BASE_URL = "https://sverigesradio.se/sida/playerajax/"
_QUALITIES = ["low", "medium", "high"]
_EXT_TO_CODEC_MAP ... |
cli | timelapse | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
from concurrent.futures import ThreadPoolExecutor, wait
import click
from octoprint import FatalStar... |
extractor | anvato | # coding: utf-8
from __future__ import unicode_literals
import base64
import hashlib
import json
import random
import re
import time
from ..aes import aes_encrypt
from ..compat import compat_str
from ..utils import (
bytes_to_intlist,
determine_ext,
int_or_none,
intlist_to_bytes,
strip_jsonp,
... |
plotting | scaleBar | from friture.plotting import generated_cmrmap
from friture.plotting.frequency_scales import numberPrecision
from PyQt5 import QtCore, QtGui, QtWidgets
# A widget canvas with a baseline, ticks and tick labels
# The logic of the placement of scale min/max and ticks belongs to another class.
# The title belongs to anothe... |
preferences | view_and_edit | from gi.repository import Gtk
from sunflower.widgets.settings_page import SettingsPage
class Column:
ICON = 0
NAME = 1
COMMAND = 2
class ViewEditOptions(SettingsPage):
"""View & Edit options extension class"""
def __init__(self, parent, application):
SettingsPage.__init__(
s... |
cli | add | #
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to add new blocks """
import getpass
import os
import re
import click
from ..core import ModToolAdd, validate_name
from ..tools import SequenceCompleter, ask_yes_no
from ... |
metadata | _id3 | # 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... |
Tux | PersistentToolbarsGui | # Persistent toolbars for FreeCAD
# Copyright (C) 2016, 2017 triplus @ FreeCAD
#
#
# This library 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; either
# version 2.1 of the License, or (at your option... |
Tools | update_qt_language_files | #!/usr/bin/env python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2015 The FreeCAD Project Association *
# * ... |
TechDraw | TestTechDrawGui | # **************************************************************************
# Copyright (c) 2022 WandererFan <wandererfan@gmail.com> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
lib | xmlrpcutil | import sys
import cherrypy
from cherrypy._cpcompat import ntob
def get_xmlrpclib():
try:
import xmlrpc.client as x
except ImportError:
import xmlrpclib as x
return x
def process_body():
"""Return (params, method) from request body."""
try:
return get_xmlrpclib().loads(ch... |
views | documents | from __future__ import annotations
from datetime import datetime
from urllib.parse import quote
import sqlalchemy as sa
import sqlalchemy.orm
from abilian.core.extensions import db, mail
from abilian.core.signals import activity
from abilian.core.util import unwrap
from abilian.i18n import _, render_template_i18n
fro... |
async-migrations | utils | import asyncio
from datetime import datetime
from typing import Callable, Optional
import posthoganalytics
import structlog
from django.conf import settings
from django.db import transaction
from django.utils.timezone import now
from posthog.async_migrations.definition import AsyncMigrationOperation
from posthog.async... |
comictaggerlib | issueidentifier | """A class to automatically identify a comic archive"""
# 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-2.0... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.