section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
interface | batch | #!/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 ... |
misc | svg2icns | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 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 late... |
OAuth2 | AuthorizationRequestHandler | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from http.server import BaseHTTPRequestHandler
from threading import Lock # To turn an asynchronous call synchronous.
from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Tuple
from urllib.parse import pa... |
digital | qa_mpsk_snr_est | #!/usr/bin/env python
#
# Copyright 2011-2013,2018 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
""" Test digital.mpsk_snr_est_cc """
import random
from gnuradio import blocks, digital, gr, gr_unittest
def random_bit():
"""Create random bits ... |
app | test_macro | # SPDX-License-Identifier: LGPL-2.1-or-later
# ***************************************************************************
# * *
# * Copyright (c) 2022-2023 FreeCAD Project Association *
# * ... |
models | site | """ the particulars for this instance of BookWyrm """
import datetime
import uuid
from urllib.parse import urljoin
import django.contrib.auth.models as auth_models
from bookwyrm.preview_images import generate_site_preview_image_task
from bookwyrm.settings import DOMAIN, ENABLE_PREVIEW_IMAGES, STATIC_FULL_URL
from djan... |
borg | locking | import errno
import json
import os
import tempfile
import time
from . import platform
from .helpers import Error, ErrorWithTraceback
from .logger import create_logger
ADD, REMOVE = "add", "remove"
SHARED, EXCLUSIVE = "shared", "exclusive"
logger = create_logger(__name__)
class TimeoutTimer:
"""
A timer for... |
accounts | SimplydebridCom | # -*- coding: utf-8 -*-
import time
from ..base.multi_account import MultiAccount
class SimplydebridCom(MultiAccount):
__name__ = "SimplydebridCom"
__type__ = "account"
__version__ = "0.20"
__status__ = "testing"
__config__ = [
("mh_mode", "all;listed;unlisted", "Filter downloaders to u... |
beetsplug | playlist | # This file is part of beets.
#
# 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, merge, publish,
# distribu... |
archiver | rdelete_cmd | import argparse
from ..cache import Cache, SecurityManager
from ..constants import * # NOQA
from ..helpers import EXIT_ERROR, bin_to_hex, format_archive, yes
from ..logger import create_logger
from ..manifest import Manifest, NoManifestError
from ._common import with_repository
logger = create_logger()
class RDele... |
CTFd | users | from CTFd.models import Users
from CTFd.utils import config
from CTFd.utils.decorators import authed_only
from CTFd.utils.decorators.visibility import (
check_account_visibility,
check_score_visibility,
)
from CTFd.utils.helpers import get_errors, get_infos
from CTFd.utils.user import get_current_user
from flas... |
threads | database_thread | # -*- coding: utf-8 -*-
import inspect
import os
import shutil
import sqlite3
from contextlib import closing
from queue import Queue
from threading import Event, Thread
from ... import exc_logger
from ..database import FileDatabaseMethods, StorageDatabaseMethods, UserDatabaseMethods
from ..utils.struct.style import s... |
builder | _html5lib | # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__all__ = [
'HTML5TreeBuilder',
]
import re
import warnings
import html5lib
from bs4.builder import HTML, HTML_5, PERMISSIVE, HTMLTreeBuilder
from bs4.element import (Comment, Doctype, NamespacedAttribute,
... |
gtk3 | createtorrentdialog | #
# Copyright (C) 2008 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.
# See LICENSE for more details.
#
import logging
import os.path
... |
version-checks | pypi_release | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2019 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import pkg_resources
import requests
from octoprint.util.version import (
get_comparable_version,
is_pr... |
engines | unsplash | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Unsplash
"""
from json import loads
from urllib.parse import parse_qsl, urlencode, urlparse, urlunparse
# about
about = {
"website": "https://unsplash.com",
"wikidata_id": "Q28233552",
"official_api_documentation": "https://unsplash.com/developers",
"u... |
TLayer | Circle | import math
import objc
from Cocoa import *
from Quartz import *
class Circle(NSObject):
radius = objc.ivar(objc._C_FLT)
center = objc.ivar(NSPoint.__typestr__)
color = objc.ivar()
def bounds(self):
return NSMakeRect(
self.center.x - self.radius,
self.center.y - self.... |
utils | javascript | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utilities related to javascript interaction."""
from typing import Sequence, Union
_InnerJsArgType = Union[None, str, bool, int, float]
_JsArgType = Union[_InnerJsArgType, Sequence[_InnerJs... |
Import | InitGui | # -*- coding: utf8 -*-
# Import gui init module
# (c) 2003 Juergen Riegel
#
# Gathering all the information to start FreeCAD
# This is the second one of three init scripts, the third one
# runs when the gui is up
# ***************************************************************************
# * Copyright (c) 2002 Jue... |
extractors | ximalaya | #!/usr/bin/env python
__all__ = ["ximalaya_download_playlist", "ximalaya_download", "ximalaya_download_by_id"]
import json
import re
from ..common import *
stream_types = [
{"itag": "1", "container": "m4a", "bitrate": "default"},
{"itag": "2", "container": "m4a", "bitrate": "32"},
{"itag": "3", "contain... |
mylar | mb | # This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that... |
extractor | porncom | from __future__ import unicode_literals
import re
from ..compat import compat_urlparse
from ..utils import int_or_none, js_to_json, parse_filesize, str_to_int
from .common import InfoExtractor
class PornComIE(InfoExtractor):
_VALID_URL = r"https?://(?:[a-zA-Z]+\.)?porn\.com/videos/(?:(?P<display_id>[^/]+)-)?(?P... |
context | rect | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 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.... |
browser | launcher | """
FireFox housekeeping - starting and stopping process
"""
import logging
import os
import shutil
from contextlib import contextmanager
PROFILE_DIR = "firefox_profile"
logger = logging.getLogger(__name__)
FIREFOX_INSTANCE = {
"headless": None,
"headed": None,
}
def cleanup():
"""Must be called before ... |
draftmake | make_facebinder | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2020 FreeCAD Developers *
# * ... |
vidcutter | mediastream | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#######################################################################
#
# VidCutter - media cutter & joiner
#
# copyright © 2018 Pete Alexandrou
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... |
GCodeWriter | GCodeWriter | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import json
import re # For escaping characters in the settings.
from cura.Machines.ContainerTree import ContainerTree
from cura.Settings.CuraStackBuilder import CuraStackBuilder
from UM.Application import Application
fro... |
models | track_plugin | from sglib.models.plugins import get_plugin_by_uid
class track_plugin:
def __init__(
self,
a_index,
a_plugin_index,
a_plugin_uid,
a_mute=0,
a_solo=0,
a_power=1,
route=0,
audio_input=1,
midi_channel=0,
):
self.index = int(a... |
parts | percussion | # 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
... |
gtkui | base | # -*- coding: utf-8 -*-
"""
UI Base Module for GtkBuilder
Based on SimpleGladeApp.py Copyright (C) 2004 Sandino Flores Moreno
"""
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
... |
iomediator | waiter | # Copyright (C) 2011 Chris Dekter
#
# 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.
#
# This program is distributed in t... |
Material | TestMaterialsApp | # **************************************************************************
# Copyright (c) 2023 David Carter <dcarter@davidcarter.ca> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
migrations | upgrade12 | """
Migration 12
- Converts modules based on March 2016 Module Tiericide
Some modules have been unpublished (and unpublished module attributes are removed
from database), which causes pyfa to crash. We therefore replace these
modules with their new replacements
"""
CONVERSIONS = {
16457: ( # Crosslin... |
twilioapp | status_callback | import logging
from apps.alerts.signals import user_notification_action_triggered_signal
from apps.twilioapp.models import (
TwilioCallStatuses,
TwilioPhoneCall,
TwilioSMS,
TwilioSMSstatuses,
)
from common.api_helpers.utils import create_engine_url
from django.urls import reverse
logger = logging.getL... |
scripts | utils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Utility functions for scripts."""
import contextlib
import os
import os.path
import sys
# Import side-effects are an evil thing, but here it's okay so scripts using
# colors work on Window... |
draftmake | make_circulararray | # ***************************************************************************
# * (c) 2019 Eliud Cabrera Castillo <e.cabrera-castillo@tum.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
miditool | midifiles | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2011 - 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
... |
draftgeoutils | fillets | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * *
# * Th... |
http | handlers | from __future__ import annotations
import functools
import logging
import urllib.parse
from pathlib import Path
from typing import TYPE_CHECKING, Any, Callable, Optional, Union, cast
import mopidy
import tornado.escape
import tornado.ioloop
import tornado.web
import tornado.websocket
from mopidy import core, models
f... |
preferences | accelerators | from gi.repository import Gtk
from sunflower.accelerator_manager import GroupType
from sunflower.widgets.settings_page import SettingsPage
class Column:
NAME = 0
TITLE = 1
PRIMARY_KEY = 2
PRIMARY_MODS = 3
SECONDARY_KEY = 4
SECONDARY_MODS = 5
class AcceleratorOptions(SettingsPage):
"""Acc... |
deluge-blocklist | detect | #
# Copyright (C) 2009-2010 John Garland <johnnybg+deluge@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
from .decompressers i... |
clientScripts | change_names | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
downloaders | ClicknuploadCom | # -*- coding: utf-8 -*-
from ..base.xfs_downloader import XFSDownloader
class ClicknuploadCom(XFSDownloader):
__name__ = "ClicknuploadCom"
__type__ = "downloader"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?clicknupload\.(?:com|org|cc|to|me|link|club|click|red)... |
notification | models | import json
from django.conf import settings
from django.db import models
from django.utils import timezone
from django.utils.encoding import python_2_unicode_compatible
from django.utils.translation import ugettext_lazy as _
from jsonfield import JSONField
from rest_framework.renderers import JSONRenderer
from .seri... |
lib | sfz | import os
import re
from sglib.lib import util
from sglib.log import LOG
from .util import AUDIO_FILE_EXTS, is_audio_file, read_file_text, string_to_note_num
class sfz_exception(Exception):
pass
class sfz_sample:
"""Corresponds to the settings for a single sample"""
def __init__(self):
self.d... |
extractor | zapiks | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
int_or_none,
parse_duration,
parse_iso8601,
xpath_text,
xpath_with_ns,
)
from .common import InfoExtractor
class ZapiksIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?zapiks\.(?:fr|com)/(?:(?:[a-z]{2... |
PyObjCTest | test_nscolorpanel | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSColorPanel(TestCase):
@min_os_level("10.5")
def testConstants10_5(self):
self.assertEqual(NSNoModeColorPanel, -1)
def testConstants(self):
self.assertEqual(NSGrayMo... |
aliceVision | KeyframeSelection | __version__ = "5.0"
import os
from meshroom.core import desc
# List of supported video extensions (provided by OpenImageIO)
videoExts = [
".avi",
".mov",
".mp4",
".m4a",
".m4v",
".3gp",
".3g2",
".mj2",
".m4v",
".mpg",
]
class KeyframeSelectionNodeSize(desc.DynamicNodeSize):
... |
polar | channel_construction_awgn | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
Based on 2 papers:
[1] Ido Tal, Alexander Vardy: 'How To Construct Polar Codes', 2013
for an in-depth description of a widely used algorithm for channel construction.
[2] Harish Vangala, Eman... |
PartDesignTests | TestPocket | # ***************************************************************************
# * Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
pyaes | util | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
plugins | event_info | """
This plugin injects as much metadata into the category/event objects
as possible. Among other things it also manipulates the category's
slug to reflect the one stored within the category.json file.
That's necessary because each video refers to each event through its name and
not its slug.
"""
import json
import lo... |
web | debugerror | """
pretty debug errors
(part of web.py)
portions adapted from Django <djangoproject.com>
Copyright (c) 2005, the Lawrence Journal-World
Used under the modified BSD license:
http://www.xfree86.org/3.3.6/COPYRIGHT2.html#5
"""
__all__ = ["debugerror", "djangoerror", "emailerrors"]
import os
import os.path
import ppri... |
QT | TabMarcos | from Code.QT import TabBloques
from PyQt4 import QtCore, QtGui
class MarcoSC(TabBloques.BloqueEspSC):
def __init__(self, escena, bloqueMarco, rutinaPulsada=None):
super(MarcoSC, self).__init__(escena, bloqueMarco)
self.rutinaPulsada = rutinaPulsada
self.rutinaPulsadaCarga = None
... |
papers | models | # -*- encoding: utf-8 -*-
# Dissemin: open access policy enforcement tool
# Copyright (C) 2014 Antonin Delpeuch
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Affero General Public License
# as published by the Free Software Foundation; either version 2
# of th... |
gui | chrome_tabs | # ===============================================================================
#
# ToDo: Bug - when selecting close on a tab, sometimes the tab to the right is
# selected, most likely due to determination of mouse position
# ToDo: Tab Selection seems overly complicated. OnLeftDown finds tab at
# position... |
sk1 | app_fsw | # -*- coding: utf-8 -*-
#
# Copyright (C) 2018 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.... |
neubot | system_win32 | # neubot/system/win32.py
#
# Copyright (c) 2010-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 ... |
ui | ui_options_plugins | # -*- 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_PluginsOptionsPage(object):
def setupUi(self, PluginsOptionsPage):
PluginsOptionsPage.setObjectName("PluginsOptionsPage")
PluginsOpt... |
property | util | import re
from collections import Counter
from typing import Any, Callable
from typing import Counter as TCounter
from typing import Dict, Iterable, List, Literal, Optional, Tuple, Union, cast
from posthog.clickhouse.client.escape import escape_param_for_clickhouse
from posthog.clickhouse.kafka_engine import trim_quot... |
extractors | infoq | #!/usr/bin/env python
import ssl
from ..common import *
from ..extractor import VideoExtractor
class Infoq(VideoExtractor):
name = "InfoQ"
stream_types = [{"id": "video"}, {"id": "audio"}, {"id": "slides"}]
def prepare(self, **kwargs):
content = get_content(self.url)
self.title = match... |
port | multibuy | # =============================================================================
# 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... |
clientScripts | copy_thumbnails_to_dip_directory | #!/usr/bin/env python
# This file is part of Archivematica.
#
# Copyright 2010-2013 Artefactual Systems Inc. <http://artefactual.com>
#
# Archivematica is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, ei... |
module | localAdd | import eos.db
import wx
from gui.fitCommands.helpers import activeStateLimit, restoreCheckedStates
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcAddLocalModuleCommand(wx.Command):
def __init__(self, fitID, newModInfo):
wx.Command.__init__(self, True, "Add Mod... |
cover | built_in | # Copyright 2013 Simonas Kazlauskas
# 2015-2020 Nick Boultbee
# 2019 Joschua Gandert
#
# 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 yo... |
Test | conftest | import atexit
import datetime
import gc
import json
import logging
import os
import shutil
import socket
import sys
import threading
import time
import urllib.request
import gevent
import mock
import pytest
if "libev" not in str(gevent.config.loop):
# Workaround for random crash when libuv used with threads
g... |
dialogs | pagedlg | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-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 ver... |
BasicDrawing | DataProvidersAndConsumers | import os
import sys
import objc
import Quartz
from Quartz import *
def createDataProviderFromPathName(path):
# Create a CFURL for the supplied file system path.
url = CFURLCreateWithFileSystemPath(None, path, kCFURLPOSIXPathStyle, False)
if url is None:
print >> sys.stderr, "Couldn't create url!... |
widgets | va_osc | from sglib.lib.translate import _
from sgui.sgqt import *
from . import _shared
from .control import *
class osc_widget:
def __init__(
self,
a_size,
a_pitch_port,
a_fine_port,
a_vol_port,
a_type_port,
a_osc_types_list,
a_rel_callback,
a_val_... |
scenarios | slack_channel_integration | import logging
import typing
from apps.slack.scenarios import scenario_step
from apps.slack.scenarios.resolution_note import RESOLUTION_NOTE_EXCEPTIONS
from apps.slack.types import (
EventPayload,
EventType,
MessageEventSubtype,
PayloadType,
ScenarioRoute,
)
if typing.TYPE_CHECKING:
from apps.... |
app-metrics | app_metrics | import json
from datetime import datetime, timedelta
from django.utils.timezone import now
from posthog.client import sync_execute
from posthog.models.app_metrics.sql import (
QUERY_APP_METRICS_DELIVERY_RATE,
QUERY_APP_METRICS_ERROR_DETAILS,
QUERY_APP_METRICS_ERRORS,
QUERY_APP_METRICS_TIME_SERIES,
)
fr... |
bup | shquote | from __future__ import absolute_import
import re
from bup.compat import bytes_from_byte
q = b"'"
qq = b'"'
class QuoteError(Exception):
pass
def _quotesplit(line):
inquote = None
inescape = None
wordstart = 0
word = b""
for i in range(len(line)):
c = bytes_from_byte(line[i])
... |
extractor | imdb | from __future__ import unicode_literals
import base64
import json
import re
from ..utils import (
determine_ext,
mimetype2ext,
parse_duration,
qualities,
try_get,
url_or_none,
)
from .common import InfoExtractor
class ImdbIE(InfoExtractor):
IE_NAME = "imdb"
IE_DESC = "Internet Movie ... |
utils | anim_effects | import math
def OUT_CIRC(t, b, c, d):
t = float(t)
b = float(b)
c = float(c)
d = float(d)
t = t / d - 1
return c * math.sqrt(1 - t * t) + b
def OUT_QUART(t, b, c, d):
t = float(t)
b = float(b)
c = float(c)
d = float(d)
t = t / d - 1
return -c * (t * t * t * t - 1)... |
PyObjCTest | test_nsprocessinfo | from __future__ import with_statement
from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSProcessInfo(TestCase):
def testConstants(self):
self.assertEqual(NSWindowsNTOperatingSystem, 1)
self.assertEqual(NSWindows95OperatingSystem, 2)
self.assertEqual(NSSolarisOperat... |
builtinViewColumns | abilities | # =============================================================================
# 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 ... |
migrations | 0185_special_migrations | # Generated by Django 3.2.5 on 2021-11-30 10:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0184_delete_sessionsfilter"),
]
operations = [
migrations.CreateModel(
name="SpecialMigration",
fields=[
... |
shift-swaps | notify_when_taken | from apps.mobile_app.tasks import (
notify_beneficiary_about_taken_shift_swap_request as notify_beneficiary_about_taken_shift_swap_request_via_push_notification,
)
from celery.utils.log import get_task_logger
from common.custom_celery_tasks import shared_dedicated_queue_retry_task
task_logger = get_task_logger(__n... |
draftobjects | pointarray | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2018 Benjamin Alterauge (ageeye) *
# * Co... |
lib | six | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 Benjamin Peterson
#
# 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 with... |
bin | running_stats | # encoding: utf-8
"""Tool for a script to keep track changes performed on a large number
of objects.
StatsCount - when you are counting incidences of a small set of outcomes
StatsList - when you also want to remember an ID associated with each incidence
Examples:
from running_stats import StatsCount
package_stats =... |
markupsafe | _constants | # -*- coding: utf-8 -*-
"""
markupsafe._constants
~~~~~~~~~~~~~~~~~~~~~
Highlevel implementation of the Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
HTML_ENTITIES = {
"AElig": 198,
"Aacute": 193,
"Acirc": 194,
"Agrave": 1... |
extensions | ubuntu_appindicator | # -*- coding: utf-8 -*-
# Ubuntu AppIndicator Icon
# Thomas Perl <thp@gpodder.org>; 2012-02-24
import logging
import gpodder
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Gtk
_ = gpodder.gettext
__title__ = _("Ubuntu App Indicator")
__description__ = _("Show a status indicator i... |
activitypub | ordered_collection | """ defines activitypub collections (lists) """
from dataclasses import dataclass, field
from typing import List
from .base_activity import ActivityObject
# pylint: disable=invalid-name
@dataclass(init=False)
class OrderedCollection(ActivityObject):
"""structure of an ordered collection activity"""
totalIte... |
models | histcategory | # SPDX-FileCopyrightText: Ryan Roden-Corrent (rcorre) <ryan@rcorre.net>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""A completion category that queries the SQL history store."""
from typing import Optional
from qutebrowser.completion.models import util
from qutebrowser.config import config
from qutebrowser.misc ... |
parser | cmptest_test | """
Tests for cmptest base test class.
"""
__copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import re
import textwrap
import unittest
from beancount.core import amount, data, position
from beancount.core.number import MISSING
from beancount.parser import booking, cmpte... |
Dressup | Tags | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
frontend | urls | """frontend URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.8/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... |
cargo | changeAmount | import wx
from gui.fitCommands.helpers import CargoInfo
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcChangeCargoAmountCommand(wx.Command):
def __init__(self, fitID, cargoInfo):
wx.Command.__init__(self, True, "Change Cargo Amount")
self.fitID = fitID... |
cli | archivebox_update | #!/usr/bin/env python3
__package__ = "archivebox.cli"
__command__ = "archivebox update"
import argparse
import sys
from typing import IO, List, Optional
from ..config import OUTPUT_DIR
from ..index import (
LINK_FILTERS,
get_archived_folders,
get_corrupted_folders,
get_duplicate_folders,
get_inde... |
pwidgets | fontctrl | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016 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.... |
RemotePyInterpreter | AsyncPythonInterpreter | __all__ = ["AsyncPythonInterpreter"]
try:
import fcntl
except:
fcntl = None
import os
import socket
import sys
import objc
from Foundation import *
from netrepr import NetRepr, RemoteObjectPool, RemoteObjectReference
from StringIO import StringIO
IMPORT_MODULES = ["netrepr", "remote_console", "remote_pipe", ... |
sk1 | app_history | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2018 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 ver... |
models | escalation_policy | import datetime
from common.ordered_model.ordered_model import OrderedModel
from common.public_primary_keys import (
generate_public_primary_key,
increase_public_primary_key_length,
)
from django.conf import settings
from django.core.validators import MinLengthValidator
from django.db import models
def gener... |
QT | PantallaJuicio | from Code import Analisis, Partida, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
Grid,
Iconos,
QTUtil,
QTUtil2,
QTVarios,
Tablero,
)
from PyQt4 import QtCore, QtGui
class WJuicio(QTVarios.WDialogo):
def __init__(
self,
gestor,
xmotor,
... |
vidcutter | settings | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#######################################################################
#
# VidCutter - media cutter & joiner
#
# copyright © 2018 Pete Alexandrou
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Licen... |
utils | imghdr | """Recognize image file formats based on their first few bytes."""
__all__ = ["what"]
#-------------------------#
# Recognize image headers #
#-------------------------#
def what(file, h=None):
if h is None:
if isinstance(file, basestring):
f = open(file, 'rb')
h = f.read(32)
... |
feature | world | # 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, ... |
anticaptchas | CircleCaptcha | # -*- coding: utf-8 -*-
#
# TODO: Recheck all
import io
import math
import operator
import sys
import urllib.request
from PIL import Image, ImageDraw
from ..base.ocr import BaseOCR
class ImageSequence:
def __init__(self, im):
self.im = im
def __getitem__(self, ix):
try:
if ix... |
utils | static_shape | # 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.