section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
ipc | socket | import select
import socket
import socketserver
import time
from sglib import constants
from sglib.ipc.abstract import AbstractIPCTransport
from sglib.lib import engine
from sglib.lib.translate import _
from sglib.log import LOG
from sgui import shared
from sgui.sgqt import QMessageBox, QtCore, Signal
__all__ = [
... |
CuraProfileWriter | CuraProfileWriter | # Copyright (c) 2015 Ultimaker B.V.
# Copyright (c) 2013 David Braam
# Uranium is released under the terms of the LGPLv3 or higher.
import zipfile
from cura.ReaderWriters.ProfileWriter import ProfileWriter
from UM.Logger import Logger
class CuraProfileWriter(ProfileWriter):
"""Writes profiles to Cura's own prof... |
downloader | rtmp | from __future__ import unicode_literals
import os
import re
import subprocess
import time
from ..compat import compat_str
from ..utils import check_executable, encodeArgument, encodeFilename, get_exe_version
from .common import FileDownloader
def rtmpdump_version():
return get_exe_version(
"rtmpdump", [... |
frescobaldi-app | open_file_at_cursor | # 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
... |
virtual-printer | virtual | __author__ = "Gina Häußge <osd@foosel.net>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
import collections
import json
import math
import os
import queue
import re
import threading
import time
from typing import Any, Dict, List, Optional
from octoprint.plugin import plugin... |
Op | Slot | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 Russell Johnson (russ4262) <russ4262@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
widgets | scripttextedit | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2007, 2009 Lukáš Lalinský
# Copyright (C) 2014 m42i
# Copyright (C) 2020-2022 Laurent Monin
# Copyright (C) 2020-2022 Philipp Wolfer
# Copyright (C) 2021-2022 Bob Swift
#
# This program is free software; you can redistribu... |
albums | prefs | # Copyright 2004-2007 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2009-2010 Steven Robertson
# 2012,2013,2016 Nick Boultbee
# 2009-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 b... |
PyObjCTest | test_nsview | import objc
from AppKit import *
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
try:
unicode
except NameError:
unicode = str
class TestNSViewHelper(NSObject):
def view_stringForToolTip_point_userData_(self, a, b, c, d):
return 1
class ObjCTestNSView_KnowP... |
extractor | philharmoniedeparis | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import try_get, urljoin
from .common import InfoExtractor
class PhilharmonieDeParisIE(InfoExtractor):
IE_DESC = "Philharmonie de Paris"
_VALID_URL = r"""(?x)
https?://
... |
scripts | directories | """Check that document directories mirror a list of accounts correctly.
"""
__copyright__ = "Copyright (C) 2014, 2016-2017 Martin Blais"
__license__ = "GNU GPLv2"
from beancount.core import account, getters
class ValidateDirectoryError(Exception):
"""A directory validation error."""
def validate_directory(acc... |
qltk | browser | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2016-23 Nick Boultbee
# 2018 Peter Strulo
#
# 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
#... |
Tools | doctools | #! python
# -*- coding: utf-8 -*-
# (c) 2010 Werner Mayer LGPL
# FreeCAD Python script to work with the FCStd file format.
import os
import xml.sax
import xml.sax.handler
import xml.sax.xmlreader
import zipfile
# SAX handler to parse the Document.xml
class DocumentHandler(xml.sax.handler.ContentHandler):
def __i... |
models | cloud_connector | import logging
import typing
from urllib.parse import urljoin
import requests
from apps.base.utils import live_settings
from apps.oss_installation.models.cloud_user_identity import CloudUserIdentity
from apps.user_management.models import User
from common.api_helpers.utils import create_engine_url
from django.db impor... |
src | proofofwork | # pylint: disable=too-many-branches,too-many-statements,protected-access
"""
Proof of work calculation
"""
import ctypes
import hashlib
import os
import sys
import tempfile
import time
from struct import pack, unpack
from subprocess import call
import openclpow
import paths
import queues
import state
import tr
from b... |
gui | app_manager | from typing import Optional
from PyQt5.QtWidgets import QApplication
from tribler.gui.utilities import connect
class AppManager:
"""
A helper class that calls QApplication.quit()
You should never call `QApplication.quit()` directly. Call `app_manager.quit_application()` instead.
It is necessary to a... |
aliceVision | DistortionCalibration | __version__ = "3.0"
from meshroom.core import desc
class DistortionCalibration(desc.AVCommandLineNode):
commandLine = "aliceVision_distortionCalibration {allParams}"
size = desc.DynamicNodeSize("input")
category = "Other"
documentation = """
Calibration of a camera/lens couple distortion using a ful... |
friture | spectrum | #!/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... |
builtinViewColumns | graphLineStyle | # =============================================================================
# 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 ... |
job | queue | # process.py -- A very simple wrapper around QProcess
#
# Copyright (c) 2012 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
# of the License, or (at your... |
cron | expressions | """This module contains the expressions applicable for CronTrigger's fields."""
import re
from calendar import monthrange
from apscheduler.util import asint
__all__ = (
"AllExpression",
"RangeExpression",
"WeekdayRangeExpression",
"WeekdayPositionExpression",
"LastDayOfMonthExpression",
)
WEEKD... |
canto-curses | command | # -*- coding: utf-8 -*-
# Canto-curses - ncurses RSS reader
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
import curses... |
gtk3 | path_combo_chooser | #!/usr/bin/env python
#
# Copyright (C) 2013 Bro <bro.development@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
import os
imp... |
mylar | dbupdater | # This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that it wi... |
migrations | 0003_fill_person_distinct_id2 | from functools import cached_property
from posthog.async_migrations.definition import (
AsyncMigrationDefinition,
AsyncMigrationOperationSQL,
)
from posthog.client import sync_execute
from posthog.constants import AnalyticsDBMS
from posthog.settings import CLICKHOUSE_DATABASE
"""
Migration summary:
Schema ch... |
events | advanced_preferences | # Copyright 2015 Christoph Reiter
# 2016-22 Nick Boultbee
# 2019 Peter Strulo
# 2022 Jej@github
#
# 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 ve... |
addons | TORRENT | # -*- coding: utf-8 -*-
import re
from ..base.addon import BaseAddon
class TORRENT(BaseAddon):
__name__ = "TORRENT"
__type__ = "addon"
__version__ = "0.07"
__status__ = "testing"
__config__ = [
("enabled", "bool", "Activated", True),
(
"torrent_plugin",
"N... |
PyObjCTest | test_set_proxy | """
Tests for the proxy of Python sets
"""
import os
import sys
import objc
from PyObjCTest.fnd import NSMutableSet, NSNull, NSObject, NSPredicate, NSSet
from PyObjCTest.pythonset import OC_TestSet
from PyObjCTools.TestSupport import *
if sys.version_info[0] == 3:
unicode = str
onLeopard = int(os.uname()[2].spli... |
clientScripts | restructure_for_compliance_maildir | #!/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... |
CuraEngineBackend | ProcessSlicedLayersJob | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import gc
import sys
from time import time
import numpy
from cura import LayerDataBuilder, LayerDataDecorator, LayerPolygon
from cura.Machines.Models.ExtrudersModel import ExtrudersModel
from cura.Scene.BuildPlateDecorator... |
gui | display | # =============================================================================
# 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 ... |
statistics | tests | # Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your opti... |
plugins | pluto | """
$description Live TV and video on-demand service owned by Paramount Streaming.
$url pluto.tv
$type live, vod
$metadata id
$metadata author
$metadata category
$metadata title
"""
import logging
import re
from urllib.parse import parse_qsl, urljoin
from uuid import uuid4
from streamlink.plugin import Plugin, plugin... |
beetsplug | spotify | # This file is part of beets.
# Copyright 2019, Rahul Ahuja.
# Copyright 2022, Alok Saboo.
#
# 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 limitatio... |
frescobaldi-app | hyphendialog | # 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
... |
digital | qamlike | # Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
This file contains constellations that are similar to QAM, but are not perfect squares.
"""
from . import digital_python
from .qam import large_ampls_to_corners_mapping
def qam32_... |
extractor | cmt | from __future__ import unicode_literals
from .mtv import MTVIE
class CMTIE(MTVIE):
IE_NAME = "cmt.com"
_VALID_URL = r"https?://(?:www\.)?cmt\.com/(?:videos|shows|(?:full-)?episodes|video-clips)/(?P<id>[^/]+)"
_TESTS = [
{
"url": "http://www.cmt.com/videos/garth-brooks/989124/the-call... |
Main | Job | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... |
models | add_to_timeline_model | """
@file
@brief This file contains the add to timeline model
@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 project
dedicated ... |
person | person | from typing import Any, List, Optional
from django.db import models, transaction
from django.db.models import F, Q
from posthog.models.utils import UUIDT
class PersonManager(models.Manager):
def create(self, *args: Any, **kwargs: Any):
with transaction.atomic():
if not kwargs.get("distinct_id... |
migrations | 0104_auto_20211001_2012 | # Generated by Django 3.2.5 on 2021-10-01 20:12
from django.db import migrations, models
def set_thread_id(app_registry, schema_editor):
"""set thread ids"""
db_alias = schema_editor.connection.alias
# set the thread id on parent nodes
model = app_registry.get_model("bookwyrm", "Status")
model.ob... |
extractor | fourtube | from __future__ import unicode_literals
import re
from ..compat import (
compat_b64decode,
compat_str,
compat_urllib_parse_unquote,
compat_urlparse,
)
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
str_or_none,
str_to_int,
try_get,
unified_timestamp,
... |
Scene | BuildPlateDecorator | from cura.Scene.CuraSceneNode import CuraSceneNode
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
class BuildPlateDecorator(SceneNodeDecorator):
"""Make a SceneNode build plate aware CuraSceneNode objects all have this decorator."""
def __init__(self, build_plate_number: int = -1) -> None:
... |
TechDrawTools | CommandShareView | # ***************************************************************************
# * Copyright (c) 2022 Wanderer Fan <wandererfan@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
base | graph | # =============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... |
widgets | taglisteditor | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2019-2020 Philipp Wolfer
# Copyright (C) 2020-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 Softwar... |
views | alert_receive_channel | from apps.alerts.grafana_alerting_sync_manager.grafana_alerting_sync import (
GrafanaAlertingSyncManager,
)
from apps.alerts.models import Alert, AlertGroup, AlertReceiveChannel
from apps.alerts.models.maintainable_object import MaintainableObject
from apps.api.permissions import RBACPermission
from apps.api.serial... |
femexamples | ccx_cantilever_base_solid | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com *
# * *
# * Th... |
downloaders | LinkifierCom | # -*- coding: utf-8 -*-
import hashlib
import json
import pycurl
from pyload.core.utils import seconds
from ..base.multi_downloader import MultiDownloader
class LinkifierCom(MultiDownloader):
__name__ = "LinkifierCom"
__type__ = "downloader"
__version__ = "0.04"
__status__ = "testing"
__patter... |
PyObjCTest | test_splitsig | import objc
from PyObjCTools.TestSupport import *
gDict = {}
"""
try:
import Foundation
except ImportError:
pass
try:
import AppKit
except ImportError:
pass
try:
import PreferencePanes
except ImportError:
pass
try:
import ScreenSaver
except ImportError:
pass
try:
import Interfa... |
neubot | runner_mlabns | # neubot/runner_mlabns.py
#
# Copyright (c) 2012
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# 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 th... |
gnuradio | gr_unittest | #!/usr/bin/env python
#
# Copyright 2004,2010,2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
GNU radio specific extension of unittest.
"""
import time
import unittest
# We allow snakeCase here for consistency with unittest
# pylint: disable... |
Gui | PreferencesAdvanced | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2021 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
utils | helpers | import hashlib
from functools import partial
import six
class CaseInsensitiveDict(dict):
def __init__(self, obj=None, **kwargs):
if obj is not None:
if isinstance(obj, dict):
for k, v in obj.items():
self[k] = v
else:
for k, v in... |
sgui | welcome | import os
import sys
from sglib.constants import UI_PIDFILE
from sglib.lib import util
from sglib.log import LOG
from sgui import shared as glbl_shared
from sgui.main import main
from sgui.sgqt import *
from sgui.util import ui_scaler_factory
from .project import (
StargateProjectVersionError,
check_project_v... |
engines | solr | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Solr
"""
# pylint: disable=global-statement, missing-function-docstring
from json import loads
from urllib.parse import urlencode
from searx.exceptions import SearxEngineAPIException
base_url = "http://localhost:8983"
collection = ""
rows = 10
sort = "" # sorting: ... |
Arch | importSHP | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... |
plugins | cleantitle | # Clean Title Plugin
# by Jack Miller
# v1.0
# This plugin will strip some annoying content out of story titles. Even though
# most of it should technically still be in there (we already try to parse
# HTML, etc.) some feeds are poorly defined and will double escape HTML and
# insert annoying newlines.
# For now, jus... |
versions | 7446b8bbc888_email_templates_and_plan_enum | """email templates and plan enum
Revision ID: 7446b8bbc888
Revises: a156683c29f2
Create Date: 2018-09-19 22:38:57.679264
"""
# revision identifiers, used by Alembic.
revision = "7446b8bbc888"
down_revision = "a156683c29f2"
import sqlalchemy as sa
from alembic import op
from sqlalchemy.dialects import postgresql
fro... |
desktop | mypaint_ora_thumbnailer | #!/usr/bin/env python
# Thumbnailer for GNOME/Cinnamon Nautilus, and compatible desktops.
#
# Copyright (c) 2010 Jon Nordby <jononor@gmail.com>
# (c) 2013-2017 the MyPaint Development Team
# This program is distributed under the same terms as MyPaint itself.
# OpenRaster specification:
# http://freedesktop... |
PyObjCTest | test_nszone | # HACK
import Foundation
import objc
from Foundation import *
from PyObjCTools.TestSupport import *
# NSZonePtr = getattr(Foundation, 'NSZone*')
try:
long
except NameError:
long = int
class TestNSZone(TestCase):
def testWithZones(self):
obj = NSObject.allocWithZone_(None).init()
zone = o... |
plugins | webtv | """
$description Turkish web conferencing platform.
$url web.tv
$type live
"""
import base64
import binascii
import logging
import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream.hls import HLSStream
from streamlink.utils.crypto import AES, unpa... |
SysML | modelinglanguage | """The SysML Modeling Language module is the entrypoint for SysML related
assets."""
from typing import Iterable
from gaphor.abc import ModelingLanguage
from gaphor.core import gettext
from gaphor.diagram.diagramtoolbox import (
DiagramType,
ElementCreateInfo,
ToolboxDefinition,
)
from gaphor.SysML import... |
lib | errors | # 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 ... |
models | property_definition | from django.contrib.postgres.indexes import GinIndex
from django.db import models
from django.db.models.expressions import F
from django.db.models.functions import Coalesce
from posthog.models.team import Team
from posthog.models.utils import UniqueConstraintByExpression, UUIDModel
class PropertyType(models.TextChoic... |
docs | ext_plugins | import abc
import ast
import pkgutil
import re
import tokenize
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional
from docutils import nodes
from docutils.parsers.rst import Directive
from docutils.statemachine import ViewList
from sphinx.errors import ExtensionError
from sphinx.util.nodes... |
engines | pil | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
import os
from io import BytesIO
from subprocess import PIPE, Popen
... |
traffic | emr_traffic | # 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, ... |
previous-dbs | tags_db | import datetime
from typing import Optional
from pony import orm
from tribler.core.utilities.pony_utils import TrackedDatabase, get_or_create
class TagDatabase:
def __init__(
self,
filename: Optional[str] = None,
*,
create_tables: bool = True,
**generate_mapping_kwargs,
... |
fec | capillary_threaded_decoder | #!/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 math
from gnuradio import blocks, gr
from . import fec_python as fec
class capillary_threaded_decoder(gr.hier_block2):
def __init__(self, decoder_... |
async-migrations | definition | from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple, Union
from posthog.constants import AnalyticsDBMS
from posthog.models.utils import sane_repr
from posthog.settings import ASYNC_MIGRATIONS_DEFAULT_TIMEOUT_SECONDS
from posthog.version_requirement import ServiceVersionRequirement
if TYPE_CHE... |
neubot | backend_null | # neubot/backend_null.py
#
# Copyright (c) 2012
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# 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... |
models | alert_manager_models | import hashlib
import json
from apps.alerts.models import Alert, AlertGroup
from django.db import transaction
# NOTE: mypy was complaining about the following for both of these models. Likely because they subclass
# a model and django-mypy can't yet properly handle this
#
# error: Couldn't resolve related manager fo... |
logic | schema | # -*- coding: utf-8 -*-
from __future__ import annotations
from ckan.logic.schema import default_pagination_schema, validator_args
from ckan.types import Schema, Validator, ValidatorFactory
@validator_args
def default_create_activity_schema(
ignore: Validator,
not_missing: Validator,
not_empty: Validato... |
RemovableDriveOutputDevice | WindowsRemovableDrivePlugin | # Copyright (c) 2015 Ultimaker B.V.
# Copyright (c) 2013 David Braam
# Uranium is released under the terms of the LGPLv3 or higher.
import ctypes
import string
from ctypes import (
wintypes,
) # Using ctypes.wintypes in the code below does not seem to work
from UM.i18n import i18nCatalog
from . import RemovableD... |
gui | statsView | # =============================================================================
# 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 ... |
canto-next | rwlock | # -*- coding: utf-8 -*-
# Canto - RSS reader backend
# Copyright (C) 2016 Jack Miller <jack@codezen.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
# Seriously python? ... |
helpers | nanorst | import io
import sys
from . import is_terminal
class TextPecker:
def __init__(self, s):
self.str = s
self.i = 0
def read(self, n):
self.i += n
return self.str[self.i - n : self.i]
def peek(self, n):
if n >= 0:
return self.str[self.i : self.i + n]
... |
chardet | langthaimodel | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
plugins | googledrive | """
$description Stream videos stored in Google Drive.
$url docs.google.com
$url drive.google.com
$type vod
"""
import logging
import re
from urllib.parse import parse_qsl
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.stream.http import HTTPStream
log = logging.getLogger(__name__)
@pluginmatc... |
Settings | SettingOverrideDecorator | # Copyright (c) 2016 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import copy
import uuid
from cura.Settings.ExtruderManager import ExtruderManager
from cura.Settings.PerObjectContainerStack import PerObjectContainerStack
from UM.Application import Application
from UM.Logger import Logge... |
database | argmax | from typing import Callable, Dict, List, Optional
def argmax_select(
table_name: str,
select_fields: Dict[str, List[str]],
group_fields: List[str],
argmax_field: str,
deleted_field: Optional[str] = None,
):
from posthog.hogql import ast
argmax_version: Callable[[ast.Expr], ast.Expr] = lam... |
filter | qa_fractional_interpolator | #!/usr/bin/env python
#
# Copyright 2007,2010,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 blocks, filter, gr, gr_unittest
def sig_source_f(samp_rate, freq, amp, N):
t = [float(x) / samp_rate for x... |
draftutils | gui_utils | # ***************************************************************************
# * (c) 2009, 2010 *
# * Yorik van Havre <yorik@uncreated.net>, Ken Cline <cline@frii.com> *
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * (c... |
cssutils | cssproductions | """productions for cssutils based on a mix of CSS 2.1 and CSS 3 Syntax
productions
- http://www.w3.org/TR/css3-syntax
- http://www.w3.org/TR/css3-syntax/#grammar0
open issues
- numbers contain "-" if present
- HASH: #aaa is, #000 is not anymore,
CSS2.1: 'nmchar': r'[_a-z0-9-]|{nonascii}|{escape}',... |
collectd | pybitmessagestatus | #!/usr/bin/env python2.7
import json
import collectd
import xmlrpclib
pybmurl = ""
api = ""
def init_callback():
global api
api = xmlrpclib.ServerProxy(pybmurl)
collectd.info("pybitmessagestatus.py init done")
def config_callback(ObjConfiguration):
global pybmurl
apiUsername = ""
apiPassw... |
femviewprovider | view_element_geometry2D | # ***************************************************************************
# * Copyright (c) 2015 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | savefrom | # coding: utf-8
from __future__ import unicode_literals
import os.path
import re
from .common import InfoExtractor
class SaveFromIE(InfoExtractor):
IE_NAME = "savefrom.net"
_VALID_URL = r"https?://[^.]+\.savefrom\.net/\#url=(?P<url>.*)$"
_TEST = {
"url": "http://en.savefrom.net/#url=http://yout... |
QT | PantallaPuente | import atexit
import datetime
import random
import time
from Code import ControlPosicion, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
Grid,
Iconos,
PantallaPotencia,
QTUtil,
QTUtil2,
QTVarios,
Tablero,
)
from Code.SQL import Base
from PyQt4 import QtGui
class P... |
tags | uhd_burst_detector | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from argparse import ArgumentParser
from gnuradio import analog, blocks, eng_notation, filter, gr, uhd
from gnuradio.eng_arg import eng_float
from gnuradio.... |
actions | actionstoolbox | """The definition for the actions section of the toolbox."""
from functools import partial
from gaphas.item import SE
from gaphor import UML
from gaphor.diagram.diagramtoolbox import ToolDef, ToolSection, new_item_factory
from gaphor.i18n import gettext, i18nize
from gaphor.UML import diagramitems
from gaphor.UML.reci... |
PyObjCTest | test_cfstream | import contextlib
import errno
import os
import socket
import sys
import time
from CoreFoundation import *
from PyObjCTools.TestSupport import *
from .test_cfsocket import onTheNetwork
try:
long
except NameError:
long = int
try:
unicode
except NameError:
unicode = str
class TestStream(TestCase):
... |
src | upnp | # pylint: disable=too-many-statements,too-many-branches,protected-access,no-self-use
"""
Complete UPnP port forwarding implementation in separate thread.
Reference: http://mattscodecave.com/posts/using-python-and-upnp-to-forward-a-port
"""
import socket
import time
from random import randint
from xml.dom.minidom impor... |
views | fonts | import logging
from PyQt5.QtCore import QRect, QSize, Qt
from PyQt5.QtGui import QColor, QFont, QPainter
from PyQt5.QtWidgets import QGridLayout, QTabWidget, QWidget
logger = logging.getLogger("cddagl")
class FontsTab(QTabWidget):
def __init__(self):
super(FontsTab, self).__init__()
layout = QG... |
PyObjCTest | test_nsfilewrapper | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSFileWrapper(TestCase):
def testMethods(self):
self.assertResultIsBOOL(NSFileWrapper.writeToFile_atomically_updateFilenames_)
self.assertArgIsBOOL(NSFileWrapper.writeToFile_atomically_updateFilenames_, 1)
self.assertArgI... |
extractors | naver | #!/usr/bin/env python
import json
import re
import urllib.parse
import urllib.request
from ..common import (
download_urls,
get_content,
playlist_not_supported,
print_info,
url_size,
)
from ..util import log
from .universal import *
__all__ = ["naver_download_by_url"]
def naver_download_by_url(... |
clientScripts | load_premis_events_from_xml | import datetime
import logging
import os
import sys
import uuid
import metsrw
from django.db import transaction
from django.utils import dateparse, timezone
from lxml import etree
from main.models import Agent, Event, File
logger = logging.getLogger(__name__)
FAILURE = 1
SUCCESS = 0
TRANSFER_ORIGINAL_LOCATION_PREFIX ... |
jinja-templater | jinja_template_env | from django.utils import timezone
from jinja2 import BaseLoader
from jinja2.exceptions import SecurityError
from jinja2.sandbox import SandboxedEnvironment
from .filters import (
datetimeformat,
iso8601_to_time,
json_dumps,
regex_match,
regex_replace,
regex_search,
to_pretty_json,
)
def r... |
ui | commands | import logging
import traceback
from contextlib import contextmanager
from meshroom.core.attribute import Attribute, ListAttribute
from meshroom.core.graph import GraphModification
from meshroom.core.node import Position, nodeFactory
from PySide2.QtCore import Property, Signal
from PySide2.QtWidgets import QUndoComman... |
access | groups | __author__ = "Marc Hannappel <salandora@gmail.com>"
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2017 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
from functools import partial
from octoprint.acce... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.