section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
transport | threaded | """
raven.transport.threaded
~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import atexit
import logging
import os
import threading
from time import sleep, time
from raven.tra... |
deposit | registry | # -*- 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... |
models | bidding | # 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, ... |
gtk3 | pluginmanager | #
# Copyright (C) 2007, 2008 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import logging
import d... |
community | payload | from __future__ import annotations
from ipv8.messaging.lazy_payload import VariablePayload, vp_compile
@vp_compile
class BandwidthTransactionPayload(VariablePayload):
"""
Payload for a message containing a bandwidth transaction.
"""
msg_id = 30
format_list = ["I", "74s", "74s", "64s", "64s", "Q"... |
editing | resub | # 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 re
from gi.repository import GObject, Gtk
from quodlibet import... |
commandFit | add | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.commandFit.add import CalcAddCommandCommand
from gui.fitCommands.helpers import InternalCommandHistory
from service.fit import Fit
class GuiAddCommandFitsCommand(wx.Command):
def __init__(self, fitID, command... |
diagram | shapes | from __future__ import annotations
import math
from dataclasses import replace
from enum import Enum
from math import pi
from typing import Callable
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext, UpdateContext
from gaphor.core.styling import (
JustifyContent,
Style,
Te... |
api-helpers | paginators | import typing
from common.api_helpers.utils import create_engine_url
from rest_framework.pagination import (
BasePagination,
CursorPagination,
PageNumberPagination,
)
from rest_framework.response import Response
PaginatedData = typing.List[typing.Any]
class BasePaginatedResponseData(typing.TypedDict):
... |
aliceVision | PanoramaCompositing | __version__ = "2.0"
import json
import os
from meshroom.core import desc
class PanoramaCompositing(desc.AVCommandLineNode):
commandLine = "aliceVision_panoramaCompositing {allParams}"
size = desc.DynamicNodeSize("input")
parallelization = desc.Parallelization(blockSize=5)
commandLineRange = "--range... |
Gui | TagPreferences | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
PyObjCTest | test_nsdocumentcontroller | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSDocumentController(TestCase):
def testMethods(self):
self.assertArgIsBOOL(
NSDocumentController.openUntitledDocumentAndDisplay_error_, 0
)
self.assertArgIsOut(
NSDocumentController.openUntitledDo... |
downloaders | DdownloadCom | # -*- coding: utf-8 -*-
import json
import pycurl
from ..base.xfs_downloader import XFSDownloader
class DdownloadCom(XFSDownloader):
__name__ = "DdownloadCom"
__type__ = "downloader"
__version__ = "0.11"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?(?:ddl\.to|ddownload\.com)/(?P<I... |
Settings | cura_empty_instance_containers | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import copy
from UM.i18n import i18nCatalog
from UM.Settings.constant_instance_containers import EMPTY_CONTAINER_ID, empty_container
catalog = i18nCatalog("cura")
# Empty definition changes
EMPTY_DEFINITION_CHANGES_CONT... |
cli | profile | # encoding: utf-8
import re
import traceback
import click
from . import error_shout
@click.group(
short_help="Code speed profiler.",
invoke_without_command=True,
)
@click.pass_context
def profile(ctx: click.Context):
"""Provide a ckan url and it will make the request and record how
long each functi... |
exaile | exaile | # Copyright (C) 2008-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... |
options | advanced | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007 Lukáš Lalinský
# Copyright (C) 2013-2015, 2018, 2020-2021 Laurent Monin
# Copyright (C) 2014, 2019-2022 Philipp Wolfer
# Copyright (C) 2016-2017 Sambhav Kothari
#
# This program is free software; you can redistribute ... |
Scripts | wmEnable | #!/usr/bin/pythonw
"""
This is an evil undocumented SPI hack that shows how to enable GUI operation
from a console application.
BUNDLES ARE RECOMMENDED, USE THIS AT YOUR OWN RISK!!
"""
import os
import sys
import objc
from Foundation import *
def S(*args):
return ''.join(args)
OSErr = objc._C_SHT
OUTPSN = 'o^{... |
converter | main | # Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import json
import logging
import os
from codecs import open
from . import block, block_tree
path = os.path
logger = logging.getLogger(__name__)
excludes = [
"qtgui_",
".grc_gnur... |
neubot | background_win32 | # neubot/background_win32.py
#
# Copyright (c) 2012 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# 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 of the GNU General P... |
Arch | ArchPanel | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
benchmarks | benchmarks | # isort: skip_file
# Needs to be first to set up django environment
from .helpers import *
from datetime import timedelta
from typing import List, Tuple
from ee.clickhouse.materialized_columns.analyze import (
backfill_materialized_columns,
get_materialized_columns,
materialize,
)
from ee.clickhouse.queries... |
cli | clean | # encoding: utf-8
import os
from typing import List
import click
import magic
from ckan import logic, model
from ckan.common import config
from ckan.lib.uploader import get_uploader
from ckan.types import Context
@click.group(short_help="Provide commands to clean entities from the database")
@click.help_option("-h"... |
filter | qa_pfb_arb_resampler | #!/usr/bin/env python
#
# Copyright 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, fft, filter, gr, gr_unittest
def sig_source_c(samp_rate, freq, amp, N):
t = [float(x) / samp_rate for x in r... |
fitWarpTime | cache | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
PyObjCTest | test_nsurlhandle | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSURLHandle(TestCase):
def testMethods(self):
self.assertIsInstance(NSHTTPPropertyStatusCodeKey, unicode)
self.assertIsInstance(NSHTTPPropertyStatusReasonKey, unicode)
... |
frescobaldi-app | cursordiff | # 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
... |
LDPC | Generate_LDPC_matrix | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import argparse
from Generate_LDPC_matrix_functions import (
LDPC_matrix,
get_best_matrix,
get_full_rank_H_matrix,
linalg,
write_alist_file,... |
beetsplug | info | # This file is part of beets.
# Copyright 2016, Adrian Sampson.
#
# 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, ... |
extractor | joj | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import int_or_none, js_to_json, try_get
from .common import InfoExtractor
class JojIE(InfoExtractor):
_VALID_URL = r"""(?x)
(?:
joj:|
... |
port | shipstats | from functools import reduce
from eos.saveddata.damagePattern import DamagePattern
from eos.utils.stats import DmgTypes, RRTypes
from gui.utils.numberFormatter import formatAmount
tankTypes = RRTypes.names()
damageTypes = DmgTypes.names()
damagePatterns = [DamagePattern.oneType(damageType) for damageType in damageTyp... |
old | docs | #!/usr/bin/env python3
"""Utility functions to download and convert Google Docs.
"""
__copyright__ = "Copyright (C) 2017 Martin Blais"
__license__ = "GNU GPLv2"
import hashlib
import logging
import os
import pickle
import re
import shelve
import subprocess
from os import path
import httplib2
from oauth2client import... |
Work | Worker | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# A GAE web application to aggregate rss and send it to your kindle.
# Visit https://github.com/cdhigh/KindleEar for the latest version
# Author:
# cdhigh <https://github.com/cdhigh>
# Contributors:
# rexdf <https://github.com/rexdf>
import datetime
import imghdr
import ran... |
chardet | langbulgarianmodel | ######################## 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... |
representatives | user_representative | from apps.slack.scenarios.scenario_step import ScenarioStep
from apps.user_management.user_representative import UserAbstractRepresentative
class UserSlackRepresentative(UserAbstractRepresentative):
def __init__(self, log_record):
self.log_record = log_record
def is_applicable(self):
return (... |
extractor | nova | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
clean_html,
determine_ext,
int_or_none,
js_to_json,
qualities,
unified_strdate,
url_or_none,
)
from .common import InfoExtractor
class NovaEmbedIE(InfoExtractor):
_VALID_URL = r"https?://media\.cm... |
commands | initdb | """ What you need in the database to make it work """
from bookwyrm import models
from django.contrib.auth.models import Group, Permission
from django.contrib.contenttypes.models import ContentType
from django.core.management.base import BaseCommand
def init_groups():
"""permission levels"""
groups = ["admin"... |
utils | memo_test | __copyright__ = "Copyright (C) 2015-2017 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import io
import tempfile
import unittest
from os import path
from unittest import mock
from beancount.utils import memo
class TestMemoization(unittest.TestCase):
def test_memoization_success(self):
functio... |
App | MeshTestsApp | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Jürgen Riegel <juergen.riegel@web.de>
# LGPL
import io
import math
import os
import sys
import tempfile
import time
import unittest
import FreeCAD
import Mesh
import MeshEnums
from FreeCAD import Base
# http://python-kurs.eu/threads.php
try:
... |
draftobjects | fillet | # ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
plugins | commodity_attr | """A plugin that asserts that all Commodity directives have a particular
attribute and that it is part of a set of enum values.
The configuration must be a mapping of attribute name to list of valid values,
like this:
plugin "beancount.plugins.commodity_attr" "{
'sector': ['Technology', 'Financials', 'Energ... |
Arch | Arch | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
ops | find_prices_test | """Tests for price finding routines.
"""
__copyright__ = "Copyright (C) 2015-2016 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import unittest
from beancount import loader
from beancount.ops import find_prices
class TestFromFile(unittest.TestCase):
@loader.load_doc()
def setUp(self, entries, _, ... |
ContentFilter | ContentFilterStorage | import collections
import hashlib
import json
import logging
import os
import time
from Config import config
from Debug import Debug
from Plugin import PluginManager
from util import helper
class ContentFilterStorage(object):
def __init__(self, site_manager):
self.log = logging.getLogger("ContentFilterSt... |
beetsplug | unimported | # This file is part of beets.
# Copyright 2019, Joris Jensen
#
# 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, mod... |
oslayer | controller | import errno
import os
import tempfile
from multiprocessing import connection
from threading import Thread
from plover import log
from plover.oslayer.config import PLATFORM
class Controller:
def __init__(self, instance="plover", authkey=b"plover"):
if PLATFORM == "win":
self._address = r"\\.\... |
conversion | epuboutput | #!/usr/bin/env python
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import with_statement
__license__ = "GPL v3"
__copyright__ = "2009, Kovid Goyal <kovid@kovidgoyal.net>"
__docformat__ = "restructuredtext en"
import os
import re
import zipfile
from calibre.utils.img import rescale_image
block_... |
acoustid | json_helpers | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2018-2020 Philipp Wolfer
# Copyright (C) 2020 Ray Bouchard
# Copyright (C) 2020-2021 Laurent Monin
#
# This program is free software; you can redistribute it and/or
# modify it under the ter... |
utils | file_extension | #!/usr/bin/python3
""" function to check and find correct extension of a (deobfuscated) file
Note: extension always contains a leading dot
"""
import os
import sys
from typing import List, Tuple
import puremagic
import sabnzbd.cfg as cfg
from sabnzbd.filesystem import RAR_RE, get_ext
# common extension from https:... |
papers | name | # -*- 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... |
builtinStatsViews | rechargeViewFull | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
experiments | test_utils | from ee.clickhouse.queries.experiments.utils import requires_flag_warning
from posthog.constants import INSIGHT_FUNNELS
from posthog.models.action.action import Action
from posthog.models.action_step import ActionStep
from posthog.models.filters.filter import Filter
from posthog.test.base import APIBaseTest, Clickhouse... |
PyObjCTest | test_foundation | """
Some simple tests to check that the framework is properly wrapped.
"""
import os
import Foundation
import objc
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestFoundation(TestCase):
def testValues(self):
self.assert_(hasattr(Foundation, "NSTimeIntervalSi... |
api | utils | import json
import re
import socket
import urllib.parse
from enum import Enum, auto
from ipaddress import ip_address
from typing import List, Literal, Optional, Tuple, Union
from uuid import UUID
import structlog
from django.core.exceptions import RequestDataTooBig
from django.db.models import QuerySet
from posthog.co... |
helpers | checks | import os
from ..platformflags import is_win32
from .errors import Error
class PythonLibcTooOld(Error):
"""FATAL: this Python was compiled for a too old (g)libc and misses required functionality."""
def check_python():
if is_win32:
required_funcs = {os.stat}
else:
required_funcs = {os.s... |
invesalius | constants | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
cli | generate | # encoding: utf-8
from __future__ import annotations
import contextlib
import json
import os
import shutil
import string
from typing import Optional
import alembic.command
import ckan
import click
from alembic.config import Config as AlembicConfig
from ckan import logic
from ckan.cli import error_shout
from ckan.cli.... |
Resources | Modules | """
Copyright 2009-2017 Olivier Belanger
This file is part of SoundGrain.
SoundGrain 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.
Sound... |
core | rename | #
# Copyright 2014, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to rename blocks """
import logging
import os
import re
from .base import ModTool, ModToolException, get_block_candidates, validate_name
logger = logging.getLogger(... |
community | popularity_community | from __future__ import annotations
import random
from binascii import unhexlify
from typing import TYPE_CHECKING, List
from ipv8.lazy_community import lazy_wrapper
from pony.orm import db_session
from tribler.core.components.metadata_store.remote_query_community.remote_query_community import (
RemoteQueryCommunit... |
extractor | businessinsider | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from .jwplatform import JWPlatformIE
class BusinessInsiderIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:[^/]+\.)?businessinsider\.(?:com|nl)/(?:[^/]+/)*(?P<id>[^/?#&]+)"
)
_TESTS = [
{
... |
gui | default_tasks | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
misc | crashdialog | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""The dialog which gets shown when qutebrowser crashes."""
import datetime
import enum
import fnmatch
import getpass
import html
import os
import re
import sys
import traceback
from typing imp... |
PyObjCTest | test_bridges | import collections
import sys
import objc
from PyObjCTest.testbndl import OC_TestClass2
from PyObjCTools.TestSupport import *
if sys.version_info[0] == 2:
from UserDict import IterableUserDict
from UserList import UserList
else:
from collections import UserDict as IterableUserDict
from collections im... |
plugins | qq | """
$description Chinese live-streaming platform for live video game broadcasts and live sports game related streams.
$url live.qq.com
$type live
$metadata id
$metadata author
$metadata category
$metadata title
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api... |
extractor | googlepodcasts | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import clean_podcast_url, int_or_none, try_get, urlencode_postdata
from .common import InfoExtractor
class GooglePodcastsBaseIE(InfoExtractor):
_VALID_URL_BASE = r"https?://podcasts\.google\.com/feed/"
def _batch_exe... |
plugins | zhanqi | """
$description Chinese live streaming platform for live video game broadcasts.
$url zhanqi.tv
$type live
"""
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.stream.http import HTTPStre... |
feature-flag | user_blast_radius | from typing import Optional
from posthog.client import sync_execute
from posthog.models.cohort import Cohort
from posthog.models.filters import Filter
from posthog.models.property import GroupTypeIndex
from posthog.models.team.team import Team
from rest_framework.exceptions import ValidationError
def get_user_blast_... |
bittorrent | btsched | # neubot/bittorrent/btsched.py
#
# 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/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General... |
macos | link | #!/usr/bin/env python3
import argparse
import collections
import copy
import glob
import os
import shutil
import subprocess
def parse_args():
parser = argparse.ArgumentParser()
return parser.parse_args()
args = parse_args()
CWD = os.path.abspath(
os.path.join(
os.path.dirname(__file__),
... |
plugins | reddit | # Canto Reddit Plugin
# by Jack Miller
# v1.2
#
# If this is placed in the plugins directory, it will add a new sort:
# reddit_score_sort, and will add "score [subreddit]" to the beginning of
# every relevant feed item.
# PREPEND_SCORE, if true will add the score to the entry title. Note, this
# doesn't effect the sor... |
Generator | dogboneII | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
main | signals | from django.conf import settings
from django.db.models.signals import post_delete, post_save
from django.dispatch import receiver
from main.models import RightsStatement, RightsStatementRightsGranted
from prometheus_client import Counter
@receiver(post_delete, sender=RightsStatementRightsGranted)
def delete_rights_st... |
PyObjCTest | test_cgpdfcontext | import Quartz
from Foundation import NSMutableData
from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
class TestCGPDFContext(TestCase):
@min_os_level("10.7")
def testFunctions10_7(self):
data = NSMutableData.data()
consumer = CGData... |
jobstores | zookeeper | from __future__ import absolute_import
import os
from datetime import datetime
from apscheduler.job import Job
from apscheduler.jobstores.base import BaseJobStore, ConflictingIdError, JobLookupError
from apscheduler.util import (
datetime_to_utc_timestamp,
maybe_ref,
utc_timestamp_to_datetime,
)
from kazo... |
Test | TestDebug | import os
import re
import gevent
import pytest
from Debug import Debug
class TestDebug:
@pytest.mark.parametrize(
"items,expected",
[
(["@/src/A/B/C.py:17"], ["A/B/C.py line 17"]), # basic test
(["@/src/Db/Db.py:17"], ["Db.py line 17"]), # path compression
(... |
Show | DepGraphTools | # /***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
devtools | runtime | # 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: Runtime
from __future__ import annotations
import enum # noqa
import typing
from dataclasses import dataclass # no... |
bandwidth-crawler | run_bandwidth_crawler | """
This executable script starts a Tribler instance and joins the BandwidthAccountingCommunity.
"""
import argparse
import logging
import signal
import sys
from asyncio import ensure_future, get_event_loop
from pathlib import Path
from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import... |
OLD | test_feature_extractor | import ocropy
from ocropy import dbtables
from pylab import *
ocropy.dinit(512, 512)
ion()
show()
# Let's open a character database and read some characters.
table = dbtables.Table("test2.db", "clusters")
table.converter("image", dbtables.SmallImage())
clusters = table.get()
shapes = []
for c in clusters:
# pi... |
httpie | uploads | import functools
import os
import sys
import threading
import zlib
from typing import IO, TYPE_CHECKING, Any, Callable, Iterable, Optional, Tuple, Union
from urllib.parse import urlencode
import requests
from requests.utils import super_len
if TYPE_CHECKING:
from requests_toolbelt import MultipartEncoder
from .c... |
gui | externalapp | # -*- coding: utf-8 -*-
# This file is part of MyPaint.
# Copyright (C) 2014-2019 by the MyPaint Development Team
# Copyright (C) 2014 by Andrew Chadwick <a.t.chadwick@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published ... |
Code | DBgamesFEN | import atexit
import os
import random
import sqlite3
import time
import LCEngine4 as LCEngine
from Code import Partida, Util
posA1 = LCEngine.posA1
a1Pos = LCEngine.a1Pos
pv2xpv = LCEngine.pv2xpv
xpv2pv = LCEngine.xpv2pv
PGNreader = LCEngine.PGNreader
setFen = LCEngine.setFen
makeMove = LCEngine.makeMove
getFen = LCE... |
PyObjCTest | test_nstokenfieldcell | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSTokenFieldCellHelper(NSObject):
def tokenFieldCell_completionsForSubstring_indexOfToken_indexOfSelectedItem_(
self, a, b, c, d
):
return 1
def tokenFieldCell_shouldAddObjects_atIndex_(self, a, b, c):
return 1
... |
gpodder | registry | #
# gpodder.registry - Central hub for exchanging plugin resolvers (2014-03-09)
# Copyright (c) 2014, Thomas Perl <m@thp.io>
#
# 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... |
extractor | vh1 | # coding: utf-8
from __future__ import unicode_literals
from .mtv import MTVServicesInfoExtractor
class VH1IE(MTVServicesInfoExtractor):
IE_NAME = "vh1.com"
_FEED_URL = "http://www.vh1.com/feeds/mrss/"
_TESTS = [
{
"url": "http://www.vh1.com/episodes/0umwpq/hip-hop-squares-kent-jones-... |
gui-process-watcher | gui_process_watcher | import logging
import os
from typing import Callable, Optional
import psutil
from ipv8.taskmanager import TaskManager
GUI_PID_ENV_KEY = "TRIBLER_GUI_PID"
CHECK_INTERVAL = 10
logger = logging.getLogger(__name__)
class GuiProcessNotRunning(Exception):
pass
class GuiProcessWatcher(TaskManager):
def __init__... |
femexamples | examplesgui | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * *
# * Th... |
web | auth | #
# Copyright (C) 2009 Damien Churchill <damoxc@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 hashlib
import logging
i... |
plugin | loader | # coding:utf-8
import imp
import logging
import os
import sys
from cactus.plugin import defaults
from cactus.utils.filesystem import fileList
logger = logging.getLogger(__name__)
class BasePluginsLoader(object):
def load(self):
raise NotImplementedError("Subclasses must implement load")
def _initia... |
oss-installation | cloud_heartbeat | import logging
import random
from urllib.parse import urljoin
import requests
from apps.base.utils import live_settings
from common.api_helpers.utils import create_engine_url
from django.conf import settings
from rest_framework import status
logger = logging.getLogger(__name__)
def setup_heartbeat_integration(name=... |
materialized-columns | columns | import re
from datetime import timedelta
from typing import Dict, List, Literal, Tuple, Union, cast
from clickhouse_driver.errors import ServerException
from django.utils.timezone import now
from posthog.cache_utils import cache_for
from posthog.clickhouse.kafka_engine import trim_quotes_expr
from posthog.client impor... |
ext | linguaplugin | import io
from lingua.extractors import Extractor, Message, get_extractor
from mako import compat
from mako.ext.extract import MessageExtractor
class LinguaMakoExtractor(Extractor, MessageExtractor):
"""Mako templates"""
extensions = [".mako"]
default_config = {
"encoding": "utf-8",
"co... |
AddonManager | addonmanager_macro_parser | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2023 FreeCAD Project Association *
# * ... |
network | invthread | """
Thread to send inv annoucements
"""
import random
from time import time
import addresses
import protocol
import Queue
import state
from network.connectionpool import BMConnectionPool
from network.dandelion import Dandelion
from queues import invQueue
from threads import StoppableThread
def handleExpiredDandelion... |
src | class_smtpServer | """
SMTP server thread
"""
import asyncore
import base64
import email
import logging
import re
import signal
import smtpd
import threading
import time
from email.header import decode_header
from email.parser import Parser
import queues
from addresses import decodeAddress
from bmconfigparser import config
from helper_a... |
constructors | jsdate | from ..base import *
from .time_helpers import *
TZ_OFFSET = time.altzone // 3600
ABS_OFFSET = abs(TZ_OFFSET)
TZ_NAME = time.tzname[1]
ISO_FORMAT = "%s-%s-%sT%s:%s:%s.%sZ"
@Js
def Date(year, month, date, hours, minutes, seconds, ms):
return now().to_string()
Date.Class = "Date"
def now():
return PyJsDate... |
cache | time | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
notifier | unix | # neubot/notifier/unix.py
#
# Copyright (c) 2011 Marco Scopesi <marco.scopesi@gmail.com>,
# Politecnico di Torino
# 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/>.
#
# Neubot is free softw... |
extractor | common | # coding: utf-8
from __future__ import unicode_literals
import base64
import datetime
import functools
import hashlib
import json
import math
import netrc
import os
import random
import re
import socket
import ssl
import sys
import time
from ..compat import (
compat_cookiejar_Cookie,
compat_cookies_SimpleCook... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.