section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
parts | menubar | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2018 by Ihor E. Novikov
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later ver... |
db | tdb_cassandra | # 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, ... |
installer | fix_app_qt_folder_names_for_codesign | # -*- coding: utf-8 -*-
# see https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing-Qt
import os
import shutil
import sys
from pathlib import Path
from typing import Generator, List, Optional
from macholib.MachO import MachO
def create_symlink(folder: Path) -> None:
"""Create the appropriate ... |
legecy-translators | nparser | # JUST FOR NOW, later I will write my own - much faster and better.
# Copyright (C) 2013 Ariya Hidayat <ariya.hidayat@gmail.com>
# Copyright (C) 2013 Thaddee Tyl <thaddee.tyl@gmail.com>
# Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
# Copyright (C) 2012 Mathias Bynens <mathias@qiwi.be>
# Copyright (... |
util | misc | # 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.
import os
import sys
import tempfil... |
migrations | upgrade18 | """
Migration 8
- Converts modules from old Warfare Links to Command Modules
"""
CONVERSIONS = {
42526: ( # Armor Command Burst I
20069, # Armored Warfare Link - Damage Control I
20409, # Armored Warfare Link - Passive Defense I
22227, # Armored Warfare Link - Rapid Repair I
),
... |
views | get_started | """ Helping new users figure out the lay of the land """
import re
from bookwyrm import book_search, forms, models
from bookwyrm.suggested_users import suggested_users
from django.contrib.auth.decorators import login_required
from django.contrib.postgres.search import TrigramSimilarity
from django.db.models import Cou... |
lib | simpleextract | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
此文件包含一个简单(不够好)的网页正文提取模块,修改自开源代码,
在精密复杂的readability模块失效后启用。
(为什么不采用更好的正文提取方法?是因为我经过很多测试,发现针对readability失效的网页,
其他比较复杂的算法大多也一并失效,或者提取到错误的文本,而反而这个简单的算法
能应付变态网页,尽管结果不精确,可能截头去尾或包含一些无关内容。
但优点也很明显:什么网页都能返回一些文本内容。)
"""
import re
def simple_extract(content):
"""使用简单算法提取正文文本,... |
calendar | views | """Forum views."""
from __future__ import annotations
from datetime import date, datetime
from abilian.i18n import _l
from abilian.web import url_for, views
from abilian.web.action import ButtonAction
from flask import g, render_template
from toolz import groupby
from ..communities.blueprint import Blueprint
from ..... |
clientScripts | store_file_modification_dates | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
views | shift_swap | import logging
from apps.api.permissions import AuthenticatedRequest
from apps.api.views.shift_swap import BaseShiftSwapViewSet
from apps.auth_token.auth import ApiTokenAuthentication
from apps.public_api.throttlers.user_throttle import UserThrottle
from apps.schedules.models import ShiftSwapRequest
from apps.user_man... |
lib | csrf | # 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, ... |
bs4 | element | # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__license__ = "MIT"
import collections
import re
import shlex
import sys
import warnings
from bs4.dammit import EntitySubstitution
DEFAULT_OUTPUT_ENCODING = "utf-8"
PY3K = (sys.version_info[0] > 2)
whitespace_re = ... |
scripts | format_test | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import textwrap
import unittest
from beancount.scripts import format
from beancount.utils import test_utils
class TestScriptFormat(test_utils.ClickTestCase):
@test_utils.docfile
def test_success(self, filename):
"""
... |
extractor | clipsyndicate | from __future__ import unicode_literals
from ..utils import find_xpath_attr, fix_xml_ampersands
from .common import InfoExtractor
class ClipsyndicateIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:chic|www)\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)"
)
_TESTS = [
{
... |
panel | lyrics | # Copyright (C) 2009-2010 Aren Olson
#
# 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... |
Tools | LicenseChecker | #! python
# -*- coding: utf-8 -*-
# (c) 2013 Werner Mayer LGPL
#
# Utility to search for source, header and Python files with a missing license text
import codecs
import os
ext = [".cpp", ".cxx", ".cc", ".c", ".hpp", ".hxx", ".hh", ".h", ".inl", ".inc", ".py"]
flt = [
"__init__.py",
"_rc.py",
"coin_header... |
v1 | config | 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_challenges, clear_config, clear_standings
from CTFd.constants impo... |
accounts | FourSharedCom | # -*- coding: utf-8 -*-
from ..base.account import BaseAccount
from ..helpers import set_cookie
class FourSharedCom(BaseAccount):
__name__ = "FourSharedCom"
__type__ = "account"
__version__ = "0.13"
__status__ = "testing"
__description__ = """FourShared.com account plugin"""
__license__ = "G... |
extractor | cloudflarestream | # coding: utf-8
from __future__ import unicode_literals
import base64
import re
from .common import InfoExtractor
class CloudflareStreamIE(InfoExtractor):
_DOMAIN_RE = r"(?:cloudflarestream\.com|(?:videodelivery|bytehighway)\.net)"
_EMBED_RE = r"embed\.%s/embed/[^/]+\.js\?.*?\bvideo=" % _DOMAIN_RE
_ID_R... |
zeromq | qa_zeromq_reqrep | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
from gnuradio import blocks, eng_notation, gr, gr_unittest, zeromq
class qa_zeromq_reqrep(gr_unittest.TestCase):
def s... |
scripts | obj_trimmer | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import argparse
import os
from typing import List, Optional, TextIO
"""
Used to reduce the size of obj files used for printer platform models.
Trims trailing 0 from coordinates
Removes duplicate vertex text... |
model | system_info | # encoding: utf-8
"""
The system_info table and SystemInfo mapped class store runtime-editable
configuration options.
For more details, check :doc:`maintaining/configuration`.
"""
from typing import Any, Optional
import ckan.model.core as core
import ckan.model.domain_object as domain_object
import ckan.model.meta ... |
gui | event_request_manager | import json
import logging
import time
from typing import Optional
from PyQt5.QtCore import QTimer, QUrl, pyqtSignal
from PyQt5.QtNetwork import QNetworkAccessManager, QNetworkReply, QNetworkRequest
from tribler.core import notifications
from tribler.core.components.reporter.reported_error import ReportedError
from tr... |
scripts | update_po_with_changes | import argparse
from typing import List
"""
Takes in one of the po files in resources/i18n/[LANG_CODE]/cura.po and updates it with translations from a
new po file without changing the translation ordering.
This script should be used when we get a po file that has updated translations but is no longer cor... |
scripts | tracker | #!/usr/bin/python
# 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
# Lic... |
widgets | knob | import os
from enum import Enum
from sglib.lib import util
from sglib.lib.translate import _
from sglib.log import LOG
from sglib.math import clip_value
from sglib.models import theme
from sgui import shared as glbl_shared
from sgui.sgqt import *
from sgui.util import svg_to_pixmap
DEFAULT_THEME_KNOB = None
DEFAULT_T... |
builders | box_predictor_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... |
frescobaldi-app | backup | # 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_nswindow | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
from Quartz.CoreGraphics import *
have_Quartz = 1
except ImportError:
have_Quartz = 0
class TestNSWindowHelper(NSObject):
def window_willUseFullScreenContentSize_(self, a, b):
... |
views | webhooks | import json
from dataclasses import asdict
from apps.api.permissions import RBACPermission
from apps.api.serializers.webhook import WebhookResponseSerializer, WebhookSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.webhooks.models import Webhook, WebhookResponse
from apps.webhooks.presets.pre... |
scripts | csscombine | #!/usr/bin/env python
"""Combine all sheets referred to a given CSS *proxy* sheet
into a single new sheet.
- no ``url()`` values are adjusted so currently when using relative references
for e.g. images it is best to have all sheets in a single folder
- in @import rules only relative paths do work for now but should... |
cohort | cohort | import time
from datetime import datetime
from typing import Any, Dict, List, Literal, Optional, cast
import structlog
from django.conf import settings
from django.db import connection, models
from django.db.models import Case, Q, When
from django.db.models.expressions import F
from django.utils import timezone
from p... |
crypto | file_integrity | import hashlib
import io
import json
import os
from hmac import compare_digest
from typing import Callable
from ..checksums import StreamingXXH64
from ..helpers import IntegrityError
from ..logger import create_logger
logger = create_logger()
class FileLikeWrapper:
def __init__(self, fd):
self.fd = fd
... |
lib | bookmark | import os
from sglib import constants
from sglib.lib import portable
from sglib.log import LOG
from .util import read_file_text, write_file_text
BOOKMARKS_FILE = os.path.join(
constants.CONFIG_DIR,
"file_browser_bookmarks.txt",
)
def get_file_bookmarks():
f_result = {
"system": {
"p... |
Tools | updatets | #!/usr/bin/python3
# SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2010 Werner Mayer <wmayer@users.sourceforge.net> *
# * ... |
quodlibet | commands | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna,
# 2011-2020 Nick Boultbee
# 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 ve... |
settings | travis | """
Travis specific settings for tests
"""
import os
# Patch urllib3 because the default SSL module on Travis sucks
import urllib3.contrib.pyopenssl
from .common import *
# We delete the logger 'dissemin', so that it goes to root logger and gets catched by pytest caplog fixture
del LOGGING["loggers"]["dissemin"]
#... |
Code | Torneo | import collections
import os
import random
import shutil
from Code import MotoresExternos, Partida, Util, VarGen
class Engine(MotoresExternos.MotorExterno):
def __init__(self):
MotoresExternos.MotorExterno.__init__(self)
self._huella = None
self._depth = 0
self._time = 0
... |
events | musicbrainzsync | # Copyright 2019 LoveIsGrief
#
# 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 plugins, qltk
from ... |
prefs | templates | # -*- 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.... |
rename-extensions | letter_case | from __future__ import absolute_import
import os
import string
from gi.repository import Gtk
from sunflower.plugin_base.rename_extension import RenameExtension
class LetterCaseRename(RenameExtension):
"""Letter case rename extension support"""
def __init__(self, parent):
RenameExtension.__init__(se... |
graphs | wrapper | # =============================================================================
# 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 ... |
builtinPreferenceViews | pyfaUpdatePreferences | # noinspection PyPackageRequirements
import wx
from gui.bitmap_loader import BitmapLoader
from gui.preferenceView import PreferenceView
from service.settings import UpdateSettings
_t = wx.GetTranslation
class PFUpdatePref(PreferenceView):
def populatePanel(self, panel):
self.title = _t("Updates")
... |
vidcutter | videosliderwidget | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# VidCutter - media cutter & joiner
#
# copyright © 2018 Pete Alexandrou
#
# 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 t... |
youtube-dl | swfinterp | from __future__ import unicode_literals
import collections
import io
import zlib
from .compat import compat_str, compat_struct_unpack
from .utils import ExtractorError
def _extract_tags(file_contents):
if file_contents[1:3] != b"WS":
raise ExtractorError("Not an SWF file; header is %r" % file_contents[:... |
backfill | msgtime_to_inbox_count | # 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, ... |
calculix | write_constraint_planerotation | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
admin | site | """ manage site settings """
from bookwyrm import forms, models
from django.contrib.auth.decorators import login_required, permission_required
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.views import View
# pylint: disable= no-self-use
@method... |
gui-qt | about_dialog | import re
import plover
from plover.gui_qt.about_dialog_ui import Ui_AboutDialog
from PyQt5.QtWidgets import QDialog
class AboutDialog(QDialog, Ui_AboutDialog):
ROLE = "about"
def __init__(self, engine):
super().__init__()
self.setupUi(self)
credits = plover.__credits__
credi... |
models | blender_model | """
@file
@brief This file contains the blender model, used by the 3d animated titles screen
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an ... |
autokey | argument_parser | # Copyright (C) 2018 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 option) any later version.
# This program ... |
migrations | 0021_pumping | # Generated by Django 4.0.3 on 2022-04-04 15:34
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("core", "0020_bmi_tags_diaperchange_tags_feeding_tags_and_more"),
]
operations = [
migrations.CreateModel(
... |
fighter | abilityToggleStates | import wx
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcToggleFighterAbilityStatesCommand(wx.Command):
def __init__(
self, fitID, projected, mainPosition, positions, effectID, forceStates=None
):
wx.Command.__init__(self, True, "Toggle Fighter Abi... |
beetsplug | limit | # This file is part of beets.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribu... |
imageserver | util | #
# Quru Image Server
#
# Document: util.py
# Date started: 29 Mar 2011
# By: Matt Fozard
# Purpose: Stand-alone utility functions
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... |
action | update | # encoding: utf-8
"""API functions for updating existing data in CKAN."""
from __future__ import annotations
import datetime
import json
import logging
import time
from typing import TYPE_CHECKING, Any, Union, cast
import ckan.lib.app_globals as app_globals
import ckan.lib.datapreview
import ckan.lib.dictization.mod... |
src | shutdown | """shutdown function"""
import os
import threading
import time
import state
from debug import logger
from helper_sql import sqlQuery, sqlStoredProcedure
from inventory import Inventory
from network import StoppableThread
from network.knownnodes import saveKnownNodes
from queues import (
UISignalQueue,
address... |
models | group | """ do book related things with other users """
from bookwyrm.settings import DOMAIN
from django.apps import apps
from django.db import IntegrityError, models, transaction
from django.db.models import Q
from . import fields
from .base_model import BookWyrmModel
from .relationship import UserBlocks
class Group(BookWy... |
classes | classespropertypages | from __future__ import annotations
import logging
from gaphor import UML
from gaphor.core import gettext, transactional
from gaphor.core.format import format, parse
from gaphor.diagram.propertypages import (
EditableTreeModel,
NamePropertyPage,
PropertyPageBase,
PropertyPages,
help_link,
new_r... |
settings | prod_without_db | import os
from . import celery_task_routes
from .base import * # noqa: F401, F403
try:
import uwsgi
from prometheus_client import multiprocess
def on_uwsgi_worker_exit():
multiprocess.mark_process_dead(os.getpid())
uwsgi.atexit = on_uwsgi_worker_exit
except ModuleNotFoundError:
# O... |
extractor | voot | # coding: utf-8
from __future__ import unicode_literals
from ..utils import ExtractorError, int_or_none, try_get, unified_timestamp
from .common import InfoExtractor
class VootIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?voot\.com/(?:[^/]+/)+(?P<id>\d+)"
_GEO_COUNTRIES = ["IN"]
_TESTS = [
... |
PartDesignTests | TestPad | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
windows | process_effect | """
@file
@brief This file loads the Initialize Effects / Pre-process effects dialog
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.org), an open-sou... |
extractor | vrak | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, parse_age_limit, smuggle_url, unescapeHTML
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
class VrakIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?vrak\.tv/videos\?.*?\btarget=(?P<... |
reader | dicom_reader | # --------------------------------------------------------------------------
# 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... |
utils | versioncheck | import logging
import re
from typing import Tuple
import requests
from streamlink import __version__ as streamlink_version
from streamlink.cache import Cache
log = logging.getLogger("streamlink.cli")
def _parse_version(version: str) -> Tuple[int, int, int, int]:
m = re.match(r"(\d+)\.(\d+)\.(\d+)(?:[+-](\d+))?"... |
plugins | check_closing_test | __copyright__ = "Copyright (C) 2018 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount import loader
from beancount.parser import cmptest
class TestCheckClosing(cmptest.TestCase):
@loader.load_doc(expect_errors=True)
def test_check_closing(self, entries, _, options_map):
"""
... |
tools | generate_interpolation_permutations | #!/usr/bin/env python3
"""
Generate all combinations and permutations of missing accounts.
"""
__copyright__ = "Copyright (C) 2016 Martin Blais"
__license__ = "GNU GPLv2"
import argparse
import logging
import sys
def gen_inputs(template, args):
for mask in range(2 ** len(args)):
actual_args = [arg if no... |
aliceVision | SfMTriangulation | __version__ = "1.0"
from meshroom.core import desc
class SfMTriangulation(desc.AVCommandLineNode):
commandLine = "aliceVision_sfmTriangulation {allParams}"
size = desc.DynamicNodeSize("input")
category = "Sparse Reconstruction"
documentation = """
This node perfoms keypoint triangulation on its inpu... |
Scripts | Epitrochoid | #! python
# -*- coding: utf-8 -*-
# (c) 2011 Werner Mayer LGPL
#
from __future__ import division # allows floating point division from integers
import math
import FreeCAD
import Part
from FreeCAD import Base
class Epitrochoid:
def __init__(self, obj):
"""Add the properties: Radius1, Radius2, Distance,... |
browser | browser | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007, 2011 Lukáš Lalinský
# Copyright (C) 2011-2013 Michael Wiencek
# Copyright (C) 2012 Chad Wilson
# Copyright (C) 2012-2013, 2018, 2021 Philipp Wolfer
# Copyright (C) 2013, 2018, 2020-2021 Laurent Monin
# Copyright (C) ... |
softwareupdate | cli | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2015 The OctoPrint Project - Released under terms of the AGPLv3 License"
def commands(cli_group, pass_octoprint_ctx, *args, **kwargs):
import click
click.disable_unicode_literals_warning = T... |
gui | shipModeChange | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.shipModeChange import CalcChangeShipModeCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiChangeShipModeCommand(wx.Command):
def __init__(self, fitID, ite... |
models | insight_caching_state | from django.db import models
from django.db.models.signals import post_save
from posthog.models.dashboard import Dashboard
from posthog.models.dashboard_tile import DashboardTile
from posthog.models.insight import Insight
from posthog.models.sharing_configuration import SharingConfiguration
from posthog.models.signals ... |
scripts | runner | """
raven.scripts.runner
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
import os
import sys
import time
from optparse import OptionParser
from raven im... |
language | show_translations | #!/usr/bin/python3
"""
@file
@brief Display all available string translations for each translation file
@author Jonathan Thomas <jonathan@openshot.org>
@author Frank Dana <ferdnyc AT gmail com>
@section LICENSE
Copyright (c) 2008-2018 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of... |
plugins | nos | """
$description Live TV channels and video on-demand service from NOS, a Dutch public, state-owned broadcaster.
$url nos.nl
$type live, vod
$metadata id
$metadata title
$region Netherlands
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from... |
serializer | base | # -*- coding: utf-8 -*-
"""
raven.utils.serializer.base
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import itertools
import types
from raven.utils.compat import (
PY... |
clientScripts | remove_files_without_premis_metadata | #!/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... |
base | xfs_account | # -*- coding: utf-8 -*-
import locale
import re
import time
import urllib.parse
from pyload.core.utils import parse
from ..helpers import parse_html_form, search_pattern, set_cookie
from .account import BaseAccount
class XFSAccount(BaseAccount):
__name__ = "XFSAccount"
__type__ = "account"
__version__ ... |
cmis | parser | """Parses XML messages and converts them to objects."""
from __future__ import annotations
import base64
from datetime import datetime
from lxml import objectify
from lxml.objectify import ObjectifiedElement
ATOM_NS = "http://www.w3.org/2005/Atom"
APP_NS = "http://www.w3.org/2007/app"
CMISRA_NS = "http://docs.oasis-... |
daw | seq_item | class sequencer_item:
__slots__ = [
"track_num",
"start_beat",
"length_beats",
"item_uid",
"start_offset",
"modified",
"uid",
]
def __init__(
self,
a_track_num,
a_start_beat,
a_length_beats,
a_item_uid=-1,
... |
statistics | models | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program 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 2
# of th... |
config | templates | # 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, ... |
autocomplete | completiondata | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2011 - 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
... |
UiPluginManager | UiPluginManagerPlugin | import io
import json
import os
import shutil
import time
from Config import config
from Debug import Debug
from Plugin import PluginManager
from Translate import Translate
from util.Flag import flag
plugin_dir = os.path.dirname(__file__)
if "_" not in locals():
_ = Translate(plugin_dir + "/languages/")
# Conv... |
activitypub | book | """ book and author data """
from dataclasses import dataclass, field
from typing import Optional
from .base_activity import ActivityObject
from .image import Document
# pylint: disable=invalid-name
@dataclass(init=False)
class BookData(ActivityObject):
"""shared fields for all book data and authors"""
open... |
core | playlists | from __future__ import annotations
import contextlib
import logging
import urllib.parse
from collections.abc import Generator
from typing import TYPE_CHECKING, Any, Optional, Union
from mopidy import exceptions
from mopidy.core import listener
from mopidy.internal import validation
from mopidy.models import Playlist,... |
backend | postgres | # -*- coding: utf-8 -*-
from __future__ import annotations
import copy
import datetime
import decimal
import distutils.version
import hashlib
import json
import logging
import os
import pprint
import sys
from collections import OrderedDict
from io import StringIO
from typing import Any, Callable, Container, Dict, Iter... |
views | schedule | import datetime
import functools
import operator
import pytz
from apps.alerts.models import EscalationChain, EscalationPolicy
from apps.api.permissions import RBACPermission
from apps.api.serializers.schedule_base import ScheduleFastSerializer
from apps.api.serializers.schedule_polymorphic import (
PolymorphicSche... |
PathScripts | PathUtilsGui | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
audio | _shared | import os
from sglib import constants
from sglib.lib.util import ITEM_SNAP_DIVISORS, pi_path
from sglib.log import LOG
from sglib.math import clip_value
from sgui import shared as glbl_shared
from sgui.sgqt import *
AUDIO_QUANTIZE = False
AUDIO_QUANTIZE_PX = 100.0
AUDIO_QUANTIZE_AMT = 1.0
AUDIO_LINES_ENABLED = True
A... |
statistics | users | from CTFd.api.v1.statistics import statistics_namespace
from CTFd.models import Users
from CTFd.utils.decorators import admins_only
from flask_restx import Resource
from sqlalchemy import func
@statistics_namespace.route("/users")
class UserStatistics(Resource):
@admins_only
def get(self):
registered ... |
gpodder | my | # -*- 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... |
PyObjCTest | test_cggeometry | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
class TestCGGeometry(TestCase):
def testStruct(self):
v = CGPoint()
self.assertIsInstance(v.x, float)
self.assertIsInstance(v.y, float)
v = CGSize()
self.assertIsInstance(v.width, float)
self.a... |
util | library | # Copyright 2004-2017 Joe Wreschnig, Michael Urman, Iñigo Serna, Christoph Reiter
# 2013-2022 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the Li... |
books | links | """ the good stuff! the books! """
from bookwyrm import forms, models
from django.contrib.auth.decorators import login_required, permission_required
from django.db import transaction
from django.shortcuts import get_object_or_404, redirect
from django.template.response import TemplateResponse
from django.utils.decorato... |
database | database | from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict
from zoneinfo import ZoneInfo, ZoneInfoNotFoundError
from posthog.hogql.database.models import (
BooleanDatabaseField,
DatabaseField,
DateDatabaseField,
DateTimeDatabaseField,
FieldTraverser,
FloatDatabaseField,
Func... |
scripts | smoothie_post | # ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.