section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
cli | archivebox_list | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox list"
import argparse
import sys
from typing import IO, List, Optional
from ..config import OUTPUT_DIR
from ..index import (
LINK_FILTERS,
get_archived_folders,
get_corrupted_folders,
get_duplicate_folders,
get_indexe... |
AttachmentEditor | Commands | # ***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
tools | db_explorer | #!/usr/bin/env python3
#
# Copyright (C) 2016 Dustin Spicuzza
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is dis... |
common | PySignal | # https://github.com/dgovil/PySignal
__author__ = "Dhruv Govil"
__copyright__ = "Copyright 2016, Dhruv Govil"
__credits__ = [
"Dhruv Govil",
"John Hood",
"Jason Viloria",
"Adric Worley",
"Alex Widener",
]
__license__ = "MIT"
__version__ = "1.1.3"
__maintainer__ = "Dhruv Govil"
__email__ = "dhruvago... |
plover-build-utils | check_requirements | #!/usr/bin/env python3
from collections import OrderedDict
import pkg_resources
from plover.registry import Registry
def sorted_requirements(requirements):
return sorted(requirements, key=lambda r: str(r).lower())
# Find all available distributions.
all_requirements = [dist.as_requirement() for dist in pkg_re... |
mp-sched | run_synthetic | #!/usr/bin/env python
#
# Copyright 2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Run synthetic.py for npipes in [1,16], nstages in [1,16]
"""
import os
import re
import sys
import tempfile
from argparse import ArgumentParser
def write_s... |
cli | archivebox_server | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox server"
import argparse
import sys
from typing import IO, List, Optional
from ..config import BIND_ADDR, OUTPUT_DIR
from ..logging_util import SmartFormatter, reject_stdin
from ..main import server
from ..util import docstring
@docstri... |
utilities | sentinels | """
Copy-pasted from https://github.com/taleinat/python-stdlib-sentinels
(PEP0661 is probably going to be accepted for python 3.9 or later)
Usage examples:
sent1 = sentinel('sent1')
sent2 = sentinel('sent2', repr='test_sentinels.sent2')
"""
import sys as _sys
from typing import Optional
__all__ = ["sentinel"]
def ... |
extractors | mgtv | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import re
import time
import uuid
from json import loads
from os.path import dirname
from urllib.parse import urlsplit
from ..common import *
from ..extractor import VideoExtractor
class MGTV(VideoExtractor):
name = "芒果 (MGTV)"
# Last updated: 201... |
cmd | fuse | from __future__ import absolute_import, print_function
import errno
import os
import sys
try:
import fuse
except ImportError:
print(
'error: cannot find the python "fuse" module; please install it',
file=sys.stderr,
)
sys.exit(2)
if not hasattr(fuse, "__version__"):
if hasattr(fuse... |
extractor | nzz | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import extract_attributes
from .common import InfoExtractor
class NZZIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?nzz\.ch/(?:[^/]+/)*[^/?#]+-ld\.(?P<id>\d+)"
_TESTS = [
{
"url": "http://www.nzz.ch/zuer... |
migrations | 0125_alter_user_preferred_language | # Generated by Django 3.2.10 on 2022-01-09 01:06
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0124_auto_20220106_1759"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_la... |
devtools | emulation | # DO NOT EDIT THIS FILE!
#
# This file is generated from the CDP specification. If you need to make
# changes, edit the generator and regenerate all modules.
#
# CDP version: v0.0.1156692
# CDP domain: Emulation
from __future__ import annotations
import enum # noqa
import typing
from dataclasses import dataclass # ... |
mako | lexer | # mako/lexer.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""provides the Lexer class for parsing template strings into parse trees."""
import codecs
import ... |
downloaders | SimplydebridCom | # -*- coding: utf-8 -*-
from datetime import timedelta
from ..base.multi_downloader import MultiDownloader
from ..helpers import replace_patterns
class SimplydebridCom(MultiDownloader):
__name__ = "SimplydebridCom"
__type__ = "downloader"
__version__ = "0.27"
__status__ = "testing"
__pattern__ ... |
accounts | RealdebridCom | # -*- coding: utf-8 -*-
import json
import time
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_account import MultiAccount
def args(**kwargs):
return kwargs
class RealdebridCom(MultiAccount):
__name__ = "RealdebridCom"
__type__ = "account"
__version__ = "... |
QT | WCapturas | DIVISOR = 12
from Code import VarGen
from Code.QT import Colocacion, QTUtil
from PyQt4 import QtCore, QtGui
class CapturaLista(QtGui.QWidget):
def __init__(self, wParent, tablero):
super(CapturaLista, self).__init__(wParent)
anchoPZ = int(tablero.ancho / DIVISOR)
self.setFixedWidth(table... |
views | user | # encoding: utf-8
from __future__ import annotations
import logging
from typing import Any, Optional, Union
import ckan.lib.authenticator as authenticator
import ckan.lib.base as base
import ckan.lib.captcha as captcha
import ckan.lib.helpers as h
import ckan.lib.mailer as mailer
import ckan.lib.maintain as maintain
... |
gtkui | model | # -*- 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... |
admin | imports | """ manage imports """
from bookwyrm import models
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.views.helpers import redirect_to_referer
from django.contrib.auth.decorators import login_required, permission_required
from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, r... |
gui | DrawingArea | """
Copyright 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
from gi.repository import Gdk, Gtk
from . import Actions, Constants
from .canvas.colors import FLOWGRAPH_BACKGROUND_COLOR
class DrawingArea(Gtk.DrawingArea):
"""
... |
gui | historypopup | # This file is part of MyPaint.
# Copyright (C) 2009-2013 by Martin Renold <martinxyz@gmx.ch>
# Copyright (C) 2010-2018 by the MyPaint Development Team.
#
# 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 Fou... |
python | audio_copy | #!/usr/bin/env python
#
# Copyright 2004,2005,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from argparse import ArgumentParser
from gnuradio import audio, gr
from gnuradio.eng_arg import eng_float
class my_top_block(gr.top_block):
def _... |
scripting | clipboard_qt | """
QtClipboard Functions
"""
import threading
from pathlib import Path
from PyQt5.QtGui import QClipboard, QImage
from PyQt5.QtWidgets import QApplication
class QtClipboard:
"""
Read/write access to the X selection and clipboard - QT version
"""
def __init__(self, app):
"""
Initial... |
streamlink-cli | console | import sys
from getpass import getpass
from json import dumps
from typing import Any, Dict, List, Optional, TextIO, Union
from streamlink.user_input import UserInputRequester
from streamlink_cli.utils import JSONEncoder
class ConsoleUserInputRequester(UserInputRequester):
"""
Request input from the user on t... |
ui | countries | #
# This file is public domain.
#
# ISO 3166-1 country names and codes
COUNTRIES = {
"AF": _("Afghanistan"),
"AX": _("Aland Islands"),
"AL": _("Albania"),
"DZ": _("Algeria"),
"AS": _("American Samoa"),
"AD": _("Andorra"),
"AO": _("Angola"),
"AI": _("Anguilla"),
"AQ": _("Antarctica")... |
CTFd | teams | from CTFd.cache import clear_team_session, clear_user_session
from CTFd.exceptions import TeamTokenExpiredException, TeamTokenInvalidException
from CTFd.models import TeamFieldEntries, TeamFields, Teams, db
from CTFd.utils import config, get_config, validators
from CTFd.utils.crypto import verify_password
from CTFd.uti... |
portmidi | ctypes_pypm | # This module provides the same api via ctypes as John Harrison's pyrex-based
# PortMIDI binding.
# Don't use this module directly but via the toplevel API of this package.
# Copyright (c) 2011 - 2014 by Wilbert Berendsen, placed in the public domain.
import array
from ctypes import byref, create_string_buffer
from .... |
builtinContextMenus | factorReload | # noinspection PyPackageRequirements
import gui.globalEvents as GE
import gui.mainFrame
import wx
from gui.contextMenu import ContextMenuUnconditional
from service.fit import Fit
_t = wx.GetTranslation
class FactorReload(ContextMenuUnconditional):
def __init__(self):
self.mainFrame = gui.mainFrame.MainF... |
core | account_test | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import types
import unittest
try:
from beancount.core import account
except ImportError:
from beancount.ccore import _core as account
from beancount.utils import test_utils
class TestAccount(unittest.TestCase):
def test_i... |
states | pseudostates | """Pseudostate diagram items.
See also gaphor.UML.states package description.
"""
from gaphas.item import SE
from gaphor import UML
from gaphor.core.modeling.properties import relation_one
from gaphor.diagram.presentation import ElementPresentation, Named
from gaphor.diagram.shapes import Box, IconBox, Text, ellipse,... |
migrations | 0004_replicated_schema | from typing import Optional, cast
import structlog
from django.conf import settings
from posthog.async_migrations.definition import AsyncMigrationDefinition
from posthog.client import sync_execute
logger = structlog.get_logger(__name__)
"""
Migration summary:
Schema change to migrate tables to support replication a... |
util | dbusutils | # Copyright 2012, 2013 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 xml.etree.ElementTree ... |
downloaders | WetransferCom | # -*- coding: utf-8 -*-
import json
import re
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.simple_downloader import SimpleDownloader
class WetransferCom(SimpleDownloader):
__name__ = "WetransferCom"
__type__ = "downloader"
__version__ = "0.01"
__status__ = "te... |
saveddata | fighter | # ===============================================================================
# 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, ... |
core | inventory_test | """
Unit tests for the Inventory class.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import copy
import datetime
import unittest
from datetime import date
from beancount.core import amount, convert, position
from beancount.core.amount import A
from beancount.core.number import... |
extractor | xstream | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
find_xpath_attr,
int_or_none,
parse_iso8601,
xpath_text,
xpath_with_ns,
)
from .common import InfoExtractor
class XstreamIE(InfoExtractor):
_VALID_URL = r"""(?x)
(?:
... |
core | base | #
# Copyright 2013, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Base class for the modules """
import glob
import itertools
import logging
import os
import re
from types import SimpleNamespace
from gnuradio import gr
from ..tools impor... |
interactions | message | """Sequence and communication diagram messages.
Messages are implemented according to UML 2.1.1 specification.
Implementation Details
======================
Message sort is supported but occurrence specification is not implemented.
This means that model drawn on a diagram is not complete on UML datamodel
level, still... |
beetsplug | bpm | # This file is part of beets.
# Copyright 2016, aroquen
#
# 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, ... |
network | connectionpool | """
`BMConnectionPool` class definition
"""
import errno
import logging
import re
import socket
import sys
import time
import asyncore_pollchoose as asyncore
import helper_random
import knownnodes
import protocol
import state
from bmconfigparser import config
from connectionchooser import chooseConnection
from node im... |
src | ExportFileJob | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import re # Filtering out invalid characters.
from typing import List, Optional
from cura.CuraApplication import CuraApplication
from UM.FileHandler.FileHandler import FileHandler
from UM.FileHandler.WriteFileJob import W... |
resources | notification_rules | import copy
from migrator import oncall_api_client
from migrator.config import PAGERDUTY_TO_ONCALL_CONTACT_METHOD_MAP
from migrator.utils import remove_duplicates, transform_wait_delay
def remove_duplicate_rules_between_waits(rules: list[dict]) -> list[dict]:
"""
Remove duplicate rules in chunks between wait... |
sunflower | icons | from __future__ import absolute_import
import os
import sys
import zipfile
from builtins import filter
from gi.repository import GdkPixbuf, Gio, GLib, Gtk
from sunflower.common import (
UserDirectory,
get_static_assets_directory,
get_user_directory,
)
class IconManager:
"""Icon manager class provide... |
femexamples | truss_3d_cs_circle_ele_seg3 | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
PathTests | TestRefactoredLinuxCNCPost | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2022 Larry Woestman <LarryWoestman2@gmail.com> *
# * ... |
core | box_list | # 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... |
Draft | DraftTools | # -*- coding: utf8 -*-
# ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * ... |
engines | deezer | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Deezer (Music)
"""
from json import loads
from urllib.parse import urlencode
# about
about = {
"website": "https://deezer.com",
"wikidata_id": "Q602243",
"official_api_documentation": "https://developers.deezer.com/",
"use_official_api": True,
"req... |
extractor | watchindianporn | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import parse_duration
from .common import InfoExtractor
class WatchIndianPornIE(InfoExtractor):
IE_DESC = "Watch Indian Porn"
_VALID_URL = r"https?://(?:www\.)?watchindianporn\.net/(?:[^/]+/)*video/(?P<display_id>[^/]+)-(?P<id>[a... |
File | FileServer | import logging
import random
import socket
import sys
import time
import gevent
import gevent.pool
import util
from Config import config
from Connection import ConnectionServer
from Debug import Debug
from gevent.server import StreamServer
from Peer import PeerPortchecker
from Plugin import PluginManager
from Site imp... |
filter | qa_fractional_resampler | #!/usr/bin/env python
#
# Copyright 2007,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
from gnuradio import blocks, filter, gr, gr_unittest
def sig_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_rate for x... |
extractors | baomihua | #!/usr/bin/env python
__all__ = ["baomihua_download", "baomihua_download_by_id"]
import urllib
from ..common import *
def baomihua_headers(referer=None, cookie=None):
# a reasonable UA
ua = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/53... |
local | release_snap | #!/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... |
plotting | titleWidget | from PyQt5 import QtCore, QtGui, QtWidgets
# a widget for the axis title, can be horizontal or vertical
class VerticalTitleWidget(QtWidgets.QWidget):
def __init__(self, title, parent):
super(VerticalTitleWidget, self).__init__(parent)
self.title = title
# for vertical title
self... |
extractors | funshion | #!/usr/bin/env python
import base64
import binascii
import json
import re
import urllib.parse
from ..common import get_content, playlist_not_supported
from ..extractors import VideoExtractor
from ..util import log
__all__ = ["funshion_download"]
class KBaseMapping:
def __init__(self, base=62):
self.bas... |
models | phone_call | from apps.phone_notifications.phone_provider import ProviderPhoneCall
from django.db import models
class ZvonokCallStatuses:
ATTEMPTS_EXC = 10
COMPL_FINISHED = 20
COMPL_NOFINISHED = 30
DELETED = 40
DURATION_ERROR = 50
EXPIRES = 60
NOVALID_BUTTON = 70
NO_PROVIDER = 80
INTERRUPTED = ... |
daemon | server | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2019-2023 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import logging
import time
from multiprocessing.connection import Client, Listener
from threading import Event, Thr... |
decrypters | MegaCoNzFolder | # -*- coding: utf-8 -*-
from pyload.core.network.cookie_jar import CookieJar
from pyload.core.network.http.http_request import HTTPRequest
from pyload.core.utils.convert import to_str
from ..base.decrypter import BaseDecrypter
from ..downloaders.MegaCoNz import MegaClient, MegaCrypto
class MegaCoNzFolder(BaseDecryp... |
rarfile | rarfile | # rarfile.py
#
# Copyright (c) 2005-2016 Marko Kreen <markokr@gmail.com>
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED... |
audioinfo | _compatid3 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2005 Michael Urman
# Copyright (C) 2006-2008, 2011-2012 Lukáš Lalinský
# Copyright (C) 2013-2014 Sophist-UK
# Copyright (C) 2013-2014, 2018 Laurent Monin
# Copyright (C) 2014, 2018-2020 Philipp Wolfer
# Copyright (C) 2016 Chris... |
Arch | ArchComponent | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
PyObjCTest | test_cgpdfcontentstream | import os
from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
class TestCGPDFContentStream(TestCase):
def testTypes(self):
self.assertIsOpaquePointer(CGPDFContentStreamRef)
def testFunctions(self):
if os.path.exists(
"/Library/Documentation//Applications/iWeb/... |
Chart | ChartPlugin | import itertools
import time
import gevent
from Config import config
from Plugin import PluginManager
from util import helper
from util.Flag import flag
from .ChartCollector import ChartCollector
from .ChartDb import ChartDb
if "db" not in locals().keys(): # Share on reloads
db = ChartDb()
gevent.spawn_late... |
models | personal_api_key | from django.contrib.auth.hashers import get_hasher
from django.db import models
from django.utils import timezone
from .utils import generate_random_token
# A constant salt is not nearly as good as user-specific, but we must be able to look up a personal API key
# by itself. Some salt is slightly better than none tho... |
Code | BaseConfig | # -*- coding: utf-8 -*-
import base64
import copy
import operator
import os
from Code import TrListas, Util, VarGen
from Code.Constantes import *
from Code.QT import Iconos, TabTipos
class Grupo:
def __init__(self, nombre, desde, hasta, minPuntos, liRivales):
self.nombre = nombre
self.desde = de... |
engines | redis_server | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Redis engine (Offline)
"""
# pylint: disable=missing-function-docstring
# pylint: disable=import-error
import redis
engine_type = "offline"
# redis connection variables
host = "127.0.0.1"
port = 6379
password = ""
db = 0
# engine specific variables
paging = False
res... |
gigachannel-manager | gigachannel_manager | import asyncio
from asyncio import CancelledError, wait_for
from pathlib import Path
from ipv8.taskmanager import TaskManager, task
from pony.orm import db_session
from tribler.core import notifications
from tribler.core.components.libtorrent.download_manager.download_config import (
DownloadConfig,
)
from tribler... |
PyObjCTest | test_ivar | from __future__ import unicode_literals
import sys
import objc
from PyObjCTest.instanceVariables import ClassWithVariables
from PyObjCTools.TestSupport import *
NSObject = objc.lookUpClass("NSObject")
NSAutoreleasePool = objc.lookUpClass("NSAutoreleasePool")
class Base(object):
def __init__(self, ondel):
... |
migrations | 0256_add_async_deletion_model | # Generated by Django 3.2.14 on 2022-08-16 08:51
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0255_user_prompt_sequence_state"),
]
operations = [
migrations.... |
helpers | progress | import json
import logging
import time
from ..logger import create_logger
logger = create_logger()
class ProgressIndicatorBase:
LOGGER = "borg.output.progress"
JSON_TYPE: str = None
operation_id_counter = 0
@classmethod
def operation_id(cls):
"""Unique number, can be used by receiving ... |
plugin | defaults | # coding:utf-8
# Define no-op plugin methods
def preBuildPage(page, context, data):
"""
Called prior to building a page.
:param page: The page about to be built
:param context: The context for this page (you can modify this, but you must return it)
:param data: The raw body for this page (you can... |
models | credits_model | """
@file
@brief This file contains the credits model, used by the about window
@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-source p... |
network | objectracker | """
Module for tracking objects
"""
import time
from threading import RLock
import network.connectionpool
from network.dandelion import Dandelion
from randomtrackingdict import RandomTrackingDict
haveBloom = False
try:
# pybloomfiltermmap
from pybloomfilter import BloomFilter
haveBloom = True
except Imp... |
extractor | fivemin | from __future__ import unicode_literals
from .common import InfoExtractor
class FiveMinIE(InfoExtractor):
IE_NAME = "5min"
_VALID_URL = r"(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)"
_TESTS = [
{
... |
versions | 039_cca459c76d45_add_expired_id_and_dates | # encoding: utf-8
"""039 Add expired id and_dates
Revision ID: cca459c76d45
Revises: fd6622e3d964
Create Date: 2018-09-04 18:49:02.364964
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "cca459c76d45... |
extractor | tvnoe | # coding: utf-8
from __future__ import unicode_literals
from ..utils import clean_html, get_element_by_class, js_to_json
from .common import InfoExtractor
class TVNoeIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?tvnoe\.cz/video/(?P<id>[0-9]+)"
_TEST = {
"url": "http://www.tvnoe.cz/video/10362"... |
plover | i18n | import gettext
import os
from plover.oslayer.config import CONFIG_DIR, PLATFORM
from plover.oslayer.i18n import get_system_language
from plover.resource import ASSET_SCHEME, resource_filename
def get_language():
# Give priority to LANGUAGE environment variable.
lang = os.environ.get("LANGUAGE")
if lang i... |
kibitzr | app | import code
import logging
import os
import signal
import time
import entrypoints
import psutil
from . import timeline
from .bootstrap import create_boilerplate
from .checker import Checker
from .conf import SettingsParser, settings
from .fetcher import cleanup_fetchers, persistent_firefox
logger = logging.getLogger... |
stats | blueprint | # encoding: utf-8
from __future__ import annotations
from typing import Any
import ckan.lib.helpers as h
import ckanext.stats.stats as stats_lib
from ckan.plugins.toolkit import render
from flask import Blueprint
stats = Blueprint("stats", __name__)
@stats.route("/stats")
def index():
stats = stats_lib.Stats()... |
models | ssd_feature_extractor_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... |
migrations | 0056_transfer_access_system_id | from django.db import migrations, models
def data_migration_up(apps, schema_editor):
MicroServiceChain = apps.get_model("main", "MicroServiceChain")
TaskConfig = apps.get_model("main", "TaskConfig")
MicroServiceChain.objects.filter(description="Upload DIP to AtoM").update(
description="Upload DIP ... |
models | admin_notes | # 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, ... |
src | RandomFileQueue | # MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
# loosely inspired from https://github.com/albertz/PictureSlider/blob/master/PictureSlide... |
extractors | le | #!/usr/bin/env python
__all__ = ["letv_download", "letvcloud_download", "letvcloud_download_by_vu"]
import base64
import hashlib
import random
import urllib
from ..common import *
# @DEPRECATED
def get_timestamp():
tn = random.random()
url = "http://api.letv.com/time?tn={}".format(tn)
result = get_cont... |
Sandbox | exportDRAWEXE | # ***************************************************************************
# * *
# * Copyright (c) 2014 Sebastian Hoogen <github@sebastianhoogen.de> *
# * *
# * Th... |
action | delete | # encoding: utf-8
"""API functions for deleting data from CKAN."""
from __future__ import annotations
import logging
from typing import Any, Type, Union, cast
import ckan.lib.api_token as api_token
import ckan.lib.jobs as jobs
import ckan.logic
import ckan.logic.action
import ckan.logic.schema
import ckan.plugins as... |
PyObjCTest | test_nsxpcconnection | import Foundation
from PyObjCTools.TestSupport import *
class XPCHelper(Foundation.NSObject):
def remoteObjectProxyWithErrorHandler_(self, a):
pass
def listener_shouldAcceptNewConnection_(self, a, b):
pass
class TestNSXPCConnection(TestCase):
@min_os_level("10.8")
def testConstants1... |
deprecated | news_cleaner | import logging
import os
from typing import Any, Dict, List, Text
import pandas as pd
from dag_factory.components.utils import date_str_to_unixtime, tag_dict_to_dict
from tfx import types
from tfx.components.base import base_component, base_executor, executor_spec
from tfx.types import standard_artifacts
from tfx.type... |
femviewprovider | view_result_mechanical | # ***************************************************************************
# * Copyright (c) 2015 Qingfeng Xia <qingfeng.xia()eng.ox.ac.uk> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
dictionary | rtfcre_dict | # Copyright (c) 2013 Hesky Fisher
# See LICENSE.txt for details.
#
# TODO: Convert non-ascii characters to UTF8
# TODO: What does ^ mean in Eclipse?
# TODO: What does #N mean in Eclipse?
# TODO: convert supported commands from Eclipse
"""Parsing an RTF/CRE dictionary.
RTF/CRE spec:
https://web.archive.org/web/2020101... |
database | migrate | # neubot/database/migrate.py
#
# Copyright (c) 2011 Alessio Palmero Aprosio <alessio@apnetwork.it>
# Universita` degli Studi di Milano
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
#... |
navl | validators | # encoding: utf-8
from typing import Any, Callable, NoReturn
import ckan.lib.navl.dictization_functions as df
from ckan.common import _, config, json
from ckan.types import Context, FlattenDataDict, FlattenErrorDict, FlattenKey, Validator
missing = df.missing
StopOnError = df.StopOnError
Invalid = df.Invalid
def k... |
mylar | process | # 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... |
migrations | 0001_initial | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("statistics", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="AliasPublisher",
fields=[
(
... |
utils | stopwatch | # coding: utf-8
import os
import time
class Stopwatch:
"""
--- on python console ---
import re
from utils.stopwatch import Stopwatch
# measurementor
stpw = Stopwatch("test")
# measurement re.sub
def m_re_sub(t, set_count, executes, texts):
t.reset()
while set_count:
... |
helpers | yes_no | import json
import logging
import os
import os.path
import sys
FALSISH = ("No", "NO", "no", "N", "n", "0")
TRUISH = ("Yes", "YES", "yes", "Y", "y", "1")
DEFAULTISH = ("Default", "DEFAULT", "default", "D", "d", "")
def yes(
msg=None,
false_msg=None,
true_msg=None,
default_msg=None,
retry_msg=None,... |
BOPTools | SplitAPI | # /***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
inference | infer_detections | # 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... |
migrations | 0290_add_dashboard_templates | # Generated by Django 3.2.16 on 2023-01-14 15:25
import django.contrib.postgres.fields
import django.db.models.deletion
import posthog.models.utils
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0289_add_tags_to_feature_flags"),
]
op... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.