section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
Test | TestWeb | import urllib.request
import pytest
try:
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.support.expected_conditions import staleness_of, title_is
from selenium.webdriver.support.ui import WebDriverWait
except:
pass
class WaitForPageLoad(object):
def __init_... |
PyObjCTools | FndCategories | """
A number of usefull categories on Foundation classes
"""
__all__ = ()
import objc
from Foundation import NSAffineTransform
class NSAffineTransform(objc.Category(NSAffineTransform)):
def rotateByDegrees_atPoint_(self, angle, point):
"""
Rotate the coordinatespace ``angle`` degrees around
... |
core | graph | from __future__ import print_function
import json
import logging
import os
import re
import weakref
from collections import OrderedDict, defaultdict
from contextlib import contextmanager
from enum import Enum
import meshroom
import meshroom.core
from meshroom.common import BaseObject, DictModel, Property, Signal, Slo... |
portfolios | views_pages | #
# Quru Image Server
#
# Document: views_pages.py
# Date started: 09 Mar 2018
# By: Matt Fozard
# Purpose: Portfolio viewing and management pages
# Requires: Flask
# Copyright: Quru Ltd (www.quru.com)
# Licence:
#
# This program is free software: you can redistribute it and/or modify
... |
example-ipermissionlabels | plugin | # encoding: utf-8
from __future__ import annotations
from typing import Any
from ckan import plugins
from ckan.lib.plugins import DefaultPermissionLabels
from ckan.plugins.toolkit import get_action
class ExampleIPermissionLabelsPlugin(plugins.SingletonPlugin, DefaultPermissionLabels):
"""
Example permission... |
lib | auth_basic | # This file is part of CherryPy <http://www.cherrypy.org/>
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:expandtab:fileencoding=utf-8
__doc__ = """This module provides a CherryPy 3.x tool which implements
the server-side of HTTP Basic Access Authentication, as described in
:rfc:`2617`.
Example usage, using the built-in che... |
neubot | api_results | # neubot/api_results.py
#
# Copyright (c) 2012-2013
# Nexa Center for Internet & Society, Politecnico di Torino (DAUIN)
# and Simone Basso <bassosimone@gmail.com>
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of... |
mylar | helpers | # This file is part of Mylar.
# -*- coding: utf-8 -*-
#
# 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 dist... |
migrations | 0213_deprecated_old_tags | # Generated by Django 3.2.5 on 2022-02-17 18:11
import django.contrib.postgres.fields
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0212_alter_persondistinctid_team"),
]
operations = [
migrat... |
widgets | peak_meter | from sglib.lib import util
from sglib.lib.translate import _
from sglib.math import clip_min, lin_to_db
from sglib.models import theme
from sgui.sgqt import *
PEAK_GRADIENT_CACHE = {}
def peak_meter_gradient(a_height):
if a_height not in PEAK_GRADIENT_CACHE:
f_gradient = QLinearGradient(0.0, 0.0, 0.0, a_... |
widgets | popup_menu | import os
from random import choice
from gi.repository import Gdk, Gio, Gtk
from sunflower.plugin_base.monitor import MonitorSignals
class PopupMenu:
"""Popup menu with path related functions."""
def __init__(self, application, plugin):
self._application = application
self._provider = None
... |
keyinput | keyutils | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Our own QKeySequence-like class and related utilities.
Note that Qt's type safety (or rather, lack thereof) is somewhat scary when it
comes to keys/modifiers. Many places (such as QKeyEvent:... |
models | feature_map_generators_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... |
src | SongEdit | # -*- coding: utf-8 -*-
# MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2012, 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 gui
import Traits
import utils
from utils import Event, Us... |
QT | WBG_Tree | import collections
from Code import TrListas
from Code.Constantes import *
from Code.QT import (
Controles,
FormLayout,
Iconos,
PantallaColores,
QTUtil,
QTUtil2,
QTVarios,
WBG_Comun,
)
from PyQt4 import QtCore, QtGui
SIN_VALORACION, MUY_MALO, MALO, BUENO, MUY_BUENO, INTERESANTE, DUDOSA... |
engine | conftest | import datetime
import json
import os
import sys
import typing
import uuid
from importlib import import_module, reload
import pytest
from apps.alerts.models import (
Alert,
AlertGroupLogRecord,
AlertReceiveChannel,
MaintainableObject,
ResolutionNote,
listen_for_alertgrouplogrecord,
listen_f... |
dev | change_release | #!/usr/bin/env python3
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Change a description of a GitHub release."""
import argparse
import os.path
import sys
import github3
import github3.exceptions
class Error(Exception):
"""Rai... |
gpodder | sync | # -*- 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... |
constructors | time_helpers | # NOTE: t must be INT!!!
import datetime
import time
import warnings
try:
from tzlocal import get_localzone
LOCAL_ZONE = get_localzone()
except: # except all problems...
warnings.warn(
"Please install or fix tzlocal library (pip install tzlocal) in order to make Date object work better. Otherwise... |
mylar | PostProcessor | # This file is part of Mylar.
#
# Mylar is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Mylar is distributed in the hope that... |
extractor | fivetv | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none
from .common import InfoExtractor
class FiveTVIE(InfoExtractor):
_VALID_URL = r"""(?x)
https?://
(?:www\.)?5-tv\.ru/
(?:
... |
searx | external_urls | import math
from searx.data import EXTERNAL_URLS
IMDB_PREFIX_TO_URL_ID = {
"tt": "imdb_title",
"mn": "imdb_name",
"ch": "imdb_character",
"co": "imdb_company",
"ev": "imdb_event",
}
HTTP_WIKIMEDIA_IMAGE = "http://commons.wikimedia.org/wiki/Special:FilePath/"
def get_imdb_url_id(imdb_item_id):
... |
mopidy | zeroconf | import logging
import string
from typing import Optional
logger = logging.getLogger(__name__)
try:
import dbus # pyright: ignore[reportMissingImports]
except ImportError:
dbus = None
_AVAHI_IF_UNSPEC = -1
_AVAHI_PROTO_UNSPEC = -1
_AVAHI_PUBLISHFLAGS_NONE = 0
def _is_loopback_address(host: str) -> bool:
... |
models | printable | # 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, ... |
tasks | plugins | import argparse
import os
import re
import shutil
import textwrap
from collections import defaultdict
from contextlib import suppress
from pathlib import Path
from typing import List, Optional, Tuple
from httpie.compat import get_dist_name, importlib_metadata
from httpie.context import Environment
from httpie.manager.... |
frontend | user | # This file is part of Supysonic.
# Supysonic is a Python implementation of the Subsonic server API.
#
# Copyright (C) 2013-2023 Alban 'spl0k' Féron
#
# Distributed under terms of the GNU AGPLv3 license.
import logging
from functools import wraps
from flask import (
current_app,
flash,
redirect,
rende... |
CTFd | config | import configparser
import os
from distutils.util import strtobool
from typing import Union
from sqlalchemy.engine.url import URL
class EnvInterpolation(configparser.BasicInterpolation):
"""Interpolation which expands environment variables in values."""
def before_get(self, parser, section, option, value, d... |
shared | patterns | from collections import OrderedDict
from itertools import chain
# noinspection PyPackageRequirements
import wx
from gui.utils.sorter import smartSort
from service.damagePattern import DamagePattern as DmgPatternSvc
_t = wx.GetTranslation
class DamagePatternMixin:
def _getPatterns(self):
sDP = DmgPattern... |
migrations | 0018_auto_20211017_2136 | # Generated by Django 3.2.7 on 2021-10-17 21:36
import datetime
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("babybuddy", "0017_settings_hide_age"),
]
operations = [
migrations.AlterField(
model_name="settings",
... |
extractor | tiktok | # coding: utf-8
from __future__ import unicode_literals
from ..utils import (
ExtractorError,
compat_str,
float_or_none,
int_or_none,
str_or_none,
try_get,
url_or_none,
)
from .common import InfoExtractor
class TikTokBaseIE(InfoExtractor):
def _extract_video(self, data, video_id=None)... |
extractor | watchbox | # coding: utf-8
from __future__ import unicode_literals
import re
from ..compat import compat_str
from ..utils import (
int_or_none,
js_to_json,
strip_or_none,
try_get,
unescapeHTML,
unified_timestamp,
)
from .common import InfoExtractor
class WatchBoxIE(InfoExtractor):
_VALID_URL = r"ht... |
migrations | 0078_auto_20200731_1323 | # Generated by Django 3.0.7 on 2020-07-31 13:23
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0077_cohortpeople_id_to_bigautofield"),
]
operations = [
migrati... |
qltk | exfalsowindow | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
#
# 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.
impor... |
storage | storage | """Load and save Gaphor models to Gaphors own XML format.
Three functions are exported: `load(file_obj)`loads a model from a
file. `save(file_obj)` stores the current model in a file.
"""
__all__ = ["load", "save"]
import io
import logging
from functools import partial
from typing import Callable, Iterable
from gap... |
Code | GM | import operator
import os
from Code import Jugada, Util, VarGen
from LCEngine4 import pv2xpv, xpv2pv
class GMpartida:
def __init__(self, linea):
(
self.xpv,
self.event,
self.oponent,
self.date,
self.opening,
self.result,
... |
httpie | context | import argparse
import os
import sys
import warnings
from contextlib import contextmanager
from enum import Enum
from pathlib import Path
from typing import IO, TYPE_CHECKING, Iterator, Optional
try:
import curses
except ImportError:
curses = None # Compiled w/o curses
from .compat import cached_property, is... |
trust-calculation | trust_graph | import hashlib
import logging
import math
import networkx as nx
from tribler.core.components.bandwidth_accounting.trust_calculation.graph_positioning import (
GraphPositioning,
)
from tribler.core.exceptions import TrustGraphException
from tribler.core.utilities.unicode import hexlify
MAX_NODES = 500
MAX_TRANSACT... |
scripts | rpm | #!/usr/bin/python3 -B
"""
This file is part of the Stargate project, Copyright Stargate 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; version 3 of the License.
This program is distributed in ... |
bs4 | dammit | # -*- coding: utf-8 -*-
"""Beautiful Soup bonus library: Unicode, Dammit
This library converts a bytestream to Unicode through any means
necessary. It is heavily based on code from Mark Pilgrim's Universal
Feed Parser. It works best on XML and HTML, but it does not rewrite the
XML or HTML to reflect a new encoding; th... |
widgets | notebook | # Copyright (C) 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 it w... |
draftgeoutils | general | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * *
# * Th... |
model | folder | # Copyright (C) 2011 Chris Dekter
# Copyright (C) 2019-2020 Thomas Hess <thomas.hess@udo.edu>
#
# 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 opt... |
nfoview | actions | # -*- coding: utf-8 -*-
# Copyright (C) 2015 Osmo Salomaa
#
# 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 pr... |
nyaa | backend | import json
import os
import re
from datetime import datetime, timedelta
from ipaddress import ip_address
import flask
import sqlalchemy
from nyaa import models, utils
from nyaa.extensions import db
from orderedset import OrderedSet
from werkzeug import secure_filename
app = flask.current_app
# Blacklists for _valid... |
downloaders | BezvadataCz | # -*- coding: utf-8 -*-
import base64
import re
from datetime import timedelta
from ..base.simple_downloader import SimpleDownloader
class BezvadataCz(SimpleDownloader):
__name__ = "BezvadataCz"
__type__ = "downloader"
__version__ = "0.35"
__status__ = "testing"
__pattern__ = r"http://(?:www\.)... |
api | feature_flag_role_access | from ee.api.role import RoleSerializer
from ee.models.feature_flag_role_access import FeatureFlagRoleAccess
from ee.models.organization_resource_access import OrganizationResourceAccess
from ee.models.role import Role
from posthog.api.feature_flag import FeatureFlagSerializer
from posthog.api.routing import StructuredV... |
extractor | webofstories | # coding: utf-8
from __future__ import unicode_literals
import re
from ..utils import int_or_none, orderedSet
from .common import InfoExtractor
class WebOfStoriesIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?webofstories\.com/play/(?:[^/]+/)?(?P<id>[0-9]+)"
_VIDEO_DOMAIN = "http://eu-mobile.webofstor... |
database | main | # neubot/database/main.py
#
# Copyright (c) 2011 Simone Basso <bassosimone@gmail.com>,
# NEXA Center for Internet & Society at Politecnico di Torino
#
# This file is part of Neubot <http://www.neubot.org/>.
#
# Neubot is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Publ... |
tornado | conn | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
"""
sockjs.tornado.conn
~~~~~~~~~~~~~~~~~~~
SockJS connection interface
"""
class SockJSConnection(object):
def __init__(self, session):
"""Connection constructor.
`session`
... |
utils | exportHtml | import threading
import time
# noinspection PyPackageRequirements
import wx
from eos.db import getFit
from logbook import Logger
from service.const import PortEftOptions
from service.fit import Fit
from service.market import Market
from service.port import Port
from service.settings import HTMLExportSettings
pyfalog ... |
deep-learning | model | from collections import OrderedDict
import torch
import torch.nn as nn
SIZE = 48
class Unet3D(nn.Module):
# Based on https://github.com/mateuszbuda/brain-segmentation-pytorch/blob/master/unet.py
def __init__(self, in_channels=1, out_channels=1, init_features=8):
super().__init__()
features =... |
downloaders | FilepupNet | # -*- coding: utf-8 -*-
#
# Test links:
# http://www.filepup.net/files/k5w4ZVoF1410184283.html
# http://www.filepup.net/files/R4GBq9XH1410186553.html
import re
from ..base.simple_downloader import SimpleDownloader
class FilepupNet(SimpleDownloader):
__name__ = "FilepupNet"
__type__ = "downloader"
__ver... |
qltk | wlw | # Copyright 2005 Joe Wreschnig, Michael Urman
# 2016 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 ve... |
tools | pull_shared_translations | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2023 Philipp Wolfer
#
# 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 ve... |
escalation-snapshot | utils | import datetime
import typing
import pytz
from django.utils import timezone
def eta_for_escalation_step_notify_if_time(
from_time: datetime.time, to_time: datetime.time
) -> typing.Optional[datetime.datetime]:
"""
Counts eta for STEP_NOTIFY_IF_TIME
"""
eta: typing.Optional[datetime.datetime] = No... |
utils | kronos | #!/usr/bin/python3
"""Module that provides a cron-like task scheduler.
This task scheduler is designed to be used from inside your own program.
You can schedule Python functions to be called at specific intervals or
days. It uses the standard 'sched' module for the actual task scheduling,
but provides much more:
* re... |
Spreadsheet | InitGui | # ***************************************************************************
# * Copyright (c) 2002,2003 Juergen Riegel <juergen.riegel@web.de> *
# * Copyright (c) 2013 Eivind Kvedalen <eivind@kvedalen.name> *
# * *
# * Th... |
localModuleCargo | cargoToLocalModule | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.cargo.add import CalcAddCargoCommand
from gui.fitCommands.calc.cargo.remove import CalcRemoveCargoCommand
from gui.fitCommands.calc.module.changeCharges import CalcChangeModuleChargesCommand
from gui.fitCommands.ca... |
dev | run_vulture | #!/usr/bin/env python
# SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Run vulture on the source files and filter out false-positives."""
import argparse
import inspect
import os
import re
import sys
import tempfile
import qutebrowser.a... |
versions | 500117641608_add_bans | """Add bans table
Revision ID: 500117641608
Revises: b79d2fcafd88
Create Date: 2017-08-17 01:44:39.205126
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "500117641608"
down_revision = "b79d2fcafd88"
branch_labels = None
depends_on = None
def upgrade():
op... |
email | alert_rendering | from apps.alerts.incident_appearance.renderers.constants import DEFAULT_BACKUP_TITLE
from apps.alerts.incident_appearance.templaters.alert_templater import AlertTemplater
from common.utils import convert_md_to_html, str_or_backup
from django.template.loader import render_to_string
from emoji.core import emojize
class... |
core | region_similarity_calculator | # 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... |
readers | read_epub | # 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... |
plugins | unique_prices_test | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import unittest
from beancount import loader
from beancount.parser import cmptest
from beancount.plugins import implicit_prices, unique_prices
class TestValidateAmbiguousPrices(cmptest.TestCase):
@loader.load_doc()
def test_va... |
plugins | menu_qrcode | # -*- coding: utf-8 -*-
"""
A menu plugin showing QR-Code for bitmessage address in modal dialog.
"""
import urllib
import qrcode
from pybitmessage.tr import _translate
from PyQt4 import QtCore, QtGui
# http://stackoverflow.com/questions/20452486
class Image(qrcode.image.base.BaseImage): # pylint: disable=abstract... |
femobjects | material_reinforced | # ***************************************************************************
# * Copyright (c) 2019 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
ui | ui_cdlookup | # -*- 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_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(720, 320)
self.vboxlayout = QtWidget... |
Http | ClusterPrinterMaterialStation | # Copyright (c) 2019 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, Dict, List, Union
from ..BaseModel import BaseModel
from .ClusterPrinterMaterialStationSlot import ClusterPrinterMaterialStationSlot
class ClusterPrinterMaterialStation(BaseModel):
"""Class rep... |
migrations | 0099_plugin_attachment | # Generated by Django 3.0.7 on 2020-11-04 14:54
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("posthog", "0098_events_property_usage"),
]
operations = [
migrations.CreateModel(
name="PluginAt... |
gdist | appdata | # Copyright 2013-2016 Christoph Reiter
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
#... |
engines | wikipedia | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Wikipedia (Web)
"""
from json import loads
from urllib.parse import quote
from lxml.html import fromstring
from searx.raise_for_httperror import raise_for_httperror
from searx.utils import match_language, searx_useragent
# about
about = {
"website": "https://www.... |
downloaders | TenluaVn | # -*- coding: utf-8 -*-
import json
import random
import re
from ..base.simple_downloader import SimpleDownloader
def gen_r():
return "0." + "".join(random.choice("0123456789") for x in range(16))
class TenluaVn(SimpleDownloader):
__name__ = "TenluaVn"
__type__ = "downloader"
__version__ = "0.04"
... |
rest | base_api_test | import json
from json import JSONDecodeError
from typing import Dict, Optional
from aiohttp import ClientSession
from tribler.core.components.restapi.rest import get_param
from tribler.core.utilities.path_util import Path
from tribler.core.version import version_id
def path_to_str(obj):
if isinstance(obj, dict):... |
PyObjCTest | test_cgeventsource | from PyObjCTools.TestSupport import *
from Quartz.CoreGraphics import *
try:
long
except NameError:
long = int
class TestCGEventSource(TestCase):
def testTypes(self):
self.assertIsCFType(CGEventSourceRef)
def testFunctions(self):
self.assertIsInstance(CGEventSourceGetTypeID(), (int, ... |
accounts | UploadgigCom | # -*- coding: utf-8 -*-
import json
import re
import time
from pyload.core.datatypes.pyfile import PyFile
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.account import BaseAccount
from ..helpers import parse_html_form
class UploadgigCom(BaseAccount):
__name__ = "UploadgigCom"
__type__ = "accoun... |
posthog | middleware | import time
from ipaddress import ip_address, ip_network
from typing import Any, Callable, List, Optional, cast
import structlog
from corsheaders.middleware import CorsMiddleware
from django.conf import settings
from django.contrib.sessions.middleware import SessionMiddleware
from django.core.exceptions import Middlew... |
migrations | 0006_auto_20230512_0902 | # Generated by Django 3.2.19 on 2023-05-12 09:02
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
(
"mobile_app",
"0005_mobileappusersettings_important_notification_volume_override",
),
]
... |
hogql | base | import re
from dataclasses import dataclass, field
from typing import Literal, Optional
from posthog.hogql.constants import ConstantDataType
from posthog.hogql.errors import NotImplementedException
# Given a string like "CorrectHorseBS", match the "H" and "B", so that we can convert this to "correct_horse_bs"
camel_c... |
scenarios | scenario_step | import importlib
import logging
import typing
from apps.slack.alert_group_slack_service import AlertGroupSlackService
from apps.slack.client import SlackClient
if typing.TYPE_CHECKING:
from apps.slack.models import SlackTeamIdentity, SlackUserIdentity
from apps.slack.types import EventPayload
from apps.us... |
extractor | syfy | from __future__ import unicode_literals
from ..utils import smuggle_url, update_url_query
from .adobepass import AdobePassIE
class SyfyIE(AdobePassIE):
_VALID_URL = r"https?://(?:www\.)?syfy\.com/(?:[^/]+/)?videos/(?P<id>[^/?#]+)"
_TESTS = [
{
"url": "http://www.syfy.com/theinternetruined... |
examples | chirp_channelize | #!/usr/bin/env python
#
# Copyright 2009,2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import sys
import time
import numpy
from gnuradio import blocks, filter, gr
from gnuradio.fft import window
try:
from gnuradio import analog
excep... |
uic-files | bookmark_manager_dialog_ui | # Form implementation generated from reading ui file './forms/bookmark_manager_dialog.ui'
#
# Created by: PyQt5 UI code generator 5.9
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from . import main_window_view_rc
class Ui_Bookmark_Dialog(object):
def setupU... |
utils | bytestringio | #!usr/bin/Python
# -*- coding:utf-8 -*-
#仿照StringIO创建的类二进制文件内存读写对象
import os
import sys
from calibre.constants import preferred_encoding
def _complain_ifclosed(closed):
if closed:
raise ValueError, "I/O operation on closed file"
class byteStringIO:
def __init__(self, buf = ''):
self.buf = N... |
nyaa | template_utils | import functools
import os.path
import re
from datetime import datetime
from email.utils import formatdate
import flask
from nyaa.backend import get_category_id_map
from nyaa.torrents import create_magnet
from werkzeug.urls import url_encode
app = flask.current_app
bp = flask.Blueprint("template-utils", __name__)
_st... |
models | schedule_export_auth_token | import typing
from apps.auth_token import constants, crypto
from apps.auth_token.models.base_auth_token import BaseAuthToken
from apps.schedules.models import OnCallSchedule
from apps.user_management.models import Organization, User
from django.db import models
class ScheduleExportAuthToken(BaseAuthToken):
objec... |
extractor | ninegag | from __future__ import unicode_literals
from ..utils import (
ExtractorError,
determine_ext,
int_or_none,
try_get,
unescapeHTML,
url_or_none,
)
from .common import InfoExtractor
class NineGagIE(InfoExtractor):
IE_NAME = "9gag"
_VALID_URL = r"https?://(?:www\.)?9gag\.com/gag/(?P<id>[^/... |
tunnel | tunnel_component | from ipv8.dht.provider import DHTCommunityProvider
from ipv8.messaging.anonymization.community import TunnelSettings
from tribler.core.components.bandwidth_accounting.bandwidth_accounting_component import (
BandwidthAccountingComponent,
)
from tribler.core.components.component import Component
from tribler.core.com... |
model | package_relationship | # encoding: utf-8
from __future__ import annotations
from typing import Any, Optional, cast
import ckan.model.core as core
import ckan.model.domain_object as domain_object
import ckan.model.meta as meta
import ckan.model.package as _package
import ckan.model.types as _types
from ckan.model import package as _package
... |
versions | 325b88f66322_ | """empty message
Revision ID: 325b88f66322
Revises: dc8c1be855c
Create Date: 2015-01-10 21:28:10.493601
"""
# revision identifiers, used by Alembic.
revision = "325b88f66322"
down_revision = "dc8c1be855c"
import sqlalchemy as sa
from alembic import op
def upgrade():
### commands auto generated by Alembic - pl... |
models | custom_on_call_shift | import copy
import datetime
import itertools
import logging
import typing
from calendar import monthrange
from uuid import uuid4
import pytz
from apps.schedules.tasks import (
drop_cached_ical_task,
refresh_ical_final_schedule,
schedule_notify_about_empty_shifts_in_schedule,
schedule_notify_about_gaps_... |
quodlibet | cli | # Copyright 2014,2016 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 json
import os
from quodl... |
picard | i18n | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2012 Frederik “Freso” S. Olesen
# Copyright (C) 2013-2014, 2018-2022 Laurent Monin
# Copyright (C) 2017 Sambhav Kothari
# Copyright (C) 2017-2022 Philipp Wolfer
#
# This program is free software; you can redistribute it and/or
... |
books | nfzm | #!/usr/bin/env python
# -*- coding:utf-8 -*-
from base import BaseFeedBook, URLOpener, string_of_tag
from bs4 import BeautifulSoup
def getBook():
return NFZM
class NFZM(BaseFeedBook):
title = "南方周末"
description = "在这里读懂中国 | 每周五更新 | 需要登录"
__author__ = "mcfloundinho"
language = "zh-cn"
feed_en... |
saveddata | fighterAbility | # ===============================================================================
# Copyright (C) 2010 Diego Duclos
#
# This file is part of eos.
#
# eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, ... |
KindleUnpack | mobi_pagemap | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab
from __future__ import absolute_import, division, print_function, unicode_literals
from .compatibility_utils import PY2, unicode_str
if PY2:
range = xrange
import re
import struct
# note: struct pack, unpack, unpack... |
Todo | InfoWindowController | from Cocoa import *
from ToDoDocument import *
NOTIFY_TAG = 0
RESCHEDULE_TAG = 1
NOTES_TAG = 2
NotifyLengthNone = 0
NotifyLengthQuarter = 1
NotifyLengthHour = 2
NotifyLengthDay = 3
NotifyLengthOther = 4
_sharedInfoWindowController = None
class InfoWindowController (NSWindowController):
dumm... |
fitCommands | helpers | import math
import eos.db
import wx
from eos.const import FittingModuleState
from eos.saveddata.booster import Booster
from eos.saveddata.cargo import Cargo
from eos.saveddata.drone import Drone
from eos.saveddata.fighter import Fighter
from eos.saveddata.implant import Implant
from eos.saveddata.module import Module
... |
display | navigation | # -*- coding: utf-8 -*-
"""
flaskbb.display.navigation
~~~~~~~~~~~~~~~~~~~~~~~~~~
Helpers to create navigation elements in FlaskBB Templates
:copyright: (c) 2018 the FlaskBB Team
:license: BSD, see LICENSE for more details
"""
from abc import ABC, abstractproperty
from enum import Enum
import att... |
extensions | enqueue_in_mediaplayer | # -*- coding: utf-8 -*-
# Extension script to add a context menu item for enqueueing episodes in a player
# Requirements: gPodder 3.x (or "tres" branch newer than 2011-06-08)
# (c) 2011-06-08 Thomas Perl <thp.io/about>
# Released under the same license terms as gPodder itself.
import functools
import logging
import gp... |
books | ZhihuDaily | #!/usr/bin/env python
# -*- coding:utf-8 -*-
__author__ = "@ohdarling88"
__version__ = "0.1.2"
import json
import urllib
from base import BaseFeedBook
from config import SHARE_FUCK_GFW_SRV
from lib.urlopener import URLOpener
# 知乎屏蔽了 GAE 访问 API,所以需要一个中转服务器来获取知乎日报的 Feed 内容
# nodejs 版本可以参考:https://github.com/ohdarling... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.