section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
util | astrcmp | # fix-header: skip
# http://hetland.org/coding/python/levenshtein.py
# This is a straightforward implementation of a well-known algorithm, and thus
# probably shouldn't be covered by copyright to begin with. But in case it is,
# the author (Magnus Lie Hetland) has, to the extent possible under law,
# dedicated all co... |
ocrolib | common | # -*- coding: utf-8 -*-
################################################################
### common functions for data structures, file name manipulation, etc.
################################################################
from __future__ import print_function
import codecs
import glob
import inspect
import multipr... |
extractor | twentyfourvideo | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, parse_iso8601, xpath_attr, xpath_element
from .common import InfoExtractor
class TwentyFourVideoIE(InfoExtractor):
IE_NAME = "24video"
_VALID_URL = r"""(?x)
https?://
... |
utils | dataset_util_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... |
duplicates | dupefuncs | def dupes(tracks, tags, func, matchcase=False, threshold=1, prevdupe=None):
if matchcase:
strings = [
[(i, t.get(field, "")) for i, t in enumerate(tracks)] for field in tags
]
else:
strings = [
[(i, t.get(field, "").lower()) for i, t in enumerate(tracks)]
... |
VersionUpgrade33to34 | VersionUpgrade33to34 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # To parse preference files.
import io # To serialise the preference files afterwards.
from typing import Dict, List, Tuple
from UM.VersionUpgrade import VersionUpgrade # We're inheriting from this.
... |
cura | PickingPass | # Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, Optional
from UM.Logger import Logger
from UM.Math.Vector import Vector
from UM.Qt.QtApplication import QtApplication
from UM.Resources import Resources
from UM.Scene.Iterator.DepthFirstIt... |
api | cmdutils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""qutebrowser has the concept of functions, exposed to the user as commands.
Creating a new command is straightforward::
from qutebrowser.api import cmdutils
@cmdutils.register(...)
de... |
lib | base | # 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, ... |
meta-architectures | ssd_meta_arch_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... |
streamlink-cli | argparser | import argparse
import numbers
import re
from pathlib import Path
from string import printable
from textwrap import dedent
from typing import Any, Callable, Dict, List, Optional, Tuple
from streamlink import __version__ as streamlink_version
from streamlink import logger
from streamlink.session import Streamlink
from ... |
data | converters | # --------------------------------------------------------------------------
# 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... |
parsers | pocket_api | __package__ = "archivebox.parsers"
import re
from configparser import ConfigParser
from pathlib import Path
from typing import IO, Iterable, Optional
from ..config import POCKET_ACCESS_TOKENS, POCKET_CONSUMER_KEY, SOURCES_DIR
from ..index.schema import Link
from ..system import atomic_write
from ..util import enforc... |
invesalius | plugins | # --------------------------------------------------------------------
# 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 - GPL... |
plugins | rtpplay | """
$description Live TV channels and video on-demand service from RTP, a Portuguese public, state-owned broadcaster.
$url rtp.pt/play
$type live, vod
$region Portugal
"""
import re
from base64 import b64decode
from urllib.parse import unquote
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin... |
plugins | helpers | # -*- coding: utf-8 -*-
# TODO: Move to utils directory in 0.6.x
import hashlib
import itertools
import json
import os
import re
import shutil
import socket
import subprocess
import sys
import time
import traceback
import zlib
from base64 import b85decode, b85encode
from collections.abc import Sequence
from datetime ... |
BasicDrawing | ColorAndGState | import array
import sys
import Utilities
from Quartz import *
def doColorSpaceFillAndStroke(context):
theColorSpace = Utilities.getTheCalibratedRGBColorSpace()
opaqueRed = (0.663, 0.0, 0.031, 1.0) # red,green,blue,alpha
aBlue = (0.482, 0.62, 0.871, 1.0) # red,green,blue,alpha
# Set the fill color ... |
accounts | LinkifierCom | # -*- coding: utf-8 -*-
import hashlib
import json
import pycurl
from ..base.multi_account import MultiAccount
class LinkifierCom(MultiAccount):
__name__ = "LinkifierCom"
__type__ = "account"
__version__ = "0.03"
__status__ = "testing"
__description__ = """Linkifier.com account plugin"""
_... |
blocks | qa_logger | #!/usr/bin/env python
#
# Copyright 2016 Free Software Foundation, Inc.
# Copyright 2021 Marcus Müller
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest
class test_logger(gr_unittest.TestCase):
def setUp(self):
pass
def... |
draftutils | messages | # ***************************************************************************
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
aliceVision | SketchfabUpload | __version__ = "1.0"
import glob
import io
import json
import os
import zipfile
import requests
from meshroom.core import desc
class BufferReader(
io.BytesIO
): # object to call the callback while the file is being uploaded
def __init__(self, buf=b"", callback=None, cb_args=(), cb_kwargs={}, stopped=None):
... |
migrations | 0178_auto_20230328_2132 | # Generated by Django 3.2.18 on 2023-03-28 21:32
import bookwyrm.models.fields
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("auth", "0012_alter_user_first_name_max_length"),
("bookwyrm", "0177_merge_0174_auto_20... |
server | workflow_abilities | """The abilities module allows for the description of abilities and their
dependencies across Archivematica components (i.e., dashboard, MCPServer, and
MCPClient).
"""
from django.conf import settings
ABILITIES = (
# The (elastic)search Transfers indexes must be enabled for the transfers
# backlog. Therefore, ... |
canto-curses | input | # -*- 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 loggin... |
extractor | odatv | # coding: utf-8
from __future__ import unicode_literals
from ..utils import NO_DEFAULT, ExtractorError, remove_start
from .common import InfoExtractor
class OdaTVIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?odatv\.com/(?:mob|vid)_video\.php\?.*\bid=(?P<id>[^&]+)"
)
_TESTS = [
{
... |
playorder | playcounteq | # Copyright 2012-2016 Ryan "ZDBioHazard" Turner <zdbiohazard2@gmail.com>
# 2016-2020 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... |
views | integration_heartbeat | from apps.api.permissions import RBACPermission
from apps.api.serializers.integration_heartbeat import IntegrationHeartBeatSerializer
from apps.auth_token.auth import PluginAuthentication
from apps.heartbeat.models import IntegrationHeartBeat
from common.api_helpers.mixins import PublicPrimaryKeyMixin, TeamFilteringMix... |
qltk | views | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2012, 2013 Christoph Reiter
# 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 t... |
SCL | essa_par | def process_nested_parent_str(attr_str):
"""
The first letter should be a parenthesis
input string: "(1,4,(5,6),7)"
output: tuple (1,4,(4,6),7)
"""
params = []
agg_scope_level = 0
current_param = ""
for i, ch in enumerate(attr_str):
if ch == ",":
params.append(cur... |
Models | QualityProfilesDropDownMenuModel | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import cura.CuraApplication # Imported this way to prevent circular dependencies.
from cura.Machines.ContainerTree import ContainerTree
from cura.Machines.Models.MachineModelUtils import fetchLayerHeight
from PyQt6.QtCore ... |
builder | _html5lib | # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__all__ = [
'HTML5TreeBuilder',
]
import re
import warnings
import html5lib
from bs4.builder import HTML, HTML_5, PERMISSIVE, HTMLTreeBuilder
from bs4.element import (Comment, Doctype, NamespacedAttribute,
... |
PyObjCTest | test_nssortdescriptor | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSSortDescriptor(TestCase):
def testMethods(self):
self.assertArgIsBOOL(NSSortDescriptor.initWithKey_ascending_, 1)
self.assertArgIsBOOL(NSSortDescriptor.initWithKey_ascending_selector_, 1)
self.assertArgIsSEL(
... |
containerprocessors | archiveprocessor | import hashlib
import io
import re
from datetime import datetime
from hashlib import sha256
from zipfile import ZipFile, ZipInfo
from model import AmbarFileContent, AmbarFileMeta
class ArchiveProcessor:
def __init__(self, Logger, ApiProxy):
self.logger = Logger
self.apiProxy = ApiProxy
def P... |
statusbar | progress | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""The progress bar in the statusbar."""
from qutebrowser.config import stylesheet
from qutebrowser.qt.core import QSize, pyqtSlot
from qutebrowser.qt.widgets import QProgressBar, QSizePolicy
f... |
extractor | vlive | # coding: utf-8
from __future__ import unicode_literals
import itertools
import json
from ..compat import compat_HTTPError, compat_str
from ..utils import (
ExtractorError,
int_or_none,
merge_dicts,
str_or_none,
strip_or_none,
try_get,
urlencode_postdata,
)
from .naver import NaverBaseIE
... |
debug | objgraph | """
Ad-hoc tools for drawing Python object reference graphs with graphviz.
This module is more useful as a repository of sample code and ideas, than
as a finished product. For documentation and background, read
http://mg.pov.lt/blog/hunting-python-memleaks.html
http://mg.pov.lt/blog/python-object-graphs.html
h... |
chardet | euctwprober | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... |
engines | json_engine | # SPDX-License-Identifier: AGPL-3.0-or-later
from collections.abc import Iterable
from json import loads
from urllib.parse import urlencode
from searx.utils import html_to_text, to_string
search_url = None
url_query = None
content_query = None
title_query = None
content_html_to_text = False
title_html_to_text = Fals... |
collection | models | # Copyright 2010, 2012-2014 Christoph Reiter
# 2020-22 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) an... |
saveddata | booster | # ===============================================================================
# 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, ... |
extractor | rtbf | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import ExtractorError, float_or_none, int_or_none, strip_or_none
from .common import InfoExtractor
class RTBFIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://(?:www\.)?rtbf\.be/
(?:
video/[^?]+\?.*\bid=|
... |
utils | variables_helper | # 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... |
face | model | import json
import os
import sys
from datetime import datetime
from pathlib import Path
from random import randint
import numpy as np
from annoy import AnnoyIndex
from django.utils import timezone
from photonix.classifiers.base_model import BaseModel
from photonix.classifiers.face.deepface import DeepFace
from photoni... |
phone-notifications | phone_provider | import typing
from abc import ABC, abstractmethod
from dataclasses import dataclass
from apps.base.utils import live_settings
from apps.phone_notifications.exceptions import ProviderNotSupports
from apps.phone_notifications.models import ProviderPhoneCall, ProviderSMS
from django.conf import settings
from django.utils... |
BasicDrawing | DrawingBasics | import math
import sys
import Quartz
from Quartz import *
def doSimpleRect(context):
# Set the fill color to opaque red.
CGContextSetRGBFillColor(context, 1.0, 0.0, 0.0, 1.0)
# Set up the rectangle for drawing.
ourRect = CGRectMake(20.0, 20.0, 130.0, 100.0)
# Draw the filled rectangle.
CGCont... |
Arranging | ShapeArray | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import copy
from typing import TYPE_CHECKING, Optional, Tuple, Union
import numpy
from UM.Math.Polygon import Polygon
if TYPE_CHECKING:
from UM.Scene.SceneNode import SceneNode
class ShapeArray:
"""Polygon repre... |
version-checks | commandline | __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
from ..exceptions import CannotCheckOffline, ConfigurationInvalid
... |
scripts | CreateThumbnail | import base64
from cura.Snapshot import Snapshot
from PyQt6.QtCore import QBuffer, QByteArray, QIODevice
from UM.Logger import Logger
from ..Script import Script
class CreateThumbnail(Script):
def __init__(self):
super().__init__()
def _createSnapshot(self, width, height):
Logger.log("d", "... |
Gui | LeadInOut | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 LTS <SammelLothar@gmx.de> under LGPL *
# * Copyright (c) 2020-2021 Schildkroet *
# * ... |
logic | validators | # -*- coding: utf-8 -*-
from __future__ import annotations
from typing import Any, cast
import ckan.plugins.toolkit as tk
from ckan.types import (
Context,
ContextValidator,
FlattenDataDict,
FlattenErrorDict,
FlattenKey,
)
def activity_type_exists(activity_type: Any) -> Any:
"""Raises Inval... |
you-get | json_output | import json
# save info from common.print_info()
last_info = None
def output(video_extractor, pretty_print=True):
ve = video_extractor
out = {}
out["url"] = ve.url
out["title"] = ve.title
out["site"] = ve.name
out["streams"] = ve.streams
try:
if ve.dash_streams:
out["s... |
migrations | 0008_speed_up_kafka_timestamp_filters | from functools import cached_property
import structlog
from django.conf import settings
from posthog.async_migrations.definition import (
AsyncMigrationDefinition,
AsyncMigrationOperationSQL,
)
from posthog.client import sync_execute
from posthog.constants import AnalyticsDBMS
from posthog.version_requirement ... |
cd | discid_parser | """
This module is a parser for audio CDs based on discid.
It is compatible with both python-discid and python-libdiscid.
"""
try: # allow both python-discid and python-libdiscid
from libdiscid.compat import discid
except ImportError:
import discid
from xl.trax import Track
def read_disc_id(device... |
reporter | exception_handler | import errno
import logging
import re
import sys
from io import StringIO
from socket import gaierror
from traceback import print_exception
from typing import Callable, Dict, Optional, Set, Tuple, Type
from tribler.core.components.exceptions import ComponentStartupException
from tribler.core.components.reporter.reporte... |
moodbar | cache | # moodbar - Replace Exaile's seekbar with a moodbar
# Copyright (C) 2015 Johannes Sasongko <sasongko@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 by
# the Free Software Foundation, either version 2 of the License... |
widgets | menu | # 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... |
grc | gen_rfnoc_replay_block_yml | """
Copyright 2023 Ettus Research, A National Instruments Brand.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import sys
MAX_NUM_CHANNELS = 4
MAIN_TMPL = """\
id: uhd_rfnoc_replay
label: RFNoC Replay Block
category: '[Core]/UHD/RFNoC/Blocks'
parameters:
- id: num_in_ports
label: In Port Count
dtype: int
opt... |
apscheduler | job | from collections import Iterable, Mapping
from uuid import uuid4
import six
from apscheduler.triggers.base import BaseTrigger
from apscheduler.util import (
check_callable_args,
convert_to_datetime,
datetime_repr,
get_callable_name,
obj_to_ref,
ref_to_obj,
repr_escape,
)
class Job(object)... |
sequencer | itemlist | from sglib import constants
from sglib.log import LOG
from sgui.daw import shared
from sgui.sgqt import (
QAbstractItemView,
QHBoxLayout,
QLineEdit,
QListWidget,
QListWidgetItem,
QMessageBox,
QPushButton,
QtCore,
QVBoxLayout,
QWidget,
)
from sgui.widgets import FileDragDropListWi... |
helloworld | testlib | # Copyright (C) 2009-2010 Aren Olson
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
protos | string_int_label_map_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: string_int_label_map.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 import messa... |
TechDrawTools | CommandAxoLengthDimension | # ***************************************************************************
# * Copyright (c) 2023 edi <edi271@a1.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms ... |
views | find_file | """
@file
@brief This file is used to find missing files when opening or importing a project
@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 ... |
plugins | https_rewrite | """
searx 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 License, or
(at your option) any later version.
searx is distributed in the hope that it will be useful,
but WITHOUT ANY WA... |
mp-sched | plot_flops | #!/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
#
#
"""
Reads output from run_synthetic.py and runs gnuplot showing
GFLOPS as f(npipes, nstages)
"""
import os
import re
import sys
import tempfile
from argparse imp... |
bitmessageqt | migrationwizard | #!/usr/bin/env python2.7
from PyQt4 import QtCore, QtGui
class MigrationWizardIntroPage(QtGui.QWizardPage):
def __init__(self):
super(QtGui.QWizardPage, self).__init__()
self.setTitle("Migrating configuration")
label = QtGui.QLabel(
"This wizard will help you to migrate your c... |
PyObjCTest | test_imp | import objc
from PyObjCTools.TestSupport import *
NSObject = objc.lookUpClass("NSObject")
class TestBasicIMP(TestCase):
# Test the basic functionality of IMP's. Imp's are basically unbound
# selectors if you look at the interface. The implementation refers to
# the actual functions that implements the me... |
papers | baremodels | # -*- 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... |
tagsources | acoust_id | import contextlib
import http.client
import os
import time
import traceback
import urllib.error
import urllib.parse
import urllib.request
from itertools import chain, product, starmap
try:
import acoustid
# Don't want it to use audioread as python-gst
# lib causes lockups.
acoustid.have_audioread = Fa... |
extractor | limelight | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_HTTPError
from ..utils import (
ExtractorError,
determine_ext,
float_or_none,
int_or_none,
smuggle_url,
try_get,
unsmuggle_url,
)
from .common import InfoExtractor
class LimelightBaseIE(InfoExtr... |
migrations | 0002_repository | # -*- coding: utf-8 -*-
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("papers", "0001_squashed_0059_remove_django_geojson"),
("deposit", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="Repository",
... |
gui | stategroup | # This file is part of MyPaint.
# Copyright (C) 2009-2013 by Martin Renold <martinxyz@gmx.ch>
# Copyright (C) 2011-2015 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 Foun... |
feedback | survey | from django.db import models
from posthog.models.utils import UUIDModel
class Survey(UUIDModel):
class SurveyType(models.TextChoices):
POPOVER = "popover", "popover"
BUTTON = "button", "button"
EMAIL = "email", "email"
FULL_SCREEN = "full_screen", "full screen"
API = "api",... |
thumbor | signal_handler | import signal
import sys
import time
import tornado.ioloop
from thumbor.utils import logger
def signal_handler(server, config, sig, _):
io_loop = tornado.ioloop.IOLoop.instance()
def stop_loop(now, deadline):
if now < deadline and (
io_loop._callbacks # pylint: disable=protected-access
... |
booster | add | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.booster.add import CalcAddBoosterCommand
from gui.fitCommands.helpers import BoosterInfo, InternalCommandHistory
from service.fit import Fit
from service.market import Market
class GuiAddBoosterCommand(wx.Command... |
core | Microphone | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009 Team FoFiX ... |
utils | purge | # -*- coding: utf-8 -*-
import re
def chars(text, chars, repl=""):
"""
Removes all chars in repl from text.
"""
chars = chars.replace("\\", "\\\\")
return re.sub(rf"[{chars}]", repl, text)
_UNIXBADCHARS = ("\0", "/", "\\")
_MACBADCHARS = _UNIXBADCHARS + (":",)
_WINBADCHARS = _MACBADCHARS + ("<"... |
extractor | ivideon | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urllib_parse_urlencode, compat_urlparse
from ..utils import qualities
from .common import InfoExtractor
class IvideonIE(InfoExtractor):
IE_NAME = "ivideon"
IE_DESC = "Ivideon TV"
_VALID_URL = r"https?://(?:www\... |
config | qtargs | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Get arguments to pass to Qt."""
import argparse
import os
import pathlib
import sys
from typing import Any, Callable, Dict, Iterator, List, Optional, Sequence, Tuple, Union
from qutebrowser... |
builtinShipBrowser | pfListPane | # =============================================================================
# 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 ... |
models | emoji_model | """
@file
@brief This file contains the emoji model, used by the main 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 proj... |
lector | guifunctions | # This file is a part of Lector, a Qt based ebook reader
# Copyright (C) 2017-2019 BasioMeusPuga
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... |
mylar | auth | #!/usr/bin/env python
# -*- encoding: UTF-8 -*-
# This file is part of Mylar.
#
# 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 ver... |
gui | globalEvents | # noinspection PyPackageRequirements
import wx.lib.newevent
FitRenamed, FIT_RENAMED = wx.lib.newevent.NewEvent()
FitChanged, FIT_CHANGED = wx.lib.newevent.NewEvent()
FitRemoved, FIT_REMOVED = wx.lib.newevent.NewEvent()
FitNotesChanged, FIT_NOTES_CHANGED = wx.lib.newevent.NewEvent()
CharListUpdated, CHAR_LIST_UPDATED =... |
accounts | YibaishiwuCom | # -*- coding: utf-8 -*-
import re
from ..base.account import BaseAccount
class YibaishiwuCom(BaseAccount):
__name__ = "YibaishiwuCom"
__type__ = "account"
__version__ = "0.09"
__status__ = "testing"
__description__ = """115.com account plugin"""
__license__ = "GPLv3"
__authors__ = [("zo... |
core | parseheader | #
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to generate AST for the headers and parse it """
import codecs
import logging
import os
import re
from ..core import Constants
from ..core.base import BlockTool, BlockTool... |
bukuserver | server | #!/usr/bin/env python
# pylint: disable=wrong-import-order, ungrouped-imports
"""Server module."""
import os
import sys
from typing import Union # NOQA; type: ignore
from urllib.parse import urlparse
from buku import BukuDb, __version__, network_handler
from flask.cli import FlaskGroup
from flask_admin import Admin
f... |
lib | totp | # 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, ... |
FilteringController | FilteringControllerDocument | #
# FilteringControllerDocument.py
# FilteringController
#
# Converted by u.fiedler on 05.02.05.
#
# The original version was written in Objective-C by Malcolm Crawford
# at http://homepage.mac.com/mmalc/CocoaExamples/controllers.html
from Cocoa import *
from PyObjCTools import AppHelper
class FilteringControll... |
funnels | funnel_unordered_persons | from typing import List, Optional
from posthog.models.filters.filter import Filter
from posthog.models.filters.mixins.utils import cached_property
from posthog.queries.actor_base_query import ActorBaseQuery
from posthog.queries.funnels.funnel_unordered import ClickhouseFunnelUnordered
from posthog.queries.funnels.sql ... |
puddletag | tagbackup | """Routines and script to back up audio metadata (puddletag
audioinfo.Tag objects).
Data is stored as json."""
import json
import logging
import os
from optparse import OptionParser
from puddlestuff import audioinfo
from puddlestuff.audioinfo import b64_to_img, tag_to_json
def tags_to_json(dirpath, fields=None):
... |
util | icontheme | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2008 Lukáš Lalinský
# Copyright (C) 2013, 2018-2021 Laurent Monin
# Copyright (C) 2016-2017 Sambhav Kothari
# Copyright (C) 2020-2021 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modif... |
extractor | piksel | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (
ExtractorError,
dict_get,
int_or_none,
parse_iso8601,
try_get,
unescapeHTML,
)
from .common import InfoExtractor
class PikselIE(InfoExtractor):
_VALID_URL = r"""(?x)htt... |
puddlestuff | tagmodel | import logging
import os
import re
import sys
import time
from collections import defaultdict
from contextlib import contextmanager
from copy import copy, deepcopy
from operator import itemgetter
from os import path
from subprocess import Popen
from PyQt5.QtCore import (
QAbstractTableModel,
QEvent,
QItemS... |
mylar | opds | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# This file is part of Mylar.
#
# 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 vers... |
PathTests | TestPathGeneratorDogboneII | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
cmd | ftp | # For now, this completely relies on the assumption that the current
# encoding (LC_CTYPE, etc.) is ASCII compatible, and that it returns
# the exact same bytes from a decode/encode round-trip (or the reverse
# (e.g. ISO-8859-1).
from __future__ import absolute_import, print_function
import fnmatch
import os
import s... |
extractor | cultureunplugged | from __future__ import unicode_literals
import re
import time
from ..utils import HEADRequest, int_or_none
from .common import InfoExtractor
class CultureUnpluggedIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?cultureunplugged\.com/documentary/watch-online/play/(?P<id>\d+)(?:/(?P<display_id>[^/]+))?"
... |
utilities | configparser | """
A configparser.
Author(s): Egbert Bouman
"""
import ast
import codecs
from configparser import DEFAULTSECT, RawConfigParser
from io import StringIO
from threading import RLock
from tribler.core.exceptions import OperationNotPossibleAtRuntimeException
class CallbackConfigParser(RawConfigParser):
def __init__... |
components | exceptions | from __future__ import annotations
from typing import TYPE_CHECKING, Set, Type
if TYPE_CHECKING:
from tribler.core.components.component import Component
class ComponentError(Exception):
pass
class ComponentStartupException(ComponentError):
def __init__(self, component: Component, cause: Exception):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.