section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
fetcher | simple | import collections
import logging
from time import sleep
import requests
from cachecontrol import CacheControl
from kibitzr import __version__ as version
logger = logging.getLogger(__name__)
class SessionFetcher:
RETRIABLE_EXCEPTIONS = (
(requests.HTTPError, 5),
(requests.ConnectionError, 15),
... |
controllers | robots | # The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
plugins | search_operators | import shlex
import string
from flask_babel import gettext
name = gettext("Search operators")
description = gettext(
"""Filter results using hyphen, site: and -site:.
Please note that you might get less results with the additional filtering."""
)
default_on = False
def on_result(request, search, result):
q ... |
python | dial_tone | #!/usr/bin/env python
#
# Copyright 2004,2005,2007,2012 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 audio, gr
from gnuradio.eng_arg import eng_float
try:
from gnuradio import analog
ex... |
engines | json_engine | #!/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 json
from thumbor.engines import BaseEngine
class JSONEngi... |
gui | workspace | # This file is part of MyPaint.
# Copyright (C) 2014-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... |
extractor | yandexdisk | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
mimetype2ext,
try_get,
urljoin,
)
from .common import InfoExtractor
class YandexDiskIE(InfoExtractor):
_VALID_URL = r"""(?x)https?://
(?P... |
apscheduler | util | """This module contains several handy functions primarily meant for internal use."""
from __future__ import division
import re
from calendar import timegm
from datetime import date, datetime, time, timedelta, tzinfo
from functools import partial
import six
from pytz import timezone, utc
try:
from inspect import... |
debian | update_metainfo | import logging
import time
import xml.etree.ElementTree as xml
from argparse import ArgumentParser
from pathlib import Path
import defusedxml.ElementTree as defxml
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def parse_arguments():
parser = ArgumentParser(description='Update Trib... |
generateTemplates | templateClassPyExport | #! python
# -*- coding: utf-8 -*-
# (c) 2006 Juergen Riegel
import os
import sys
import generateBase.generateModel_Module
import generateBase.generateTools
from . import template
class TemplateClassPyExport(template.ModelTemplate):
def Generate(self):
# self.ParentNamespace = "Base"
# self.Nam... |
utils | network | # coding:utf-8
import logging
import time
from cactus.utils.parallel import multiMap
from six.moves import urllib
logger = logging.getLogger(__name__)
def retry(exceptions, tries=4, delay=3, backoff=2):
"""
Retry execution in case we fail on one of the exceptions
"""
def deco_retry(f):
def ... |
cli | archivebox_setup | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox setup"
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 setup
from ..util import docstring
@docstring(setup.__do... |
migrations | 0009_auto_20210617_2218 | # Generated by Django 3.2.3 on 2021-06-17 22:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("photos", "0008_auto_20210604_1842"),
]
operations = [
migrations.AddField(
model_name="library",
name="classification... |
blocks | qa_host_buffer_copy | #!/usr/bin/env python
#
# Copyright 2009,2010,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import blocks, gr, gr_unittest
def makeExpected(history, src_data):
"""Helper function to make expected result from history and sou... |
publishers | ajax | """
Created on 21 févr. 2019
@author: antonin
"""
from django.contrib.auth.decorators import user_passes_test
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseNotFound
from django.views.decorators.http import require_POST
from papers.user import is_admin
from pub... |
anticaptchas | ReCaptcha | # -*- coding: utf-8 -*-
import io
import os
import re
import urllib.parse
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
pass
from ..base.captcha_service import CaptchaService
class ReCaptcha(CaptchaService):
__name__ = "ReCaptcha"
__type__ = "anticaptcha"
__version__ = "0... |
helpers | lrucache | from collections import OrderedDict
from collections.abc import (
Callable,
ItemsView,
Iterator,
KeysView,
MutableMapping,
ValuesView,
)
from typing import TypeVar
K = TypeVar("K")
V = TypeVar("V")
class LRUCache(MutableMapping[K, V]):
"""
Mapping which maintains a maximum size by rem... |
extractor | vidlii | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
float_or_none,
get_element_by_id,
int_or_none,
strip_or_none,
unified_strdate,
urljoin,
)
from .common import InfoExtractor
class VidLiiIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?vidlii\.com... |
extractor | ted | from __future__ import unicode_literals
import json
import re
from ..compat import compat_str, compat_urlparse
from ..utils import extract_attributes, float_or_none, int_or_none, try_get, url_or_none
from .common import InfoExtractor
class TEDIE(InfoExtractor):
IE_NAME = "ted"
_VALID_URL = r"""(?x)
... |
midifiles | meta | """
Meta messages for MIDI files.
TODO:
- what if an unknown meta message is implemented and someone depends on
the 'data' attribute?
- is 'type_byte' a good name?
- 'values' is not a good name for a dictionary.
- type and value safety?
- copy().
- expose _key_signature_encode/deco... |
C4Model | c4model | # This file is generated by coder.py. DO NOT EDIT!
# ruff: noqa: F401, E402, F811
# fmt: off
from __future__ import annotations
from gaphor.core.modeling.properties import association
from gaphor.core.modeling.properties import attribute as _attribute
from gaphor.core.modeling.properties import derived, derivedunion
... |
zeromq | rpc_manager | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import threading
import pmt
import zmq
class rpc_manager(object):
def __init__(self):
self.zmq_context = zmq.Context()
self.poller_rep = zmq.Poller()
sel... |
gui | esiFittings | import json
import config
import gui.globalEvents as GE
import gui.mainFrame
import requests
# noinspection PyPackageRequirements
import wx
from eos.db import getItem
from eos.saveddata.cargo import Cargo
from gui.auxWindow import AuxiliaryFrame
from gui.characterEditor import APIView
from gui.display import Display
... |
metadata | wv | # 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... |
books | Aisixiang | #!/usr/bin/env python
# -*- coding:utf-8 -*-
""" 爱思想的网站文章大多数有分页,此书籍是自定义书籍处理分页的一个例子 """
import re
from base import BaseFeedBook
from bs4 import BeautifulSoup, NavigableString
def getBook():
return Aisixiang
class Aisixiang(BaseFeedBook):
title = "爱思想一周排行"
description = "最具原创性和思想性的中文学术平台之一。每周六推送。"
l... |
util | git | #!/usr/bin/env python
import os
import subprocess
from ..version import __version__
def get_head(repo_path):
"""Get (branch, commit) from HEAD of a git repo."""
try:
ref = (
open(os.path.join(repo_path, ".git", "HEAD"), "r")
.read()
.strip()[5:]
.split... |
scripts | new_version | #!/usr/bin/env python
#
# 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 General Public L... |
raven | base | """
raven.base
~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
import os
import sys
import time
import uuid
import warnings
import zlib
from datetime import datetime
from insp... |
extractor | kinja | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str, compat_urllib_parse_unquote
from ..utils import (
int_or_none,
parse_iso8601,
strip_or_none,
try_get,
unescapeHTML,
urljoin,
)
from .common import InfoExtractor
class KinjaEmbedIE(InfoExtractor... |
femexamples | constraint_section_print | # ***************************************************************************
# * Copyright (c) 2020 Sudhanshu Dubey <sudhanshu.thethunder@gmail.com> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
object | model | import os
import sys
from pathlib import Path
import numpy as np
import tensorflow as tf
from django.utils import timezone
from photonix.classifiers.base_model import BaseModel
from photonix.classifiers.object.utils import label_map_util
from photonix.photos.utils.metadata import PhotoMetadata
from photonix.photos.uti... |
neubot | privacy | #!/usr/bin/env python
#
# Copyright (c) 2012 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 General Public L... |
chardet | eucjpprober | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org 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 Reserved.
#
# Con... |
commands | sync_feature_flags | from typing import Dict, cast
from django.core.management.base import BaseCommand
from posthog.models import FeatureFlag, Team, User
class Command(BaseCommand):
help = "Add and enable all feature flags in frontend/src/lib/constants.tsx for all teams"
def handle(self, *args, **options):
flags: Dict[s... |
searx | raise_for_httperror | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Raise exception for an HTTP response is an error.
"""
from searx.exceptions import (
SearxEngineAccessDeniedException,
SearxEngineCaptchaException,
SearxEngineTooManyRequestsException,
)
def is_cloudflare_challenge(resp):
if resp.status_code in [429, 50... |
gtkui | macosx | # -*- coding: utf-8 -*-
#
# gPodder - A media aggregator and podcast client
# Copyright (c) 2005-2018 The gPodder Team
#
# gPodder is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the Licens... |
object-detection | trainer | # 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 | nationalgeographic | from __future__ import unicode_literals
from ..utils import smuggle_url, url_basename
from .common import InfoExtractor
from .fox import FOXIE
class NationalGeographicVideoIE(InfoExtractor):
IE_NAME = "natgeo:video"
_VALID_URL = r"https?://video\.nationalgeographic\.com/.*?"
_TESTS = [
{
... |
helpers | gcom | import logging
from typing import Optional, Tuple
from apps.auth_token.exceptions import InvalidToken
from apps.auth_token.models import PluginAuthToken
from apps.grafana_plugin.helpers import GcomAPIClient
from apps.user_management.models import Organization
from django.conf import settings
from django.utils import t... |
downloaders | MegaupNet | # -*- coding: utf-8 -*-
import json
import re
from pyload.core.utils.misc import eval_js
from ..base.simple_downloader import SimpleDownloader
class MegaupNet(SimpleDownloader):
__name__ = "MegaupNet"
__type__ = "downloader"
__version__ = "0.03"
__status__ = "testing"
__pattern__ = r"https?://... |
windows | keyboardcontrol | # Copyright (c) 2011 Hesky Fisher.
# See LICENSE.txt for details.
#
# winkeyboardcontrol.py - capturing and injecting keyboard events in windows.
"""Keyboard capture and control in windows.
This module provides an interface for basic keyboard event capture and
emulation. Set the key_up and key_down functions of the
K... |
scripts | invesalius_server | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# This scripts allows sending events to InVesalius via Socket.IO, mimicking InVesalius's
# internal communication. It can be useful for developing and debugging InVesalius.
#
# Example usage:
#
# - (In console window 1) Run the script by: python scripts/invesalius_ser... |
funnels | funnel_correlation | import dataclasses
import urllib.parse
from typing import (
Any,
Dict,
List,
Literal,
Optional,
Set,
Tuple,
TypedDict,
Union,
cast,
)
from ee.clickhouse.queries.column_optimizer import EnterpriseColumnOptimizer
from ee.clickhouse.queries.groups_join_query import GroupsJoinQuery
... |
plugin | plugin | from collections import defaultdict
try:
from sg_py_vendor.pymarshal import type_assert, type_assert_iter
except ImportError:
from pymarshal import type_assert, type_assert_iter
class PluginControl:
def __init__(
self,
num,
value,
):
self.num = type_assert(
... |
templaters | alert_templater | from abc import ABC, abstractmethod
from dataclasses import dataclass
from apps.base.messaging import get_messaging_backend_from_id
from apps.slack.slack_formatter import SlackFormatter
from common.jinja_templater import apply_jinja_template
from common.jinja_templater.apply_jinja_template import (
JinjaTemplateEr... |
legacy | v3_1_0_session_cookie_format | import argparse
from typing import TYPE_CHECKING, Any, Dict, List, Type
if TYPE_CHECKING:
from httpie.sessions import Session
INSECURE_COOKIE_JAR_WARNING = """\
Outdated layout detected for the current session. Please consider updating it,
in order to not get affected by potential security problems.
For fixing ... |
cypress | wait | import datetime
import http.client
import time
def main():
print("Waiting to run tests until PostHog is up and serving requests")
booted = False
ts = datetime.datetime.now()
while not booted and (datetime.datetime.now() - ts).seconds < 240:
try:
conn = http.client.HTTPConnection("1... |
draftguitools | gui_trackers | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
parts | keyboard | # 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
... |
widgets | downloadwidgetitem | import logging
from datetime import datetime
from typing import Dict, Optional
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QProgressBar, QTreeWidgetItem, QVBoxLayout, QWidget
from tribler.core.utilities.simpledefs import DownloadStatus
from tribler.gui.defs import STATUS_STRING
from tribler.gui.utilities i... |
gui | Console | """
Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import logging
import os
import gi
from gi.repository import Gdk, GObject, Gtk
from ..core import Messages
from .Constants import DEFAULT_CONSOLE_WINDOW_WIDTH
from .Dialogs im... |
PyObjCTest | test_nsfont | import os
import AppKit
import objc
from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestNSFont(TestCase):
def matrixEquals(self, value1, value2):
self.assertEqual(len(value1), len(value... |
caching | fetch_from_cache | from dataclasses import dataclass
from datetime import datetime, timedelta
from typing import Any, Optional, Union
from django.utils.timezone import now
from posthog.caching.calculate_results import (
calculate_cache_key,
calculate_result_by_insight,
)
from posthog.caching.insight_cache import update_cached_st... |
femobjects | material_mechanicalnonlinear | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
mainwindow | messageview | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Showing messages above the statusbar."""
from typing import MutableSequence, Optional
from qutebrowser.config import config, stylesheet
from qutebrowser.qt.core import Qt, QTimer, pyqtSigna... |
doxyxml | text | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Utilities for extracting text from generated classes.
"""
def is_string(txt):
if isinstance(txt, str):
return True
try:
if isinstance(txt, unicode):
... |
search | solr | # 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, ... |
qltk | tagscombobox | # Copyright 2006 Joe Wreschnig
# 2015 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from gi... |
blocktool | cli | #
# Copyright 2019 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Module to generate parsed header output data """
import json
import logging
import os
import sys
import click
from click import ClickException
from gnuradio.modtool.core import y... |
views | integrations | from apps.alerts.models import AlertReceiveChannel
from apps.auth_token.auth import ApiTokenAuthentication
from apps.public_api.serializers import (
IntegrationSerializer,
IntegrationUpdateSerializer,
)
from apps.public_api.throttlers.user_throttle import UserThrottle
from common.api_helpers.filters import ByTe... |
mod-dash | client_negotiate | # mod_dash/client_negotiate.py
#
# Copyright (c) 2010-2011, 2013
# 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... |
tagsources | _acoustid | # This file is part of pyacoustid.
# Copyright 2012, Adrian Sampson.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, c... |
mac | pyobjc_framework_build | #!/usr/bin/env python
import os
import shutil
import subprocess
import sys
sys.path = ["."] + sys.path
os.chdir(os.path.dirname(__file__))
TargetDir = "build/Release/pyobjc"
try: shutil.rmtree(TargetDir)
except OSError: pass
os.mkdir(TargetDir)
assert os.path.exists(TargetDir)
if False:
# TODO: doesnt work current... |
softwaremixer | mixer | import logging
import pykka
from mopidy import mixer
from pykka.typing import proxy_method
logger = logging.getLogger(__name__)
class SoftwareMixer(pykka.ThreadingActor, mixer.Mixer):
name = "software"
def __init__(self, config):
super().__init__(config)
self._audio_mixer = None
se... |
preferences | associations | from gi.repository import Gdk, Gtk
from sunflower.gui.input_dialog import ApplicationInputDialog, InputDialog
from sunflower.widgets.settings_page import SettingsPage
class Column:
NAME = 0
COMMAND = 1
class AssociationsOptions(SettingsPage):
"""Mime-type associations options extension class"""
def... |
AddonManager | addonmanager_cache | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
examples | atsc_ctrlport_monitor | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import sys
import matplotlib
import matplotlib.animation as animation
import matplotlib.pyplot as plt
import numpy
from gnuradio.ctrlport.GNURadioControlPortClient import (
GNURadioControlPortClient,... |
server | gunicorn | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2021-2023 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
from gunicorn.app.base import BaseApplication
from ._base import BaseServer
class GunicornApp(BaseApplication):
... |
dateutil | easter | # -*- coding: utf-8 -*-
"""
This module offers a generic easter computing method for any given year, using
Western, Orthodox or Julian algorithms.
"""
import datetime
__all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTERN"]
EASTER_JULIAN = 1
EASTER_ORTHODOX = 2
EASTER_WESTERN = 3
def easter(year,... |
src | DigitalFactoryFileProvider | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os
from cura.API import Account
from cura.CuraApplication import CuraApplication
from UM.FileProvider import FileProvider
from UM.Logger import Logger
from .DigitalFactoryController import DigitalFactoryController
... |
Operations | SetParentOperation | # Copyright (c) 2016 Ultimaker B.V.
# Uranium is released under the terms of the LGPLv3 or higher.
from typing import Optional
from UM.Operations import Operation
from UM.Scene.SceneNode import SceneNode
class SetParentOperation(Operation.Operation):
"""An operation that parents a scene node to another scene nod... |
blocks | qa_type_conversions | #!/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 math import atan2, sqrt
from gnuradio import blocks, gr, gr_unittest
class test_type_conversions(gr_unittest.TestCase):
def setUp(self):
... |
invesalius | utils | # --------------------------------------------------------------------------
# Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas
# Copyright: (C) 2001 Centro de Pesquisas Renato Archer
# Homepage: http://www.softwarepublico.gov.br
# Contact: invesalius@cti.gov.br
# License: GNU... |
dictization | model_dictize | # encoding: utf-8
"""
These dictize functions generally take a domain object (such as Package) and
convert it to a dictionary, including related objects (e.g. for Package it
includes PackageTags, PackageExtras, PackageGroup etc).
The basic recipe is to call:
dictized = ckan.lib.dictization.table_dictize(domain_o... |
utils | column | #
# Copyright (C) 2011 Nick Lanham <nick@afternight.org>
#
# 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 copy
import logging
impor... |
devscripts | buildserver | #!/usr/bin/python3
import argparse
import ctypes
import functools
import os.path
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
sys.path.insert(0, os.path.dirname(os.path.dirname((os.path.abspath(__file__)))))
from youtube_dl.compat import (
compat_http_server,
co... |
decrypters | CloudzillaToFolder | # -*- coding: utf-8 -*-
import re
from ..base.simple_decrypter import SimpleDecrypter
class CloudzillaToFolder(SimpleDecrypter):
__name__ = "CloudzillaToFolder"
__type__ = "decrypter"
__version__ = "0.11"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?cloudzilla\.to/share/folder/(?P<ID... |
lib | document | # -*- coding: utf-8 -*-
# This file is part of MyPaint.
# Copyright (C) 2010-2019 by the MyPaint Development Team
# Copyright (C) 2007-2013 by Martin Renold <martinxyz@gmx.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
... |
ui | ui_tagsfromfilenames | # -*- coding: utf-8 -*-
# Automatically generated - don't edit.
# Use `python setup.py build_ui` to update it.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TagsFromFileNamesDialog(object):
def setupUi(self, TagsFromFileNamesDialog):
TagsFromFileNamesDialog.setObjectName("TagsFromFileNamesDialog"... |
gui | icons_rc | # -*- coding: utf-8 -*-
# Resource object code
#
# Created by: The Resource Compiler for PyQt5 (Qt v5.11.0)
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore
qt_resource_data = b"\
\x00\x00\x0a\x85\
\x3c\
\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
\x30\x22\x20\x... |
CloudSync | RestartApplicationPresenter | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from cura.CuraApplication import CuraApplication
from UM import i18nCatalog
from UM.Message import Message
class RestartApplicationPresenter:
"""Presents a dialog telling the user that a restart is required to apply c... |
frescobaldi-app | documentstructure | # 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
... |
core | playback | from __future__ import annotations
import logging
import urllib.parse
from collections.abc import Iterable
from typing import TYPE_CHECKING, Optional
from mopidy.audio import PlaybackState
from mopidy.core import listener
from mopidy.exceptions import CoreError
from mopidy.internal import deprecation, models, validat... |
views | files_listview | """
@file
@brief This file contains the project file listview, used by the main window
@author Noah Figg <eggmunkee@hotmail.com>
@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 ... |
mainwin | releasewidget | import sys
import traceback
from copy import deepcopy
from functools import partial
from PyQt5 import QtCore
from PyQt5.QtCore import QModelIndex, Qt, pyqtRemoveInputHook, pyqtSignal
from PyQt5.QtWidgets import (
QAbstractItemView,
QAction,
QApplication,
QHeaderView,
QMenu,
QStyle,
QTreeVie... |
migrations | 0002_alter_mobileappauthtoken_user | import django.db.models.deletion
from django.db import migrations, models
def delete_user_duplicate_mobileappauthtokens(apps, _):
MobileAppAuthToken = apps.get_model("mobile_app", "MobileAppAuthToken")
# start w/ the oldest mobile app auth tokens (ORDER BY id ASC)
# and if we find any newer tokens, delet... |
xl | xdg | # 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... |
extractor | turbo | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none, qualities, xpath_text
from .common import InfoExtractor
class TurboIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?turbo\.fr/videos-voiture/(?P<id>[0-9]+)-"
... |
draftmake | make_patharray | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2013 WandererFan <wandererfan@gmail.com> *
# * Co... |
Code | GestorElo | import datetime
import random
import time
from Code import Apertura, Gestor, Jugada, Util, XMotorRespuesta
from Code.Constantes import *
from Code.QT import QTUtil2
def listaMotoresElo():
x = """amyan|1|1112|5461
amyan|2|1360|6597
amyan|3|1615|7010
amyan|4|1914|7347
alaric|1|1151|5442
alaric|2|1398|6552
alaric|3... |
aliceVision | MeshFiltering | __version__ = "3.0"
from meshroom.core import desc
class MeshFiltering(desc.AVCommandLineNode):
commandLine = "aliceVision_meshFiltering {allParams}"
category = "Dense Reconstruction"
documentation = """
This node applies a Laplacian filtering to remove local defects from the raw Meshing cut.
"""
i... |
canto-curses | theme | # -*- 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... |
marketSources | evemarketdata | # =============================================================================
# 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 ... |
deluge-toggle | gtkui | #
# 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... |
engines | bing | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Bing (Web)
"""
import re
from urllib.parse import urlencode
from lxml import html
from searx import logger
from searx.utils import eval_xpath, extract_text, match_language
logger = logger.getChild("bing engine")
# about
about = {
"website": "https://www.bing.com... |
Scripts | HelloWorld | #!/usr/bin/env pythonw
# HelloWorld.py
#
# The original PyObjC interface example by Steve Majewski.
#
# A quick guide to runtime name mangling:
#
# ObjC becomes Python
# [ obj method ] obj.method()
# [ obj method: arg ] obj.method_(arg)
# [ obj me... |
views | phone_notifications | import logging
from apps.auth_token.auth import ApiTokenAuthentication
from apps.phone_notifications.exceptions import (
CallsLimitExceeded,
FailedToMakeCall,
FailedToSendSMS,
NumberNotVerified,
SMSLimitExceeded,
)
from apps.phone_notifications.phone_backend import PhoneBackend
from apps.public_api... |
prototypes | jsfunction | # python 3 support
import six
if six.PY3:
basestring = str
long = int
xrange = range
unicode = str
# todo fix apply and bind
class FunctionPrototype:
def toString():
if not this.is_callable():
raise TypeError("toString is not generic!")
args = ", ".join(this.code.__c... |
qltk | textedit | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from ... |
downloaders | GofileIo | # -*- coding: utf-8 -*-
import base64
import json
import re
from ..base.downloader import BaseDownloader
from ..helpers import set_cookie
class GofileIo(BaseDownloader):
__name__ = "GofileIo"
__type__ = "downloader"
__version__ = "0.01"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.