section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
util | i18n | # Copyright 2006 Joe Wreschnig
#
# 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 gettext
import locale
import os... |
objecteditor | defineoffset | # 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
... |
api | playlists | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2018 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import uuid
from flask import request
from ..db import Playlist, Track, User, db
from . import api_routing, get_e... |
lib | config_tool | # encoding: utf-8
from __future__ import annotations
import logging
import re
from typing import Any, Dict, Iterable, Optional
from typing_extensions import Literal
INSERT_NEW_SECTIONS_BEFORE_SECTION = "app:main"
log = logging.getLogger(__name__)
def config_edit_using_option_strings(
config_filepath: str,
... |
bittorrent | estimate | # neubot/bittorrent/estimate.py
#
# Copyright (c) 2011 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 Genera... |
UI | PrintInformation | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
import math
import os
from typing import TYPE_CHECKING, Dict, List, Optional
from PyQt6.QtCore import QObject, QTimer, pyqtProperty, pyqtSignal, pyqtSlot
from UM.i18n import i18nCatalog
from UM.Logger import Lo... |
mutagenext | tak | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2008 Lukáš Lalinský
# Copyright (C) 2013, 2018-2021 Laurent Monin
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018-2019, 2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it... |
versions | 100_ccd38ad5fced_remove_package_tag_revision_foreign_key | # encoding: utf-8
"""Remove package_tag_revision foreign key
Revision ID: ccd38ad5fced
Revises: 3ae4b17ed66d
Create Date: 2020-08-13 20:39:03.031606
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = "ccd38ad5fced"
down_revision = "3ae4b17ed66d"
branch_labels = None
depends_on = None
d... |
query | _match | # Copyright 2004-2005 Joe Wreschnig, Michael Urman
# 2011 Christoph Reiter
# 2016 Ryan Dellenbaugh
# 2016-22 Nick Boultbee
# 2018 Peter Strulo
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published... |
program | utils | import logging
import os
import subprocess
logger = logging.getLogger(__name__)
def eject_device(device):
"""Eject the given device."""
logger.debug("ejecting device %s", device)
try:
# `eject device` prints nothing to stdout
subprocess.check_output(["eject", device], stderr=subprocess.ST... |
web | check | # -*- coding: utf-8 -*-
import os
import re
# import validators
from ..convert import to_str
from . import format
# import idna
# import requests
# from .convert import splitaddress
# def is_ipv4(value):
# try:
# validators.ipv4(value)
# except validators.ValidationFailure:
# return False
# return True
# def i... |
beetsplug | fish | # This file is part of beets.
# Copyright 2015, winters jean-marie.
# Copyright 2020, Justin Mayer <https://justinmayer.com>
#
# 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 restrict... |
interactions | interactionsconnect | """Message item connection adapters."""
from typing import Optional
from gaphor import UML
from gaphor.core.modeling import Element, Presentation
from gaphor.diagram.connectors import BaseConnector, Connector
from gaphor.diagram.group import group
from gaphor.UML.interactions.executionspecification import ExecutionSp... |
backends | gearman_backend | """
Gearman task backend. Submits `Task` objects to gearman for processing,
and returns results.
"""
import logging
import pickle
import uuid
from django.conf import settings
from gearman import GearmanClient
from gearman.constants import JOB_COMPLETE, JOB_FAILED, JOB_UNKNOWN
from server import metrics
from server.tas... |
escalation-snapshot | escalation_snapshot_mixin | import datetime
import logging
import typing
import pytz
from apps.alerts.escalation_snapshot.snapshot_classes import (
ChannelFilterSnapshot,
EscalationChainSnapshot,
EscalationPolicySnapshot,
EscalationSnapshot,
)
from apps.alerts.tasks import escalate_alert_group
from celery import uuid as celery_uu... |
clientScripts | upload_qubit | #!/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... |
iio | qa_iio | #!/usr/bin/env python
#
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
from __future__ import print_function
import time
import pmt
from gnuradio import blocks, gr, gr_unittest, iio
class test_iio(gr_unittest.TestCase):
def tes... |
LDPC | Generate_LDPC_matrix_functions | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import string
import sys
import numpy as np
from numpy import (
array,
concatenate,
dot,
eye,
identity,
linalg,
vstack,
zeros,
... |
helpers | time | import os
import re
from datetime import datetime, timedelta, timezone
def parse_timestamp(timestamp, tzinfo=timezone.utc):
"""Parse a ISO 8601 timestamp string.
For naive/unaware dt, assume it is in tzinfo timezone (default: UTC).
"""
dt = datetime.fromisoformat(timestamp)
if dt.tzinfo is None:
... |
api | kafka_inspector | from typing import Union
from kafka import TopicPartition
from posthog.kafka_client.client import build_kafka_consumer
from posthog.permissions import IsStaffUser
from rest_framework import serializers, viewsets
from rest_framework.decorators import action
from rest_framework.response import Response
KAFKA_CONSUMER_T... |
PyBitmessage | setup | #!/usr/bin/env python2.7
import os
import platform
import shutil
import sys
from importlib import import_module
from setuptools import Extension, setup
from setuptools.command.install import install
from src.version import softwareVersion
EXTRAS_REQUIRE = {
"docs": ["sphinx", "sphinx_rtd_theme"],
"gir": ["py... |
util | dprint | # Copyright 2011,2013,2016 Christoph Reiter
# 2020 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 versio... |
extractor | msn | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import ExtractorError, determine_ext, int_or_none, unescapeHTML
from .common import InfoExtractor
class MSNIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:www|preview)\.)?msn\.com/(?:[^/]+/)+(?P<displ... |
extractor | uplynk | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import ExtractorError, float_or_none
from .common import InfoExtractor
class UplynkIE(InfoExtractor):
IE_NAME = "uplynk"
_VALID_URL = r"https?://.*?\.uplynk\.com/(?P<path>ext/[0-9a-f]{32}/(?P<external_id>[^/?&]+)|(?P<id>[0-9a-f]{... |
mail | personalization | class Personalization(object):
"""A Personalization defines who should receive an individual message and
how that message should be handled.
:var dynamic_template_data: data for dynamic transactional template.
Should be JSON-serializeable structure. No pre-processing will be done
prior to s... |
ee | urls | from typing import Any, List
from django.conf import settings
from django.contrib import admin
from django.urls import include
from django.urls.conf import path
from ee.api import integration, time_to_see_data
from posthog.api.routing import DefaultRouterPlusPlus
from rest_framework_extensions.routers import NestedReg... |
canto-next | server | # -*- coding: utf-8 -*-
# Canto - RSS reader backend
# 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 logging
impo... |
aliceVision | ImageProcessing | __version__ = "3.3"
import os.path
from meshroom.core import desc
def outputImagesValueFunct(attr):
basename = os.path.basename(attr.node.input.value)
fileStem = os.path.splitext(basename)[0]
inputExt = os.path.splitext(basename)[1]
outputExt = ("." + attr.node.extension.value) if attr.node.extensio... |
Fem | TestFemGui | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
AddonManager | addonmanager_workers_installation | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * Copyright (c) 2019 Yorik van Havre ... |
doxyxml | base | #
# 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
#
#
"""
A base class is created.
Classes based upon this are used to make more user-friendly interfaces
to the... |
providers | caa | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2007 Oliver Charles
# Copyright (C) 2007, 2010-2011 Lukáš Lalinský
# Copyright (C) 2007-2011, 2015, 2018-2023 Philipp Wolfer
# Copyright (C) 2011 Michael Wiencek
# Copyright (C) 2011-2012 Wieland Hoffmann
# Copyright (C) 2013-2... |
executors | base | import logging
import sys
from abc import ABCMeta, abstractmethod
from collections import defaultdict
from datetime import datetime, timedelta
from traceback import format_tb
import six
from apscheduler.events import (
EVENT_JOB_ERROR,
EVENT_JOB_EXECUTED,
EVENT_JOB_MISSED,
JobExecutionEvent,
)
from pyt... |
extractor | instagram | from __future__ import unicode_literals
import hashlib
import itertools
import json
import re
from ..compat import compat_HTTPError, compat_str
from ..utils import (
ExtractorError,
float_or_none,
get_element_by_attribute,
int_or_none,
lowercase_escape,
std_headers,
try_get,
url_or_non... |
qrcode | qrbase | from lib.qrcode import constants
EXP_TABLE = list(range(256))
LOG_TABLE = list(range(256))
for i in range(8):
EXP_TABLE[i] = 1 << i
for i in range(8, 256):
EXP_TABLE[i] = (
EXP_TABLE[i - 4] ^ EXP_TABLE[i - 5] ^ EXP_TABLE[i - 6] ^ EXP_TABLE[i - 8]
)
for i in range(255):
LOG_TABLE[EXP_TABLE[i... |
migrations | 0190_experiment | # Generated by Django 3.2.5 on 2021-12-09 10:11
import django.db.models.deletion
import django.utils.timezone
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0189_alter_annotation_scope"),
]
operations... |
models | shelf | """ puttin' books on shelves """
import re
from bookwyrm import activitypub
from bookwyrm.settings import DOMAIN
from bookwyrm.tasks import BROADCAST
from django.core.cache import cache
from django.core.exceptions import PermissionDenied
from django.db import models
from django.utils import timezone
from . import fie... |
misc | debugcachestats | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Implementation of the command debug-cache-stats.
Because many modules depend on this command, this needs to have as few
dependencies as possible to avoid cyclic dependencies.
"""
import sys... |
preferences | playlists | # 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... |
compat-logging | config | # Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
extractor | karaoketv | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class KaraoketvIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?karaoketv\.co\.il/[^/]+/(?P<id>\d+)"
_TEST = {
"url": "http://www.karaoketv.co.il/%D7%A9%D7%99%D7%A8%D7%99_%D7%A7%D7%A8%D7%99%D7%95%D7%A7%D7%99... |
tzlocal | win32 | try:
import _winreg as winreg
except ImportError:
import winreg
import pytz
from tzlocal.windows_tz import win_tz
_cache_tz = None
def valuestodict(key):
"""Convert a registry key's values to a dictionary."""
dict = {}
size = winreg.QueryInfoKey(key)[1]
for i in range(size):
data = w... |
ops | lifetimes_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import unittest
from beancount import loader
from beancount.ops import lifetimes
from beancount.utils import test_utils
class TestCommodityLifetimes(test_utils.TestCase):
@loader.load_doc()
def test_lifetimes_d... |
cmd | on | from __future__ import absolute_import
import getopt
import os
import signal
import struct
import subprocess
import sys
from subprocess import PIPE
from bup import options, path, ssh
from bup.compat import argv_bytes
from bup.helpers import DemuxConn, log
from bup.io import byte_stream
optspec = """
bup on <hostname... |
torrentlist | torrentviewcolumns | #
# Copyright (C) 2016 bendikro <bro.devel+deluge@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.
#
from deluge.decorators import... |
svgview | svgfiles | # 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
... |
gadgets | toolboxwheeler | # 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
... |
PyObjCTest | test_nsfontpanel | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSFontPanelHelper(NSObject):
def validModesForFontPanel_(self, p):
return 1
class TestNSFontPanel(TestCase):
def testConstants(self):
self.assertEqual(NSFPPreviewButton, 131)
self.assertEqual(NSFPRevertButton, 130)
... |
daapserver | server | # Modified to work with Exaile - Brian Parma
#
# Copyright (C) 2008 Erik Hetzner
# This file is part of Spydaap. Spydaap 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 (... |
tasks | slack | import re
from typing import Any, Dict
from urllib.parse import urlparse
import structlog
from django.conf import settings
from ee.tasks.subscriptions.subscription_utils import generate_assets
from posthog.models.exported_asset import ExportedAsset
from posthog.models.integration import Integration, SlackIntegration
f... |
analog | wfm_tx | #
# Copyright 2005,2007,2012,2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import filter, gr
from . import analog_python as analog
from .fm_emph import fm_preemph
class wfm_tx(gr.hier_block2):
def __init__(sel... |
manuscript | widget | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
PyObjCTest | test_nsspeechsynthesizer | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSSpeechSynthesizerHelper(NSObject):
def speechSynthesizer_didFinishSpeaking_(self, ss, b):
pass
def speechSynthesizer_willSpeakWord_ofString_(self, ss, w, s):
pass
... |
Path | PathCommands | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2016 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
draftobjects | dimension | # -*- coding: utf-8 -*-
# ***************************************************************************
# * 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-cas... |
migrations | 0083_auto_20200826_1504 | # Generated by Django 3.0.7 on 2020-08-26 15:04
import uuid
from django.db import migrations, models
from posthog.models.utils import UUIDT
def create_uuid(apps, schema_editor):
Team = apps.get_model("posthog", "Team")
for team in Team.objects.all():
team.uuid = UUIDT()
team.save()
class M... |
clientScripts | copy_transfer_submission_documentation | #!/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... |
blocks | qa_message | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004,2010,2013,2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import pmt
from gnuradio import blocks, gr, gr_unittest
# def all_counts():
# return (gr.block_ncurrently... |
puddlestuff | puddleobjects | """
Contains objects used throughout puddletag
"""
import itertools
import json
import logging
import os
import re
import sys
import time
from bisect import bisect_left, insort_left # for unique function.
from collections import defaultdict
from copy import copy
from functools import partial
from glob import glob
fro... |
clientScripts | assign_file_uuids | #!/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... |
sequencer | track | from sglib import constants
from sglib.lib import strings as sg_strings
from sglib.lib import util
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.models.daw import *
from sglib.models.theme import get_asset_path
from sgui import shared as glbl_shared
from sgui import widgets
from sgui.daw imp... |
tools | funcs | # 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... |
cli | archivebox_remove | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox remove"
import argparse
import sys
from typing import IO, List, Optional
from ..config import OUTPUT_DIR
from ..logging_util import SmartFormatter, accept_stdin
from ..main import remove
from ..util import docstring
@docstring(remove._... |
executors | base_py3 | import logging
import sys
from datetime import datetime, timedelta
from traceback import format_tb
from apscheduler.events import (
EVENT_JOB_ERROR,
EVENT_JOB_EXECUTED,
EVENT_JOB_MISSED,
JobExecutionEvent,
)
from pytz import utc
async def run_coroutine_job(job, jobstore_alias, run_times, logger_name)... |
gui | projectedChangeStates | import eos.db
import gui.mainFrame
import wx
from eos.const import FittingModuleState
from eos.saveddata.drone import Drone as EosDrone
from eos.saveddata.fighter import Fighter as EosFighter
from eos.saveddata.fit import Fit as EosFit
from eos.saveddata.module import Module as EosModule
from gui import globalEvents as... |
saveddata | boosterSideEffect | # ===============================================================================
# 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, ... |
FirmwareUpdateChecker | FirmwareUpdateCheckerMessage | # Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from UM.i18n import i18nCatalog
from UM.Message import Message
i18n_catalog = i18nCatalog("cura")
# Make a separate class, since we need an extra field: The machine-id that this message is about.
class FirmwareUpdateChec... |
extractor | tvland | # coding: utf-8
from __future__ import unicode_literals
from .spike import ParamountNetworkIE
class TVLandIE(ParamountNetworkIE):
IE_NAME = "tvland.com"
_VALID_URL = r"https?://(?:www\.)?tvland\.com/(?:video-clips|(?:full-)?episodes)/(?P<id>[^/?#.]+)"
_FEED_URL = "http://www.tvland.com/feeds/mrss/"
_... |
mpris2 | dbushelper | # mpris2 - Support MPRIS 2 in Exaile
# Copyright (C) 2015-2016 Johannes Sasongko <sasongko@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at... |
extractor | varzesh3 | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_parse_qs, compat_urllib_parse_urlparse
from ..utils import clean_html, remove_start
from .common import InfoExtractor
class Varzesh3IE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?video\.varzesh3\.com/(?:[^/]+/)+(?P<id>[^/]+... |
Code | Albums | import atexit
import collections
import random
from Code import Books, Util, VarGen, XGestorMotor, XMotorRespuesta
from Code.QT import Iconos
ALBUMSHECHOS = "albumshechos"
class GestorMotorAlbum:
def __init__(self, gestor, cromo):
self.cromo = cromo
self.gestor = gestor
self.partida = ... |
extractor | condenast | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urllib_parse_urlparse, compat_urlparse
from ..utils import (
determine_ext,
extract_attributes,
int_or_none,
js_to_json,
mimetype2ext,
orderedSet,
parse_iso8601,
strip_or_none,
try_get,
)
... |
extractors | UnZip | # -*- coding: utf-8 -*-
import fnmatch
import os
import sys
import zipfile
from pyload.plugins.base.extractor import (
ArchiveError,
BaseExtractor,
CRCError,
PasswordError,
)
class UnZip(BaseExtractor):
__name__ = "UnZip"
__type__ = "extractor"
__version__ = "1.28"
__status__ = "stab... |
extractors | universal | #!/usr/bin/env python
__all__ = ["universal_download"]
from ..common import *
from .embed import *
def universal_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
try:
content_type = get_head(url, headers=fake_headers)["Content-Type"]
except:
content_type = get_head(url, ... |
models | session_recording | from typing import Any, List, Literal, Optional
from django.conf import settings
from django.db import models
from django.db.models import Count
from django.dispatch import receiver
from posthog.celery import ee_persist_single_recording
from posthog.models.person.person import Person
from posthog.models.team.team impo... |
autokey | qtapp | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# 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 late... |
migrations | 0281_create_insight_caching_state_model | # Generated by Django 3.2.15 on 2022-11-29 14:06
import django.db.models.deletion
import posthog.models.utils
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0280_fix_async_deletion_team"),
]
operations = [
migrations.CreateMo... |
extractor | yesjapan | # coding: utf-8
from __future__ import unicode_literals
from ..utils import HEADRequest, get_element_by_attribute, parse_iso8601
from .common import InfoExtractor
class YesJapanIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?yesjapan\.com/video/(?P<slug>[A-Za-z0-9\-]*)_(?P<id>[A-Za-z0-9]+)\.html"
_TEST ... |
app | test_git | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
friture | renard | # Renard's numbers, or preferred numbers
# used for frequency display
# R5 for octave analyzer
# R10 for 1/3 octave analyzer
# R20 for 1/6 octave analyzer
# R40 for 1/12 octave analyzer
# R80 for 1/24 octave analyzer
# see http://en.wikipedia.org/wiki/Preferred_number
R5 = [1.00, 1.60, 2.50, 4.00, 6.30]
R10a = [1.25,... |
meshes | mesh_flexural_buckling | def create_nodes(femmesh):
# nodes
femmesh.addNode(0.0, 1.5, 0.0, 1)
femmesh.addNode(0.0, 1.5, 0.5, 2)
femmesh.addNode(0.0, 1.125, 0.5, 3)
femmesh.addNode(0.0, 1.125, 0.0, 4)
femmesh.addNode(0.25, 1.5, 0.0, 5)
femmesh.addNode(0.25, 1.5, 0.5, 6)
femmesh.addNode(0.25, 1.125, 0.5, 7)
fe... |
downloaders | LinksnappyComTorrent | # -*- coding: utf-8 -*-
import json
import os
import time
import urllib.request
from pyload.core.network.http.http_request import FormFile
from pyload.core.utils import parse
from ..base.downloader import BaseDownloader
from ..helpers import exists
class LinksnappyComTorrent(BaseDownloader):
__name__ = "Linksn... |
Gui | RemoteDebugger | # -*- coding: utf-8 -*-
# /******************************************************************************
# * Copyright (c) 2020 Werner Mayer <wmayer[at]users.sourceforge.net> *
# * *
# * This file is part of the FreeCAD CAx developme... |
object-detection | exporter | # 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... |
serializers | on_call_shifts | from apps.schedules.models import CustomOnCallShift, OnCallSchedule, OnCallScheduleWeb
from apps.user_management.models import User
from common.api_helpers.custom_fields import (
OrganizationFilteredPrimaryKeyRelatedField,
RollingUsersField,
UsersFilteredByOrganizationField,
)
from common.api_helpers.mixins... |
draftguitools | gui_pathtwistedarray | # ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
midifiles | units | def tick2second(tick, ticks_per_beat, tempo):
"""Convert absolute time in ticks to seconds.
Returns absolute time in seconds for a chosen MIDI file time
resolution (ticks per beat, also called PPQN or pulses per quarter
note) and tempo (microseconds per beat).
"""
scale = tempo * 1e-6 / ticks_p... |
desktop | channel | # -*- 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... |
unisearch | parser | # 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 re
import sre_constants
impo... |
api | dashboard_collaborator | from typing import Any, Dict, cast
from django.db import IntegrityError
from ee.models.dashboard_privilege import DashboardPrivilege
from posthog.api.routing import StructuredViewSetMixin
from posthog.api.shared import UserBasicSerializer
from posthog.models import Dashboard, User
from posthog.permissions import TeamM... |
modules | mod_preloader | # 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.
PreloadNextN = 10
import sys
Attribs = ["sha1", "gain", "fingerprint_AcoustId", "bmpTh... |
planet | sanitize | """
sanitize: bringing sanitiy to world of messed-up data
"""
__author__ = [
"Mark Pilgrim <http://diveintomark.org/>",
"Aaron Swartz <http://www.aaronsw.com/>",
]
__contributors__ = ["Sam Ruby <http://intertwingly.net/>"]
__license__ = "BSD"
__version__ = "0.25"
_debug = 0
# If you want sanitize to automati... |
player | adapters | # Copyright (C) 2011 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it w... |
archiver | delete_cmd | import argparse
import logging
from ..archive import Archive, Statistics
from ..cache import Cache
from ..constants import * # NOQA
from ..helpers import format_archive, log_multi, sig_int
from ..logger import create_logger
from ..manifest import Manifest
from ._common import Highlander, with_repository
logger = cre... |
controllers | newsletter | # 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, ... |
gui | utils | # --------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU - GPL... |
version-check | versioncheck_manager | import logging
import platform
from distutils.version import LooseVersion
from typing import List, Optional
from aiohttp import ClientResponse, ClientSession, ClientTimeout
from ipv8.taskmanager import TaskManager
from tribler.core import notifications
from tribler.core.utilities.notifier import Notifier
from tribler.... |
canto-curses | text | # -*- 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... |
reports | views | #
# Quru Image Server
#
# Document: views.py
# Date started: 12 Sep 2011
# By: Matt Fozard
# Purpose: Reporting data access URLs and views
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it u... |
plugins | trovo | """
$description Global video game live-streaming and video hosting platform, owned by Tencent.
$url trovo.live
$type live, vod
$metadata id
$metadata author
$metadata category
$metadata title
"""
import logging
import re
import secrets
import sys
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.pl... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.