section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
utils | np_box_list_ops | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
version-checks | python_checker | __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"
from ..exceptions import CannotCheckOffline, ConfigurationInvalid
def get_latest(... |
views | soundpacks | import html
import json
import logging
import os
import random
import shutil
import tempfile
import zipfile
from collections import deque
from datetime import datetime
from os import scandir
from urllib.parse import urlencode, urljoin
import cddagl.constants as cons
import rarfile
from cddagl import __version__ as ver... |
layer | data | # This file is part of MyPaint.
# -*- coding: utf-8 -*-
# Copyright (C) 2019 by The Mypaint Development Team
# Copyright (C) 2011-2017 by Andrew Chadwick <a.t.chadwick@gmail.com>
# Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch>
#
# This program is free software; you can redistribute it and/or modify
# it u... |
libraries | quodlibetlib | import os
import pickle
import time
import traceback
from collections import defaultdict
from copy import deepcopy
from functools import partial
import quodlibet.config
from PyQt5.QtCore import QDir, Qt
from PyQt5.QtWidgets import (
QCompleter,
QFileDialog,
QFileSystemModel,
QHBoxLayout,
QLabel,
... |
classes | language | """
@file
@brief This file loads the current language based on the computer's locale settings
@author Noah Figg <eggmunkee@hotmail.com>
@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... |
OctoPrint | setup | # -*- coding: utf-8 -*-
### NOTE #################################################################################
# This file has to stay format compatible to Python 2, or pip under Python 2 will
# not be able to detect that OctoPrint requires Python 3 but instead fail with a
# syntax error.
#
# So, no f-strings, no ... |
Arranging | GridArrange | import math
from typing import TYPE_CHECKING, List, Set, Tuple, Union
if TYPE_CHECKING:
from UM.Scene.SceneNode import SceneNode
from cura.BuildVolume import BuildVolume
from cura.Arranging.Arranger import Arranger
from UM.Application import Application
from UM.Math.AxisAlignedBox import AxisAlignedBox
from U... |
songsmenu | html | # Copyright 2005 Eduardo Gonzalez
# 2020 Roneel Valambhia
#
# 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.
f... |
Code | Tacticas | import codecs
import os
import random
from Code import Util
class BaseTactica:
def __init__(self):
self.PUZZLES = 100 # Max number of puzzles in each block
self.JUMPS = [
3,
5,
9,
17,
] # Puzzle repetitions, each puzzle can be repeated, th... |
gdist | util | # Copyright 2016 Christoph Reiter
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# dist... |
server | mcp | """
Start and run MCPServer via the `main` function.
`main` goes through the following steps:
1. A `ThreadPoolExecutor` is initialized with a configurable number of threads
(default ncpus).
2. A signal listener is setup to handle shutdown on SIGINT/SIGTERM events.
3. The default workflow is loaded (from workflow.j... |
utils | db | import imghdr
import mimetypes
import os
import re
import subprocess
import time
from datetime import datetime
from decimal import Decimal
from django.utils.timezone import utc
from photonix.photos.models import (
Camera,
Lens,
Library,
Photo,
PhotoFile,
PhotoTag,
Tag,
Task,
)
from phot... |
extractor | dtube | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from socket import timeout
from ..utils import int_or_none, parse_iso8601
from .common import InfoExtractor
class DTubeIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?d\.tube/(?:#!/)?v/(?P<uploader_id>[0-9a-z.-]+)/(?P<id>[0-9a-z]... |
beetsplug | ihate | # This file is part of beets.
# Copyright 2016, Blemjhoo Tezoulbr <baobab@heresiarch.info>.
#
# 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 limitati... |
ui | drawBotPackageController | import os
import vanilla
from defconAppKit.windows.baseWindow import BaseWindowController
from drawBot.drawBotPackage import DrawBotPackage
class DrawBotPackageController(BaseWindowController):
packageInfo = [
"name",
"version",
"developer",
"developerURL",
"requiresVersio... |
natsort | natsort | # -*- coding: utf-8 -*-
"""
Natsort can sort strings with numbers in a natural order.
It provides the natsorted function to sort strings with
arbitrary numbers.
You can mix types with natsorted. This can get around the new
'unorderable types' issue with Python 3. Natsort will recursively
descend into lists of lists s... |
ui | toolbox | """The Toolbox which is the tool palette.
This is the toolbox in the lower left of the screen.
"""
import functools
import logging
from typing import Optional, Tuple
from gaphor.core.eventmanager import EventManager, event_handler
from gaphor.diagram.diagramtoolbox import ToolboxDefinition
from gaphor.diagram.event ... |
examples | pyqt_example_f | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import blocks, filter, gr
from gnuradio.fft import window
try:
import sip
from gnuradio import qtgui
from PyQt5 i... |
webkit | webpage | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""The main browser widgets."""
import functools
import html
from qutebrowser.browser import downloads, greasemonkey, pdfjs, shared
from qutebrowser.browser.webkit import http
from qutebrowser... |
mido | tokenizer | from collections import deque
from numbers import Integral
from .messages.specs import SPEC_BY_STATUS, SYSEX_END, SYSEX_START
from .py2 import convert_py2_bytes
class Tokenizer(object):
"""
Splits a MIDI byte stream into messages.
"""
def __init__(self, data=None):
"""Create a new decoder.""... |
plover | resource | import os
import shutil
from contextlib import contextmanager
from importlib.util import find_spec
from tempfile import NamedTemporaryFile
ASSET_SCHEME = "asset:"
def _asset_filename(resource_name):
components = resource_name[len(ASSET_SCHEME) :].split(":", 1)
if len(components) != 2:
raise ValueErro... |
CIHazeFilterSample | HazeFilterView | import MyHazeFilter
import objc
from Cocoa import *
from Quartz import *
class HazeFilterView(NSView):
filter = objc.ivar()
distance = objc.ivar(type=objc._C_FLT)
slope = objc.ivar(type=objc._C_FLT)
def distanceSliderChanged_(self, sender):
self.distance = sender.floatValue()
self.set... |
accounts | MegaRapidCz | # -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
class MegaRapidCz(BaseAccount):
__name__ = "MegaRapidCz"
__type__ = "account"
__version__ = "0.43"
__status__ = "testing"
__description__ = """MegaRapid.cz account plugin"""
__license__ = "GPLv3"
__auth... |
elmer | tasks | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Draft | TestDraft | # ***************************************************************************
# * Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * Th... |
sword | tests | import json
import os
import re
from datetime import date
from zipfile import ZipFile
import pytest
import responses
from deposit.models import DDC, DepositRecord, License, LicenseChooser
from deposit.protocol import DepositError, DepositResult
from deposit.sword.forms import SWORDMETSForm
from deposit.sword.protocol ... |
PathTests | TestMach3Mach4Post | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2022 Larry Woestman <LarryWoestman2@gmail.com> *
# * ... |
Utils | Decorators | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import functools
import re
from typing import Callable
# An API version must be a semantic version "x.y.z" where ".z" is optional. So the valid formats are as follows:
# - x.y.z
# - x.y
SEMANTIC_VERSION_REGEX = re.compil... |
extractor | teachingchannel | from __future__ import unicode_literals
from .common import InfoExtractor
class TeachingChannelIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?teachingchannel\.org/videos?/(?P<id>[^/?&#]+)"
_TEST = {
"url": "https://www.teachingchannel.org/videos/teacher-teaming-evolution",
"info_dict":... |
mopidy | ext | from __future__ import annotations
import logging
import sys
from collections.abc import Mapping
from typing import TYPE_CHECKING, NamedTuple, Union
if sys.version_info < (3, 10):
import importlib_metadata as metadata # pyright: ignore[reportMissingImports]
else:
from importlib import metadata
from mopidy i... |
migrations | 0012_licenses | # Generated by Django 2.2.1 on 2019-05-17 09:25
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("deposit", "0011_nullable_fields"),
]
operations = [
migrations.CreateModel(
name="License",
... |
tagsources | musicbrainz | import json
import re
import time
import urllib.error
import urllib.parse
import urllib.request
from collections import defaultdict
from html.parser import HTMLParser
from itertools import chain
from xml.dom import Node, minidom
from xml.sax.saxutils import escape, quoteattr
from puddlestuff.audioinfo import IMAGETYPE... |
port | efs | import json
from math import log
from numbers import Number
import eos.db
from config import getVersion
from eos.const import FittingHardpoint, FittingModuleState, FittingSlot
from eos.db import gamedata_session, getAttributeInfo, getCategory, getGroup
from eos.effectHandlerHelpers import HandledList
from eos.gamedata... |
admin | celery_status | """ celery status """
import json
import redis
from bookwyrm.tasks import (
BROADCAST,
CONNECTORS,
EMAIL,
HIGH,
IMAGES,
IMPORT_TRIGGERED,
IMPORTS,
INBOX,
LISTS,
LOW,
MEDIUM,
MISC,
STREAMS,
SUGGESTED_USERS,
)
from bookwyrm.tasks import app as celery
from celerywyr... |
filter | optfir | #
# Copyright 2004,2005,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Routines for designing optimal FIR filters.
For a great intro to how all this stuff works, see section 6.6 of
"Digital Signal Processing: A Practical Approach", Emmanuae... |
migrations | 0036_mediaconch_validation | from django.db import migrations
def data_migration(apps, schema_editor):
"""Workflow migrations for file validation using MediaConch.
Changes workflow so that, at a high-level the following micro-services are
created:
1. "Validate Preservation Derivatives" micro-service
2. "Validate Access Deri... |
saveddata | mutatorDrone | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
ipconsole | ipconsoleprefs | # Copyright (C) 2012 Brian Parma
#
# 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 1, or (at your option)
# any later version.
#
# This program is distributed in the hope that it ... |
gst | gst_utils | # 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... |
friture | plotCurve | import numpy as np
from friture.curve import Curve
from PyQt5.QtCore import pyqtProperty, pyqtSignal
from PyQt5.QtGui import QColor
from PyQt5.QtQuick import (
QQuickItem,
QSGFlatColorMaterial,
QSGGeometry,
QSGGeometryNode,
QSGNode,
)
class PlotCurve(QQuickItem):
colorChanged = pyqtSignal()
... |
mobi | langcodes | #!/usr/bin/env python
__license__ = "GPL v3"
__copyright__ = "2008, Kovid Goyal kovid@kovidgoyal.net"
__docformat__ = "restructuredtext en"
from struct import pack
from calibre.utils.localization import lang_as_iso639_1
lang_codes = {}
main_language = {
0: "NEUTRAL",
54: "AFRIKAANS",
28: "ALBANIAN",
... |
utils | requirements | """
flaskbb.utils.requirements
~~~~~~~~~~~~~~~~~~~~~~~~~~
Authorization requirements for FlaskBB.
:copyright: (c) 2015 by the FlaskBB Team.
:license: BSD, see LICENSE for more details
"""
import logging
from flask_allows import And, Or, Permission, Requirement
from flaskbb.exceptions import Flask... |
migrations | 0263_plugin_config_web_token | # Generated by Django 3.2.15 on 2022-09-29 11:07
from django.db import migrations, models
from posthog.models.utils import generate_random_token
def forwards_func(apps, schema_editor):
PluginConfig = apps.get_model("posthog", "PluginConfig")
plugin_configs = PluginConfig.objects.all()
for plugin_config i... |
draftviewproviders | view_bezcurve | # ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
extractor | nobelprize | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
determine_ext,
get_element_by_attribute,
int_or_none,
js_to_json,
mimetype2ext,
update_url_query,
)
from .common import InfoExtractor
class NobelPrizeIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?nobelpri... |
lib | jobs | #!/usr/bin/env python
# encoding: utf-8
"""
Asynchronous background jobs.
Note that most job management functions are not available from this
module but via the various ``job_*`` API functions.
Internally, RQ queue names are prefixed with a string containing the
CKAN site ID to avoid key collisions when the same Red... |
gamedata | category | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
borg | manifest | import enum
import re
from collections import abc, namedtuple
from collections.abc import Sequence
from datetime import datetime, timedelta, timezone
from operator import attrgetter
from .logger import create_logger
logger = create_logger()
from .constants import * # NOQA
from .helpers.datastruct import StableDict
... |
puddlestuff | musiclib | # -*- coding: utf-8 -*-
"""Module for importing music libraries into puddletag.
See puddlestuff.libraries.quodlibetlib for an example implementation.
Classes of interest:
LibraryWidget->Shows a tree view of library with search edit.
LibraryTree->Actual widget used to show library info.
"""
import sys
from collectio... |
migrations | 201709041519_d0ffadc3ea48_add_hidden_columns | """Add hidden columns
Revision ID: d0ffadc3ea48
Revises:
Create Date: 2017-09-04 15:19:38.519991
"""
import flaskbb
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "d0ffadc3ea48"
down_revision = "881dd22cab94"
branch_labels = ()
depends_on = None
def upgrade():
... |
doxyxml | doxyindex | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-howto
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Classes providing more user-friendly interfaces to the doxygen xml
docs than the generated classes prov... |
Arch | ArchEquipment | # -*- coding: utf8 -*-
# ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it an... |
Inspection | Init | # ***************************************************************************
# * Copyright (c) 2001,2002 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
BasicDrawing | ShadowsAndTransparencyLayers | import Utilities
from Quartz import *
def scaleShadowOffset(offset):
shadowScaling = Utilities.getScalingFactor()
# Adjust the shadow offset if scaling to export as bits. This is
# equivalent to scaling base space by the scaling factor.
if shadowScaling != 1.0:
offset = CGSizeApplyAffineTransf... |
Doc | conf | # -*- coding: utf-8 -*-
#
# PyObjC-Core documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 22 15:20:27 2009.
#
# 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.
#
#... |
femviewprovider | view_constraint_selfweight | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
X3DReader | X3DReader | # Contributed by Seva Alekseyev <sevaa@nih.gov> with National Institutes of Health, 2016
# Cura is released under the terms of the LGPLv3 or higher.
from math import cos, pi, sin, sqrt
from typing import Dict
import numpy
from cura.Scene.CuraSceneNode import CuraSceneNode as SceneNode
from UM.Job import Job
from UM.L... |
neubot | log_api | # neubot/log_api.py
#
# Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lic... |
extractor | massengeschmacktv | from __future__ import unicode_literals
import re
from ..utils import (
clean_html,
determine_ext,
int_or_none,
js_to_json,
mimetype2ext,
parse_filesize,
)
from .common import InfoExtractor
class MassengeschmackTVIE(InfoExtractor):
IE_NAME = "massengeschmack.tv"
_VALID_URL = r"https?... |
PartDesignTests | TestChamfer | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
blocks | qa_wavfile | #!/usr/bin/env python
#
# Copyright 2008,2010,2013,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import os
from os.path import getsize
from gnuradio import blocks, gr, gr_unittest
g_in_file = os.path.join(os.getenv("srcdir"), "test_16bit_1ch... |
analog | qa_probe_avg_mag_sqrd | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import analog, blocks, gr, gr_unittest
def avg_mag_sqrd_c(x, alpha):
y = [
0,
]
for xi in x:
tmp = ... |
OAuth2 | KeyringAttribute | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from io import BlockingIOError
from typing import TYPE_CHECKING, List, Optional, Type
import keyring
from keyring.backend import KeyringBackend
from keyring.errors import KeyringError, KeyringLocked, NoKeyringError, Passwor... |
Models | MultiBuildPlateModel | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt6.QtCore import QTimer, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Qt.ListModel import ListModel
from UM.Scene.Camera import Camera
from UM.Scene.Selection import Selection
class Mult... |
extractor | daum | # coding: utf-8
from __future__ import unicode_literals
import itertools
from ..compat import compat_parse_qs, compat_urllib_parse_unquote, compat_urlparse
from .common import InfoExtractor
class DaumBaseIE(InfoExtractor):
_KAKAO_EMBED_BASE = "http://tv.kakao.com/embed/player/cliplink/"
class DaumIE(DaumBase... |
extractors | joy | #!/usr/bin/env python
__all__ = ["joy_download"]
from ..common import *
def video_info(channel_id, program_id, volumn_id):
url = "http://msx.app.joy.cn/service.php"
if program_id:
url += "?action=vodmsxv6"
url += "&channelid=%s" % channel_id
url += "&programid=%s" % program_id
... |
utils | table_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import io
import textwrap
import unittest
from decimal import Decimal
from beancount.utils import table
class TestTable(unittest.TestCase):
def test_attribute_to_title(self):
attributes = list(map(table.... |
projectedFighter | abilityToggleState | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.fighter.abilityToggleStates import (
CalcToggleFighterAbilityStatesCommand,
)
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiToggleProjectedFighterAbilityState... |
migrations | 0006_auto_20201012_1520 | # Generated by Django 3.0.8 on 2020-10-12 15:20
from django.db import migrations, models
from django.utils.text import slugify
def forwards_func(apps, schema_editor):
SnapshotModel = apps.get_model("core", "Snapshot")
TagModel = apps.get_model("core", "Tag")
db_alias = schema_editor.connection.alias
... |
PyObjCTest | test_methods2 | import sys
import objc
from objc import NO, YES, nil
from PyObjCTest import ctests
from PyObjCTest.fnd import NSPriorDayDesignations
from PyObjCTools.TestSupport import *
if sys.version_info[0] == 3:
unicode = str
# Several types are encoded slightly different on 32-bit vs. 64-bit
# - NSPoint and NSRect: the act... |
plugins | idf1 | """
$description French live TV channel and video on-demand service owned by IDF1.
$url idf1.fr
$type live, vod
$metadata id
$metadata title
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
log = lo... |
plugins | mrtmk | """
$description Live TV channels and video on-demand service from MRT, a North Macedonian public, state-owned broadcaster.
$url play.mrt.com.mk
$type live, vod
$region North Macedonia
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from stre... |
legacy | v3_2_0_session_header_format | from typing import TYPE_CHECKING, Any, Dict, List, Type
if TYPE_CHECKING:
from httpie.sessions import Session
OLD_HEADER_STORE_WARNING = """\
Outdated layout detected for the current session. Please consider updating it,
in order to use the latest features regarding the header layout.
For fixing the current ses... |
projectedFit | changeAmount | import wx
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcChangeProjectedFitAmountCommand(wx.Command):
def __init__(self, fitID, projectedFitID, amount, relative=False):
wx.Command.__init__(self, True, "Change Projected Fit Amount")
self.fitID = fitID
... |
PyObjCTest | test_caanimation | from PyObjCTools.TestSupport import *
from Quartz.QuartzCore import *
try:
unicode
except NameError:
unicode = str
class TestCAAnimationHelper(NSObject):
def animationDidStop_finished_(self, a, f):
pass
class TestCAAnimation(TestCase):
@min_os_level("10.5")
def testMethods(self):
... |
OLD | lineseg | import morph
from pylab import *
from scipy.ndimage import filters, measurements, morphology
from toplevel import *
@checks(AFLOAT2,alpha=RANGE(0.0,20.0),r=RANGE(0,20))
def dpcuts(image,alpha=0.5,r=2):
"""Compute dynamic programming cuts through an image.
The image contains the costs themselves, `alpha` is th... |
printing | printrend | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
experiments | funnel_experiment_result | from dataclasses import asdict, dataclass
from datetime import datetime
from typing import List, Optional, Tuple, Type
from zoneinfo import ZoneInfo
from ee.clickhouse.queries.experiments import (
CONTROL_VARIANT_KEY,
FF_DISTRIBUTION_THRESHOLD,
MIN_PROBABILITY_FOR_SIGNIFICANCE,
)
from numpy.random import d... |
blocks | qa_add_mult_div_sub | #!/usr/bin/env python
#
# Copyright 2004,2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest
class test_add_mult_div_sub(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.t... |
extractor | funimation | # coding: utf-8
from __future__ import unicode_literals
import random
import string
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
js_to_json,
urlencode_postdata,
)
from .common import InfoExtractor
class FunimationIE(InfoExtractor):
_... |
extractor | franceculture | # coding: utf-8
from __future__ import unicode_literals
from ..utils import determine_ext, extract_attributes, int_or_none
from .common import InfoExtractor
class FranceCultureIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?franceculture\.fr/emissions/(?:[^/]+/)*(?P<id>[^/?#&]+)"
)
_TESTS ... |
views | search | """ search views"""
import re
from bookwyrm import models
from bookwyrm.book_search import format_search_result, search
from bookwyrm.connectors import connector_manager
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.utils import regex
from csp.decorators import csp_update
from django.contrib.postgres.search ... |
network | threads | """Threading primitives for the network package"""
import logging
import random
import threading
from contextlib import contextmanager
class StoppableThread(threading.Thread):
"""Base class for application threads with stopThread method"""
name = None
logger = logging.getLogger("default")
def __ini... |
tools | variation | from collections import OrderedDict
import CoreText
from drawBot.misc import memoize, warnings
from fontTools.ttLib import TTFont
"""
https://developer.apple.com/documentation/coretext/ctfont/font_variation_axis_dictionary_keys?language=objc
https://developer.apple.com/documentation/coretext/1508650-ctfontdescriptorc... |
clientScripts | load_dublin_core | #!/usr/bin/env python
import json
import os
import sys
import django
django.setup()
from django.db import transaction
# dashboard
from main import models
# This is the UUID of SIP from the `MetadataAppliesToTypes` table
INGEST_METADATA_TYPE = "3e48343d-e2d2-4956-aaa3-b54d26eb9761"
def main(job, sip_uuid, dc_path)... |
migrations | 0026_auto_20200227_0804 | # Generated by Django 3.0.3 on 2020-02-27 08:04
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
("posthog", "0025_cohort"),
]
operations = [
migrations.CreateModel(
name="Elem... |
extractor | douyutv | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import re
import time
from ..utils import ExtractorError, unescapeHTML, unified_strdate, urljoin
from .common import InfoExtractor
class DouyuTVIE(InfoExtractor):
IE_DESC = "斗鱼"
_VALID_URL = r"https?://(?:www\.)?douyu(?:tv)?\.com/(?:[^/]... |
migrations | 0001_initial | # Generated by Django 2.2 on 2019-05-01 03:27
import uuid
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Snapshot",
fields=[
(
... |
calculix | write_constraint_contact | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
diagram | export | """Service dedicated to exporting diagrams to a variety of file formats."""
import re
import cairo
from gaphas.painter import BoundingBoxPainter, FreeHandPainter, PainterChain
from gaphor.core.modeling.diagram import StyledDiagram
from gaphor.diagram.painter import DiagramTypePainter, ItemPainter
def escape_filenam... |
accounts | FshareVn | # -*- coding: utf-8 -*-
import json
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.account import BaseAccount
class FshareVn(BaseAccount):
__name__ = "FshareVn"
__type__ = "account"
__version__ = "0.27"
__status__ = "testing"
__description__ = """Fshare.vn a... |
lib | gzipper | # 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, ... |
eva | scheduler | from __future__ import annotations
import logging
from asyncio import Future
from typing import TYPE_CHECKING, Dict, Iterable, List
from tribler.core.components.ipv8.eva.result import TransferResult
from tribler.core.components.ipv8.eva.transfer.base import Transfer
from tribler.core.utilities.async_group.async_group... |
clientScripts | trim_verify_checksums | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 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... |
statusbar | clock | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Clock displayed in the statusbar."""
from datetime import datetime
from qutebrowser.mainwindow.statusbar import textbase
from qutebrowser.qt.core import Qt, QTimer
class Clock(textbase.Tex... |
ui | reconstruction | import json
import logging
import math
import os
from collections.abc import Iterable
from multiprocessing.pool import ThreadPool
from threading import Thread
import meshroom.common
import meshroom.core
from meshroom import multiview
from meshroom.common.qt import QObjectListModel
from meshroom.core import Version
fro... |
retention | sql | RETENTION_BREAKDOWN_SQL = """
WITH actor_query AS ({actor_query})
SELECT
actor_activity.breakdown_values AS breakdown_values,
actor_activity.intervals_from_base AS intervals_from_base,
COUNT(DISTINCT actor_activity.actor_id) AS count
FROM actor_query AS actor_activity
GROUP BY... |
tools | template_convert | #!/usr/bin/env python3
import os
import re
from argparse import ArgumentParser
template_keywords = [
"GR_EXPAND_X_H",
"GR_EXPAND_CC_H",
"GR_EXPAND_X_CC_H_IMPL",
"GR_EXPAND_X_CC_H",
]
template_regex = re.compile(
r"^(?P<template_type>"
+ "|".join(template_keywords)
+ r")\("
+ r"(?P<cate... |
social-auth | pipeline | import logging
from urllib.parse import urljoin
from apps.slack.tasks import (
populate_slack_channels_for_team,
populate_slack_usergroups_for_team,
)
from apps.social_auth.exceptions import InstallMultiRegionSlackException
from common.constants.slack_auth import (
SLACK_AUTH_SLACK_USER_ALREADY_CONNECTED_E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.