section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
accounts | TbSevenPl | # -*- coding: utf-8 -*-
import re
import time
from ..base.multi_account import MultiAccount
class TbSevenPl(MultiAccount):
__name__ = "TbSevenPl"
__type__ = "account"
__version__ = "0.02"
__status__ = "testing"
__config__ = [
("mh_mode", "all;listed;unlisted", "Filter downloaders to use... |
equations | nonlinear | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2022 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * Th... |
Gui | BitLibrary | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2020 Schildkroet *
# * ... |
downloader | external | from __future__ import unicode_literals
import os
import re
import subprocess
import sys
import tempfile
import time
from ..compat import compat_setenv, compat_str
from ..postprocessor.ffmpeg import EXT_TO_OUT_FORMATS, FFmpegPostProcessor
from ..utils import (
T,
check_executable,
cli_bool_option,
cli... |
Test | Menu | # ***************************************************************************
# * Copyright (c) 2005 Werner Mayer <werner.wm.mayer@gmx.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
sabnzbd | panic | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
songsmenu | embedded | # Copyright 2013 Christoph Reiter
# 2013-2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from... |
jobstores | rethinkdb | from __future__ import absolute_import
from apscheduler.job import Job
from apscheduler.jobstores.base import BaseJobStore, ConflictingIdError, JobLookupError
from apscheduler.util import (
datetime_to_utc_timestamp,
maybe_ref,
utc_timestamp_to_datetime,
)
try:
import cPickle as pickle
except ImportEr... |
matrix | randomization | from enum import Enum
from typing import Dict, List, Tuple
import mimesis
import mimesis.random
WeightedPool = Tuple[List[str], List[int]]
class Industry(str, Enum):
TECHNOLOGY = "technology"
FINANCE = "finance"
MEDIA = "media"
HEALTHCARE = "healthcare"
EDUCATION = "education"
ENTERTAINMENT ... |
Drawing | DrawingPatterns | # ***************************************************************************
# * *
# * (c) Yorik van Havre (yorik@uncreated.net 2015 *
# * *
# * Th... |
anchor-generators | grid_anchor_generator | # 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... |
util | id_extractors | # 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, ... |
plugins | drop_no_publish | import fnmatch
import glob
import json
import os
import pelican
from pelican import signals
# Monkey patch the ArticleGenerator to override specific method.
# We have to override the `_include_path` method because it does not
# filter files with enough specificity. If we wanted to filter a talk
# at `categories/jack... |
engines | etools | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
eTools (Web)
"""
from urllib.parse import quote
from lxml import html
from searx.utils import eval_xpath, extract_text
# about
about = {
"website": "https://www.etools.ch",
"wikidata_id": None,
"official_api_documentation": None,
"use_official_api": F... |
chardet | langhungarianmodel | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
draftfunctions | cut | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
aliceVision | ColorCheckerDetection | __version__ = "1.0"
import os.path
from meshroom.core import desc
class ColorCheckerDetection(desc.AVCommandLineNode):
commandLine = "aliceVision_colorCheckerDetection {allParams}"
size = desc.DynamicNodeSize("input")
# parallelization = desc.Parallelization(blockSize=40)
# commandLineRange = '--ran... |
extractor | globalplayer | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
T,
clean_html,
join_nonempty,
merge_dicts,
parse_duration,
str_or_none,
traverse_obj,
unified_strdate,
unified_timestamp,
urlhandle_detect_ext,
)
from .common import InfoExtractor
class GlobalPlayerB... |
chardet | codingstatemachine | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
web | common | #
# Copyright (C) 2009 Damien Churchill <damoxc@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 gettext
from deluge.com... |
localDrone | mutatedRevert | import math
import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand
from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand
from gui.fitCommands.helpers import DroneInfo, InternalCommandHistory
from ... |
qltk | models | # Copyright 2013, 2014 Christoph Reiter
# 2015, 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
# (at your option) any later ve... |
blocks | qa_tag_file_sink | #!/usr/bin/env python
#
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import os
import struct
from gnuradio import blocks, gr, gr_unittest
class test_tag_file_sink(gr_unittest.TestCase):
def setUp(self):
self.tb = gr... |
options | tags_compatibility_ac3 | # -*- 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_nsimagerep | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSImageRep(TestCase):
def testConstants(self):
self.assertEqual(NSImageRepMatchesDevice, 0)
self.assertEqual(
NSImageRepRegistryChangedNotification,
N... |
extractor | rtvs | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class RTVSIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?rtvs\.sk/(?:radio|televizia)/archiv/\d+/(?P<id>\d+)"
)
_TESTS = [
{
# radio archive
"url": "http://www.rtvs.sk... |
preferences | appearance | # 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... |
lib | morphology | # This file is part of MyPaint.
# Copyright (C) 2018-2019 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... |
digital | qa_ofdm_frame_equalizer_vcvc | #!/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 numpy
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
class qa_ofdm_frame_equalizer_vcvc(gr_unittest.TestCase):
def setUp(self):... |
gui | task_tractography | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
examples | hello_world | # Use a logger for debug output - this will be managed by gPodder.
import logging
logger = logging.getLogger(__name__)
# Provide some metadata that will be displayed in the gPodder GUI.
__title__ = "Hello World Extension"
__description__ = "Explain in one sentence what this extension does."
__only_for__ = "gtk, cli"
... |
pynocchio | settings_manager | import logging
from PyQt5 import QtCore
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
class SettingsManager:
def __init__(self):
self.settings = QtCore.QSettings("Pynocchio", "Pynocchio")
def save_recent_files(self, recent_files_list):
logger.info("Saving recent files")... |
draftviewproviders | view_hatch | # ***************************************************************************
# * *
# * Copyright (c) 2021 Yorik van Havre <yorik@uncreated.net> *
# * *
# * Th... |
scenarios | step_mixins | import json
import logging
from apps.alerts.models import AlertGroup
from apps.api.permissions import (
LegacyAccessControlCompatiblePermissions,
user_is_authorized,
)
from apps.slack.models import SlackMessage, SlackTeamIdentity
from apps.slack.types import EventPayload
from apps.user_management.models import... |
gui | previewwindow | # This file is part of MyPaint.
# Copyright (C) 2012-2018 by the MyPaint Development Team
# Copyright (C) 2012-2013 by Ali Lown <ali@lown.me.uk>
#
# 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;... |
projectedModule | changeMetas | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.module.projectedAdd import CalcAddProjectedModuleCommand
from gui.fitCommands.calc.module.projectedRemove import CalcRemoveProjectedModuleCommand
from gui.fitCommands.helpers import InternalCommandHistory, ModuleIn... |
resources | pdids | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2018 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... |
sabnzbd | cfg | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
controllers | editor_polygon | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... |
config | configdata | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Configuration data for config.py.
Module attributes:
DATA: A dict of Option objects after init() has been called.
"""
import dataclasses
import functools
from typing import (
Any,
... |
contributors | generate | """
Generate snippets to copy-paste.
"""
import sys
from fetch import HERE, load_awesome_people
from jinja2 import Template
TPL_FILE = HERE / "snippet.jinja2"
HTTPIE_TEAM = {"claudiatd", "jakubroztocil", "jkbr", "isidentical"}
BOT_ACCOUNTS = {"dependabot-sr"}
IGNORE_ACCOUNTS = HTTPIE_TEAM | BOT_ACCOUNTS
def gene... |
managers | file_manager | # -*- coding: utf-8 -*-
from itertools import chain
from threading import RLock
from ..datatypes.enums import Destination
from ..utils.struct.lock import lock
from .event_manager import InsertEvent, ReloadAllEvent, RemoveEvent, UpdateEvent
def change(func):
def new(self, *args):
self.unchanged = False
... |
converter | cheetah_converter | # Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import collections
import re
import string
delims = {"(": ")", "[": "]", "{": "}", "": ", #\\*:"}
identifier_start = "_" + string.ascii_letters + "".join(delims.keys())
string_delims = "\"... |
downloaders | CzshareCom | # -*- coding: utf-8 -*-
import re
from pyload.core.utils import parse
from pyload.core.utils.convert import to_bytes
from ..base.simple_downloader import SimpleDownloader
class CzshareCom(SimpleDownloader):
__name__ = "CzshareCom"
__type__ = "downloader"
__version__ = "1.11"
__status__ = "testing"
... |
Scripts | FilletArc | #! python
# -*- coding: utf-8 -*-
# (c) 2010 Werner Mayer LGPL
__author__ = "Werner Mayer <wmayer[at]users.sourceforge.net>"
# Formulas:
# M2 = P + b*r2 + t*u
# S1 = (r2*M1 + r1*M2)/(r1+r2)
# S2 = M2-b*r2
import math
# 3d vector class
class Vector:
def __init__(self, x, y, z):
self.x = x
self.y... |
extractor | ign | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_filter as filter
from ..compat import compat_HTTPError, compat_parse_qs, compat_urlparse
from ..utils import (
ExtractorError,
determine_ext,
error_to_compat_str,
extract_attributes,
int_or_none,
mer... |
PyObjCTest | test_blocks | # Tests for interaction with ObjC "blocks".
#
# These tests are fairly minimal at the moment.
import objc
from PyObjCTest.block import OCTestBlock
from PyObjCTools.TestSupport import *
objc.parseBridgeSupport(
"""\
<?xml version='1.0'?>
<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/Brid... |
transports | jsonp | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.transports.jsonp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JSONP transport implementation.
"""
import logging
from octoprint.vendor.sockjs.tornado import proto
from octoprint.vendor.sockjs.... |
metadata | aiff | # Copyright (C) 2017 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
parsers | generic_json | __package__ = "archivebox.parsers"
import json
from datetime import datetime, timezone
from typing import IO, Iterable
from ..index.schema import Link
from ..util import enforce_types, htmldecode
@enforce_types
def parse_generic_json_export(json_file: IO[str], **_kwargs) -> Iterable[Link]:
"""Parse JSON-format ... |
lib | scales | # -*- coding: utf-8 -*-
"""
This file is part of the Stargate project, Copyright Stargate 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; version 3 of the License.
This program is distributed i... |
QT | PantallaSolo | from Code import TrListas
from Code.QT import Colocacion, Columnas, Delegados, FormLayout, Grid, Iconos, QTVarios
class WEtiquetasPGN(QTVarios.WDialogo):
def __init__(self, procesador, liPGN):
titulo = _("Edit PGN labels")
icono = Iconos.PGN()
extparam = "editlabels"
self.listandar... |
webkit | tabhistory | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utilities related to QWebHistory."""
from typing import Any, List, Mapping
from qutebrowser.qt.core import QByteArray, QDataStream, QIODevice, QUrl
from qutebrowser.utils import qtutils
d... |
hack | osdeps | #!/usr/bin/env python3
"""
osdeps retrieves the list of packages needed for a given distro
across the different Archivematica components.
Usage: ./osdeps.py [distro] [stage]
distro (required) Distro name, e.g. "Ubuntu-18"
stage (requried) Stage number, e.g. "1", "2", ...
Typically, we'll use stage "1". Howe... |
extractor | videomore | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_parse_qs, compat_str, compat_urllib_parse_urlparse
from ..utils import ExtractorError, int_or_none
from .common import InfoExtractor
class VideomoreBaseIE(InfoExtractor):
_API_BASE_URL = "https://more.tv/api/v3/web/"
... |
params | param | # Copyright 2008-2017 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import ast
import collections
import textwrap
from .. import Constants
from ..base import Element
from ..utils.descriptors import Evaluated, EvaluatedEnum, setup_names
from . import d... |
preferences | plugins | from __future__ import absolute_import
import locale
import os
from gi.repository import Gtk
try:
from configparser import ConfigParser
except:
from ConfigParser import ConfigParser
from sunflower.widgets.settings_page import SettingsPage
class Column:
ACTIVE = 0
LOCATION = 1
NAME = 2
AUTH... |
PyObjCTest | test_nssimplehorizontaltypesetter | from AppKit import *
from PyObjCTools.TestSupport import *
if is32Bit():
class TestNSSimpleHorizontalTypesetterHelper(NSSimpleHorizontalTypesetter):
def willSetLineFragmentRect_forGlyphRange_usedRect_(self, a, b, c):
return 1
class TestNSSimpleHorizontalTypesetter(TestCase):
@onlyOn32Bit... |
cli | dataset | # encoding: utf-8
import logging
import pprint
import ckan.logic as logic
import ckan.model as model
import click
from ckan.types import Context
log = logging.getLogger(__name__)
@click.group(short_help="Manage datasets")
def dataset():
"""Manage datasets."""
pass
@dataset.command()
@click.argument("pack... |
BasicDrawing | PatternDrawing | import sys
import Utilities
from Quartz import *
def scalePatternPhase(phase):
# Adjust the pattern phase if scaling to export as bits. This is equivalent to scaling base
# space by the scaling factor.
patternScaling = Utilities.getScalingFactor()
if patternScaling != 1.0:
phase = CGSizeApply... |
utilities | rest_utils | import os
from pathlib import Path
from typing import Any, Union
from yarl import URL
MAGNET_SCHEME = "magnet"
FILE_SCHEME = "file"
HTTP_SCHEME = "http"
HTTPS_SCHEME = "https"
def path_to_url(file_path: Union[str, Any], _path_cls=Path) -> str:
"""Convert path to url
Example:
'/path/to/file' -> 'fil... |
gtk3 | trackers_tab | #
# Copyright (C) 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 logging
import deluge.... |
extractor | puls4 | # coding: utf-8
from __future__ import unicode_literals
from ..utils import compat_str, parse_duration, unified_strdate
from .prosiebensat1 import ProSiebenSat1BaseIE
class Puls4IE(ProSiebenSat1BaseIE):
_VALID_URL = r"https?://(?:www\.)?puls4\.com/(?P<id>[^?#&]+)"
_TESTS = [
{
"url": "htt... |
web | server | #
# Copyright (C) 2009-2010 Damien Churchill <damoxc@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 fnmatch
import json... |
plugins | songsmenu | # Copyright 2006 Joe Wreschnig
# 2013-2014 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from qu... |
canvas | connection | """
Copyright 2007, 2008, 2009 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from argparse import Namespace
from math import pi
import cairo
from ...core.Connection import Connection as CoreConnection
from ...core.utils.descriptors import nop_write
fro... |
gpodder | core | # -*- 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... |
frescobaldi-app | wordboundary | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
dev | run_pylint_on_tests | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Run pylint on tests.
This is needed because pylint can't check a folder which isn't a package:
https://bitbucket.org/logilab/pylint/issue/512/
"""
import os
import ... |
fonts | oldfontsdialog | # 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
... |
db | serialization | from __future__ import annotations
import struct
from datetime import datetime, timedelta
from typing import List, Tuple
from ipv8.keyvault.crypto import default_eccrypto
from ipv8.messaging.lazy_payload import VariablePayload, vp_compile
from ipv8.messaging.payload import Payload
from ipv8.messaging.serialization im... |
targetProfile | adder | from collections import OrderedDict
from itertools import chain
import gui.mainFrame
import wx
from eos.saveddata.targetProfile import TargetProfile
from gui.contextMenu import ContextMenuUnconditional
from gui.utils.sorter import smartSort
from service.targetProfile import TargetProfile as svc_TargetProfile
# noinsp... |
builtinContextMenus | moduleAmmoChange | from collections import OrderedDict
import gui.fitCommands as cmd
import gui.mainFrame
# noinspection PyPackageRequirements
import wx
from gui.bitmap_loader import BitmapLoader
from gui.contextMenu import ContextMenuCombined
from gui.fitCommands.helpers import getSimilarModPositions
from service.ammo import Ammo
from... |
slow-coro-detection | profiler | import cProfile
import io
import logging
import pstats
import sys
import time
from functools import wraps
from types import FunctionType
from typing import List, Optional, Tuple
logger = logging.getLogger(__name__)
def profile(
func: Optional[FunctionType] = None,
/,
*,
sort_order: pstats.SortKey = p... |
src | RestoreBackupJob | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import base64
import hashlib
import threading
from tempfile import NamedTemporaryFile
from typing import Any, Dict, Optional
from cura.CuraApplication import CuraApplication
from PyQt6.QtNetwork import QNetworkReply, QNetw... |
booster | remove | import wx
from gui.fitCommands.helpers import BoosterInfo
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcRemoveBoosterCommand(wx.Command):
def __init__(self, fitID, position):
wx.Command.__init__(self, True, "Remove Booster")
self.fitID = fitID
... |
extractors | favicon | __package__ = "archivebox.extractors"
from pathlib import Path
from typing import Optional
from ..config import (
CHECK_SSL_VALIDITY,
CURL_ARGS,
CURL_BINARY,
CURL_USER_AGENT,
CURL_VERSION,
FAVICON_PROVIDER,
SAVE_FAVICON,
TIMEOUT,
)
from ..index.schema import ArchiveOutput, ArchiveResul... |
extractor | ntvcojp | # coding: utf-8
from __future__ import unicode_literals
from ..utils import js_to_json, smuggle_url
from .common import InfoExtractor
class NTVCoJpCUIE(InfoExtractor):
IE_NAME = "cu.ntv.co.jp"
IE_DESC = "Nippon Television Network"
_VALID_URL = r"https?://cu\.ntv\.co\.jp/(?!program)(?P<id>[^/?&#]+)"
_... |
tasks | going_oncall_notification | import datetime
import json
import logging
import math
import typing
import humanize
import pytz
from apps.mobile_app.types import FCMMessageData, MessageType, Platform
from apps.mobile_app.utils import (
MAX_RETRIES,
construct_fcm_message,
send_push_notification,
)
from apps.schedules.models.on_call_sched... |
Code | Tutor | import codecs
import os
import LCEngine4 as LCEngine
from Code import Analisis, Partida, Util
from Code.QT import PantallaTutor, QTUtil2
class Tutor:
def __init__(self, procesador, gestor, jg, desde, hasta, siEntrenando):
self.procesador = procesador
self.gestor = gestor
self.difpts = pr... |
protos | model_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/model.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.protobuf imp... |
mako | pyparser | # mako/pyparser.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
"""Handles parsing of Python code.
Parsing to AST is done via _ast on Python > 2.5, otherwise th... |
lib | memoize | # 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, ... |
views | user | """ The user profile """
from bookwyrm import models
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.settings import PAGE_LENGTH
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.db.models import Q
from django.http import Http404
from dj... |
migrations | 0090_auto_20210908_2346 | # Generated by Django 3.2.4 on 2021-09-08 23:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0089_user_show_suggested_users"),
]
operations = [
migrations.AlterField(
model_name="connector",
name="d... |
db | operators | # 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, ... |
canto-curses | screen | # -*- coding: utf-8 -*-
# Canto-curses - ncurses RSS reader
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import curses... |
migrations | 0063_auto_20210407_1827 | # Generated by Django 3.1.6 on 2021-04-07 18:27
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0062_auto_20210407_1545"),
]
operations = [
migrations.AddField(
model_name="federatedserver",
name="note... |
widgets | profilelistwidget | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2021 Bob Swift
# Copyright (C) 2022 Laurent Monin
# Copyright (C) 2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as publishe... |
extractor | fox | # coding: utf-8
from __future__ import unicode_literals
import json
import uuid
from ..compat import compat_HTTPError, compat_str, compat_urllib_parse_unquote
from ..utils import (
ExtractorError,
int_or_none,
parse_age_limit,
parse_duration,
try_get,
unified_timestamp,
)
from .adobepass impor... |
ordered-model | ordered_model | import random
import time
import typing
from functools import wraps
from django.db import IntegrityError, OperationalError, models, transaction
def _retry(
exc: typing.Type[Exception] | tuple[typing.Type[Exception], ...],
max_attempts: int = 5,
) -> typing.Callable:
"""
A utility decorator for retryi... |
deluge-toggle | core | #
# Copyright (C) 2010 John Garland <johnnybg+deluge@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is l... |
migrations | 201802282131_232e68a03aa2_change_emoji_shortcodes_to_characters | # -*- coding: utf-8 -*-
"""change emoji shortcodes to characters
Revision ID: 232e68a03aa2
Revises: af3f5579c84d
Create Date: 2018-02-28 21:31:35.260704
"""
from __future__ import unicode_literals
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "232e68a03aa2"
down_... |
legacy | app_data_generator | import random
from dateutil.relativedelta import relativedelta
from django.utils.timezone import now
from posthog.constants import TREND_FILTER_TYPE_ACTIONS
from posthog.models import (
Action,
ActionStep,
Dashboard,
DashboardTile,
EventDefinition,
Insight,
Person,
PropertyDefinition,
)... |
core | newmod | #
# Copyright 2013, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Create a whole new out-of-tree module """
import logging
import os
import re
import shutil
from gnuradio import gr
from ..tools import SCMRepoFactory
from .base import Mod... |
docs | conf | # -*- coding: utf-8 -*-
#
# Isso documentation build configuration file, created by
# sphinx-quickstart on Thu Nov 21 11:28:01 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 ... |
dateutil | parser | # -*- coding:iso-8859-1 -*-
"""
This module offers a generic date/time string parser which is able to parse
most known formats to represent a date and/or time.
This module attempts to be forgiving with regards to unlikely input formats,
returning a datetime object even for dates which are ambiguous. If an element
of a... |
widgets | keysequencewidget | # 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
... |
commands | setup_test_environment | from django.core.management.base import BaseCommand
from django.test.runner import DiscoverRunner as TestRunner
from infi.clickhouse_orm import Database
from posthog.clickhouse.schema import (
CREATE_DICTIONARY_QUERIES,
CREATE_DISTRIBUTED_TABLE_QUERIES,
CREATE_KAFKA_TABLE_QUERIES,
CREATE_MERGETREE_TABLE... |
PyObjCTest | test_nscombobox | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSComboBox(TestCase):
def testConstants(self):
self.assertIsInstance(NSComboBoxWillPopUpNotification, unicode)
self.assertIsInstance(NSComboBoxWillDismissNotification, unicode... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.