section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
docker | install_and_upload_python_packages | import argparse
import os
import re
import subprocess
os.environ["PYTHONUNBUFFERED"] = "1"
class LineProcessor:
whl_name = None
folder = None
def __init__(self, username, password, env):
self.username = username
self.password = password
self.env = env
def process_line(self, ... |
utils | file_utils | """File utilities.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import contextlib
import logging
import os
import time
from os import path
def find_files(fords, ignore_dirs=(".hg", ".svn", ".git"), ignore_files=(".DS_Store",)):
"""Enumerate the files under the given direc... |
fingerprint | acoustid | # Copyright 2011,2013 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import collections
import gzip... |
util | lrucache | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2017 Antonio Larrosa
# Copyright (C) 2018-2021 Laurent Monin
#
# 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 Fo... |
shelf | shelf | """ shelf views """
from collections import namedtuple
from bookwyrm import forms, models
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.views.helpers import get_user_from_username, is_api_request
from django.contrib.auth.decorators import login_required
fr... |
installer | build_server | """
@file
@brief Build server used to generate daily builds of libopenshot-audio, libopenshot, and openshot-qt
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2016 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.... |
extractor | pokemon | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import extract_attributes, int_or_none
from .common import InfoExtractor
class PokemonIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?pokemon\.com/[a-z]{2}(?:.*?play=(?P<id>[a-z0-9]{32})|/(?:[^/]+/)+(?P<display_id>[^/?#&]+))"
... |
post-processing | autoProcessComics | import os.path
import platform
import sys
import urllib
import ConfigParser
import urllib2
try:
import requests
use_requests = True
except ImportError:
print '''Requests module not found on system. I'll revert so this will work, but you probably should install
requests to bypass this in the futur... |
Crypt | CryptHash | import base64
import hashlib
import os
def sha512sum(file, blocksize=65536, format="hexdigest"):
if type(file) is str: # Filename specified
file = open(file, "rb")
hash = hashlib.sha512()
for block in iter(lambda: file.read(blocksize), b""):
hash.update(block)
# Truncate to 256bits i... |
kibitzr | cli | import logging
import sys
import click
import entrypoints
LOG_LEVEL_CODES = {
"debug": logging.DEBUG,
"info": logging.INFO,
"warning": logging.WARNING,
"error": logging.ERROR,
}
def merge_extensions(click_group):
"""
Each extension is called with click group for
ultimate agility while pr... |
bup | midx | from __future__ import absolute_import, print_function
import glob
import os
import struct
from bup import _helpers
from bup.compat import pending_raise
from bup.helpers import log, mmap_read
from bup.io import path_msg
MIDX_VERSION = 4
extract_bits = _helpers.extract_bits
_total_searches = 0
_total_steps = 0
cla... |
versions | ef87d69ec29a_add_topics_and_challenge_topics_tables | """Add topics and challenge_topics tables
Revision ID: ef87d69ec29a
Revises: 07dfbe5e1edc
Create Date: 2021-07-29 23:22:39.345426
"""
import sqlalchemy as sa
from alembic import op # noqa: I001
# revision identifiers, used by Alembic.
revision = "ef87d69ec29a"
down_revision = "07dfbe5e1edc"
branch_labels = None
dep... |
mackup | config | """Package used to manage the .mackup.cfg config file."""
import os
import os.path
from .constants import (
CUSTOM_APPS_DIR,
ENGINE_COPY,
ENGINE_DROPBOX,
ENGINE_FS,
ENGINE_GDRIVE,
ENGINE_ICLOUD,
MACKUP_BACKUP_PATH,
MACKUP_CONFIG_FILE,
)
from .utils import (
error,
get_copy_fold... |
webengine | spell | # SPDX-FileCopyrightText: Michal Siedlaczek <michal.siedlaczek@gmail.com>
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Installing and configuring spell-checking for QtWebEngine."""
import glob
import os
import os.path
import re
from ... |
plover-build-utils | tree | #!/usr/bin/env python3
import functools
import operator
import os.path
import stat
import sys
from pathlib import Path
BLOCK_SIZES = (
(1024 * 1024 * 1024 * 1024, "T"),
(1024 * 1024 * 1024, "G"),
(1024 * 1024, "M"),
(1024, "K"),
)
def format_size(size):
for bs, unit in BLOCK_SIZES:
if si... |
email | tasks | from socket import gaierror
from apps.alerts.models import AlertGroup
from apps.base.utils import live_settings
from apps.email.alert_rendering import build_subject_and_message
from apps.email.models import EmailMessage
from apps.user_management.models import User
from celery.utils.log import get_task_logger
from comm... |
Debug | DebugReloader | import logging
import os
import time
from Config import config
if config.debug and config.action == "main":
try:
import watchdog
import watchdog.events
import watchdog.observers
logging.debug("Watchdog fs listener detected, source code autoreload enabled")
enabled = True
... |
utils | url | import os
from cactus.utils.helpers import CaseInsensitiveDict
from six.moves import http_client, urllib
EXTERNAL_SCHEMES = ("//", "http://", "https://", "mailto:")
def getURLHeaders(url):
url = urllib.parse.urlparse(url)
conn = http_client.HTTPConnection(url.netloc)
conn.request("HEAD", urllib.parse.q... |
extractor | onionstudios | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import js_to_json
from .common import InfoExtractor
class OnionStudiosIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?onionstudios\.com/(?:video(?:s/[^/]+-|/)|embed\?.*\bid=)(?P<id>\d+)(?!-)"
... |
Robot | InitGui | # Robot gui init module
# (c) 2009 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
# ***************************************************************************
# * Copyright (c) 2009 Juergen Riegel <juergen.rie... |
pynocchio | setup | import os
import sys
from codecs import open
from setuptools import find_packages, setup
version_path = os.path.join(
os.path.abspath(os.path.dirname(__file__)), "pynocchio", "__version__.py"
)
about = {}
with open(version_path, "r") as f:
exec(f.read(), about)
if sys.argv[-1] == "build_deb":
os.system... |
media | filesystem | # 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, ... |
httplib2 | socks | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
... |
SceneDetails | ObjectClipPlane | # /***************************************************************************
# * Copyright (c) 2019 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
codegen | coder | """The code generator for modeling languages.
This is the code generator for the models used by Gaphor.
In order to work with the code generator, a model should follow some conventions:
* `Profile` packages are only for profiles (excluded from generation)
* A stereotype `simpleAttribute` can be defined, which conver... |
nyaa | rangeban | #!/usr/bin/env python3
import sys
from datetime import datetime
from ipaddress import ip_address
import click
from nyaa import create_app, models
from nyaa.extensions import db
def is_cidr_valid(c):
"""Checks whether a CIDR range string is valid."""
try:
subnet, mask = c.split("/")
except ValueE... |
common | encode | # -*- Mode: Python; test-case-name: whipper.test.test_common_encode -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# th... |
PyObjCTest | test_testsupport | import ctypes
import sys
import unittest
import objc
from PyObjCTools import TestSupport
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
try:
unicode
except NameError:
unicode = str
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
... |
Content | ContentDbDict | import os
import time
from Config import config
from Debug import Debug
from . import ContentDb
class ContentDbDict(dict):
def __init__(self, site, *args, **kwargs):
s = time.time()
self.site = site
self.cached_keys = []
self.log = self.site.log
self.db = ContentDb.getCon... |
Code | GestorMateMap | from Code import ControlPosicion, Gestor, Jugada
from Code.Constantes import *
from Code.QT import QTUtil
class GestorMateMap(Gestor.Gestor):
def inicio(self, workmap):
self.workmap = workmap
self.ayudas = 0
fenInicial = workmap.fenAim()
self.rivalPensando = False
self.... |
Drawing | Init | # FreeCAD init script of the Image module
# (c) 2001 Juergen Riegel
# ***************************************************************************
# * (c) Juergen Riegel (juergen.riegel@web.de) 2002 *
# * *
# * This file ... |
tasks | sessions | import argparse
from httpie.context import Environment
from httpie.legacy import v3_1_0_session_cookie_format, v3_2_0_session_header_format
from httpie.manager.cli import missing_subcommand, parser
from httpie.sessions import SESSIONS_DIR_NAME, get_httpie_session
from httpie.status import ExitStatus
from httpie.utils ... |
GCodeReader | FlavorParser | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import math
import re
from typing import Dict, List, NamedTuple, Optional, Set, Union
import numpy
from cura.CuraApplication import CuraApplication
from cura.LayerDataBuilder import LayerDataBuilder
from cura.LayerDataDeco... |
AddonManager | addonmanager_uninstaller_gui | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
lib | appconfig | """
Configuration helper for MCPServer, MCPClient and Dashboard, used in:
- MCPClient/lib/settings/common.py
- MCPServer/lib/settings/common.py
- Dashboard/src/settings/base.py
Config. attributes are declared on those settings files and they can be defined
by a dictionary indicating the 'section', 'option... |
containers | TXT | # -*- coding: utf-8 -*-
import codecs
import os
from ..base.container import BaseContainer
class TXT(BaseContainer):
__name__ = "TXT"
__type__ = "container"
__version__ = "0.22"
__status__ = "testing"
__pattern__ = r".+\.(txt|text)$"
__config__ = [
("enabled", "bool", "Activated", Tr... |
qltk | delete | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2013-2017 Nick Boultbee
# 2013,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... |
builder | make_dmg | #!/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... |
templatetags | datetime | # -*- coding: utf-8 -*-
from django import template
from django.conf import settings
from django.utils import formats, timezone
from django.utils.translation import gettext_lazy as _
register = template.Library()
@register.filter()
def datetime_short(date):
"""
Format a datetime object as short string for li... |
RemotePyInterpreter | netrepr | import itertools
import types
import exceptions
def type_string(obj):
objType = type(obj)
if objType is types.InstanceType:
objType = obj.__class__
return getattr(objType, "__module__", "-") + "." + objType.__name__
class NetRepr(object):
def __init__(self, objectPool):
self.objectP... |
rhythm | rhythm | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2011 - 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
... |
core | prices_test | __copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import unittest
from beancount import loader
from beancount.core import prices
from beancount.core.number import D
from beancount.parser import cmptest
class TestPriceEntries(cmptest.TestCase):
@loader.load_doc()
... |
cargo | add | import wx
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcAddCargoCommand(wx.Command):
def __init__(self, fitID, cargoInfo):
wx.Command.__init__(self, True, "Add Cargo")
self.fitID = fitID
self.cargoInfo = cargoInfo
def Do(self):
py... |
plugins | channel | # -*- 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... |
plugins | deutschewelle | """
$description Live TV channels and video on-demand service from Deutsche Welle, a German public, state-owned broadcaster.
$url dw.com
$type live, vod
$metadata id
$metadata author
$metadata title
"""
import logging
import re
from urllib.parse import parse_qsl, urlparse
from streamlink.plugin import Plugin, pluginm... |
r2 | updateini | #!/usr/bin/env python
# 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
#... |
extractor | bpb | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import determine_ext, js_to_json
from .common import InfoExtractor
class BpbIE(InfoExtractor):
IE_DESC = "Bundeszentrale für politische Bildung"
_VALID_URL = r"https?://(?:www\.)?bpb\.de/mediathek/(?P<id>[0-9]+)/"
_TEST = {
... |
qtgui | graphicitem | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import os
import sys
import pmt
from gnuradio import gr
from PyQt5.QtCore import QSize
from PyQt5.QtCore import Qt as Qtc
from PyQt5.QtGu... |
dictization | model_save | # encoding: utf-8
from __future__ import annotations
import copy
import datetime
import logging
import uuid
from typing import TYPE_CHECKING, Any, Collection, Optional, Type, Union, cast, overload
import ckan.authz as authz
import ckan.lib.dictization as d
from ckan.types import Context
if TYPE_CHECKING:
import ... |
posthog | gunicorn_config | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import logging
import os
import socket
import struct
import sys
import threading
import time
import structlog
from prometheus_client import CollectorRegistry, Gauge, multiprocess, start_http_server
loglevel = "error"
keepalive = 120
# Set the timeout to something lower... |
cmd | cat_file | from __future__ import absolute_import
import re
import stat
import sys
from bup import git, options, vfs
from bup.compat import argv_bytes
from bup.helpers import chunkyreader, log, saved_errors
from bup.io import byte_stream
from bup.repo import LocalRepo
optspec = """
bup cat-file [--meta|--bupm] /branch/revision... |
ui | ui_options_renaming | # -*- 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_RenamingOptionsPage(object):
def setupUi(self, RenamingOptionsPage):
RenamingOptionsPage.setObjectName("RenamingOptionsPage")
Renami... |
AddonManager | package_list | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
scripts | glibc_check | #!/usr/bin/env python3
"""
Check if all given binaries work with the given glibc version.
glibc_check.py 2.11 bin [bin ...]
rc = 0 means "yes", rc = 1 means "no".
"""
import re
import subprocess
import sys
verbose = True
objdump = "objdump -T %s"
glibc_re = re.compile(r"GLIBC_([0-9]\.[0-9]+)")
def parse_version(v... |
View | Adv | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# A GAE web application to aggregate rss and send it to your kindle.
# Visit https://github.com/cdhigh/KindleEar for the latest version
# Contributors:
# rexdf <https://github.com/rexdf>
import datetime
import hashlib
import urllib
import StringIO
import urlparse
try:
... |
views | emojis_listview | """
@file
@brief This file contains the emojis listview, 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 ... |
landing | landing | """ non-interactive pages """
from bookwyrm import forms, models
from bookwyrm.views.feed import Feed
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.views import View
# pylint: disable= no-self-use
class Home(View):
"""landing page or home feed depending on... |
options | renaming_compat | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2008, 2011 Lukáš Lalinský
# Copyright (C) 2008-2009 Nikolai Prokoschenko
# Copyright (C) 2009-2010, 2014-2015, 2018-2022 Philipp Wolfer
# Copyright (C) 2011-2013 Michael Wiencek
# Copyright (C) 2011-2013 Wieland Hoffmann
#... |
MachineSettingsAction | MachineSettingsAction | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, Optional
import cura.CuraApplication # Imported like this to prevent circular dependencies.
import UM.i18n
from cura.MachineAction import MachineAction
from cura.Machines.ContainerTree im... |
femexamples | ccx_cantilever_nodeload | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * *
# * Th... |
scripts | dynapath_post | # ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
client | execute | import json
import threading
import types
from contextlib import contextmanager
from functools import lru_cache
from time import perf_counter
from typing import Any, Dict, List, Optional, Sequence, Union
import sqlparse
from clickhouse_driver import Client as SyncClient
from django.conf import settings as app_settings... |
femtaskpanels | task_material_common | # ***************************************************************************
# * Copyright (c) 2013 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
game | Debug | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2006 Sami Kyöstilä ... |
PathTests | TestPathThreadMilling | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
GCodeReader | GCodeReader | # Copyright (c) 2017 Aleph Objects, Inc.
# Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import TYPE_CHECKING, List, Optional, Union
from UM.Application import Application
from UM.FileHandler.FileReader import FileReader
from UM.i18n import i18nCatalog
from ... |
migrations | 0012_auto_20201024_1847 | # Generated by Django 3.1.2 on 2020-10-25 01:47
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0011_auto_20200813_0238"),
]
operations = [
migrations.AlterField(
model_name="settings",
name="timezone... |
ingest | views | # 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, either version 3 of the ... |
db | userrel | # 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, ... |
plugins | leafonly_test | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount import loader
class TestLeafOnly(unittest.TestCase):
@loader.load_doc(expect_errors=True)
def test_leaf_only1(self, _, errors, __):
"""
plugin "beancount.plugins.leafonly"
... |
gpodder | extensions | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2009 Thomas Perl and the gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version... |
clientScripts | verify_transfer_compliance | #!/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... |
migrations | 0006_auto_20230426_1631 | # Generated by Django 3.2.18 on 2023-04-26 16:31
import mirage.fields
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("webhooks", "0005_webhook_is_legacy"),
]
operations = [
migrations.AlterField(
model_name="webhook",
... |
migrations | 0013_auto_20220312_1215 | # Generated by Django 3.2.12 on 2022-03-12 12:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("photos", "0012_crt_photo_delete_fld"),
]
operations = [
migrations.AlterField(
model_name="phototag",
name="source",... |
migrations | 0338_datawarehouse_saved_query | # Generated by Django 3.2.19 on 2023-07-27 20:32
import django.db.models.deletion
import posthog.models.utils
import posthog.warehouse.models.datawarehouse_saved_query
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posth... |
qltk | playorder | # Copyright 2006 Joe Wreschnig
# 2016 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.
from gi... |
mako | template | # mako/template.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Provides the Template class, a facade for parsing, generating and executing
template strings, ... |
builders | box_predictor_builder_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... |
win | dist | # helper script to zip up pyinstaller distribution and create installer file
import os.path
import zipfile
from subprocess import call
import yaml
from packaging.version import Version
with open("version.yml", "r") as file:
data = yaml.load(file, Loader=yaml.SafeLoader)
version = data["version"]
os.environ[... |
plugins | songshelpers | # Copyright 2016 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.
"""Various `plugin_handles` helpers""... |
femobjects | constraint_tie | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
Worker | WorkerTaskManager | import bisect
from collections.abc import MutableSequence
class CustomSortedList(MutableSequence):
def __init__(self):
super().__init__()
self.items = [] # (priority, added index, actual value)
self.logging = False
def __repr__(self):
return "<{0} {1}>".format(self.__class__.... |
rules | tag_rules_base | from dataclasses import dataclass, field
from typing import AnyStr, Callable, Iterable, Optional, Pattern, Sequence
from tribler.core.components.knowledge.community.knowledge_validator import (
is_valid_resource,
)
@dataclass
class Rule:
patterns: Sequence[Pattern[AnyStr]] = field(default_factory=lambda: [])... |
statusbar | backforward | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Navigation (back/forward) indicator displayed in the statusbar."""
from qutebrowser.mainwindow.statusbar import textbase
class Backforward(textbase.TextBase):
"""Shows navigation indi... |
lib | organic | # 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, ... |
friture | octavefilters | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2009 Timoth?Lecomte
# This file is part of Friture.
#
# Friture is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as published by
# the Free Software Foundation.
#
# Friture is distribu... |
extractor | aenetworks | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
GeoRestrictedError,
int_or_none,
remove_start,
traverse_obj,
update_url_query,
urlencode_postdata,
)
from .theplatform import ThePlatformIE
class AENetworksBaseIE(ThePlatformIE):
_... |
widgets | settingspage | import json
import logging
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtWidgets import QCheckBox, QFileDialog, QMessageBox, QSizePolicy, QWidget
from tribler.core.utilities.osutils import get_root_state_directory
from tribler.core.utilities.path_util import Path
from tribler.core.utilities.simpledefs import MAX_LI... |
game | Menu | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
extensions | gtk_statusicon | # -*- coding: utf-8 -*-
#
# Gtk Status Icon (gPodder bug 1495)
# Thomas Perl <thp@gpodder.org>; 2012-07-31
#
import logging
import os.path
import gpodder
from gi.repository import GdkPixbuf, Gtk
from gpodder.gtkui import draw
logger = logging.getLogger(__name__)
_ = gpodder.gettext
__title__ = _("Gtk Status Icon")... |
widgets | downloadsdetailstabwidget | from enum import IntEnum
from pathlib import PurePosixPath
from typing import Dict, Optional
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtWidgets import QTabWidget, QTreeWidgetItem
from tribler.core.utilities.simpledefs import DownloadStatus
from tribler.gui.defs import STATUS_STRING
from tribler.gui.network.reque... |
extractors | cntv | #!/usr/bin/env python
import json
import re
from ..common import get_content, match1, playlist_not_supported, r1
from ..extractor import VideoExtractor
__all__ = ["cntv_download", "cntv_download_by_id"]
class CNTV(VideoExtractor):
name = "CNTV.com"
stream_types = [
{"id": "1", "video_profile": "128... |
CompoundTools | _CommandCompoundFilter | # ***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
Tool | Controller | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
digital | qa_scrambler | #!/usr/bin/env python
#
# Copyright 2008,2010,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy as np
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
from gnuradio.digital.utils import lfsr_args
# See gr-digital/... |
localDrone | clone | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localAdd import CalcAddLocalDroneCommand
from gui.fitCommands.helpers import DroneInfo, InternalCommandHistory
from service.fit import Fit
class GuiCloneLocalDroneCommand(wx.Command):
def __init__(self,... |
utils | resources | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Resources related utilities."""
import contextlib
import os.path
import pathlib
import posixpath
import sys
from typing import Iterable, Iterator, Union
# We cannot use the stdlib version o... |
scripts | hostblock_blame | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Check by which hostblock list a host was blocked."""
import io
import os
import os.path
import sys
import urllib.request
sys.path.insert(0, os.path.join(os.path.dirn... |
posthog | admin | import json
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as DjangoUserAdmin
from django.contrib.auth.forms import UserChangeForm as DjangoUserChangeForm
from django.contrib.auth.tokens import default_token_generator
from django.utils.html import form... |
audio | item | from sglib import constants
from sglib.lib import strings as sg_strings
from sglib.lib import util
from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.math import (
clip_max,
clip_min,
clip_value,
db_to_lin,
linear_interpolate,
pitch_to_ratio,
)
from sglib.models import the... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.