section stringlengths 2 30 | filename stringlengths 1 82 | text stringlengths 783 28M |
|---|---|---|
migrations | 0001_initial | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = []
operations = [
migrations.CreateModel(
name="Feed",
fields=[
(
"id",
... |
lib | _ctypes | import ctypes
import ctypes.util
import glob
import os
from sglib.log import LOG
__all__ = [
"patch_ctypes",
"revert_patch_ctypes",
]
ORIG_CDLL = None
ORIG_FIND_LIB = None
def revert_patch_ctypes():
global ORIG_CDLL, ORIG_FIND_LIB
ctypes.CDLL = ORIG_CDLL
ORIG_CDLL = None
ctypes.util.find_li... |
KindleUnpack | mobi_k8proc | #!/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, bstr, utf8_str
if PY2:
range = xrange
import os
import re
import struct
from .mobi_index import... |
tagsources | amazon | # -*- coding: utf-8 -*-
# Example tutorial for writing a tag source plugin using Amazon's webservice API.
# The important stuff is at the bottom in the Amazon class.
# Comments (or you've created a tag source you'd like
# to share) can be directed at concentricpuddle@gmail.com
import base64
import hashlib
import hmac... |
Sidebar | ConsolePlugin | import logging
import re
from Config import config
from Debug import Debug
from Plugin import PluginManager
from util import SafeRe
from util.Flag import flag
class WsLogStreamer(logging.StreamHandler):
def __init__(self, stream_id, ui_websocket, filter):
self.stream_id = stream_id
self.ui_websoc... |
localModule | mutatedConvert | import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.module.localReplace import CalcReplaceLocalModuleCommand
from gui.fitCommands.helpers import InternalCommandHistory, ModuleInfo
from service.fit import Fit
class GuiConvertMutatedLocalModuleCommand(wx.Command):
... |
gtkui | label_config | #
# 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 more details.
#
import logging
from deluge.ui... |
prefs | prefs_palettes | # -*- coding: utf-8 -*-
#
# 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 the ho... |
containers | CCF | # -*- coding: utf-8 -*-
import base64
import os
import re
from pyload.core.network.http.http_request import FormFile
from ..base.container import BaseContainer
class CCF(BaseContainer):
__name__ = "CCF"
__type__ = "container"
__version__ = "0.30"
__status__ = "testing"
__pattern__ = r".+\.ccf$... |
builders | model_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... |
throttlers | phone_verification_throttler | from common.api_helpers.custom_rate_scoped_throttler import CustomRateScopedThrottler
class GetPhoneVerificationCodeThrottlerPerUser(CustomRateScopedThrottler):
def get_scope(self):
return "get_phone_verification_code_per_user"
def get_throttle_limits(self):
return 5, 10 * 60
class VerifyPh... |
downloaders | TbSevenPl | # -*- coding: utf-8 -*-
import re
from pyload.core.utils import parse
from ..base.multi_downloader import MultiDownloader
class TbSevenPl(MultiDownloader):
__name__ = "TbSevenPl"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r"^unmatchable$"
__config__ =... |
grc | gen_rfnoc_siggen_block_yml | """
Copyright 2021 Ettus Research, A National Instruments Brand.
SPDX-License-Identifier: GPL-3.0-or-later
"""
import sys
MAX_NUM_CHANNELS = 16
MAIN_TMPL = """\
id: uhd_rfnoc_siggen
label: RFNoC SigGen Block
category: '[Core]/UHD/RFNoC/Blocks'
parameters:
- id: num_chans
label: Channel count
dtype: int
optio... |
PyObjCTest | test_nsapplescript | from Foundation import *
from PyObjCTools.TestSupport import *
try:
unicode
except NameError:
unicode = str
class TestAE(TestCase):
def testConstants(self):
self.assertIsInstance(NSAppleScriptErrorMessage, unicode)
self.assertIsInstance(NSAppleScriptErrorNumber, unicode)
self.asse... |
migrations | 0034_add_readme_to_aips | from django.db import migrations
from main.models import Job
# Can't use apps.get_model for this model as we need to access class attributes
def data_migration(apps, schema_editor):
"""Workflow migrations for adding README file to AIPs.
Changes workflow so that, at a high-level, the following micro-services... |
tasks | drop_cached_ical | from celery.utils.log import get_task_logger
from common.custom_celery_tasks import shared_dedicated_queue_retry_task
from .refresh_ical_files import refresh_ical_final_schedule
task_logger = get_task_logger(__name__)
@shared_dedicated_queue_retry_task(
autoretry_for=(Exception,), retry_backoff=True, max_retrie... |
chardet | gb2312freq | ######################## 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... |
friture | generated_filters | # Filters parameters generated from filter_design.py
import json
JSON_PARAMS = """
{
"1": [
[
[
0.3363108965857415,
0.0029152307841421206,
-0.6666769535463926,
0.0029152307841421848,
0.3363108965857415
... |
Cloud | CloudOutputDeviceManager | # Copyright (c) 2022 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
import os
from typing import Dict, List, Optional, Set
from cura.API import Account
from cura.API.Account import SyncState
from cura.CuraApplication import CuraApplication
from cura.Settings.CuraContainerRegistry import (
... |
extractor | nba | from __future__ import unicode_literals
import functools
import re
from ..compat import (
compat_parse_qs,
compat_str,
compat_urllib_parse_unquote,
compat_urllib_parse_urlparse,
)
from ..utils import (
OnDemandPagedList,
int_or_none,
merge_dicts,
parse_duration,
parse_iso8601,
... |
settings | schedules | from posthog.settings.base_variables import TEST
from posthog.settings.utils import get_from_env
USE_PRECALCULATED_CH_COHORT_PEOPLE = not TEST
CALCULATE_X_COHORTS_PARALLEL = get_from_env(
"CALCULATE_X_COHORTS_PARALLEL", 5, type_cast=int
)
ACTION_EVENT_MAPPING_INTERVAL_SECONDS = get_from_env(
"ACTION_EVENT_MAP... |
cura | CuraActions | # Copyright (c) 2023 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.
from typing import List, cast
import cura.CuraApplication
from cura.Arranging.GridArrange import GridArrange
from cura.Arranging.Nest2DArrange import Nest2DArrange
from cura.MultiplyObjectsJob import MultiplyObjectsJob
from cur... |
fec | qa_polar_decoder_sc_list | #!/usr/bin/env python
#
# Copyright 2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import numpy as np
from gnuradio import blocks, fec, gr, gr_unittest
from gnuradio.fec import extended_decoder
from gnuradio.fec.polar import channel_constructio... |
downloaders | ExtmatrixCom | # -*- coding: utf-8 -*-
import re
from ..base.simple_downloader import SimpleDownloader
class ExtmatrixCom(SimpleDownloader):
__name__ = "ExtmatrixCom"
__type__ = "downloader"
__version__ = "0.02"
__status__ = "testing"
__pattern__ = r"https?://www\.extmatrix\.com/(?:get|files)/\w+"
__confi... |
CloudSync | SubscribedPackagesModel | # Copyright (c) 2022 Ultimaker B.V.
# Cura is released under the terms of the LGPLv3 or higher.
from typing import Any, Dict, List
from cura import ApplicationMetadata
from PyQt6.QtCore import Qt, pyqtProperty
from UM.PackageManager import PackageManager
from UM.Qt.ListModel import ListModel
from UM.Version import Ve... |
builtinShipBrowser | fitItem | # coding: utf-8
import re
import time
import config
import gui.builtinShipBrowser.sfBrowserItem as SFItem
import gui.fitCommands as cmd
import gui.globalEvents as GE
import gui.mainFrame
import gui.utils.color as colorUtils
import gui.utils.draw as drawUtils
import gui.utils.fonts as fonts
import wx
from gui.bitmap_l... |
mpris2 | mprisobject | # mpris2 - Support MPRIS 2 in Exaile
# Copyright (C) 2015-2016 Johannes Sasongko <sasongko@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... |
auth | plugins | # -*- coding: utf-8 -*-
"""
flaskbb.auth.plugins
~~~~~~~~~~~~~~~~~~~~
Plugin implementations for FlaskBB auth hooks
:copyright: (c) 2014-2018 the FlaskBB Team.
:license: BSD, see LICENSE for more details
"""
from flask import flash, redirect, url_for
from flask_login import current_user, logout_use... |
ui | recentfiles | from pathlib import Path
from gaphor.abc import Service
from gaphor.core import event_handler
from gaphor.event import ModelLoaded, ModelSaved
from gaphor.ui import APPLICATION_ID
from gi.repository import GLib, Gtk
class RecentFiles(Service):
def __init__(self, event_manager, recent_manager=None):
self.... |
extensions | taskbar_progress | # -*- 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... |
lib | trending | # 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, ... |
meshes | mesh_boxanalysis_tetra10 | def create_nodes(femmesh):
# nodes
femmesh.addNode(0.0, 0.0, 0.0, 1)
femmesh.addNode(0.0, 0.0, 10.0, 2)
femmesh.addNode(0.0, 10.0, 0.0, 3)
femmesh.addNode(0.0, 10.0, 10.0, 4)
femmesh.addNode(10.0, 0.0, 0.0, 5)
femmesh.addNode(10.0, 0.0, 10.0, 6)
femmesh.addNode(10.0, 10.0, 0.0, 7)
fe... |
decrypters | EmbeduploadCom | # -*- coding: utf-8 -*-
import re
from pyload.core.network.http.exceptions import BadHeader
from ..base.decrypter import BaseDecrypter
class EmbeduploadCom(BaseDecrypter):
__name__ = "EmbeduploadCom"
__type__ = "decrypter"
__version__ = "0.08"
__status__ = "testing"
__pattern__ = r"http://(?:w... |
pwidgets | actions | # -*- 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.... |
metasync | amarok | # This file is part of beets.
# Copyright 2016, Heinz Wiesinger.
#
# 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,... |
extern | freedb | # Audio Tools, a module and set of tools for manipulating audio data
# Copyright (C) 2007-2016 Brian Langenberger
# 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 Licens... |
neubot | agent | # neubot/agent.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 Public Licen... |
gst | engine | # Copyright (C) 2008-2010 Adam Olsen
# Copyright (C) 2014-2015 Dustin Spicuzza
#
# 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.
#
# Th... |
builtinContextMenus | moduleSpool | import math
import eos.config
import gui.fitCommands as cmd
import gui.mainFrame
import wx
from eos.utils.spoolSupport import SpoolOptions, SpoolType
from gui.contextMenu import ContextMenuSingle
from service.fit import Fit
# noinspection PyPackageRequirements
_t = wx.GetTranslation
class ChangeModuleSpool(Context... |
qltk | queue | # Copyright 2004-2005 Joe Wreschnig, Michael Urman, Iñigo Serna
# 2016-2023 Nick Boultbee
# 2017 Fredrik Strupe
#
# 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 ... |
extractor | tvplayer | # coding: utf-8
from __future__ import unicode_literals
from ..compat import compat_HTTPError, compat_str
from ..utils import ExtractorError, extract_attributes, try_get, urlencode_postdata
from .common import InfoExtractor
class TVPlayerIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?tvplayer\.com/watch/(?... |
paned | pane | # Copyright 2013 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 operator
from gi.repository... |
covers | discogs | # Copyright 2016 Mice Pápai
# 2018 Nick Boultbee
#
# Based on lastfm.py by Simonas Kazlauskas
#
# 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
# (a... |
middleware | locale | # This file is part of Archivematica.
#
# Copyright 2010-2017 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 ... |
comic | cartoonmadbase | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# http://www.cartoonmad.com网站的漫画的基类,简单提供几个信息实现一个子类即可推送特定的漫画
# Author: insert0003 <https://github.com/insert0003>
from books.base import BaseComicBook
from bs4 import BeautifulSoup
from lib.autodecoder import AutoDecoder
from lib.urlopener import URLOpener
class CartoonMadB... |
submitters | rippleSubmitter | import json
import os
# mpc logging import
import mpc.logging
# meshroom modules
from meshroom.core.desc import Level
from meshroom.core.submitter import BaseSubmitter
# validators for numbers
from mpc.pyCore.validators import IntValidator
from mpc.ripple.dispatcher import DefaultDispatcher
from mpc.ripple.rippleAtt... |
mobile-app | auth | from typing import Optional, Tuple
from apps.auth_token.exceptions import InvalidToken
from apps.user_management.models import User
from rest_framework import exceptions
from rest_framework.authentication import BaseAuthentication, get_authorization_header
from .models import MobileAppAuthToken, MobileAppVerification... |
QT | PantallaDailyTest | import os.path
import random
import time
from Code import Analisis, ControlPosicion, Jugada, Util
from Code.QT import (
Colocacion,
Columnas,
Controles,
FormLayout,
Grid,
Iconos,
PantallaPotencia,
QTUtil2,
QTVarios,
Tablero,
)
class WDailyTestBase(QTVarios.WDialogo):
def _... |
matrix | models | import datetime as dt
from abc import ABC, abstractmethod
from collections import defaultdict
from copy import deepcopy
from dataclasses import dataclass
from enum import Enum, auto
from itertools import chain
from typing import (
TYPE_CHECKING,
Any,
Callable,
DefaultDict,
Dict,
Generic,
Ite... |
src | fileid | # MusicPlayer, https://github.com/albertz/music-player
# Copyright (c) 2013, Albert Zeyer, www.az2000.de
# All rights reserved.
# This code is under the 2-clause BSD license, see License.txt in the root directory of this project.
# Get some native file-id handle which is persistent from file-moves.
import os
import s... |
ip | unassigned | import json
def format_ret(return_set, as_json=False):
"""decouple, allow for modifications to return type
returns a list of ip addresses in object or json form"""
ret_list = list()
for item in return_set:
d = {"ip": item}
ret_list.append(d)
if as_json:
return json.dumps(r... |
utils | defdict_test | __copyright__ = "Copyright (C) 2016 Martin Blais"
__license__ = "GNU GPLv2"
import pickle
import unittest
from unittest import mock
from beancount.utils import defdict
class TestDefDictWithKey(unittest.TestCase):
def test_defdict_with_key(self):
factory = mock.MagicMock()
testdict = defdict.Defa... |
QT | Colocacion | from PyQt4 import QtCore, QtGui
class V(QtGui.QVBoxLayout):
def control(self, control):
self.addWidget(control)
return self
def controlc(self, control):
self.addWidget(control)
self.setAlignment(QtCore.Qt.AlignCenter)
return self
def controld(self, control):
... |
utorrent | upload | # code copied from http://www.doughellmann.com/PyMOTW/urllib2/
import itertools
import mimetypes
import urllib
import mimetools
import urllib2
from cStringIO import StringIO
class MultiPartForm(object):
"""Accumulate the data to be used when posting a form."""
def __init__(self):
self.form_fields =... |
analog | qa_simple_squelch | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from gnuradio import analog, blocks, gr, gr_unittest
class test_simple_squelch(gr_unittest.TestCase):
def setUp(self):
self.tb = gr.top_block(... |
scripts | format | __copyright__ = "Copyright (C) 2014-2016 Martin Blais"
__license__ = "GNU GPLv2"
import collections
import io
import click
import regex
from beancount.core import account, amount
from beancount.parser.version import VERSION
NUMBER_RE = r"[-+]?\s*[\d,]+(?:\.\d*)?"
PARENTHESIZED_BINARY_OP_RE = rf"\({NUMBER_RE}\s*[-+*... |
ctrlport | usrp_source_controller | #!/usr/bin/env python
import sys
from argparse import ArgumentParser
import pmt
from gnuradio.ctrlport.GNURadioControlPortClient import GNURadioControlPortClient
parser = ArgumentParser()
parser.add_argument(
"-H",
"--host",
default="localhost",
help="Hostname to connect to (default=%(default)r)",
)
... |
ui | graph | #!/usr/bin/env python
# coding:utf-8
import json
import logging
import os
from enum import Enum
from multiprocessing.pool import ThreadPool
from threading import Event, Lock, Thread
from meshroom.common.qt import QObjectListModel
from meshroom.core import sessionUid, submitters
from meshroom.core.attribute import Attr... |
beetsplug | importadded | """Populate an item's `added` and `mtime` fields by using the file
modification time (mtime) of the item's source file before import.
Reimported albums and items are skipped.
"""
import os
from beets import importer, util
from beets.plugins import BeetsPlugin
class ImportAddedPlugin(BeetsPlugin):
def __init__(... |
commands | split_person | import logging
import structlog
from django.core.management.base import BaseCommand
from posthog.kafka_client.client import KafkaProducer
from posthog.models import Person
logger = structlog.get_logger(__name__)
logger.setLevel(logging.INFO)
class Command(BaseCommand):
help = (
"Split a person into one ... |
stream | segmented | from __future__ import annotations
import logging
import queue
from concurrent import futures
from concurrent.futures import Future, ThreadPoolExecutor
from sys import version_info
from threading import Event, Thread, current_thread
from typing import ClassVar, Generator, Generic, Optional, Tuple, Type, TypeVar
from ... |
femobjects | element_fluid1D | # ***************************************************************************
# * Copyright (c) 2016 Ofentse Kgoa <kgoaot@eskom.co.za> *
# * Copyright (c) 2018 Bernd Hahnebach <bernd@bimstatik.org> *
# * Based on the FemElementGeometry1D by Bernd Hahnebach *
# * ... |
SCL | Part21 | # Copyright (c) 2011, Thomas Paviot (tpaviot@gmail.com)
# All rights reserved.
# This file is part of the StepClassLibrary (SCL).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code mus... |
misc | pastebin | # SPDX-FileCopyrightText: Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
"""Client for the pastebin."""
import urllib.parse
from qutebrowser.qt.core import QObject, QUrl, pyqtSignal, pyqtSlot
class PastebinClient(QObject):
"""A client for Stikked pastebins u... |
formats | mp4 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
#
# Copyright (C) 2006-2008, 2011 Lukáš Lalinský
# Copyright (C) 2009-2011, 2015, 2018-2023 Philipp Wolfer
# Copyright (C) 2011 Johannes Weißl
# Copyright (C) 2011-2014 Wieland Hoffmann
# Copyright (C) 2012-2013 Michael Wiencek
# Copyright (C) 2... |
beancount | setup | #!/usr/bin/env python3
"""
Install script for beancount.
"""
__copyright__ = "Copyright (C) 2008-2011, 2013-2016 Martin Blais"
__license__ = "GNU GPLv2"
import datetime
import os
import platform
import re
import runpy
import subprocess
import sys
from os import path
from setuptools import Extension, find_packages, ... |
migrations | 0020_embargo_field | # Generated by Django 4.2.4 on 2019-10-10 11:56
from django.db import migrations, models
def add_publication_date_when_published(apps, schema_editor):
"""
If a DepositRecord has status ``published``, set ``publication_date`` to ``date``
"""
DepositRecord = apps.get_model("deposit", "DepositRecord")
... |
asyncio-fixes | wait_for | import asyncio
import asyncio.tasks
import functools
import logging
import sys
import warnings
from asyncio import ensure_future, events, exceptions
logger = logging.getLogger(__name__)
def base_lost_result_handler(task_result):
# It is possible for the task inside wait_for to return an object that require closi... |
archiver | rinfo_cmd | import argparse
import textwrap
from ..constants import * # NOQA
from ..helpers import basic_json_data, bin_to_hex, format_file_size, json_print
from ..logger import create_logger
from ..manifest import Manifest
from ._common import with_repository
logger = create_logger()
class RInfoMixIn:
@with_repository(ca... |
femobjects | mesh_boundarylayer | # ***************************************************************************
# * Copyright (c) 2016 Bernd Hahnebach <bernd@bimstatik.org> *
# * *
# * This file is part of the FreeCAD CAx development system. *
# * ... |
ocrolib | edist | import re
import numpy as np
from scipy.ndimage import filters
def levenshtein(a, b):
"""Calculates the Levenshtein distance between a and b.
(Clever compact Pythonic implementation from hetland.org)"""
n, m = len(a), len(b)
if n > m:
a, b = b, a
n, m = m, n
current = range(n + 1)... |
templaters | slack_templater | from apps.alerts.incident_appearance.templaters.alert_templater import AlertTemplater
class AlertSlackTemplater(AlertTemplater):
RENDER_FOR_SLACK = "slack"
def _render_for(self):
return self.RENDER_FOR_SLACK
def _postformat(self, templated_alert):
# We need to replace new line characters... |
mylar | sabparse | #!/usr/bin/env python
# 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 distri... |
decrypters | DebridlinkFrTorrent | # -*- coding: utf-8 -*-
import fnmatch
import json
import os
import time
import urllib.request
import pycurl
from pyload.core.network.http.exceptions import BadHeader
from pyload.core.network.http.http_request import FormFile
from pyload.core.utils.old import safejoin
from pyload.core.utils.purge import uniquify
fro... |
core | matcher | # 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... |
extractor | nrl | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class NRLTVIE(InfoExtractor):
_VALID_URL = r"https?://(?:www\.)?nrl\.com/tv(/[^/]+)*/(?P<id>[^/?&#]+)"
_TEST = {
"url": "https://www.nrl.com/tv/news/match-highlights-titans-v-knights-862805/",
"info_dict... |
mako | cmd | # mako/cmd.py
# Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file>
#
# This module is part of Mako and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import sys
from argparse import ArgumentParser
from os.path import dirname, isfile
from mako import ex... |
widgets | audio_item_viewer | from sglib.lib import util
from sglib.lib.translate import _
from sglib.math import clip_max, clip_min, clip_value
from sglib.models import theme
from sgui.sgqt import *
from sgui.shared import AUDIO_ITEM_SCENE_HEIGHT, AUDIO_ITEM_SCENE_WIDTH
from sgui.widgets.sample_graph import create_sample_graph
from . import _shar... |
localDrone | changeAmount | import math
import eos.db
import gui.mainFrame
import wx
from gui import globalEvents as GE
from gui.fitCommands.calc.drone.localChangeAmount import (
CalcChangeLocalDroneAmountCommand,
)
from gui.fitCommands.calc.drone.localRemove import CalcRemoveLocalDroneCommand
from gui.fitCommands.helpers import InternalComm... |
core | GameEngine | #####################################################################
# -*- coding: utf-8 -*- #
# #
# Frets on Fire #
# Copyright (C) 2006 Sami Kyöstilä ... |
chardet | chardistribution | ######################## 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... |
gui | ParamWidgets | # Copyright 2007-2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
import configparser
import os
import subprocess
from gi.repository import Gdk, Gtk
from . import Constants, Dialogs, Utils
from .canvas.colors import DARK_THEME_STYLES, LIGHT_THEME_ST... |
aliceVision | GlobalSfM | __version__ = "1.0"
import json
import os
from meshroom.core import desc
class GlobalSfM(desc.AVCommandLineNode):
commandLine = "aliceVision_globalSfM {allParams}"
size = desc.DynamicNodeSize("input")
category = "Sparse Reconstruction"
documentation = """
Performs the Structure-From-Motion with a g... |
util | net | __license__ = "GNU Affero General Public License http://www.gnu.org/licenses/agpl.html"
__copyright__ = "Copyright (C) 2018 The OctoPrint Project - Released under terms of the AGPLv3 License"
import logging
import os
import socket
import sys
import netaddr
import netifaces
import requests
import werkzeug.http
_cache... |
builtinPreferenceViews | dummyView | # =============================================================================
# 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 ... |
xl | dynamic | # Copyright (C) 2008-2010 Adam Olsen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that... |
engines | command | # SPDX-License-Identifier: AGPL-3.0-or-later
"""
Command (offline)
"""
import re
from os.path import commonprefix, expanduser, isabs, realpath
from shlex import split as shlex_split
from subprocess import PIPE, Popen
from threading import Thread
from searx import logger
engine_type = "offline"
paging = True
command... |
draftobjects | array | # ***************************************************************************
# * Copyright (c) 2009, 2010 Yorik van Havre <yorik@uncreated.net> *
# * Copyright (c) 2009, 2010 Ken Cline <cline@frii.com> *
# * Copyright (c) 2019, M G Berberich (berberic2, rynn) *
# * Co... |
graphs | temperature_change | # -*- coding: utf-8 -*-
import plotly.graph_objs as go
import plotly.offline as plotly
from django.utils.translation import gettext as _
from reports import utils
def temperature_change(objects):
"""
Create a graph showing temperature over time.
:param objects: a QuerySet of Temperature instances.
:re... |
stats | stats | # encoding: utf-8
from __future__ import annotations
import datetime
import logging
from typing import Any, ClassVar, Optional, Union
import ckan.model as model
from sqlalchemy import Table, and_, func, join, select
log = logging.getLogger(__name__)
DATE_FORMAT = "%Y-%m-%d"
def table(name: str):
return Table(... |
extractor | newstube | # coding: utf-8
from __future__ import unicode_literals
import base64
import hashlib
from ..aes import aes_cbc_decrypt
from ..utils import (
bytes_to_intlist,
int_or_none,
intlist_to_bytes,
parse_codecs,
parse_duration,
)
from .common import InfoExtractor
class NewstubeIE(InfoExtractor):
_VA... |
downloaders | XHamsterCom | # -*- coding: utf-8 -*-
import json
import re
from ..base.downloader import BaseDownloader
def quality_fallback(desired, available):
result = available.get(desired, None)
if result is None:
if desired == "720p":
return quality_fallback("480p", available)
elif desired == "480p":
... |
update | update_currencies | #!/usr/bin/env python
import json
import re
import unicodedata
from os.path import dirname, join, realpath
# set path
from sys import path
from searx import searx_dir, settings
from searx.engines.wikidata import send_wikidata_query
# ORDER BY (with all the query fields) is important to keep a deterministic result o... |
downloaders | FilejokerNet | # -*- coding: utf-8 -*-
import io
import json
import os
import re
import urllib.parse
import pycurl
from pyload.core.utils import purge
from ..anticaptchas.HCaptcha import HCaptcha
from ..anticaptchas.ReCaptcha import ReCaptcha
from ..base.xfs_downloader import XFSDownloader
from ..helpers import check_module, parse... |
blocks | qa_file_metadata | #!/usr/bin/env python
#
# Copyright 2012,2013 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
import math
import os
import pmt
from gnuradio import blocks, gr, gr_unittest
def sig_source_c(samp_rate, freq, amp, N):
t = [float(x) / samp_rate fo... |
gui | Application | """
Copyright 2007-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
SPDX-License-Identifier: GPL-2.0-or-later
"""
import logging
import os
import subprocess
from getpass import getuser
from gi.repository import Gio, GLib, GObject, Gtk
from ..core import Messages
from . import Actions, Bars, Cons... |
QT | Iconos | """Iconos y pixmap usados en el programa"""
from PyQt4 import QtGui
f = open("./IntFiles/Iconos.bin", "rb")
binIconos = f.read()
f.close()
def icono(name):
return eval("%s()" % name)
def pixmap(name):
return eval("pm%s()" % name)
def PM(desde, hasta):
pm = QtGui.QPixmap()
pm.loadFromData(binIcono... |
colors | uimisc | # This file is part of MyPaint.
# Copyright (C) 2012 by Andrew Chadwick <andrewc-git@piffle.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 2 of the License, or
# (at your ... |
openssl | ecc | import ctypes
import hmac
import threading
from .._ecc import ECC
from .aes import aes
from .library import lib, openssl_backend
# Initialize functions
lib.BN_new.restype = ctypes.POINTER(ctypes.c_char)
lib.BN_bin2bn.restype = ctypes.POINTER(ctypes.c_char)
lib.BN_CTX_new.restype = ctypes.POINTER(ctypes.c_char)
lib.EC... |
Arch | ArchAxis | # ***************************************************************************
# * Copyright (c) 2011 Yorik van Havre <yorik@uncreated.net> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.