section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
QT | Motores | from Code import VarGen
if VarGen.isLinux32:
import Code.EnginesLinux32 as Engines
elif VarGen.isLinux64:
import Code.EnginesLinux64 as Engines
else:
import Code.EnginesWindows as Engines
from Code import BaseConfig, EnginesMicElo, GestorElo, MotoresExternos
from Code.QT import Controles, Iconos, QTVarios... |
commands | get_fpr_changes | import itertools
import json
from django.core.management.base import BaseCommand
class frozendict(dict):
def __hash__(self):
return hash((frozenset(self), frozenset(self.values())))
class Command(BaseCommand):
help = "Generate updates from FPR dumpdata JSON files"
def add_arguments(self, parse... |
plugins | youtube | """
$description Global live-streaming and video hosting social platform owned by Google.
$url youtube.com
$url youtu.be
$type live, vod
$metadata id
$metadata author
$metadata category
$metadata title
$notes Protected videos are not supported
"""
import json
import logging
import re
from urllib.parse import urlparse,... |
engines | digbt | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
DigBT (Videos, Music, Files)
"""
from urllib.parse import urljoin
from lxml import html
from searx.utils import extract_text, get_torrent_size
# about
about = {
"website": "https://digbt.org",
"wikidata_id": None,
"official_api_documentation": None,
"... |
old | packagetools | # -*- coding: utf-8 -*-
# JDownloader/src/jd/controlling/LinkGrabberPackager.java
import re
from urllib.parse import urlparse
def match_first(string, *args):
"""
matches against list of regexp and returns first match.
"""
for patternlist in args:
for pattern in patternlist:
r = pa... |
bleachbit | General | # 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
# ... |
port | eft | # =============================================================================
# Copyright (C) 2014 Ryan Holmes
#
# This file is part of pyfa.
#
# pyfa is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either v... |
Robot | RobotExample | # Example how to use the basic robot class Robot6Axis which represent a 6-Axis
# industrial robot. The Robot Module is dependent on Part but not on other Modules.
# It works mostly with the basic types Placement, Vector and Matrix. So we need
# only:
import tempfile
import FreeCAD as App
from FreeCAD import *
from Par... |
views | reading | """ the good stuff! the books! """
import logging
from bookwyrm import forms, models
from bookwyrm.views.shelf.shelf_actions import unshelve
from django.contrib.auth.decorators import login_required
from django.core.cache import cache
from django.db import transaction
from django.http import HttpResponse, HttpResponse... |
extractor | ruv | # coding: utf-8
from __future__ import unicode_literals
from ..utils import determine_ext, unified_timestamp
from .common import InfoExtractor
class RuvIE(InfoExtractor):
_VALID_URL = (
r"https?://(?:www\.)?ruv\.is/(?:sarpurinn/[^/]+|node)/(?P<id>[^/]+(?:/\d+)?)"
)
_TESTS = [
{
... |
accounts | DownsterNet | # -*- coding: utf-8 -*-
import json
import random
import string
import time
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from ..base.multi_account import MultiAccount
class DownsterApi(object):
API_URL = "https://downster.net/api/"
def __init__(self, plugin):
self.plugin... |
Code | DBgames | import atexit
import os
import random
import sqlite3
import time
import LCEngine4 as LCEngine
from Code import ControlPosicion, Partida, Util, VarGen
posA1 = LCEngine.posA1
a1Pos = LCEngine.a1Pos
pv2xpv = LCEngine.pv2xpv
xpv2pv = LCEngine.xpv2pv
xpv2pgn = LCEngine.xpv2pgn
PGNreader = LCEngine.PGNreader
setFen = LCEng... |
tornado | static | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.static
~~~~~~~~~~~~~~~~~~~~~
Various static handlers required for SockJS to function properly.
"""
import hashlib
import random
import sys
import time
from octoprint.vendor.sockj... |
Code | DGT | """
Rutinas internas para la conexion con DGTEBDLL.dll
"""
import ctypes
from Code import Util, VarGen
DGT_ON = "DGT.ON"
def activarSegunON_OFF(dispatch):
if siON():
if VarGen.dgt is None:
if activar():
showDialog()
else:
ponOFF()
... |
comictaggerlib | autotagprogresswindow | """A PyQT4 dialog to show ID log and progress"""
# Copyright 2012-2014 Anthony Beville
# 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
# Unl... |
cura | CuraApplication | # Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import enum
import os
import platform
import sys
import tempfile
import time
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, cast
import cura.Settings.cura_empty_instance_containers
import numpy
import UM.... |
PyObjCTest | test_cggradient | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
long
except NameError:
long = int
class TestCGGradient(TestCase):
@min_os_level("10.5")
def testTypes(self):
self.assertIsCFType(CGGradientRef)
@min_os_level("10.5")
def testConstants(self):
self.ass... |
digital | qpsk | #
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
QPSK modulation.
Demodulation is not included since the generic_mod_demod
"""
from gnuradio import gr
from gnuradio.digital.generic_mod_demod import (
generic_demod... |
canto-next | client | # -*- 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.
import errno
import... |
forms | edit_user | """ using django model forms """
from bookwyrm import models
from bookwyrm.models.fields import ClearableFileInputWithWarning
from django import forms
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_laz... |
settings | base_variables | import os
import sys
import structlog
from posthog.settings.utils import get_from_env, str_to_bool
logger = structlog.get_logger(__name__)
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
DEBUG = get_from_... |
downloaders | SizedriveCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class SizedriveCom(SimpleDownloader):
__name__ = "SizedriveCom"
__type__ = "downloader"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?sizedrive\.com/[rd]/(?P<ID>\w+)"
__con... |
extractors | UnTar | # -*- coding: utf-8 -*-
import os
import sys
import tarfile
from pyload.plugins.base.extractor import ArchiveError, BaseExtractor, CRCError
# Fix for tarfile CVE-2007-4559
def _safe_extractall(tar, path=".", members=None, *, numeric_owner=False):
def _is_within_directory(directory, target):
abs_director... |
filter | qa_single_pole_iir | #!/usr/bin/env python
#
# Copyright 2005,2007,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, filter, gr, gr_unittest
class test_single_pole_iir_filter(gr_unittest.TestCase):
def setUp(self):
self.... |
clientScripts | bind_pid | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2017 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
FeatureHole | FeatureHole | # /******************************************************************************
# * Copyright (c) 2012 Jan Rheinländer <jrheinlaender@users.sourceforge.net> *
# * *
# * This file is part of the FreeCAD CAx development system. ... |
PyObjCTest | test_bridgesupport | import ctypes
import imp
import os
import re
import subprocess
import sys
import xml.etree.ElementTree as ET
import objc
import objc._bridgesupport as bridgesupport
from PyObjCTools.TestSupport import *
try:
basestring
except NameError:
basestring = str
try:
long
except NameError:
long = int
IDENTIF... |
migrations | 0157_auto_20220909_2338 | # Generated by Django 3.2.15 on 2022-09-09 23:38
import bookwyrm.models.fields
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0156_alter_user_preferred_language"),
]
operations = [
migrations.Al... |
Tools | FCFileTools | # shell and operating system
import os
import re
import sys
verbose = 0
dcount = fcount = 0
maxfileload = 100000
blksize = 1024 * 8
def cpfile(pathFrom, pathTo, maxfileload=maxfileload):
"""
copy file pathFrom to pathTo, byte for byte
"""
if os.path.getsize(pathFrom) <= maxfileload:
bytesFrom... |
polar | helper_functions | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import copy
import sys
import time
import numpy as np
def bsc_channel(p):
"""
binary symmetric channel (BSC)
output alphabet Y = {0, 1} and
W(0|0) = W(1|1) and W(1|0) = W(0|1)
... |
gui | topbar | # This file is part of MyPaint.
# Copyright (C) 2013-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
"""Combined menu... |
plugin-base | provider | from __future__ import absolute_import
import os
from collections import namedtuple
from sunflower.plugin_base.monitor import Monitor
FileInfo = namedtuple(
"FileInfo",
[
"size", # file size
"mode", # file access mode
"user_id", # user id
"group_id", # group id
"ti... |
config | appearance | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2022 The OctoPrint Project - Released under terms of the AGPLv3 License"
from enum import Enum
from typing import List
from octoprint.schema import BaseModel
from octoprint.vendor.with_attrs_docs imp... |
process | servers | """
Starting in CherryPy 3.1, cherrypy.server is implemented as an
:ref:`Engine Plugin<plugins>`. It's an instance of
:class:`cherrypy._cpserver.Server`, which is a subclass of
:class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class
is designed to control other servers, as well.
Multiple servers/p... |
core | FlowGraph | # Copyright 2008-2015 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import collections
import itertools
import logging
import sys
import types
from operator import attrgetter, methodcaller
from . import Messages, blocks
from .base import Element
from ... |
migrations | 0187_stale_events | # Generated by Django 3.2.5 on 2021-11-30 08:23
import django.utils.timezone
from django.db import migrations, models
def set_created_at(apps, schema_editor):
try:
from posthog.client import sync_execute
except ImportError:
sync_execute = None
EventDefinition = apps.get_model("posthog", "... |
cmd | meta | # Copyright (C) 2010 Rob Browning
#
# This code is covered under the terms of the GNU Library General
# Public License as described in the bup LICENSE file.
# TODO: Add tar-like -C option.
from __future__ import absolute_import
import sys
from bup import metadata, options
from bup.compat import argv_bytes
from bup.... |
commands | config | #
# Copyright (C) 2008-2009 Ido Abramovich <ido.deluge@gmail.com>
# Copyright (C) 2009 Andrew Resch <andrewresch@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.
#... |
lib | profiler | # 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, ... |
proxy | ical_proxy | from abc import ABC, abstractmethod
from datetime import datetime
from typing import List, Tuple
from icalendar import Calendar, Event
class IcalService(ABC):
@abstractmethod
def get_events_from_ical_between(
self, calendar: Calendar, start_date: datetime, end_date: datetime
) -> List[Event]:
... |
chardet | mbcssm | ######################## 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... |
migrations | 0005_drop_unused_dynamic_settings | # Generated by Django 3.2.20 on 2023-08-02 17:56
from django.db import migrations
def remove_unused_dynamic_settings(apps, schema_editor):
"""
These are deprecated dynamic settings that no longer have references and should be dropped
"""
DynamicSetting = apps.get_model("base", "DynamicSetting")
... |
Arch | importIFCmulticore | # ***************************************************************************
# * Copyright (c) 2020 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
extractor | freespeech | from __future__ import unicode_literals
from .common import InfoExtractor
from .youtube import YoutubeIE
class FreespeechIE(InfoExtractor):
IE_NAME = "freespeech.org"
_VALID_URL = r"https?://(?:www\.)?freespeech\.org/stories/(?P<id>.+)"
_TEST = {
"add_ie": ["Youtube"],
"url": "http://www.... |
database | migrate2 | # neubot/database/migrate2.py
#
# 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 ... |
utils | reddit_agent_parser | # The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
PyObjCTest | test_cfurl | import array
import os
from CoreFoundation import *
from Foundation import NSURL
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
try:
long
except NameError:
long = int
class TestURL(TestCase):
def testTypes(self):
self.assertIs(CFURLRef, NSURL)
d... |
celerywyrm | settings | """ bookwyrm settings and configuration """
# pylint: disable=wildcard-import
# pylint: disable=unused-wildcard-import
from bookwyrm.settings import *
QUERY_TIMEOUT = env.int("CELERY_QUERY_TIMEOUT", env.int("QUERY_TIMEOUT", 30))
# pylint: disable=line-too-long
REDIS_BROKER_PASSWORD = requests.compat.quote(env("REDIS_... |
beetsplug | mbsubmit | # This file is part of beets.
# Copyright 2016, Adrian Sampson and Diego Moreda.
#
# 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 righ... |
trayicon | util | # Copyright 2004-2006 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2012 Christoph Reiter
# 2013 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 ... |
daw | tempo_marker | from sglib.lib.translate import _
from sglib.lib.util import *
from sglib.models.stargate import *
from . import _shared
class tempo_marker(_shared.abstract_marker):
__slots__ = [
"type",
"beat",
"tempo",
"tsig_num",
"tsig_den",
"real_tempo",
]
def __init_... |
models | listcategory | # SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Completion category that uses a list of tuples as a data source."""
import re
from typing import Iterable, Tuple
from qutebrowser.completion.models import util
from qutebrowser.qt.core import QReg... |
comicapi | comicarchive | """A class to represent a single comic, be it file or folder of images"""
# Copyright 2012-2014 Anthony Beville
# 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/li... |
migrations | env | from __future__ import with_statement
from logging.config import fileConfig
from alembic import context
from sqlalchemy import engine_from_config, pool
# this is the Alembic Config object, which provides
# access to the values within the .ini file in use.
config = context.config
# Interpret the config file for Pyth... |
Benchmark | BenchmarkDb | import contextlib
import json
import os
import time
from Config import config
from Plugin import PluginManager
@PluginManager.registerTo("Actions")
class ActionsPlugin:
def getBenchmarkTests(self, online=False):
tests = super().getBenchmarkTests(online)
tests.extend(
[
... |
extractor | tvanouvelles | # coding: utf-8
from __future__ import unicode_literals
import re
from .brightcove import BrightcoveNewIE
from .common import InfoExtractor
class TVANouvellesIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?tvanouvelles\.ca/videos/(?P<id>\d+)"
_TEST = {
"url": "http://www.tvanouvelles.ca/videos/... |
extractor | tunepk | from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import int_or_none, try_get, unified_timestamp
from .common import InfoExtractor
class TunePkIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
(?:
(?:www\.... |
views | directory | """ who all's here? """
from bookwyrm import suggested_users
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.shortcuts import redirect
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.... |
errorreport | sentrywrapper | # Copyright 2017 Christoph Reiter
# 2020 Nick Boultbee
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
"""
A ... |
rtorrent | group | # Copyright (c) 2013 Dean Gardiner, <gardiner91@gmail.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,... |
calculix | write_constraint_displacement | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
cactus | page | import io
import logging
import os
import yaml
from cactus.compat.paths import PageCompatibilityLayer
from cactus.utils.helpers import memoize
from cactus.utils.url import ResourceURLHelperMixin
from django.template import Context, Template
from six.moves import urllib
logger = logging.getLogger(__name__)
class Pag... |
api | email_verification | from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from posthog.models.user import User
from posthog.tasks.email import send_email_verification
class EmailVerificationTokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, use... |
fec | 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
#
#
from gnuradio import blocks, gr
from . import fec_python as fec
class threaded_decoder(gr.hier_block2):
def __init__(self, decoder_list_0, input_size, outp... |
downloaders | AlldebridCom | # -*- coding: utf-8 -*-
import json
import re
import time
from ..base.multi_downloader import MultiDownloader
class AlldebridCom(MultiDownloader):
__name__ = "AlldebridCom"
__type__ = "downloader"
__version__ = "0.64"
__status__ = "testing"
__pattern__ = r"https?://(?:\w+\.)?(?:alldebrid\.com|d... |
widgets | preset_manager | import os
import shutil
from sglib.constants import PRESET_DIR
from sglib.lib import util
from sglib.lib.translate import _
from sglib.log import LOG
from sgui.sgqt import *
PRESET_FILE_DIALOG_STRING = "Stargate Presets (*.sgp)"
PLUGIN_SETTINGS_CLIPBOARD = {}
PLUGIN_CONFIGURE_CLIPBOARD = None
class preset_manager_w... |
qtui | _main_ | # Copyright (C) 2011 Chris Dekter
# Copyright (C) 2018 Thomas Hess
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#... |
parser | context_test | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import textwrap
import unittest
from beancount import loader
from beancount.parser import context
from beancount.utils import test_utils
class TestContext(test_utils.TestCase):
@loader.load_doc()
def test_context(self, entries... |
draftfunctions | fuse | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
neubot | raw_analyze | # neubot/raw_analyze.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 ... |
api | signup | from typing import Any, Dict, Optional, Union, cast
from urllib.parse import urlencode
import structlog
from django import forms
from django.conf import settings
from django.contrib.auth import login, password_validation
from django.core.exceptions import ValidationError
from django.db import IntegrityError, transacti... |
frescobaldi-app | pointandclick | # 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
... |
isso | config | # -*- encoding: utf-8 -*-
import datetime
import logging
import re
from configparser import (
ConfigParser,
DuplicateSectionError,
NoOptionError,
NoSectionError,
)
from email.utils import formataddr, parseaddr
import pkg_resources
logger = logging.getLogger("isso")
default_config_file = pkg_resource... |
Gui | Custom | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
searchdialog | album | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2016 Rahul Raturi
# Copyright (C) 2018-2022 Laurent Monin
# Copyright (C) 2018-2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
... |
PyObjCTest | test_conversion | """
Some basic tests for converting values to and from Objective-C
TODO: This only tests C values at the moment.
"""
from __future__ import absolute_import
import array
import sys
import objc
from PyObjCTools.TestSupport import *
from .testbndl import (
CHAR_MAX,
CHAR_MIN,
DBL_EPSILON,
DBL_MAX,
... |
clients | http | # 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, ... |
ui | ui_exception_script_selector | # -*- 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_ExceptionScriptSelector(object):
def setupUi(self, ExceptionScriptSelector):
ExceptionScriptSelector.setObjectName("ExceptionScriptSelector"... |
backfill | subreddit_images |
# 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,... |
imageserver | flask_app | #
# Quru Image Server
#
# Document: flask_app.py
# Date started: 03 Oct 2011
# By: Matt Fozard
# Purpose: Flask app initializer
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... |
vcs | gitrepo | # 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
... |
QT | PantallaManualSave | import codecs
import encodings
import os
from Code import ControlPosicion, Partida
from Code.QT import (
Colocacion,
Columnas,
Controles,
Delegados,
Grid,
Iconos,
QTUtil2,
QTVarios,
Tablero,
Voyager,
)
from PyQt4 import QtCore, QtGui
class WManualSave(QTVarios.WDialogo):
d... |
PyObjCTest | test_nsrulerview | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSRulerViewHelper(NSView):
def rulerView_shouldMoveMarker_(self, rl, mk):
return 1
def rulerView_willMoveMarker_toLocation_(self, rl, mk, l):
return 1
def rulerView_didMoveMarker_(self, rv, mk):
pass
def ru... |
extractor | reddit | from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
float_or_none,
int_or_none,
try_get,
unescapeHTML,
url_or_none,
)
from .common import InfoExtractor
class RedditIE(InfoExtractor):
_VALID_URL = r"https?://v\.redd\.it/(?P<id>[^/?#&]+)"
_TEST = {
... |
PyObjCTest | test_array_property | import collections
import pickle
import sys
import objc
from PyObjCTools.TestSupport import *
NSObject = objc.lookUpClass("NSObject")
NSIndexSet = objc.lookUpClass("NSIndexSet")
NSMutableIndexSet = objc.lookUpClass("NSMutableIndexSet")
class TestArrayPropertyHelper(NSObject):
array = objc.array_property()
a... |
users | models | import hashlib
import hmac
from datetime import datetime
from flask import g, render_template, render_template_string, url_for
from formspree import settings
from formspree.stuff import DB, TEMPLATES
from formspree.utils import IS_VALID_EMAIL, send_email
from .helpers import hash_pwd
class Plan(DB.Enum):
free =... |
femviewprovider | view_base_femobject | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
resources | escalation_policies | from migrator import oncall_api_client
from migrator.utils import find_by_id, transform_wait_delay
def match_escalation_policy(policy: dict, oncall_escalation_chains: list[dict]) -> None:
oncall_escalation_chain = None
for candidate in oncall_escalation_chains:
if candidate["name"].lower().strip() == ... |
integrations | urls | from pathlib import Path
from apps.email.inbound import InboundEmailWebhookView
from common.api_helpers.optional_slash_router import optional_slash_path
from django.conf import settings
from django.urls import path
from .views import (
AlertManagerAPIView,
AmazonSNS,
GrafanaAlertingAPIView,
GrafanaAPI... |
migrations | 0027_move_elements_to_group | # Generated by Django 3.0.3 on 2020-02-27 18:13
import hashlib
import json
from typing import List
from django.db import migrations, models, transaction
from django.forms.models import model_to_dict
def hash_elements(elements) -> str:
elements_list = []
for _index, element in enumerate(elements):
el_... |
comictaggerlib | main | """A python app to (automatically) tag comic archives"""
# Copyright 2012-2014 Anthony Beville
# 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.... |
Gui | JobDlg | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2018 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
ManualBindings | AppController | #
# AppController.py
# ManualBindings
#
from Cocoa import *
class AppController(NSObject):
arrayController = objc.IBOutlet()
selectedNameField = objc.IBOutlet()
selectedPriceField = objc.IBOutlet()
tableView = objc.IBOutlet()
totalCountField = objc.IBOutlet()
def awakeFromNib(self):
... |
posthog | utils | import asyncio
import base64
import dataclasses
import datetime
import datetime as dt
import gzip
import hashlib
import json
import os
import re
import secrets
import string
import subprocess
import time
import uuid
import zlib
from enum import Enum
from functools import lru_cache, wraps
from typing import (
TYPE_C... |
constructors | jsfunction | from ..base import *
try:
from ..translators.translator import translate_js
except:
pass
@Js
def Function():
# convert arguments to python list of strings
a = [e.to_string().value for e in arguments.to_list()]
body = ";"
args = ()
if len(a):
body = "%s;" % a[-1]
args = a[:... |
webengine | webengineelem | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""QtWebEngine specific part of the web element API."""
from typing import (
TYPE_CHECKING,
Any,
Callable,
Dict,
Iterator,
Optional,
Set,
Tuple,
Union,
)
fr... |
engines | bing_images | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Bing (Images)
"""
from json import loads
from urllib.parse import urlencode
from lxml import html
from searx.engines.bing import ( # NOQA # pylint: disable=unused-import
_fetch_supported_languages,
language_aliases,
supported_languages_url,
)
from searx.u... |
bindings | header_utils | # Utilities for reading values in header files
import re
from argparse import ArgumentParser
class PybindHeaderParser:
def __init__(self, pathname):
with open(pathname, "r") as f:
self.file_txt = f.read()
def get_flag_automatic(self):
# p = re.compile(r'BINDTOOL_GEN_AUTOMATIC\(([... |
gui-qt | add_translation_dialog | from plover import _
from plover.gui_qt.add_translation_dialog_ui import Ui_AddTranslationDialog
from plover.gui_qt.tool import Tool
from PyQt5.QtWidgets import QDialogButtonBox
class AddTranslationDialog(Tool, Ui_AddTranslationDialog):
# i18n: Widget: “AddTranslationDialog”, tooltip.
__doc__ = _("Add a new t... |
Code | EngineThread | import os
import time
import psutil
from Code import VarGen
from Code.Constantes import *
DEBUG_ENGINE = False
def xpr(exe, line):
if DEBUG_ENGINE:
t = time.time()
prlk("%0.04f %s" % (t - tdbg[0], line))
tdbg[0] = t
return True
def xprli(li):
if DEBUG_ENGINE:
t = time.t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.