section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
MegaLight | CustomTheme | #####################################################################
# -*- coding: iso-8859-1 -*- #
# #
# Frets on Fire X #
# Copyright (C) 2006 Sami Kystil ... |
plugins | xfade | # -*- coding: utf-8 -*-
"""
This file is part of the Stargate project, Copyright Stargate 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 Foundation version 3 of the License.
This program is distributed in... |
modeling | properties | """Properties used to create the Gaphor data models.
The logic for creating and destroying connections between elements is
implemented in Python property classes. These classes are simply instantiated
like this:
class Class(Element): pass
class Comment(Element): pass
Class.comment = association('comment', ... |
PDFKit | _metadata | # This file is generated by objective.metadata
#
# Last update: Fri Jun 8 16:58:05 2012
import sys
import objc
if sys.maxsize > 2**32:
def sel32or64(a, b):
return b
else:
def sel32or64(a, b):
return a
if sys.byteorder == "little":
def littleOrBig(a, b):
return a
else:
... |
extractor | peertube | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (
int_or_none,
parse_resolution,
str_or_none,
try_get,
unified_timestamp,
url_or_none,
urljoin,
)
from .common import InfoExtractor
class PeerTubeIE(InfoExtractor):
_... |
bup | pwdgrp | from __future__ import absolute_import, print_function
import os
from bup import _helpers
from bup.helpers import cache_key_value
# Using __slots__ makes these much smaller (even than a namedtuple)
class Passwd:
"""Drop in replacement for pwd's structure with bytes instead of strings."""
__slots__ = (
... |
vocoder | qa_g721_vocoder | #!/usr/bin/env python
#
# Copyright 2011,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest, vocoder
class test_g721_vocoder(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()... |
clientScripts | check_transfer_directory_for_objects | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
saveddata | targetProfile | # ===============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# 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, e... |
module | localSwap | import wx
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcSwapLocalModuleCommand(wx.Command):
def __init__(self, fitID, position1, position2):
wx.Command.__init__(self, True, "Swap Modules")
self.fitID = fitID
self.position1 = position1
... |
doxyxml | text | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file was generated by gr_modtool, a tool from the GNU Radio framework
# This file is a part of gr-howto
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Utilities for extracting text from generated classes.
"""
def is_string(txt):
if isinstance(txt, ... |
gui | sliderwidget | # This file is part of MyPaint.
# Copyright (C) 2020 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 Foundation; either version 2 of the License, or
# (at your option) any ... |
Content | ContentManager | import base64
import copy
import json
import os
import re
import sys
import time
import gevent
from Config import config
from Crypt import CryptHash
from Debug import Debug
from Peer import PeerHashfield
from Plugin import PluginManager
from util import Diff, SafeRe, helper
from .ContentDbDict import ContentDbDict
... |
PyObjCTest | test_cgwindow | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestCGWindow(TestCase):
def testConstants(self):
self.assertEqual(kCGWindowIDCFNumberType, kCFNumberSInt32Type)
self.... |
clientScripts | check_for_access_directory | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
formats | wav | # Copyright 2006 Joe Wreschnig
# 2021 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import ... |
sequencer | atm_context_menu | import math
from sglib import constants
from sglib.lib import util
from sglib.lib.translate import _
from sglib.math import clip_value, linear_interpolate
from sglib.models.daw import *
from sgui import shared as glbl_shared
from sgui import widgets
from sgui.daw import shared
from sgui.sgqt import *
from . import _s... |
migrations | 0017_dashboarditem | # Generated by Django 2.2.7 on 2020-02-06 22:07
import django.contrib.postgres.fields.jsonb
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0016_user_temporary_token"),
]
operations = [
migrati... |
dialogs | confirmationdialog | from PyQt5 import uic
from PyQt5.QtCore import Qt, pyqtSignal
from PyQt5.QtGui import QCursor
from PyQt5.QtWidgets import QSizePolicy, QSpacerItem
from tribler.gui.defs import BUTTON_TYPE_NORMAL
from tribler.gui.dialogs.dialogcontainer import DialogContainer
from tribler.gui.utilities import connect, get_ui_file_path, ... |
fitShieldRegen | graph | # =============================================================================
# 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 ... |
gui | targetProfileEditor | # =============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# 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 v... |
RemovableDriveOutputDevice | RemovableDrivePlugin | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Python built-ins
import threading
import time
# Uranium/l18n
from UM.i18n import i18nCatalog
# Uranium/Messaging
from UM.Logger import Logger
# Uranium/IO
from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlug... |
extractors | headers | __package__ = "archivebox.extractors"
from pathlib import Path
from typing import Optional
from ..config import (
CHECK_SSL_VALIDITY,
CURL_ARGS,
CURL_BINARY,
CURL_USER_AGENT,
CURL_VERSION,
SAVE_HEADERS,
TIMEOUT,
)
from ..index.schema import ArchiveOutput, ArchiveResult, Link
from ..logging... |
misc | keyhintwidget | # SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Small window that pops up to show hints for possible keystrings.
When a user inputs a key that forms a partial match, this shows a small window
with each possible completion of that keystring and t... |
game | Lobby | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire X #
# Copyright (C) 2006 Sami Kyöstilä ... |
deluge | httpdownloader | #
# Copyright (C) 2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import cgi
import logging
impo... |
Machines | VariantNode | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING
import UM.FlameProfiler
from cura.Machines.ContainerNode import ContainerNode
from cura.Machines.MaterialNode import MaterialNode
from UM.Logger import Logger
from UM.Settings.ContainerRegis... |
tasks | task | """
Task class, representing an individual command (usually run on a file or directory).
Stored in the `Task` model.
Tasks are passed to MCPClient for processing.
"""
import logging
import os
import uuid
from django.utils import timezone
from main import models
from server.db import auto_close_old_connections
logger... |
serializers | schedule_web | from apps.api.serializers.schedule_base import ScheduleBaseSerializer
from apps.schedules.models import OnCallScheduleWeb
from apps.schedules.tasks import (
schedule_notify_about_empty_shifts_in_schedule,
schedule_notify_about_gaps_in_schedule,
)
from apps.slack.models import SlackChannel, SlackUserGroup
from c... |
femexamples | constraint_contact_solid_solid | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com *
# * *
# * Th... |
cherrypy | _cpcompat | """Compatibility code for using CherryPy with various versions of Python.
CherryPy 3.2 is compatible with Python versions 2.3+. This module provides a
useful abstraction over the differences between Python versions, sometimes by
preferring a newer idiom, sometimes an older one, and sometimes a custom one.
In particul... |
PyObjCTest | test_cfurlaccess | import os
import sys
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestURLAccess(TestCase):
def testConstants(self):
self.assertEqual(kCFURLUnknownError, -10)
self.ass... |
parsers | ocrproxy | import io
import re
import sys
import pyocr
import pyocr.builders
from PIL import Image
class OCRProxyResponse:
def __init__(self):
self.text = ""
self.success = False
self.message = ""
class OCRProxy:
def __init__(self):
self.ocr = None
self.lang = None
for... |
lib | email_settings | """
Email settings and globals.
The main setting is `EMAIL_BACKEND`, which defines which backend to use. Valid
backends are:
* Console: `django.core.mail.backends.console.EmailBackend`
* Dummy: `django.core.mail.backends.dummy.EmailBackend`
* File: `django.core.mail.backends.filebased.EmailBackend`
* ... |
zeromq | qa_zeromq_pubsub | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import time
import pmt
from gnuradio import blocks, gr, gr_unittest, zeromq
def make_tag(key, value, offset, srcid=None):
tag = gr... |
Content | ContentDb | import os
from Config import config
from Db.Db import Db, DbTableError
from Debug import Debug
from Plugin import PluginManager
@PluginManager.acceptPlugins
class ContentDb(Db):
def __init__(self, path):
Db.__init__(self, {"db_name": "ContentDb", "tables": {}}, path)
self.foreign_keys = True
... |
config | access_control | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from typing import List, Optional
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs import with_att... |
extractors | toutiao | #!/usr/bin/env python
import binascii
import random
from json import loads
from urllib.parse import urlparse
from ..common import *
try:
from base64 import decodebytes
except ImportError:
from base64 import decodestring
decodebytes = decodestring
__all__ = [
"toutiao_download",
]
def random_with_n... |
frescobaldi-app | toplevel | # 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
... |
Settings | SettingInheritanceManager | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, List, Optional
from cura.Settings.ExtruderManager import ExtruderManager
from PyQt6.QtCore import QObject, QTimer, pyqtProperty, pyqtSignal
from UM.Application import Application
from UM.Fl... |
widgets | sidebar | #
# Copyright (C) 2016 bendikro <bro.devel+deluge@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 curses
import logging
... |
update | update_osm_keys_tags | #!/usr/bin/env python
# lint: pylint
# pylint: disable=missing-function-docstring
"""Fetch OSM keys and tags.
To get the i18n names, the scripts uses `Wikidata Query Service`_ instead of for
example `OSM tags API`_ (sidenote: the actual change log from
map.atownsend.org.uk_ might be useful to normalize OSM tags)
.. _... |
sabnzbd | par2file | #!/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... |
SCL | AggregationDataTypes | # Copyright (c) 2011, Thomas Paviot (tpaviot@gmail.com)
# All rights reserved.
# This file is part of the StepClassLibrary (SCL).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code mus... |
migrations | 0005_alertgroup_cached_render_for_web | # Generated by Django 3.2.13 on 2022-07-20 09:04
import django_migration_linter as linter
from django.db import OperationalError, ProgrammingError, migrations, models
class AddFieldIfNotExists(migrations.AddField):
"""
Adds a field and ignores "duplicate column" error in case the field already exists.
Wh... |
list | curate | """ book list views"""
from bookwyrm import forms, models
from bookwyrm.views.list.list import (
increment_order_in_reverse,
normalize_book_list_ordering,
)
from django.contrib.auth.decorators import login_required
from django.db.models import Max
from django.shortcuts import get_object_or_404, redirect
from dj... |
analog | qa_pwr_squelch | #!/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
#
#
from gnuradio import analog, blocks, gr, gr_unittest
class test_pwr_squelch(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block()
... |
extractor | camwithher | from __future__ import unicode_literals
import re
from ..utils import int_or_none, parse_duration, unified_strdate
from .common import InfoExtractor
class CamWithHerIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?camwithher\.tv/view_video\.php\?.*\bviewkey=(?P<id>\w+)"
)
_TESTS = [
... |
hogql | printer | import re
from dataclasses import dataclass
from datetime import date, datetime
from difflib import get_close_matches
from typing import List, Literal, Optional, Union, cast
from uuid import UUID
from posthog.hogql import ast
from posthog.hogql.base import AST
from posthog.hogql.constants import MAX_SELECT_RETURNED_RO... |
implant | imprt | import eos.db
import gui.mainFrame
import wx
from eos.const import ImplantLocation
from gui import globalEvents as GE
from gui.fitCommands.calc.implant.add import CalcAddImplantCommand
from gui.fitCommands.calc.implant.changeLocation import CalcChangeImplantLocationCommand
from gui.fitCommands.helpers import ImplantInf... |
PyObjCTest | test_clinmeth | """
Tests for accessing methods through classes and instances
"""
import objc
from PyObjCTest.clinmeth import *
from PyObjCTools.TestSupport import *
class TestClassMethods(TestCase):
# Some very basic tests that check that getattr on instances doesn't
# return a class method and that getattr on classes prefe... |
PyObjCTest | test_regr | import os
from threading import Thread
import AppKit
import Foundation
import objc
from Foundation import NSAutoreleasePool, NSLog, NSObject
from PyObjCTools.TestSupport import *
class TestRegr(TestCase):
def testFSRepr(self):
fm = Foundation.NSFileManager.defaultManager()
self.assertRaises(
... |
module | localChangeStates | import wx
from eos.saveddata.module import Module
from gui.fitCommands.helpers import restoreCheckedStates
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcChangeLocalModuleStatesCommand(wx.Command):
def __init__(self, fitID, mainPosition, positions, click):
wx.... |
KindleUnpack | mobi_split | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import, division, print_function, unicode_literals
import struct
from .unipath import pathof
# note: struct pack, unpack, unpack_from all require bytestring format
# data all the way up to... |
auth-token | auth | import json
import logging
from typing import Tuple
from apps.api.permissions import RBACPermission, user_is_authorized
from apps.grafana_plugin.helpers.gcom import check_token
from apps.user_management.exceptions import (
OrganizationDeletedException,
OrganizationMovedException,
)
from apps.user_management.mo... |
engines | invidious | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Invidious (Videos)
"""
import random
import time
from urllib.parse import quote_plus
from dateutil import parser
# about
about = {
"website": "https://api.invidious.io/",
"wikidata_id": "Q79343316",
"official_api_documentation": "https://github.com/iv-org... |
PyObjCTest | test_nsscroller | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSScroller(TestCase):
def testConstants(self):
self.assertEqual(NSScrollerArrowsMaxEnd, 0)
self.assertEqual(NSScrollerArrowsMinEnd, 1)
self.assertEqual(NSScrollerArrow... |
thumbor | console | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import argparse
from thumbor import __release_date__, __version__
f... |
Code | GestorRoutes | import random
import time
import LCEngine4 as LCEngine
from Code import (
PGN,
Books,
ControlPosicion,
Gestor,
Jugada,
LibChess,
Partida,
Routes,
Util,
VarGen,
)
from Code.Constantes import *
from Code.QT import QTUtil, QTUtil2
class GR_Engine:
def __init__(self, procesado... |
borg | constants | # this set must be kept complete, otherwise the RobustUnpacker might malfunction:
# fmt: off
ITEM_KEYS = frozenset(['path', 'source', 'target', 'rdev', 'chunks', 'chunks_healthy', 'hardlink_master', 'hlid',
'mode', 'user', 'group', 'uid', 'gid', 'mtime', 'atime', 'ctime', 'birthtime', 'size',
... |
examples | test_migration | from posthog.async_migrations.definition import (
AsyncMigrationDefinition,
AsyncMigrationOperation,
AsyncMigrationOperationSQL,
)
from posthog.constants import AnalyticsDBMS
# For testing purposes
class SideEffects:
def __init__(self):
self.reset_count()
def reset_count(self):
s... |
projectedFit | changeAmount | import math
import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.projectedFit.changeAmount import (
CalcChangeProjectedFitAmountCommand,
)
from gui.fitCommands.calc.projectedFit.remove import CalcRemoveProjectedFitCommand
from gui.fitCommands.helpers import Inte... |
femexamples | ccx_cantilever_prescribeddisplacement | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * *
# * Th... |
src | appinfo_args | # MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, 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.
# Strip out MacOSX launchd -psn_... parameter.
from __future__ import print_function
imp... |
Foundation | _nsobject | """
Define a category on NSObject with some useful methods.
"""
import sys
import objc
if sys.version_info[0] == 2:
def _str(v):
return v
exec(
"""\
def _raise(exc_type, exc_value, exc_trace):
raise exc_type, exc_value, exc_trace
"""
)
else:
def _str(v):
if isinstance(v,... |
scripts | LimitXYAccelJerk | # Limit XY Accel: Authored by: Greg Foresi (GregValiant)
# July 2023
# Sometimes bed-slinger printers need different Accel and Jerk values for the Y but Cura always makes them the same.
# This script changes the Accel and/or Jerk from the beginning of the 'Start Layer' to the end of the 'End Layer'.
# The existing M20... |
wiki | views | from __future__ import annotations
import difflib
from pathlib import Path
from typing import Any
from urllib.parse import quote
import sqlalchemy as sa
from abilian.core.extensions import db
from abilian.core.signals import activity
from abilian.core.util import unwrap
from abilian.i18n import _, _l, _n
from abilian... |
tasks | alert_group_status | import logging
from apps.alerts.models import AlertGroup, AlertGroupLogRecord
from apps.webhooks.models import Webhook
from celery.utils.log import get_task_logger
from common.custom_celery_tasks import shared_dedicated_queue_retry_task
from django.conf import settings
from .trigger_webhook import send_webhook_event
... |
helpers | fs | import errno
import hashlib
import os
import posixpath
import re
import stat
import subprocess
import sys
import textwrap
import platformdirs
from ..constants import * # NOQA
from ..logger import create_logger
from ..platformflags import is_win32
from .errors import Error
from .process import prepare_subprocess_env
... |
engines | emojipedia | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Emojipedia
"""
from urllib.parse import urlencode
from lxml import html
from searx import logger
from searx.utils import eval_xpath_getindex, eval_xpath_list, extract_text
logger = logger.getChild("Emojipedia engine")
about = {
"website": "https://emojipedia.org... |
PyObjCTest | test_cfdata | import sys
from CoreFoundation import *
from Foundation import NSCFData
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
class TestData(TestCase):
def testTypes(self):
try:
NSCFData = objc.lookUpClass("__NSCFData")
except objc.error:
NS... |
parts | vocal | # 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
... |
Models | NozzleModel | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import cura.CuraApplication # Imported like this to prevent circular dependencies.
from cura.Machines.ContainerTree import ContainerTree
from PyQt6.QtCore import Qt
from UM.Logger import Logger
from UM.Qt.ListModel import ... |
util | hidden | # 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, ... |
pubsub | pub | # --------------------------------------------------------------------------
# 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... |
webengine | webview | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""The main browser widget for QtWebEngine."""
from typing import Iterable, List
from qutebrowser.browser import shared
from qutebrowser.browser.webengine import certificateerror, webengineset... |
views | users | import binascii
import math
import time
from ipaddress import ip_address
from itertools import chain
import flask
from flask_paginate import Pagination
from itsdangerous import BadSignature, URLSafeSerializer
from nyaa import forms, models
from nyaa.extensions import db
from nyaa.search import (
DEFAULT_MAX_SEARCH... |
extractor | cliprs | # coding: utf-8
from __future__ import unicode_literals
from .onet import OnetBaseIE
class ClipRsIE(OnetBaseIE):
_VALID_URL = r"https?://(?:www\.)?clip\.rs/(?P<id>[^/]+)/\d+"
_TEST = {
"url": "http://www.clip.rs/premijera-frajle-predstavljaju-novi-spot-za-pesmu-moli-me-moli/3732",
"md5": "c41... |
imageserver | data_manager | #
# Quru Image Server
#
# Document: data_manager.py
# Date started: 09 Aug 2011
# By: Matt Fozard
# Purpose: General purpose database access and data management.
# Specialist areas such as stats and image caching are handled elsewhere.
# Requires: SQLAlchemy
# Copyright: Q... |
fitRemoteReps | getter | # =============================================================================
# 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 ... |
groups-join-query | groups_join_query | from typing import Dict, Optional, Tuple, Union
from posthog.models import Filter
from posthog.models.filters.path_filter import PathFilter
from posthog.models.filters.retention_filter import RetentionFilter
from posthog.models.filters.stickiness_filter import StickinessFilter
from posthog.queries.column_optimizer.col... |
archiver | rcompress_cmd | import argparse
from collections import defaultdict
from ..compress import COMPRESSOR_TABLE, Auto, CompressionSpec, ObfuscateSize
from ..constants import * # NOQA
from ..helpers import ProgressIndicatorPercent, sig_int
from ..logger import create_logger
from ..manifest import Manifest
from ._common import Highlander,... |
lib | meta | # This file is part of MyPaint.
# Copyright (C) 2014-2016 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 by
# the Free Software Foundation; either version 2 of the License, or
# (at ... |
ocrolib | h5utils | from __future__ import print_function
import re
import tables
from numpy import dtype
def table_copy(source, dest, names=None, omit=[], verbose=1):
if names is None:
names = [
name
for name in dir(source.root)
if re.match(r"^[a-zA-Z][a-zA-Z0-9_][a-zA-Z0-9]*$", name)
... |
analog | qa_random_uniform_source | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy as np
from gnuradio import analog, blocks, gr, gr_unittest
class qa_random_uniform_source(gr_unittest.TestCase):
def s... |
settings | base | import base64
import json
import os
import typing
from random import randrange
from celery.schedules import crontab
from common.utils import getenv_boolean, getenv_integer
from firebase_admin import credentials, initialize_app
VERSION = "dev-oss"
SEND_ANONYMOUS_USAGE_STATS = getenv_boolean("SEND_ANONYMOUS_USAGE_STATS... |
ordered-model | viewset | from common.api_helpers.exceptions import BadRequest
from common.insight_log import EntityEvent, write_resource_insight_log
from rest_framework import serializers, status
from rest_framework.decorators import action
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framew... |
PartDesignTests | TestThickness | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
daw | track_colors | import ast
from sglib.models import theme
class TrackColors:
__slots__ = [
"colors",
]
def __init__(self):
self.colors = {}
def _check_color(self, a_track_num):
a_track_num = int(a_track_num)
if a_track_num not in self.colors:
default_track_colors = theme... |
admin | invite | """ invites when registration is closed """
import operator
from functools import reduce
from urllib.parse import urlencode
from bookwyrm import emailing, forms, models
from bookwyrm.settings import PAGE_LENGTH
from django.contrib.auth.decorators import login_required, permission_required
from django.core.paginator im... |
gadgets | arbitraryhighlighter | # 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
... |
widgets | multifx10 | import copy
from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
from .knob import ArcType
from .multifx_tooltips import MULTIFX_INFO, MultiFXInfo, mfx_set_tooltip
MULTIFX10_CLIPBOARD = None
MULTIFX10_INFO = copy.deepcopy(MULTIFX_INFO)
MULTIFX10_INFO.update(
{
... |
tools | check_num_args | #!/usr/bin/env python3
"""Count the number of arguments used to call a particular function in a codebase.
"""
__copyright__ = "Copyright (C) 2016 Martin Blais"
__license__ = "GNU GPLv2"
import argparse
import ast
import logging
import os
import sys
from os import path
def find_files(rootdir):
if path.isfile(roo... |
services | factories | # -*- coding: utf-8 -*-
"""
flaskbb.auth.services.factories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Factory functions for various FlaskBB auth services
These factories are provisional.
:copyright: 2014-2018 the FlaskBB Team.
:license: BSD, see LICENSE for more details
"""
from datetime import timedelt... |
commands | raw_processor | import queue
import threading
from multiprocessing import cpu_count
from time import sleep
from django.core.management.base import BaseCommand
from photonix.photos.models import Task
from photonix.photos.utils.raw import process_raw_task
from photonix.photos.utils.tasks import requeue_stuck_tasks
from photonix.web.uti... |
src | helper_msgcoding | """
Message encoding end decoding functions
"""
import string
import zlib
import messagetypes
from bmconfigparser import config
from debug import logger
from tr import _translate
try:
import msgpack
except ImportError:
try:
import umsgpack as msgpack
except ImportError:
import fallback.um... |
codegen | override | """Code for loading up an override file.
The override file provides implementations of functions where the code
generator could not do its job correctly.
This is a simple rip-off of the override script used in PyGTK.
"""
import re
from typing import List
OVERRIDE_RE = re.compile(
r"^override\s+(?P<name>[\w.]+)(... |
PathTests | TestPathRotationGenerator | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
protos | ssd_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/ssd.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 impor... |
conversions | releaseOceanus | """
Conversion pack for Oceanus Module Tiericide
"""
CONVERSIONS = {
"Basic Capacitor Flux Coil": "'Basic' Capacitor Flux Coil",
"Basic LADAR Backup Array": "Basic Ladar Backup Array",
"LADAR Backup Array I": "Ladar Backup Array I",
"LADAR Backup Array II": "Ladar Backup Array II",
"'Regard' Remote... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.