section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
scenarios | distribute_alerts | import json
import logging
import typing
from contextlib import suppress
from datetime import datetime
from apps.alerts.constants import ActionSource
from apps.alerts.incident_appearance.renderers.constants import DEFAULT_BACKUP_TITLE
from apps.alerts.incident_appearance.renderers.slack_renderer import AlertSlackRende... |
versions | 016_37ada738328e_uuids_everywhere | # encoding: utf-8
"""016 Uuids everywhere
Revision ID: 37ada738328e
Revises: 6d8ffebcaf54
Create Date: 2018-09-04 18:48:53.632517
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "37ada738328e"
down_r... |
extractor | esri | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urlparse
from ..utils import int_or_none, parse_filesize, unified_strdate
from .common import InfoExtractor
class EsriVideoIE(InfoExtractor):
_VALID_URL = r"https?://video\.esri\.com/watch/(?P<id>[0-9]+)"
_TEST = {... |
torrent-checker | torrent_checker_component | from tribler.core.components.component import Component
from tribler.core.components.libtorrent.libtorrent_component import LibtorrentComponent
from tribler.core.components.metadata_store.metadata_store_component import (
MetadataStoreComponent,
)
from tribler.core.components.socks_servers.socks_servers_component i... |
extractor | sendtonews | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
determine_protocol,
float_or_none,
int_or_none,
parse_iso8601,
unescapeHTML,
update_url_query,
)
from .common import InfoExtractor
class SendtoNewsIE(InfoExtractor):
_VALID_URL = r"https?://embed\.sen... |
equations | magnetodynamic2D | # ***************************************************************************
# * Copyright (c) 2023 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
clientScripts | archivematicaCreateMETSMetadataCSV | #!/usr/bin/env python
#
# This file is part of Archivematica.
#
# Copyright 2010-2012 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, ... |
qtui | configwindow | # Copyright (C) 2011 Chris Dekter
# 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) a... |
cura | CrashHandler | # Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import faulthandler
import json
import locale
import os
import os.path
import platform
import tempfile
import traceback
import uuid
from typing import Any, cast
try:
from sentry_sdk import add_breadcrumb, configure_scope
... |
funnels | funnel_event_query | from typing import Any, Dict, Set, Tuple, Union
from posthog.constants import TREND_FILTER_TYPE_ACTIONS
from posthog.hogql.hogql import translate_hogql
from posthog.models.filters.filter import Filter
from posthog.models.group.util import get_aggregation_target_field
from posthog.queries.event_query import EventQuery
... |
aliceVision | SfmBootstraping | __version__ = "1.0"
from meshroom.core import desc
class SfMBootStraping(desc.AVCommandLineNode):
commandLine = "aliceVision_sfmBootstraping {allParams}"
size = desc.DynamicNodeSize("input")
category = "Sparse Reconstruction"
documentation = """
"""
inputs = [
desc.File(
nam... |
views | dialogs | import html
import logging
import os
import platform
import traceback
from io import StringIO
from urllib.parse import urlencode
import cddagl.constants as cons
import markdown2
from cddagl import __version__ as version
from cddagl.constants import get_resource_path
from cddagl.functions import bitness, clean_qt_path
... |
extractor | zhihu | # coding: utf-8
from __future__ import unicode_literals
from ..utils import float_or_none, int_or_none
from .common import InfoExtractor
class ZhihuIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?zhihu\.com/zvideo/(?P<id>[0-9]+)"
_TEST = {
"url": "https://www.zhihu.com/zvideo/1342930761977176064... |
posthog | urls | from typing import Any, Callable, List, Optional, cast
from urllib.parse import urlparse
from django.conf import settings
from django.http import HttpRequest, HttpResponse, HttpResponseServerError
from django.template import loader
from django.urls import URLPattern, include, path, re_path
from django.views.decorators... |
Gui | IconViewProvider | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
Tools | PythonToCPP | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2004 Werner Mayer LGPL
import os
import sys
# os.chdir("E:\\Develop\\FreeCADWin\\scripts")
try:
file = open(sys.argv[1], encoding="utf-8")
except TypeError:
file = open(sys.argv[1])
if len(sys.argv) > 4:
sys.stderr.write(
"Wrong Parameter\n Usage... |
migrations | 0004_tag | # Generated by Django 3.0.3 on 2020-02-21 05:54
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0003_auto_20200221_0131"),
]
operations = [
migrations.CreateMo... |
draftguitools | gui_move | # ***************************************************************************
# * (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> *
# * ... |
async-migrations | disk_util | from posthog.client import sync_execute
from posthog.settings import CLICKHOUSE_DATABASE
def analyze_enough_disk_space_free_for_table(table_name: str, required_ratio: float):
"""
Analyzes whether there's enough disk space free for given async migration operation.
This is done by checking whether there's ... |
classes | updates | """
@file
@brief This file contains the classes needed for tracking updates and distributing changes
@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, LLC
(http://www.... |
frescobaldi-app | cursortools | # cursortools.py -- QTextCursor utility functions
#
# 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
# of the License, or (at y... |
gui | bitmap_preview_panel | import time
import invesalius.constants as const
import invesalius.data.converters as converters
import invesalius.data.vtk_utils as vtku
import invesalius.reader.bitmap_reader as bitmap_reader
import invesalius.utils as utils
import numpy
import wx
from invesalius.gui.widgets.canvas_renderer import CanvasRendererCTX
... |
core | Language | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
api | views_api | #
# Quru Image Server
#
# Document: views_api.py
# Date started: 05 Dec 2011
# By: Matt Fozard
# Purpose: Developer API views (aside from the core public image serving)
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistri... |
extractor | seznamzpravy | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_parse_qs, compat_str, compat_urllib_parse_urlparse
from ..utils import int_or_none, parse_codecs, try_get, urljoin
from .common import InfoExtractor
def _raw_id(src_url):
return compat_urllib_parse_urlparse(src_url).pa... |
rename-extensions | audio_metadata | from __future__ import absolute_import
import os
import string
from gi.repository import Gtk
from sunflower.plugin_base.rename_extension import RenameExtension
try:
import mutagen
USE_MUTAGEN = True
except ImportError:
USE_MUTAGEN = False
class AudioMetadataRename(RenameExtension):
"""Song tags r... |
PyObjCTest | test_nsscriptobjectspecifier | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSScriptObjectSpecifiers(TestCase):
def testConstants(self):
self.assertEqual(NSNoSpecifierError, 0)
self.assertEqual(NSNoTopLevelContainersSpecifierError, 1)
self.assertEqual(NSContainerSpecifierError, 2)
sel... |
Test | TestContentUser | import io
import json
import pytest
from Content.ContentManager import SignError, VerifyError
from Crypt import CryptBitcoin
@pytest.mark.usefixtures("resetSettings")
class TestContentUser:
def testSigners(self, site):
# File info for not existing user file
file_info = site.content_manager.getFil... |
chardet | euctwfreq | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
accounts | HellshareCz | # -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
class HellshareCz(BaseAccount):
__name__ = "HellshareCz"
__type__ = "account"
__version__ = "0.26"
__status__ = "testing"
__description__ = """Hellshare.cz account plugin"""
__license__ = "GPLv3"
__autho... |
addons | ExternalScripts | # -*- coding: utf-8 -*-
import os
import subprocess
from ..base.addon import BaseAddon, expose
class ExternalScripts(BaseAddon):
__name__ = "ExternalScripts"
__type__ = "addon"
__version__ = "0.76"
__status__ = "testing"
__config__ = [
("enabled", "bool", "Activated", True),
("u... |
importers | librarything_import | """ handle reading a tsv from librarything """
import re
from typing import Optional
from bookwyrm.models import Shelf
from . import Importer
def _remove_brackets(value: Optional[str]) -> Optional[str]:
return re.sub(r"\[|\]", "", value) if value else None
class LibrarythingImporter(Importer):
"""csv down... |
oss-installation | usage_stats | import logging
import platform
from dataclasses import asdict, dataclass
import requests
from apps.alerts.models import AlertGroupCounter
from apps.oss_installation.utils import active_oss_users_count
from django.conf import settings
from django.db.models import Sum
USAGE_STATS_URL = "https://stats.grafana.org/oncall... |
borg | patterns | import argparse
import fnmatch
import os.path
import re
import sys
import unicodedata
from collections import namedtuple
from enum import Enum
from .helpers import clean_lines, shellpattern
from .helpers.errors import Error
def parse_patternfile_line(line, roots, ie_commands, fallback):
"""Parse a pattern-file l... |
digital | qa_ofdm_cyclic_prefixer | #!/usr/bin/env python3
#
# Copyright 2007-2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Unit tests for OFDM cyclic prefixer.
"""
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
class test_ofdm_cyclic_prefixer(gr_unittest.... |
migrations | 0282_fix_insight_caching_state_model | # Generated by Django 3.2.15 on 2022-12-01 13:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0281_create_insight_caching_state_model"),
]
operations = [
migrations.RemoveField(
model_name="insightcachingstate",... |
migrations | upgrade38 | """
Migration 38
- Armor hardener tiericide
"""
CONVERSIONS = {
16357: ( # Experimental Enduring EM Armor Hardener I
16353, # Upgraded Armor EM Hardener I
),
16365: ( # Experimental Enduring Explosive Armor Hardener I
16361, # Upgraded Armor Explosive Hardener I
),
16373: ( # ... |
views | group | """group views"""
from bookwyrm import forms, models
from bookwyrm.suggested_users import suggested_users
from django.apps import apps
from django.contrib.auth.decorators import login_required
from django.contrib.postgres.search import TrigramSimilarity
from django.core.paginator import Paginator
from django.db import ... |
lib | merge | # 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, ... |
core | alertmanager | #
# Copyright (C) 2007-2009 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.
#
"""
The AlertManager han... |
renderers | web_renderer | from apps.alerts.incident_appearance.renderers.base_renderer import (
AlertBaseRenderer,
AlertGroupBaseRenderer,
)
from apps.alerts.incident_appearance.templaters import AlertWebTemplater
from common.constants.alert_group_restrictions import (
IS_RESTRICTED_MESSAGE,
IS_RESTRICTED_TITLE,
)
from common.ut... |
accounts | RapidgatorNet | # -*- coding: utf-8 -*-
import json
from ..base.account import BaseAccount
class RapidgatorNet(BaseAccount):
__name__ = "RapidgatorNet"
__type__ = "account"
__version__ = "0.25"
__status__ = "testing"
__description__ = """Rapidgator.net account plugin"""
__license__ = "GPLv3"
__authors_... |
integrations | views | import json
import logging
from apps.alerts.models import AlertReceiveChannel
from apps.heartbeat.tasks import process_heartbeat_task
from apps.integrations.legacy_prefix import has_legacy_prefix
from apps.integrations.mixins import (
AlertChannelDefiningMixin,
BrowsableInstructionMixin,
IntegrationHeartBe... |
userguide | browser | # 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
... |
upload | 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... |
formats | id3 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2009, 2011-2012 Lukáš Lalinský
# Copyright (C) 2008-2011, 2014, 2018-2021, 2023 Philipp Wolfer
# Copyright (C) 2009 Carlin Mangar
# Copyright (C) 2011-2012 Johannes Weißl
# Copyright (C) 2011-2014 Michael Wiencek
# Copyrig... |
events | themeswitcher | # Copyright 2011,2013 Christoph Reiter
# 2016 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later vers... |
KindleUnpack | mobi_dict | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import, division, print_function, unicode_literals
from .compatibility_utils import PY2, PY3, bchr, bstr, utf8_str
if PY2:
range = xrange
array_format = b"B"
if PY3:
unichr = chr... |
classes | copypaste | import itertools
from gaphor.diagram.copypaste import copy
from gaphor.UML import Association, Class, DataType, Enumeration, Interface, Operation
from gaphor.UML.copypaste import copy_named_element
@copy.register(Class)
@copy.register(DataType)
@copy.register(Interface)
def copy_class(element):
yield element.id,... |
Code | Partida | import LCEngine4 as LCEngine
from Code import AperturasStd, ControlPosicion, Jugada, Util, VarGen
OPENING, MIDDLEGAME, ENDGAME, ALLGAME = range(4)
class Partida:
def __init__(self, iniPosicion=None, fen=None):
self.firstComment = ""
if fen:
self.resetFEN(fen)
else:
... |
tools | sphinx_odt2rst | #!/usr/bin/env python3
"""Convert selected OpenOffice documents to reStructuredText and build it into
Dominik Aumayr's Sphinx docs.
Two methods are possible from a Google Drive download:
- html -> rst (using pandoc)
- odt -> rst (using pandoc)
"""
__copyright__ = "Copyright (C) 2017 Martin Blais"
__license__ = "GN... |
wavefile | libsndfile | """
A (currently) limited wrapper around the library libsndfile by Erik Castro de Lopo
http://www.mega-nerd.com/libsndfile/
licensed under the LGPL
(http://www.gnu.org/copyleft/lesser.html)
All sounds formats supported by libsndfile are available and a class interface
is implemented with some helper methods.
Requir... |
writer8 | main | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import absolute_import, division, print_function, unicode_literals
__license__ = "GPL v3"
__copyright__ = "2012, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
import copy
import logging
from collection... |
imageserver | user_auth | #
# Quru Image Server
#
# Document: user_auth.py
# Date started: 10 Aug 2011
# By: Matt Fozard
# Purpose: Image server user authentication module
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it under... |
scripts | update_octoprint | #!/bin/env python
__author__ = "Gina Haeussge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import errno
import sys
import time
import traceback
# defau... |
rules | knowledge_rules_processor | import logging
import queue
import time
from dataclasses import dataclass
from datetime import timedelta
from typing import Optional, Set
import human_readable
from ipv8.taskmanager import TaskManager
from pony.orm import db_session
from tribler.core import notifications
from tribler.core.components.database.db.trible... |
youtube-dl | YoutubeDL | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, unicode_literals
import collections
import copy
import datetime
import errno
import io
import itertools
import json
import locale
import operator
import os
import platform
import random
import re
import shutil
import socket
import subproces... |
mylar | maintenance | # This file is part of Mylar.
# -*- coding: utf-8 -*-
#
# 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 dist... |
tasks | send_license_usage | import posthoganalytics
import requests
from dateutil.relativedelta import relativedelta
from django.utils import timezone
from django.utils.timezone import now
from ee.models.license import License
from posthog.client import sync_execute
from posthog.models import User
from posthog.settings import SITE_URL
def send_... |
extractor | jamendo | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import random
from ..compat import compat_str
from ..utils import clean_html, int_or_none, try_get
from .common import InfoExtractor
class JamendoIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
... |
classes | json_data | """
@file
@brief This file loads and saves settings (as JSON)
@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, LLC
(http://www.openshotstudios.com). This file is part... |
Tux | PersistentToolbars | # Persistent toolbars for FreeCAD.
# Copyright (C) 2016, 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... |
logic | action | # -*- coding: utf-8 -*-
from __future__ import annotations
import datetime
import json
import logging
from typing import Any, Optional
import ckan.plugins.toolkit as tk
import ckanext.activity.email_notifications as email_notifications
from ckan.logic import validate
from ckan.types import ActionResult, Context, Dat... |
crypto | key | import binascii
import hmac
import os
import textwrap
from binascii import a2b_base64, b2a_base64, hexlify
from hashlib import pbkdf2_hmac, sha256
from typing import Callable, ClassVar, Literal
from ..logger import create_logger
logger = create_logger()
import argon2.low_level
from ..constants import * # NOQA
from... |
commands | resume | #
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 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.
#... |
tornado | sessioncontainer | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.sessioncontainer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simple heapq-based session implementation with sliding expiration window
support.
"""
from hashlib import md5
from heapq impor... |
hogql | property | import re
from typing import Any, List, Optional, Union, cast
from posthog.constants import AUTOCAPTURE_EVENT, PropertyOperatorType
from posthog.hogql import ast
from posthog.hogql.base import AST
from posthog.hogql.errors import NotImplementedException
from posthog.hogql.functions import HOGQL_AGGREGATIONS
from posth... |
model | task_status | # encoding: utf-8
from datetime import datetime
from typing import Optional
import ckan.model.domain_object as domain_object
import ckan.model.meta as meta
import ckan.model.types as _types
from sqlalchemy import Column, Table, UniqueConstraint, types
from typing_extensions import Self
__all__ = ["TaskStatus", "task... |
Op | Util | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2021 Schildkroet *
# * ... |
friture | axis | from friture.plotting.coordinateTransform import CoordinateTransform
from friture.plotting.scaleDivision import ScaleDivision
from PyQt5 import QtCore
from PyQt5.QtCore import pyqtProperty, pyqtSlot
class Axis(QtCore.QObject):
name_changed = QtCore.pyqtSignal(str)
def __init__(self, parent=None):
sup... |
xlgui | accelerators | # Copyright (C) 2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it w... |
extractor | kankan | from __future__ import unicode_literals
import hashlib
import re
from .common import InfoExtractor
_md5 = lambda s: hashlib.md5(s.encode("utf-8")).hexdigest()
class KankanIE(InfoExtractor):
_VALID_URL = r"https?://(?:.*?\.)?kankan\.com/.+?/(?P<id>\d+)\.shtml"
_TEST = {
"url": "http://yinyue.kankan... |
PyObjCTest | test_cvdisplaylink | from PyObjCTools.TestSupport import *
from Quartz import *
try:
long
except NameError:
long = int
class TestCVDisplayLink(TestCase):
def testTypes(self):
self.assertIsCFType(CVDisplayLinkRef)
def testFunctions(self):
self.assertIsInstance(CVDisplayLinkGetTypeID(), (int, long))
... |
localDrone | remove | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
from service.market import Market
class GuiRemoveLocalDronesCommand(wx.C... |
plugins | ceskatelevize | """
$description Live TV channels from CT, a Czech public, state-owned broadcaster.
$url ceskatelevize.cz
$type live
$metadata id
$metadata title
$region Czechia
"""
import json
import logging
import re
from urllib.parse import urlparse
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api im... |
extractor | thisvid | # coding: utf-8
from __future__ import unicode_literals
import itertools
import re
from ..compat import compat_urlparse
from ..utils import (
clean_html,
get_element_by_class,
int_or_none,
merge_dicts,
url_or_none,
urljoin,
)
from .common import InfoExtractor
class ThisVidIE(InfoExtractor):
... |
extractor | tele5 | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_urlparse
from ..utils import ExtractorError, extract_attributes
from .dplay import DPlayIE
class Tele5IE(DPlayIE):
_VALID_URL = r"https?://(?:www\.)?tele5\.de/(?:[^/]+/)*(?P<id>[^/?#&]+)"
_GEO_COUNTRIES = ["DE"]
_TESTS = ... |
extractor | youjizz | from __future__ import unicode_literals
import re
from ..utils import determine_ext, int_or_none, parse_duration, url_or_none
from .common import InfoExtractor
class YouJizzIE(InfoExtractor):
_VALID_URL = r"https?://(?:\w+\.)?youjizz\.com/videos/(?:[^/#?]*-(?P<id>\d+)\.html|embed/(?P<embed_id>\d+))"
_TESTS ... |
plugins | migrations | import inspect # noqa: I001
import os
from alembic.config import Config
from alembic.migration import MigrationContext
from alembic.operations import Operations
from alembic.script import ScriptDirectory
from CTFd.utils import _get_config, set_config
from flask import current_app
from sqlalchemy import create_engine
... |
migrations | 0034_delete_unused_models | # Generated by Django 1.11.29 on 2021-03-08 17:03
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("fpr", "0033_update_idtools"),
]
operations = [
migrations.DeleteModel(
name="Agent",
),
migrations.DeleteModel(
... |
lib | get_image_size | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
"""
get_image_size.py
====================
:Name: get_image_size
:Purpose: extract image dimensions given a file path
:Author: Paulo Scardine (based on code from Emmanuel VAÏSSE)
:Created: 26/09/... |
chardet | gb2312prober | ######################## 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... |
draftfunctions | rotate | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
lib | jinja_extensions | # encoding: utf-8
from __future__ import annotations
import logging
import re
from os import path
from typing import Any, Iterable, Optional, Sequence, Union
import ckan.lib.base as base
import ckan.lib.helpers as h
from ckan.common import config
from jinja2 import ext, loaders, nodes
from jinja2.exceptions import Te... |
draftviewproviders | view_circulararray | # ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
tools | imageObject | import os
from math import radians
import AppKit
from drawBot.context.imageContext import _makeBitmapImageRep
from drawBot.misc import DrawBotError, optimizePath
class ImageObject(object):
"""
An image object with support for filters.
Optional a `path` to an existing image can be provided.
For mor... |
migrations | 0333_add_timestamp_fields_to_batch_exports | # Generated by Django 3.2.18 on 2023-06-27 17:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0332_featureflag_has_enriched_analytics"),
]
operations = [
migrations.AddField(
model_name="batchexport",
... |
Material | MaterialEditor | # ***************************************************************************
# * Copyright (c) 2013 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
plugins | pandalive | """
$description South Korean live-streaming platform for individual live streams.
$url pandalive.co.kr
$type live
$metadata author
$metadata title
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
l... |
clientScripts | policy_check | #!/usr/bin/env python
"""Runs zero or more FPR policy check against the provided file and returns an
exit code. May also print to stdout, generate an Event models in the db,
and/or write command-specific stdout to disk.
If a format has no defined policy check commands, no command is run.
Arguments::
[FILE_PATH] ... |
songsmenu | cover_download | # Copyright 2018-2023 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import operator
import os
import ... |
extensions | widget | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
PyObjCTest | test_method_prototypes | """
These tests check if method prototypes match method signatures.
TODO: a separate test file that tests calls with optional arguments in
method defintions:
class MyClass (NSObject):
def myMethod_(self, arg=1):
pass
o = MyClass.alloc().init()
o.myMethod_(2)
... |
utils | cache | import pickle
from time import time
# Imported from cachelib: https://github.com/pallets-eco/cachelib
# As of v0.7.0, commit 4e23926effc41303c9e305663eafa81192442241
# License: BSD 3-Clause, Copyright 2018 Pallets
# BaseSerializer and SimpleSerializer: src/cachelib/serializers.py
# BaseCache and NullCache: src/cachel... |
scripts | inject_test_data | # 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, ... |
default-toolbar | plugin | from __future__ import absolute_import
from gi.repository import Gtk
from sunflower.plugin_base.toolbar_factory import ToolbarFactory
from .bookmark_button import Button as BookmarkButton
from .bookmark_button import ConfigurationDialog as BookmarkButton_Dialog
from .bookmarks_button import Button as BookmarksButton
... |
engrave | lytools | # 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
... |
deluge-blocklist | common | #
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# 2007-2009 Andrew Resch <andrewresch@gmail.com>
# 2009 Damien Churchill <damoxc@gmail.com>
# 2010 Pedro Algarvio <pedro@algarvio.me>
# 2017 Calum Lind <calumlind+delug... |
filemanager | analysis | __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import collections
import copy
import logging
import os
import queue
import threadi... |
image | pil | # Needed on case-insensitive filesystems
from __future__ import absolute_import
# Try to import PIL in either of the two ways it can be installed.
try:
from PIL import Image, ImageDraw
except ImportError: # pragma: no cover
import Image
import ImageDraw
import lib.qrcode.image.base as imgbase
class Pil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.