section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
femtools | constants | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
PyObjCTest | test_nsbyteorder | import sys
import Foundation
from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSByteOrder(TestCase):
def testConstants(self):
self.assertEqual(NS_UnknownByteOrder, CFByteOrderUnknown)
self.assertEqual(NS_LittleEndian, CFByteOrderLittleEndian)
self.assertEqual(NS_Bi... |
gui | cachingImageList | # =============================================================================
# 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 ... |
QT | Info | from Code.QT import Colocacion, Controles, Iconos, InfoBase, QTUtil
from PyQt4 import QtCore, QtGui
class WAbout(QtGui.QDialog):
def __init__(self, procesador):
super(WAbout, self).__init__(procesador.pantalla)
self.setWindowTitle(_("About"))
self.setWindowIcon(Iconos.Aplicacion())
... |
mido | syx | """
Read and write SYX file format
"""
from __future__ import print_function
import re
from .parser import Parser
def read_syx_file(filename):
"""Read sysex messages from SYX file.
Returns a list of sysex messages.
This handles both the text (hexadecimal) and binary
formats. Messages other than sy... |
user | views | # -*- coding: utf-8 -*-
"""
flaskbb.user.views
~~~~~~~~~~~~~~~~~~
The user view handles the user profile
and the user settings from a signed in user.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
import logging
import attr
from flask import Bluepri... |
imageserver | _about_ | # -*- coding: utf-8 -*-
#
# Quru Image Server
#
# Document: __about__.py
# Date started: 05 Aug 2013
# By: Alex Stapleton
# Purpose: App packaging info and version
# Requires:
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or m... |
extractors | sohu | #!/usr/bin/env python
__all__ = ["sohu_download"]
import json
import time
from random import random
from urllib.parse import urlparse
from ..common import *
"""
Changelog:
1. http://tv.sohu.com/upload/swf/20150604/Main.swf
new api
"""
def real_url(fileName, key, ch):
url = (
"https://data.... |
femtaskpanels | task_constraint_tie | # ***************************************************************************
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
accounts | MegaRapidoNet | # -*- coding: utf-8 -*-
import re
import time
from datetime import timedelta
from ..base.multi_account import MultiAccount
class MegaRapidoNet(MultiAccount):
__name__ = "MegaRapidoNet"
__type__ = "account"
__version__ = "0.10"
__status__ = "testing"
__config__ = [
("mh_mode", "all;liste... |
models | metadata | from datetime import datetime
from typing import Any, Dict, List, Optional, TypedDict, Union
SnapshotData = Dict
WindowId = Optional[str]
class RecordingSegment(TypedDict):
start_time: datetime
end_time: datetime
window_id: WindowId
is_active: bool
class SnapshotDataTaggedWithWindowId(TypedDict):
... |
python | test_tcm | #!/usr/bin/env python
import math
import random
import sys
from optparse import OptionParser
import numpy
from gnuradio import blocks, digital, eng_notation, gr, trellis
from gnuradio.eng_option import eng_option
from gnuradio.trellis import fsm_utils
try:
from gnuradio import analog
except ImportError:
sys.... |
PyObjCTest | test_dyld | import os
import objc._dyld as dyld
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestDyld(TestCase):
def setUp(self):
self.orig_environ = os.environ
os.environ = os.environ.copy()
def tearDown(self):
os.environ = self.orig_environ
... |
data | e_field | import queue
import threading
import time
import numpy as np
from vtkmodules.vtkCommonCore import vtkIdList
def Get_coil_position(m_img):
# coil position cp : the center point at the bottom of the coil casing,
# corresponds to the origin of the coil template.
# coil normal cn: outer normal of the coil, i... |
lib | fork_runner | #!/usr/bin/env python
"""
Execute the .call(jobs) function of a clientScripts module from multiple
processes.
Takes a list of jobs to be executed and split them across a specified number of
subprocesses. Once the subprocesses complete, gather up the results and return
them to the MCP Client.
This is invoked when a c... |
migrations | 0148_alter_user_preferred_language | # Generated by Django 3.2.12 on 2022-03-31 14:35
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0147_alter_user_preferred_language"),
]
operations = [
migrations.AlterField(
model_name="user",
name="p... |
util | task | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# SoundConverter - GNOME application for converting between audio formats.
# Copyright 2004 Lars Wirzenius
# Copyright 2005-2020 Gautier Portet
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as ... |
filters | redeye | #!/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
# pylint: disable=no-member
from os.path import abspath, dirname, jo... |
extractor | voicerepublic | from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import ExtractorError, determine_ext, int_or_none, urljoin
from .common import InfoExtractor
class VoiceRepublicIE(InfoExtractor):
_VALID_URL = r"https?://voicerepublic\.com/(?:talks|embed)/(?P<id>[0-9a-z-]+)"
_TESTS = [
... |
source | conf | # Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... |
utils | conf | from __future__ import absolute_import
import copy
import os
from raven.utils.compat import string_types
from raven.utils.imports import import_string
def convert_options(settings, defaults=None):
"""
Convert a settings object (or dictionary) to parameters which may be passed
to a new ``Client()`` insta... |
views | util | from __future__ import annotations
import re
from abilian.core.signals import activity
from abilian.core.util import unwrap
from abilian.sbe.apps.documents.models import BaseContent, Document, Folder
from abilian.sbe.apps.documents.repository import repository
from abilian.services.security import MANAGE, WRITE, Admi... |
transmissionrpc | error | # -*- coding: utf-8 -*-
# Copyright (c) 2008-2013 Erik Svensson <erik.public@gmail.com>
# Licensed under the MIT license.
from six import integer_types, string_types
class TransmissionError(Exception):
"""
This exception is raised when there has occurred an error related to
communication with Transmissio... |
file-list | file_list | from __future__ import absolute_import
import fnmatch
import os
import re
import sys
import time
from threading import Event, Thread
from gi.repository import Gdk, Gio, GLib, GObject, Gtk
from sunflower import common
from sunflower.gui.input_dialog import (
ApplicationSelectDialog,
CopyDialog,
DeleteDialo... |
custom-emails | test_custom_emails | # encoding: utf-8
import os
import ckan.lib.mailer as mailer
import ckan.model as model
import pytest
from ckan.common import config
from ckan.lib.base import render
from ckan.tests import factories
from ckan.tests.lib.test_mailer import MailerBase
@pytest.mark.usefixtures("clean_db", "with_plugins", "with_request_... |
addons | MergeFiles | # -*- coding: utf-8 -*-
import os
import re
from ..base.addon import BaseAddon, threaded
class MergeFiles(BaseAddon):
__name__ = "MergeFiles"
__type__ = "addon"
__version__ = "0.24"
__status__ = "testing"
__config__ = [("enabled", "bool", "Activated", False)]
__description__ = """Merges par... |
extractor | vube | from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import ExtractorError, int_or_none
from .common import InfoExtractor
class VubeIE(InfoExtractor):
IE_NAME = "vube"
IE_DESC = "Vube.com"
_VALID_URL = r"https?://vube\.com/(?:[^/]+/)+(?P<id>[\da-zA-Z]{10})\b"
... |
extractor | safari | # coding: utf-8
from __future__ import unicode_literals
import json
import re
from ..compat import compat_parse_qs, compat_urlparse
from ..utils import ExtractorError, update_url_query
from .common import InfoExtractor
class SafariBaseIE(InfoExtractor):
_LOGIN_URL = "https://learning.oreilly.com/accounts/login/... |
CITransitionSelectorSample | TransitionSelectorView | import math
from Cocoa import *
from Quartz import *
TRANSITION_COUNT = 9
class TransitionSelectorView(NSView):
_sourceImage = objc.ivar()
_targetImage = objc.ivar()
_shadingImage = objc.ivar()
_blankImage = objc.ivar()
_maskImage = objc.ivar()
transitions = objc.ivar() # Array
base = ... |
decrypters | DevhostStFolder | # -*- coding: utf-8 -*-
#
# Test links:
# http://d-h.st/users/shine/?fld_id=37263#files
import re
import urllib.parse
from ..base.simple_decrypter import SimpleDecrypter
class DevhostStFolder(SimpleDecrypter):
__name__ = "DevhostStFolder"
__type__ = "decrypter"
__version__ = "0.12"
__status__ = "t... |
builtinStatsViews | firepowerViewFull | # =============================================================================
# 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 ... |
extractor | ruhd | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class RUHDIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?ruhd\.ru/play\.php\?vid=(?P<id>\d+)"
_TEST = {
"url": "http://www.ruhd.ru/play.php?vid=207",
"md5": "d1a9ec4edf8598e3fbd92bb16072ba83",
... |
api | license | import posthoganalytics
import requests
from django.db.models import QuerySet
from django.shortcuts import get_object_or_404
from django.utils.timezone import now
from ee.models.license import License, LicenseError
from posthog.cloud_utils import is_cloud
from posthog.event_usage import groups
from posthog.models.organ... |
builtinContextMenus | skillAffectors | # noinspection PyPackageRequirements
import gui.globalEvents as GE
import gui.mainFrame
import wx
from eos.saveddata.character import Skill
from gui.bitmap_loader import BitmapLoader
from gui.contextMenu import ContextMenuSingle
from service.character import Character
from service.fit import Fit
_t = wx.GetTranslatio... |
CurrencyConverter | CurrencyConverter | import sys
import time
from AppKit import *
class Converter(NSObject):
def convertAmount(self, amt, rate):
return amt * rate
class ConverterController(NSObject):
# First define the IB Outlets, the 'ivar' calls below define new
# instance variables in the objective-C class (e.g. visible
# fo... |
AddonManager | addonmanager_installer | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022 FreeCAD Project Association *
# * ... |
documents | actions | from __future__ import annotations
from typing import Any
from abilian.i18n import _l
from abilian.sbe.apps.communities.security import is_manager
from abilian.services.security import MANAGE, WRITE, security
from abilian.web.action import Action, FAIcon, ModalActionMixin, actions
from flask import g
from flask impor... |
views | user | import logging
import pytz
from apps.alerts.paging import check_user_availability
from apps.api.permissions import (
ALL_PERMISSION_CHOICES,
IsOwnerOrHasRBACPermissions,
LegacyAccessControlRole,
RBACPermission,
get_permission_from_permission_string,
user_is_authorized,
)
from apps.api.serialize... |
fixtures | settings | # -*- coding: utf-8 -*-
"""
flaskbb.fixtures.settings
~~~~~~~~~~~~~~~~~~~~~~~~~
The fixtures module for our settings.
:copyright: (c) 2014 by the FlaskBB Team.
:license: BSD, see LICENSE for more details.
"""
from flaskbb.utils.forms import SettingValueType
from flaskbb.utils.helpers import get_av... |
migrations | 0011_auto_20200127_2105 | # Generated by Django 2.2.7 on 2020-01-27 21:05
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0010_funnel_funnelstep"),
]
operations = [
migrations.RemoveField(
model_name="elemen... |
models | status | """ models for storing different kinds of Activities """
import re
from dataclasses import MISSING
from typing import Optional
from bookwyrm import activitypub
from bookwyrm.preview_images import generate_edition_preview_image_task
from bookwyrm.settings import ENABLE_PREVIEW_IMAGES
from django.apps import apps
from d... |
translators | std_nodes | import six
from .pyjsparserdata import *
class BaseNode:
def finish(self):
pass
def finishArrayExpression(self, elements):
self.type = Syntax.ArrayExpression
self.elements = elements
self.finish()
return self
def finishArrayPattern(self, elements):
self.t... |
femviewprovider | view_constraint_initialflowvelocity | # ***************************************************************************
# * Copyright (c) 2017 Markus Hovorka <m.hovorka@live.de> *
# * Copyright (c) 2020 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
extractor | springboardplatform | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
int_or_none,
unescapeHTML,
unified_timestamp,
xpath_attr,
xpath_element,
xpath_text,
)
from .common import InfoExtractor
class SpringboardPlatformIE(InfoExtractor):
_VALID_URL = r"... |
views | zoom_slider | """
@file
@brief This file contains the zoom slider QWidget (for interactive zooming/panning on the timeline)
@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.o... |
cli | base | #
# Copyright 2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Base CLI module """
import functools
import logging
import os
import sys
from importlib import import_module
from logging import Formatter, StreamHandler
import click
from click ... |
serializers | escalation_snapshot | from apps.alerts.escalation_snapshot.serializers import (
ChannelFilterSnapshotSerializer,
EscalationChainSnapshotSerializer,
EscalationPolicySnapshotSerializer,
)
from rest_framework import serializers
class EscalationSnapshotSerializer(serializers.Serializer):
channel_filter_snapshot = ChannelFilter... |
unit | urls | # This file is part of Archivematica.
#
# Copyright 2010-2016 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, either version 3 of the ... |
downloaders | DepositfilesCom | # -*- coding: utf-8 -*-
import re
import urllib.parse
from datetime import timedelta
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..anticaptchas.SolveMedia import SolveMedia
from ..base.simple_downloader import SimpleDownloader
class DepositfilesCom(SimpleDownloader):
__name__ = "DepositfilesCom"
__t... |
archivebox | manage | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
# if you're a developer working on archivebox, still prefer the archivebox
# versions of ./manage.py commands whenever possible. When that's not possible
# (e.g. makemigrations), you can comment out this check temporarily
if not ("m... |
models | faster_rcnn_nas_feature_extractor_test | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
qltk | util | # Copyright 2015 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.
from typing import Dict, Optional, ... |
photocollage | collage | # Copyright (C) 2014 Adrien Vergé
#
# 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.
#
# This program is distributed in t... |
authorize | interaction | # 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_cfcharacterset | import sys
from CoreFoundation import *
from PyObjCTools.TestSupport import *
try:
long
except NameError:
long = int
try:
unichr
except NameError:
unichr = chr
class TestCharacterSet(TestCase):
def testTypes(self):
self.assertIsCFType(CFCharacterSetRef)
self.assertIsCFType(CFMut... |
tzlocal | windows_tz | # This file is autogenerated by the get_windows_info.py script
# Do not edit.
win_tz = {
"AUS Central Standard Time": "Australia/Darwin",
"AUS Eastern Standard Time": "Australia/Sydney",
"Afghanistan Standard Time": "Asia/Kabul",
"Alaskan Standard Time": "America/Anchorage",
"Arab Standard Time": "A... |
chardet | langthaimodel | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... |
data | tractography | # -*- coding: utf-8 -*-
# --------------------------------------------------------------------------
# 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.g... |
lib | namespaces | from xml.etree import ElementPath
dcNS = "http://purl.org/dc/elements/1.1/"
dctermsNS = "http://purl.org/dc/terms/"
dspaceNS = "http://www.dspace.org/xmlns/dspace/dim"
fitsNS = "http://hul.harvard.edu/ois/xml/ns/fits/fits_output"
metsNS = "http://www.loc.gov/METS/"
premisNS = "http://www.loc.gov/premis/v3"
premisNS_V2... |
migrations | 0016_alter_settings_timezone | # Generated by Django 3.2 on 2021-06-16 13:30
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0015_alter_settings_timezone"),
]
operations = [
migrations.AlterField(
model_name="settings",
name="timez... |
parsers | readwise_reader_api | __package__ = "archivebox.parsers"
import re
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
from typing import IO, Iterable, Optional
import requests
from ..config import READWISE_READER_TOKENS, SOURCES_DIR
from ..index.schema import Link
from ..system import atomic_wri... |
markovify | text | # markovify
# Copyright (c) 2015, Jeremy Singer-Vine
# Origin: https://github.com/jsvine/markovify
# MIT License: https://github.com/jsvine/markovify/blob/master/LICENSE.txt
import random
import re
from .chain import BEGIN, Chain
from .splitters import split_into_sentences
# BleachBit does not use unidecode
# from u... |
flaskbb | setup | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from setuptools import setup
install_requires = [
"alembic>=1.6.5",
"amqp>=5.0.6",
"attrs>=21.2.0",
"Babel>=2.9.1",
"billiard>=3.6.4.0",
"blinker>=1.4",
"celery>=5.1.2",
"certifi>=2021.5.30",
"charset-normalizer>=2.0.3",
"... |
api | subscription | from typing import Any, Dict
import jwt
from django.db.models import QuerySet
from django.http import HttpRequest, JsonResponse
from ee.tasks import subscriptions
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.routing import StructuredViewSetMixin
from posthog.api.shared import UserBa... |
daw | painter_path | from sglib import constants
from sglib.math import clip_max
from sglib.models import theme
from sgui import shared as glbl_shared
from sgui.daw import shared
from sgui.sgqt import *
from sgui.widgets.sample_graph import create_sample_graph
PIXMAP_BEAT_WIDTH = 48
PIXMAP_TILE_HEIGHT = 32
PIXMAP_TILE_WIDTH = 4000
PIXMAP... |
python | server | #
# Copyright 2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
import sys
import time
from argparse import ArgumentParser
from threading import Thread
import numpy
###############################################################################
# ... |
feature-flag | flag_matching | import hashlib
import time
from dataclasses import dataclass
from enum import Enum
from typing import Dict, List, Optional, Tuple, Union
import structlog
from django.conf import settings
from django.db import DatabaseError, IntegrityError, OperationalError
from django.db.models import Q
from django.db.models.expressio... |
migrations | 0026_fits_nailgun_compat | from django.db import migrations
OLD_FITS_CMD_UUID = "0b0d301f-b586-45d5-ba35-d76da57ce32a"
NEW_FITS_CMD_UUID = "1a0394dc-528b-4a03-8c2b-1c158f1fb313"
OLD_FITS_RULE_UUID = "296a131d-ce70-45ae-b800-6c71b3ea46f0"
NEW_FITS_RULE_UUID = "c3b06895-ef9d-401e-8c51-ac585f955655"
def data_migration_up(apps, schema_editor):
... |
browsers | podcasts | # Copyright 2005 Joe Wreschnig
# 2017-2022 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.
import ... |
gstbe | player | # Copyright 2004-2011 Joe Wreschnig, Michael Urman, Steven Robertson,
# 2011-2014 Christoph Reiter
# 2020-2021 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;... |
PyObjCTest | test_nskeyedarchiver | # This just tests the definitions in the NSKeyedArchiver header
from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSKeyedArchiver(TestCase):
def testConstants(self):
self.assertIsInstance(NSInvalidArchiveOperationException, unico... |
caching | tolerant_zlib_compressor | import zlib
import structlog
from django.conf import settings
from django_redis.compressors.base import BaseCompressor
from prometheus_client import Counter
logger = structlog.get_logger(__name__)
COULD_NOT_DECOMPRESS_VALUE_COUNTER = Counter(
"posthog_redis_could_not_decompress_value_counter",
"""
Number... |
torrent-checker | dataclasses | from __future__ import annotations
import time
from dataclasses import dataclass, field
from typing import List
import human_readable
from tribler.core.utilities.unicode import hexlify
MINUTE = 60
HOUR = MINUTE * 60
TOLERABLE_TIME_DRIFT = MINUTE # When receiving health from another peer, how far the timestamp can b... |
email | inbound | import logging
from typing import Optional, TypedDict
from anymail.exceptions import AnymailWebhookValidationFailure
from anymail.inbound import AnymailInboundMessage
from anymail.signals import AnymailInboundEvent
from anymail.webhooks import (
amazon_ses,
mailgun,
mailjet,
mandrill,
postal,
p... |
View | Share | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# A GAE web application to aggregate rss and send it to your kindle.
# Visit https://github.com/cdhigh/KindleEar for the latest version
# Contributors:
# rexdf <https://github.com/rexdf>
import hashlib
import urllib
import web
from apps.BaseHandler import BaseHandler
from ... |
CocoaDrawingShell | MyView | import math
from Cocoa import *
from Quartz import *
def doAlphaRects(context):
# ***** Part 1 *****
ourRect = CGRectMake(0.0, 0.0, 130.0, 100.0)
numRects = 6
rotateAngle = 2 * math.pi / numRects
tintAdjust = 1.0 / numRects
# ***** Part 2 *****
CGContextTranslateCTM(context, 2 * ourRect.... |
parser | grammar_test | """
Tests for grammar parser.
"""
__copyright__ = "Copyright (C) 2015-2016 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import inspect
import re
import textwrap
import unittest
from decimal import Decimal
from unittest import mock
from beancount.core import amount, data
from beancount.core.amount import A... |
classes | dependencypropertypages | from gaphor import UML
from gaphor.diagram.propertypages import (
PropertyPageBase,
PropertyPages,
unsubscribe_all_on_destroy,
)
from gaphor.transaction import transactional
from gaphor.UML.classes.classespropertypages import new_builder
from gaphor.UML.classes.dependency import DependencyItem
@PropertyPa... |
mako | parsetree | # mako/parsetree.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""defines the parse tree components for Mako templates."""
import re
from mako import ast, co... |
QT | PantallaEverest | import os.path
import random
import Code.PGNreader as PGNReader
import Code.SQL.Base as SQLBase
import LCEngine4 as LCEngine
from Code import PGN, Everest, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
FormLayout,
Grid,
Iconos,
QTUtil2,
QTVarios,
)
from PyQt4 import QtCore... |
models | session_recording_playlist | from django.db import models
from django.utils import timezone
from posthog.utils import generate_short_id
class SessionRecordingPlaylist(models.Model):
short_id: models.CharField = models.CharField(
max_length=12, blank=True, default=generate_short_id
)
name: models.CharField = models.CharField(m... |
comictaggerlib | matchselectionwindow | """A PyQT4 dialog to select from automated issue matches"""
# 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... |
engines | searchcode_code | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Searchcode (IT)
"""
from json import loads
from urllib.parse import urlencode
# about
about = {
"website": "https://searchcode.com/",
"wikidata_id": None,
"official_api_documentation": "https://searchcode.com/api/",
"use_official_api": True,
"requi... |
VersionUpgrade25to26 | VersionUpgrade25to26 | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import configparser # To parse the files we need to upgrade and write the new files.
import io # To serialise configparser output to a string.
import os
from typing import Dict, List, Set, Tuple
from urllib.parse import q... |
event | event | import copy
import datetime
import re
from collections import defaultdict
from typing import Dict, List, Optional, Union
from dateutil.relativedelta import relativedelta
from django.db import models
from django.utils import timezone
from posthog.models.team import Team
SELECTOR_ATTRIBUTE_REGEX = r"([a-zA-Z]*)\[(.*)=[... |
core | preprocessor | # 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... |
migrations | 0059_user_preferred_timezone | # Generated by Django 3.1.6 on 2021-03-28 21:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0058_auto_20210324_1536"),
]
operations = [
migrations.AddField(
model_name="user",
name="preferred_timez... |
ui | statuswindow | """Defines a status window class for displaying the progress of a queue."""
from gaphas.decorators import g_async
from gi.repository import Gtk, Pango
class StatusWindow:
"""Create a borderless window on the parent, usually the main window, with
a label and a progress bar.
The progress bar is updated a... |
file-import | midi | # 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
... |
browser | pdfjs | # SPDX-FileCopyrightText: Daniel Schadt
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""pdf.js integration for qutebrowser."""
import os
from qutebrowser.config import config
from qutebrowser.qt.core import QUrl, QUrlQuery
from qutebrows... |
controllers | editor_chooser | # -*- coding: utf-8 -*-
#
# Copyright (C) 2015 by Ihor E. Novikov
#
# 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.... |
views | discover | """ What's up locally """
from bookwyrm import activitystreams
from django.contrib.auth.decorators import login_required
from django.core.paginator import Paginator
from django.db.models import Q
from django.template.response import TemplateResponse
from django.utils.decorators import method_decorator
from django.views... |
femtools | ccxtools | # ***************************************************************************
# * Copyright (c) 2015 Przemo Firszt <przemo@firszt.eu> *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
bookwyrm | context_processors | """ customize the info available in context for rendering templates """
from bookwyrm import models, settings
def site_settings(request): # pylint: disable=unused-argument
"""include the custom info about the site"""
request_protocol = "https://"
if not request.is_secure():
request_protocol = "ht... |
file | views | import json
import logging
import os
import elasticSearchFunctions
import requests
import storageService as storage_service
from components import helpers
from django.conf import settings as django_settings
from django.views.generic import View
from main import models
logger = logging.getLogger("archivematica.dashboa... |
migrations | env | from __future__ import with_statement # noqa: I001
import logging
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
# Inter... |
UI | TextManager | # Copyright (c) 2021 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import collections
from typing import Dict, List, Optional, cast
from PyQt6.QtCore import QObject, pyqtSlot
from UM.i18n import i18nCatalog
from UM.Resources import Resources
from UM.Version import Version
catalog = i18nC... |
migrations | 0007_embedded_default_thumbnail | from django.db import migrations
REPLACE_COMMAND = """
import argparse
import sys
# http://i.imgur.com/ijwSkff.jpg
DEFAULT_THUMBNAIL = \"\"\"
/9j/2wBDAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQH/2wBDAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEB
AQEBAQEBAQEBAQEBAQEBAQ... |
command | image | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Copyright (C) 2009 Thomas Vander Stichele
# This file is part of whipper.
#
# whipper 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 t... |
migrations | 0130_alter_user_preferred_language | # Generated by Django 3.2.10 on 2022-01-24 17:32
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("bookwyrm", "0129_auto_20220117_1716"),
]
operations = [
migrations.AlterField(
model_name="user",
name="preferred_la... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.