section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
protos | input_reader_pb2 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: object_detection/protos/input_reader.proto
import sys
_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1"))
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pb2
from google.proto... |
mylar | api | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# 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 vers... |
PyObjCTest | test_quartzfiltermanager | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
class TestQuartzFilterManager(TestCase):
@min_os_level("10.5")
def testMethods(self):
self.assertResultIsBOOL(QuartzFilterManager.selectFilter_)
@min_os_level("10.5")
def testConst... |
search | common | # encoding: utf-8
from __future__ import annotations
import datetime
import logging
import re
from typing import Any, Optional
import pysolr
import simplejson
from ckan.common import config
from pysolr import Solr
from six.moves.urllib.parse import quote_plus # type: ignore
log = logging.getLogger(__name__)
class... |
friture | iec | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2021 Timothée 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 distri... |
PyObjCTest | test_nsnetservices | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSNetServicesHelper(NSObject):
def netServiceBrowser_didFindDomain_moreComing_(self, a, b, c):
pass
def netServiceBrowser_didFindService_moreComing_(self, a, b, c):
p... |
QT | PantallaTacticas | from Code import Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
Delegados,
Grid,
Iconos,
QTUtil2,
QTVarios,
)
from PyQt4 import QtGui
def consultaHistorico(pantalla, tactica, icono):
w = WHistoricoTacticas(pantalla, tactica, icono)
return w.resultado if w.exec_() e... |
filters | lifecycle_filter | import datetime
from typing import Any, Dict, Optional
from posthog.models import Filter
from posthog.utils import relative_date_parse
from rest_framework.exceptions import ValidationError
from rest_framework.request import Request
class LifecycleFilter(Filter):
target_date: Optional[datetime.datetime] = None
... |
books | Novelbase | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# https://www.xxbiquge.com 的基类
# Author: skiinder <https://github.com/skiinder>
import datetime
from apps.dbModels import LastDelivered
from apps.utils import str_to_int
from books.base import BaseUrlBook
from bs4 import BeautifulSoup
from config import TIMEZONE
from lib.au... |
frescobaldi-app | progress | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2008 - 2014 by Wilbert Berendsen
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
... |
models | channel_filter | import json
import logging
import re
import typing
from common.jinja_templater import apply_jinja_template
from common.jinja_templater.apply_jinja_template import (
JinjaTemplateError,
JinjaTemplateWarning,
)
from common.ordered_model.ordered_model import OrderedModel
from common.public_primary_keys import (
... |
transmissionrpc | utils | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
import datetime
import logging
import socket
from collections import namedtuple
import transmissionrpc.constants as constants
from six import iteritems, string_types
from transmissionrpc.constants... |
downloaders | EasyuploadIo | # -*- coding: utf-8 -*-
import json
import re
import urllib.parse
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.simple_downloader import SimpleDownloader
class EasyuploadIo(SimpleDownloader):
__name__ = "EasyuploadIo"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
... |
searx | webutils | # -*- coding: utf-8 -*-
import csv
import hashlib
import hmac
import inspect
import os
import re
from codecs import getincrementalencoder
from io import StringIO
from searx import logger
VALID_LANGUAGE_CODE = re.compile(r"^[a-z]{2,3}(-[a-zA-Z]{2})?$")
logger = logger.getChild("webutils")
class UnicodeWriter:
"... |
UML | recipes | """UML model support functions.
Functions collected in this module allow to
- create more complex UML model structures
- perform specific searches and manipulations
"""
from __future__ import annotations
import itertools
from typing import Iterable, Sequence, TypeVar
from gaphor.UML.uml import (
Artifact,
... |
CompoundTools | _CommandExplodeCompound | # ***************************************************************************
# * Copyright (c) 2016 Victor Titov (DeepSOIC) <vv.titov@gmail.com> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
sphinx | conf | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... |
config | extensions | # 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, ... |
versions | 5cbcee17bece_add_trusted_applications | """Add trusted applications
Revision ID: 5cbcee17bece
Revises: 8a6a7662eb37
Create Date: 2018-11-05 15:16:07.497898
"""
import sqlalchemy as sa
import sqlalchemy_utils
from alembic import op
# revision identifiers, used by Alembic.
revision = "5cbcee17bece"
down_revision = "8a6a7662eb37"
branch_labels = None
depends... |
classes | exceptions | """
@file
@brief This file deals with unhandled exceptions
@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 to ... |
trax | track | # -*- coding: utf-8
# 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 distribu... |
extractor | vodplatform | # coding: utf-8
from __future__ import unicode_literals
from ..utils import unescapeHTML
from .common import InfoExtractor
class VODPlatformIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:www\.)?vod-platform\.net|embed\.kwikmotion\.com)/[eE]mbed/(?P<id>[^/?#]+)"
_TESTS = [
{
# from http:... |
Tools | params_utils | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2022 Zheng Lei (realthunder) <realthunder.dev@gmail.com>*
# * *
# * This program is free software; you can redistribute it a... |
stream | actor | import fnmatch
import logging
import re
import time
import urllib.parse
from typing import Optional
import pykka
from mopidy import audio as audio_lib
from mopidy import backend, exceptions, stream
from mopidy.audio import scan, tags
from mopidy.internal import http, playlists
from mopidy.models import Track
logger =... |
migrations | 0031_job_currentstep_choices | from django.db import migrations, models
def data_migration(apps, schema_editor):
Job = apps.get_model("main", "Job")
MicroServiceChainLink = apps.get_model("main", "MicroServiceChainLink")
MicroServiceChainLinkExitCode = apps.get_model(
"main", "MicroServiceChainLinkExitCode"
)
# I can't... |
draftviewproviders | view_bspline | # ***************************************************************************
# * Copyright (c) 2020 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
Post | UtilsArguments | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2014 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * Copyright (c) 2015 Dan Falck <ddfalck@gmail.com> ... |
module | projectedChangeStates | import wx
from eos.const import FittingModuleState
from eos.saveddata.module import Module
from gui.fitCommands.helpers import restoreCheckedStates
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
STATE_MAP = {
"inactive": FittingModuleState.OFFLINE,
"active": FittingModuleSt... |
TDTest | DrawViewDimensionTest | import unittest
import FreeCAD
from PySide import QtCore
from .TechDrawTestUtilities import createPageWithSVGTemplate
class DrawViewDimensionTest(unittest.TestCase):
def setUp(self):
"""Creates a page and 2 views"""
print("DVDTest.setUp()")
FreeCAD.newDocument("TDDimTest")
FreeCA... |
requests | compat | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
import sys
from .packages import chardet
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = _ver[0] == 2
#: Python 3.x?
is_py3 = _ver[0] == 3
try:
import simplejson as json
except (ImportError, SyntaxError):
# simple... |
SysML | toolbox | """The action definition for the SysML toolbox."""
from gaphor import UML
from gaphor.diagram.diagramtoolbox import (
DiagramTypes,
ElementCreateInfo,
ToolboxDefinition,
ToolDef,
ToolSection,
general_tools,
new_item_factory,
)
from gaphor.i18n import gettext, i18nize
from gaphor.SysML impor... |
schedulers | twisted | from __future__ import absolute_import
from functools import wraps
from apscheduler.schedulers.base import BaseScheduler
from apscheduler.util import maybe_ref
try:
from twisted.internet import reactor as default_reactor
except ImportError: # pragma: nocover
raise ImportError("TwistedScheduler requires Twis... |
core | VFS | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire X (FoFiX) #
# Copyright (C) 2009-2010 John Stumpo ... |
auth | update | # encoding: utf-8
import ckan.authz as authz
import ckan.logic as logic
import ckan.logic.auth as logic_auth
from ckan.common import _
# FIXME this import is evil and should be refactored
from ckan.logic.auth.create import _check_group_auth
from ckan.types import AuthResult, Context, DataDict
@logic.auth_allow_anon... |
migrations | 0003_mobileappusersettings | # Generated by Django 3.2.18 on 2023-03-21 15:53
import django.core.validators
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("user_management", "0009_organization_cluster_slug"),
("mobile_app", "0002_alter_mobile... |
migrations | 0002_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import django.db.models.deletion
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("user_management", "0001_squashed_initial"),
("base", "00... |
plugins | base | from typing import Tuple
class BasePlugin:
# The name of the plugin, eg. "My auth".
name = None
# Optional short description. It will be shown in the help
# under --auth-type.
description = None
# This be set automatically once the plugin has been loaded.
package_name = None
class Auth... |
funnels | funnel | from typing import List, cast
from posthog.queries.funnels.base import ClickhouseFunnelBase
class ClickhouseFunnel(ClickhouseFunnelBase):
"""
A basic ordered funnel.
## Query Intuition
We start with all events of interest (coming from the `FunnelEventQuery`). The query runs in different levels: at e... |
api | geoip | from typing import Dict, Optional
import structlog
from django.contrib.gis.geoip2 import GeoIP2
from sentry_sdk import capture_exception
logger = structlog.get_logger(__name__)
try:
geoip: Optional[GeoIP2] = GeoIP2(cache=8)
# Cache setting corresponds to MODE_MEMORY: Load database into memory. Pure Python.
... |
qltk | cbes | # Copyright 2005-2020 Joe Wreschnig, Michael Urman, Christoph Reiter,
# 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
# ... |
gh-pages | add_version | #!/usr/bin/env python3
from __future__ import unicode_literals
import hashlib
import json
import os.path
import sys
dirn = os.path.dirname
sys.path.insert(0, dirn(dirn(dirn(os.path.abspath(__file__)))))
from devscripts.utils import read_file, write_file
from youtube_dl.compat import compat_open as open
if len(sys.... |
resourceproxy | plugin | # encoding: utf-8
from __future__ import annotations
from logging import getLogger
from typing import Any, Callable, Container
from urllib.parse import urlparse
import ckan.lib.datapreview as datapreview
import ckan.lib.helpers as h
import ckan.plugins as p
from ckan.common import config
from ckanext.resourceproxy im... |
Tools | make_snapshot | # (c) 2022 Werner Mayer LGPL
"""
The module can be used from another module with:
from make_snapshot import make_snapshot
make_snapshot("file.stl", "image.png")
This other module then can be used with:
FreeCAD -c make_snapshot_from_file.py
or
FreeCADCmd make_snapshot_from_file.py
"""
import importlib
import os
i... |
Web | TestWebGui | # **************************************************************************
# Copyright (c) 2018 Werner Mayer <wmayer[at]users.sourceforge.net> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
action | patch | # encoding: utf-8
"""API functions for partial updates of existing data in CKAN"""
from ckan.logic import check_access as _check_access
from ckan.logic import get_action as _get_action
from ckan.logic import get_or_bust as _get_or_bust
from ckan.types import Context, DataDict
from ckan.types.logic import ActionResult... |
PyObjCTest | guitest_graphics | """
Some tests for difficult wrapped graphics functions and methods
NOTE: These require a WindowServer connection on MacOS X
"""
import array
import sys
from AppKit import *
from Foundation import *
from PyObjCTools.TestSupport import *
class SimpleImage:
"""
Helper class that makes it easier to access indi... |
posthog | dbrouter | from posthog.settings.data_stores import READ_REPLICA_OPT_IN
class ReplicaRouter:
def __init__(self, opt_in=None):
self.opt_in = opt_in if opt_in else READ_REPLICA_OPT_IN
"""
A database router to route reads to a separate Aurora endpoint
This adds opt-in routing for models, pointing them to ... |
mystran | add_femelement_material | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
zeromq | qa_zeromq_pull_msg_source | #!/usr/bin/env python
#
# Copyright 2020 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""Unit tests for ZMQ PULL Message Source block"""
import time
import pmt
import zmq
from gnuradio import blocks, gr, gr_unittest, zeromq
class qa_zeromq_pull_... |
jobs | base | """
A base class for other Job types to inherit from.
"""
import abc
import logging
import uuid
from django.utils import timezone
from main import models
from server.db import auto_close_old_connections
logger = logging.getLogger("archivematica.mcp.server.jobs")
class Job(metaclass=abc.ABCMeta):
"""
A singl... |
blocks | qa_patterned_interleaver | #!/usr/bin/env python
#
# Copyright 2008,2010,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, gr, gr_unittest
class test_patterned_interleaver(gr_unittest.TestCase):
def setUp(self):
self.t... |
booster | imprt | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.booster.add import CalcAddBoosterCommand
from gui.fitCommands.helpers import BoosterInfo, InternalCommandHistory
from service.fit import Fit
class GuiImportBoostersCommand(wx.Command):
def __init__(self, fitI... |
extractor | filmweb | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class FilmwebIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?filmweb\.no/(?P<type>trailere|filmnytt)/article(?P<id>\d+)\.ece"
_TEST = {
"url": "http://www.filmweb.no/trailere/article1264921.ece",
"md5": ... |
migrations | 0013_upload_archivesspace_inherit_notes | from django.db import migrations
def data_migration(apps, schema_editor):
arguments = " ".join(
[
'--host "%host%"',
'--port "%port%"',
'--user "%user%"',
'--passwd "%passwd%"',
'--dip_location "%SIPDirectory%"',
'--dip_name "%SIPName... |
pynocchio | comic_file_loader_tar | import logging
import tarfile
from .comic import Page
from .comic_file_loader import ComicLoader
from .exception import NoDataFindException
from .utility import IMAGE_FILE_FORMATS, get_file_extension
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def is_tarfile(filename):
"""Verify if file i... |
grc | main | # Copyright 2009-2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import argparse
import logging
import sys
import gi
gi.require_version("Gtk", "3.0")
gi.require_version("PangoCairo", "1.0")
from gi.repository import Gtk
VERSION_AND_DISCLAIMER_TEMP... |
planet | atomstyler | import re
from xml.dom import Node, minidom
from xml.parsers.expat import ExpatError
from htmlentitydefs import name2codepoint
from urlparse import urlparse, urlunparse
# select and apply an xml:base for this entry
class relativize:
def __init__(self, parent):
self.score = {}
self.links = []
... |
analog | qa_ctcss_squelch | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import random
from gnuradio import analog, blocks, gr, gr_unittest
class test_ctcss_squelch(gr_unittest.TestCase):
def setUp(self):
... |
downloaders | DataHu | # -*- coding: utf-8 -*-
#
# Test links:
# http://data.hu/get/6381232/random.bin
from ..base.simple_downloader import SimpleDownloader
class DataHu(SimpleDownloader):
__name__ = "DataHu"
__type__ = "downloader"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?data\.h... |
sabnzbd | osxmenu | #!/usr/bin/python3 -OO
# Copyright 2007-2023 The SABnzbd-Team (sabnzbd.org)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later ver... |
migrations | 0001_initial | # Generated by Django 3.2.15 on 2022-10-10 12:06
import uuid
import django.db.models.deletion
import django_migration_linter as linter
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("user_management", "0003_user_hide_phone_number"),
... |
classes | timeline | """
@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... |
beetsplug | filefilter | # This file is part of beets.
# Copyright 2016, Malte Ried.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... |
plugins | adultswim | """
$description American live TV channel and video on-demand service owned by Warner Bros.
$url adultswim.com
$type live, vod
$region various
$notes VODs may be protected by DRM
"""
import logging
import re
from urllib.parse import urlparse, urlunparse
from streamlink.plugin import Plugin, PluginError, pluginmatcher... |
migrations | 0135_auto_20220217_1624 | # Generated by Django 3.2.12 on 2022-02-17 16:24
import bookwyrm.models.fields
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0134_announcement_display_type"),
]
operations = [
migrations.RenameField(
model_name="author"... |
saveddata | override | # ===============================================================================
# Copyright (C) 2015 Ryan Holmes
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, e... |
QT | TabSVG | from Code.QT import TabBloques
from PyQt4 import QtCore, QtGui, QtSvg
class SVGSC(TabBloques.BloqueEspSC):
def __init__(self, escena, bloqueImgSVG, rutinaPulsada=None, siEditando=False):
super(SVGSC, self).__init__(escena, bloqueImgSVG)
self.rutinaPulsada = rutinaPulsada
self.rutinaPulsad... |
extractor | foxgay | from __future__ import unicode_literals
import itertools
from ..utils import get_element_by_id, int_or_none, remove_end
from .common import InfoExtractor
class FoxgayIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?foxgay\.com/videos/(?:\S+-)?(?P<id>\d+)\.shtml"
_TEST = {
"url": "http://foxgay.c... |
rtorrent | torrent | # Copyright (c) 2013 Chris Lucas, <chris@chrisjlucas.com>
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, ... |
engines | google_videos | # SPDX-License-Identifier: AGPL-3.0-or-later
"""Google (Video)
For detailed description of the *REST-full* API see: `Query Parameter
Definitions`_. Not all parameters can be applied.
.. _admonition:: Content-Security-Policy (CSP)
This engine needs to allow images from the `data URLs`_ (prefixed with the
``dat... |
cli | archivebox_version | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox version"
import argparse
import sys
from typing import IO, List, Optional
from ..config import OUTPUT_DIR
from ..logging_util import SmartFormatter, reject_stdin
from ..main import version
from ..util import docstring
@docstring(versio... |
examples | pyqt_waterfall_c | #!/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... |
config | routing | # 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, ... |
api | user | import json
import os
import secrets
import urllib.parse
from base64 import b32encode
from binascii import unhexlify
from typing import Any, Optional, cast
import requests
from django.conf import settings
from django.contrib.auth import login, update_session_auth_hash
from django.contrib.auth.password_validation impor... |
PyObjCTest | test_nsanimation | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSAnimationHelper(NSObject):
def animationShouldStart_(self, animation):
return 1
def animation_valueForProgress_(self, a, b):
return 1
def animation_didReachProgres... |
scripts | uccnc_post | # -*- coding: utf-8 -*-
# ***************************************************************************
# * *
# * based upon linuxcnc_post.py (c) sliptonic (shopinthewoods@gmail.com) *
# * ... |
bleachbit | Special | # vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2023 Andrew Ziem
# https://www.bleachbit.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 3 of the License, or
# ... |
extractors | kuwo | #!/usr/bin/env python
__all__ = ["kuwo_download"]
import re
from ..common import *
def kuwo_download_by_rid(rid, output_dir=".", merge=True, info_only=False):
html = get_content(
"http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=MUSIC_%s" % rid
)
title = match1(html, r"<name>(.*)</name>")... |
migrations | 0001_squashed_initial | # Generated by Django 3.2.5 on 2022-05-31 14:46
import apps.auth_token.models.slack_auth_token
import django_migration_linter as linter
from django.db import migrations, models
from django.utils import timezone
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
... |
draftguitools | gui_annotationstyleeditor | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it a... |
clientScripts | verify_aip | #!/usr/bin/env python
import os
import shutil
import sys
from pprint import pformat
import django
django.setup()
import databaseFunctions
# archivematicaCommon
from archivematicaFunctions import get_setting
from bagit import Bag, BagError
from django.conf import settings as mcpclient_settings
from django.db import t... |
extractors | iqiyi | #!/usr/bin/env python
import hashlib
import json
import time
from math import floor
from random import randint, random
from uuid import uuid4
from zlib import decompress
from .. import json_output
from ..common import *
from ..common import print_more_compatible as print
from ..extractor import VideoExtractor
from ..... |
builtinViewColumns | ammoIcon | # =============================================================================
# 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 ... |
UI | RecommendedMode | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from cura import CuraApplication
from PyQt6.QtCore import QObject, pyqtSlot
#
# This object contains helper/convenience functions for Recommended mode.
#
class RecommendedMode(QObject):
# Sets to use the adhesion or n... |
searchdialog | track | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2016 Rahul Raturi
# Copyright (C) 2018 Antonio Larrosa
# Copyright (C) 2018-2021 Laurent Monin
# Copyright (C) 2018-2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the ter... |
vimode | normal | # vimode -- Vi Mode package for QPlainTextEdit
#
# 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 option... |
extractor | aol | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_parse_qs, compat_urllib_parse_urlparse
from ..utils import ExtractorError, int_or_none, url_or_none
from .yahoo import YahooIE
class AolIE(YahooIE):
IE_NAME = "aol.com"
_VALID_URL = r"(?:aol-video:|https?://(?:www\... |
cli | translations | # -*- coding: utf-8 -*-
"""
flaskbb.cli.translations
~~~~~~~~~~~~~~~~~~~~~~~~
This module contains all translation commands.
:copyright: (c) 2016 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import click
from flaskbb.cli.main import flaskbb
from flaskbb.cli.utils import va... |
generator | hier_block | import codecs
import collections
import os
from .. import Constants
from ..io import yaml
from .top_block import TopBlockGenerator
class HierBlockGenerator(TopBlockGenerator):
"""Extends the top block generator to also generate a block YML file"""
def __init__(self, flow_graph, _):
"""
Initi... |
PartDesignTests | TestHole | # **************************************************************************
# Copyright (c) 2017 Kurt Kremitzki <kkremitzki@gmail.com> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
classes | interface | """Interface item implementation. There are several notations supported.
- class box with interface stereotype
- folded interface
- ball is drawn to indicate provided interface
- socket is drawn to indicate required interface
Interface item can act as icon of assembly connector, see
`gaphor.diagram.connector`... |
system-terminal | plugin | from __future__ import absolute_import
import os
import shlex
import subprocess
from gi.repository import GLib, Vte
from sunflower.parameters import Parameters
from sunflower.plugin_base.terminal import Terminal, TerminalType
def register_plugin(application):
"""Register plugin classes with application"""
a... |
cura | PlatformPhysics | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import random # used for list shuffling
from cura.Operations import PlatformPhysicsOperation
from cura.Scene import ZOffsetDecorator
from cura.Scene.ConvexHullDecorator import ConvexHullDecorator
from PyQt6.QtCore import ... |
searx | webadapter | from collections import defaultdict
from typing import Dict, List, Optional, Tuple
from searx.engines import categories, engines
from searx.exceptions import SearxParameterException
from searx.preferences import Preferences, is_locked
from searx.query import RawTextQuery
from searx.search import EngineRef, SearchQuery... |
aliceVision | Publish | from __future__ import print_function
__version__ = "1.3"
import distutils.dir_util as du
import glob
import os
import shutil
from meshroom.core import desc
class Publish(desc.Node):
size = desc.DynamicNodeSize("inputFiles")
category = "Export"
documentation = """
This node allows to copy files into a... |
PyObjCTest | test_arrays | """
Some tests for arrays in method arguments (the 'int foo[4]' type of array).
This tests both calling such methods, as well as implementing methods with such arguments.
"""
import array
import objc
from PyObjCTest.arrays import *
from PyObjCTest.fnd import NSObject
from PyObjCTools.TestSupport import *
class Test... |
lib | comment_tree | # 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, ... |
calculix | write_constraint_heatflux | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
extractor | beatport | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import int_or_none
from .common import InfoExtractor
class BeatportIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.|pro\.)?beatport\.com/track/(?P<display_id>[^/]+)/(?P<id>[0-9]+)"
_TESTS = [
... |
unisearch | db | # Copyright 2014 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import sys
import unicodedata
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.