section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
userguide
export
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2014 by Wilbert Berendsen # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 ...
Test
TestSite
import os import shutil import pytest from Site import SiteManager TEST_DATA_PATH = "src/Test/testdata" @pytest.mark.usefixtures("resetSettings") class TestSite: def testClone(self, site): assert ( site.storage.directory == TEST_DATA_PATH + "/1TeSTvb4w2PWE81S2rEELgmX2GCCExQGT" ...
item-editor
automation
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.log import LOG from sglib.math import clip_min, clip_value from sglib.models import stargate as sg_project from sglib.models import theme from sgli...
migrations
0126_filelink_link_linkdomain
# Generated by Django 3.2.10 on 2022-01-10 21:20 import bookwyrm.models.activitypub_mixin import bookwyrm.models.fields import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0125_alt...
mac-osx
launcher
import os import os.path import platform import re import runpy import subprocess import sys import time import traceback from os.path import join from subprocess import PIPE, CalledProcessError, Popen class MakeCertPem: """create openssl cert bundle from system certificates""" def __init__(self, openssl): ...
search
cloudsearch
# 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, ...
qtui
centralwidget
# Copyright (C) 2011 Chris Dekter # Copyright (C) 2018, 2020 Thomas Hess <thomas.hess@udo.edu> # 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 opt...
game
MainMenu
#!/usr/bin/python # -*- coding: utf-8 -*- ##################################################################### # Frets on Fire # # Copyright (C) 2006 Sami Kyöstilä # # 2008 myfingershurt ...
sk1
app_palettes
# -*- 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....
localModuleCargo
localModuleToCargo
import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.cargo.add import CalcAddCargoCommand from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand from gui.fitCommands.calc.module.localRemove import CalcRemoveLocalModulesCommand from gui.fitCommands.calc....
exports
csv_exporter
import datetime from typing import Any, Dict, List, Optional, Tuple from urllib.parse import parse_qsl, quote, urlencode, urlparse, urlunparse import requests import structlog from django.http import QueryDict from posthog.api.query import process_query from posthog.jwt import PosthogJwtAudience, encode_jwt from posth...
css
cssvariablesdeclaration
"""CSSVariablesDeclaration http://disruptive-innovations.com/zoo/cssvariables/#mozTocId496530 """ __all__ = ['CSSVariablesDeclaration'] __docformat__ = 'restructuredtext' __version__ = '$Id: cssstyledeclaration.py 1819 2009-08-01 20:52:43Z cthedot $' import itertools import xml.dom import cssutils from cssutils.helpe...
dev
powinterrupttest
import ctypes import hashlib import os import signal from multiprocessing import current_process from struct import pack, unpack from threading import current_thread shutdown = 0 def signal_handler(signal, frame): global shutdown print( "Got signal %i in %s/%s" % (signal, current_process().na...
qltk
songmodel
# Copyright 2012 Christoph Reiter # 2016 Nick Boultbee # 2018-2019 Fredrik Strupe # # 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 ...
model
base
# -*- coding: utf-8 -*- from __future__ import annotations import datetime from collections import OrderedDict from typing import Any, Callable, Optional import sqlalchemy as sa from sqlalchemy import orm from sqlalchemy.ext.declarative import declarative_base from typing_extensions import Self from .meta import Ses...
OpenSCAD
exportCSG
# *************************************************************************** # * Copyright (c) 2012 Keith Sloan <keith@sloan-home.co.uk> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
API
Account
# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import enum import json from datetime import datetime from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional from cura.OAuth2.AuthorizationService import AuthorizationService from cura.OAuth2.Models import OA...
preferences
block
""" views for actions you can take in the application """ from bookwyrm import models from django.contrib.auth.decorators import login_required from django.shortcuts import get_object_or_404, redirect from django.template.response import TemplateResponse from django.utils.decorators import method_decorator from django....
extractor
la7
# coding: utf-8 from __future__ import unicode_literals from ..utils import js_to_json, smuggle_url from .common import InfoExtractor class LA7IE(InfoExtractor): IE_NAME = "la7.it" _VALID_URL = r"""(?x)(https?://)?(?: (?:www\.)?la7\.it/([^/]+)/(?:rivedila7|video)/| tg\.la7\.it/repliche-tgla7\...
PyObjCTest
test_convenience
import objc import objc._convenience as convenience from PyObjCTools.TestSupport import * class TestConvenienceHelpers(TestCase): def test_add_for_selector(self): methods = [("add", lambda self, x: self.testMethod_(x))] with filterWarnings("error", DeprecationWarning): self.assertRais...
Pipeline
apiproxy
import io import re import urllib.parse import requests class ApiProxy: def __init__(self, ApiUrl, WebApiUrl, ApiCallTimeoutSeconds): self.apiUrl = ApiUrl self.webApiUrl = WebApiUrl self.apiCallTimeoutSeconds = ApiCallTimeoutSeconds def GetTaggingRules(self): apiResp = RestAp...
gui
start_gui
import logging import os import sys from typing import Optional from PyQt5.QtCore import QSettings from tribler.core.check_os import ( check_and_enable_code_tracing, check_environment, check_free_space, enable_fault_handler, ) from tribler.core.logger.logger import load_logger_config from tribler.core....
draftgeoutils
faces
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * * # * Th...
chardet
sjisprober
######################## 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...
UltimakerCloud
CloudMaterialSync
# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import zipfile # To export all materials in a .zip archive. from typing import TYPE_CHECKING, Dict, Optional import cura.CuraApplication # Imported like this to prevent circular imports. from cura.PrinterOutput.UploadMat...
utils
alignment
#!/usr/bin/env python # # Copyright 2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ This module contains functions for aligning sequences. >>> import random >>> rndm = random.Random() >>> rndm.seed(1234) >>> ran_seq = [rndm.randint(0,1) for i...
find-file-extensions
size
from __future__ import absolute_import from gi.repository import Gtk from sunflower.plugin_base.find_extension import FindExtension class SizeFindFiles(FindExtension): """Size extension for find files tool""" def __init__(self, parent): FindExtension.__init__(self, parent) # create containe...
utils
ssl_match_hostname
"""The match_hostname() function from Python 3.2, essential when using SSL.""" from __future__ import absolute_import import re __version__ = "3.2.2" class CertificateError(ValueError): pass def _dnsname_match(dn, hostname, max_wildcards=1): """Matching according to RFC 6125, section 6.4.3 http://to...
PyObjCTest
test_cgdataprovider
import os import sys from Foundation import NSData from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * if sys.version_info[0] != 2: def buffer(value): if isinstance(value, bytes): return value return value.encode("latin1") class TestCGDataProvider(TestCase): ...
base
xfs_decrypter
# -*- coding: utf-8 -*- from ..helpers import set_cookie from .simple_decrypter import SimpleDecrypter class XFSDecrypter(SimpleDecrypter): __name__ = "XFSDecrypter" __type__ = "decrypter" __version__ = "0.26" __status__ = "stable" __pattern__ = r"^unmatchable$" __config__ = [ ("ena...
aliceVision
CameraInit
__version__ = "9.0" import json import logging import os import shutil import tempfile import psutil from meshroom.core import Version, desc from meshroom.multiview import FilesByType, findFilesByTypeInFolder Viewpoint = [ desc.IntParam( name="viewId", label="ID", description="Image UID."...
SCL
ConstructedDataTypes
# Copyright (c) 2011, Thomas Paviot (tpaviot@gmail.com) # All rights reserved. # This file is part of the StepClassLibrary (SCL). # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # Redistributions of source code mus...
v1
unlocks
from typing import List from CTFd.api.v1.helpers.request import validate_args from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic from CTFd.api.v1.schemas import APIDetailedSuccessResponse, APIListSuccessResponse from CTFd.cache import clear_standings from CTFd.constants import RawEnum from CTFd.models impo...
rarfile
rarfile
# rarfile.py # # Copyright (c) 2005-2016 Marko Kreen <markokr@gmail.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED...
Models
ExtruderConfigurationModel
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import Optional from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal from .MaterialOutputModel import MaterialOutputModel class ExtruderConfigurationModel(QObject): extruderConfigurationChanged = py...
css
cssvalue
"""CSSValue related classes - CSSValue implements DOM Level 2 CSS CSSValue - CSSPrimitiveValue implements DOM Level 2 CSS CSSPrimitiveValue - CSSValueList implements DOM Level 2 CSS CSSValueList """ __all__ = ['CSSValue', 'CSSPrimitiveValue', 'CSSValueList', 'RGBColor', 'CSSVariable'] __docformat__ = 'rest...
models
group_type_mapping
from django.db import models # This table is responsible for mapping between group types for a Team/Project and event columns # to add group keys class GroupTypeMapping(models.Model): class Meta: constraints = [ models.UniqueConstraint( fields=["team", "group_type"], name="uniq...
bookwyrm
signatures
""" signs activitypub activities """ import datetime import hashlib from base64 import b64decode, b64encode from urllib.parse import urlparse from Crypto import Random from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA from Crypto.Signature import pkcs1_15 # pylint: disable=no-name-in-module MAX_SIGNATU...
migrations
0019_alter_settings_timezone
# Generated by Django 3.2.9 on 2021-11-13 14:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("babybuddy", "0018_auto_20211017_2136"), ] operations = [ migrations.AlterField( model_name="settings", name="timezone...
plugins
radiko
""" $description Japanese live radio simulcasts and time-shifted broadcasts for over 100 stations. $url radiko.jp $type live, vod $region Japan """ import base64 import datetime import hashlib import random import re from urllib.parse import urlencode from lxml.etree import XML from streamlink.plugin import Plugin, p...
api
downloads
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """APIs related to downloading files.""" import io from qutebrowser.browser import downloads, qtnetworkdownloads from qutebrowser.qt.core import QObject, QUrl, pyqtSignal, pyqtSlot from quteb...
Tux
InitGui
# Tux module for FreeCAD # Copyright (C) 2017 triplus @ FreeCAD # # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later ver...
Code
AperturasStd
from operator import attrgetter import LCEngine4 as LCEngine from Code import TrListas, Util, VarGen class AperturaStd: def __init__(self, clave): self.nombre = clave self.trNombre = clave self.nivel = 0 self.padre = None self.hijos = [] self.a1h8 = "" self...
printing
pdf_printer
# -*- 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....
service
damagePattern
# ============================================================================= # Copyright (C) 2010 Diego Duclos # # This file is part of pyfa. # # pyfa is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either ...
QT
PantallaColores
import base64 import os from Code import ControlPosicion, TrListas, Util, VarGen from Code.QT import ( Colocacion, Controles, FormLayout, Iconos, PantallaTabVFlechas, QTUtil, QTUtil2, QTVarios, TabFlechas, Tablero, ) from PyQt4 import QtCore, QtGui class BotonTema(QtGui.QPushB...
database
table_config
#!/usr/bin/env python # # 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 General Public L...
Code
GestorVariantes
import time from Code import PGN, ControlPosicion, Gestor, Jugada, Util from Code.Constantes import * from Code.QT import Iconos class GestorVariantes(Gestor.Gestor): def inicio( self, fen, lineaPGN, okMasOpciones, siBlancasAbajo, siEngineActivo=False, siCo...
css
cssimportrule
"""CSSImportRule implements DOM Level 2 CSS CSSImportRule plus the ``name`` property from http://www.w3.org/TR/css3-cascade/#cascading.""" __all__ = ['CSSImportRule'] __docformat__ = 'restructuredtext' __version__ = '$Id$' import os import xml.dom import cssrule import cssutils import urlparse class CSSImportRule(...
mylar
nzbget
#!/usr/bin/python # This file is part of Harpoon. # # Harpoon 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. # # Harpoon is dist...
fec
qa_polar_encoder
#!/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 numpy as np from gnuradio import blocks, fec, gr, gr_unittest from gnuradio.fec.extended_encoder import extended_encoder from gnuradio.fec.polar import ch...
src
helper_search
""" Additional SQL helper for searching messages. Used by :mod:`.bitmessageqt`. """ from helper_sql import sqlQuery from tr import _translate def search_sql( xAddress="toaddress", account=None, folder="inbox", where=None, what=None, unreadOnly=False, ): """ Search for messages from gi...
migrations
0083_auto_20210816_2022
# Generated by Django 3.2.4 on 2021-08-16 20:22 import bookwyrm.models.fields from django.db import migrations class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0082_auto_20210806_2324"), ] operations = [ migrations.AddField( model_name="comment", ...
conversion
preprocess
#!/usr/bin/env python # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai __license__ = 'GPL v3' __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>' __docformat__ = 'restructuredtext en' import functools import json import re from calibre import as_unicode, entity_to_unicode XMLDECL_RE = re.compile(r'^\s...
pattern
_pattern
# Copyright 2004-2010 Joe Wreschnig, Michael Urman # Copyright 2010,2013 Christoph Reiter # Copyright 2013-2015 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 o...
filters
filter
from .base_filter import BaseFilter from .mixins.common import ( AggregationAxisMixin, BreakdownMixin, BreakdownValueMixin, ClientQueryIdMixin, CompareMixin, DateMixin, DisplayDerivedMixin, DistinctIdMixin, EmailMixin, EntitiesMixin, EntityIdMixin, EntityMathMixin, En...
exports
serializers
import json from collections import OrderedDict, defaultdict from datetime import date, datetime from decimal import Decimal from CTFd.utils import string_types from CTFd.utils.exports.databases import is_database_mariadb class JSONEncoder(json.JSONEncoder): def default(self, obj): if isinstance(obj, (da...
mylar
versioncheck
# This file is part of Mylar. # # Mylar 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. # # Mylar is distributed in the hope that...
extractors
ucas
#!/usr/bin/env python __all__ = ["ucas_download", "ucas_download_single", "ucas_download_playlist"] import http.client import urllib.error import xml.etree.ElementTree as ET from copy import copy from random import random from time import time from ..common import * """ Do not replace http.client with get_content f...
extractor
bravotv
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import int_or_none, smuggle_url, update_url_query from .adobepass import AdobePassIE class BravoTVIE(AdobePassIE): _VALID_URL = ( r"https?://(?:www\.)?(?P<req_id>bravotv|oxygen)\.com/(?:[^/]+/)+(?P<id>[^/?#]+)" ) _TES...
util
periodictouch
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # 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 published by the Free Software Foundati...
css
property
"""Property is a single CSS property in a CSSStyleDeclaration.""" __all__ = ["Property"] __docformat__ = "restructuredtext" __version__ = "$Id$" import xml.dom import cssutils from cssutils.helper import Deprecated from value import PropertyValue class Property(cssutils.util.Base): """A CSS property in a StyleD...
migrations
0021_update_deposit_status
# Generated by Django 2.2.7 on 2019-11-28 08:47 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("deposit", "0020_embargo_field"), ] operations = [ migrations.AddField( model_name="repository", name="update_status_u...
cssutils
_fetchgae
"""GAE specific URL reading functions""" __all__ = ['_defaultFetcher'] __docformat__ = 'restructuredtext' __version__ = '$Id: tokenize2.py 1547 2008-12-10 20:42:26Z cthedot $' import cgi import errorhandler import util # raises ImportError of not on GAE from google.appengine.api import urlfetch log = errorhandler.Er...
generators
white
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (C) 2009 Timothée Lecomte # This file is part of Friture. # # Friture is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as published by # the Free Software Foundation. # # Friture is distri...
projectedFit
remove
import wx from gui.fitCommands.helpers import restoreCheckedStates from logbook import Logger from service.fit import Fit pyfalog = Logger(__name__) class CalcRemoveProjectedFitCommand(wx.Command): def __init__(self, fitID, projectedFitID, amount): wx.Command.__init__(self, True, "Add Projected Fit") ...
extractor
urort
# coding: utf-8 from __future__ import unicode_literals from ..compat import compat_urllib_parse from ..utils import unified_strdate from .common import InfoExtractor class UrortIE(InfoExtractor): IE_DESC = "NRK P3 Urørt" _VALID_URL = r"https?://(?:www\.)?urort\.p3\.no/#!/Band/(?P<id>[^/]+)$" _TEST = { ...
extractor
thesun
from __future__ import unicode_literals import re from ..utils import extract_attributes from .common import InfoExtractor class TheSunIE(InfoExtractor): _VALID_URL = r"https://(?:www\.)?thesun\.co\.uk/[^/]+/(?P<id>\d+)" _TEST = { "url": "https://www.thesun.co.uk/tvandshowbiz/2261604/orlando-bloom-a...
i18n
languages
# # This file is public domain. # # Language code for this installation. All choices can be found here: # http://www.i18nguy.com/unicode/language-identifiers.html LANGUAGE_CODE = "en-us" # Deferred translation def _(message): return message # Languages we provide translations for, out of the box. LANGUAGES = {...
core
box_coder_test
# 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...
builtinContextMenus
graphDmgIgnoreResists
# noinspection PyPackageRequirements import gui.globalEvents as GE import gui.mainFrame import wx from gui.contextMenu import ContextMenuUnconditional from service.settings import GraphSettings _t = wx.GetTranslation class GraphDmgIgnoreResistsMenu(ContextMenuUnconditional): def __init__(self): self.mai...
windows
build_win_installer
from __future__ import annotations import os import shutil import subprocess from pathlib import Path version = subprocess.run( ["poetry", "version", "-s"], encoding="utf-8", capture_output=True, text=True ).stdout.rstrip() def clean_files(paths: list[Path]) -> None: print("Cleaning files") for path in ...
migrations
0107_plugin_source
# Generated by Django 3.0.11 on 2020-12-10 22:18 from django.db import migrations, models def add_plugin_types(apps, schema_editor): Plugin = apps.get_model("posthog", "Plugin") for plugin in Plugin.objects.filter(plugin_type__isnull=True): plugin.plugin_type = ( "local" if plugin.url and...
extractor
goshgay
# coding: utf-8 from __future__ import unicode_literals from ..compat import compat_parse_qs from ..utils import parse_duration from .common import InfoExtractor class GoshgayIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?goshgay\.com/video(?P<id>\d+?)($|/)" _TEST = { "url": "http://www.goshgay...
migrations
upgrade42
""" Migration 42 - Resistance membrane tiericide """ CONVERSIONS = { 16391: ( # Compact Multispectrum Energized Membrane 16389, # Experimental Energized Adaptive Nano Membrane I 16387, # Limited Energized Adaptive Nano Membrane I 16385, # Upgraded Energized Adaptive Nano Membrane I ...
forms
teams
from CTFd.forms import BaseForm from CTFd.forms.fields import SubmitField from CTFd.models import TeamFieldEntries, TeamFields from CTFd.utils.countries import SELECT_COUNTRIES_LIST from CTFd.utils.user import get_current_team from flask_babel import lazy_gettext as _l from wtforms import BooleanField, PasswordField, S...
bookwyrm
activitystreams
""" access the activity streams stored in redis """ from datetime import timedelta from bookwyrm import models from bookwyrm.redis_store import RedisStore, r from bookwyrm.tasks import IMPORT_TRIGGERED, STREAMS, app from bookwyrm.telemetry import open_telemetry from django.db import transaction from django.db.models i...
core
batcher_test
# 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...
src
helper_startup
""" Startup operations. """ # pylint: disable=too-many-branches,too-many-statements import ctypes import logging import os import platform import socket import sys import time from distutils.version import StrictVersion from struct import pack try: import defaults import helper_random import paths imp...
errorreport
ui
# Copyright 2017 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. from gi.repository import Gtk from ...
server
rpc_server
"""Archivematica MCPServer API (Gearman RPC). We have plans to replace this server with gRPC. TODO(sevein): methods with `raise_exc` enabled should be updated so they don't need it, but it needs to be tested further. The main thing to check is whether the client is ready to handle application-level exceptions. """ im...
gr
qa_python_logging
#!/usr/bin/env python # # Copyright 2022,2023 Marcus Müller # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import time import numpy from gnuradio import gr, gr_unittest class logging_blk(gr.sync_block): def __init__(self, name=""): gr.sync_block.__init__(self, name,...
models
instance_setting
import json from contextlib import contextmanager from typing import Any, List from django.db import models from posthog.settings import CONSTANCE_CONFIG, CONSTANCE_DATABASE_PREFIX class InstanceSetting(models.Model): class Meta: constraints = [models.UniqueConstraint(fields=["key"], name="unique key")] ...
settings
flac_tempo
# Copyright (C) 2023 luzip665 # # 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 wil...
extractor
megaphone
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import js_to_json from .common import InfoExtractor class MegaphoneIE(InfoExtractor): IE_NAME = "megaphone.fm" IE_DESC = "megaphone.fm embedded players" _VALID_URL = r"https://player\.megaphone\.fm/(?P<id>[A-Z0-9]+)" _TES...
cssutils
parse
#!/usr/bin/env python """A validating CSSParser""" __all__ = ["CSSParser"] __docformat__ = "restructuredtext" __version__ = "$Id$" import codecs import os import sys import urllib import cssutils import tokenize2 from cssutils import css from helper import path2url if sys.version_info < (2, 6): bytes = str cla...
thumbor
url_composer
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/thumbor/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com thumbor@googlegroups.com import optparse # pylint: disable=deprecated-module import sys from...
baseclass
myaddress
# pylint: disable=unused-argument, import-error, no-member, attribute-defined-outside-init # pylint: disable=no-name-in-module, too-few-public-methods, too-many-instance-attributes """ myaddress.py ============== All generated addresses are managed in MyAddress """ import os from functools import partial from kivy.a...
archiver
diff_cmd
import argparse import json import os import sys import textwrap from ..archive import Archive from ..constants import * # NOQA from ..helpers import ( BaseFormatter, BorgJsonEncoder, DiffFormatter, archivename_validator, ) from ..logger import create_logger from ..manifest import Manifest from ._comm...
draftguitools
gui_points
# *************************************************************************** # * (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * (c) 2009, 2010 Ken Cline <cline@frii.com> * # * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> * # * ...
urllib3
filepost
import codecs from io import BytesIO from uuid import uuid4 from .fields import RequestField from .packages import six from .packages.six import b writer = codecs.lookup("utf-8")[3] def choose_boundary(): """ Our embarassingly-simple replacement for mimetools.choose_boundary. """ return uuid4().hex ...
command
main
# -*- Mode: Python -*- # vi:si:et:sw=4:sts=4:ts=4 import logging import os import site import sys from distutils.sysconfig import get_python_lib import musicbrainzngs import pkg_resources import whipper from whipper.command import accurip, cd, drive, image, mblookup, offset from whipper.command.basecommand import Bas...
comic
manhuaguibase
#!/usr/bin/env python3 # encoding: utf-8 # https://www.manhuagui.com或者https://m.manhuagui.com网站的免费漫画的基类,简单提供几个信息实现一个子类即可推送特定的漫画 # Author: insert0003 <https://github.com/insert0003> import imghdr import json import re import urllib import urllib2 from books.base import BaseComicBook from bs4 import BeautifulSoup from g...
connectors
personal
from apps.alerts.models import AlertGroup from apps.base.models import UserNotificationPolicy, UserNotificationPolicyLogRecord from apps.telegram.client import TelegramClient from apps.telegram.decorators import ignore_reply_to_message_deleted from apps.telegram.models import TelegramMessage, TelegramToOrganizationConn...
Tools
MakeApp
#! python # -*- coding: utf-8 -*- # (c) 2003 Werner Mayer LGPL # Create a new application module import os import sys import MakeAppTools if len(sys.argv) != 2: sys.stdout.write("Please enter a name for your application.\n") sys.exit() Application = sys.argv[1] # create directory ../Mod/<Application> if no...
extractor
filemoon
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import decode_packed_codes, js_to_json from .common import InfoExtractor class FileMoonIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?filemoon\.sx/./(?P<id>\w+)" _TEST = { "url": "https://filemoon.sx/e/dw40rxrzruqz"...
ingest
urls
# This file is part of Archivematica. # # Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com> # # Archivematica is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the ...
tasks
notify_about_empty_shifts_in_schedule
import pytz from apps.schedules.ical_utils import list_of_empty_shifts_in_schedule from apps.slack.utils import format_datetime_to_slack_with_time, post_message_to_channel from celery.utils.log import get_task_logger from common.custom_celery_tasks import shared_dedicated_queue_retry_task from common.utils import trim_...
extractor
clubic
# coding: utf-8 from __future__ import unicode_literals from ..utils import clean_html, qualities from .common import InfoExtractor class ClubicIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\.)?clubic\.com/video/(?:[^/]+/)*video.*-(?P<id>[0-9]+)\.html" ) _TESTS = [ { "ur...
stream
dash
import copy import itertools import logging from collections import defaultdict from contextlib import contextmanager, suppress from datetime import datetime from time import time from typing import Any, Dict, List, Optional, Tuple from urllib.parse import urlparse, urlunparse from requests import Response from stream...