repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
russss/Diamond | src/collectors/dseopscenter/dseopscenter.py | 16 | 7115 | # coding=utf-8
"""
Collect the DataStax OpsCenter metrics
"""
import urllib2
import datetime
try:
import json
except ImportError:
import simplejson as json
import diamond.collector
class DseOpsCenterCollector(diamond.collector.Collector):
last_run_time = 0
column_families = None
last_schema_sy... | mit |
adityacs/ansible | lib/ansible/modules/network/avi/avi_virtualservice.py | 8 | 20685 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 16.3.8
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
tpsatish95/Python-Workshop | Python Environment Setup/Alternate/1. Python/1. Installer/Python-3.4.0(Linux)/Tools/stringbench/stringbench.py | 51 | 44018 |
# Various microbenchmarks comparing unicode and byte string performance
# Please keep this file both 2.x and 3.x compatible!
import timeit
import itertools
import operator
import re
import sys
import datetime
import optparse
VERSION = '2.0'
def p(*args):
sys.stdout.write(' '.join(str(s) for s in args) + '\n')
... | apache-2.0 |
cneill/designate | designate/plugin.py | 8 | 4112 | # Copyright 2012 Bouvet ASA
#
# Author: Endre Karlson <endre.karlson@bouvet.no>
#
# 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 ... | apache-2.0 |
yury-s/v8-inspector | Source/chrome/tools/telemetry/telemetry/results/csv_pivot_table_output_formatter_unittest.py | 20 | 3349 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import StringIO
import unittest
from telemetry import page as page_module
from telemetry.page import page_set
from telemetry.results import csv_piv... | bsd-3-clause |
Cinntax/home-assistant | homeassistant/components/uscis/sensor.py | 2 | 2273 | """Support for USCIS Case Status."""
import logging
from datetime import timedelta
import voluptuous as vol
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.helpers import config_validation as cv
from... | apache-2.0 |
fransklaver/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
takeshineshiro/swift | test/probe/brain.py | 8 | 8163 | #!/usr/bin/python -u
# 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
# ... | apache-2.0 |
seblefevre/testerman | core/snmp/pysnmp/proto/secmod/rfc3414/auth/hmacsha.py | 2 | 3023 | try:
from hashlib import sha1
except ImportError:
import sha
sha1 = sha.new
import string
from pysnmp.proto.secmod.rfc3414.auth import base
from pysnmp.proto import error
_twelveZeros = '\x00'*12
_fortyFourZeros = '\x00'*44
# 7.2.4
class HmacSha(base.AbstractAuthenticationService):
serviceID = (1, 3,... | gpl-2.0 |
asimshankar/tensorflow | tensorflow/python/kernel_tests/zero_division_test.py | 6 | 2466 | # 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... | apache-2.0 |
astaninger/speakout | venv/lib/python3.6/site-packages/pkg_resources/_vendor/packaging/specifiers.py | 1107 | 28025 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import abc
import functools
import itertools
import re
from ._compat impo... | mit |
openiitbombayx/edx-platform | cms/djangoapps/course_creators/views.py | 230 | 3176 | """
Methods for interacting programmatically with the user creator table.
"""
from course_creators.models import CourseCreator
from student.roles import CourseCreatorRole
from student import auth
def add_user_with_status_unrequested(user):
"""
Adds a user to the course creator table with status 'unrequested'.... | agpl-3.0 |
vtexier/duniter-python-api | duniterpy/key/encryption_key.py | 1 | 1634 | """
duniter public and private keys
@author: inso
"""
import libnacl.public
from pylibscrypt import scrypt
from .base58 import Base58Encoder
from .signing_key import _ensure_bytes
SEED_LENGTH = 32 # Length of the key
crypto_sign_BYTES = 64
SCRYPT_PARAMS = {'N': 4096,
'r': 16,
'p':... | gpl-3.0 |
tmerrick1/spack | var/spack/repos/builtin/packages/py-packaging/package.py | 5 | 2098 | ##############################################################################
# Copyright (c) 2013-2018, 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... | lgpl-2.1 |
Igalia/skia | platform_tools/android/bin/gyp_to_android.py | 44 | 8982 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Script for generating the Android framework's version of Skia from gyp
files.
"""
import argparse
import os
import shutil
import sys
import tempfile
# Find the t... | bsd-3-clause |
mr-ice/pipython | InteractiveProgramming/concentration.py | 1 | 7657 | # implementation of card game - Memory
# I originally coded this with timers for hiding the cards instead of hiding them
# on a mouse click. And I removed cards that matched instead of leaving them face up.
# I thought it worked pretty well but it didn't meet the requirements of the grading
# rubrick, so I had to mak... | mit |
sbates130272/fio-stuff | tools/cpuperf.py | 1 | 3479 | #!/usr/bin/env python
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import subprocess as sp
import time
def get_ps_data(options):
try:
data = sp.check_output(["ps", "-C", options.command, "-o" "%cpu=,%mem="])
if options.multithread:
... | apache-2.0 |
ovnicraft/odoo | addons/l10n_no/__init__.py | 693 | 1057 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | agpl-3.0 |
jhrozek/samba-ldb-mdb | python/samba/tests/dcerpc/registry.py | 51 | 1887 | # Unix SMB/CIFS implementation.
# Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2008
#
# 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) a... | gpl-3.0 |
TheWylieStCoyote/gnuradio | gr-qtgui/examples/pyqt_example_f.py | 3 | 5397 | #!/usr/bin/env python
#
# Copyright 2011,2012,2015 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
#
from __future__ import print_function
from __future__ import unicode_literals
from gnuradio import gr, filter
from gnuradio import blocks
import sys
tr... | gpl-3.0 |
carljm/django | tests/backends/test_creation.py | 26 | 3755 | import copy
import unittest
from contextlib import contextmanager
from django.db import DEFAULT_DB_ALIAS, connection, connections
from django.db.backends.base.creation import (
TEST_DATABASE_PREFIX, BaseDatabaseCreation,
)
from django.db.backends.postgresql.creation import DatabaseCreation
from django.test import ... | bsd-3-clause |
RomanZWang/osf.io | website/addons/googledrive/client.py | 26 | 1530 | # -*- coding: utf-8 -*-
from framework.exceptions import HTTPError
from website.util.client import BaseClient
from website.addons.googledrive import settings
class GoogleAuthClient(BaseClient):
def userinfo(self, access_token):
return self._make_request(
'GET',
self._build_url(se... | apache-2.0 |
jmighion/ansible | lib/ansible/inventory/manager.py | 4 | 22984 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible 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) an... | gpl-3.0 |
i4Ds/IRE | IREMedia/libraries/OpenCV/samples/python2/gaussian_mix.py | 7 | 1822 | #!/usr/bin/env python
import numpy as np
from numpy import random
import cv2
def make_gaussians(cluster_n, img_size):
points = []
ref_distrs = []
for i in xrange(cluster_n):
mean = (0.1 + 0.8*random.rand(2)) * img_size
a = (random.rand(2, 2)-0.5)*img_size*0.1
cov = np.dot(a.T, a) +... | apache-2.0 |
fe11x/dpark | dpark/moosefs/master.py | 14 | 10945 | import os
import socket
import threading
import Queue
import time
import struct
import logging
from consts import *
from utils import *
logger = logging.getLogger(__name__)
# mfsmaster need to been patched with dcache
ENABLE_DCACHE = False
class StatInfo:
def __init__(self, totalspace, availspace, trashspace,
... | bsd-3-clause |
mrunge/horizon | openstack_dashboard/dashboards/admin/hypervisors/compute/tables.py | 8 | 2749 | # 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
# distributed under th... | apache-2.0 |
huggingface/transformers | tests/test_generation_flax_utils.py | 1 | 9361 | # Copyright 2021 The HuggingFace Team. 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 applicabl... | apache-2.0 |
maropu/spark | examples/src/main/python/sql/streaming/structured_network_wordcount.py | 27 | 2500 | #
# 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... | apache-2.0 |
jonasschnelli/bitcoin | test/functional/rpc_deprecated.py | 6 | 3063 | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import BitcoinTestFramework
from t... | mit |
pexip/os-pyasn1 | tests/type/test_univ.py | 6 | 62254 | #
# This file is part of pyasn1 software.
#
# Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com>
# License: http://snmplabs.com/pyasn1/license.html
#
import math
import pickle
import sys
try:
import unittest2 as unittest
except ImportError:
import unittest
from tests.base import BaseTestCase
from pya... | bsd-2-clause |
momm3/WelcomeBot | welcomebot/Lib/hmac.py | 27 | 5057 | """HMAC (Keyed-Hashing for Message Authentication) Python module.
Implements the HMAC algorithm as described by RFC 2104.
"""
import warnings as _warnings
from _operator import _compare_digest as compare_digest
import hashlib as _hashlib
trans_5C = bytes((x ^ 0x5C) for x in range(256))
trans_36 = bytes((x ^ 0x36) fo... | mit |
mcardillo55/django | tests/many_to_one/models.py | 128 | 2623 | """
Many-to-one relationships
To define a many-to-one relationship, use ``ForeignKey()``.
"""
from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class Reporter(models.Model):
first_name = models.CharFiel... | bsd-3-clause |
WSDC-NITWarangal/django | django/views/static.py | 300 | 5129 | """
Views and functions for serving static files. These are only to be used
during development, and SHOULD NOT be used in a production setting.
"""
from __future__ import unicode_literals
import mimetypes
import os
import posixpath
import re
import stat
from django.http import (
FileResponse, Http404, HttpRespons... | bsd-3-clause |
nikolas/edx-platform | openedx/core/djangoapps/credit/api/provider.py | 12 | 15368 | """
API for initiating and tracking requests for credit from a provider.
"""
import datetime
import logging
import pytz
import uuid
from django.db import transaction
from lms.djangoapps.django_comment_client.utils import JsonResponse
from openedx.core.djangoapps.credit.exceptions import (
UserIsNotEligible,
... | agpl-3.0 |
drazenzadravec/nequeo | Tools/MySql/python-2.1.3/lib/mysql/connector/constants.py | 17 | 23017 | # MySQL Connector/Python - MySQL driver written in Python.
# Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
# MySQL Connector/Python is licensed under the terms of the GPLv2
# <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most
# MySQL Connectors. There are special exceptio... | gpl-2.0 |
TEDICpy/write-it | contactos/migrations/0002_auto__add_field_contact_is_bounced.py | 2 | 2566 | # -*- coding: utf-8 -*-
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 field 'Contact.is_bounced'
db.add_column(u'contactos_contact', 'is_bounced',
... | gpl-3.0 |
Jaemu/haiku.py | nltk/cluster/em.py | 5 | 9530 | # Natural Language Toolkit: Expectation Maximization Clusterer
#
# Copyright (C) 2001-2012 NLTK Project
# Author: Trevor Cohn <tacohn@cs.mu.oz.au>
# URL: <http://www.nltk.org/>
# For license information, see LICENSE.TXT
from __future__ import print_function
import numpy
from util import VectorSpaceClusterer
class EM... | apache-2.0 |
lanfker/tdma_imac | .waf-1.6.7-0a94702c61504c487a251b8d0a04ca9a/waflib/Tools/d.py | 4 | 1957 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/svn/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys
from waflib import Utils,Task,Errors
from waflib.TaskGen import taskgen_method,feature,after_method,before_method,extension
from waflib.Configure import conf
fro... | gpl-2.0 |
andersonresende/django | tests/admin_ordering/tests.py | 37 | 6765 | from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.options import ModelAdmin
from django.contrib.auth.models import User
from django.test import TestCase, RequestFactory
from .models import (Band, Song, SongInlineDefaultOrdering,
SongInlineNewOrdering, DynOrderingBa... | bsd-3-clause |
bugralevent/linux | tools/perf/scripts/python/failed-syscalls-by-pid.py | 1996 | 2233 | # failed system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
GeekTrainer/Flask | Work/TriviaMVA/TriviaMVA/env/Lib/site-packages/werkzeug/datastructures.py | 146 | 86337 | # -*- coding: utf-8 -*-
"""
werkzeug.datastructures
~~~~~~~~~~~~~~~~~~~~~~~
This module provides mixins and classes with an immutable interface.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import cod... | apache-2.0 |
alexcuellar/odoo | addons/account/wizard/account_report_central_journal.py | 378 | 1697 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
freestyle4568/Clothes-match | feature_analysis/src/fp_growth.py | 1 | 6357 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
Created on Sep 20, 2015
@author: freestyle4568
'''
"""
this progarm is to test fp-growth algorithm
user guide: result_list, support_data_dict = fptree(dataset, min_support)
该函数返回列表格式的result_list, 元素为列表, [[1元素项集], [2元素项集]]
子列表元素为固定集合 -- frozenset({, , ,})
support_data... | apache-2.0 |
rixrix/servo | tests/wpt/css-tests/css-fonts-3_dev/xhtml1/reference/support/fonts/makegsubfonts.py | 820 | 14309 |
import os
import textwrap
from xml.etree import ElementTree
from fontTools.ttLib import TTFont, newTable
from fontTools.misc.psCharStrings import T2CharString
from fontTools.ttLib.tables.otTables import GSUB,\
ScriptList, ScriptRecord, Script, DefaultLangSys,\
FeatureList, FeatureRecord, Feature,\
LookupLi... | mpl-2.0 |
analyseuc3m/ANALYSE-v1 | cms/djangoapps/contentstore/features/common.py | 60 | 12732 | # pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
import os
from lettuce import world, step
from nose.tools import assert_true, assert_in
from django.conf import settings
from student.roles import CourseStaffRole, CourseInstructorRole, GlobalStaff
from student.models import get_user
from sel... | agpl-3.0 |
rahuldan/sympy | sympy/ntheory/modular.py | 108 | 7676 | from __future__ import print_function, division
from sympy.core.numbers import igcdex, igcd
from sympy.core.mul import prod
from sympy.core.compatibility import as_int, reduce
from sympy.ntheory.primetest import isprime
from sympy.polys.domains import ZZ
from sympy.polys.galoistools import gf_crt, gf_crt1, gf_crt2
d... | bsd-3-clause |
Ripley6811/TAIMAU | src/frames/po/prodselectf.py | 1 | 12013 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tix
import tkMessageBox
from utils import settings
from utils import calendar_tixradiobutton as date_picker
from utils.symbols import U_TOOLS, U_TRUCK
def main(_):
"""List products for creating orders.
Enter prices and order amounts and save as a multiple... | gpl-2.0 |
ldtp/ldtp2 | ldtpd/xmlrpc_daemon.py | 3 | 4888 | """
LDTP v2 xml rpc daemon.
@author: Eitan Isaacson <eitan@ascender.com>
@author: Nagappan Alagappan <nagappan@gmail.com>
@copyright: Copyright (c) 2009 Eitan Isaacson
@copyright: Copyright (c) 2009-13 Nagappan Alagappan
@license: LGPL
http://ldtp.freedesktop.org
This file may be distributed and/or modified under th... | lgpl-2.1 |
RunningLight/machinekit | configs/sim/axis/remap/iocontrol-removed/python/embedding.py | 28 | 1709 | # a tour of accessing interpreter internals
def call_stack(self,*args):
print "------- interpreter call stack: "
for i in range(self.call_level):
s = self.sub_context[i]
print "%d: position=%d sequence_number=%d filename=%s subname=%s context_status=%x" % (i, s.position, s.sequence_number,s.fil... | lgpl-2.1 |
eformat/vertx-web | vertx-web/src/test/sockjs-protocol/venv/lib/python2.7/site-packages/unittest2/test/test_case.py | 13 | 51351 | import contextlib
from copy import deepcopy
import difflib
import gc
import pickle
import pprint
import re
import sys
import logging
import six
from six import b, u
import unittest2
import unittest2 as unittest
from unittest2.test.support import (
OldTestResult, EqualityMixin, HashingMixin, LoggingResult,
Le... | apache-2.0 |
mathhun/scipy_2015_sklearn_tutorial | notebooks/figures/plot_kneighbors_regularization.py | 25 | 1363 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.neighbors import KNeighborsRegressor
def make_dataset(n_samples=100):
rnd = np.random.RandomState(42)
x = np.linspace(-3, 3, n_samples)
y_no_noise = np.sin(4 * x) + x
y = y_no_noise + rnd.normal(size=len(x))
return x, y
def plot_re... | cc0-1.0 |
UoMCS/syllabus-visualisation | add_initial_data.py | 1 | 5971 | #!/usr/bin/python
from __future__ import print_function
import sys
import os
import glob
import itertools
import argparse
from flask import Flask
import openpyxl
import requests
from server.app import app
from server.models import *
from server.api import get_categories
# Expected spreadsheet headers
HEADERS = [('... | mit |
openstack/nova | nova/tests/unit/policies/test_lock_server.py | 3 | 10320 | # 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
# d... | apache-2.0 |
aptrishu/coala | coalib/results/result_actions/IgnoreResultAction.py | 6 | 4593 | from coalib.bearlib.languages import Language
from coalib.bearlib.languages.Language import UnknownLanguageError
from coalib.results.result_actions.ResultAction import ResultAction
from coalib.results.Result import Result
from coalib.results.Diff import Diff
from coala_utils.FileUtils import detect_encoding
from os.pat... | agpl-3.0 |
jlegendary/orange | Orange/data/utils.py | 6 | 8732 | #from __future__ import absolute_import
from Orange.core import TransformValue, \
Ordinal2Continuous, \
Discrete2Continuous, \
NormalizeContinuous, \
MapIntValue
import random
import math
from operator import itemgetter
from collections import defaultdict
from Orange.data import Table, Domain, Inst... | gpl-3.0 |
partp/gtg-services | tests/tools/test_dates.py | 2 | 5285 | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Getting Things GNOME! - a personal organizer for the GNOME desktop
# Copyright (c) 2008-2014 - Lionel Dricot & Bertrand Rousseau
#
# This program is free software: you can redistribute it and/or modify it under
# t... | gpl-3.0 |
kernc/networkx | networkx/drawing/tests/test_layout.py | 43 | 1870 | """Unit tests for layout functions."""
import sys
from nose import SkipTest
from nose.tools import assert_equal
import networkx as nx
class TestLayout(object):
numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
try:
... | bsd-3-clause |
Alignak-monitoring-contrib/alignak-webui | alignak_webui/plugins/grafana/grafana.py | 1 | 1479 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2018:
# Frederic Mohier, frederic.mohier@alignak.net
#
# This file is part of (WebUI).
#
# (WebUI) 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 F... | agpl-3.0 |
jhawkesworth/ansible-modules-core | windows/win_stat.py | 66 | 1711 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible 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.
#
# Ansible is distributed... | gpl-3.0 |
cortedeltimo/SickRage | lib/sqlalchemy/testing/suite/test_reflection.py | 76 | 19615 |
import sqlalchemy as sa
from sqlalchemy import exc as sa_exc
from sqlalchemy import types as sql_types
from sqlalchemy import inspect
from sqlalchemy import MetaData, Integer, String
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.testing import engines, fixtures
from sqlalchemy.testing.schema impo... | gpl-3.0 |
leifurhauks/grpc | tools/buildgen/plugins/expand_bin_attrs.py | 31 | 2515 | # Copyright 2015, Google Inc.
# 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 code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
GNOME/pygtk | examples/pygtk-demo/demos/colorsel.py | 6 | 2059 | #!/usr/bin/env python
"""Color Selector
GtkColorSelection lets the user choose a color. GtkColorSelectionDialog is a
prebuilt dialog containing a GtkColorSelection."""
import pygtk
pygtk.require('2.0')
import gtk
class ColorSelectorDemo(gtk.Window):
color = gtk.gdk.color_parse("blue")
def __init__(self, par... | lgpl-2.1 |
0Chencc/CTFCrackTools | Lib/Lib/email/charset.py | 180 | 16043 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
__all__ = [
'Charset',
'add_alias',
'add_charset',
'add_codec',
]
import codecs
import email.base64mime
import email.quoprimime
from email import errors
from email.encoders ... | gpl-3.0 |
thombashi/pingparsing | pingparsing/_cmd_maker.py | 1 | 7021 | import abc
import math
from typing import List, Optional
import humanreadable as hr
from subprocrunner.typing import Command
from typepy import Integer
from ._typing import PingAddOpts
DEFAULT_DEADLINE = 3
class PingCmdMaker(metaclass=abc.ABCMeta):
def __init__(
self,
count: Optional[int] = No... | mit |
hdinsight/hue | desktop/core/ext-py/django-extensions-1.5.0/django_extensions/utils/dia2django.py | 37 | 10304 | # -*- coding: UTF-8 -*-
##Author Igor Támara igor@tamarapatino.org
##Use this little program as you wish, if you
#include it in your work, let others know you
#are using it preserving this note, you have
#the right to make derivative works, Use it
#at your own risk.
#Tested to work on(etch testing 13-08-2007):
# Pytho... | apache-2.0 |
bastik/youtube-dl | youtube_dl/extractor/academicearth.py | 95 | 1399 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
class AcademicEarthCourseIE(InfoExtractor):
_VALID_URL = r'^https?://(?:www\.)?academicearth\.org/playlists/(?P<id>[^?#/]+)'
IE_NAME = 'AcademicEarth:Course'
_TEST = {
'url': 'http://academicearth.org/playlists/l... | unlicense |
frederick-masterton/django | django/utils/2to3_fixes/fix_unicode.py | 349 | 1181 | """Fixer for __unicode__ methods.
Uses the django.utils.encoding.python_2_unicode_compatible decorator.
"""
from __future__ import unicode_literals
from lib2to3 import fixer_base
from lib2to3.fixer_util import find_indentation, Name, syms, touch_import
from lib2to3.pgen2 import token
from lib2to3.pytree import Leaf,... | bsd-3-clause |
cloudbase/neutron | neutron/server/wsgi_pecan.py | 9 | 1026 | #!/usr/bin/env python
# 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 wr... | apache-2.0 |
eric-stanley/robotframework | utest/utils/test_robottime.py | 4 | 17337 | import unittest
import re
import time
import datetime
from robot.utils.asserts import (assert_equal, assert_raises_with_msg,
assert_true, assert_not_none)
from robot.utils.robottime import (timestr_to_secs, secs_to_timestr, get_time,
parse_time, form... | apache-2.0 |
shanglt/youtube-dl | youtube_dl/extractor/laola1tv.py | 122 | 3030 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import random
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
xpath_text,
)
class Laola1TvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?laola1\.tv/(?P<lang>[a-z]+)-(?P<portal>[a-z]+)/.*?/(?P<id>[0-9]... | unlicense |
shurihell/testasia | openedx/core/djangoapps/credit/tasks.py | 60 | 7836 | """
This file contains celery tasks for credit course views.
"""
from celery import task
from celery.utils.log import get_task_logger
from django.conf import settings
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey, UsageKey
from openedx.core.djangoapps.credit.api import set_credit_... | agpl-3.0 |
justyns/emacs-for-python | python-libs/rope/base/oi/runmod.py | 32 | 7600 |
def __rope_start_everything():
import os
import sys
import socket
import cPickle as pickle
import marshal
import inspect
import types
import threading
class _MessageSender(object):
def send_data(self, data):
pass
class _SocketSender(_MessageSender):
... | gpl-3.0 |
tsdmgz/ansible | lib/ansible/plugins/connection/local.py | 73 | 6815 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>
# (c) 2015, 2017 Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible 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, eithe... | gpl-3.0 |
ibab/tensorflow | tensorflow/contrib/__init__.py | 5 | 1621 | # Copyright 2015 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 a... | apache-2.0 |
qifeigit/scikit-learn | examples/decomposition/plot_pca_3d.py | 354 | 2432 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Principal components analysis (PCA)
=========================================================
These figures aid in illustrating how a point cloud
can be very flat in one direction--which is where PCA
comes in to ch... | bsd-3-clause |
sammyt/p3 | tests/p3_select_all_vows.py | 1 | 3512 | from p3 import P3
from pyvows import Vows, expect
import lxml
from lxml.etree import ElementBase
from lxml.html import builder as E
from lxml.html import fromstring, tostring
from lxml.cssselect import CSSSelector
@Vows.batch
class SelectionSelectAll(Vows.Context):
class SelectBody(Vows.Context):
"""se... | mit |
alex/sqlalchemy | lib/sqlalchemy/sql/sqltypes.py | 2 | 51062 | # sql/sqltypes.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""SQL specific types.
"""
import datetime as dt
import codecs
from .type_api impor... | mit |
menardorama/ReadyNAS-Add-ons | headphones-1.0.0/files/etc/apps/headphones/lib/unidecode/x0c5.py | 253 | 4581 | data = (
'sseum', # 0x00
'sseub', # 0x01
'sseubs', # 0x02
'sseus', # 0x03
'sseuss', # 0x04
'sseung', # 0x05
'sseuj', # 0x06
'sseuc', # 0x07
'sseuk', # 0x08
'sseut', # 0x09
'sseup', # 0x0a
'sseuh', # 0x0b
'ssyi', # 0x0c
'ssyig', # 0x0d
'ssyigg', # 0x0e
'ssyigs', # 0x0f
'ss... | gpl-2.0 |
JVillella/tensorflow | tensorflow/python/layers/layers.py | 41 | 2376 | # 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... | apache-2.0 |
sonyahanson/assaytools | examples/ipynbs/data-analysis/spectra/2015-12-18/xml2png4scans-spectra.py | 8 | 5636 | # This script takes xml data file output from the Tecan Infinite m1000 Pro plate reader
# and makes quick and dirty images of the raw data.
# But with scans and not just singlet reads.
# This script specifically combines four spectrum scripts (AB, CD, EF, GH) into a single dataframe and plot.
# The same procedure can... | lgpl-2.1 |
MycChiu/tensorflow | tensorflow/python/ops/gradient_checker.py | 82 | 14406 | # 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... | apache-2.0 |
openhatch/oh-mainline | vendor/packages/gdata/tests/gdata_tests/blogger/live_client_test.py | 39 | 5831 | #!/usr/bin/env python
#
# Copyright (C) 2009 Google 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 ... | agpl-3.0 |
crmccreary/openerp_server | openerp/addons/sale/report/__init__.py | 10 | 1082 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ess/dd-agent | checks.d/go_expvar.py | 26 | 7086 | # stdlib
from collections import defaultdict
import re
# 3rd party
import requests
# project
from checks import AgentCheck
DEFAULT_MAX_METRICS = 350
PATH = "path"
ALIAS = "alias"
TYPE = "type"
TAGS = "tags"
GAUGE = "gauge"
RATE = "rate"
DEFAULT_TYPE = GAUGE
SUPPORTED_TYPES = {
GAUGE: AgentCheck.gauge,
RAT... | bsd-3-clause |
egyp7/Subterfuge | modules/harvester/harvester.py | 4 | 5071 | #!/usr/bin/python
import os
import re
import sys
sys.path.append('/usr/share/subterfuge')
import time
import datetime
import urllib
#Ignore Deprication Warnings
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
from django.conf import settings
settings.configure(
DATABASES = {
'de... | gpl-3.0 |
rowillia/buck | third-party/py/unittest2/unittest2/test/test_functiontestcase.py | 122 | 5570 | import unittest2
from unittest2.test.support import LoggingResult
class Test_FunctionTestCase(unittest2.TestCase):
# "Return the number of tests represented by the this test object. For
# unittest2.TestCase instances, this will always be 1"
def test_countTestCases(self):
test = unittest2.Functio... | apache-2.0 |
OpenTrons/opentrons-api | api/src/opentrons/calibration_storage/types.py | 2 | 1757 | import typing
from dataclasses import dataclass
from datetime import datetime
from os import PathLike
CalibrationID = typing.NewType('CalibrationID', str)
StrPath = typing.Union[str, PathLike]
AttitudeMatrix = typing.List[typing.List[float]]
PipetteOffset = typing.List[float]
class TipLengthCalNotFound(Exception):... | apache-2.0 |
sysbot/pastedown | vendor/pygments/pygments/styles/default.py | 26 | 2532 | # -*- coding: utf-8 -*-
"""
pygments.styles.default
~~~~~~~~~~~~~~~~~~~~~~~
The default highlighting style.
:copyright: Copyright 2006-2012 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Com... | mit |
zaina/nova | nova/network/opts.py | 51 | 1529 | # 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
# distributed under the Li... | apache-2.0 |
petemounce/ansible-modules-extras | cloud/amazon/ec2_eni.py | 10 | 14272 | #!/usr/bin/python
#
# This is a 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 Ansible library is distributed in the hope that i... | gpl-3.0 |
hickerson/bbn | fable/fable_sources/libtbx/lzw.py | 1 | 25535 | """
A stream friendly, simple compression library, built around
iterators. See L{compress} and L{decompress} for the easiest way to
get started.
After the TIFF implementation of LZW, as described at
U{http://www.fileformat.info/format/tiff/corion-lzw.htm}
In an even-nuttier-shell, lzw compresses input bytes with int... | mit |
smeissner/eden | modules/tests/suite.py | 4 | 10356 | # This script is designed to be run as a Web2Py application:
# python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py
# or
# python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A testscript
import sys
import re
import time
import unittest
import argparse
def loadAllTests():
... | mit |
wangxhere/python-wpa-supplicant | docs/source/conf.py | 2 | 9398 | # -*- coding: utf-8 -*-
#
# python-wpa-supplicant documentation build configuration file, created by
# sphinx-quickstart on Wed Jun 3 14:30:47 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerat... | mpl-2.0 |
ctk3b/mdtraj | mdtraj/formats/lh5.py | 11 | 17930 | ##############################################################################
# MDTraj: A Python Library for Loading, Saving, and Manipulating
# Molecular Dynamics Trajectories.
# Copyright 2012-2014 Stanford University and the Authors
#
# Authors: Robert McGibbon, Kyle A. Beauchamp
# Contributors:
#
# MDTraj ... | lgpl-2.1 |
xhteam/external-chromium | googleurl/PRESUBMIT.py | 93 | 3371 | #!/usr/bin/python
# Copyright (c) 2009 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Top-level presubmit script for googleurl.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
details o... | bsd-3-clause |
paolodedios/tensorflow | tensorflow/lite/python/metrics_interface.py | 6 | 1570 | # Lint as: python2, python3
# Copyright 2021 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
#
... | apache-2.0 |
pombredanne/teamwork | w2/static/Brython2.0.0-20140209-164925/Lib/http/cookies.py | 735 | 20810 | #!/usr/bin/env python3
#
####
# Copyright 2000 by Timothy O'Malley <timo@alum.mit.edu>
#
# All Rights Reserved
#
# Permission to use, copy, modify, and distribute this software
# and its documentation for any purpose and without fee is hereby
# granted, provided that the above copyright notice appear in... | gpl-2.0 |
madongfly/grpc | src/python/grpcio/grpc/framework/foundation/relay.py | 23 | 5651 | # Copyright 2015, Google Inc.
# 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 code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
MakMukhi/grpc | test/http2_test/test_rst_during_data.py | 26 | 2707 | # Copyright 2016, Google Inc.
# 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 code must retain the above copyright
# notice, this list of conditions and the f... | bsd-3-clause |
JackieJ/UCLA-robomagellan-2011 | glados_sensors/src/glados_sensors/msg/_imu.py | 2 | 3254 | """autogenerated by genmsg_py from imu.msg. Do not edit."""
import roslib.message
import struct
class imu(roslib.message.Message):
_md5sum = "4ed31225b8988ef9b0cd0b234eb0aa9b"
_type = "glados_sensors/imu"
_has_header = False #flag to mark the presence of a Header object
_full_text = """float32 bearing
float32... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.