code stringlengths 6 947k | repo_name stringlengths 5 100 | path stringlengths 4 226 | language stringclasses 1
value | license stringclasses 15
values | size int64 6 947k |
|---|---|---|---|---|---|
# Copyright 2013 OpenStack Foundation
# 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 requ... | ntymtsiv/tempest | tempest/api/network/base_security_groups.py | Python | apache-2.0 | 2,428 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Telefónica Investigación y Desarrollo, S.A.U
#
# This file is part of FI-WARE project.
#
# 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:
#
# ... | telefonicaid/fiware-facts | tests/acceptance/features/component/steps/multi_tenancy.py | Python | apache-2.0 | 7,996 |
"""
Provides all the logic to construct the `sklearn` wrappers from standard H2O estimators or transformers.
The only requirements from the original estimator are the following:
- it must have a `train` method (equivalent of `sklearn` `fit` method).
- `train` must accept `h2o.H2OFrame` as `training_frame` param.
""... | michalkurka/h2o-3 | h2o-py/h2o/sklearn/wrapper.py | Python | apache-2.0 | 36,985 |
# -*- coding: utf-8 -*-
""" recording warnings during test function execution. """
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import inspect
import re
import sys
import warnings
import six
import _pytest._code
from _pytest.deprecated import PYTEST_WAR... | kawamon/hue | desktop/core/ext-py/pytest-4.6.11/src/_pytest/recwarn.py | Python | apache-2.0 | 9,347 |
# Copyright 2013 Google Inc. 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 applicable law or ... | henrymp/coursebuilder | modules/dashboard/unit_lesson_editor.py | Python | apache-2.0 | 31,883 |
# Copyright 2016 OpenStack Foundation
#
# 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 ... | priya-pp/Tacker | tacker/db/migration/alembic_migrations/versions/5246a6bd410f_multisite_vim.py | Python | apache-2.0 | 2,711 |
import zstackwoodpecker.test_state as ts_header
TestAction = ts_header.TestAction
def path():
return dict(initial_formation="template2", path_list=[[TestAction.create_volume, "volume1", "=scsi"], [TestAction.attach_volume, "vm1", "volume1"], [TestAction.create_volume, "volume2", "=scsi"], [TestAction.attach_volume,... | zstackorg/zstack-woodpecker | integrationtest/vm/multihosts/volumes/paths/path59.py | Python | apache-2.0 | 814 |
# pyOCD debugger
# Copyright (c) 2017-2019 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... | pyocd/pyOCD | pyocd/utility/progress.py | Python | apache-2.0 | 4,303 |
# -*- coding: utf-8 -*-
__all__ = [
'Fraction',
]
class Fraction(object):
def __init__(self, numerator, denominator):
self._numerator = numerator
self._denominator = denominator
@property
def numerator(self):
return self._numerator
@property
def denominator(self):
... | simone-campagna/daikon | test_zirkon/tfractions/fraction_type.py | Python | apache-2.0 | 610 |
"""
maxminddb.decoder
~~~~~~~~~~~~~~~~~
This package contains code for decoding the MaxMind DB data section.
"""
from __future__ import unicode_literals
import struct
from maxminddb.compat import byte_from_int, int_from_bytes
from maxminddb.errors import InvalidDatabaseError
class Decoder(object): # pylint: disa... | kikinteractive/MaxMind-DB-Reader-python | maxminddb/decoder.py | Python | apache-2.0 | 5,904 |
import re
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, FormRequest, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from product_spiders.items import Product, ProductLoader
class TyresCoUk(Base... | 0--key/lib | portfolio/Python/scrapy/topgeartrading/4x4tyrescouk.py | Python | apache-2.0 | 2,085 |
#!/usr/local/bin/python
###################################################
# Jeffrey Herbstman
# nerv3.py
# Goal: Named entity recognition script to pull names/place from text
# called as python nerv3.py text_path_or_file
#
# Inputs:
# path - text file or directory containing text files
# output - output file name
# O... | fredzannarbor/pagekicker-community | scripts_python_3/bin/nerv35.py | Python | apache-2.0 | 2,890 |
# Copyright 2014 Cloudbase Solutions SRL
# 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 r... | rdo-management/neutron | neutron/tests/unit/hyperv/test_hyperv_security_groups_driver.py | Python | apache-2.0 | 7,747 |
# Copyright The Cloud Custodian Authors.
# SPDX-License-Identifier: Apache-2.0
"""Cloud Watch Log Subscription Email Relay
"""
import argparse
import itertools
import logging
import sys
from c7n.credentials import SessionFactory
from c7n.mu import LambdaManager
from c7n.ufuncs import logsub
log = logging.getLogger("... | thisisshi/cloud-custodian | tools/ops/logsetup.py | Python | apache-2.0 | 2,623 |
# -*- coding: utf-8 -*-
#
# Copyright 2015 Red Hat, Inc.
# 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... | redhat-cip/hardware | hardware/tests/test_benchmark_mem.py | Python | apache-2.0 | 5,424 |
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
def glrm_benign():
print "Importing benign.csv data..."
benignH2O = h2o.upload_file(pyunit_utils.locate("smalldata/logreg/benign.csv"))
benignH2O.describe()
for i... | madmax983/h2o-3 | h2o-py/tests/testdir_algos/glrm/pyunit_benign_glrm.py | Python | apache-2.0 | 663 |
#!/usr/bin/env python
# Copyright 2016 Criteo
#
# 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 agree... | natbraun/biggraphite | tests/test_drivers_utils.py | Python | apache-2.0 | 1,554 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | dhalperi/incubator-beam | sdks/python/apache_beam/runners/dataflow/internal/dependency_test.py | Python | apache-2.0 | 16,895 |
"""This module implements the primitives of the Scheme language."""
import math
import operator
import sys
import numbers
import re
try:
import turtle
except:
print("warning: could not import the turtle module.", file=sys.stderr)
#############################
# Errors and Error Checking #
###################... | MicBrain/Scheme-Interpreter | scheme_primitives.py | Python | apache-2.0 | 27,263 |
#!/usr/bin/env python
# Copyright 2013-present Barefoot Networks, Inc.
#
# 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... | Peilong/p4factory | targets/switch/run_tests.py | Python | apache-2.0 | 1,140 |
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache/libcloud | libcloud/backup/base.py | Python | apache-2.0 | 15,294 |
import re
import os
from scrapy.spider import BaseSpider
from scrapy.selector import HtmlXPathSelector
from scrapy.http import Request, HtmlResponse
from scrapy.utils.response import get_base_url
from scrapy.utils.url import urljoin_rfc
from urllib import urlencode
import csv
from product_spiders.items import Produc... | 0--key/lib | portfolio/Python/scrapy/myotcstore/drugstore.py | Python | apache-2.0 | 3,135 |
# Copyright (c) 2016 PaddlePaddle 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 applic... | luotao1/Paddle | python/paddle/batch.py | Python | apache-2.0 | 2,180 |
# Copyright 2016 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
"""Implements authentication based on LUCI machine tokens.
LUCI machine tokens are short lived signed protobuf blobs that (among other
informatio... | luci/luci-py | appengine/components/components/auth/machine_auth.py | Python | apache-2.0 | 7,005 |
# -*- coding: utf-8 -*-
# Copyright (c) 2015, Michael Droettboom All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
# notice, t... | mdboom/freetypy | lib/freetypy/tests/test_truetype.py | Python | bsd-2-clause | 4,807 |
# Copyright (c) 2015, 2014 Computational Molecular Biology Group, Free University
# Berlin, 14195 Berlin, Germany.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source ... | arokem/PyEMMA | pyemma/coordinates/tests/test_numpyfilereader.py | Python | bsd-2-clause | 5,975 |
__version__ = '0.5.0.dev0+git'
| bjodah/pycompilation | pycompilation/_release.py | Python | bsd-2-clause | 31 |
# -*- coding: utf-8 -*-
#
# Copyright (C) 2011 Alexander Shorin
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
| kxepal/phoxpy | phoxpy/tests/modules/__init__.py | Python | bsd-3-clause | 216 |
"""
Local winner-take-all layer.
"""
__author__ = "Da Xiao, Ian Goodfellow, Minh Ngoc Le"
from functools import wraps
import numpy
from theano import tensor as T
from pylearn2.models.mlp import Linear, Layer
def lwta(p, block_size):
"""
Apply hard local winner-take-all on every rows of a theano matrix.
... | ml-lab/pylearn2 | pylearn2/models/lwta.py | Python | bsd-3-clause | 2,297 |
from urllib.parse import urlsplit
from django.contrib import messages
from django.core.exceptions import ObjectDoesNotExist
from django.core.urlresolvers import reverse
from django.db import IntegrityError, transaction
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from conne... | nlhkabu/connect | connect/accounts/view_utils.py | Python | bsd-3-clause | 2,407 |
import deepdish as dd
class Foo(dd.util.SaveableRegistry):
def __init__(self, x):
self.x = x
@classmethod
def load_from_dict(self, d):
obj = Foo(d['x'])
return obj
def save_to_dict(self):
return {'x': self.x}
@Foo.register('bar')
class Bar(Foo):
def __init__(self... | agarbuno/deepdish | doc/source/codefiles/saveable_example.py | Python | bsd-3-clause | 542 |
import itertools
from twisted.internet import defer
from twisted.trial import unittest
from kontiki import persist
from kontiki.test.common import dropResult
firstEntries = [persist.LogEntry(term=0, command='first1'),
persist.LogEntry(term=0, command='first2'),
persist.LogEntry(term=1,... | matthewnorman/kon_tiki | kontiki/test/test_persist.py | Python | bsd-3-clause | 18,457 |
"""
Goal: set the environment for tests
Docs:
https://pythonhosted.org/Flask-SQLAlchemy/quickstart.html
The only things you need to know compared to plain SQLAlchemy are:
SQLAlchemy gives you access to the following things:
- all the functions and classes from sqlalchemy and sqlalchemy.orm
- a preconfigured scope... | indera/barebones-flask-app | tests/base_test.py | Python | bsd-3-clause | 1,403 |
#!/usr/bin/env python
"""Vandermonde matrix example
Demonstrates matrix computations using the Vandermonde matrix.
* http://en.wikipedia.org/wiki/Vandermonde_matrix
"""
from sympy import Matrix, pprint, Rational, sqrt, symbols, Symbol, zeros
def symbol_gen(sym_str):
"""Symbol generator
Generates sym_str_... | flacjacket/sympy | examples/intermediate/vandermonde.py | Python | bsd-3-clause | 4,652 |
"""
==============================================
Discrete Fourier transforms (:mod:`scipy.fft`)
==============================================
.. currentmodule:: scipy.fft
Fast Fourier Transforms (FFTs)
==============================
.. autosummary::
:toctree: generated/
fft - Fast (discrete) Fourier Transf... | jor-/scipy | scipy/fft/__init__.py | Python | bsd-3-clause | 3,965 |
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
``fitsheader`` is a command line script based on astropy.io.fits for printing
the header(s) of one or more FITS file(s) to the standard output in a human-
readable format.
Example uses of fitsheader:
1. Print the header of all the HDUs of a .fits fil... | DougBurke/astropy | astropy/io/fits/scripts/fitsheader.py | Python | bsd-3-clause | 12,441 |
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
log = logging.getLogger('VizTimeLine')
log.setLevel(logging.ERROR)
log.addHandler(NullHandler())
import VizMorris
class VizTimeLine(VizMorris.VizMorris):
#======================== header ==================... | twatteyne/dustlink_academy | views/web/dustWeb/viz/VizTimeLine.py | Python | bsd-3-clause | 3,559 |
# -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-14 17:20
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateMode... | richardcornish/django-paywall | regwall/tests/articles/migrations/0001_initial.py | Python | bsd-3-clause | 1,053 |
# coding=utf-8
"""
The Automations API endpoint actions
Note: This is a paid feature
Documentation: http://developer.mailchimp.com/documentation/mailchimp/reference/automations/
"""
from __future__ import unicode_literals
from mailchimp3.baseapi import BaseApi
class AutomationActions(BaseApi):
"""
Actions ... | charlesthk/python-mailchimp | mailchimp3/entities/automationactions.py | Python | mit | 1,368 |
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | BurtBiel/autorest | AutoRest/Generators/Python/Azure.Python.Tests/Expected/AcceptanceTests/AzureReport/autorestreportserviceforazure/auto_rest_report_service_for_azure.py | Python | mit | 5,023 |
# Copyright 2015 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... | xuleiboy1234/autoTitle | tensorflow/tensorflow/python/ops/math_ops.py | Python | mit | 83,640 |
x = 4
a = lambda: x
# Perhaps it once made sense to someone why c and d see the inner x
# but a and b do not.
print(''.join(
# generator expression
'{}{}{} {}{}{}{}\n'.format(i, j, k, a(), b(), c(), d())
for i, b in enumerate([a, lambda: x, a])
for j, c in enumerate([b, lambda: x, b])
for k, d in... | csvoss/onelinerizer | tests/scope_comprehension.py | Python | mit | 1,199 |
# adapters/tensorflow module initialization goes here...
| jensenbox/singnet | agent/adapters/tensorflow/__init__.py | Python | mit | 57 |
from pythonforandroid.toolchain import Bootstrap, current_directory, info, info_main, shprint
from pythonforandroid.util import ensure_dir
from os.path import join
import sh
class WebViewBootstrap(Bootstrap):
name = 'webview'
recipe_depends = list(
set(Bootstrap.recipe_depends).union({'genericndkbuil... | germn/python-for-android | pythonforandroid/bootstraps/webview/__init__.py | Python | mit | 1,982 |
import os
from IPython.lib import passwd
c.NotebookApp.ip = '*'
c.NotebookApp.port = int(os.getenv('PORT', 8888))
c.NotebookApp.open_browser = False
c.MultiKernelManager.default_kernel_name = 'python3'
c.NotebookApp.password = u'sha1:035a13e895a5:8a3398f1576a32cf938f9236db03f5e8668356c5'
| ec2ainun/skripsiTF | DeepLforServer(GPU)/jupyter_notebook_config.py | Python | mit | 290 |
from django.contrib import admin
from django.utils.translation import ugettext_lazy as _
from reviewboard.attachments.models import FileAttachment
class FileAttachmentAdmin(admin.ModelAdmin):
list_display = ('file', 'caption', 'mimetype',
'review_request_id')
list_display_links = ('file',... | Khan/reviewboard | reviewboard/attachments/admin.py | Python | mit | 582 |
# #START_LICENSE###########################################################
#
#
# This file is part of the Environment for Tree Exploration program
# (ETE). http://etetoolkit.org
#
# ETE is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# t... | sauloal/cnidaria | scripts/venv/lib/python2.7/site-packages/ete2/__init__.py | Python | mit | 2,644 |
#!/usr/bin/env python
import argparse
import errno
import os
import subprocess
import sys
import tempfile
from lib.config import PLATFORM, get_target_arch, get_chromedriver_version, \
get_platform_key, get_env_var
from lib.util import electron_gyp, execute, get_electron_version, \
... | jhen0409/electron | script/upload.py | Python | mit | 7,881 |
class Zipper(object):
@staticmethod
def from_tree(tree):
pass
def value(self):
pass
def set_value(self):
pass
def left(self):
pass
def set_left(self):
pass
def right(self):
pass
def set_right(self):
pass
def up(self):
... | N-Parsons/exercism-python | exercises/zipper/zipper.py | Python | mit | 367 |
# This file is part of Indico.
# Copyright (C) 2002 - 2021 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.modules.events.management.views import WPEventManagement
from indico.modules.events.views impo... | pferreir/indico | indico/modules/events/surveys/views.py | Python | mit | 1,351 |
import os
import unittest
from cupy.cuda import compiler
class NvccNotFoundTest(unittest.TestCase):
def setUp(self):
self.path = os.environ.pop('PATH', '')
def tearDown(self):
os.environ['PATH'] = self.path
def test_nvcc_without_command(self):
# Check that error message include... | truongdq/chainer | tests/cupy_tests/cuda_tests/test_compiler.py | Python | mit | 630 |
import json
from django.db import models
from django.conf import settings
from django.utils.six import with_metaclass, text_type
from django.utils.translation import ugettext_lazy as _
from . import SirTrevorContent
from .forms import SirTrevorFormField
class SirTrevorField(with_metaclass(models.SubfieldBase, models.... | zerc/django-sirtrevor | sirtrevor/fields.py | Python | mit | 974 |
class LSA(object):
def __init__(self,input_path,output_path):
super(LSA,self).__init__()
self.input_path = input_path
self.output_path = output_path
self.hpfx = 'k, bins: [' | scottdaniel/LatentStrainAnalysis | LSA/LSA.py | Python | mit | 182 |
# vim:set fileencoding=utf-8
#
# Copyright (C) 2015 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distribute... | dashea/anaconda | tests/pyanaconda_tests/user_create_test.py | Python | gpl-2.0 | 15,039 |
from os import system, popen, path as os_path, listdir
from re import compile as re_compile, search as re_search
from socket import *
from enigma import eConsoleAppContainer
from Components.Console import Console
from Components.PluginComponent import plugins
from Plugins.Plugin import PluginDescriptor
class Network:
... | kakunbsc/enigma2.4 | lib/python/Components/Network.py | Python | gpl-2.0 | 20,526 |
# vim: expandtab ts=4 sw=4 sts=4 fileencoding=utf-8:
#
# Copyright (C) 2007-2010 GNS3 Development Team (http://www.gns3.net/team).
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation;
#
#... | GNS3/gns3-legacy | src/GNS3/Link/PipeCapture.py | Python | gpl-2.0 | 3,431 |
import os.path
from pcs.common import file_type_codes as code
from pcs.common.file import FileMetadata
_metadata = {
code.BOOTH_CONFIG: lambda path: FileMetadata(
file_type_code=code.BOOTH_CONFIG,
path=path,
owner_user_name=None,
owner_group_name=None,
permissions=None,
... | tomjelinek/pcs | pcs/cli/file/metadata.py | Python | gpl-2.0 | 1,201 |
# Copyright (C) 2021 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | puremourning/ycmd-1 | ycmd/tests/cs/__init__.py | Python | gpl-3.0 | 4,611 |
"""Test PbenchConfig class and objects
"""
import pytest
from pathlib import Path
from pbench import PbenchConfig
from pbench.common.exceptions import BadConfig
_config_path_prefix = Path("lib/pbench/test/unit/common/config")
class TestPbenchConfig:
def test_empty_config(self):
config = PbenchConfig(... | ndokos/pbench | lib/pbench/test/unit/common/test_config.py | Python | gpl-3.0 | 2,638 |
from mock import patch, call
import mock
from lxml import etree
from kiwi.solver.repository.rpm_md import SolverRepositoryRpmMd
from kiwi.solver.repository.base import SolverRepositoryBase
class TestSolverRepositoryRpmMd:
def setup(self):
self.xml_data = etree.parse('../data/repomd.xml')
self.u... | SUSE/kiwi | test/unit/solver/repository/rpm_md_test.py | Python | gpl-3.0 | 1,668 |
#!/usr/bin/env python -t
# -*- coding: utf-8 -*-
# Copyright (C) 2015 Jonathan Delvaux <pyshell@djoproject.net>
# 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... | djoproject/pyshell | pyshell/utils/test/misc_test.py | Python | gpl-3.0 | 2,472 |
import string
import asyncio
import re
from sqlalchemy import Table, Column, String
import requests
from cloudbot import hook
from cloudbot.util import botvars, colors, web
re_lineends = re.compile(r'[\r\n]*')
FACTOID_CHAR = "?" # TODO: config
table = Table(
"mem",
botvars.metadata,
Column("word", St... | nidhididi/CloudBot | plugins/factoids.py | Python | gpl-3.0 | 5,516 |
#!/usr/bin/python3
#
# Get list of repo contributors from GitHub using v4 GraphQL API
#
# Copyright (C) 2018 - Brad Parker
#
# 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 t... | GregorR/RetroArch | github-contributors.py | Python | gpl-3.0 | 2,716 |
# -*- encoding: utf-8 -*-
"""
Usage::
hammer module-stream [OPTIONS] SUBCOMMAND [ARG] ...
Parameters::
SUBCOMMAND subcommand
[ARG] ... subcommand arguments
Subcommands::
info Show a module-stream
list List ... | ldjebran/robottelo | robottelo/cli/module_stream.py | Python | gpl-3.0 | 494 |
import os
import string
import random
from fabric.api import env
from fabric.colors import green
from literals import (DEFAULT_INSTALL_PATH, DEFAULT_VIRTUALENV_NAME,
DEFAULT_REPOSITORY_NAME, DEFAULT_OS, OS_CHOICES,
DEFAULT_DATABASE_MANAGER, DB_CHOICES, DEFAULT_DATABASE_NAME,
DEFAULT_WEBSERVER, WEB_CHOIC... | appsembler/mayan_appsembler | fabfile/conf.py | Python | gpl-3.0 | 2,675 |
""" Tools for reading Mac resource forks. """
from __future__ import print_function, division, absolute_import
from fontTools.misc.py23 import *
import struct
from fontTools.misc import sstruct
from collections import OrderedDict
try:
from collections.abc import MutableMapping
except ImportError:
from UserDict import... | MitchTalmadge/Emoji-Tools | src/main/resources/PythonScripts/fontTools/misc/macRes.py | Python | gpl-3.0 | 6,563 |
import logging
import re
from datetime import datetime, timedelta
from django.conf import settings
import calendar
logger = logging.getLogger(__name__)
DATETIME_REGEX = re.compile('^(?P<year>\d{4})-(?P<month>\d{2})-(?P<day>\d{2})(T|\s+)(?P<hour>\d{2}):(?P<minute>\d{2}):(?P<second>\d{2}).*?$')
YEAR_MONTH_REGEX = re.co... | Squishymedia/feedingdb | django-faceted-search/faceted_search/utils.py | Python | gpl-3.0 | 2,983 |
from flask.ext.restplus import Namespace
from app.api.tickets import ORDER, TICKET
from app.helpers.ticketing import TicketingManager
from app.api.helpers.helpers import (
requires_auth,
can_access, replace_event_id)
from app.api.helpers.utils import POST_RESPONSES
from app.api.helpers.utils import Resource
f... | SaptakS/open-event-orga-server | app/api/attendees.py | Python | gpl-3.0 | 2,552 |
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
from socorro.unittest.cron.setup_configman import (
get_config_manager_for_crontabber,
)
from crontabber.tests impo... | AdrianGaudebert/socorro | socorro/unittest/cron/jobs/base.py | Python | mpl-2.0 | 1,178 |
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | kmee/bank-statement-reconcile | __unported__/account_invoice_reference/__openerp__.py | Python | agpl-3.0 | 6,213 |
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2020, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | numenta/nupic.research | src/nupic/research/frameworks/vernon/interfaces/__init__.py | Python | agpl-3.0 | 1,076 |
# -*- coding: utf-8 -*-
import numpy as np
import scipy.stats as stat
import os
from rmtk.vulnerability.common import utils
from rmtk.vulnerability.mdof_to_sdof import sdof_utils
pi = 3.141592653589793
from rmtk.vulnerability.derivation_fragility.R_mu_T_no_dispersion.dolsek_fajfar.get_spo2ida_parameters import get_spo... | mabevillar/rmtk | rmtk/vulnerability/derivation_fragility/R_mu_T_no_dispersion/dolsek_fajfar/DF2004.py | Python | agpl-3.0 | 13,465 |
from pyExcelerator import ExcelFormulaParser, ExcelFormula
import sys
f = ExcelFormula.Formula(
""" -((1.80 + 2.898 * 1)/(1.80 + 2.898))*
AVERAGE((1.80 + 2.898 * 1)/(1.80 + 2.898);
(1.80 + 2.898 * 1)/(1.80 + 2.898);
(1.80 + 2.898 * 1)/(1.80 + 2.898)) +
SIN(PI()/4)""")
#for t in f.rpn():
# print ... | aaronsw/watchdog | vendor/pyExcelerator-0.6.3a/examples/parse-fmla.py | Python | agpl-3.0 | 376 |
# Copyright 2015, 2017 Jairo Llopis <jairo.llopis@tecnativa.com>
# Copyright 2016 Tecnativa, S.L. - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo.tests.common import TransactionCase
from odoo.exceptions import UserError
class BasicCase(TransactionCase):
def setUp(se... | brain-tec/server-tools | datetime_formatter/tests/test_best_matcher.py | Python | agpl-3.0 | 2,584 |
#!/usr/bin/python
import sys
import logging
#logging.basicConfig(level = logging.DEBUG)
from gi.repository import Vips, GObject
# Search for all VipsOperation which don't have an input image object ... these
# should be class methods and need to have their names pasted into Vips.py
# This is slow :-( so we don't d... | leiyangyou/libvips | python/find_class_methods.py | Python | lgpl-2.1 | 1,412 |
##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | TheTimmy/spack | var/spack/repos/builtin/packages/simul/package.py | Python | lgpl-2.1 | 2,009 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRgexf(RPackage):
"""Create, read and write GEXF (Graph Exchange XML Format) graph files
... | iulian787/spack | var/spack/repos/builtin/packages/r-rgexf/package.py | Python | lgpl-2.1 | 1,241 |
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
class PyWebsocketClient(PythonPackage):
"""WebSocket client for Python. hybi13 is supported."""
homepage = "http... | rspavel/spack | var/spack/repos/builtin/packages/py-websocket-client/package.py | Python | lgpl-2.1 | 997 |
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
"""
oauthlib.oauth2.rfc6749.parameters
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module contains methods related to `Section 4`_ of the OAuth 2 RFC.
.. _`Section 4`: http://tools.ietf.org/html/rfc6749#section-4
"""
import json
try:
i... | dakiri/splunk-app-twitter | twitter2/bin/oauthlib/oauth2/rfc6749/parameters.py | Python | apache-2.0 | 12,583 |
"""Support ezviz camera devices."""
from __future__ import annotations
import logging
from pyezviz.exceptions import HTTPError, InvalidHost, PyEzvizError
import voluptuous as vol
from homeassistant.components import ffmpeg
from homeassistant.components.camera import PLATFORM_SCHEMA, SUPPORT_STREAM, Camera
from homea... | jawilson/home-assistant | homeassistant/components/ezviz/camera.py | Python | apache-2.0 | 11,868 |
#
# Copyright (c) 2008-2015 Citrix Systems, Inc.
#
# 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 l... | benfinke/ns_python | nssrc/com/citrix/netscaler/nitro/resource/config/system/systementitytype_args.py | Python | apache-2.0 | 1,188 |
input = """
% No auxiliary atoms at all.
ouch :- #max{V:a(V)} = 0.
"""
output = """
{}
"""
| Yarrick13/hwasp | tests/wasp1/AllAnswerSets/aggregates_max_bug_1.test.py | Python | apache-2.0 | 92 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is subject to the terms and conditions defined in
# file 'LICENSE.md', which is part of this source code package.
#
from kubernetes_py.utils import is_valid_string, filter_model
from kubernetes_py.models.v1.ContainerState import ContainerState
class Contai... | mnubo/kubernetes-py | kubernetes_py/models/v1/ContainerStatus.py | Python | apache-2.0 | 5,514 |
#!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... | zouzhberk/ambaridemo | demo-server/src/main/python/setupAgent.py | Python | apache-2.0 | 15,510 |
#!/usr/bin/env impala-python
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (... | michaelhkw/incubator-impala | testdata/bin/random_avro_schema.py | Python | apache-2.0 | 6,014 |
"""HTTP related errors."""
from asyncio import TimeoutError
__all__ = (
'DisconnectedError', 'ClientDisconnectedError', 'ServerDisconnectedError',
'HttpProcessingError', 'BadHttpMessage',
'HttpMethodNotAllowed', 'HttpBadRequest', 'HttpProxyError',
'BadStatusLine', 'LineTooLong', 'InvalidHeader',
... | esaezgil/aiohttp | aiohttp/errors.py | Python | apache-2.0 | 4,390 |
# -*- coding: utf-8 -*-
from typing import Optional, Text
from mock import MagicMock, patch
from zerver.lib.test_classes import WebhookTestCase
from zerver.lib.webhooks.git import COMMITS_LIMIT
class GogsHookTests(WebhookTestCase):
STREAM_NAME = 'commits'
URL_TEMPLATE = "/api/v1/external/gogs?&api_key={api_k... | mahim97/zulip | zerver/webhooks/gogs/tests.py | Python | apache-2.0 | 7,893 |
import unittest
import transaction
from pyramid import testing
from climasng.tests import ProseMakerTestCase
from climasng.parsing.prosemaker import ProseMaker
# ===================================================================
class TestProseMakerConditions(ProseMakerTestCase):
# ----------------------------... | DanielBaird/climas-global | webapp/climasng/tests/test_prosemaker_conditions_nonnum.py | Python | apache-2.0 | 2,470 |
# Copyright 2018 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... | AnishShah/tensorflow | tensorflow/contrib/data/python/ops/sliding.py | Python | apache-2.0 | 5,041 |
import os, sys, shutil, glob, numpy, csv, cPickle
import scipy.io.wavfile as wavfile
import audioBasicIO
import audioTrainTest as aT
import audioSegmentation as aS
import matplotlib.pyplot as plt
import scipy.spatial.distance
minDuration = 7;
def classifyFolderWrapper(inputFolder, modelType, modelName, outputMode=Fals... | raman-sharma/pyAudioAnalysis | analyzeMovieSound.py | Python | apache-2.0 | 6,014 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License... | sparkslabs/kamaelia_ | Tests/Python/Axon/test_Ipc.py | Python | apache-2.0 | 8,217 |
#!/usr/bin/env python
#
# Copyright 2015 Flavio Garcia
#
# 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 ... | piraz/diasporapy | podship/test/services/account.py | Python | apache-2.0 | 1,299 |
# Copyright 2016 Cloudbase Solutions Srl
# 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 r... | stefan-caraiman/cloudbase-init-ci | argus/unit_tests/backends/tempest/test_cloud.py | Python | apache-2.0 | 13,589 |
# vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2011 Cisco Systems, Inc. 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... | wallnerryan/quantum_migrate | quantum/plugins/cisco/nexus/cisco_nexus_configuration.py | Python | apache-2.0 | 1,227 |
import platform
if platform.system().lower() != 'windows':
GREEN = "\33[32m"
RED = "\33[31m"
NO_COLOR = "\33[0m"
BOLD="\33[1m"
else:
GREEN = ""
NO_COLOR = ""
RED = ""
BOLD = "" | induane/stomp.py3 | stomp/colors.py | Python | apache-2.0 | 219 |
"""
Cron execution modules.
The modules under this package do the actual cron execution.
"""
from treadmill import cron
CRON_EXEC_MODULE = '{}.run'.format(cron.CRON_MODULE)
| keithhendry/treadmill | treadmill/cron/run/__init__.py | Python | apache-2.0 | 175 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | GabrielBrascher/cloudstack | test/integration/component/test_stopped_vm.py | Python | apache-2.0 | 58,065 |
# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
# Copyright 2013 Red Hat, Inc.
#
# 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/licens... | citrix-openstack-build/oslo.messaging | oslo/messaging/notify/_impl_noop.py | Python | apache-2.0 | 811 |
import os.path
import platform
from nose2.compat import unittest
from nose2.tests._common import FunctionalTestCase
class TestCoverage(FunctionalTestCase):
@unittest.skipIf(
platform.python_version_tuple()[:2] == ('3', '2'),
'coverage package does not support python 3.2')
def test_run(self):
... | usc-isi-i2/WEDC | spark_dependencies/python_lib/nose2/tests/functional/test_coverage.py | Python | apache-2.0 | 878 |
import re
from streamlink.compat import urlparse
from streamlink.plugin import Plugin
from streamlink.plugin.api import http, validate
from streamlink.stream import HLSStream, RTMPStream
CHINFO_URL = "http://www.filmon.com/ajax/getChannelInfo"
SWF_URL = "http://www.filmon.com/tv/modules/FilmOnTV/files/flashapp/filmon... | ethanhlc/streamlink | src/streamlink/plugins/filmon.py | Python | bsd-2-clause | 4,570 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.