section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
downloaders | ZDF | # -*- coding: utf-8 -*-
import json
import os
import re
import pycurl
from ..base.downloader import BaseDownloader
# Based on zdfm by Roland Beermann (http://github.com/enkore/zdfm/)
class ZDF(BaseDownloader):
__name__ = "ZDF Mediathek"
__type__ = "downloader"
__version__ = "0.93"
__status__ = "test... |
bleachbit | CLI | #!/usr/bin/python3
# vim: ts=4:sw=4:expandtab
# BleachBit
# Copyright (C) 2008-2023 Andrew Ziem
# https://www.bleachbit.org
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of... |
extractors | longzhu | #!/usr/bin/env python
__all__ = ["longzhu_download"]
import json
from ..common import (
download_urls,
general_m3u8_extractor,
get_content,
match1,
player,
playlist_not_supported,
print_info,
)
def longzhu_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
web_dom... |
versions | 041_6817d4e3bdc3_resource_new_fields | # encoding: utf-8
"""041 Resource new fields
Revision ID: 6817d4e3bdc3
Revises: 500a08f4818e
Create Date: 2018-09-04 18:49:03.042528
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "6817d4e3bdc3"
dow... |
extractor | scte | from __future__ import unicode_literals
import re
from ..utils import ExtractorError, decode_packed_codes, urlencode_postdata
from .common import InfoExtractor
class SCTEBaseIE(InfoExtractor):
_LOGIN_URL = "https://www.scte.org/SCTE/Sign_In.aspx"
_NETRC_MACHINE = "scte"
def _real_initialize(self):
... |
chardet | euckrfreq | ######################## 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... |
versions | 6cc823948c5a_add_trackerapi | """Add trackerapi table
Revision ID: 6cc823948c5a
Revises: b61e4f6a88cc
Create Date: 2018-02-11 20:57:15.244171
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "6cc823948c5a"
down_revision = "b61e4f6a88cc"
branch_labels = None
depends_on = None
def upgrade():
... |
utils | defdict | """An instance of collections.defaultdict whose factory accepts a key.
Note: This really ought to be an enhancement to Python itself. I should bother
adding this in eventually.
"""
__copyright__ = "Copyright (C) 2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
class DefaultDictWithKey(collections.de... |
apps | module_backend | #!/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
# Author:
# cdhigh <https://github.com/cdhigh>
# Contributors:
# rexdf <https://github.com/rexdf>
__Author__ = "cdhigh"
import datetime
i... |
PyObjCTest | test_nsexpression | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSExpression(TestCase):
def testConstants(self):
self.assertEqual(NSConstantValueExpressionType, 0)
self.assertEqual(NSEvaluatedObjectExpressionType, 1)
self.assertEqual(NSVariableExpressionType, 2)
self.asser... |
builders | region_similarity_calculator_builder_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... |
plover | orthography | # Copyright (c) 2010-2011 Joshua Harlan Lifton.
# See LICENSE.txt for details.
"""Functions that implement some English orthographic rules."""
from plover import system
def make_candidates_from_rules(word, suffix, check=lambda x: True):
candidates = []
for r in system.ORTHOGRAPHY_RULES:
m = r[0].mat... |
Code | GestorMicElo | import datetime
import random
from Code import (
DGT,
Books,
EnginesMicElo,
Gestor,
Jugada,
Util,
VarGen,
XMotorRespuesta,
)
from Code.Constantes import *
from Code.QT import QTUtil2
class DicMicElos:
def __init__(self):
self.variable = "DicMicElos"
self.configurac... |
params | template_arg | # Copyright 2008-2017 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
class TemplateArg(str):
"""
A cheetah template argument created from a param.
The str of this class evaluates to the param's to code method.
The use of this class as a ... |
clients | deluge | import base64
import os
import mylar
from deluge_client import DelugeRPCClient
from mylar import helpers, logger
class TorrentClient(object):
def __init__(self):
self.conn = None
def connect(self, host, username, password, test=False):
if self.conn is not None:
return self.connec... |
api | views_data_api | #
# Quru Image Server
#
# Document: views_data_api.py
# Date started: 08 Feb 2012
# By: Matt Fozard
# Purpose: Developer / Admin API for managing database records
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute i... |
printing | cups_print | # -*- coding: utf-8 -*-
#
# Copyright (C) 2016-2017 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... |
frescobaldi-app | tokeniter | # 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
... |
migrations | 0018_archivesspace_sip_arrange | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [("main", "0017_update_seigfried")]
operations = [
migrations.CreateModel(
name="ArchivesSpaceDigitalObject",
fields=[
(
"id",
... |
scripts | PauseAtHeight | # Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
# Revised by GregValiant 10-17-2022
# Changed "extrude" line to before the nozzle moves back to the print (if not Repetier or Griffin).
# Add M104 option for Resume temperature
import re
from typing import List, Tuple
from ... |
openshot-qt | freeze | """
@file
@brief cx_Freeze script to build OpenShot package with dependencies (for Mac and Windows)
@author Jonathan Thomas <jonathan@openshot.org>
@section LICENSE
Copyright (c) 2008-2016 OpenShot Studios, LLC
(http://www.openshotstudios.com). This file is part of
OpenShot Video Editor (http://www.openshot.or... |
extractor | internetvideoarchive | from __future__ import unicode_literals
import json
import re
from ..compat import compat_parse_qs, compat_urlparse
from .common import InfoExtractor
class InternetVideoArchiveIE(InfoExtractor):
_VALID_URL = r"https?://video\.internetvideoarchive\.net/(?:player|flash/players)/.*?\?.*?publishedid.*?"
_TEST ... |
formats | _misc | # Copyright 2016 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.
import contextlib
import os
import ... |
core | batcher | # 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... |
Test | TestMsgpack | import io
import os
from collections import OrderedDict
import msgpack
import pytest
from Config import config
from util import Msgpack
class TestMsgpack:
test_data = OrderedDict(
sorted(
{
"cmd": "fileGet",
"bin": b"p\x81zDhL\xf0O\xd0\xaf",
"pa... |
stpa | unsafecontrolaction | """Unsafe Control Action item definition."""
from gaphas.geometry import Rectangle
from gaphor.core.modeling import DrawContext
from gaphor.diagram.presentation import (
Classified,
ElementPresentation,
from_package_str,
)
from gaphor.diagram.shapes import Box, Text, draw_border
from gaphor.diagram.support... |
machine | stentura | # Copyright (c) 2011 Hesky Fisher
# See LICENSE.txt for details.
# Many thanks to a steno geek for help with the protocol.
# TODO: Come up with a mechanism to communicate back to the engine when there
# is a connection error.
# TODO: Address any generic exceptions still left.
"""Thread-based monitoring of a stenotype... |
UI | AddPrinterPagesModel | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from .WelcomePagesModel import WelcomePagesModel
#
# This Qt ListModel is more or less the same the WelcomePagesModel, except that this model is only for adding a printer,
# so only the steps for adding a printer is inclu... |
tasks | notify_user | import time
from apps.alerts.constants import NEXT_ESCALATION_DELAY
from apps.alerts.signals import user_notification_action_triggered_signal
from apps.base.messaging import get_messaging_backend_from_id
from apps.metrics_exporter.helpers import metrics_update_user_cache
from apps.phone_notifications.phone_backend imp... |
Code | GestorAlbum | from Code import Albums, Gestor, Jugada
from Code.Constantes import *
from Code.QT import QTUtil2
class GestorAlbum(Gestor.Gestor):
def inicio(self, album, cromo, aplazamiento=None):
if aplazamiento:
album = aplazamiento["ALBUM"]
cromo = aplazamiento["CROMO"]
self.reini... |
utils | happyeyeballs | #!/usr/bin/python3
# Python implementation of RFC 6555 / Happy Eyeballs: find the quickest IPv4/IPv6 connection
# See https://tools.ietf.org/html/rfc6555
# Method: Start parallel sessions using threads, and only wait for the quickest successful socket connect
# See https://tools.ietf.org/html/rfc6555#section-4.1
# You... |
settings | data_stores | import json
import os
from typing import List
from urllib.parse import urlparse
import dj_database_url
from django.core.exceptions import ImproperlyConfigured
from posthog.settings.base_variables import DEBUG, IS_COLLECT_STATIC, TEST
from posthog.settings.utils import get_from_env, get_list, str_to_bool
# See https:/... |
migrations | 0008_fix_name_indices | # Generated by Django 2.1.7 on 2019-05-12 16:08
from django.db import migrations, models
class Migration(migrations.Migration):
atomic = False
dependencies = [
("publishers", "0007_publisher_romeo_parent_id"),
]
operations = [
migrations.AlterField(
model_name="journal",... |
mackup | constants | """Constants used in Mackup."""
# Current version
VERSION = "0.8.37"
# Support platforms
PLATFORM_DARWIN = "Darwin"
PLATFORM_LINUX = "Linux"
# Directory containing the application configs
APPS_DIR = "applications"
# Mackup application name
MACKUP_APP_NAME = "mackup"
# Default Mackup backup path where it stores its ... |
Measure | Init | # ***************************************************************************
# * Copyright (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
core | anchor_generator | # 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... |
constructors | jsobject | import six
from ..base import *
# todo Double check everything is OK
@Js
def Object():
val = arguments.get("0")
if val.is_null() or val.is_undefined():
return PyJsObject(prototype=ObjectPrototype)
return val.to_object()
@Js
def object_constructor():
if len(arguments):
val = argumen... |
stargate | tracks | from sglib.lib import *
from sglib.lib.util import *
class tracks:
__slots__ = [
"tracks",
]
def __init__(self):
self.tracks = {}
def reorder(self, a_dict):
self.tracks = {a_dict[k]: self.tracks[k] for k in sorted(self.tracks)}
for k, v in self.tracks.items():
... |
extras | fgen | ################################################################
### text image generation with Cairo
################################################################
from __future__ import print_function
import ctypes
import cairo
import pango
import pangocairo
from cairoextras import *
from numpy import *
from pyl... |
pynocchio | comic_file_loader_rar | import logging
import rarfile
from .comic import Page
from .comic_file_loader import ComicLoader
from .exception import NoDataFindException
from .utility import IMAGE_FILE_FORMATS, get_file_extension
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
def is_rarfile(filename):
"""Verify if file ... |
analog | fm_emph | #
# Copyright 2005,2007,2012 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import cmath
import math
from gnuradio import filter, gr
class fm_deemph(gr.hier_block2):
r"""
FM Deemphasis IIR filter
Args:
fs: sampling freq... |
extractors | pptv | #!/usr/bin/env python
# __all__ = ['pptv_download', 'pptv_download_by_id']
import binascii
import random
import re
import time
import urllib
from xml.dom.minidom import parseString
from ..common import *
from ..extractor import VideoExtractor
def lshift(a, b):
return (a << b) & 0xFFFFFFFF
def rshift(a, b):
... |
tasks | delete_alert_group | from apps.slack.errors import SlackAPIRatelimitError
from celery.utils.log import get_task_logger
from common.custom_celery_tasks import shared_dedicated_queue_retry_task
from django.conf import settings
logger = get_task_logger(__name__)
@shared_dedicated_queue_retry_task(
autoretry_for=(Exception,),
retry_... |
Http | CloudPrintJobResponse | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Optional
from ..BaseModel import BaseModel
# Model that represents the response received from the cloud after requesting to upload a print job
class CloudPrintJobResponse(BaseModel):
def __init__(
... |
frescobaldi-app | browseriface | # This file is part of the Frescobaldi project, http://www.frescobaldi.org/
#
# Copyright (c) 2014 - 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
... |
logging | timing | import functools
from time import time
from typing import Any, Optional
import structlog
from statshog.defaults.django import statsd
logger = structlog.get_logger(__name__)
def timed(name: str):
def timed_decorator(func: Any) -> Any:
@functools.wraps(func)
def wrapper(*args, **kwargs):
... |
printdlg | canvas | # -*- 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.... |
digital | modulation_utils | #
# Copyright 2010 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
"""
Miscellaneous utilities for managing mods and demods, as well as other items
useful in dealing with generalized handling of different modulations and demods.
"""
import inspect
# T... |
extractor | techtalks | from __future__ import unicode_literals
import re
from ..utils import clean_html, get_element_by_attribute
from .common import InfoExtractor
class TechTalksIE(InfoExtractor):
_VALID_URL = r"https?://techtalks\.tv/talks/(?:[^/]+/)?(?P<id>\d+)"
_TESTS = [
{
"url": "http://techtalks.tv/tal... |
core | exceptions | # -*- coding: utf-8 -*-
"""
flaskbb.core.exceptions
~~~~~~~~~~~~~~~~~~~~~~~
Exceptions raised by flaskbb.core,
forms the root of all exceptions in
FlaskBB.
:copyright: (c) 2014-2018 the FlaskBB Team
:license: BSD, see LICENSE for more details
"""
class BaseFlaskBBError(Exception):
""... |
Tools | ArchiveNameFromVersionHeader | #! python
###
# A convenience script to generate a deployment archive name of the form
# FreeCAD_{Major Version Number}.{Minor Version Number}-{Git Revision Count}.{Git Short SHA}-{OS}-{Arch}
#
import getopt
import platform
import sys
def deserializeVersionHeader(path):
version = {}
try:
dat = open(... |
extractor | audioboom | # coding: utf-8
from __future__ import unicode_literals
from ..utils import clean_html, float_or_none
from .common import InfoExtractor
class AudioBoomIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?audioboom\.com/(?:boos|posts)/(?P<id>[0-9]+)"
_TESTS = [
{
"url": "https://audioboom.... |
Test | TestTor | import time
import mock
import pytest
from Config import config
from Crypt import CryptRsa
from File import FileServer
@pytest.mark.usefixtures("resetSettings")
@pytest.mark.usefixtures("resetTempSettings")
class TestTor:
def testDownload(self, tor_manager):
for retry in range(15):
time.sleep... |
FirmwareUpdateChecker | FirmwareUpdateCheckerLookup | # Copyright (c) 2018 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, Optional
from UM.i18n import i18nCatalog
i18n_catalog = i18nCatalog("cura")
def getSettingsKeyForMachine(machine_id: int) -> str:
return "info/latest_checked_firmware_for_{0}".format(machine... |
base | plugin | # -*- coding: utf-8 -*-
import inspect
import os
import sys
import pycurl
from pyload.core.network.exceptions import Fail, Skip
from pyload.core.network.request_factory import get_request
from pyload.core.utils import fs
from pyload.core.utils.old import fixurl
from pyload.core.utils.web import purge
from ..helpers ... |
PyObjCTest | test_nsdrawer | from AppKit import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestNSDrawerHelper(NSObject):
def drawerShouldOpen_(self, sender):
return 1
def drawerShouldClose_(self, sender):
return 1
def drawerWillResizeContents_toSize_(self, a, ... |
scripting | system | # 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... |
PyObjCTest | test_nsbezierpath | # Test special methods of NSBezierPath
# TODO: Test implementing these in python.
import objc
from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSBezierPath(TestCase):
if not hasattr(TestCase, "assertAlmostEquals"):
def assertAlmostEquals(self, val1, val2):
self.assert_(abs... |
parts | mdiarea | # -*- 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... |
utilities | pony_utils | from __future__ import annotations
import logging
import sys
import threading
import time
import traceback
from asyncio import get_event_loop
from dataclasses import dataclass
from io import StringIO
from operator import attrgetter
from types import FrameType
from typing import Callable, Dict, Iterable, Optional, Type... |
books | Economist | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from base import BaseFeedBook, URLOpener, string_of_tag
from bs4 import BeautifulSoup
def getBook():
return Economist
class Economist(BaseFeedBook):
title = "The Economist"
description = "Global news and current affairs from a European perspective. deliver on... |
gui | fitBrowserLite | import re
import gui.display as d
# noinspection PyPackageRequirements
import wx
from service.fit import Fit
_t = wx.GetTranslation
def fitSorter(fit):
return fit.shipName, fit.name
class FitBrowserLiteDialog(wx.Dialog):
def __init__(self, parent, title=_t("Add Fits"), excludedFitIDs=()):
super()... |
Part | TestPartApp | # **************************************************************************
# Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net> *
# *
# This file is part of the FreeCAD CAx development system. *
# ... |
templatetags | babybuddy | # -*- coding: utf-8 -*-
from axes.helpers import get_lockout_message
from axes.models import AccessAttempt
from core.models import Child
from django import template
from django.apps import apps
from django.conf import settings
from django.utils import timezone
from django.utils.translation import get_language, to_loca... |
OpenGLDemo | OpenGLDemo | """OpenGLDemo.py -- A simple demo of using OpenGL with Cocoa
To build the demo program, run this line in Terminal.app:
$ python setup.py py2app -A
This creates a directory "dist" containing OpenGLDemo.app. (The
-A option causes the files to be symlinked to the .app bundle instead
of copied. This means you don't ... |
base | container | # -*- coding: utf-8 -*-
import os
import urllib.parse
from ..helpers import exists
from .decrypter import BaseDecrypter
class BaseContainer(BaseDecrypter):
__name__ = "Container"
__type__ = "base"
__version__ = "0.15"
__status__ = "stable"
__pattern__ = r"^unmatchable$"
__config__ = [
... |
builtinContextMenus | priceOptions | from abc import ABCMeta, abstractmethod
import gui.globalEvents as GE
import gui.mainFrame
import wx
from gui.contextMenu import ContextMenuUnconditional
from service.settings import MarketPriceSettings
_t = wx.GetTranslation
class ItemGroupPrice(ContextMenuUnconditional, metaclass=ABCMeta):
def __init__(self):... |
grc | gen_rfnoc_tx_radio_block_yml | """
Copyright 2023 Ettus Research, A National Instruments Brand.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import sys
MAX_NUM_CHANNELS = 4
MAIN_TMPL = """\
id: uhd_rfnoc_tx_radio
label: RFNoC TX Radio
flags: [python, throttle]
category: '[Core]/UHD/RFNoC/Blocks'
parameters:
- id: num_chans
label: Channel cou... |
extractor | libsyn | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import (
clean_html,
get_element_by_class,
parse_duration,
strip_or_none,
unified_strdate,
)
from .common import InfoExtractor
class LibsynIE(InfoExtractor):
_VALID_URL = r"(?P<mainurl>https?://html5-player\.libsy... |
forms | landing | """ Forms for the landing pages """
import pyotp
from bookwyrm import models
from bookwyrm.settings import DOMAIN, TWO_FACTOR_LOGIN_VALIDITY_WINDOW
from django import forms
from django.contrib.auth.password_validation import validate_password
from django.core.exceptions import ValidationError
from django.utils.translat... |
deluge-label | test | #!/usr/bin/env python
#
# -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Martijn Voncken <mvoncken@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... |
person | sql | from posthog.clickhouse.base_sql import COPY_ROWS_BETWEEN_TEAMS_BASE_SQL
from posthog.clickhouse.indexes import index_by_kafka_timestamp
from posthog.clickhouse.kafka_engine import KAFKA_COLUMNS, STORAGE_POLICY, kafka_engine
from posthog.clickhouse.table_engines import CollapsingMergeTree, ReplacingMergeTree
from posth... |
nested-json | parse | from typing import Iterator
from .errors import NestedJSONSyntaxError
from .tokens import (
BACKSLASH,
EMPTY_STRING,
LITERAL_TOKENS,
OPERATORS,
SPECIAL_CHARS,
Path,
PathAction,
Token,
TokenKind,
)
__all__ = [
"parse",
"assert_cant_happen",
]
def parse(source: str) -> Iter... |
Part | Init | # ***************************************************************************
# * Copyright (c) 2001, 2002 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
api | async_migration | import structlog
from posthog.api.routing import StructuredViewSetMixin
from posthog.async_migrations.runner import (
MAX_CONCURRENT_ASYNC_MIGRATIONS,
is_posthog_version_compatible,
)
from posthog.async_migrations.setup import get_async_migration_definition
from posthog.async_migrations.utils import (
force... |
papers | admin | # 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 the License, or (at your opti... |
migrator | report | TAB = " " * 4
SUCCESS_SIGN = "✅"
ERROR_SIGN = "❌"
WARNING_SIGN = "⚠️" # TODO: warning sign does not renders properly
def format_user(user: dict) -> str:
result = "{} ({})".format(user["name"], user["email"])
if user["oncall_user"]:
result = "{} {}".format(SUCCESS_SIGN, result)
else:
resu... |
extractor | stanfordoc | from __future__ import unicode_literals
import re
from ..utils import ExtractorError, orderedSet, unescapeHTML
from .common import InfoExtractor
class StanfordOpenClassroomIE(InfoExtractor):
IE_NAME = "stanfordoc"
IE_DESC = "Stanford Open ClassRoom"
_VALID_URL = r"https?://openclassroom\.stanford\.edu(?... |
scripts | linuxcnc_post | # ***************************************************************************
# * Copyright (c) 2014 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
cmd | web | from __future__ import absolute_import, print_function
import mimetypes
import os
import posixpath
import signal
import stat
import sys
import time
import webbrowser
from binascii import hexlify
from collections import namedtuple
from bup import git, options, vfs
from bup.helpers import chunkyreader, debug1, format_f... |
builtinItemStatsViews | itemCompare | # noinspection PyPackageRequirements
import wx
from gui.utils.numberFormatter import formatAmount
from service.attribute import Attribute
from service.market import Market
from service.price import Price as ServicePrice
from .helpers import AutoListCtrl
_t = wx.GetTranslation
def defaultSort(item):
return (item... |
mylar | findcomicfeed | #!/usr/bin/env python
import os
import re
import sys
import time
import unicodedata
import urllib
import feedparser
import logger
import mylar
def Startit(
searchName, searchIssue, searchYear, ComicVersion, IssDateFix, booktype=None
):
cName = searchName
# clean up searchName due to webparse/redudant n... |
gtk3 | tab_data_funcs | #
# Copyright (C) 2007, 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.
#
from deluge.common impor... |
popularity | popularity_component | from ipv8.peerdiscovery.network import Network
from tribler.core.components.component import Component
from tribler.core.components.gigachannel.community.sync_strategy import RemovePeers
from tribler.core.components.ipv8.ipv8_component import INFINITE, Ipv8Component
from tribler.core.components.metadata_store.metadata_... |
web | browser | """Browser to test web applications.
(from web.py)
"""
import copy
import urllib
import httplib
import urllib2
from net import htmlunquote
from StringIO import StringIO
from utils import re_compile
DEBUG = False
__all__ = [
"BrowserError",
"Browser", "AppBrowser",
"AppHandler"
]
class BrowserError(Excep... |
CuraEngineBackend | StartSliceJob | # Copyright (c) 2021-2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
import os
import re
import time
from enum import IntEnum
from string import Formatter
from typing import Any, Dict, List, Optional, Set, cast
import numpy
import pyArcus as Arcus # For typing.
from cura.CuraApplicat... |
downloaders | NowVideoSx | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class NowVideoSx(SimpleDownloader):
__name__ = "NowVideoSx"
__type__ = "downloader"
__version__ = "0.17"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)?nowvideo\.[a-zA-Z]{2,}/(video/|mobile/(#/video... |
stream | dash_manifest | import copy
import dataclasses
import logging
import math
import re
from collections import defaultdict
from contextlib import contextmanager
from datetime import datetime, timedelta
from itertools import count, repeat
from pathlib import Path
from typing import (
Any,
Callable,
ClassVar,
Dict,
Iter... |
gui | accelmap | # This file is part of MyPaint.
# Copyright (C) 2014 by Andrew Chadwick <a.t.chadwick@gmail.com>
#
# 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 ... |
context | pdfContext | import AppKit
import CoreText
import Quartz
from packaging.version import Version
from ..macOSVersion import macOSVersion
from ..misc import DrawBotError, isGIF, isPDF
from .baseContext import BaseContext, FormattedString
from .tools import gifTools
def sendPDFtoPrinter(pdfDocument):
printInfo = AppKit.NSPrintIn... |
gui | task_importer | # --------------------------------------------------------------------------
# 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... |
extractor | motherless | # coding: utf-8
from __future__ import unicode_literals
import datetime
import re
from ..compat import compat_urlparse
from ..utils import (
ExtractorError,
InAdvancePagedList,
orderedSet,
str_to_int,
unified_strdate,
)
from .common import InfoExtractor
class MotherlessIE(InfoExtractor):
_VA... |
extractors | lrts | #!/usr/bin/env python
__all__ = ["lrts_download"]
import logging
from ..common import *
from ..util import log, term
def lrts_download(url, output_dir=".", merge=True, info_only=False, **kwargs):
html = get_html(url)
args = kwargs.get("args")
if not args:
args = {}
matched = re.search(r"/bo... |
forms | links | """ using django model forms """
from urllib.parse import urlparse
from bookwyrm import models
from django.utils.translation import gettext_lazy as _
from .custom_form import CustomForm
# pylint: disable=missing-class-docstring
class LinkDomainForm(CustomForm):
class Meta:
model = models.LinkDomain
... |
tools | dependency_constraints | #!/usr/bin/env python3
"""Enforce ordering of the dependencies.
We generate the dependency order with snakefood.
In this script, we ensure that the expected set of dependencies aren't violated.
"""
__copyright__ = "Copyright (C) 2014-2017 Martin Blais"
__license__ = "GNU GPLv2"
import argparse
import logging
import ... |
StartPage | EnableDownload | # ***************************************************************************
# * Copyright (c) 2012 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
fpr | forms | from django import forms
from django.utils.translation import ugettext_lazy as _
from fpr import models as fprmodels
# ########## FORMATS ############
class FormatForm(forms.ModelForm):
group = forms.ChoiceField(widget=forms.Select(attrs={"class": "form-control"}))
def __init__(self, *args, **kwargs):
... |
session-recordings | session_recording_playlist | import json
from typing import Any, Dict, List, Optional
import structlog
from django.db.models import Q, QuerySet
from django.utils.timezone import now
from django_filters.rest_framework import DjangoFilterBackend
from posthog.api.forbid_destroy_model import ForbidDestroyModel
from posthog.api.routing import Structur... |
posthog | auth | import functools
import re
from datetime import timedelta
from typing import Any, Dict, Optional, Tuple, Union
from urllib.parse import urlsplit
import jwt
from django.apps import apps
from django.contrib.auth.models import AnonymousUser
from django.http import HttpRequest, JsonResponse
from django.utils import timezo... |
extractor | pornovoisines | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import float_or_none, int_or_none, unified_strdate
from .common import InfoExtractor
class PornoVoisinesIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?pornovoisines\.com/videos/show/(?P<id>\d+)/(?P<display_id>[^/.]+)"
_TES... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.