code stringlengths 1 199k |
|---|
import re
from django.core.management.base import BaseCommand
from django.contrib.auth.models import User
from apps.rss_feeds.models import Feed
from apps.reader.models import UserSubscription
from optparse import make_option
class Command(BaseCommand):
option_list = BaseCommand.option_list + (
make_option(... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
db.rename_column('django_mailbox_message', 'from_address', 'address')
db.rename_column('django_mailbox_message', 'received', 'processed... |
"""
Script used to publish GitHub release notes extracted from CHANGELOG.rst.
This script is meant to be executed after a successful deployment in GitHub actions.
Uses the following environment variables:
* GIT_TAG: the name of the tag of the current commit.
* GH_RELEASE_NOTES_TOKEN: a personal access token with 'repo'... |
SCRIPT_NAME = 'theme'
SCRIPT_AUTHOR = 'Sebastien Helleu <flashcode@flashtux.org>'
SCRIPT_VERSION = '0.1-dev'
SCRIPT_LICENSE = 'GPL3'
SCRIPT_DESC = 'WeeChat theme manager'
SCRIPT_COMMAND = 'theme'
import_weechat_ok = True
import_other_ok = True
try:
import weechat
except ImportError:
import_weechat_ok =... |
from django.conf import settings
from django.core.validators import MinValueValidator
from openslides.core.config import ConfigVariable
from openslides.motions.models import MotionPoll
from .models import Workflow
def get_workflow_choices():
"""
Returns a list of all workflows to be used as choices for the conf... |
"""
Commonly useful filters for `attr.asdict`.
"""
from __future__ import absolute_import, division, print_function
from ._compat import isclass
from ._make import Attribute
def _split_what(what):
"""
Returns a tuple of `frozenset`s of classes and attributes.
"""
return (
frozenset(cls for cls i... |
import beaglebone_pru_adc as adc
import time
numsamples = 10000 # how many samples to capture
capture = adc.Capture()
capture.oscilloscope_init(adc.OFF_VALUES, numsamples) # captures AIN0 - the first elt in AIN array
capture.start()
for _ in range(10):
if capture.oscilloscope_is_complete():
break
print ... |
"""Test the listtransactions API."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
from test_framework.mininode import CTransaction, COIN
from io import BytesIO
def txFromHex(hexstring):
tx = CTransaction()
f = BytesIO(hex_str_to_bytes(hexstring))
tx.deseri... |
class Solution(object):
def removeKdigits(self, num, k):
"""
:type num: str
:type k: int
:rtype: str
"""
stack = []
length = len(num) - k
for c in num:
while k and stack and stack[-1] > c:
stack.pop()
k -= 1
... |
def gcd(num1, num2):
if num1 == num2:
return num1
if num1 > num2:
return gcd(num1-num2, num2)
return gcd(num1, num2-num1)
def lcm(num1, num2):
return (num1*num2) // gcd(num1, num2)
def test():
num1, num2 = 12, 4
print('LCM of {} and {} is {}'.format(num1, num2, lcm(num1, num2))) |
import os, shutil, errno, time
from StringIO import StringIO
from xml.dom import minidom as dom
from twisted.trial import unittest
from twisted.python.filepath import FilePath
from twisted.lore import tree, process, indexer, numberer, htmlbook, default
from twisted.lore.default import factory
from twisted.lore.latex im... |
import os
import json
def main():
print("Sample Post Script")
files = json.loads(os.environ.get('MH_FILES'))
for filename in files:
print(filename)
if __name__ == "__main__":
main() |
"""experiments model definition."""
from ..schema import SchemaOverdo
experiments = SchemaOverdo(schema="experiments.json") |
from flask_admin import expose
from listenbrainz.webserver.admin import AdminIndexView
class HomeView(AdminIndexView):
@expose('/')
def index(self):
return self.render('admin/home.html') |
common = {}
execfile_('common.py', common)
MODELS = [
u'7906G',
u'7911G',
u'7931G',
u'7941G',
u'7942G',
u'7961G',
u'7962G',
]
class CiscoSccpPlugin(common['BaseCiscoSccpPlugin']):
IS_PLUGIN = True
pg_associator = common['BaseCiscoPgAssociator'](MODELS) |
import frappe
from frappe import _
def execute(filters=None):
if not filters: filters = {}
columns = get_columns()
data = get_employees(filters)
return columns, data
def get_columns():
return [
_("Employee") + ":Link/Employee:120", _("Name") + ":Data:200", _("Date of Birth")+ ":Date:100",
_("Branch") + ":Link/... |
from outwiker.gui.baseaction import BaseAction
from outwiker.core.commands import createNewWiki
class NewAction (BaseAction):
"""
Создание нового дерева заметок
"""
stringId = u"NewTree"
def __init__(self, application):
self._application = application
@property
def title(self):
... |
'''XYZ file format'''
import numpy as np
from horton.units import angstrom
from horton.periodic import periodic
__all__ = ['load_xyz', 'dump_xyz']
def load_xyz(filename):
'''Load a molecular geometry from a .xyz file.
**Argument:**
filename
The file to load the geometry from
**Retur... |
from frappe import _
def get_data():
return {
'fieldname': 'delivery_note',
'non_standard_fieldnames': {
'Stock Entry': 'delivery_note_no',
'Quality Inspection': 'reference_name',
'Auto Repeat': 'reference_document',
},
'internal_links': {
'Sales Order': ['items', 'against_sales_order'],
},
'tr... |
"""
Copyright (C) <2010> Autin L. TSRI
This file git_upy/blender/v271/__init__.py is part of upy.
upy 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
(a... |
from jx_elasticsearch.es52.painless._utils import Painless, LIST_TO_PIPE
from jx_elasticsearch.es52.painless.add_op import AddOp
from jx_elasticsearch.es52.painless.and_op import AndOp
from jx_elasticsearch.es52.painless.basic_add_op import BasicAddOp
from jx_elasticsearch.es52.painless.basic_eq_op import BasicEqOp
fro... |
import os, sys
from booki.utils.json_wrapper import json
from zipfile import ZipFile, ZipInfo, ZIP_DEFLATED, ZIP_STORED
MEDIATYPES = {
'html': "text/html",
'xhtml': "application/xhtml+xml",
'css': 'text/css',
'json': "application/json",
'png': 'image/png',
'gif': 'image/gif',
'jpg': 'image/j... |
{
'name': 'Tests flow of API keys',
'category': 'Tools',
'depends': ['web_tour'],
'data': ['views/assets.xml'],
} |
import bountyfunding
from bountyfunding.core.const import *
from bountyfunding.core.data import clean_database
from test import to_object
from nose.tools import *
USER = "bountyfunding"
class Email_Test:
def setup(self):
self.app = bountyfunding.app.test_client()
clean_database()
def test_email(... |
from HTMLParser import HTMLParser
from weboob.tools.browser import BaseBrowser, BrowserHTTPNotFound
from weboob.capabilities.base import NotAvailable, NotLoaded
from weboob.capabilities.cinema import Movie, Person
from weboob.tools.json import json
from .pages import PersonPage, MovieCrewPage, BiographyPage, Filmograph... |
from . import b2s_image |
"""Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('instructor_task.tests.test_base', 'lms.djangoapps.instructor_task.tests.test_base')
from lms.djangoapps.instructor_task.tests.test_base import * |
from openerp.osv import orm, fields
from openerp.tools.translate import _
class res_partner(orm.Model):
_inherit = 'res.partner'
_columns = {
'ref': fields.char('Reference', size=64, select=True, required=True),
}
_sql_constraints = [
('uniq_reference', 'unique(ref)', "The reference ... |
from spack import *
class Pngwriter(CMakePackage):
"""PNGwriter is a very easy to use open source graphics library that uses
PNG as its output format. The interface has been designed to be as simple
and intuitive as possible. It supports plotting and reading pixels in the
RGB (red, green, blue), HSV (hu... |
import argparse
from spack.cmd.common import print_module_placeholder_help
description = "add package to environment using dotkit"
section = "environment"
level = "long"
def setup_parser(subparser):
"""Parser is only constructed so that this prints a nice help
message with -h. """
subparser.add_argument(... |
from spack import *
class RModelmetrics(RPackage):
"""Collection of metrics for evaluating models written in C++ using
'Rcpp'."""
homepage = "https://cran.r-project.org/package=ModelMetrics"
url = "https://cran.r-project.org/src/contrib/ModelMetrics_1.1.0.tar.gz"
version('1.1.0', 'd43175001f053... |
from spack import *
class RDoparallel(RPackage):
"""Provides a parallel backend for the %dopar% function using the parallel
package."""
homepage = "https://cloud.r-project.org/package=doParallel"
url = "https://cloud.r-project.org/src/contrib/doParallel_1.0.10.tar.gz"
list_url = "https://cloud.... |
from unittest import TestCase
from . import formattest
from .. import nbpy
from .nbexamples import nb0, nb0_py
class TestPy(formattest.NBFormatTest, TestCase):
nb0_ref = nb0_py
ext = 'py'
mod = nbpy
ignored_keys = ['collapsed', 'outputs', 'prompt_number', 'metadata']
def assertSubset(self, da, db):
... |
"""
Example Airflow DAG that shows the complex DAG structure.
"""
from datetime import datetime
from airflow import models
from airflow.models.baseoperator import chain
from airflow.operators.bash import BashOperator
with models.DAG(
dag_id="example_complex",
schedule_interval=None,
start_date=datetime(2021... |
import sys
import urlparse
import os
import requests
def chunkedFetchUrl(url, local_filename=None, **kwargs):
"""Adapted from http://stackoverflow.com/q/16694907"""
if not local_filename:
local_filename = url.split('/')[-1]
# NOTE the stream=True parameter
r = requests.get(url, stream=True, **kw... |
import distutils.dir_util
import glob
import os
import shutil
import subprocess
import time
from cassandra.concurrent import execute_concurrent_with_args
from dtest import (Tester, cleanup_cluster, create_ccm_cluster, create_ks,
debug, get_test_path)
from tools.assertions import assert_one
from tools... |
import os
import shutil
import sys
from threading import Lock
from tempfile import NamedTemporaryFile
from pyspark import accumulators
from pyspark.accumulators import Accumulator
from pyspark.broadcast import Broadcast
from pyspark.files import SparkFiles
from pyspark.java_gateway import launch_gateway
from pyspark.se... |
"""Tests for Apple System Log file parser."""
import unittest
from plaso.formatters import asl as _ # pylint: disable=unused-import
from plaso.lib import timelib
from plaso.parsers import asl
from tests.parsers import test_lib
class AslParserTest(test_lib.ParserTestCase):
"""Tests for Apple System Log file parser.""... |
"""Support for SCSGate switches."""
import logging
import voluptuous as vol
from homeassistant.components import scsgate
from homeassistant.components.switch import SwitchDevice, PLATFORM_SCHEMA
from homeassistant.const import ATTR_ENTITY_ID, ATTR_STATE, CONF_NAME, CONF_DEVICES
import homeassistant.helpers.config_valid... |
import unittest
import imp
import os
import errno
import sys
import glob
import re
from distutils.errors import *
def unlink(path):
try:
os.unlink(path)
except OSError, exc:
if exc.errno != errno.ENOENT:
raise
class BrokenTest(unittest.TestCase.failureException):
def __repr__(sel... |
from horizon.tables.actions import Action
from horizon.tables.actions import BatchAction
from horizon.tables.actions import DeleteAction
from horizon.tables.actions import FilterAction
from horizon.tables.actions import FixedFilterAction
from horizon.tables.actions import LinkAction
from horizon.tables.actions import N... |
from rally.common import logging
from rally import consts
from rally.plugins.openstack import scenario
from rally.plugins.openstack.scenarios.nova import utils
from rally.task import validation
LOG = logging.getLogger(__name__)
class NovaServices(utils.NovaScenario):
"""Benchmark scenarios for Nova agents."""
@... |
from __future__ import absolute_import
from changes.api.base import APIView
from changes.models import Task
class TaskIndexAPIView(APIView):
def get(self):
queryset = Task.query.order_by(Task.date_created.desc())
return self.paginate(queryset) |
class B(object):
def __init__<warning descr="Signature is not compatible to __new__">(self)</warning>: # error
pass
def __new__<warning descr="Signature is not compatible to __init__">(cls, x, y)</warning>: # error
pass
class A1(B):
pass
class A2(A1):
def __new__<warning descr="Signature is not comp... |
"""extend base_image_id to 100 chars
Revision ID: 43df309dbf3f
Revises: 40df542e345
Create Date: 2015-06-30 20:39:56.988397
"""
from alembic import op
import sqlalchemy as sa
revision = '43df309dbf3f'
down_revision = '40df542e345'
def upgrade():
op.alter_column('image', 'base_image_id',
type_=sa... |
from oss.oss_api import *
from oss.oss_util import *
from oss.oss_xml_handler import *
from aliyunCliParser import aliyunCliParser
import signal
import ConfigParser
from optparse import OptionParser
from optparse import Values
import os
import re
import time
import Queue
import sys
import socket
import shutil
reload(s... |
from __future__ import annotations
from dataclasses import dataclass
import logging
import json
import numbers
from typing import (Any, Dict, List, Union, Tuple,
Sequence, TYPE_CHECKING)
from opentrons import config
from opentrons.config import feature_flags as ff
from opentrons_shared_data.pipette ... |
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.admin import dashboard
class Users(horizon.Panel):
name = _("Users")
slug = 'users'
dashboard.Admin.register(Users) |
from collections import OrderedDict
import json
import logging
from copy import deepcopy
from datetime import datetime, timedelta
from six import string_types
import requests
import sqlalchemy as sa
from sqlalchemy import (
Column, Integer, String, ForeignKey, Text, Boolean,
DateTime,
)
from sqlalchemy.orm impo... |
import xml.etree.ElementTree as ET
class brocade_maps_ext(object):
"""Auto generated class.
"""
def __init__(self, **kwargs):
self._callback = kwargs.pop('callback')
def maps_get_all_policy_input_rbridge_id(self, **kwargs):
"""Auto Generated Code
"""
config = ET.Element("... |
'''
cron trigger
@author: Huiyugeng
'''
import datetime
import trigger
class CronTrigger(trigger.Trigger):
def __init__(self, cron):
trigger.Trigger.__init__(self, 0, 1);
self.cron = cron
def _is_match(self):
parser = CronParser(self.cron)
_date = datetime.date.today()
_t... |
from urllib.parse import quote_plus
import praw
QUESTIONS = ['what is', 'who is', 'what are']
REPLY_TEMPLATE = '[Let me google that for you](http://lmgtfy.com/?q={})'
def main():
reddit = praw.Reddit(user_agent='LMGTFY (by /u/USERNAME)',
client_id='CLIENT_ID', client_secret="CLIENT_SECRET",... |
from django.contrib.auth.models import User
from django.core import mail
from django.test.client import RequestFactory
from mock import ANY, patch
from nose.tools import eq_, ok_
from test_utils import TestCase
from remo.dashboard.forms import EmailRepsForm
from remo.profiles.tests import FunctionalAreaFactory, UserFac... |
import os
from django.conf import settings
from django.core.exceptions import PermissionDenied
from django.core.files.storage import FileSystemStorage
from django.forms import Form
from django.template.response import SimpleTemplateResponse
from django.urls import NoReverseMatch
from formtools.wizard.views import Sessi... |
import pytest
from functools import partial
from bluesky.preprocessors import suspend_wrapper
from bluesky.suspenders import (SuspendBoolHigh,
SuspendBoolLow,
SuspendFloor,
SuspendCeil,
Suspen... |
from __future__ import absolute_import
import re
xpath_tokenizer_re = re.compile(
"("
"'[^']*'|\"[^\"]*\"|"
"::|"
"//?|"
r"\.\.|"
r"\(\)|"
r"[/.*:\[\]\(\)@=])|"
r"((?:\{[^}]+\})?[^/\[\]\(\)@=\s]+)|"
r"\s+"
)
def xpath_tokenizer(pattern, namespaces=None):
# ElementTree uses ''... |
"""MethodCaller provider traversal tests."""
from dependency_injector import providers
def test_traverse():
provider1 = providers.Provider()
provided = provider1.provided
method = provided.method
provider = method.call()
all_providers = list(provider.traverse())
assert len(all_providers) == 3
... |
"""Tests for the engine module
"""
import numpy as np
import scipy.sparse as ssp
import re
import mock
from nipype.pipeline.plugins.tools import report_crash
def test_report_crash():
with mock.patch('pickle.dump', mock.MagicMock()) as mock_pickle_dump:
with mock.patch('nipype.pipeline.plugins.tools.format_e... |
import sys, os
extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Diazo'
copyright = u'2011, Plone Foundation'
version = '1.0b1'
release = '1.0b1'
exclude_patterns = ['_build']
pygments_style = 'sphinx'
html_theme = 'haiku'
html_title = "Diazo"
html_static_path = ['_... |
import time
import config
from ophyd import scaler
from ophyd.utils import enum
ScalerMode = enum(ONE_SHOT=0, AUTO_COUNT=1)
loggers = ('ophyd.signal',
'ophyd.scaler',
)
config.setup_loggers(loggers)
logger = config.logger
sca = scaler.EpicsScaler(config.scalers[0])
sca.preset_time.put(5.2, wait=Tr... |
import re
from os.path import join
from setuptools import find_packages
def get():
pkgnames = find_packages()
if len(pkgnames) == 0:
return "unknown"
pkgname = pkgnames[0]
content = open(join(pkgname, "__init__.py")).read()
c = re.compile(r"__version__ *= *('[^']+'|\"[^\"]+\")")
m = c.se... |
"""
Provide functionality to interact with Cast devices on the network.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/media_player.cast/
"""
import logging
import voluptuous as vol
from homeassistant.components.media_player import (
MEDIA_TYPE_MUSIC,... |
from . import resource
class AuthorizationsBase(resource.GitHubResource):
path = 'authorizations'
class Authorization(AuthorizationsBase):
pass
class Authorizations(AuthorizationsBase):
pass |
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import MicrosoftGraphProvider
class MicrosoftGraphTests(OAuth2TestsMixin, TestCase):
provider_id = MicrosoftGraphProvider.id
def get_mocked_response(self):
response_data = """
... |
"""
Function/method decorators that provide timeout and retry logic.
"""
import functools
import itertools
import sys
from devil.android import device_errors
from devil.utils import cmd_helper
from devil.utils import reraiser_thread
from devil.utils import timeout_retry
DEFAULT_TIMEOUT_ATTR = '_default_timeout'
DEFAULT... |
from django.core.urlresolvers import reverse
from django.db import models
from django.db.models import Q
from core.models import TimeStampedModel
from accounts.models import Account
class Board(models.Model):
def __str__(self):
return 'Board Name: ' + self.name
def get_absolute_url(self):
return... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'FeaturedResource'
db.create_table('resources_featuredresource', (
('id', self.gf('django.db.models.fields.A... |
import os
from home.models import ReplicaSet, WhatTorrent, WhatFulltext
def run_checks():
errors = []
warnings = []
# Check WhatFulltext integrity
def check_whatfulltext():
w_torrents = dict((w.id, w) for w in WhatTorrent.objects.defer('torrent_file').all())
w_fulltext = dict((w.id, w) f... |
"""
Some helper functions for workspace stuff
"""
import logging
import re
import biokbase
import biokbase.workspace
from biokbase.workspace import client as WorkspaceClient
g_log = logging.getLogger(__name__)
ws_regex = re.compile('^ws\.(?P<wsid>\d+)\.obj\.(?P<objid>\d+)')
user_id_regex = re.compile('^un=(?P<user_id>\... |
from gramps.gen.plug._pluginreg import *
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
MODULE_VERSION="5.1"
plg = newplugin()
plg.id = 'ancestor_chart,BKI'
plg.name = _("Ancestor Chart")
plg.description = _("Produces a graphical ancestral chart")
plg.version = '1.0'
plg.gram... |
import dns
import os
import socket
import struct
from recursortests import RecursorTest
class testKeepOpenTCP(RecursorTest):
_confdir = 'KeepOpenTCP'
_config_template = """dnssec=validate
packetcache-ttl=10
packetcache-servfail-ttl=10
auth-zones=authzone.example=configs/%s/authzone.zone""" % _confdir
@class... |
import re
from collections import OrderedDict
from odoo import api, fields, models, _
from PIL import Image
from cStringIO import StringIO
import babel
from odoo.tools import html_escape as escape, posix_to_ldml, safe_eval, float_utils
from .qweb import unicodifier
import logging
_logger = logging.getLogger(__name__)
d... |
"""
InaSAFE Disaster risk assessment tool developed by AusAid and World Bank
- **GUI Test Cases.**
Contact : ole.moller.nielsen@gmail.com
.. note:: 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 Founda... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import ast
import base64
import imp
import json
import os
import shlex
import zipfile
from io import BytesIO
from ansible.release import __version__, __author__
from ansible import constants as C
from ansible.errors import AnsibleEr... |
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import json
import sys
from nose.plugins.skip import SkipTest
if sys.version_info < (2, 7):
raise SkipTest("F5 Ansible modules require Python >= 2.7")
from ansible.module_utils.basic import AnsibleModule
try:
from ... |
__license__ = 'GPL v3'
__copyright__ = '2010, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
import json, traceback
from PyQt4.Qt import QDialogButtonBox
from calibre.gui2 import error_dialog, warning_dialog
from calibre.gui2.preferences import ConfigWidgetBase, test_widget
from calibre.gui... |
"""
CubeColourDialog is an alternative implementation of `wx.ColourDialog`.
Description
===========
The CubeColourDialog is an alternative implementation of `wx.ColourDialog`, and it
offers different functionalities with respect to the default wxPython one. It
can be used as a replacement of `wx.ColourDialog` with exac... |
import pytest
from db import testdb
import Abe.util
import Abe.Chain
@pytest.fixture(scope="module")
def btc200(testdb):
btc_chain = Abe.Chain.create('Bitcoin')
blocks = []
for hex in _blocks():
ds = Abe.util.str_to_ds(hex.decode('hex'))
hash = btc_chain.ds_block_header_hash(ds)
b = ... |
from osv import osv, fields
from datetime import datetime
from tools.translate import _
from log import *
class csb_19(osv.osv):
_name = 'csb.19'
_auto = False
def _cabecera_presentador_19(self,cr,uid):
converter = self.pool.get('payment.converter.spain')
texto = '5180'
texto += (sel... |
import radon.complexity
import radon.visitors
from coalib.bears.LocalBear import LocalBear
from coalib.results.Result import Result
from coalib.results.RESULT_SEVERITY import RESULT_SEVERITY
from coalib.results.SourceRange import SourceRange
from coalib.settings.Setting import typed_list
class RadonBear(LocalBear):
... |
"""
Instructor Views
"""
from contextlib import contextmanager
import csv
import json
import logging
import os
import re
import requests
from collections import defaultdict, OrderedDict
from markupsafe import escape
from requests.status_codes import codes
from StringIO import StringIO
from django.conf import settings
f... |
from spack import *
class Gengeo(AutotoolsPackage):
"""GenGeo is a library of tools for creating complex particle
geometries for use in ESyS-Particle simulations. GenGeo is a standalone
application with a Python API that creates geometry files suitable for
importing into ESyS-Particle simulations. The f... |
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
determine_ext,
float_or_none,
int_or_none,
)
class JWPlatformBaseIE(InfoExtractor):
@staticmethod
def _find_jwplayer_data(webpage):
# TODO: Merge this with JWPlayer-related codes in gene... |
import json
from six.moves.urllib.parse import quote, unquote
import tarfile
from xml.sax import saxutils
from time import time
from eventlet import sleep
import zlib
from swift.common.swob import Request, HTTPBadGateway, \
HTTPCreated, HTTPBadRequest, HTTPNotFound, HTTPUnauthorized, HTTPOk, \
HTTPPreconditionF... |
"""
This module contains a Google Speech to Text operator.
"""
from typing import Optional
from google.api_core.retry import Retry
from google.cloud.speech_v1.types import RecognitionConfig
from airflow import AirflowException
from airflow.models import BaseOperator
from airflow.providers.google.cloud.hooks.speech_to_t... |
"""Copyright 2008 Orbitz WorldWide
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 applicable law or agreed to in writing, software... |
import uuid
from tempest_lib import exceptions as lib_exc
from tempest.api.identity import base
from tempest.common.utils import data_utils
from tempest import test
class TenantsNegativeTestJSON(base.BaseIdentityV2AdminTest):
@test.attr(type=['negative'])
@test.idempotent_id('ca9bb202-63dd-4240-8a07-8ef9c19c04b... |
import time
from oslo.config import cfg
import requests
from neutron.common import exceptions as n_exc
from neutron.common import utils
from neutron.extensions import portbindings
from neutron.openstack.common import excutils
from neutron.openstack.common import jsonutils
from neutron.openstack.common import log
from n... |
from __future__ import absolute_import, division, print_function
from functools import partial
import locale
import logging
import os
import ctypes
from ctypes import c_char_p, c_wchar_p
from ctypes import c_int, c_longlong
from ctypes import c_size_t, c_ssize_t
from ctypes import c_void_p
from ctypes import POINTER
fr... |
import os
import shutil
import sys
import unittest
import uuid
from pyflink.pyflink_gateway_server import on_windows
from pyflink.table import DataTypes
from pyflink.table.udf import udf
from pyflink.testing import source_sink_utils
from pyflink.testing.test_case_utils import (PyFlinkBlinkStreamTableTestCase,
... |
"""Constants for the Vilfo Router integration."""
from __future__ import annotations
from dataclasses import dataclass
from homeassistant.components.sensor import SensorEntityDescription
from homeassistant.const import DEVICE_CLASS_TIMESTAMP, PERCENTAGE
DOMAIN = "vilfo"
ATTR_API_DATA_FIELD_LOAD = "load"
ATTR_API_DATA_F... |
"""The Brother component."""
from __future__ import annotations
from datetime import timedelta
import logging
from brother import Brother, DictToObj, SnmpError, UnsupportedModel
import pysnmp.hlapi.asyncio as SnmpEngine
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_HOST, CONF... |
from pulsar.tools.authorization import get_authorizer
from .test_utils import get_test_toolbox, TestCase
def test_allow_any_authorization():
authorizer = get_authorizer(None)
authorization = authorizer.get_authorization('tool1')
authorization.authorize_setup()
authorization.authorize_tool_file('cow', '#... |
import collections
from . import _jclass
class _WrappedIterator(object):
"""
Wraps a Java iterator to respect the Python 3 iterator API
"""
def __init__(self, iterator):
self.iterator = iterator
def __iter__(self):
return self.iterator
def __next__(self):
return next(self... |
import django
if django.VERSION >= (3, 2):
# The declaration is only needed for older Django versions
pass
else:
default_app_config = (
"wagtail.contrib.simple_translation.apps.SimpleTranslationAppConfig"
) |
"""
sentry.interfaces.template
~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
__all__ = ('Template',)
from sentry.interfaces.base import Interface, InterfaceValidationError
fro... |
import hou
import IECore
import IECoreHoudini
import unittest
import os
class TestFromHoudiniPointsConverter( IECoreHoudini.TestCase ) :
def createBox( self ) :
obj = hou.node("/obj")
geo = obj.createNode("geo", run_init_scripts=False)
box = geo.createNode( "box" )
return box
def createTorus( self ) :
obj =... |
from . import Pmod_DevMode
from . import PMOD_SWCFG_DIOALL
from . import PMOD_DIO_BASEADDR
from . import PMOD_DIO_TRI_OFFSET
from . import PMOD_DIO_DATA_OFFSET
from . import PMOD_CFG_DIO_ALLOUTPUT
from . import PMOD_NUM_DIGITAL_PINS
__author__ = "Graham Schelle, Giuseppe Natale, Yun Rock Qu"
__copyright__ = "Copyright ... |
"""
Demonstrates how the bz2 module may be used to create a compressed object
which represents a bitarray.
"""
import bz2
from bitarray import bitarray
def compress(ba):
"""
Given a bitarray, return an object which represents all information
within the bitarray in a compresed form.
The function `decompr... |
''' Functions for arranging bokeh Layout objects.
'''
from __future__ import absolute_import
from .core.enums import Location, SizingMode
from .models.tools import ToolbarBox
from .models.plots import Plot
from .models.layouts import LayoutDOM, Row, Column, Spacer, WidgetBox
from .models.widgets import Widget
from .uti... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.