section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
Pipeline
model
import base64 import hashlib import io import json import re from datetime import datetime from hashlib import sha256 from os import path class ExternalNER: def __init__(self): self.id = "" self.uri = "" @classmethod def Init(cls, Id, Uri): eNER = cls() eNER.id = Id.lower(...
commands
import_demo_photos
import os from pathlib import Path from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from django.db.utils import IntegrityError from photonix.photos.models import Library, LibraryPath, LibraryUser from photonix.photos.utils.db import record_photo from photonix.photos.ut...
util
logging
# Copyright 2014 Christoph Reiter # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. from __future__ import absolute_imp...
Arch
ArchWall
# *************************************************************************** # * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
zeromq
qa_zeromq_pushpull
#!/usr/bin/env python # # Copyright 2014 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import time from gnuradio import blocks, gr, gr_unittest, zeromq class qa_zeromq_pushpull(gr_unittest.TestCase): def setUp(self): self.send_tb = g...
extractor
escapist
from __future__ import unicode_literals from ..utils import clean_html, determine_ext, float_or_none, int_or_none from .common import InfoExtractor def _decrypt_config(key, string): a = "" i = "" r = "" while len(a) < (len(string) / 2): a += key a = a[0 : int(len(string) / 2)] t = ...
gui
Actions
""" Copyright 2007-2011 Free Software Foundation, Inc. This file is part of GNU Radio SPDX-License-Identifier: GPL-2.0-or-later """ import logging from gi.repository import Gdk, Gio, GLib, GObject, Gtk from . import Utils log = logging.getLogger(__name__) def filter_from_dict(vars): return filter(lambda x:...
plugins
sellgains_test
__copyright__ = "Copyright (C) 2015-2017 Martin Blais" __license__ = "GNU GPLv2" import unittest from beancount import loader from beancount.ops import validation from beancount.parser import printer from beancount.plugins import sellgains class TestSellGains(unittest.TestCase): @loader.load_doc() def test...
utils
search
# -*- coding: utf-8 -*- """ flaskbb.utils.search ~~~~~~~~~~~~~~~~~~~~ This module contains all the whoosheers for FlaskBB's full text search. :copyright: (c) 2016 by the FlaskBB Team. :license: BSD, see LICENSE for more details. """ import logging import whoosh from flask_whooshee import Abst...
doc
conf
# -*- coding: utf-8 -*- # # Exaile documentation build configuration file, created by # sphinx-quickstart on Mon Jul 31 17:15:07 2017. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # Al...
m3u
playlists
from __future__ import annotations import contextlib import locale import logging import operator import os import tempfile from collections.abc import Generator from pathlib import Path from typing import IO, TYPE_CHECKING, Any, Optional, Union, cast from mopidy import backend from mopidy.exceptions import BackendEr...
lib
autosave
# This file is part of MyPaint. # Copyright (C) 2015 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 your ...
mpdserver
avahi
# Copyright 2014 Christoph Reiter <reiter.christoph@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 your option) any later version. from c...
utils
visualization_utils
# 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...
guitarscene
Neck
##################################################################### # -*- coding: utf-8 -*- # # # # Frets on Fire # # Copyright (C) 2009 Team FoFiX ...
draftobjects
wpproxy
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * Copyright (c) 2020 FreeCAD Developers * # * ...
bitmessageqt
support
"""Composing support request message functions.""" # pylint: disable=no-member import ctypes import ssl import sys import time import account import defaults import network.stats import paths import proofofwork import queues import state from bmconfigparser import config from foldertree import AccountMixin from helpe...
tools
pygettext
#! /usr/bin/env python3 # -*- coding: iso-8859-1 -*- # Originally written by Barry Warsaw <barry@python.org> # # Minimally patched to make it even more xgettext compatible # by Peter Funk <pf@artcom-gmbh.de> # # 2002-11-22 Jrgen Hermann <jh@web.de> # Added checks that _() only contains string literals, and # command li...
cmd
list_idx
from __future__ import absolute_import, print_function import sys from binascii import hexlify, unhexlify from bup import git, options from bup.compat import argv_bytes from bup.helpers import add_error, handle_ctrl_c, log, qprogress, saved_errors from bup.io import byte_stream optspec = """ bup list-idx [--find=<pr...
util
settingsoverride
# -*- coding: utf-8 -*- # # Picard, the next-generation MusicBrainz tagger # # Copyright (C) 2019-2021 Laurent Monin # Copyright (C) 2020 Tim Gates # # 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 Foundati...
diagram
instanteditors
from __future__ import annotations from functools import singledispatch from gaphas import Item from gaphas.geometry import Rectangle from gaphor.diagram.presentation import LinePresentation, Named, Valued from gaphor.transaction import Transaction from gi.repository import Gdk, Gtk @singledispatch def instant_edit...
saveddata
damagePattern
# =============================================================================== # 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, ...
frescobaldi-app
externalcommand
# This file is part of the Frescobaldi project, http://www.frescobaldi.org/ # # Copyright (c) 2015 - 2015 by Wilbert Berendsen and Pavel Roskin # # 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; ...
WebServicesTool
WSTApplicationDelegateClass
""" WSTApplicationDelegateClass An instance of this class is instantiated in the MainMenu.nib default NIB file. """ from Cocoa import * from PyObjCTools import AppHelper from twisted.internet import reactor from WSTConnectionWindowControllerClass import WSTConnectionWindowController class WSTApplicationDelegate(NSO...
PyObjCTest
test_nsfilehandle
from Foundation import * from PyObjCTools.TestSupport import * try: unicode except NameError: unicode = str class TestNSFileHandle(TestCase): def testConstants(self): self.assertIsInstance(NSFileHandleOperationException, unicode) self.assertIsInstance(NSFileHandleReadCompletionNotificatio...
layer
test
# This file is part of MyPaint. # Copyright (C) 2011-2015 by Andrew Chadwick <a.t.chadwick@gmail.com> # Copyright (C) 2007-2012 by Martin Renold <martinxyz@gmx.ch> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
cli
rm
# # Copyright 2018 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Remove blocks module """ import click from ..core import ModToolRemove, get_block_candidates from ..tools import SequenceCompleter from .base import block_name, cli_input, common...
frescobaldi-app
historymanager
# 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 ...
puddletag
setup
# -*- coding: utf-8 -*- from setuptools import setup def _runtime_dependencies(): """Read the runtime dependencies from the requirements file""" with open("requirements.txt") as f: return f.read().splitlines() def _version(): """Read the version from the puddlestuff package""" version = {} ...
community
knowledge_payload
from dataclasses import dataclass from ipv8.messaging.payload_dataclass import overwrite_dataclass, type_from_format dataclass = overwrite_dataclass(dataclass) @dataclass class StatementOperation: """Do not change the format of the StatementOperation, because this will result in an invalid signature.""" su...
core
SceneFactory
##################################################################### # -*- coding: utf-8 -*- # # # # Frets on Fire X (FoFiX) # # Copyright (C) 2006 Sami Kyöstilä ...
windows
preview_thread
""" @file @brief This file contains the preview thread, used for displaying previews of the timeline @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.o...
grc
gen_uhd_usrp_blocks
""" Copyright 2010-2011,2014,2018 Free Software Foundation, Inc. This file is part of GNU Radio SPDX-License-Identifier: GPL-2.0-or-later """ import sys MAIN_TMPL = """\ id: uhd_usrp_${sourk} label: 'UHD: USRP ${sourk.title()}' flags: [python, cpp, throttle] parameters: - id: type label: ${direction.title()...
Arch
OfflineRenderingUtils
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2019 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it a...
PyObjCTest
test_cfnotificationcenter
from CoreFoundation import * from PyObjCTools.TestSupport import * try: long except NameError: long = int class TestNotificationCenter(TestCase): def testTypes(self): self.assertIsCFType(CFNotificationCenterRef) def testTypeID(self): self.assertIsInstance(CFNotificationCenterGetTypeI...
misc
lineparser
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Parser for line-based files like histories.""" import contextlib import os import os.path from typing import Sequence from qutebrowser.config import config from qutebrowser.qt.core import Q...
module
changeCharges
import wx from gui.fitCommands.helpers import restoreCheckedStates from logbook import Logger from service.fit import Fit from service.market import Market pyfalog = Logger(__name__) class CalcChangeModuleChargesCommand(wx.Command): def __init__( self, fitID, projected, chargeMap, ignoreRestrictions=Fals...
interaction-payloads
block_actions
""" [Documentation](https://api.slack.com/reference/interaction-payloads/block-actions) """ import enum import typing from apps.slack.types.common import BaseEvent, Channel, Container, Message, PayloadType class BlockActionType(enum.StrEnum): """ https://api.slack.com/reference/interaction-payloads/block-ac...
fitWarpTime
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 ...
util
connection
import socket try: from select import POLLIN, poll except ImportError: # `poll` doesn't exist on OSX and other platforms poll = False try: from select import select except ImportError: # `select` doesn't exist on AppEngine. select = False def is_connection_dropped(conn): # Platform...
aliceVision
PanoramaMerging
__version__ = "1.0" import json import os from meshroom.core import desc class PanoramaMerging(desc.AVCommandLineNode): commandLine = "aliceVision_panoramaMerging {allParams}" size = desc.DynamicNodeSize("input") cpu = desc.Level.NORMAL ram = desc.Level.INTENSIVE category = "Panorama HDR" d...
extractor
gdcvault
from __future__ import unicode_literals import re from ..utils import ( HEADRequest, remove_start, sanitized_Request, smuggle_url, urlencode_postdata, ) from .common import InfoExtractor from .kaltura import KalturaIE class GDCVaultIE(InfoExtractor): _VALID_URL = ( r"https?://(?:www\...
versions
b61e4f6a88cc_del_torrents_info
"""Remove bencoded info dicts from mysql Revision ID: b61e4f6a88cc Revises: cf7bf6d0e6bd Create Date: 2017-08-29 01:45:08.357936 """ import sys import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import mysql # revision identifiers, used by Alembic. revision = "b61e4f6a88cc" down_revision = "cf7...
extractor
eitb
# coding: utf-8 from __future__ import unicode_literals from ..utils import float_or_none, int_or_none, parse_iso8601, sanitized_Request from .common import InfoExtractor class EitbIE(InfoExtractor): IE_NAME = "eitb.tv" _VALID_URL = ( r"https?://(?:www\.)?eitb\.tv/(?:eu/bideoa|es/video)/[^/]+/\d+/(?P...
digital
qa_cpm
#!/usr/bin/env python # # Copyright 2010,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import numpy from gnuradio import analog, blocks, digital, gr, gr_unittest class test_cpm(gr_unittest.TestCase): def setUp(self): self.tb = gr...
sabnzbd
filesystem
#!/usr/bin/python3 -OO # Copyright 2008-2017 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...
RemotePyInterpreter
RemotePyInterpreter
import keyword import sys import time import traceback import sets from AppKit import * from Foundation import * from PyObjCTools import AppHelper, NibClassBuilder NibClassBuilder.extractClasses("RemotePyInterpreterDocument.nib") from AsyncPythonInterpreter import * from ConsoleReactor import * from netrepr import R...
lib
certgen
# -*- coding: latin-1 -*- # # Copyright (C) Martin Sjgren and AB Strakt 2001, All rights reserved # Copyright (C) Jean-Paul Calderone 2008, All rights reserved # This file is licenced under the GNU LESSER GENERAL PUBLIC LICENSE Version 2.1 or later (aka LGPL v2.1) # Please see LGPL2.1.txt for more information """ Certi...
experiments
utils
from typing import Set, Union from posthog.client import sync_execute from posthog.constants import TREND_FILTER_TYPE_ACTIONS from posthog.models.filters.filter import Filter from posthog.models.team.team import Team from posthog.queries.query_date_range import QueryDateRange def requires_flag_warning(filter: Filter...
beetsplug
rewrite
# 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
soundgasm
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor class SoundgasmIE(InfoExtractor): IE_NAME = "soundgasm" _VALID_URL = r"https?://(?:www\.)?soundgasm\.net/u/(?P<user>[0-9a-zA-Z_-]+)/(?P<display_id>[0-9a-zA-Z_-]+)" _TEST = { "url": "http://soundga...
cura
Layer
# Copyright (c) 2019 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. from typing import List import numpy from cura.LayerPolygon import LayerPolygon from UM.Mesh.MeshBuilder import MeshBuilder from UM.Mesh.MeshData import MeshData class Layer: def __init__(self, layer_id: int) -> None...
controllers
captcha
# 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, ...
webkit
webkitinspector
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Customized QWebInspector for QtWebKit.""" from qutebrowser.browser import inspector from qutebrowser.misc import miscwidgets # pylint: disable=no-name-in-module from qutebrowser.qt.webkit i...
mixins
session_recordings
import json from typing import List, Literal, Optional from posthog.constants import PERSON_UUID_FILTER, SESSION_RECORDINGS_FILTER_IDS from posthog.models.filters.mixins.common import BaseParamMixin from posthog.models.filters.mixins.utils import cached_property from posthog.models.property import Property class Per...
builtinContextMenus
fitAddCurrentlyOpen
# noinspection PyPackageRequirements import gui.mainFrame import wx from gui.builtinViews.emptyView import BlankPage from gui.contextMenu import ContextMenuUnconditional from service.fit import Fit _t = wx.GetTranslation class AddCurrentlyOpenFit(ContextMenuUnconditional): def __init__(self): self.mainF...
analog
qa_cpfsk
#!/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 analog, blocks, gr, gr_unittest class test_cpfsk_bc(gr_unittest.TestCase): def setUp(self): self.tb = gr.top...
dev
run_profile
#!/usr/bin/env python3 # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Profile qutebrowser.""" import argparse import cProfile import os import os.path import shlex import shutil import subprocess import sys import tempfile sys.path.ins...
models
slack_user_identity
import logging import typing import requests from apps.slack.client import SlackClient from apps.slack.constants import SLACK_BOT_ID from apps.slack.errors import ( SlackAPICannotDMBotError, SlackAPIInvalidAuthError, SlackAPITokenError, SlackAPIUserNotFoundError, ) from apps.slack.scenarios.notified_us...
extractor
manyvids
# coding: utf-8 from __future__ import unicode_literals import re from ..compat import compat_str from ..utils import ( determine_ext, extract_attributes, int_or_none, str_to_int, url_or_none, urlencode_postdata, ) from .common import InfoExtractor class ManyVidsIE(InfoExtractor): _VALID...
plover
registry
from collections import namedtuple import pkg_resources from plover import log from plover.oslayer.config import PLUGINS_PLATFORM class Plugin: def __init__(self, plugin_type, name, obj): self.plugin_type = plugin_type self.name = name self.obj = obj self.__doc__ = obj.__doc__ or ...
commands
argparser
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """argparse.ArgumentParser subclass to parse qutebrowser commands.""" import argparse from qutebrowser.commands import cmdexc from qutebrowser.qt.core import QUrl from qutebrowser.utils import...
extractors
yizhibo
#!/usr/bin/env python __all__ = ["yizhibo_download"] import json import time from ..common import * def yizhibo_download(url, output_dir=".", merge=True, info_only=False, **kwargs): video_id = url[url.rfind("/") + 1 :].split(".")[0] json_request_url = ( "http://www.yizhibo.com/live/h5api/get_basic_...
downloaders
FilericeCom
# -*- coding: utf-8 -*- from ..base.xfs_downloader import XFSDownloader class FilericeCom(XFSDownloader): __name__ = "FilericeCom" __type__ = "downloader" __version__ = "0.01" __status__ = "testing" __pattern__ = r"https?://(?:www\.)?filerice\.com/(?P<ID>\w{12})" __config__ = [ ("ena...
Gui
Slot
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2020 Russell Johnson (russ4262) <russ4262@gmail.com> * # * * # * This program is free software; you can redistribute it a...
panels
sbe_notifications
"""This panel manages user setting for email reminders related to the SBE (social netowking) app.""" from __future__ import annotations from abilian.core.extensions import db from abilian.i18n import _, _l from abilian.services.preferences.panel import PreferencePanel from abilian.web import csrf from abilian.web.form...
contrib
import_blogger
#!/usr/bin/env python # -*- encoding: utf-8 -*- """Comment importer from Blogger This python script can convert comments posted to a Blogger-powered blog to a JSON file with can then be imported into Isso (by following the procedure explained in docs/docs/extras/advanced-migration.rst. The script can be run like thi...
ui
ui_scripteditor_details
# -*- coding: utf-8 -*- # Automatically generated - don't edit. # Use `python setup.py build_ui` to update it. from PyQt5 import QtCore, QtGui, QtWidgets class Ui_ScriptDetails(object): def setupUi(self, ScriptDetails): ScriptDetails.setObjectName("ScriptDetails") ScriptDetails.setWindowModalit...
PyObjCTest
test_nsvalue
from Foundation import * from PyObjCTools.TestSupport import * class TestNSValue(TestCase): def testMethods(self): self.assertArgIsBOOL(NSNumber.numberWithBool_, 0) self.assertArgIsBOOL(NSNumber.initWithBool_, 0) self.assertResultIsBOOL(NSNumber.boolValue) self.assertResultIsBOOL(N...
config
configcommands
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Commands related to the configuration.""" import contextlib import os.path from typing import TYPE_CHECKING, Any, Iterator, List, Optional, Tuple from qutebrowser.api import cmdutils from q...
ops
compress_test
__copyright__ = "Copyright (C) 2016 Martin Blais" __license__ = "GNU GPLv2" import unittest from beancount import loader from beancount.core import data from beancount.ops import compress from beancount.parser import cmptest class TestMerge(cmptest.TestCase): @loader.load_doc() def test_merge(self, entries...
externals
extractMaildirAttachments
# Author Ian Lewis # http://www.ianlewis.org/en/parsing-email-attachments-python # Modification # Author Joseph Perry # date Aug 10 2010 import email import sys import uuid from io import StringIO def parse_attachment(message_part, state, attachments=None): """Extract the attachment and metadata about it from the...
Base
SetupSheet
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
PyObjCTest
test_nsobject
from Foundation import * from PyObjCTools.TestSupport import * try: long except NameError: long = int class TestNSObjectHelper(NSObject): def copyWithZone_(self, zn): return None def mutableCopyWithZone_(self, zn): return None def isContentDiscarded(self): return 1 ...
sabnzbd
constants
#!/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...
calc
itemRebase
import wx from logbook import Logger from service.fit import Fit from service.market import Market pyfalog = Logger(__name__) class CalcRebaseItemCommand(wx.Command): def __init__(self, fitID, containerName, position, itemID): wx.Command.__init__(self, True, "Rebase Item") self.fitID = fitID ...
PyObjCTest
test_cgpdfarray
from PyObjCTools.TestSupport import * from Quartz.CoreGraphics import * class TestCGPDFArray(TestCase): @expectedFailure def testIncomplete(self): self.fail("Tests are too minimal") def testTypes(self): self.assertIsOpaquePointer(CGPDFArrayRef) def testFunctions(self): self.a...
util
logger
#!/usr/bin/python3 # -*- coding: utf-8 -*- # # SoundConverter - GNOME application for converting between audio formats. # Copyright 2004 Lars Wirzenius # Copyright 2005-2020 Gautier Portet # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as ...
bukuserver
filters
from enum import Enum from flask_admin.model import filters class BookmarkField(Enum): ID = 0 URL = 1 TITLE = 2 TAGS = 3 DESCRIPTION = 4 def equal_func(query, value, index): return filter(lambda x: x[index] == value, query) def not_equal_func(query, value, index): return filter(lambda...
plotting
cmrmap_generate
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2015, Timothée Lecomte # Copyright (c) 2012, Christopher Hummersone # Copyright (c) 2002, Carey Rappaport # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
network
stats
""" Network statistics """ import time import asyncore_pollchoose as asyncore from network.connectionpool import BMConnectionPool from objectracker import missingObjects lastReceivedTimestamp = time.time() lastReceivedBytes = 0 currentReceivedSpeed = 0 lastSentTimestamp = time.time() lastSentBytes = 0 currentSentSpee...
beetsplug
bucket
# This file is part of beets. # Copyright 2016, Fabrice Laporte. # # 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,...
file-import
musicxml
# 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 ...
meshes
mesh_platewithhole_tetra10
def create_nodes(femmesh): # nodes femmesh.addNode(-200.0, -100.0, 0.0, 1) femmesh.addNode(-200.0, -100.0, 10.0, 2) femmesh.addNode(200.0, -100.0, 0.0, 3) femmesh.addNode(200.0, -100.0, 10.0, 4) femmesh.addNode(200.0, 100.0, 0.0, 5) femmesh.addNode(200.0, 100.0, 10.0, 6) femmesh.addNode(...
uploads
uploaders
import datetime import os import posixpath import string import time from pathlib import PurePath from shutil import copyfileobj, rmtree from urllib.parse import urlparse import boto3 from botocore.client import Config from CTFd.utils import get_app_config from CTFd.utils.encoding import hexencode from flask import cu...
commands
create_admin_from_env
import os from pathlib import Path from django.contrib.auth import get_user_model from django.core.management.base import BaseCommand from django.db.utils import IntegrityError from photonix.photos.models import Library, LibraryPath, LibraryUser from photonix.photos.utils.db import record_photo from photonix.photos.ut...
wiki
markup
"""Set up the markdown converter. Add extensions here (for now). """ from __future__ import annotations import markdown from abilian.sbe.apps.wiki.models import WikiPage from flask import url_for from markdown.core import Markdown from markdown.extensions.wikilinks import WikiLinkExtension, WikiLinksInlineProcessor f...
core
iosignature
# # Copyright 2019 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Module to get io_signature of the header block """ import itertools import logging import re import string from ..core import Constants LOGGER = logging.getLogger(__name__) de...
utils
shape_utils_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...
eos
const
# ============================================================================= # Copyright (C) 2019 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...
utils
config_util
# 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...
extractor
izlesene
# coding: utf-8 from __future__ import unicode_literals from ..compat import compat_str, compat_urllib_parse_unquote from ..utils import ( determine_ext, float_or_none, get_element_by_id, int_or_none, parse_iso8601, str_to_int, ) from .common import InfoExtractor class IzleseneIE(InfoExtracto...
localModule
changeCharges
import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.module.changeCharges import CalcChangeModuleChargesCommand from gui.fitCommands.helpers import InternalCommandHistory from service.fit import Fit class GuiChangeLocalModuleChargesCommand(wx.Command): def __in...
migrations
0001_initial_squashed_0284_improved_caching_state_idx
# Generated by Django 3.2.16 on 2022-12-30 21:18 import django.contrib.auth.models import django.contrib.auth.validators import django.contrib.postgres.fields import django.contrib.postgres.fields.jsonb import django.contrib.postgres.indexes import django.contrib.postgres.operations import django.core.validators impor...
StartPage
LoadMRU
# *************************************************************************** # * Copyright (c) 2018 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
plugins
vidio
""" $description Indonesian & international live TV channels and video on-demand service. OTT service from Vidio. $url vidio.com $type live, vod """ import logging import re from urllib.parse import urlsplit, urlunsplit from streamlink.plugin import Plugin, pluginmatcher from streamlink.plugin.api import validate fro...
clientScripts
convert_dataverse_structure
#!/usr/bin/env python """Convert Dataverse Structure Given a transfer type Dataverse, read the metadata submission object ``dataset.json`` to generate a Dataverse METS.xml file. This METS file will then later be used to create a Transfer METS.xml document as part of the Archivematica submission information package (SI...
socks-servers
socks_servers_component
from typing import List from tribler.core.components.component import Component from tribler.core.components.reporter.reporter_component import ReporterComponent from tribler.core.components.socks_servers.socks5.server import Socks5Server from tribler.core.utilities.network_utils import default_network_utils NUM_SOCK...
scripts
lsprofcalltree
# lsprofcalltree.py: lsprof output which is readable by kcachegrind # David Allouche # Jp Calderone & Itamar Shtull-Trauring # Johan Dahlin import optparse import os import sys try: import cProfile except ImportError: raise SystemExit("This script requires cProfile from Python 2.5") def label(code): if ...
PyObjCTest
test_nsscanner
import objc from Foundation import * from PyObjCTools.TestSupport import * class TestNSScannerUsage(TestCase): # Python 2.2 doesn't have this one: def assertAlmostEquals(self, val1, val2, message=None): self.assert_(abs(val1 - val2) < 0.00001, message) def testUsage(self): obj = NSScanner...