section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
tools | textedit | from gaphor.core.modeling import Diagram
from gaphor.diagram.event import DiagramOpened
from gaphor.diagram.instanteditors import instant_editor
from gi.repository import Gdk, Gtk
def text_edit_tools(view, event_manager):
key_tool = Gtk.EventControllerKey.new()
click_tool = Gtk.GestureClick.new()
key_too... |
hal | metadata | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program 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 2
# of th... |
extractor | weiqitv | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class WeiqiTVIE(InfoExtractor):
IE_DESC = "WQTV"
_VALID_URL = r"https?://(?:www\.)?weiqitv\.com/index/video_play\?videoId=(?P<id>[A-Za-z0-9]+)"
_TESTS = [
{
"url": "http://www.weiqitv.com/index/... |
bs4 | diagnose | """Diagnostic functions, mainly for use when doing tech support."""
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import cProfile
import os
import pstats
import random
import sys
import tempfile
import time
import traceback
import bs4
from b... |
extractor | filmon | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_HTTPError, compat_str
from ..utils import ExtractorError, int_or_none, qualities, strip_or_none
from .common import InfoExtractor
class FilmOnIE(InfoExtractor):
IE_NAME = "filmon"
_VALID_URL = r"(?:https?://(?:www\.)?filmon\.... |
Assembly | CommandInsertLink | # SPDX-License-Identifier: LGPL-2.1-or-later
# /****************************************************************************
# *
# Copyright (c) 2023 Ondsel <development@ondsel.com> *
# ... |
plugins | euronews | """
$description French television news network, covering world news from the European perspective.
$url euronews.com
$type live
"""
import logging
import re
from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from str... |
preferences | import_export | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
extractor | njpwworld | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urlparse
from ..utils import get_element_by_class, urlencode_postdata
from .common import InfoExtractor
class NJPWWorldIE(InfoExtractor):
_VALID_URL = r"https?://(front\.)?njpwworld\.com/p/(?P<id>[a-z0-9_]+)"
IE_DE... |
Sandbox | InitGui | # ***************************************************************************
# * Copyright (c) 2002,2003 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
cmd | fsck | from __future__ import absolute_import, print_function
import glob
import os
import subprocess
import sys
from binascii import hexlify
from shutil import rmtree
from subprocess import PIPE
from tempfile import mkdtemp
from bup import git, options
from bup.compat import argv_bytes
from bup.helpers import Sha1, chunkyr... |
aliceVision | ApplyCalibration | __version__ = "1.0"
from meshroom.core import desc
class ApplyCalibration(desc.AVCommandLineNode):
commandLine = "aliceVision_applyCalibration {allParams}"
size = desc.DynamicNodeSize("input")
category = "Utils"
documentation = """
Overwrite intrinsics with a calibrated intrinsic.
"""
inputs = ... |
PyObjCTest | test_nsalert | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSAlertHelper(NSObject):
def alertShowHelp_(self, alert):
return 1
class TestNSAlert(TestCase):
def testConstants(self):
self.assertEqual(NSWarningAlertStyle, 0)
self.assertEqual(NSInformationalAlertStyle, 1)
... |
beancount | api | """V3 public API.
!WARNING! THIS IS EXPERIMENTAL.
The future of Beancount (v3) will bind the majority of public symbols on the
root package, so that one can seamlessly use it like e.g., numpy, with
import beancount as bn
bn.load_file(...)
WARNING: This is a prototype API. This is subject to change until the ... |
plugins | tv5monde | """
$description Live TV channel and video on-demand service from TV5Monde, a French free-to-air broadcaster.
$url tv5monde.com
$url tivi5mondeplus.com
$type live, vod
$region France, Belgium, Switzerland, Africa
"""
import re
from urllib.parse import quote
from streamlink.plugin import Plugin, pluginmatcher
from str... |
PyObjCTest | test_keyvalue_prop | import objc
from PyObjCTools.TestSupport import *
NSObject = objc.lookUpClass("NSObject")
class TestKVOPropHelper(NSObject):
def init(self):
self = super(TestKVOPropHelper, self).init()
if self is None:
return None
self.__helper = None
self.accessing = []
retu... |
settings | logs | import logging
import os
import threading
from typing import List
import structlog
from posthog.settings.base_variables import DEBUG, TEST
# Setup logging
LOGGING_FORMATTER_NAME = os.getenv("LOGGING_FORMATTER_NAME", "default")
DEFAULT_LOG_LEVEL = os.getenv("DJANGO_LOG_LEVEL", "ERROR" if TEST else "INFO")
class Filt... |
scripts | itemDiff | #!/usr/bin/env python3
# ===============================================================================
# Copyright (C) 2010-2011 Anton Vorobyov
#
# 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
# ... |
modeling | modelinglanguage | """C4 Model Language entrypoint."""
from gaphor.abc import ModelingLanguage
from gaphor.core.modeling import coremodel
class CoreModelingLanguage(ModelingLanguage):
@property
def name(self) -> str:
return ""
@property
def toolbox_definition(self):
raise ValueError("No toolbox for the... |
options | tags_compatibility_aac | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006 Lukáš Lalinský
# Copyright (C) 2019-2021 Philipp Wolfer
# Copyright (C) 2021 Laurent Monin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# a... |
PyObjCTest | test_nscollectionview | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSCollectionViewHelper(NSObject):
def collectionView_canDragItemsAtIndexes_withEvent_(self, v, i, e):
return 1
def collectionView_writeItemsAtIndexes_toPasteboard_(self, v, i, p):
return 1
def collectionView_draggingIma... |
aliceVision | NodalSfM | __version__ = "1.0"
from meshroom.core import desc
class NodalSfM(desc.AVCommandLineNode):
commandLine = "aliceVision_nodalSfM {allParams}"
size = desc.DynamicNodeSize("input")
category = "Sparse Reconstruction"
documentation = """
A Structure-From-Motion node specifically designed to handle pure ro... |
config | temperature | __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 typing import List
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_attrs_docs
... |
hal | forms | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program 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 2
# of th... |
ui | common | #
# Copyright (C) Damien Churchill 2008-2009 <damoxc@gmail.com>
# Copyright (C) Andrew Resch 2009 <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# S... |
autotag | hooks | # 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, ... |
clientScripts | extract_contents | #!/usr/bin/env python
import os
import sys
import uuid
import django
from django.db import transaction
django.setup()
from archivematicaFunctions import format_subdir_path, get_dir_uuids
# archivematicaCommon
from custom_handlers import get_script_logger
from databaseFunctions import fileWasRemoved
from executeOrRun... |
gui | resource_monitor | from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QWidget
from tribler.core.components.resource_monitor.implementation.base import ResourceMonitor
GUI_RESOURCE_CHECK_INTERVAL = 5000 # milliseconds
GUI_RESOURCE_HISTORY_SIZE = 1000
class GuiResourceMonitor(ResourceMonitor, QWidget):
"""
Implementati... |
gui | Platform | """
Copyright 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import os
import sys
from ..core.platform import Platform as CorePlatform
from ..core.utils.backports import ChainMap
from . import canvas
from .Config import Config
class Platform... |
KindleEar | config | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Configures for KindleEar, the First two variable is must to modify.
KindleEar配置文件,请务必修改开始两个配置(如果使用uploader,则uploader自动帮你修改)
"""
SRC_EMAIL = "akindleear@gmail.com" # Your gmail account for sending mail to Kindle
DOMAIN = "http://kindleear.appspot.com/" # Your domain of ... |
PyObjCTest | test_ikimagebrowsercell | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
class TestIKImageBrowserCell(TestCase):
@min_os_level("10.6")
def testConstants10_6(self):
self.assertEqual(IKImageStateNoImage, 0)
self.assertEqual(IKImageStateInvalid, 1)
... |
widgets | paif | from sglib.lib.translate import _
from sglib.models.multifx_settings import multifx_settings
from sgui.sgqt import *
from .multifx import MultiFXSingle
class per_audio_item_fx_widget:
def __init__(
self,
a_rel_callback,
a_val_callback,
):
self.effects = []
self.widget ... |
bookwyrm | redis_store | """ access the activity stores stored in redis """
from abc import ABC, abstractmethod
import redis
from bookwyrm import settings
r = redis.from_url(settings.REDIS_ACTIVITY_URL)
class RedisStore(ABC):
"""sets of ranked, related objects, like statuses for a user's feed"""
max_length = settings.MAX_STREAM_LE... |
gui | input_dialog | from __future__ import absolute_import
import fnmatch
import locale
import os
import time
from gi.repository import Gtk
from sunflower.common import UserDirectory, decode_file_name, get_user_directory
from sunflower.plugin_base.provider import FileType
from sunflower.plugin_base.provider import Support as ProviderSup... |
utorrent | client | #coding=utf8
import re
import urllib
import cookielib
import StringIO
import urllib2
import urlparse
try:
import json
except ImportError:
import simplejson as json
from upload import MultiPartForm
class UTorrentClient(object):
def __init__(self, base_url, username, password):
self.base_url = ... |
extractor | azmedien | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from .common import InfoExtractor
from .kaltura import KalturaIE
class AZMedienIE(InfoExtractor):
IE_DESC = "AZ Medien videos"
_VALID_URL = r"""(?x)
https?://
(?:www\.)?
... |
torrent-checker | utils | from __future__ import annotations
from asyncio import gather
from typing import Awaitable, Iterable, List, TypeVar, Union, cast
from tribler.core.components.torrent_checker.torrent_checker.dataclasses import (
HealthInfo,
TrackerResponse,
)
T = TypeVar("T")
async def gather_coros(coros: Iterable[Awaitable... |
widgets | additive_osc | import numpy
from sglib.lib import util
from sglib.lib.translate import _
from sglib.log import LOG
from sglib.math import clip_value, db_to_lin, lin_to_db
from sgui.sgqt import *
class abstract_custom_oscillator:
def __init__(self):
self.widget = QWidget()
self.widget.setObjectName("plugin_ui")
... |
website | signals | from allauth.account.signals import user_logged_in
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount.signals import pre_social_login
from django.shortcuts import render
from django.utils.translation import ugettext as _
from papers.models import Researcher
from papers.utils import validate... |
builder | package | #!/usr/bin/python3 -OO
# Copyright 2008-2017 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... |
decrypters | PastebinCom | # -*- coding: utf-8 -*-
from ..base.simple_decrypter import SimpleDecrypter
class PastebinCom(SimpleDecrypter):
__name__ = "PastebinCom"
__type__ = "decrypter"
__version__ = "0.09"
__status__ = "testing"
__pattern__ = r"https://(?:www\.)?pastebin\.com/(.+i=)?(?P<ID>\w{8})"
__config__ = [
... |
SCL | SimpleDataTypes | # Copyright (c) 2011, Thomas Paviot (tpaviot@gmail.com)
# All rights reserved.
# This file is part of the StepClassLibrary (SCL).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code mus... |
windows | file_properties | """
@file
@brief This file loads the File Properties dialog
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an open-source project
dedicated to... |
extractor | periscope | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, parse_iso8601, unescapeHTML
from .common import InfoExtractor
class PeriscopeBaseIE(InfoExtractor):
_M3U8_HEADERS = {"Referer": "https://www.periscope.tv/"}
def _call_api(self, method, query, item_id):
... |
builders | optimizer_builder | # 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... |
QT | PantallaMotores | import operator
import os
import random
from Code import Books, EnginesMicElo, MotoresExternos, Util, VarGen
from Code.QT import (
Colocacion,
Columnas,
Controles,
FormLayout,
Grid,
Iconos,
QTUtil,
QTUtil2,
QTVarios,
)
from PyQt4 import QtCore, QtGui
class WMotores(QTVarios.WDialo... |
postprocessor | xattrpp | from __future__ import unicode_literals
from ..compat import compat_os_name
from ..utils import (
XAttrMetadataError,
XAttrUnavailableError,
hyphenate_date,
write_xattr,
)
from .common import PostProcessor
class XAttrMetadataPP(PostProcessor):
#
# More info about extended attributes for media... |
frescobaldi-app | unicode_blocks | #!/usr/bin/env python
"""
Unicode Block data,
http://www.unicode.org/Public/5.2.0/ucd/Blocks.txt
The blocks() function returns a list of Block named tuples: (start, end, name).
The block() function returns the Block named tuple containing the given charcode,
if any.
"""
import collections
__all__ = ["blocks", "bl... |
clientScripts | check_for_service_directory | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
doc | conf | # -*- coding: utf-8 -*-
#
# RarFile documentation build configuration file, created by
# sphinx-quickstart on Sun Mar 24 13:29:46 2013.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All... |
app | test_freecad_interface | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2023 FreeCAD Project Association *
# * ... |
drone | localAdd | import wx
from gui.fitCommands.helpers import DroneInfo, droneStackLimit
from logbook import Logger
from service.fit import Fit
from service.market import Market
pyfalog = Logger(__name__)
class CalcAddLocalDroneCommand(wx.Command):
def __init__(self, fitID, droneInfo, forceNewStack=False, ignoreRestrictions=Fal... |
modules | mod_mediakeys | # 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
class MacMediaKeyEventsTap:
# http://weblog.rogueamoeba.com/2007/09/29/appl... |
engines | gigablast | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Gigablast (Web)
"""
# pylint: disable=missing-function-docstring, invalid-name
import re
from json import JSONDecodeError, loads
from urllib.parse import urlencode
from searx.exceptions import SearxEngineResponseException
from searx.poolrequests import get
# about
ab... |
preferences | change_password | """ class views for password management """
from bookwyrm import forms
from django.contrib.auth import login
from django.contrib.auth.decorators import login_required
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.views import View
from django.view... |
draftgeoutils | circles | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * *
# * Th... |
classes | files | """
@file
@brief This file is for legacy support of OpenShot 1.x project files
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an open-source pr... |
general | picture | """PictureItem diagram item."""
import base64
import io
import cairo
from gaphor.core.modeling import Picture
from gaphor.diagram.presentation import ElementPresentation
from gaphor.diagram.shapes import Box, IconBox
from gaphor.diagram.support import represents
from PIL import Image
@represents(Picture)
class Pict... |
controllers | creators | # -*- 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.... |
mako | lookup | # mako/lookup.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import os
import posixpath
import re
import stat
from mako import exceptions, util
from mako.templ... |
metadata-store | metadata_store_component | from tribler.core import notifications
from tribler.core.components.component import Component
from tribler.core.components.key.key_component import KeyComponent
from tribler.core.components.knowledge.rules.knowledge_rules_processor import (
KnowledgeRulesProcessor,
)
from tribler.core.components.metadata_store.db.... |
frescobaldi-app | fileprinter | # 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
... |
forms | pages | from CTFd.forms import BaseForm
from wtforms import (
BooleanField,
HiddenField,
MultipleFileField,
SelectField,
StringField,
TextAreaField,
)
from wtforms.validators import InputRequired
class PageEditForm(BaseForm):
title = StringField(
"Title", description="This is the title sho... |
lector | delegates | # This file is a part of Lector, a Qt based ebook reader
# Copyright (C) 2017-2019 BasioMeusPuga
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
mopidy | mixer | # ruff: noqa: ARG002
from __future__ import annotations
import logging
from typing import TYPE_CHECKING, Any, ClassVar, Literal, Optional
import pykka
from mopidy import listener
from pykka.typing import ActorMemberMixin, proxy_field, proxy_method
if TYPE_CHECKING:
from mopidy.types import Percentage
from t... |
utils | expr_utils | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import ast
import string
def expr_replace(expr, replace_dict):
"""
Search for vars in the expression and add the prepend.
Args:
expr: an expression string
... |
protos | hyperparams_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/hyperparams.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.protob... |
jobstores | base | import logging
from abc import ABCMeta, abstractmethod
import six
class JobLookupError(KeyError):
"""Raised when the job store cannot find a job for update or removal."""
def __init__(self, job_id):
super(JobLookupError, self).__init__(
"No job by the id of %s was found" % job_id
... |
gui | application | # This file is part of MyPaint.
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2013 by Martin Renold <martinxyz@gmx.ch>
# Copyright (C) 2013-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... |
twilioapp | views | import logging
from apps.base.utils import live_settings
from common.api_helpers.utils import create_engine_url
from django.http import HttpResponse
from rest_framework import status
from rest_framework.permissions import BasePermission
from rest_framework.response import Response
from rest_framework.views import APIV... |
writer8 | mobi | #!/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
... |
migrations | 0142_auto_20220227_1752 | # Generated by Django 3.2.12 on 2022-02-27 17:52
import django.db.models.deletion
from django.db import migrations, models
def add_default_themes(apps, schema_editor):
"""add light and dark themes"""
db_alias = schema_editor.connection.alias
theme_model = apps.get_model("bookwyrm", "Theme")
theme_mod... |
events | rbimport | # Copyright 2014 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 os
import xml.sax
from xml.s... |
deployments | node | """Node item may represent a node or a device UML metamodel classes.
Grouping
========
Node item can group following items
- other nodes, which are represented with Node.nestedNode on UML metamodel
level
- deployed artifacts using deployment
- components, which are parts of a node acting as structured classifier
... |
utils | tagged_streams | #!/usr/bin/env python
#
# Copyright 2013,2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
# DEPRECATED -- Marked for removal in 3.8
import pmt
from gnuradio import gr
def make_lengthtags(lengths, offsets, tagname="length", vlen=1):
tags = [... |
extractor | raywenderlich | from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (
ExtractorError,
int_or_none,
merge_dicts,
try_get,
unescapeHTML,
unified_timestamp,
urljoin,
)
from .common import InfoExtractor
from .vimeo import VimeoIE
class RayWenderlichIE(InfoEx... |
clickhouse | query_tagging | # This module is responsible for adding tags/metadata to outgoing clickhouse queries in a thread-safe manner
import threading
from typing import Any, Optional
thread_local_storage = threading.local()
def get_query_tags():
try:
return thread_local_storage.query_tags
except AttributeError:
ret... |
friture | curve | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2021 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... |
downloaders | JumbofilesCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class JumbofilesCom(SimpleDownloader):
__name__ = "JumbofilesCom"
__type__ = "downloader"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?jumbofiles\.com/(?P<ID>\w{12})"
__co... |
downloaders | FileuploadCom | # -*- coding: utf-8 -*-
from ..base.xfs_downloader import XFSDownloader
class FileuploadCom(XFSDownloader):
__name__ = "FileuploadCom"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?file-upload\.com/\w{12}"
__config__ = [
("enab... |
forum | tasks | """Celery tasks related to document transformation and preview."""
from __future__ import annotations
import email
import mailbox
import re
from os.path import expanduser
from pathlib import Path
from typing import Any
import bleach
import chardet
import html2text
from abilian.core.celery import periodic_task
from ab... |
Sidebar | SidebarPlugin | import html
import io
import json
import math
import os
import re
import sys
import time
import urllib
import urllib.parse
import gevent
import util
from Config import config
from Debug import Debug
from Plugin import PluginManager
from Translate import Translate
from util import helper
from util.Flag import flag
fro... |
deluge | crypto_utils | #
# Copyright (C) 2007,2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import os
import stat
im... |
AddonManager | addonmanager_freecad_interface | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2023 FreeCAD Project Association *
# * ... |
fta | seqgate | """SEQ gate item definition."""
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, IconBox, Text, stroke
from gaphor.diagram.support import r... |
settings | access | # Settings which restrict access to the site across the app
import os
import sys
import structlog
from posthog.settings.base_variables import DEBUG, TEST
from posthog.settings.utils import get_from_env, get_list, str_to_bool
logger = structlog.get_logger(__name__)
# SSL & cookie defaults
if os.getenv("SECURE_COOKIES... |
migrations | 0012_progressupdate | # Generated by Django 3.0.7 on 2020-11-17 07:36
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0011_auto_20201113_1727"),
]
operations = [
migrations.CreateMo... |
utils | internal | # coding:utf-8
import inspect
import six
# Adapted from: http://kbyanc.blogspot.com/2007/07/python-more-generic-getargspec.html
FUNC_OBJ_ATTR = "__func__" if six.PY3 else "im_func"
def getargspec(obj):
"""
Get the names and default values of a callable's
arguments
A tuple of four things is ret... |
api | site_app | import json
from django.http import HttpRequest, HttpResponse
from django.views.decorators.csrf import csrf_exempt
from posthog.exceptions import generate_exception_response
from posthog.logging.timing import timed
from posthog.plugins.site import get_site_config_from_schema, get_transpiled_site_source
from rest_frame... |
options | ratings | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2008-2009, 2020-2021 Philipp Wolfer
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2018, 2020-2021 Laurent Monin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GN... |
graphs | diaperchange_types | # -*- coding: utf-8 -*-
import plotly.graph_objs as go
import plotly.offline as plotly
from django.db.models import Case, Count, When
from django.db.models.functions import TruncDate
from django.utils.translation import get_language
from django.utils.translation import gettext as _
from reports import utils
def diape... |
Arch | ArchMaterial | # ***************************************************************************
# * Copyright (c) 2015 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
clientScripts | parse_dataverse_mets | #!/usr/bin/env python
"""Parse the transfer METS file created as part of a Dataverse transfer and
validate against the objects expected to be part of the SIP generated during
transfer.
"""
import json
import os
import uuid
import django
# databaseFunctions requires Django to be set up
django.setup()
import databaseF... |
extractor | dropbox | # coding: utf-8
from __future__ import unicode_literals
import os.path
import re
from ..compat import compat_urllib_parse_unquote
from ..utils import url_basename
from .common import InfoExtractor
class DropboxIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?dropbox[.]com/sh?/(?P<id>[a-zA-Z0-9]{15})/.*"
... |
widgets | waitingoverlay | # 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
... |
pages | admin_pages | # 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, ... |
serializers | escalation_policy | import time
from datetime import timedelta
from apps.alerts.models import CustomButton, EscalationChain, EscalationPolicy
from apps.schedules.models import OnCallSchedule
from apps.slack.models import SlackUserGroup
from apps.user_management.models import User
from apps.webhooks.models import Webhook
from common.api_h... |
views | api | # encoding: utf-8
from __future__ import annotations
import datetime
import html
import io
import logging
import os
from typing import Any, Callable, Optional, Union
import ckan.model as model
from ckan.common import _, current_user, g, json, request
from ckan.lib.base import render
from ckan.lib.helpers import url_f... |
extractor | nfl | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import clean_html, determine_ext, get_element_by_class
from .common import InfoExtractor
class NFLBaseIE(InfoExtractor):
_VALID_URL_BASE = r"""(?x)
https?://
(?P<host>
... |
async-group | async_group | from __future__ import annotations
import asyncio
import logging
from asyncio import CancelledError, Future, Task
from contextlib import suppress
from typing import Coroutine, Iterable, List, Optional, Set
from weakref import ref
from tribler.core.utilities.async_group.exceptions import DoneException
def done_callb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.