section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
QT | Scanner | import os
from Code import Util
from Code.QT import QTUtil
from PyQt4 import QtCore, QtGui
class Scanner_vars:
def __init__(self, folder_scanners):
self.fich_vars = os.path.join(folder_scanners, "last.data")
self.read()
def read(self):
dic = Util.iniBase8dic(self.fich_vars)
s... |
plugins | facebook | """
$description Global live-streaming and video hosting social platform.
$url facebook.com
$type live, vod
$metadata title
"""
import logging
import re
from urllib.parse import unquote_plus, urlencode
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.strea... |
extractor | twitcasting | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
clean_html,
float_or_none,
get_element_by_class,
get_element_by_id,
parse_duration,
str_to_int,
unified_timestamp,
urlencode_postdata,
)
from .common import InfoExtractor
class TwitCastingIE(InfoE... |
views | route_regex_debugger | import json
import re
from apps.alerts.incident_appearance.renderers.web_renderer import AlertWebRenderer
from apps.alerts.models import Alert, AlertGroup
from apps.auth_token.auth import PluginAuthentication
from common.api_helpers.exceptions import BadRequest
from django.db.models import Prefetch
from rest_framework... |
output | writer | import errno
from typing import IO, Any, Dict, Optional, TextIO, Tuple, Type, Union
import requests
from ..cli.dicts import HTTPHeadersDict
from ..context import Environment
from ..models import (
HTTPMessage,
HTTPRequest,
HTTPResponse,
OutputOptions,
RequestsMessage,
RequestsMessageKind,
)
fr... |
PathTests | TestPathToolController | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
commands | materialize_columns | import logging
from django.core.management.base import BaseCommand
from ee.clickhouse.materialized_columns.analyze import (
logger,
materialize_properties_task,
)
from ee.clickhouse.materialized_columns.columns import DEFAULT_TABLE_COLUMN
from posthog.settings import (
MATERIALIZE_COLUMNS_ANALYSIS_PERIOD_H... |
plugins | check_drained | """Insert a balance check for zero before balance sheets accounts are closed.
For balance sheet accounts with a Close directive (Assets, Liabilities &
Equity), insert Balance directives just after its closing date, for all the
commodities that have appeared in that account and that are declared as legal on
it as well.... |
metadata | _base | # Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
frescobaldi-app | util | # 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
... |
service | 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... |
clientScripts | manual_normalization_create_metadata_and_restructure | #!/usr/bin/env python
"""
Associate manually normalized preservation files with their originals.
Find the original file that matches this file by filename.
Rename the preservation file to be in the same directory as the original.
Generate a manual normalization event.
Add a derivative link.
:param fileUUID: UUID of t... |
extractor | xnxx | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import NO_DEFAULT, determine_ext, int_or_none, str_to_int
from .common import InfoExtractor
class XNXXIE(InfoExtractor):
_VALID_URL = r"https?://(?:video|www)\.xnxx\.com/video-?(?P<id>[0-9a-z]+)/"
_TESTS = [
{
... |
restapi | metadata_endpoint | from binascii import unhexlify
from typing import Optional
from aiohttp import ContentTypeError, web
from aiohttp_apispec import docs
from ipv8.REST.base_endpoint import HTTP_BAD_REQUEST, HTTP_NOT_FOUND
from ipv8.REST.schema import schema
from marshmallow.fields import Boolean
from pony.orm import db_session
from trib... |
OAuth2 | AuthorizationService | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
from datetime import datetime, timedelta
from typing import TYPE_CHECKING, Callable, Dict, Optional, Union
from urllib.parse import quote_plus, urlencode
from cura.OAuth2.AuthorizationHelpers import (
TOKEN... |
migrations | 0036_pronom_109 | import os
from django.core.management import call_command
from django.db import migrations
def data_migration(apps, schema_editor):
fixture_file = os.path.join(os.path.dirname(__file__), "pronom_109.json")
call_command("loaddata", fixture_file, app_label="fpr")
Format = apps.get_model("fpr", "Format")
... |
books | editions | """ the good stuff! the books! """
import operator
from functools import reduce
from bookwyrm import forms, models
from bookwyrm.activitypub import ActivitypubResponse
from bookwyrm.settings import PAGE_LENGTH
from bookwyrm.views.helpers import is_api_request
from django.contrib.auth.decorators import login_required
f... |
database | table_geoloc | # neubot/database/table_geoloc.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU Gene... |
mail | footer_settings | class FooterSettings(object):
"""The default footer that you would like included on every email."""
def __init__(self, enable=None, text=None, html=None):
"""Create a default footer.
:param enable: Whether this footer should be applied.
:type enable: boolean, optional
:param te... |
aliceVision | RelativePoseEstimating | __version__ = "1.0"
from meshroom.core import desc
class RelativePoseEstimating(desc.AVCommandLineNode):
commandLine = "aliceVision_relativePoseEstimating {allParams}"
size = desc.DynamicNodeSize("input")
parallelization = desc.Parallelization(blockSize=25)
commandLineRange = "--rangeStart {rangeSta... |
cherrypy | _cpdispatch | """CherryPy dispatchers.
A 'dispatcher' is the object which looks up the 'page handler' callable
and collects config for the current request based on the path_info, other
request attributes, and the application architecture. The core calls the
dispatcher as early as possible, passing it a 'path_info' argument.
The de... |
mysql | 20171230 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2017 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
# Converts ids from hex-encoded strings to binary data
import argparse
try:
import MySQLdb as provider
except Impo... |
dialogs | recorddialog | # Copyright (C) 2011 Chris Dekter
# Copyright (C) 2018 Thomas Hess <thomas.hess@udo.edu>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) a... |
hogql | resolver | from datetime import date, datetime
from typing import Any, List, Optional, cast
from uuid import UUID
from posthog.hogql import ast
from posthog.hogql.ast import ConstantType, FieldTraverserType
from posthog.hogql.context import HogQLContext
from posthog.hogql.database.models import (
FunctionCallTable,
LazyT... |
Toggle | setup | #
# Copyright (C) 2010 John Garland <johnnybg+deluge@gmail.com>
#
# Basic plugin template created by:
# Copyright (C) 2008 Martijn Voncken <mvoncken@gmail.com>
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
# Copyright (C) 2009 Damien Churchill <damoxc@gmail.com>
#
# This file is part of Deluge and is l... |
fonts | textfonts | # 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
... |
builtinContextMenus | fitOpenNewTab | # noinspection PyPackageRequirements
import gui.mainFrame
import wx
from graphs.wrapper import BaseWrapper
from gui.builtinShipBrowser.events import FitSelected
from gui.contextMenu import ContextMenuSingle
_t = wx.GetTranslation
class OpenFitInNewTab(ContextMenuSingle):
def __init__(self):
self.mainFra... |
messages | encode | from .specs import CHANNEL_MESSAGES, MIN_PITCHWHEEL, SPEC_BY_TYPE
def _encode_pitchwheel(msg):
pitch = msg["pitch"] - MIN_PITCHWHEEL
return [0xE0 | msg["channel"], pitch & 0x7F, pitch >> 7]
def _encode_sysex(msg):
return [0xF0] + list(msg["data"]) + [0xF7]
def _encode_quarter_frame(msg):
return [0... |
widgets | growingtext | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2013 - 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
... |
components | scene3D | from math import acos, asin, atan2, cos, pi, sin, sqrt
from meshroom.ui.utils import makeProperty
from PySide2.Qt3DCore import Qt3DCore
from PySide2.Qt3DRender import Qt3DRender
from PySide2.QtCore import QObject, QPointF, QSize, Signal, Slot
from PySide2.QtGui import QMatrix4x4, QQuaternion, QVector2D, QVector3D, QVe... |
extractor | sportbox | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import determine_ext, int_or_none, js_to_json, merge_dicts
from .common import InfoExtractor
class SportBoxIE(InfoExtractor):
_VALID_URL = r"https?://(?:news\.sportbox|matchtv)\.ru/vdl/player(?:/[^/]+/|\?.*?\bn?id=)(?P<id>\d+)"
_... |
qltk | songlist | # Copyright 2005 Joe Wreschnig
# 2012 Christoph Reiter
# 2014 Jan Path
# 2011-2023 Nick Boultbee
# 2018 David Morris
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foun... |
models | embedded_ssd_mobilenet_v1_feature_extractor_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... |
extractor | streamcz | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import float_or_none, int_or_none, merge_dicts, parse_codecs, urljoin
from .common import InfoExtractor
class StreamCZIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?(?:stream|televizeseznam)\.cz/[^?#]+/(?P<display_i... |
lib | unicode | # 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, ... |
Test | TestAnnounce | import copy
import time
import gevent
import mock
import pytest
from AnnounceLocal import AnnounceLocalPlugin
from File import FileServer
from Test import Spy
@pytest.fixture
def announcer(file_server, site):
file_server.sites[site.address] = site
announcer = AnnounceLocalPlugin.LocalAnnouncer(file_server, l... |
xl | unicode | """
Routines useful for dealing with unicode data
"""
import locale
import logging
import string
import unicodedata
logger = logging.getLogger(__name__)
def shave_marks(text):
"""
Removes diacritics from Latin characters and replaces them with their
base characters
:param text: Some input that ... |
PyObjCTest | test_nsdatepickercell | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSDatePickerHelper(NSObject):
def datePickerCell_validateProposedDateValue_timeInterval_(self, v1, v2, v3):
pass
class TestNSDatePickerCell(TestCase):
def testConstants(self):
self.assertEqual(NSTextFieldAndStepperDatePicke... |
clientScripts | create_sip_from_transfer_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... |
webkit | mhtml | # SPDX-FileCopyrightText: Daniel Schadt
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utils for writing an MHTML file."""
import dataclasses
import email.encoders
import email.generator
import email.message
import email.mime.multipart
i... |
nfoview | paths | # -*- coding: utf-8 -*-
# Copyright (C) 2008 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... |
autokey | gtkapp | # -*- coding: utf-8 -*-
# Copyright (C) 2011 Chris Dekter
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... |
femtools | errors | # ***************************************************************************
# * Copyright (c) 2020 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
zvonok | phone_provider | import logging
from random import randint
from typing import Optional
import requests
from apps.base.utils import live_settings
from apps.phone_notifications.exceptions import (
FailedToMakeCall,
FailedToStartVerification,
)
from apps.phone_notifications.phone_provider import PhoneProvider, ProviderFlags
from ... |
imageserver | permissions_manager | #
# Quru Image Server
#
# Document: permissions_manager.py
# Date started: 13 Nov 2012
# By: Matt Fozard
# Purpose: Permissions engine and utilities
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it un... |
models | sharing_configuration | import secrets
from typing import List
from django.db import models
def get_default_access_token() -> str:
return secrets.token_urlsafe(22)
class SharingConfiguration(models.Model):
# Relations
team: models.ForeignKey = models.ForeignKey("Team", on_delete=models.CASCADE)
dashboard = models.ForeignK... |
lib | mailer | # encoding: utf-8
from __future__ import annotations
import codecs
import logging
import mimetypes
import os
import smtplib
import socket
from email import utils
from email.message import EmailMessage
from time import time
from typing import IO, Any, Iterable, Optional, Tuple, Union, cast
import ckan
import ckan.lib.... |
lib | brushsettings | # This file is part of MyPaint.
# Copyright (C) 2016-2018 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... |
urllib3 | request | try:
from urllib.parse import urlencode
except ImportError:
from urllib import urlencode
from .filepost import encode_multipart_formdata
__all__ = ["RequestMethods"]
class RequestMethods(object):
"""
Convenience mixin for classes who implement a :meth:`urlopen` method, such
as :class:`~urllib3.c... |
email | null | # 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, ... |
nfoview | window | # -*- coding: utf-8 -*-
# Copyright (C) 2005 Osmo Salomaa
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This pr... |
file-list | column_editor | from __future__ import absolute_import
from sunflower.plugin_base.column_editor_extension import ColumnEditorExtension
class FileList_ColumnEditor(ColumnEditorExtension):
"""Column editor for file list plugin"""
def __init__(self, parent, config):
ColumnEditorExtension.__init__(self, parent, config)... |
job | dialog | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2015 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
... |
classes | keyframe | """
@file
@brief This file is for legacy support of OpenShot 1.x project files
@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 pr... |
SCL-output | automotive_design | # This file was generated by fedex_python. You probably don't want to edit
# it since your modifications will be lost if fedex_plus is used to
# regenerate it.
import sys
from SCL.AggregationDataTypes import *
from SCL.Builtin import *
from SCL.ConstructedDataTypes import *
from SCL.Rules import *
from SCL.SCLBase im... |
commands | run_async_migrations | import logging
from typing import List, Sequence
import structlog
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand
from posthog.async_migrations.runner import (
complete_migration,
is_migration_dependency_fulfilled,
start_async_migration,
)
from po... |
femexamples | manager | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * *
# * Th... |
scripts | InsertAtLayerChange | # Copyright (c) 2020 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
# Created by Wayne Porter
from ..Script import Script
class InsertAtLayerChange(Script):
def __init__(self):
super().__init__()
def getSettingDataString(self):
return """{
"name": "Ins... |
clientScripts | manual_normalization_move_access_files_to_dip | #!/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... |
transfer | base | from __future__ import annotations
import asyncio
import logging
from math import isclose
from typing import Callable, Dict, Optional
from ipv8.messaging.lazy_payload import VariablePayload
from ipv8.types import Peer
from tribler.core.components.ipv8.eva.aliases import (
TransferCompleteCallback,
TransferErr... |
query | savedsearch | # Copyright 2016 Ryan Dellenbaugh
# 2020 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
impo... |
downloaders | MediafireCom | # -*- coding: utf-8 -*-
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..anticaptchas.SolveMedia import SolveMedia
from ..base.simple_downloader import SimpleDownloader
class MediafireCom(SimpleDownloader):
__name__ = "MediafireCom"
__type__ = "downloader"
__version__ = "0.99"
__status__ = "tes... |
tools | cmakefile_editor | #
# Copyright 2013, 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Edit CMakeLists.txt files """
import logging
import re
logger = logging.getLogger(__name__)
class CMakeFileEditor(object):
"""A tool for editing CMakeLists.txt files.... |
clientScripts | trim_verify_manifest | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 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... |
PyObjCTest | test_nsbytecountformatter | import Foundation
from PyObjCTools.TestSupport import *
class TestNSByteCountFormatter(TestCase):
@min_os_level("10.8")
def testConstants10_8(self):
self.assertEqual(Foundation.NSByteCountFormatterUseDefault, 0)
self.assertEqual(Foundation.NSByteCountFormatterUseBytes, 1 << 0)
self.ass... |
widgets | playlist | # Copyright (C) 2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it w... |
scripts | example_pre | # ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
PyObjCTest | test_foundationerrors | from Foundation import *
from PyObjCTools.TestSupport import *
class FoundationErrorsTest(TestCase):
def testConstants(self):
self.assertEqual(NSFileNoSuchFileError, 4)
self.assertEqual(NSFileLockingError, 255)
self.assertEqual(NSFileReadUnknownError, 256)
self.assertEqual(NSFileRe... |
paths | paths | import dataclasses
from collections import defaultdict
from typing import Dict, List, Literal, Optional, Tuple, Union, cast
from posthog.clickhouse.materialized_columns import ColumnName
from posthog.constants import LIMIT, PATH_EDGE_LIMIT
from posthog.models import Filter, Team
from posthog.models.filters.path_filter... |
accounts | GetTwentyFourOrg | # -*- coding: utf-8 -*-
import json
import time
from hashlib import sha256
import pycurl
from ..base.multi_account import MultiAccount
class GetTwentyFourOrg(MultiAccount):
__name__ = "GetTwentyFourOrg"
__type__ = "account"
__version__ = "0.04"
__status__ = "testing"
__description__ = "GeT24.o... |
audioinfo | wma | import struct
from mutagen.asf import ASF, ASFByteArrayAttribute, ASFUnicodeAttribute
from . import tag_versions, util
from .util import (
FILENAME,
PATH,
CaselessDict,
cover_info,
del_deco,
fn_hash,
get_mime,
get_total,
getdeco,
info_to_dict,
isempty,
keys_deco,
pa... |
views | setup | """ Installation wizard 🧙 """
import re
from bookwyrm import forms, models, settings
from bookwyrm.utils import regex
from django.contrib.auth import login
from django.contrib.auth.models import Group
from django.core.exceptions import PermissionDenied
from django.db import transaction
from django.shortcuts import re... |
femtaskpanels | task_element_rotation1D | # ***************************************************************************
# * Copyright (c) 2017 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
platform | base | import errno
import os
import socket
import uuid
from ..helpers import safe_unlink
from ..platformflags import is_win32
"""
platform base module
====================
Contains platform API implementations based on what Python itself provides. More specific
APIs are stubs in this module.
When functions in this module... |
blocks | block | from gaphor.core.modeling.properties import attribute
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import (
Box,
JustifyContent,
Text,
TextAlign,
draw_border,
draw_top_separator,
)
from gaphor.diagram.suppor... |
models | vote | # 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, ... |
PyObjCTest | test2_dictviews | """
test.test_dictview from python2.7 adapted
for testing NSMutableDictionary
"""
import objc
from PyObjCTools.TestSupport import *
NSDictionary = objc.lookUpClass("NSDictionary")
NSMutableDictionary = objc.lookUpClass("NSMutableDictionary")
import unittest
class DictSetTest(TestCase):
def test_constructors_no... |
engines | duckduckgo_definitions | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
DuckDuckGo (Instant Answer API)
"""
import json
from urllib.parse import urlencode, urljoin, urlparse
from lxml import html
from searx import logger
from searx.data import WIKIDATA_UNITS
from searx.engines.duckduckgo import ( # NOQA # pylint: disable=unused-import
... |
project | abstract | """
Utility functions that are global to the entire application
"""
import datetime
import os
import traceback
from sglib.lib import util
from sglib.lib.engine import close_engine, reopen_engine
from sglib.lib.translate import _
from sglib.log import LOG
from sglib.models.daw.track_colors import TrackColors
from sgli... |
core | amount | """Amount class.
This simple class is used to associate a number of units of a currency with its
currency:
(number, currency).
"""
__copyright__ = "Copyright (C) 2013-2017 Martin Blais"
__license__ = "GNU GPLv2"
import re
from decimal import Decimal
from typing import NamedTuple, Optional
from beancount.core.di... |
utils | system | # -*- coding: utf-8 -*-
import os
import shlex
import sys
from subprocess import PIPE, Popen
# import psutil
from . import convert
from .check import is_iterable
from .convert import to_str
try:
import dbus
except ImportError:
dbus = None
try:
import grp
except ImportError:
grp = None
try:
import... |
Gui | qtunittest | # ***************************************************************************
# * Copyright (c) 2006 Werner Mayer <werner.wm.mayer@gmx.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
builtinViewColumns | targetResists | # =============================================================================
# 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 ... |
Tools | MakeAppTools | import os
import re
import sys
import FCFileTools
verbose = 0
dcount = fcount = 0
def replaceTemplate(dirName, oldName, newName):
"""
modify contents from dirName and below, replace oldName by newName
"""
for file in os.listdir(dirName):
pathName = os.path.join(dirName, file)
if not ... |
draftguitools | gui_base_original | # ***************************************************************************
# * (c) 2009 Yorik van Havre <yorik@uncreated.net> *
# * (c) 2010 Ken Cline <cline@frii.com> *
# * (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * ... |
examples | pyqt_waterfall_f | #!/usr/bin/env python
#
# Copyright 2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
from gnuradio import blocks, filter, gr
from gnuradio.fft import window
try:
import sip
from gnuradio import qtgui
from PyQt5 import... |
extensions | loader | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Loader for qutebrowser extensions."""
import argparse
import dataclasses
import importlib
import pathlib
import pkgutil
import sys
import types
from typing import Callable, Iterator, List, O... |
equations | heat | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2022 Uwe Stöhr <uwestoehr@lyx.org> *
# * *
# * Th... |
extractor | konserthusetplay | # coding: utf-8
from __future__ import unicode_literals
from ..utils import determine_ext, float_or_none, int_or_none, url_or_none
from .common import InfoExtractor
class KonserthusetPlayIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?(?:konserthusetplay|rspoplay)\.se/\?.*\bm=(?P<id>[^&]+)"
)
... |
digital | qa_constellation_receiver | #!/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
#
#
import math
import random
import pmt
from gnuradio import analog, blocks, digital, filter, gr, gr_unittest
from gnuradio.digital import packet_utils
from g... |
CloudSync | LicenseModel | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from PyQt6.QtCore import QObject, pyqtProperty, pyqtSignal
from UM.i18n import i18nCatalog
catalog = i18nCatalog("cura")
# Model for the ToolboxLicenseDialog
class LicenseModel(QObject):
DEFAULT_DECLINE_BUTTON_TEXT =... |
PyObjCTest | test_nsscrollview | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TesNSScrollView(TestCase):
def testMethods(self):
self.assertArgIsBOOL(
NSScrollView.frameSizeForContentSize_hasHorizontalScroller_hasVerticalScroller_borderType_,
... |
buku | setup | #!/usr/bin/env python3
import os
import re
import shutil
from setuptools import find_packages, setup
if os.path.isfile("buku"):
shutil.copyfile("buku", "buku.py")
with open("buku.py", encoding="utf-8") as f:
version = re.search("__version__ = '([^']+)'", f.read()).group(1) # type: ignore
with open("README... |
Arch | ArchWindow | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
core | account_types | """Definition for global account types.
This is where we keep the global account types value and definition.
Note that it's unfortunate that we're using globals and side-effect here, but
this is the best solution in the short-term, the account types are used
in too many places to pass around that state everywhere. Ma... |
schemas | teams | from CTFd.models import TeamFieldEntries, TeamFields, Teams, Users, ma
from CTFd.schemas.fields import TeamFieldEntriesSchema
from CTFd.utils import get_config, string_types
from CTFd.utils.crypto import verify_password
from CTFd.utils.user import get_current_team, get_current_user, is_admin
from CTFd.utils.validators ... |
extractors | zhibo | #!/usr/bin/env python
__all__ = ["zhibo_download"]
from ..common import *
def zhibo_vedio_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
# http://video.zhibo.tv/video/details/d103057f-663e-11e8-9d83-525400ccac43.html
html = get_html(url)
title = r1(r"<title>([\s\S]*)</title>", ht... |
migrations | 0001_initial | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-08-19 20:13
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER... |
extractor | showroomlive | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none, urljoin
from .common import InfoExtractor
class ShowRoomLiveIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?showroom-live\.com/(?!onlive|timetable|event|campaign|news|rank... |
digital | qa_correlate_access_code_XX_ts | #!/usr/bin/env python
#
# Copyright 2006,2007,2010,2011,2013,2016 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import pmt
from gnuradio import blocks, digital, gr, gr_unittest
default_access_code = "\xAC\xDD\xA4\xE2\xF2\x8C\x20\xFC"
def string_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.