section
stringlengths
2
30
filename
stringlengths
1
82
text
stringlengths
783
28M
clientScripts
update_size_and_checksum
#!/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...
extractor
mdr
# coding: utf-8 from __future__ import unicode_literals from ..compat import compat_str, compat_urlparse from ..utils import ( determine_ext, int_or_none, parse_duration, parse_iso8601, url_or_none, xpath_text, ) from .common import InfoExtractor class MDRIE(InfoExtractor): IE_DESC = "MDR...
modules
mod_mpdBackend
# MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2013, Albert Zeyer, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. # This is an implementation of the [MPD protocol](http://www.musicpd.org/doc/protocol/). ...
analog
standard_squelch
# # Copyright 2005,2007,2012 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # import math from gnuradio import blocks, filter, gr class standard_squelch(gr.hier_block2): def __init__(self, audio_rate): gr.hier_block2.__init__( ...
migrations
0007_temperature
# Generated by Django 2.2 on 2019-05-17 03:54 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("core", "0006_auto_20190502_1701"), ] operations = [ migrations.CreateModel( name="Temperature", ...
v1
users
from typing import List from CTFd.api.v1.helpers.request import validate_args from CTFd.api.v1.helpers.schemas import sqlalchemy_to_pydantic from CTFd.api.v1.schemas import ( APIDetailedSuccessResponse, PaginatedAPIListSuccessResponse, ) from CTFd.cache import clear_challenges, clear_standings, clear_user_sess...
bleachbit
DeepScan
# vim: ts=4:sw=4:expandtab # -*- coding: UTF-8 -*- # 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...
posthog
metrics
# Shared metrics and labels for prometheus metrics from contextlib import contextmanager import structlog from django.conf import settings from prometheus_client import CollectorRegistry, push_to_gateway from sentry_sdk import capture_exception logger = structlog.get_logger(__name__) __doc__ = """ This module holds ...
migrations
0174_organization_slug
# Generated by Django 3.1.12 on 2021-10-12 15:54 from django.db import IntegrityError, migrations, transaction from django.utils.text import slugify from posthog.models.utils import LowercaseSlugField, generate_random_short_suffix MAX_SLUG_LENGTH = 48 def slugify_all(apps, schema_editor): Organization = apps.ge...
imageserver
image_attrs
# # Quru Image Server # # Document: image_attrs.py # Date started: 31 Mar 2011 # By: Matt Fozard # Purpose: Wrapper for required image attribute changes # Requires: # Copyright: Quru Ltd (www.quru.com) # Licence: # # This program is free software: you can redistribute it and/or modify # i...
cli
config_tool
# encoding: utf-8 from __future__ import annotations import logging import ckan.lib.config_tool as ct import click from ckan.cli import error_shout log = logging.getLogger(__name__) class ConfigOption(click.ParamType): name = "config-option" def convert(self, value: str, param: str, ctx: click.Context): ...
checker
_main_
# SPDX-License-Identifier: AGPL-3.0-or-later import argparse import io import logging import os import sys import searx.search import searx.search.checker from searx.engines import engine_shortcuts from searx.search import processors # configure logging root = logging.getLogger() handler = logging.StreamHandler(sys....
PyObjCTest
test_keyvalue
""" Tests for the Key-Value Coding support in OC_PythonObject NOTE: Testcases here should be synchronized with the Key-Value Coding tests in PyObjCTools.test.test_keyvalue and Foundation.test.test_keyvalue. """ from __future__ import unicode_literals import objc from PyObjCTest.fnd import * from PyObjCTest.keyvaluehe...
common
checksum
# -*- Mode: Python; test-case-name: whipper.test.test_common_checksum -*- # 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 # ...
plugins
goodgame
""" $description Russian live-streaming platform for live video game broadcasts. $url goodgame.ru $type live $metadata id $metadata author $metadata category $metadata title """ import logging import re import sys from urllib.parse import urlparse, urlunparse from streamlink.plugin import Plugin, pluginmatcher from s...
database
table_speedtest
# neubot/database/table_speedtest.py # # Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>, # NEXA Center for Internet & Society at Politecnico di Torino # Copyright (c) 2011 Alessio Palmero Aprosio <alessio@apnetwork.it>, # Universita` degli Studi di Milano # # This file is part of Neubot <http://www.neubot.o...
babybuddy
models
# -*- coding: utf-8 -*- import pytz from django.conf import settings from django.contrib.auth import get_user_model from django.db import models from django.db.models.signals import post_save from django.dispatch import receiver from django.utils import timezone from django.utils.text import format_lazy from django.uti...
community
knowledge_validator
from tribler.core.components.database.db.tribler_database import Operation, ResourceType from tribler.core.components.knowledge.knowledge_constants import ( MAX_RESOURCE_LENGTH, MIN_RESOURCE_LENGTH, ) def validate_resource(resource: str): """Validate the resource. Raises ValueError, in the case the resour...
meshes
mesh_contact_tube_tube_tria3
def create_nodes(femmesh): # nodes femmesh.addNode(25.0, -6e-15, 500.0, 1) femmesh.addNode(25.0, -6e-15, 0.0, 2) femmesh.addNode(475.0, 76.0, 475.0, 3) femmesh.addNode(-25.0, 76.0, 475.0, 4) femmesh.addNode(0.0, 76.0, 475.0, 5) femmesh.addNode(24.519632010080763, 4.8772580504031975, 500.0, 6...
lib
permissions
# 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, ...
ui
commands
# This file is part of beets. # Copyright 2016, Adrian Sampson. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, ...
blocks
qa_plateau_detector_fb
#!/usr/bin/env python # # Copyright 2012-2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import blocks, gr, gr_unittest class qa_plateau_detector_fb(gr_unittest.TestCase): def setUp(self): self.tb = gr.top_block() ...
utils
titlecase
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Original Perl version by: John Gruber http://daringfireball.net/ 10 May 2008 Python version by Stuart Colville http://muffinresearch.co.uk License: http://www.opensource.org/licenses/mit-license.php """ import re from calibre.utils.icu import capitalize __all__ = ["...
migrator
utils
from typing import Callable, Optional, TypeVar from migrator.config import ONCALL_DELAY_OPTIONS T = TypeVar("T") def find( lst: list[T], cond: Callable[[T], bool], reverse: bool = False ) -> Optional[int]: indices = range(len(lst)) if reverse: indices = indices[::-1] for idx in indices: ...
i18n
setup
# 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 ...
bookwyrm
storage_backends
"""Handles backends for storages""" import os from tempfile import SpooledTemporaryFile from storages.backends.azure_storage import AzureStorage from storages.backends.s3boto3 import S3Boto3Storage class StaticStorage(S3Boto3Storage): # pylint: disable=abstract-method """Storage class for Static contents""" ...
feminout
importInpMesh
# *************************************************************************** # * Copyright (c) 2016 Frantisek Loeffelmann <LoffF@email.cz> * # * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * Th...
KindleEar
helper
#!/usr/bin/env python # -*- coding:utf-8 -*- """ uploader helper for KindleEar <https://github.com/cdhigh/KindleEar> It will modify AppId and some other items for you automatically. Configure file 'custom.txt' format (encoding of the file must be ascii): application: YourAppId email: YourEmail timezone: 8 If it not exi...
autocomplete
documentdata
# 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 ...
lib
inventory
# 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, ...
StartPage
TranslationTexts
# *************************************************************************** # * Copyright (c) 2012 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
bup
gc
from __future__ import absolute_import import glob import os import subprocess import sys import tempfile from binascii import hexlify, unhexlify from os.path import basename from bup import bloom, git, midx from bup.compat import hexstr, pending_raise from bup.git import MissingObject, walk_object from bup.helpers i...
builtinViewColumns
baseName
# coding: utf-8 # ============================================================================= # 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 Fou...
extractor
tf1
# coding: utf-8 from __future__ import unicode_literals import json import re from ..utils import int_or_none, parse_iso8601, try_get from .common import InfoExtractor class TF1IE(InfoExtractor): _VALID_URL = r"https?://(?:www\.)?tf1\.fr/[^/]+/(?P<program_slug>[^/]+)/videos/(?P<id>[^/?&#]+)\.html" _TESTS = ...
migrations
0171_alter_user_preferred_timezone
# Generated by Django 3.2.16 on 2022-12-19 15:30 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("bookwyrm", "0170_merge_0168_auto_20221205_2331_0169_auto_20221206_0902"), ] operations = [ migrations.AlterField( model_name="us...
ui
ui_options_renaming_compat
# -*- 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_RenamingCompatOptionsPage(object): def setupUi(self, RenamingCompatOptionsPage): RenamingCompatOptionsPage.setObjectName("RenamingCompatOpti...
qutebrowser
qutebrowser
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Early initialization and main entry point. qutebrowser's initialization process roughly looks like this: - This file gets imported, either via the setuptools entry point or __main__.py. ...
Tools
fcbt
#!python # FreeCAD Build Tool # (c) 2004 Juergen Riegel import sys help1 = """ FreeCAD Build Tool Usage: fcbt <command name> [command parameter] possible commands are: - DistSrc (DS) Build a source Distr. of the current source tree - DistBin (DB) Build a binary Distr. of the current source ...
draftgeoutils
intersections
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * * # * Th...
messages
strings
from .specs import SPEC_BY_TYPE, make_msgdict def msg2str(msg, include_time=True): type_ = msg["type"] spec = SPEC_BY_TYPE[type_] words = [type_] for name in spec["value_names"]: value = msg[name] if name == "data": value = "({})".format(",".join(str(byte) for byte in va...
database
from1to2
# Copyright (C) 2008-2010 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that...
game
Main
#!/usr/bin/python # -*- coding: utf-8 -*- ##################################################################### # Frets on Fire X (FoFiX) # # Copyright (C) 2006 Sami Kyöstilä # # 2008 evilynux <evilynux@gmail.com> ...
GCodeProfileReader
GCodeProfileReader
# Copyright (c) 2020 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import json import re # Regular expressions for parsing escape characters in the settings. from typing import Optional from cura.ReaderWriters.ProfileReader import NoProfileException, ProfileReader from UM.i18n import i18...
decrypters
HoerbuchIn
# -*- coding: utf-8 -*- import re from bs4 import BeautifulSoup from ..base.decrypter import BaseDecrypter class HoerbuchIn(BaseDecrypter): __name__ = "HoerbuchIn" __type__ = "decrypter" __version__ = "0.68" __status__ = "testing" __pattern__ = r"https?://(?:www\.)?hoerbuch\.us/(wp/horbucher/\d...
rarfile
setup
"""Setup script for rarfile. """ import re from setuptools import setup vrx = r"""^__version__ *= *['"]([^'"]+)['"]""" src = open("rarfile.py").read() ver = re.search(vrx, src, re.M).group(1) ldesc = open("README.rst").read().strip() sdesc = ldesc.split("\n")[0].split(" - ")[1].strip() setup( name="rarfile", ...
cura
MultiplyObjectsJob
# Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import copy from typing import List from cura.Arranging.GridArrange import GridArrange from cura.Arranging.Nest2DArrange import Nest2DArrange from UM.Application import Application from UM.i18n import i18nCatalog from UM.J...
fighter
changeAmount
import wx from logbook import Logger from service.fit import Fit pyfalog = Logger(__name__) class CalcChangeFighterAmountCommand(wx.Command): def __init__(self, fitID, projected, position, amount): wx.Command.__init__(self, True, "Change Fighter Amount") self.fitID = fitID self.projected ...
migrations
0082_personalapikey
# Generated by Django 3.0.6 on 2020-07-29 09:02 import django.db.models.deletion import django.utils.timezone import posthog.models.utils from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0081_person_is_identifie...
parsers
txt
# This file is a part of Lector, a Qt based ebook reader # Copyright (C) 2017-2019 BasioMeusPuga # 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 o...
engine
parsers
from django.conf import settings from rest_framework import parsers, renderers def check_content_length(parser_context): """Enforce DATA_UPLOAD_MAX_MEMORY_SIZE for json rest framework API requests.""" if ( parser_context and settings.DATA_UPLOAD_MAX_MEMORY_SIZE and "request" in parser_...
migrations
0001_initial
# Generated by Django 3.2.18 on 2023-05-24 03:54 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("user_management", "0011_auto_20230411_1358"), ("alerts", "0015_auto_20230508_1641"), ("b...
migrations
0262_track_viewed_notifications
# Generated by Django 3.2.15 on 2022-09-30 09:19 import django.db.models.deletion import posthog.models.utils from django.conf import settings from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0261_team_capture_console_log_opt_in"), ] o...
models
slack_team_identity
import logging import typing from apps.api.permissions import RBACPermission from apps.slack.client import SlackClient from apps.slack.constants import SLACK_INVALID_AUTH_RESPONSE, SLACK_WRONG_TEAM_NAMES from apps.slack.errors import ( SlackAPIChannelNotFoundError, SlackAPIFetchMembersFailedError, SlackAPI...
Arch
ArchAxisSystem
# *************************************************************************** # * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> * # * * # * This program is free software; you can redistribute it and/or modify * # * it...
umsgpack
umsgpack
# u-msgpack-python v2.4.1 - v at sergeev.io # https://github.com/vsergeev/u-msgpack-python # # u-msgpack-python is a lightweight MessagePack serializer and deserializer # module, compatible with both Python 2 and 3, as well CPython and PyPy # implementations of Python. u-msgpack-python is fully compliant with the # lat...
templatetags
utilities
""" template filters for really common utilities """ import os import re from uuid import uuid4 from django import template from django.templatetags.static import static from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ register = template.Library() @register.filte...
femexamples
ccx_cantilever_beam_pipe
# *************************************************************************** # * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> * # * * # * This file is part of the FreeCAD CAx development system. * # * ...
PyObjCTest
test_cfbyteorder
import sys from CoreFoundation import * from PyObjCTools.TestSupport import * class TestByteOrder(TestCase): def testConstants(self): self.assertEqual(CFByteOrderUnknown, 0) self.assertEqual(CFByteOrderLittleEndian, 1) self.assertEqual(CFByteOrderBigEndian, 2) def testCurrent(self): ...
inference
detection_inference_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...
access
users
__license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html" __copyright__ = "Copyright (C) 2014 The OctoPrint Project - Released under terms of the AGPLv3 License" import hashlib import logging import os import shutil import time import uuid import wrapt from flask_login import AnonymousUs...
widgets
tablecontentmodel
import json import logging import time import uuid from collections import deque from dataclasses import dataclass, field from datetime import timedelta from enum import Enum, auto from typing import Callable, Dict, List from PyQt5.QtCore import ( QAbstractTableModel, QModelIndex, QRectF, QSize, Qt...
Test
TestCryptHash
import base64 from Crypt import CryptHash sha512t_sum_hex = "2e9466d8aa1f340c91203b4ddbe9b6669879616a1b8e9571058a74195937598d" sha512t_sum_bin = b".\x94f\xd8\xaa\x1f4\x0c\x91 ;M\xdb\xe9\xb6f\x98yaj\x1b\x8e\x95q\x05\x8at\x19Y7Y\x8d" sha256_sum_hex = "340cd04be7f530e3a7c1bc7b24f225ba5762ec7063a56e1ae01a30d56722e5c3" ...
models
uploaded_media
from typing import List, Optional import structlog from django.conf import settings from django.db import models from posthog.models.team import Team from posthog.models.user import User from posthog.models.utils import UUIDModel from posthog.storage import object_storage from posthog.storage.object_storage import Obj...
Todo
CalendarMatrix
from Cocoa import * gNumDaysInMonth = (0, 31, 28, 31, 30, 21, 30, 31, 31, 30, 31, 30, 31) def isLeap(year): return ((year % 4) == 0 and ((year % 100) != 0)) or (year % 400) == 0 class CalendarMatrix(NSMatrix): lastMonthButton = objc.IBOutlet() monthName = objc.IBOutlet() nextMonthButton = objc.IBOu...
quodlibet
const
# 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. """Constants used in various parts of QL, mostly strings.""" import os...
utils
urlutils
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # SPDX-License-Identifier: GPL-3.0-or-later """Utils regarding URL handling.""" import base64 import ipaddress import mimetypes import os.path import posixpath import re import urllib.parse from typing import Iterable, Optional, Tuple, U...
extractor
arcpublishing
# coding: utf-8 from __future__ import unicode_literals import re from ..utils import extract_attributes, int_or_none, parse_iso8601, try_get from .common import InfoExtractor class ArcPublishingIE(InfoExtractor): _UUID_REGEX = r"[\da-f]{8}-(?:[\da-f]{4}-){3}[\da-f]{12}" _VALID_URL = r"arcpublishing:(?P<org...
amazoncovers
_ecs
# Copyright (C) 2006 Adam Olsen # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 1, or (at your option) # any later version. # # This program is distributed in the hope that it w...
migrations
0288_add_session_recording_persistence
# Generated by Django 3.2.16 on 2023-01-05 15:05 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0287_add_session_recording_model"), ] operations = [ migrations.AddField( model_name="sessionrecording", ...
downloaders
ZbigzCom
# -*- coding: utf-8 -*- import json import random import re import time import urllib.parse from ..base.downloader import BaseDownloader class ZbigzCom(BaseDownloader): __name__ = "ZbigzCom" __type__ = "downloader" __version__ = "0.04" __status__ = "testing" __pattern__ = r"^unmatchable$" _...
Draft
DraftVecUtils
# *************************************************************************** # * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> * # * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> * # * * # * Th...
core
outputschema
# # Copyright 2019 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # """ Schema to be strictly followed be parsed header output """ RESULT_SCHEMA = { "title": "JSON SCHEMA TO BE FOLLOWED BY BLOCK HEADER PARSING TOOL", "description": "Schema des...
accounts
SimplyPremiumCom
# -*- coding: utf-8 -*- import json from ..base.multi_account import MultiAccount from ..helpers import set_cookie class SimplyPremiumCom(MultiAccount): __name__ = "SimplyPremiumCom" __type__ = "account" __version__ = "0.15" __status__ = "testing" __config__ = [ ("mh_mode", "all;listed;...
builtinContextMenus
cargoAddAmmo
import gui.fitCommands as cmd import gui.mainFrame import wx from gui.contextMenu import ContextMenuSingle _t = wx.GetTranslation class AddToCargoAmmo(ContextMenuSingle): def __init__(self): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, callingWindow, srcContext, mainItem)...
chardet
enums
""" All of the Enums that are used throughout the chardet package. :author: Dan Blanchard (dan.blanchard@gmail.com) """ class InputState(object): """ This enum represents the different states a universal detector can be in. """ PURE_ASCII = 0 ESC_ASCII = 1 HIGH_BYTE = 2 class LanguageFilte...
recaptcha
recaptcha_v3
import logging from urllib.parse import urlparse import requests from django.conf import settings from ipware import get_client_ip logger = logging.getLogger(__name__) def check_recaptcha_internal_api(request, action: str, score=0.5) -> bool: """ Helper function to perform recaptcha checks in internal api. ...
Gui
PropertyBag
# -*- coding: utf-8 -*- # *************************************************************************** # * Copyright (c) 2020 sliptonic <shopinthewoods@gmail.com> * # * * # * This program is free software; you can redistribute it a...
dissemin
conftest
import hashlib import json import os import re import sys from datetime import date from io import BytesIO from tempfile import NamedTemporaryFile from urllib.parse import parse_qs, urlparse import pytest import requests import responses from deposit.models import Repository from dissemin.settings import BASE_DIR, POS...
custom-widgets
qscroll_area_viewer
from PyQt5 import QtCore, QtWidgets class QScrollAreaViewer(QtWidgets.QScrollArea): resized = QtCore.pyqtSignal() def __init__(self, parent=None): super(QScrollAreaViewer, self).__init__(parent) self.drag_mouse = False self.drag_position = {"x": 0, "y": 0} self.setCursor(QtCor...
gui
task_exporter
# -------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU...
gaphor
transaction
"""Transaction support for Gaphor.""" from __future__ import annotations import logging from typing import Callable from gaphor.event import TransactionBegin, TransactionCommit, TransactionRollback log = logging.getLogger(__name__) class TransactionError(Exception): """Errors related to the transaction module...
sitemaps
watcher
import datetime import json import time import dateutil import pytz from boto.s3.connection import S3Connection from boto.sqs.connection import SQSConnection from pylons import app_globals as g from r2.lib.s3_helpers import parse_s3_path from r2.lib.sitemaps.data import find_all_subreddits from r2.lib.sitemaps.store i...
migrations
0279_recording_playlist_item_model
# Generated by Django 3.2.16 on 2022-11-17 14:02 import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("posthog", "0278_organization_customer_id"), ] operations = [ migrations.AddField( model_name="s...
migrations
0014_shiftswaprequest
# Generated by Django 3.2.20 on 2023-07-21 18:55 import apps.schedules.models.shift_swap_request import django.core.validators import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("user_management", "0013_alter_organization_ack...
restapi
create_torrent_endpoint
import base64 import json from aiohttp import web from aiohttp_apispec import docs, json_schema from ipv8.REST.schema import schema from marshmallow.fields import String from tribler.core.components.libtorrent.download_manager.download_config import ( DownloadConfig, ) from tribler.core.components.libtorrent.downl...
feature
feature
# 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, ...
ui
ui_options_network
# -*- 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_NetworkOptionsPage(object): def setupUi(self, NetworkOptionsPage): NetworkOptionsPage.setObjectName("NetworkOptionsPage") NetworkOpt...
gpodder
schema
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the Licens...
controllers
login
# 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, ...
modules
mod_socketcontrol
# -*- coding: utf-8 -*- # MusicPlayer, https://github.com/albertz/music-player # Copyright (c) 2013, Albert Zeyer, www.az2000.de # All rights reserved. # This code is under the 2-clause BSD license, see License.txt in the root directory of this project. import os import sys import appinfo import binstruct import util...
src
depends
""" Utility functions to check the availability of dependencies and suggest how it may be installed """ import os import re import sys # Only really old versions of Python don't have sys.hexversion. We don't # support them. The logging module was introduced in Python 2.3 if not hasattr(sys, "hexversion") or sys.hexve...
localFighter
toggleStates
import eos.db import gui.mainFrame import wx from gui import globalEvents as GE from gui.fitCommands.calc.fighter.localToggleStates import ( CalcToggleLocalFighterStatesCommand, ) from gui.fitCommands.helpers import InternalCommandHistory from service.fit import Fit class GuiToggleLocalFighterStatesCommand(wx.Com...
src
shared
""" Some shared functions .. deprecated:: 0.6.3 Should be moved to different places and this file removed, but it needs refactoring. """ from __future__ import division # Libraries. import hashlib import os import stat import subprocess import sys from binascii import hexlify # Project imports. import highlevelc...
notifier
factory
import importlib import logging import os import pkgutil logger = logging.getLogger(__name__) def dummy_notify_factory(notify_func): def factory(conf, value): return notify_func return factory def load_notifiers(): path = os.path.dirname(os.path.abspath(__file__)) before, sep, _ = __name__...
util
timeout
# The default socket timeout, used by httplib to indicate that no timeout was # specified by the user import time from socket import _GLOBAL_DEFAULT_TIMEOUT from ..exceptions import TimeoutStateError # A sentinel value to indicate that no timeout was specified by the user in # urllib3 _Default = object() def curren...
downloaders
UpstoreNet
# -*- coding: utf-8 -*- import json import re from ..anticaptchas.HCaptcha import HCaptcha from ..base.simple_downloader import SimpleDownloader class UpstoreNet(SimpleDownloader): __name__ = "UpstoreNet" __type__ = "downloader" __version__ = "0.18" __status__ = "testing" __pattern__ = r"https?...
platform
xattr
import errno import os from ..helpers import Buffer try: ENOATTR = errno.ENOATTR except AttributeError: # on some platforms, ENOATTR is missing, use ENODATA there ENOATTR = errno.ENODATA buffer = Buffer(bytearray, limit=2**24) def split_string0(buf): """split a list of zero-terminated strings into...
PyObjCTest
test_nsprintoperation
from AppKit import * from PyObjCTools.TestSupport import * try: unicode except NameError: unicode = str class TestNSPrintOperation(TestCase): def testConstants(self): self.assertEqual(NSDescendingPageOrder, -1) self.assertEqual(NSSpecialPageOrder, 0) self.assertEqual(NSAscendingPa...
cli
requestitems
import functools import os from typing import IO, Callable, Dict, List, Optional, Tuple, Union from ..utils import ( get_content_type, load_json_preserve_order_and_dupe_keys, split_iterable, ) from .argtypes import KeyValueArg from .constants import ( SEPARATOR_DATA_EMBED_FILE_CONTENTS, SEPARATOR_D...
extractors
douban
#!/usr/bin/env python __all__ = ["douban_download"] import urllib.parse import urllib.request from ..common import * def douban_download(url, output_dir=".", merge=True, info_only=False, **kwargs): html = get_html(url) if re.match(r"https?://movie", url): title = match1(html, 'name="description" c...