section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
snippet | snippets | # 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
... |
sabnzbd | emailer | #!/usr/bin/python3 -OO
# Copyright 2007-2023 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... |
migrate | vote_details_ip_backfill | import json
from collections import defaultdict
from datetime import datetime, timedelta
from pylons import app_globals as g
from r2.lib.db.sorts import epoch_seconds
from r2.lib.db.tdb_cassandra import write_consistency_level
from r2.lib.utils import in_chunks
from r2.models.vote import (VoteDetailsByComment, VoteDet... |
widgets | nested_combobox | from typing import Dict, Optional, Tuple
from sglib.lib.translate import _
from sgui.sgqt import QAction, QMenu, QPushButton
class NestedComboBox(QPushButton):
def __init__(
self,
lookup: Dict[str, Tuple[int, Optional[str]]],
tooltip=None,
):
"""
lookup:
A ... |
Code | Apertura | import random
from Code import Books, Partida, Util, VarGen
class EtiApertura:
def __init__(self, nombre, eco, a1h8, pgn):
self.nombre = nombre
self.eco = eco
self.a1h8 = a1h8.split(" ")
self.pgn = pgn
self.liHijos = []
def hijo(self, ea):
self.liHijos.append(... |
plugin-base | find_extension | from gi.repository import Gtk
class FindExtension:
"""Base class for extending find files tool.
Use this class to provide find files tool with additional
options. Objects are created every time tool is created!
"""
def __init__(self, parent, always_on=False):
self._parent = parent
... |
cli | main | # -*- coding: utf-8 -*-
"""
flaskbb.cli.commands
~~~~~~~~~~~~~~~~~~~~
This module contains the main commands.
:copyright: (c) 2016 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import binascii
import logging
import os
import sys
import time
import traceback
from datetime im... |
extractor | noz | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_urllib_parse_unquote, compat_xpath
from ..utils import find_xpath_attr, int_or_none, update_url_query, xpath_text
from .common import InfoExtractor
class NozIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?noz\.de/video/(?P<i... |
gstreamer | compressor | # 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 gi.repository import GObject, ... |
config | terminalfilters | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_attrs_docs
@with_attrs_docs
class Te... |
utils | localization | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import absolute_import
__license__ = "GPL v3"
__copyright__ = "2009, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
import locale
import os
import re
from gettext import GNUTranslations, NullTranslatio... |
posthog | errors | import re
from dataclasses import dataclass
from typing import Dict
from clickhouse_driver.errors import ServerException
from posthog.exceptions import EstimatedQueryExecutionTimeTooLong
class InternalCHQueryError(ServerException):
code_name: str
def __init__(self, message, *, code=None, nested=None, code_n... |
orm-bindings | channel_metadata | import os
from binascii import unhexlify
from datetime import datetime
from lz4.frame import LZ4FrameCompressor
from pony import orm
from pony.orm import db_session, raw_sql, select
from tribler.core.components.libtorrent.utils.libtorrent_helper import libtorrent as lt
from tribler.core.components.metadata_store.db.or... |
plover | config | # Copyright (c) 2010-2011 Joshua Harlan Lifton.
# See LICENSE.txt for details.
"""Configuration management."""
import configparser
import json
import re
from collections import ChainMap, OrderedDict, namedtuple
from plover import log
from plover.exception import InvalidConfigurationError
from plover.machine.keymap i... |
commands | resolve_pending_jobs | """Resolve pending jobs.
This is an interactive command used to resolve processing jobs
awaiting user decisions. It interacts with the workflow engine RPC
interface directly meaning that it can operate independently to the
Archivematica Dashboard or its API.
It impersonates the admin user, or the first match when mul... |
projects | export | #!/usr/bin/env python3
"""List assets and attributes of account and commodities.
This script:
- produces a table of postings for the assets and liabilities,
- produces a table of per-account attributes,
- produces a table of per-commodity attributes,
- joins these tables,
- outputs them to a CSV file.
The upload... |
SQL | DBF | """
Navegacion por una tabla de datos mediante instrucciones tipo xBase.
"""
import collections
import sqlite3
import time
class Almacen:
pass
class DBF:
"""
Permite acceder a una consulta de SQL, con un estilo dBase, haciendo una
lectura inicial completa de los rowids y luego moviendose a traves d... |
drafttaskpanels | task_orthoarray | # ***************************************************************************
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
loaders | strict_https_loader | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from thumbor.loaders import http_loader
def _normalize_url(url):
... |
downloaders | TwoSharedCom | # -*- coding: utf-8 -*-
from ..base.simple_downloader import SimpleDownloader
class TwoSharedCom(SimpleDownloader):
__name__ = "TwoSharedCom"
__type__ = "downloader"
__version__ = "0.19"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?2shared\.com/(account/)?(download|get|file|document|p... |
extractor | viu | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_kwargs, compat_str
from ..utils import ExtractorError, int_or_none
from .common import InfoExtractor
class ViuBaseIE(InfoExtractor):
def _real_initialize(self):
viu_auth_res = self._request_webpage(
... |
builtinContextMenus | moduleFill | import gui.fitCommands as cmd
import gui.mainFrame
import wx
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
_t = wx.GetTranslation
class FillWithModule(ContextMenuSingle):
visibilitySetting = "moduleFill"
def __init__(self):
self.mainFrame = gui.mainFrame.MainFrame.getInst... |
formats | midi | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2018, 2020-2022 Philipp Wolfer
# Copyright (C) 2020-2021 Laurent Monin
#
# 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 S... |
qltk | tracknumbers | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# 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 ... |
deposit | forms | # -*- 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... |
misc | sql | # SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Provides access to sqlite databases."""
import collections
import contextlib
import dataclasses
import enum
import types
from typing import (
Any,
Dict,
Iterator,
List,
Mapping,... |
queries | event_query | from typing import Dict, List, Optional, Tuple, Union
from ee.clickhouse.materialized_columns.columns import ColumnName
from ee.clickhouse.queries.column_optimizer import EnterpriseColumnOptimizer
from ee.clickhouse.queries.groups_join_query import GroupsJoinQuery
from posthog.models.filters.filter import Filter
from ... |
protos | pipeline_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/pipeline.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pb2
from google.protobuf ... |
utils | spoolSupport | # ===============================================================================
# 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, ... |
canto-curses | taglist | # -*- coding: utf-8 -*-
# Canto-curses - ncurses RSS reader
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import curses... |
config | configfiles | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Configuration files residing on disk."""
import configparser
import contextlib
import enum
import os.path
import pathlib
import re
import sys
import textwrap
import traceback
import types
fr... |
qltk | information | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2016-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 License, or
# (at yo... |
core | Messages | # Copyright 2007, 2015 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import sys
import traceback
# A list of functions that can receive a message.
MESSENGERS_LIST = list()
_indent = ""
# Global FlowGraph Error and the file that caused it
flowgraph_e... |
neubot | system_posix | # neubot/system_posix.py
#
# Copyright (c) 2010-2011
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms o... |
isso | migrate | # -*- encoding: utf-8 -*-
import functools
import io
import json
import logging
import os
import re
import sys
import textwrap
from collections import defaultdict
from time import mktime, strptime, time
from urllib.parse import urlparse
from xml.etree import ElementTree
from isso.utils import anonymize
logger = logg... |
views | person | from typing import Dict, List, Optional, Tuple
from ee.clickhouse.queries.funnels.funnel_correlation_persons import (
FunnelCorrelationActors,
)
from posthog.api.person import PersonViewSet
from posthog.constants import (
FUNNEL_CORRELATION_PERSON_LIMIT,
FUNNEL_CORRELATION_PERSON_OFFSET,
INSIGHT_FUNNEL... |
puddlestuff | audio_filter | # -*- coding: utf-8 -*-
import logging
import re
from pyparsing import *
from . import audioinfo, findfunc
from .puddleobjects import gettaglist
from .util import to_string
def str_cmp(a, b):
if not isinstance(a, str):
a = "\\".join(a)
if not isinstance(b, str):
b = "\\".join(b)
return... |
draftfunctions | downgrade | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
extractor | hotstar | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import hmac
import json
import re
import time
import uuid
from ..compat import compat_HTTPError, compat_str
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
str_or_none,
try_get,
url_or_none,
)
from .common... |
accounts | FastshareCz | # -*- coding: utf-8 -*-
import re
import time
from ..base.account import BaseAccount
from ..helpers import set_cookie
class FastshareCz(BaseAccount):
__name__ = "FastshareCz"
__type__ = "account"
__version__ = "0.18"
__status__ = "testing"
__description__ = """Fastshare.cz account plugin"""
... |
backfill | gilded_user_comments | # 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, ... |
landing | register | """ class views for login/register views """
import pytz
from bookwyrm import emailing, forms, models
from bookwyrm.settings import DOMAIN
from django.contrib.auth import login
from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404, redirect
from django.template.response impo... |
core | rpcserver | #
# Copyright (C) 2008,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.
#
"""RPCServer Module"""
im... |
sunflower | mounts | from __future__ import absolute_import
from gi.repository import Gio, GLib, Gtk, Pango
from sunflower.gui.mounts_manager_window import MountsManagerWindow
from sunflower.widgets.location_menu import GenericHeader, Location
class MountsManager:
"""Class used for monitoring and managing mounts menu"""
def __i... |
webengine | certificateerror | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Wrapper over a QWebEngineCertificateError."""
from typing import Any
from qutebrowser.qt import machinery
from qutebrowser.qt.core import QUrl
from qutebrowser.qt.webenginecore import QWebE... |
OLD | patrec | import random as pyrandom
from collections import Counter
import improc
import mlinear
from pylab import *
from scipy.ndimage import filters, interpolation
from toplevel import *
if 0:
from scipy.spatial.distance import cdist
else:
from ocrolib.distance import cdist
sidenote = "\t\t\t\t\t"
def method(cls):
... |
addons | DiscordNotifier | # -*- coding: utf-8 -*-
from pyload.core.network.request_factory import get_request
from ..base.notifier import Notifier
class DiscordNotifier(Notifier):
__name__ = "DiscordNotifier"
__type__ = "addon"
__version__ = "0.11"
__status__ = "testing"
__config__ = [
("enabled", "bool", "Activ... |
migrations | 0236_add_instance_setting_model | # Generated by Django 3.2.12 on 2022-05-18 12:39
import json
import logging
import pickle
from base64 import b64decode
from django.db import connection, migrations, models, utils
logger = logging.getLogger(__name__)
def populate_instance_settings(apps, schema_editor):
try:
InstanceSetting = apps.get_mo... |
localDrone | stacksMerge | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localChangeAmount import (
CalcChangeLocalDroneAmountCommand,
)
from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand
from gui.fitCommands.helpers import InternalCommandHistory
fr... |
you-get | extractor | #!/usr/bin/env python
import os
import sys
from . import json_output
from .common import (
download_urls,
dry_run,
get_content,
get_filename,
match1,
maybe_print,
parse_host,
player,
)
from .common import print_more_compatible as print
from .common import set_proxy, unset_proxy
from .u... |
ocrolib | lstm | # An implementation of LSTM networks, CTC alignment, and related classes.
#
# This code operates on sequences of vectors as inputs, and either outputs
# sequences of vectors, or symbol sequences. Sequences of vectors are
# represented as 2D arrays, with rows representing vectors at different
# time steps.
#
# The code ... |
implant | remove | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.implant.remove import CalcRemoveImplantCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
from service.market import Market
class GuiRemoveImplantsCommand(wx.Command):
... |
src | multiqueue | """
A queue with multiple internal subqueues.
Elements are added into a random subqueue, and retrieval rotates
"""
from collections import deque
from six.moves import queue
try:
import helper_random
except ImportError:
from . import helper_random
class MultiQueue(queue.Queue):
"""A base queue class"""
... |
extractor | indavideo | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import int_or_none, parse_age_limit, parse_iso8601, update_url_query
from .common import InfoExtractor
class IndavideoEmbedIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:embed\.)?indavideo\.hu/player... |
puddlestuff | puddletag | import logging
import os
import platform
import sys
import traceback
import urllib.parse
from collections import defaultdict
from errno import EEXIST
from functools import partial
from operator import itemgetter
from PyQt5.QtCore import QDir, QSettings, QUrl, pyqtRemoveInputHook, pyqtSignal
from PyQt5.QtGui import QDe... |
extractor | screencastomatic | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
get_element_by_class,
int_or_none,
remove_start,
strip_or_none,
unified_strdate,
)
from .common import InfoExtractor
class ScreencastOMaticIE(InfoExtractor):
_VALID_URL = r"https?://screencast-o-matic\.com/(?:(?:wat... |
heartbeat | legacy_alertmanager | from pathlib import PurePath
from apps.integrations.metadata.heartbeat._heartbeat_text_creator import (
HeartBeatTextCreatorForTitleGrouping,
)
integration_verbal = PurePath(__file__).stem
creator = HeartBeatTextCreatorForTitleGrouping(integration_verbal)
heartbeat_text = creator.get_heartbeat_texts()
heartbeat_... |
administration | views | # This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the ... |
benchmarks | helpers | import os
import sys
from contextlib import contextmanager
from functools import wraps
from os.path import dirname
from django.utils.timezone import now
os.environ["POSTHOG_DB_NAME"] = "posthog_test"
os.environ["DJANGO_SETTINGS_MODULE"] = "posthog.settings"
sys.path.append(dirname(dirname(dirname(__file__))))
import... |
uhd | replaymsgpushbutton | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2023 Ettus Research, a National Instruments Brand.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import pmt
from gnuradio import gr
from PyQt5 import Qt
class ReplayMsgPushButton(gr.sync_block, Qt.QPushButton):
"""
This block creates a variable ... |
core | preferencesmanager | #
# Copyright (C) 2008-2010 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... |
core | scheduler | # -*- coding: utf-8 -*-
import time
from _thread import start_new_thread
from heapq import heappop, heappush
from threading import Lock
from .utils.struct.lock import lock
class AlreadyCalled(Exception):
pass
class Deferred:
def __init__(self):
self.call = []
self.result = ()
def add_... |
archiver | compact_cmd | import argparse
from ..constants import * # NOQA
from ..helpers import EXIT_SUCCESS
from ..logger import create_logger
from ..manifest import Manifest
from ._common import Highlander, with_repository
logger = create_logger()
class CompactMixIn:
@with_repository(manifest=False, exclusive=True)
def do_compac... |
friture | ringbuffer | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timothée Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distri... |
commands | send_usage_report | from django.core.management.base import BaseCommand
from posthog.tasks.usage_report import send_all_org_usage_reports
class Command(BaseCommand):
help = "Send the usage report for a given day"
def add_arguments(self, parser):
parser.add_argument(
"--dry-run", type=bool, help="Print inform... |
cmd | split | from __future__ import absolute_import, division, print_function
import sys
import time
from binascii import hexlify
from bup import client, compat, git, hashsplit, options
from bup.compat import argv_bytes, environ, nullcontext
from bup.hashsplit import HashSplitter
from bup.helpers import (
add_error,
hostn... |
versions | 060_31ad11c518fc_add_system_info_table | # encoding: utf-8
"""060 Add system info table
Revision ID: 31ad11c518fc
Revises: 9291bb46f352
Create Date: 2018-09-04 18:49:09.587220
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "31ad11c518fc"
d... |
connectors | abstract_connector | """ functionality outline for a book data connector """
from __future__ import annotations
import asyncio
import imghdr
import logging
import re
from abc import ABC, abstractmethod
from typing import Any, Callable, Iterator, Optional, TypedDict, Union
from urllib.parse import quote_plus
import aiohttp
import requests... |
PyObjCTest | test_keyvalue | """
Tests for the Key-Value Coding for hybrid python objects.
NOTE: Testcases here should be synchronized with the Key-Value Coding tests
in PyObjCTools.test.test_keyvalue and objc.test.test_keyvalue.
TODO:
- This test uses C code, that code should be added to this package!
- Tests that access properties in t... |
archiver | extract_cmd | import argparse
import logging
import os
import stat
import sys
from ..archive import BackupError, BackupOSError
from ..constants import * # NOQA
from ..helpers import (
HardLinkManager,
ProgressIndicatorPercent,
archivename_validator,
remove_surrogates,
)
from ..logger import create_logger
from ..man... |
extractor | iwara | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_urllib_parse_urlparse
from ..utils import int_or_none, mimetype2ext, remove_end, url_or_none
from .common import InfoExtractor
class IwaraIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.|ecchi\.)?iwara\.tv/videos/(?P<id>[a-zA-... |
PyObjCTest | test_nsprogressindicator | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSProgressIndicator(TestCase):
def testConstants(self):
self.assertEqual(NSProgressIndicatorPreferredThickness, 14)
self.assertEqual(NSProgressIndicatorPreferredSmallThickness, 10)
self.assertEqual(NSProgressIndicatorPref... |
extractors | qq_egame | import json
import re
from ..common import *
from ..extractors import VideoExtractor
from ..util import log
from ..util.strings import unescape_html
__all__ = ["qq_egame_download"]
def qq_egame_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
uid = re.search("\d\d\d+", url)
an_url = "ht... |
migrations | 0002_person | # Generated by Django 2.2.7 on 2020-01-24 18:38
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0001_initial"),
]
operations = [
migrations.CreateMod... |
models | report | """ flagged for moderation """
from bookwyrm.settings import DOMAIN
from django.core.exceptions import PermissionDenied
from django.db import models
from django.utils.translation import gettext_lazy as _
from .base_model import BookWyrmModel
# Report action enums
COMMENT = "comment"
RESOLVE = "resolve"
REOPEN = "reop... |
utils | test_utils | """Support utilities for testing scripts.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import builtins
import collections
import contextlib
import functools
import io
import os
import re
import shutil
import sys
import tempfile
import textwrap
import unittest
from os import pat... |
widgets | channelsmenulistwidget | from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QBrush, QColor, QIcon, QPixmap
from PyQt5.QtWidgets import (
QAbstractItemView,
QAbstractScrollArea,
QAction,
QListWidget,
QListWidgetItem,
)
from tribler.core.components.metadata_store.db.serialization import CHANNEL_TORRENT
from tribler.co... |
upload | views | # -*- 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... |
wiki | actions | from __future__ import annotations
from typing import Any, cast
from abilian.sbe.apps.communities.actions import CommunityEndpoint
from abilian.sbe.apps.communities.security import is_manager
from abilian.services import get_service
from abilian.services.security import Admin, SecurityService
from abilian.web.action ... |
update | update_engine_descriptions | #!/usr/bin/env python
import json
import sys
from urllib.parse import quote, urlparse
import detect_language
import searx
import searx.poolrequests
import searx.search
from lxml.html import fromstring
from searx.engines.wikidata import send_wikidata_query
from searx.utils import extract_text
SPARQL_WIKIPEDIA_ARTICLE... |
misc | dmg_settings | import os.path
import plistlib
# dmgbuild -s settings.py -D app=QuodLibet.app "Quod Libet" QuodLibet.dmg
application = defines["app"]
appname = os.path.basename(application)
def icon_from_app(app_path):
plist_path = os.path.join(app_path, "Contents", "Info.plist")
with open(plist_path, "rb") as h:
p... |
api | tagged_item | from django.db.models import Prefetch, Q, QuerySet
from posthog.api.routing import StructuredViewSetMixin
from posthog.constants import AvailableFeature
from posthog.models import Tag, TaggedItem, User
from posthog.models.tag import tagify
from rest_framework import response, serializers, status, viewsets
from rest_fra... |
PyObjCTest | test_nsfilecoordinator | import Foundation
from PyObjCTools.TestSupport import *
class TestSFileCoordinator(TestCase):
@min_os_level("10.7")
def testConstants(self):
self.assertEqual(Foundation.NSFileCoordinatorReadingWithoutChanges, 1 << 0)
self.assertEqual(
Foundation.NSFileCoordinatorReadingResolvesSymb... |
femexamples | rc_wall_2d | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com *
# * *
# * Th... |
PyObjCTest | test_cgeventtypes | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
class TestCGEventTypes(TestCase):
def testTypes(self):
self.assertIsCFType(CGEventRef)
self.assertIsCFType(CGEventSourceRef)
def testConstants(self):
self.assertEqual(kCGMouseButtonLeft, 0)
self.assertEqua... |
object-detection | trainer_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... |
misc | ipc | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utilities for IPC with existing instances."""
import binascii
import getpass
import hashlib
import json
import os
import time
from typing import Optional
import qutebrowser
from qutebrowser... |
sabnzbd | database | #!/usr/bin/python3 -OO
# Copyright 2007-2023 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... |
clientScripts | verify_and_restructure_transfer_bag | #!/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... |
uhd | qa_uhd | #!/usr/bin/env python
#
# Copyright 2005,2008,2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
"""
gr-uhd sanity checking
"""
from gnuradio import gr, gr_unittest, uhd
class test_uhd(gr_unittest.TestCase):
def setUp(self):
self.tb = gr... |
simplejson | decoder | """Implementation of JSONDecoder
"""
import re
import struct
import sys
from scanner import make_scanner
def _import_c_scanstring():
try:
from simplejson._speedups import scanstring
return scanstring
except ImportError:
return None
c_scanstring = _import_c_scanstring()
__all__ = [... |
filters | round_corner | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from thumbor.ext.filters import _round_corner
from thumbor.filters i... |
extractor | kickstarter | # coding: utf-8
from __future__ import unicode_literals
from ..utils import smuggle_url
from .common import InfoExtractor
class KickStarterIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?kickstarter\.com/projects/(?P<id>[^/]*)/.*"
_TESTS = [
{
"url": "https://www.kickstarter.com/proj... |
scripts | check_shortcut_keys | #!/usr/bin/env python3
#
# This script checks for duplicate shortcut keys in all translation files.
#
import collections
import os
import sys
from typing import Optional
COLOR_WARNING = "\033[93m"
COLOR_ENDC = "\033[0m"
regex_patter = (
"(&[\w])" # "&[a-zA-Z0-9]" - Search char '&' and at least one character afte... |
workflows | postgres_batch_export | import contextlib
import datetime as dt
import json
from dataclasses import dataclass
import psycopg2
from django.conf import settings
from posthog.batch_exports.service import PostgresBatchExportInputs
from posthog.temporal.workflows.base import PostHogWorkflow
from posthog.temporal.workflows.batch_exports import (
... |
addons | WindowsPhoneNotify | # -*- coding: utf-8 -*-
import http.client
from contextlib import closing
from ..base.notifier import Notifier
class WindowsPhoneNotify(Notifier):
__name__ = "WindowsPhoneNotify"
__type__ = "addon"
__version__ = "0.19"
__status__ = "testing"
__config__ = [
("enabled", "bool", "Activated... |
scripts | KineticNCBeamicon2_post | # ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
torrent-checker | tracker_manager | import logging
import time
from pathlib import Path
from pony.orm import count, db_session
from tribler.core.components.metadata_store.db.store import MetadataStore
from tribler.core.utilities.tracker_utils import get_uniformed_tracker_url
MAX_TRACKER_FAILURES = 5 # if a tracker fails this amount of times in a row, ... |
archiver | debug_cmd | import argparse
import functools
import json
import textwrap
from binascii import hexlify, unhexlify
from ..archive import Archive
from ..compress import CompressionSpec
from ..constants import * # NOQA
from ..helpers import (
StableDict,
archivename_validator,
bin_to_hex,
dash_open,
msgpack,
... |
fixtures | groups | # -*- coding: utf-8 -*-
"""
flaskbb.fixtures.groups
~~~~~~~~~~~~~~~~~~~~~~~
The fixtures module for our groups.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from collections import OrderedDict
fixture = OrderedDict(
(
(
"Admin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.