section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
tools
find_missing_tests
#!/usr/bin/env python3 """ Find missing test coverage in our source code. This program find source code and warns us if associated tests are missing or incomplete. This is used to track progress in test coverage and to ensure that the entire software suite is covered by appropriate testing code. """ __copyright__ = "C...
Op
Pocket
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it a...
saveddata
damagePattern
# =============================================================================== # 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, ...
data
bases
import invesalius.data.coordinates as dco import invesalius.data.coregistration as dcr import invesalius.data.transformations as tr import numpy as np def angle_calculation(ap_axis, coil_axis): """ Calculate angle between two given axis (in degrees) :param ap_axis: anterior posterior axis represented ...
v1
scoreboard
from collections import defaultdict from CTFd.cache import cache, make_cache_key from CTFd.models import Awards, Solves, Users, db from CTFd.utils import get_config from CTFd.utils.dates import isoformat, unix_time_to_utc from CTFd.utils.decorators.visibility import ( check_account_visibility, check_score_visi...
plugins
ustvnow
""" $description US live TV channels. OTT service from USTVnow. $url ustvnow.com $type live $account Required, additional subscription required by some streams """ import base64 import json import logging import re from urllib.parse import urljoin, urlparse from uuid import uuid4 from streamlink.plugin import Plugin,...
grouptagger
gt_export
# 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...
query
_query
# Copyright 2004-2005 Joe Wreschnig, Michael Urman # 2015-2020 Nick Boultbee, # 2016 Ryan Dellenbaugh, # 2019 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 by # the Free So...
extractor
aparat
# coding: utf-8 from __future__ import unicode_literals from ..utils import ( get_element_by_id, int_or_none, merge_dicts, mimetype2ext, url_or_none, ) from .common import InfoExtractor class AparatIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?aparat\.com/(?:v/|video/video/embed/videoh...
const
languages
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2007 Lukáš Lalinský # Copyright (C) 2014, 2018, 2020 Laurent Monin # Copyright (C) 2017 Sambhav Kothari # Copyright (C) 2018 Shen-Ta Hsieh # Copyright (C) 2018-2020 Philipp Wolfer # # This program is free software; you can redi...
extractor
ketnet
from __future__ import unicode_literals from ..compat import compat_urllib_parse_unquote from ..utils import int_or_none, parse_iso8601 from .canvas import CanvasIE from .common import InfoExtractor class KetnetIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?ketnet\.be/(?P<id>(?:[^/]+/)*[^/?#&]+)" _TEST...
clientScripts
restructure_dip_for_content_dm_upload
#!/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...
parser
booking_full_test
__copyright__ = "Copyright (C) 2015-2016 Martin Blais" __license__ = "GNU GPLv2" import collections import datetime import functools import io import re import textwrap import unittest from unittest import mock from beancount import loader from beancount.core import amount, data, interpolate, inventory, position fro...
utils
np_box_list_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...
neubot
backend
# neubot/backend.py # # Copyright (c) 2012-2013 # Nexa Center for Internet & Society, Politecnico di Torino (DAUIN) # and Simone Basso <bassosimone@gmail.com> # # Copyright (c) 2012 Fabio Forno <fabio.forno@gmail.com> # # This file is part of Neubot <http://www.neubot.org/>. # # Neubot is free software: you ca...
narrowband
uhd_interface
#!/usr/bin/env python # # Copyright 2010,2011 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import sys from optparse import OptionParser from gnuradio import eng_notation, gr, uhd from gnuradio.eng_option import eng_option def add_freq_option(pa...
downloaders
UseruploadNet
# -*- coding: utf-8 -*- import re from ..base.xfs_downloader import XFSDownloader class UseruploadNet(XFSDownloader): __name__ = "UseruploadNet" __type__ = "downloader" __version__ = "0.02" __status__ = "testing" __pattern__ = r"https?://(?:www\.)?userupload\.net/\w{12}" __config__ = [ ...
extractor
streamable
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import ExtractorError, float_or_none, int_or_none from .common import InfoExtractor class StreamableIE(InfoExtractor): _VALID_URL = r"https?://streamable\.com/(?:[es]/)?(?P<id>\w+)" _TESTS = [ { "url": "https:...
api
documentation
import re from typing import Dict, get_args from drf_spectacular.types import OpenApiTypes from drf_spectacular.utils import ( # # noqa: F401 for easy import extend_schema, extend_schema_field, ) from posthog.models.entity import MathType from posthog.models.property import OperatorType, PropertyType from res...
classes
ui_util
""" @file @brief This file contains PyQt help functions, to translate the interface, load icons, and connect signals @author Noah Figg <eggmunkee@hotmail.com> @author Jonathan Thomas <jonathan@openshot.org> @author Olivier Girard <eolinwen@gmail.com> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, L...
builders
input_reader_builder
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
builder
release
#!/usr/bin/python3 -OO # Copyright 2008-2017 The SABnzbd-Team (sabnzbd.org) # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later ver...
transports
htmlfile
# -*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals """ sockjs.tornado.transports.htmlfile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HtmlFile transport implementation. """ import re from octoprint.vendor.sockjs.tornado import proto from octoprint.vendor.so...
actions
partition
"""Activity Partition item.""" from gaphas.geometry import Rectangle from gaphas.item import NW, SE from gaphor import UML from gaphor.core.modeling import DrawContext from gaphor.core.modeling.properties import association from gaphor.core.styling import JustifyContent from gaphor.diagram.presentation import ElementP...
generic
env
# -*- coding: utf-8 -*- from __future__ import with_statement import os from logging.config import fileConfig from alembic import context from sqlalchemy import engine_from_config, pool # this is the Alembic Config object, which provides # access to the values within the .ini file in use. config = context.config #...
widgets
sample_viewer
from sglib.lib.translate import _ from sgui.sgqt import * from .audio_item_viewer import * AUDIO_LOOP_CLIPBOARD = None LOOP_GRADIENT = QLinearGradient(0.0, 0.0, 66.0, 66.0) LOOP_GRADIENT.setColorAt(0.0, QColor.fromRgb(246, 180, 30)) LOOP_GRADIENT.setColorAt(1.0, QColor.fromRgb(226, 180, 42)) LOOP_PEN = QPen(QColor.fr...
queries
person_query
from typing import Any, Dict, List, Optional, Set, Tuple, Union from uuid import UUID from posthog.clickhouse.materialized_columns import ColumnName from posthog.constants import PropertyOperatorType from posthog.models import Filter from posthog.models.cohort import Cohort from posthog.models.cohort.sql import ( ...
views
alerts
from apps.alerts.models import Alert from apps.auth_token.auth import ApiTokenAuthentication from apps.public_api.serializers.alerts import AlertSerializer from apps.public_api.throttlers.user_throttle import UserThrottle from common.api_helpers.mixins import RateLimitHeadersMixin from common.api_helpers.paginators imp...
api
validators
"""Validation of transfer documents. Usage example:: >> validator = get_validator("avalon") >> validator.validate(b"...") True Expect the ``validate`` method to raise ``ValidationError`` when validation does not pass. The exception may include a message with more details. New validators must be added to...
utils
feature_utils
# 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, ...
extractor
pearvideo
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import qualities, unified_timestamp from .common import InfoExtractor class PearVideoIE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?pearvideo\.com/video_(?P<id>\d+)" _TEST = { "url": "http://www.pearvideo.com/video_...
classes
stereotype
"""Support code for dealing with stereotypes in diagrams.""" from gaphor.core.format import format from gaphor.core.styling import JustifyContent, TextAlign from gaphor.diagram.shapes import Box, Text, draw_top_separator def stereotype_watches(presentation): presentation.watch("subject.appliedStereotype", presen...
datastore
writer
# encoding: utf-8 from __future__ import annotations import csv from codecs import BOM_UTF8 from contextlib import contextmanager from email.utils import encode_rfc2231 from typing import Any, Optional from xml.etree.cElementTree import Element, ElementTree, SubElement from simplejson import dumps @contextmanager d...
gtk3
removetorrentdialog
# # Copyright (C) 2007-2008 Andrew Resch <andrewresch@gmail.com> # # This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with # the additional special exception to link portions of this program with the OpenSSL library. # See LICENSE for more details. # import logging import os ...
downloaders
MegacrypterCom
# -*- coding: utf-8 -*- import json import re from .MegaCoNz import MegaCoNz, MegaCrypto class MegacrypterCom(MegaCoNz): __name__ = "MegacrypterCom" __type__ = "downloader" __version__ = "0.28" __status__ = "testing" __pattern__ = r"https?://\w{0,10}\.?megacrypter\.com/[\w\-!]+" __config__ ...
uic-files
about_dialog_ui
# Form implementation generated from reading ui file './forms/about_dialog.ui' # # Created by: PyQt5 UI code generator 5.9 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets from . import main_window_view_rc class Ui_AboutDialog(object): def setupUi(self, AboutDi...
mainwin
dirview
import os from PyQt5.QtCore import ( QDir, QDirIterator, QItemSelectionModel, QMutex, QSettings, Qt, QUrl, pyqtSignal, ) from PyQt5.QtGui import QDesktopServices from PyQt5.QtWidgets import ( QAbstractItemView, QAction, QCheckBox, QFileSystemModel, QHeaderView, Q...
extensions
actions
# 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 ...
femviewprovider
view_material_common
# *************************************************************************** # * Copyright (c) 2013 Juergen Riegel <FreeCAD@juergen-riegel.net> * # * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
builtinItemStatsViews
itemProperties
# noinspection PyPackageRequirements import wx from .helpers import AutoListCtrl _t = wx.GetTranslation class ItemProperties(wx.Panel): def __init__(self, parent, stuff, item, context=None): wx.Panel.__init__(self, parent) mainSizer = wx.BoxSizer(wx.VERTICAL) self.paramList = AutoListCt...
widgets
ipv8health
import statistics import threading import time from PyQt5.QtCore import Qt, QTimer from PyQt5.QtGui import QPainter from PyQt5.QtWidgets import QWidget from tribler.gui.sentry_mixin import AddBreadcrumbOnShowMixin from tribler.gui.utilities import connect class MonitorWidget(AddBreadcrumbOnShowMixin, QWidget): "...
Gui
JobCmd
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
commands
parser
# SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net> # # SPDX-License-Identifier: GPL-3.0-or-later """Module for parsing commands entered into the browser.""" import dataclasses from typing import Iterator, List from qutebrowser.commands import cmdexc, command from qutebrowser.config import config...
ui
macosshim
import logging import sys log = logging.getLogger(__name__) if sys.platform == "darwin": from gi.repository import GLib, Gtk def new_shortcut_with_args(shortcut, signal, *args): shortcut = Gtk.Shortcut.new( trigger=Gtk.ShortcutTrigger.parse_string(shortcut), action=Gtk.Signal...
frescobaldi-app
documenttooltip
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2008 - 2016 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 ...
projectedModule
changeSpool
import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.module.changeSpool import CalcChangeModuleSpoolCommand from gui.fitCommands.helpers import InternalCommandHistory from service.fit import Fit class GuiChangeProjectedModuleSpoolCommand(wx.Command): def __init...
admin
federation
""" manage federated servers """ import json from bookwyrm import forms, models from bookwyrm.models.user import get_or_create_remote_server from bookwyrm.settings import PAGE_LENGTH from django.contrib.auth.decorators import login_required, permission_required from django.core.paginator import Paginator from django.d...
qrcode
main
from bisect import bisect_left import lib.six as six from lib.qrcode import constants, exceptions, util from lib.qrcode.image.base import BaseImage def make(data=None, **kwargs): qr = QRCode(**kwargs) qr.add_data(data) return qr.make_image() def _check_version(version): if version < 1 or version > ...
system
english_stenotype
KEYS = ( "#", "S-", "T-", "K-", "P-", "W-", "H-", "R-", "A-", "O-", "*", "-E", "-U", "-F", "-R", "-P", "-B", "-L", "-G", "-T", "-S", "-D", "-Z", ) IMPLICIT_HYPHEN_KEYS = ("A-", "O-", "-E", "-U", "*") SUFFIX_KEYS = ("-Z", "-D",...
rest
shutdown_endpoint
from aiohttp import web from aiohttp_apispec import docs from ipv8.REST.schema import schema from marshmallow.fields import Boolean from tribler.core.components.restapi.rest.rest_endpoint import ( RESTEndpoint, RESTResponse, ) from tribler.core.utilities.utilities import froze_it @froze_it class ShutdownEndpo...
ui
ui_infodialog
# -*- coding: utf-8 -*- # Automatically generated - don't edit. # Use `python setup.py build_ui` to update it. from PyQt5 import QtCore, QtGui, QtWidgets class Ui_InfoDialog(object): def setupUi(self, InfoDialog): InfoDialog.setObjectName("InfoDialog") InfoDialog.resize(665, 436) self.v...
scripts
conversion
# Developed for module tiericide, this script will quickly print out a market # conversion map based on patch notes, as well as database conversion mapping. import argparse import os.path import sqlite3 import sys # Add eos root path to sys.path so we can import ourselves path = os.path.dirname(__file__) sys.path.app...
extractor
channel9
from __future__ import unicode_literals import re from ..utils import ( ExtractorError, clean_html, int_or_none, parse_iso8601, qualities, unescapeHTML, ) from .common import InfoExtractor class Channel9IE(InfoExtractor): IE_DESC = "Channel 9" IE_NAME = "channel9" _VALID_URL = r"...
Code
STS
import collections import os from Code import MotoresExternos, Util, VarGen class Elem: def __init__(self, linea): self._fen, results = linea.strip().split("|") results = results.replace(" ", "") mx = 0 dr = {} for resp in results.split(","): pv, pts = resp.sp...
gpodder
model
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # Copyright (c) 2011 Neal H. Walfield # # 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 Foun...
femtaskpanels
task_solver_ccxtools
# *************************************************************************** # * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
commands
watch_photos
import asyncio from pathlib import Path from time import sleep from typing import AsyncGenerator, Generator from asgiref.sync import sync_to_async from asyncinotify import Inotify, Mask from django.conf import settings from django.core.management.base import BaseCommand from photonix.photos.models import LibraryPath f...
faulthandler
setup
#!/usr/bin/env python # Todo list to prepare a release: # - run ./run_tests.py # - run tests on FreeBSD and Windows # - set VERSION in faulthandler.c # - set VERSION in setup.py # - set release date in the ChangeLog (README file) # - git commit -a # - git tag -a faulthandler-x.y -m "tag version x.y" # - git pu...
util
thread
# Copyright 2015 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. """Utils for executing things in a ...
Code
MotoresExternos
import os from Code import BaseConfig, Util, VarGen, XMotor class OpcionUCI: def leeTXT(self, txt): li = txt.split(VarGen.XSEP) self.tipo = li[0] self.nombre = li[1] self.default = li[2] self.valor = li[3] # if self.default != self.valor: # p rint self....
box-coders
mean_stddev_box_coder
# 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...
paned
prefs
# Copyright 2013 Christoph Reiter # 2015 Nick Boultbee # 2017 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 ...
PyObjCTest
test_nslayoutmanager
from AppKit import * from PyObjCTools.TestSupport import * try: long except NameError: long = int class TestNSLayoutManagerHelper(NSObject): def layoutManager_shouldUseTemporaryAttributes_forDrawingToScreen_atCharacterIndex_effectiveRange_( self, a, b, c, d, e ): return 1 def lay...
meshes
mesh_truss_crane_seg3
def create_nodes(femmesh): # nodes femmesh.addNode(0.0, 2000.0, 0.0, 1) femmesh.addNode(0.0, 0.0, 0.0, 2) femmesh.addNode(2000.0, 2000.0, 0.0, 3) femmesh.addNode(2000.0, 0.0, 0.0, 4) femmesh.addNode(4000.0, 2000.0, 0.0, 5) femmesh.addNode(4000.0, 0.0, 0.0, 6) femmesh.addNode(6000.0, 2000...
alerts
utils
import ipaddress import json import socket from typing import Tuple from urllib.parse import urlparse import requests from apps.base.utils import live_settings def render_relative_timeline(log_created_at, alert_group_started_at): time_delta = log_created_at - alert_group_started_at seconds = int(time_delta.t...
extractor
eighttracks
# coding: utf-8 from __future__ import unicode_literals import json import random from ..compat import compat_str from ..utils import ExtractorError from .common import InfoExtractor class EightTracksIE(InfoExtractor): IE_NAME = "8tracks" _VALID_URL = r"https?://8tracks\.com/(?P<user>[^/]+)/(?P<id>[^/#]+)(?...
extractor
aws
# coding: utf-8 from __future__ import unicode_literals import datetime import hashlib import hmac from ..compat import compat_urllib_parse_urlencode from .common import InfoExtractor class AWSIE(InfoExtractor): _AWS_ALGORITHM = "AWS4-HMAC-SHA256" _AWS_REGION = "us-east-1" def _aws_execute_api(self, aw...
gtk3
path_chooser
# # Copyright (C) 2013 Bro <bro.development@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.compo...
instruments
Guitar
##################################################################### # -*- coding: utf-8 -*- # # # # Frets on Fire # # Copyright (C) 2006 Sami Kyostila ...
gpodder
services
# -*- 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...
migrations
0176_hashtag_support
# Generated by Django 3.2.16 on 2022-12-17 19:28 import bookwyrm.models.fields import django.contrib.postgres.fields.citext from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0174_auto_20230130_1240"), ] operations = [ migration...
lector
metadatadialog
# This file is a part of Lector, a Qt based ebook reader # Copyright (C) 2017-2019 BasioMeusPuga # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your o...
migrations
0241_subscription
# Generated by Django 3.2.13 on 2022-06-14 13:58 import django.contrib.postgres.fields import django.db.models.deletion from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0240_organizationinvite_message"), ] ...
engines
archlinux
# SPDX-License-Identifier: AGPL-3.0-or-later """ Arch Linux Wiki API: Mediawiki provides API, but Arch Wiki blocks access to it """ from urllib.parse import urlencode, urljoin from lxml import html from searx.utils import eval_xpath_getindex, eval_xpath_list, extract_text # about about = { "website": "https:/...
models
annual_goal
""" How many books do you want to read this year """ from bookwyrm.models.status import Review from django.core.validators import MinValueValidator from django.db import models from django.utils import timezone from . import Review, fields from .base_model import BookWyrmModel def get_current_year(): """sets def...
clientScripts
fits
#!/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...
bitmessageqt
dialogs
""" Custom dialog classes """ import paths import widgets from address_dialogs import ( AddAddressDialog, EmailGatewayDialog, NewAddressDialog, NewSubscriptionDialog, RegenerateAddressesDialog, SpecialAddressBehaviorDialog, ) from newchandialog import NewChanDialog # pylint: disable=too-few-pub...
example-itemplatehelpers
plugin
# encoding: utf-8 from __future__ import annotations from typing import Any, Callable import ckan.plugins as plugins from ckan.common import CKANConfig # Our custom template helper function. def example_helper(): """An example template helper function.""" # Just return some example text. return "This i...
bleachbit
CleanerML
# vim: ts=4:sw=4:expandtab # BleachBit # Copyright (C) 2008-2023 Andrew Ziem # https://www.bleachbit.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 3 of the License, or # ...
script
serializer
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2021, 2023 Bob Swift # Copyright (C) 2021-2022 Laurent Monin # Copyright (C) 2021-2023 Philipp Wolfer # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public Licen...
models
experiment
from django.db import models from django.utils import timezone class Experiment(models.Model): name: models.CharField = models.CharField(max_length=400) description: models.CharField = models.CharField( max_length=400, null=True, blank=True ) team: models.ForeignKey = models.ForeignKey("Team",...
Db
DbQuery
import re # Parse and modify sql queries class DbQuery: def __init__(self, query): self.setQuery(query.strip()) # Split main parts of query def parseParts(self, query): parts = re.split("(SELECT|FROM|WHERE|ORDER BY|LIMIT)", query) parts = [_f for _f in parts if _f] # Remove empty...
migrations
0005_project_based_permissioning
# Generated by Django 3.2.5 on 2021-09-10 11:39 import django.db.models.deletion import posthog.models.utils from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0170_project_based_permissioning"), migration...
knowledge-to-triblerdb
migration
import logging import shutil from tribler.core.utilities.path_util import Path from tribler.core.utilities.simpledefs import STATEDIR_DB_DIR class MigrationKnowledgeToTriblerDB: def __init__(self, state_dir: Path): self.logger = logging.getLogger(self.__class__.__name__) self.state_dir = state_di...
songsmenu
filterbrowser
# Copyright 2012 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 quodlibet import _, app, brows...
migrations
0228_fix_tile_layouts
# Generated by Django 3.2.12 on 2022-04-22 09:10 import json import structlog from django.core.paginator import Paginator from django.db import migrations def migrate_dashboard_insight_relations(apps, _) -> None: logger = structlog.get_logger(__name__) logger.info("starting_0228_fix_tile_layouts") Dashb...
lib
translation
# 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, ...
cherrypy
_cprequest
import os import sys import time import warnings import cherrypy from cherrypy import _cpconfig, _cpreqbody from cherrypy._cpcompat import ( CookieError, SimpleCookie, basestring, copykeys, ntob, py3k, unicodestr, ) from cherrypy._cperror import bare_error, format_exc from cherrypy.lib impo...
PyObjCTest
test_cgwindowlevel
from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * try: long except NameError: long = int class TestCGWindowLevel(TestCase): def testConstants(self): self.assertEqual(kCGBaseWindowLevelKey, 0) self.assertEqual(kCGMinimumWindowLevelKey, 1) self.assertEqual(kCGD...
lib
makeoeb
#!usr/bin/Python # -*- coding:utf-8 -*- # 将News feed生成的HTML文件转换成内存中的OEB格式 # Author: cdhigh <https://github.com/cdhigh> import os import re import sys import uuid # 这两个是必须先引入的,会有一些全局初始化 import calibre.startup import calibre.utils.resources from calibre.ebooks.conversion.epuboutput import EPUBOutput from calibre.ebooks....
extractor
videofyme
from __future__ import unicode_literals from ..utils import int_or_none, parse_iso8601 from .common import InfoExtractor class VideofyMeIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\.videofy\.me/.+?|p\.videofy\.me/v)/(?P<id>\d+)(&|#|$)" ) IE_NAME = "videofy.me" _TEST = { "url":...
windows
preferences
""" @file @brief This file loads the Preferences dialog (i.e where is all preferences) @author Jonathan Thomas <jonathan@openshot.org> @author Olivier Girard <olivier@openshot.org> @section LICENSE Copyright (c) 2008-2018 OpenShot Studios, LLC (http://www.openshotstudios.com). This file is part of OpenShot Vi...
BOPTools
BOPFeatures
# SPDX-License-Identifier: LGPL-2.1-or-later # *************************************************************************** # * Copyright (c) 2023 Werner Mayer <wmayer[at]users.sourceforge.net> * # * * # * This file is part of FreeCAD. ...
Code
EnginesBunch
def relaciones(dicRivales): result = """ stockfish=b2b3 e2e4 c1d2 e3e4 g1e2 c4c5 c1d2 b3e3 e1g1 b3d1 a4d7 d2c4 f1b5 d1d4 a1c1 c4c5 d4d5 a2a4 d1c1 e2e4 c1f4 e2c1 e1g1 d2d4 a4b5 h2h3 c1g5 d3d4 b2b3 a2a4 f2f4 a2a4 e1g1 d3d4 a2a4 b1c3 f1e1 d1c1 d1a4 b2b3 d4d5 c1d2 a2a3 h2h3 c4b5 c3e2 c3d1 e1g1 f1g2 e3d4 d1e2 f1e1 a4c4 ...
migrations
0004_rights
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("main", "0003_archivesspacedipobjectresourcepairing_data")] operations = [ migrations.AlterField( model_name="rightsstatement", name="metadataappliestoidentifier", fiel...
builtinPreferenceViews
pyfaEnginePreferences
import logging import gui.globalEvents as GE import gui.mainFrame import wx from gui.bitmap_loader import BitmapLoader from gui.preferenceView import PreferenceView from service.fit import Fit from service.settings import EOSSettings from wx.lib.intctrl import IntCtrl logger = logging.getLogger(__name__) _t = wx.Get...
PyObjCTest
test_qcplugin
from PyObjCTools.TestSupport import * from Quartz.QuartzComposer import * try: unicode except NameError: unicode = str class TestQCPlugIn(TestCase): @min_os_level("10.5") def testConstants10_5(self): self.assertIsInstance(QCPlugInAttributeNameKey, unicode) self.assertIsInstance(QCPlug...
validate
_validate
from collections import abc from copy import copy, deepcopy from functools import singledispatch from re import Match, Pattern from lxml.etree import Element, iselement from streamlink.exceptions import PluginError from streamlink.plugin.api.validate._exception import ValidationError from streamlink.plugin.api.validat...
socks5
aiohttp_connector
import socket from asyncio import wait_for from aiohttp import TCPConnector from aiohttp.abc import AbstractResolver from tribler.core.components.socks_servers.socks5.client import Socks5Client class FakeResolver(AbstractResolver): async def resolve(self, host, port=0, family=socket.AF_INET): return [ ...
Draft
importSVG
# *************************************************************************** # * Copyright (c) 2009 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...