section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
parsers | pinboard_rss | __package__ = "archivebox.parsers"
from datetime import datetime, timezone
from typing import IO, Iterable
from xml.etree import ElementTree
from ..index.schema import Link
from ..util import enforce_types, htmldecode
@enforce_types
def parse_pinboard_rss_export(rss_file: IO[str], **_kwargs) -> Iterable[Link]:
... |
threads | plugin_thread | # -*- coding: utf-8 -*-
import os
import pprint
import time
import traceback
from sys import exc_info
from threading import Thread
from types import MethodType
class PluginThread(Thread):
"""
abstract base class for thread types.
"""
# ----------------------------------------------------------------... |
update | update_firefox_version | #!/usr/bin/env python
import json
import re
from os.path import dirname, join
from urllib.parse import urljoin, urlparse
import requests
from lxml import html
from packaging.version import Version, parse
from searx import searx_dir
URL = "https://ftp.mozilla.org/pub/firefox/releases/"
RELEASE_PATH = "/pub/firefox/re... |
PyObjCTest | test_nsfontmanager | from AppKit import *
from PyObjCTools.TestSupport import *
class TestNSFontManagerHelper(NSObject):
def fontManager_willIncludeFont_(self, m, f):
return 1
class TestNSFontManager(TestCase):
def testConstants(self):
self.assertEqual(NSItalicFontMask, 0x00000001)
self.assertEqual(NSBol... |
sqlite | 20230111 | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2023 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
# Converts ids from binary data to hex-encoded strings
import sqlite3
from uuid import UUID
def process_table(connect... |
client | connection | from contextlib import contextmanager
from enum import Enum
from functools import lru_cache
from clickhouse_driver import Client as SyncClient
from clickhouse_pool import ChPool
from django.conf import settings
class Workload(Enum):
# Default workload
DEFAULT = "DEFAULT"
# Analytics queries, other 'livel... |
extractor | thestar | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class TheStarIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?thestar\.com/(?:[^/]+/)*(?P<id>.+)\.html"
_TEST = {
"url": "http://www.thestar.com/life/2016/02/01/mankind-why-this-woman-started-a-men-s-skincar... |
extractor | uktvplay | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class UKTVPlayIE(InfoExtractor):
_VALID_URL = r"https?://uktvplay\.(?:uktv\.)?co\.uk/(?:.+?\?.*?\bvideo=|([^/]+/)*watch-online/)(?P<id>\d+)"
_TESTS = [
{
"url": "https://uktvplay.uktv.co.uk/shows/wor... |
downloaders | RemixshareCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
#
# Test links:
# http://remixshare.com/download/z8uli
#
# Note:
# The remixshare.com website is very very slow, so
# if your download not starts because of pycurl timeouts:
# Adjust timeouts in /usr/share/pyload/pyload/network/HT... |
PyObjCTest | test_nscomparisonpredicate | from Foundation import *
from PyObjCTools.TestSupport import *
class TestNSComparisonPredicate(TestCase):
def testConstants(self):
self.assertEqual(NSCaseInsensitivePredicateOption, 1)
self.assertEqual(NSDiacriticInsensitivePredicateOption, 2)
self.assertEqual(NSNormalizedPredicateOption, ... |
mp3tag | parse_debug | import codecs
import pdb
from . import Cursor, open_script
dbg_skip = ["ifnot", "do", "while"]
src_skip = ["endif", "do", "while", "ifnot", "else"]
def parse_group(group):
group = group.strip().split("\n")
ret = {}
params = {}
desc = ""
prevout = False
for i, line in enumerate(group):
... |
BasicDrawing | Images | import sys
import DataProvidersAndConsumers
import Quartz
import Utilities
from LaunchServices import * # kUTType* constants
from Quartz import *
def drawJPEGImage(context, url):
# Create a Quartz data provider for the supplied URL.
jpgProvider = CGDataProviderCreateWithURL(url)
if jpgProvider is None:
... |
schemas | topics | from CTFd.models import ChallengeTopics, Topics, ma
from CTFd.utils import string_types
class TopicSchema(ma.ModelSchema):
class Meta:
model = Topics
include_fk = True
dump_only = ("id",)
views = {"admin": ["id", "value"]}
def __init__(self, view=None, *args, **kwargs):
i... |
extractor | allocine | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_str
from ..utils import (
int_or_none,
qualities,
remove_end,
try_get,
unified_timestamp,
url_basename,
)
from .common import InfoExtractor
class AllocineIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.... |
Gui | Profile | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2017 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
extractors | yixia | #!/usr/bin/env python
__all__ = ["yixia_download"]
import re
from json import loads
from urllib.parse import urlparse
from ..common import *
# ----------------------------------------------------------------------
def miaopai_download_by_smid(smid, output_dir=".", merge=True, info_only=False):
""""""
api_e... |
dev | ua_fetch | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Fetch and print the most common user agents.
This script fetches the most common user agents according to
https://github.com/Kikobeats/top-user-agents, and prints the... |
string | titlecase | # Copyright 2007 Javier Kohen
# 2010,2014 Nick Boultbee
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
import u... |
plugins | sellgains | """A plugin that cross-checks declared gains against prices on lot sales.
When you sell stock, the gains can be automatically implied by the corresponding
cash amounts. For example, in the following transaction the 2nd and 3rd postings
should match the value of the stock sold:
1999-07-31 * "Sell"
Assets:US:... |
data | brainmesh_handler | import invesalius.data.slice_ as sl
import invesalius.data.vtk_utils as vtk_utils
import numpy as np
import pyacvd
# import os
import pyvista
from invesalius.data.converters import to_vtk
from vtkmodules.vtkCommonColor import vtkColorSeries, vtkNamedColors
# import Trekker
from vtkmodules.vtkCommonCore import vtkFloa... |
group | util | import datetime
import json
from typing import Dict, Optional, Union
from zoneinfo import ZoneInfo
from dateutil.parser import isoparse
from django.utils.timezone import now
from posthog.kafka_client.client import ClickhouseProducer
from posthog.kafka_client.topics import KAFKA_GROUPS
from posthog.models.filters.utils... |
extractor | sztvhu | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class SztvHuIE(InfoExtractor):
_VALID_URL = r"https?://(?:(?:www\.)?sztv\.hu|www\.tvszombathely\.hu)/(?:[^/]+)/.+-(?P<id>[0-9]+)"
_TEST = {
"url": "http://sztv.hu/hirek/cserkeszek-nepszerusitettek-a-kornyezettud... |
projectedFit | changeState | import wx
from gui.fitCommands.helpers import restoreCheckedStates
from logbook import Logger
from service.fit import Fit
pyfalog = Logger(__name__)
class CalcChangeProjectedFitStateCommand(wx.Command):
def __init__(self, fitID, projectedFitID, state):
wx.Command.__init__(self, True, "Change Projected Fi... |
CloudSync | CloudApiClient | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from cura.CuraApplication import CuraApplication
from cura.UltimakerCloud.UltimakerCloudScope import UltimakerCloudScope
from UM.Logger import Logger
from UM.TaskManagement.HttpRequestManager import HttpRequestManager
from ... |
extractor | ctv | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class CTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?ctv\.ca/(?P<id>(?:show|movie)s/[^/]+/[^/?#&]+)"
_TESTS = [
{
"url": "https://www.ctv.ca/shows/your-morning/wednesday-december-23-2020-s5e... |
Test | TestContent | import io
import json
import time
import pytest
from Content.ContentManager import SignError, VerifyError
from Crypt import CryptBitcoin
from util.SafeRe import UnsafePatternError
@pytest.mark.usefixtures("resetSettings")
class TestContent:
privatekey = "5KUh3PvNm5HUWoCfSUfcYvfQ2g3PrRNJWr6Q9eqdBGu23mtMntv"
... |
image-processor | imageprocessor | # from app.object_detection import visualization_utils as vis_util
import logging
import os
import tarfile
from pathlib import Path
import click
import numpy as np
import six.moves.urllib as urllib
import tensorflow as tf
from app.object_detection import label_map_util
from PIL import Image
root = Path(__file__).pare... |
core | balanced_positive_negative_sampler | # 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... |
lib | filters | # 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, ... |
migrations | 0147_plugin_logs | # Generated by Django 3.1.8 on 2021-04-26 10:59
import django.db.models.deletion
import django.utils.timezone
import posthog.models.utils
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0146_eventproperty_sync"),
]
operations = [
... |
extractor | discoverygo | from __future__ import unicode_literals
import re
from ..utils import (
ExtractorError,
determine_ext,
extract_attributes,
int_or_none,
parse_age_limit,
remove_end,
unescapeHTML,
url_or_none,
)
from .common import InfoExtractor
class DiscoveryGoBaseIE(InfoExtractor):
_VALID_URL_T... |
comictaggerlib | issueselectionwindow | """A PyQT4 dialog to select specific issue from list"""
# Copyright 2012-2014 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0... |
picard | pluginmanager | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2007 Lukáš Lalinský
# Copyright (C) 2014 Shadab Zafar
# Copyright (C) 2015-2021 Laurent Monin
# Copyright (C) 2019 Wieland Hoffmann
# Copyright (C) 2019-2020, 2022-2023 Philipp Wolfer
# Copyright (C) 2023 Bob Swift
#
# This pro... |
PyObjCTest | test_nsxmlnode | from Foundation import *
from PyObjCTools.TestSupport import *
class TestXMLNode(TestCase):
def testConstants(self):
self.assertEqual(NSXMLInvalidKind, 0)
self.assertEqual(NSXMLDocumentKind, 1)
self.assertEqual(NSXMLElementKind, 2)
self.assertEqual(NSXMLAttributeKind, 3)
se... |
utilities | utilities | """
This module mainly provides validation and correction for urls. This class
provides a method for HTTP GET requests as well as a function to translate peers into health.
Author(s): Jie Yang
"""
import binascii
import itertools
import logging
import os
import platform
import random
import re
import sys
import threadi... |
downloaders | AndroidfilehostCom | # -*- coding: utf-8 -*
import re
import pycurl
from ..base.simple_downloader import SimpleDownloader
class AndroidfilehostCom(SimpleDownloader):
__name__ = "AndroidfilehostCom"
__type__ = "downloader"
__version__ = "0.07"
__status__ = "testing"
__pattern__ = r"https?://(?:www\.)?androidfilehos... |
builders | post_processing_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... |
Gui | Inspect | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2015 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This file is part of the FreeCAD CAx development system.... |
comictaggerlib | logwindow | """A PyQT4 dialog to a text file or log"""
# Copyright 2012-2014 Anthony Beville
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless re... |
requests | utils | # -*- coding: utf-8 -*-
"""
requests.utils
~~~~~~~~~~~~~~
This module provides utility functions that are used within Requests
that are also useful for external consumption.
"""
import cgi
import codecs
import collections
import io
import os
import platform
import re
import socket
import struct
import sys
import wa... |
nyaa | search | import math
import re
import shlex
import threading
import time
import flask
import sqlalchemy
import sqlalchemy_fulltext.modes as FullTextMode
from elasticsearch import Elasticsearch
from elasticsearch_dsl import Q, Search
from flask_sqlalchemy import Pagination
from nyaa import models
from nyaa.extensions import db
... |
base | tasks | from apps.base.models import FailedToInvokeCeleryTask
from common.custom_celery_tasks import shared_dedicated_queue_retry_task
from common.utils import batch_queryset
from django.db import transaction
@shared_dedicated_queue_retry_task
def process_failed_to_invoke_celery_tasks():
task_pks = FailedToInvokeCeleryTa... |
extractor | mtv | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str, compat_xpath
from ..utils import (
ExtractorError,
HEADRequest,
RegexNotFoundError,
find_xpath_attr,
fix_xml_ampersands,
float_or_none,
sanitized_Request,
strip_or_none,
timeconvert,
... |
aliceVision | ImageMasking | __version__ = "3.0"
from meshroom.core import desc
class ImageMasking(desc.AVCommandLineNode):
commandLine = "aliceVision_imageMasking {allParams}"
size = desc.DynamicNodeSize("input")
parallelization = desc.Parallelization(blockSize=40)
commandLineRange = "--rangeStart {rangeStart} --rangeSize {rang... |
extractor | litv | # coding: utf-8
from __future__ import unicode_literals
import json
from ..utils import ExtractorError, int_or_none, smuggle_url, unsmuggle_url
from .common import InfoExtractor
class LiTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?litv\.tv/(?:vod|promo)/[^/]+/(?:content\.do)?\?.*?\b(?:content_)?id=(?P... |
mystran | solver | # ***************************************************************************
# * Copyright (c) 2021 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
radio-crawler | fetch_xiph | #!/usr/bin/env python2
# Copyright 2014 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from __futur... |
sgui | updates | from sglib.lib.updates import check_for_updates
from sglib.log import LOG
from . import shared
from .sgqt import QDesktopServices, QMessageBox, QtCore
TIMER = None
def ui_check_updates():
def go_to_releases_page():
global TIMER
url = QtCore.QUrl(
"https://github.com/stargatedaw/starg... |
versions | 058_bd36d1826a5d_add_follower_tables | # encoding: utf-8
"""058 Add follower tables
Revision ID: bd36d1826a5d
Revises: 660a5aae527e
Create Date: 2018-09-04 18:49:08.908624
"""
import sqlalchemy as sa
from alembic import op
from ckan.migration import skip_based_on_legacy_engine_version
# revision identifiers, used by Alembic.
revision = "bd36d1826a5d"
dow... |
femmesh | meshtools | # ***************************************************************************
# * *
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * Th... |
ui | modelbrowser | from __future__ import annotations
from gaphor import UML
from gaphor.abc import ActionProvider
from gaphor.action import action
from gaphor.core import event_handler
from gaphor.core.modeling import (
DerivedAdded,
DerivedDeleted,
DerivedSet,
Diagram,
Element,
ElementCreated,
ElementDelete... |
engines | wolframalpha_api | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wolfram|Alpha (Science)
"""
from urllib.parse import urlencode
from lxml import etree
# about
about = {
"website": "https://www.wolframalpha.com",
"wikidata_id": "Q207006",
"official_api_documentation": "https://products.wolframalpha.com/api/",
"use_o... |
mail | asm | class ASM(object):
"""An object specifying unsubscribe behavior."""
def __init__(self, group_id=None, groups_to_display=None):
"""Create an ASM with the given group_id and groups_to_display.
:param group_id: ID of an unsubscribe group
:type group_id: int, optional
:param groups... |
heartbeat | elastalert | from pathlib import PurePath
from apps.integrations.metadata.heartbeat._heartbeat_text_creator import (
HeartBeatTextCreator,
)
integration_verbal = PurePath(__file__).stem
creator = HeartBeatTextCreator(integration_verbal)
heartbeat_text = creator.get_heartbeat_texts()
heartbeat_expired_title = heartbeat_text.h... |
streamlink | session | import logging
import pkgutil
import warnings
from functools import lru_cache
from socket import AF_INET, AF_INET6
from typing import Any, Callable, ClassVar, Dict, Iterator, Mapping, Optional, Tuple, Type
import urllib3.util.connection as urllib3_util_connection
from requests.adapters import HTTPAdapter
from streamli... |
lib | inventory_optimization | # The contents of this file are subject to the Common Public Attribution
# License Version 1.0. (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://code.reddit.com/LICENSE. The License is based on the Mozilla Public
# License Version 1.1, ... |
PyObjCTest | test_specialtypecodes_unichar | """
Test handling of the private typecodes: _C_UNICHAR
This typecode doesn't actually exists in the ObjC runtime but
are private to PyObjC. We use these to simplify the bridge code
while at the same time getting a higher fidelity bridge.
- Add tests for calling methods from ObjC
"""
from __future__ import unicode_li... |
ofdm | transmit_path | #
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import copy
import sys
from gnuradio import blocks, digital, eng_notation, gr
# /////////////////////////////////////////////////////////////////////////////
# ... |
cmd | on_server | from __future__ import absolute_import
import os
import struct
import sys
from bup import helpers, options, path
from bup.compat import environ
from bup.io import byte_stream
optspec = """
bup on--server
--
This command is run automatically by 'bup on'
"""
def main(argv):
o = options.Options(optspec)
o... |
mylar | db | # 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... |
TemplatePyMod | TaskPanel | # FreeCAD TemplatePyMod module
# (c) 2011 Werner Mayer LGPL
import FreeCAD as App
import FreeCADGui as Gui
from PySide import QtCore, QtGui
class MyLineEdit(QtGui.QLineEdit):
pass
class TaskWatcher:
def __init__(self):
self.commands = ["Part_Box", "Part_Sphere", "Part_Cylinder"]
self.title ... |
rights | load | """Import ``PREMISRights``.
Similar to ``rights_from_csv`` in that it imports rights statements. In this
module, we load a ``premisrw.PREMISRights`` object into the database.
This module does not use the ``__`` notation for accessors offered by
``premisrw``.
"""
from components.helpers import get_metadata_type_id_by_... |
backends | portmidi | """
Input and Output ports for PortMidi.
There is no need to use this module directly. All you need is
available in the toplevel module.
PortMidi documentation:
http://portmedia.sourceforge.net/portmidi/doxygen/
"""
import threading
from ..ports import BaseInput, BaseOutput, sleep
from . import portmidi_init as pm
... |
fitEcmBurstScanresDamps | getter | # =============================================================================
# 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 ... |
ingest | forms | # 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, either version 3 of the ... |
serializers | integration_heartbeat | import humanize
from apps.alerts.models import AlertReceiveChannel
from apps.heartbeat.models import IntegrationHeartBeat
from common.api_helpers.custom_fields import OrganizationFilteredPrimaryKeyRelatedField
from common.api_helpers.mixins import EagerLoadingMixin
from django.utils import timezone
from rest_framework ... |
blocks | block | """
Copyright 2008-2020 Free Software Foundation, Inc.
Copyright 2021 GNU Radio contributors
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import ast
import collections
import copy
import itertools
import re
from ..base import Element
from ..utils.descriptors import lazy_property
fro... |
v0 | FFImageServer | # -*- coding: utf-8 -*-
# This is an attempt to reproduce Firefox Bug 583351
# Firefox sends GET request twice to server for a dynamically-generated small PNG image
# https://bugzilla.mozilla.org/show_bug.cgi?id=583351
# Despite replicating a known trigger page for this bug
# as closely as possibly, the bug is not rep... |
pytz | exceptions | """
Custom exceptions raised by pytz.
"""
__all__ = [
"UnknownTimeZoneError",
"InvalidTimeError",
"AmbiguousTimeError",
"NonExistentTimeError",
]
class UnknownTimeZoneError(KeyError):
"""Exception raised when pytz is passed an unknown timezone.
>>> isinstance(UnknownTimeZoneError(), LookupEr... |
extractor | applepodcasts | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
clean_html,
clean_podcast_url,
get_element_by_class,
int_or_none,
parse_codecs,
parse_iso8601,
try_get,
)
from .common import InfoExtractor
class ApplePodcastsIE(InfoExtractor):
_VALID_URL = r"https?://podca... |
tunnel-community | speed_test_e2e | import argparse
import os
from binascii import unhexlify
from pathlib import Path
from ipv8.messaging.anonymization.tunnel import EXIT_NODE, ORIGINATOR
from ipv8.taskmanager import task
from scripts.experiments.tunnel_community.speed_test_exit import (
EXPERIMENT_NUM_CIRCUITS,
EXPERIMENT_NUM_HOPS,
)
from scrip... |
Code | Washing | import datetime
import os
import random
from Code import PGNreader, Util
INACTIVE, CREATING, REPLAY, TACTICS, ENDED = range(5)
class WLine:
def __init__(self):
self.fen = None
self.label = None
self.pgn = None
self.num_moves = 0
self.pv = None
self.limoves = None
... |
usecases | actor | """Actor item classes."""
from math import pi
from gaphas.constraint import constraint
from gaphas.geometry import distance_line_point
from gaphas.item import SE, SW
from gaphas.port import LinePort
from gaphas.position import Position
from gaphas.solver import REQUIRED, STRONG, variable
from gaphor import UML
from g... |
fonts | dialog | # 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
... |
filter | qa_fir_filter | #!/usr/bin/env python
#
# Copyright 2008,2010,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, filter, gr, gr_unittest
def fir_filter(x, taps, decim=1):
y = []
x2 = (len(taps) - 1) * [
0,
] ... |
fitRemoteReps | cache | # =============================================================================
# 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 ... |
models | gold | # 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, ... |
plugins | sbscokr | """
$description Live TV channels from SBS, a South Korean public broadcaster.
$url www.sbs.co.kr/live
$type live
$metadata id
$metadata author
$metadata title
$region South Korea
"""
import argparse
import logging
import re
from streamlink.plugin import Plugin, pluginargument, pluginmatcher
from streamlink.plugin.ap... |
Tool | Bit | # -*- coding: utf-8 -*-
# ***************************************************************************
# * Copyright (c) 2019 sliptonic <shopinthewoods@gmail.com> *
# * *
# * This program is free software; you can redistribute it a... |
notifier | smtp | import functools
import logging
from smtplib import SMTP
import six
from ..compat import SMTPNotSupportedError
from ..conf import settings
logger = logging.getLogger(__name__)
def notify_factory(conf, value):
@functools.wraps(notify)
def baked_notify(report):
return notify(
conf=conf,
... |
PyObjCTest | test_ikpicturetaker | from PyObjCTools.TestSupport import *
from Quartz import *
try:
unicode
except NameError:
unicode = str
class TestIKPictureTaker(TestCase):
@min_os_level("10.5")
def testMethods(self):
self.assertArgIsSEL(
IKPictureTaker.beginPictureTakerWithDelegate_didEndSelector_contextInfo_,
... |
workflows | bigquery_batch_export | import contextlib
import datetime as dt
import json
from dataclasses import dataclass
from django.conf import settings
from google.cloud import bigquery
from google.oauth2 import service_account
from posthog.batch_exports.service import BigQueryBatchExportInputs
from posthog.temporal.workflows.base import PostHogWorkf... |
engines | arxiv | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
ArXiV (Scientific preprints)
"""
from datetime import datetime
from lxml import html
from searx.utils import eval_xpath_getindex, eval_xpath_list
# about
about = {
"website": "https://arxiv.org",
"wikidata_id": "Q118398",
"official_api_documentation": "ht... |
deposit | declaration | import io
import logging
import os
import subprocess
from datetime import date
from tempfile import NamedTemporaryFile
from deposit.models import UserPreferences
from django.conf import settings
from django.utils.formats import date_format
from fdfgen import forge_fdf
from papers.models import Researcher
logger = log... |
extractor | hearthisat | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_urlparse
from ..utils import (
KNOWN_EXTENSIONS,
HEADRequest,
sanitized_Request,
str_to_int,
urlencode_postdata,
urlhandle_detect_ext,
)
from .common import InfoExtractor
class HearThisAtIE(InfoExtr... |
digital | psk | #
# Copyright 2005,2006,2011 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
"""
PSK modulation and demodulation.
"""
from cmath import exp
from math import log, pi
from . import digital_python, modulation_utils
from .generic_mod_demod import (
... |
sql | session_recording_event_sql | from django.conf import settings
from posthog.clickhouse.indexes import index_by_kafka_timestamp
from posthog.clickhouse.kafka_engine import KAFKA_COLUMNS, kafka_engine, ttl_period
from posthog.clickhouse.table_engines import (
Distributed,
ReplacingMergeTree,
ReplicationScheme,
)
from posthog.kafka_client.... |
engines | onesearch | """Onesearch
"""
import re
from urllib.parse import unquote
from lxml.html import fromstring
from searx.utils import eval_xpath, extract_text
# about
about = {
"website": "https://www.onesearch.com/",
"wikidata_id": None,
"use_official_api": False,
"require_api_key": False,
"results": "HTML",
}
... |
Robot | Init | # FreeCAD init script of the Robot module
# (c) 2001 Juergen Riegel
# ***************************************************************************
# * Copyright (c) 2002 Juergen Riegel <juergen.riegel@web.de> *
# * *
# * This file i... |
PyObjCTest | test_qlpreviewpanel | import objc
from Foundation import NSObject
from PyObjCTools.TestSupport import *
try:
from Quartz import *
except ImportError:
pass
class TestQLPreviewPanelHelper(NSObject):
def acceptsPreviewPanelControl_(self, panel):
return 1
def previewPanel_handleEvent_(self, panel, event):
ret... |
MusicPlayer | build_copyScript | #!/usr/bin/python
# build-copyScript.py
# MusicPlayer
#
# Created by Albert Zeyer on 21.08.12.
# Copyright (c) 2012 Albert Zeyer. All rights reserved.
import os
import re
import shutil
import sys
from glob import glob
from pprint import pprint
from subprocess import PIPE, Popen
env = os.environ
cp = shutil.copyf... |
PyObjCTest | test_cvbase | from PyObjCTools.TestSupport import *
from Quartz import *
try:
long
except NameError:
long = int
class TestCVBase(TestCase):
def testStructs(self):
v = CVSMPTETime()
self.assertIsInstance(v.subframes, (int, long))
self.assertIsInstance(v.subframeDivisor, (int, long))
self... |
providers | provider | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2014-2015, 2018-2019, 2021 Laurent Monin
# Copyright (C) 2015 Rahul Raturi
# Copyright (C) 2016 Ville Skyttä
# Copyright (C) 2016 Wieland Hoffmann
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2019-2020 Philipp Wolfer
#
... |
fiwalk-plugins | pronom_ident | #!/usr/bin/env python
"""
pronom-ident.py - Identify a bitstream against PRONOM; uses fido
"""
# https://github.com/anarchivist/fiwalk-dgi/blob/master/python/pronom_ident.py
# Author anarchivist
import os
import sys
import time
from optparse import OptionParser
from fido import fido
class FiwalkFido(fido.Fido):
... |
plugins | blanket | # -*- coding: utf-8 -*-
"""Quick implementations of simple plugin interfaces.
Blankets allow to reduce boilerplate code in plugins by simplifying the way
common interfaces are registered.
For instance, this is how template helpers are generally added using the
:py:class:`~ckan.plugins.interfaces.ITemplateHelpers` int... |
extractor | discoveryvr | # coding: utf-8
from __future__ import unicode_literals
from ..utils import parse_duration
from .common import InfoExtractor
class DiscoveryVRIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?discoveryvr\.com/watch/(?P<id>[^/?#]+)"
_TEST = {
"url": "http://www.discoveryvr.com/watch/discovery-vr-an... |
core | torrent | #
# Copyright (C) 2007-2009 Andrew Resch <andrewresch@gmail.com>
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
"""Internal Torrent class... |
controllers | select_ctrl | # -*- 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.... |
extractor | pornhub | # coding: utf-8
from __future__ import unicode_literals
import functools
import itertools
import operator
import re
from ..compat import compat_HTTPError, compat_str, compat_urllib_request
from ..utils import (
NO_DEFAULT,
ExtractorError,
determine_ext,
int_or_none,
merge_dicts,
orderedSet,
... |
colors | adjbases | # This file is part of MyPaint.
# Copyright (C) 2012-2018 by the MyPaint Development Team.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.