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 |
|---|---|---|---|---|---|
ruba9/HotelChatbot | my_env/lib/python3.6/site-packages/setuptools/command/sdist.py | 86 | 6844 | from distutils import log
import distutils.command.sdist as orig
import os
import sys
import io
import contextlib
from setuptools.extern import six
from .py36compat import sdist_add_defaults
import pkg_resources
_default_revctrl = list
def walk_revctrl(dirname=''):
"""Find all files under revision control"""
... | mit |
retrography/scancode-toolkit | src/licensedcode/index.py | 4 | 18939 | #
# Copyright (c) 2015 nexB Inc. and others. All rights reserved.
# http://nexb.com and https://github.com/nexB/scancode-toolkit/
# The ScanCode software is licensed under the Apache License version 2.0.
# Data generated with ScanCode require an acknowledgment.
# ScanCode is a trademark of nexB Inc.
#
# You may not use... | apache-2.0 |
katstalk/android_external_chromium_org | remoting/tools/runclient.py | 182 | 1717 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""Gets the chromoting host info from an input arg and then
tries to find the authentication info in the .chromotingAuthToken file
... | bsd-3-clause |
abhishek-ch/hue | apps/oozie/src/oozie/migrations/0011_auto__add_email.py | 39 | 22302 | # encoding: 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 model 'Email'
db.create_table('oozie_email', (
('cc', self.gf('django.db.models.fields.TextFi... | apache-2.0 |
chrisseto/osf.io | api_tests/nodes/views/test_node_registrations_list.py | 5 | 3178 | import pytest
from urlparse import urlparse
from api.base.settings.defaults import API_BASE
from osf_tests.factories import (
ProjectFactory,
RegistrationFactory,
AuthUserFactory,
)
node_url_for = lambda n_id: '/{}nodes/{}/'.format(API_BASE, n_id)
@pytest.fixture()
def user():
return AuthUserFactory(... | apache-2.0 |
calfonso/ansible | lib/ansible/modules/web_infrastructure/ansible_tower/tower_team.py | 23 | 3406 | #!/usr/bin/python
# coding: utf-8 -*-
# (c) 2017, Wayne Witzel III <wayne@riotousliving.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1... | gpl-3.0 |
pinterest/teletraan | deploy-board/deploy_board/webapp/webhook_views.py | 8 | 3330 | # Copyright 2016 Pinterest, 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 law or agreed to in writi... | apache-2.0 |
ansobolev/regCMPostProc | src/plot.py | 1 | 2816 | #!/usr/bin/env python
# RegCM postprocessing tool
# Copyright (C) 2014 Aliou, Addisu, Kanhu, Andrey
# 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 Licens... | gpl-3.0 |
p0psicles/SickRage | lib/unidecode/x058.py | 252 | 4678 | data = (
'Ku ', # 0x00
'Ke ', # 0x01
'Tang ', # 0x02
'Kun ', # 0x03
'Ni ', # 0x04
'Jian ', # 0x05
'Dui ', # 0x06
'Jin ', # 0x07
'Gang ', # 0x08
'Yu ', # 0x09
'E ', # 0x0a
'Peng ', # 0x0b
'Gu ', # 0x0c
'Tu ', # 0x0d
'Leng ', # 0x0e
'[?] ', # 0x0f
'Ya ', # 0x10
'Qian ', ... | gpl-3.0 |
kikokubo/Sick-Beard-TPB | sickbeard/searchCurrent.py | 18 | 1154 | # Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Lice... | gpl-3.0 |
Bismarrck/tensorflow | tensorflow/python/saved_model/function_serialization.py | 1 | 4869 | # 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... | apache-2.0 |
wy123123/django-registration | registration/tests/simple_backend.py | 43 | 3433 | from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import TestCase
from registration.forms import RegistrationForm
from registration.users import UserModel
class SimpleBackendViewTests(TestCase):
urls = 'test_app.urls_simple'
def test_allow(self):
"""
... | bsd-3-clause |
drinkingChai/angular-project-1 | node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
wenzowski/closure-library | closure/bin/build/depswriter.py | 247 | 6208 | #!/usr/bin/env python
#
# Copyright 2009 The Closure Library 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 |
malikcjm/qtcreator | tests/system/suite_QMLS/tst_QMLS05/test.py | 3 | 2759 | #############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this f... | lgpl-2.1 |
robotican/ric | ric_board/scripts/RiCConfigurator/BAL/Devices/PPMReader.py | 1 | 2203 | __author__ = 'tom1231'
from PyQt4.QtCore import QUrl
from PyQt4.QtGui import *
from BAL.Interface.DeviceFrame import DeviceFrame, EX_DEV, PPMReader
from lxml.etree import Element, SubElement, XML
class PPMReader(DeviceFrame):
def __init__(self, frame, data):
DeviceFrame.__init__(self, EX_DEV, frame, data)... | bsd-3-clause |
wmvanvliet/mne-python | examples/time_frequency/plot_source_power_spectrum.py | 19 | 1959 | """
======================================================
Compute source power spectral density (PSD) in a label
======================================================
Returns an STC file containing the PSD (in dB) of each of the sources
within a label.
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
... | bsd-3-clause |
mohammed-alfatih/servo | tests/wpt/css-tests/css-text-decor-3_dev/html/reference/support/generate-text-emphasis-ruby-tests.py | 829 | 3042 | #!/usr/bin/env python
# - * - coding: UTF-8 - * -
"""
This script generates tests text-emphasis-ruby-001 ~ 004 which tests
emphasis marks with ruby in four directions. It outputs a list of all
tests it generated in the format of Mozilla reftest.list to the stdout.
"""
from __future__ import unicode_literals
TEST_FIL... | mpl-2.0 |
destijl/forensicartifacts | frontend/thirdparty/networkx-1.9/examples/graph/napoleon_russian_campaign.py | 44 | 3216 | #!/usr/bin/env python
"""
Minard's data from Napoleon's 1812-1813 Russian Campaign.
http://www.math.yorku.ca/SCS/Gallery/minard/minard.txt
"""
__author__ = """Aric Hagberg (hagberg@lanl.gov)"""
# Copyright (C) 2006 by
# Aric Hagberg <hagberg@lanl.gov>
# Dan Schult <dschult@colgate.edu>
# Pieter Swart <sw... | apache-2.0 |
bokeh/bokeh | examples/integration/glyphs/categorical_multi_glyphs.py | 1 | 1210 | from bokeh.io import show
from bokeh.layouts import gridplot
from bokeh.plotting import figure
x_range = ['a', 'b', 'c', 'd']
y_values = [1., 2., 3., 4.]
y_errors = [.1, .2, .3, .4]
err_xs = []
err_ys = []
for x, y, yerr in zip(x_range, y_values, y_errors):
err_xs.append((x, x))
err_ys.append((y - yerr, y + ... | bsd-3-clause |
bearstech/ansible | lib/ansible/module_utils/facts/network/aix.py | 62 | 5981 | # 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 in the hope that ... | gpl-3.0 |
awslabs/chalice | tests/codelinter.py | 1 | 2180 | # These are linting checks used in the chalice codebase itself.
# These are used to enforce specific coding standards and constraints.
from pylint.checkers import BaseChecker
from pylint.interfaces import IAstroidChecker
from astroid.exceptions import InferenceError
import astroid
def register(linter):
linter.reg... | apache-2.0 |
cn-app-registry/cnr-server | appr/commands/cli.py | 2 | 2478 | from __future__ import absolute_import, division, print_function
import argparse
import os
from appr.commands.channel import ChannelCmd
from appr.commands.config import ConfigCmd
from appr.commands.delete_package import DeletePackageCmd
from appr.commands.helm import HelmCmd
from appr.commands.inspect import InspectC... | apache-2.0 |
smarkets/marge-bot | tests/git_repo_mock.py | 1 | 8075 | import logging as log
from collections import defaultdict
from datetime import timedelta
import functools
import shlex
import marge.git as git
class RepoMock(git.Repo):
@classmethod
def init_for_merge_request(cls, merge_request, initial_target_sha, project, forked_project=None):
assert bool(forked_p... | bsd-3-clause |
seporaitis/mysqlparse | tests/grammar/test_sql_file.py | 1 | 1373 | # -*- encoding:utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from mysqlparse.grammar.sql_file import sql_file_syntax
class SqlFileSyntaxTest(unittest.TestCase):
def test_multiple_statements(self):
sql_file = sql_file_syntax.parseString("""
... | mit |
ph1l/halo_radio | WebRoot/Preferences.py | 1 | 2083 | import HaloRadio.TopWeb as TopWeb
import HaloRadio.StyleListMaker as StyleListMaker
import HaloRadio.Style as Style
class plugin(TopWeb.TopWeb):
def GetReqs(self):
return "amv"
def handler(self, context):
import HaloRadio.UserSongStatsListMaker as UserSongStatsListMaker
import HaloRadio.Use... | gpl-2.0 |
rictec/huawei_s7_kernel | arch/ia64/scripts/unwcheck.py | 916 | 1718 | #!/usr/bin/env python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthe... | gpl-2.0 |
fbossy/SickRage | tornado/httpclient.py | 66 | 26340 | """Blocking and non-blocking HTTP client interfaces.
This module defines a common interface shared by two implementations,
``simple_httpclient`` and ``curl_httpclient``. Applications may either
instantiate their chosen implementation class directly or use the
`AsyncHTTPClient` class from this module, which selects an... | gpl-3.0 |
jyotikamboj/container | django/utils/crypto.py | 9 | 6878 | """
Django's standard crypto functions and utilities.
"""
from __future__ import unicode_literals
import hmac
import struct
import hashlib
import binascii
import time
# Use the system PRNG if possible
import random
try:
random = random.SystemRandom()
using_sysrandom = True
except NotImplementedError:
impo... | mit |
zarafagroupware/python-zarafa | scripts/z-barplot.py | 2 | 1667 | #!/usr/bin/env python
import zarafa
import matplotlib.pyplot as plt
def opt_args():
parser = zarafa.parser('skpc')
parser.add_option('--save', dest='save', action='store', help='Save plot to file (png)')
return parser.parse_args()
def b2m(bytes):
return (bytes / 1024) / 1024
def main():
options,... | agpl-3.0 |
nickmoline/feedsanitizer | django/utils/tzinfo.py | 313 | 2511 | "Implementation of tzinfo classes for use with datetime.datetime."
import time
from datetime import timedelta, tzinfo
from django.utils.encoding import smart_unicode, smart_str, DEFAULT_LOCALE_ENCODING
class FixedOffset(tzinfo):
"Fixed offset in minutes east from UTC."
def __init__(self, offset):
if i... | mit |
CommonsDev/dataserver | commons/migrations/0006_auto__chg_field_pertinence_comment.py | 1 | 7545 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Changing field 'Pertinence.comment'
db.alter_column(u'commons_pertinen... | agpl-3.0 |
edubecks/vaidecaronaorg | caronasbrasilapp/djangoapp/apps/caronasbrasil/migrations/0009_auto__del_field_caronamodel_date__add_field_caronamodel_from_datetime_.py | 1 | 3750 | # -*- 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):
# Deleting field 'CaronaModel.date'
db.delete_column(u'caronasbrasil_caronamodel', 'date')
# Adding... | mit |
epssy/hue | desktop/core/ext-py/Django-1.6.10/django/core/handlers/base.py | 74 | 12481 | from __future__ import unicode_literals
import logging
import sys
import types
from django import http
from django.conf import settings
from django.core import urlresolvers
from django.core import signals
from django.core.exceptions import MiddlewareNotUsed, PermissionDenied, SuspiciousOperation
from django.db import... | apache-2.0 |
plamut/ggrc-core | test/integration/ggrc_workflows/converters/test_workflow_export_csv.py | 2 | 11513 | # Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for workflow object exports."""
from os.path import abspath, dirname, join
from flask.json import dumps
from ggrc.app import app
from ggrc_workflows.models import Workflow
from integration.ggrc im... | apache-2.0 |
MridulS/sympy | sympy/plotting/intervalmath/tests/test_intervalmath.py | 19 | 8906 | from __future__ import division
from sympy.plotting.intervalmath import interval
from sympy.utilities.pytest import raises
from sympy.external import import_module
def test_interval():
assert (interval(1, 1) == interval(1, 1, is_valid=True)) == (True, True)
assert (interval(1, 1) == interval(1, 1, is_valid=Fa... | bsd-3-clause |
bitcity/django-allauth | allauth/socialaccount/admin.py | 67 | 1830 | import django
from django.contrib import admin
from django import forms
from allauth.account.adapter import get_adapter
from .models import SocialApp, SocialAccount, SocialToken
class SocialAppForm(forms.ModelForm):
class Meta:
model = SocialApp
exclude = []
widgets = {
'clie... | mit |
aaleotti-unimore/ComicsScraper | lib/setuptools/archive_util.py | 320 | 6613 | """Utilities for extracting common archive formats"""
import zipfile
import tarfile
import os
import shutil
import posixpath
import contextlib
from distutils.errors import DistutilsError
from pkg_resources import ensure_directory, ContextualZipFile
__all__ = [
"unpack_archive", "unpack_zipfile", "unpack_tarfile"... | apache-2.0 |
Sangsub/android-samsung-3.0-ics-mr1 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # 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 system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
jchevin/MissionPlanner-master | Lib/encodings/tis_620.py | 593 | 12556 | """ Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='st... | gpl-3.0 |
hveto/hveto | hveto/tests/test_triggers.py | 1 | 1896 | # -*- coding: utf-8 -*-
# Copyright (C) Joshua Smith (2016-)
#
# This file is part of the hveto python package.
#
# hveto 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
# (... | gpl-3.0 |
viewdy/phantomjs2 | src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/sheriff_unittest.py | 122 | 3783 | # Copyright (C) 2010 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 |
MarcusTan/yncn-grid | venv/lib/python2.7/site-packages/gunicorn/sock.py | 25 | 6838 | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
import errno
import os
import socket
import stat
import sys
import time
from gunicorn import util
from gunicorn.six import string_types
SD_LISTEN_FDS_START = 3
class BaseSocket(object):
... | mit |
MounirMesselmeni/django | tests/reverse_lookup/tests.py | 326 | 1675 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from .models import Choice, Poll, User
class ReverseLookupTests(TestCase):
def setUp(self):
john = User.objects.create(name="John Doe")
jim = User.objects.create(name="Jim Bo")... | bsd-3-clause |
skoppisetty/hackathon | lib/cherrypy/test/test_routes.py | 42 | 2411 | import os
curdir = os.path.join(os.getcwd(), os.path.dirname(__file__))
import cherrypy
from cherrypy.test import helper
import nose
class RoutesDispatchTest(helper.CPWebCase):
def setup_server():
try:
import routes
except ImportError:
raise nose.SkipTest('Install routes... | gpl-3.0 |
jbbskinny/sympy | sympy/physics/vector/tests/test_fieldfunctions.py | 115 | 5638 | from sympy import S, Symbol, sin, cos
from sympy.physics.vector import ReferenceFrame, Vector, Point, \
dynamicsymbols
from sympy.physics.vector.fieldfunctions import divergence, \
gradient, curl, is_conservative, is_solenoidal, \
scalar_potential, scalar_potential_difference
from sympy.utilities.pytest ... | bsd-3-clause |
mscherer/ansible | lib/ansible/plugins/action/assert.py | 163 | 2353 | # Copyright 2012, Dag Wieers <dag@wieers.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) any later versi... | gpl-3.0 |
davidecaminati/Handcart-lift-rotary | Python/facedetect_mio.py | 1 | 3991 | #!/usr/bin/env python
import numpy as np
import cv2
import cv2.cv as cv
from multiprocessing.pool import ThreadPool
from video import create_capture
from common import clock, draw_str
from pyfirmata import Arduino, util
ArduinoPresent = False
if ArduinoPresent :
board = Arduino('/dev/ttyACM0')
#board.digital[2... | gpl-2.0 |
j0057/ansible-1 | lib/ansible/cache/redis.py | 117 | 3477 | # (c) 2014, Brian Coca, Josh Drake, et al
#
# 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.
... | gpl-3.0 |
Pauliecoon/android_kernel_motorola_shamu_benzoCore | tools/perf/scripts/python/check-perf-trace.py | 11214 | 2503 | # perf script event handlers, generated by perf script -g python
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# This script tests basic functionality such as flag and symbol
# strings, common_xxx() calls back into perf, begin, end, unhandled
# events, etc. ... | gpl-2.0 |
mcus/SickRage | lib/github/CommitComment.py | 72 | 6837 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | gpl-3.0 |
martbhell/wasthereannhlgamelastnight | src/lib/oauthlib/oauth2/rfc6749/endpoints/revocation.py | 3 | 5317 | # -*- coding: utf-8 -*-
"""
oauthlib.oauth2.rfc6749.endpoint.revocation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
An implementation of the OAuth 2 `Token Revocation`_ spec (draft 11).
.. _`Token Revocation`: https://tools.ietf.org/html/draft-ietf-oauth-revocation-11
"""
from __future__ import absolute_import, unico... | mit |
zhjunlang/kbengine | kbe/src/lib/python/Lib/linecache.py | 97 | 3862 | """Cache lines from files.
This is intended to read lines from modules imported -- hence if a filename
is not found, it will look down the module search path for a file by
that name.
"""
import sys
import os
import tokenize
__all__ = ["getline", "clearcache", "checkcache"]
def getline(filename, lineno, module_globa... | lgpl-3.0 |
hslee16/ansible-modules-extras | notification/hipchat.py | 24 | 6425 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# 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.
... | gpl-3.0 |
Elbagoury/odoo | addons/purchase_requisition/purchase_requisition.py | 200 | 23548 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
peoplepower/composer-sdk-python | com.ppc.Microservices/intelligence/data_request/tools/download_data.py | 1 | 5155 | #!/usr/bin/env python
# encoding: utf-8
'''
Created on January 4, 2019
@author: David Moss
'''
# Data Stream Address
DATASTREAM_ADDRESS = "download_data"
# Data Stream Content
DATASTREAM_CONTENT = {
"force": True
}
# input function behaves differently in Python 2.x and 3.x. And there is no raw_input in 3.x... | apache-2.0 |
julianprabhakar/eden_car | modules/unit_tests/s3db/vulnerability.py | 12 | 97188 | # -*- coding: utf-8 -*-
#
# Stats Unit Tests
#
# To run this script use:
# python web2py.py -S eden -M -R applications/eden/modules/unit_tests/s3db/vulnerability.py
#
import unittest
import datetime
from gluon import *
from gluon.storage import Storage
# ===============================================================... | mit |
danielkitachewsky/reviewder | requests/packages/urllib3/filepost.py | 147 | 2511 | # urllib3/filepost.py
# Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import codecs
import mimetypes
from uuid import uuid4
from io import BytesIO
from .packages ... | mit |
toolforger/sympy | sympy/solvers/ode.py | 38 | 330846 | r"""
This module contains :py:meth:`~sympy.solvers.ode.dsolve` and different helper
functions that it uses.
:py:meth:`~sympy.solvers.ode.dsolve` solves ordinary differential equations.
See the docstring on the various functions for their uses. Note that partial
differential equations support is in ``pde.py``. Note t... | bsd-3-clause |
jmesteve/openerp | openerp/tools/func.py | 63 | 2118 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you can red... | agpl-3.0 |
eonpatapon/lollypop | src/database_upgrade.py | 1 | 1934 | #!/usr/bin/python
# Copyright (c) 2014-2015 Cedric Bellegarde <cedric.bellegarde@adishatz.org>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your opti... | gpl-3.0 |
InAnimaTe/CouchPotatoServer | libs/subliminal/services/opensubtitles.py | 106 | 9503 | # -*- coding: utf-8 -*-
# Copyright 2011-2012 Antoine Bertin <diaoulael@gmail.com>
#
# This file is part of subliminal.
#
# subliminal is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 3 of... | gpl-3.0 |
mzizzi/ansible | lib/ansible/modules/packaging/os/pkg5_publisher.py | 71 | 5936 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2014 Peter Oliver <ansible@mavit.org.uk>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your o... | gpl-3.0 |
Linaro/squad | squad/frontend/comparison.py | 1 | 4547 | from functools import reduce
from django.shortcuts import render, get_object_or_404
from django.core.paginator import Paginator
from django.db.models import Q, Prefetch
from squad.core.models import Project, Group, Build
from squad.core.comparison import TestComparison, MetricComparison
from squad.frontend.utils impo... | agpl-3.0 |
mirror/vbox | src/VBox/ValidationKit/testboxscript/testboxconnection.py | 4 | 11363 | # -*- coding: utf-8 -*-
# $Id$
"""
TestBox Script - HTTP Connection Handling.
"""
__copyright__ = \
"""
Copyright (C) 2012-2014 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and/or modify ... | gpl-2.0 |
azbshiri/rstblog | bootstrap.py | 44 | 3807 | ##############################################################################
#
# Copyright (c) 2006 Zope Corporation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SO... | bsd-3-clause |
kevinxw/namebench | nb_third_party/dns/tokenizer.py | 246 | 17962 | # Copyright (C) 2003-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
lecaoquochung/ddnb.django | django/db/backends/dummy/base.py | 41 | 2302 | """
Dummy database backend for Django.
Django uses this if the database ENGINE setting is empty (None or empty string).
Each of these API functions, except connection.close(), raises
ImproperlyConfigured.
"""
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import (BaseDatabaseOperatio... | bsd-3-clause |
jendap/tensorflow | tensorflow/python/ops/gradient_checker.py | 11 | 15237 | # 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 |
MOA-2011/enigma2.pli4.0 | lib/python/Screens/RecordPaths.py | 38 | 8043 | from Screens.Screen import Screen
from Screens.LocationBox import MovieLocationBox, TimeshiftLocationBox
from Screens.MessageBox import MessageBox
from Components.Label import Label
from Components.config import config, ConfigSelection, getConfigListEntry, configfile
from Components.ConfigList import ConfigListScreen
f... | gpl-2.0 |
dims/test-infra | gubernator/third_party/defusedxml/minidom.py | 53 | 1798 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Defused xml.dom.minidom
"""
from __future__ import print_function, absolute_import
from xml.dom.minidom import _do_pulldom_pa... | apache-2.0 |
harshavardhana/minio-py | tests/unit/minio_test.py | 1 | 3865 | # -*- coding: utf-8 -*-
# Minio Python Library for Amazon S3 Compatible Cloud Storage, (C) 2015 Minio, 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/licen... | apache-2.0 |
fidomason/kbengine | kbe/res/scripts/common/Lib/idlelib/idle_test/test_widgetredir.py | 79 | 4128 | """Unittest for idlelib.WidgetRedirector
100% coverage
"""
from test.support import requires
import unittest
from idlelib.idle_test.mock_idle import Func
from tkinter import Tk, Text, TclError
from idlelib.WidgetRedirector import WidgetRedirector
class InitCloseTest(unittest.TestCase):
@classmethod
def setU... | lgpl-3.0 |
slowfranklin/samba | selftest/subunithelper.py | 22 | 22518 | # Python module for parsing and generating the Subunit protocol
# (Samba-specific)
# Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; ... | gpl-3.0 |
xodus7/tensorflow | tensorflow/contrib/slim/python/slim/learning.py | 36 | 31195 | # Copyright 2016 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 |
tosolveit/scikit-learn | sklearn/decomposition/tests/test_pca.py | 199 | 10949 | import numpy as np
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_greater
from sklearn.utils.testing import assert_rai... | bsd-3-clause |
dhootha/openxc-vehicle-simulator | data/speed_calc.py | 6 | 1911 | from .data_calc import DataCalc
import math
from datetime import datetime
class SpeedCalc(DataCalc):
def __init__(self):
self.initialize_data()
def initialize_data(self):
self.data = 0.0
self.last_calc = datetime.now()
self.name = 'vehicle_speed'
def iterate(self, snapshot... | bsd-3-clause |
EnviroCentre/jython-upgrade | jython/lib/site-packages/pip/download.py | 1 | 26290 | import cgi
import email.utils
import hashlib
import getpass
import mimetypes
import os
import platform
import re
import shutil
import sys
import tempfile
import pip
from pip.backwardcompat import urllib, urlparse, raw_input
from pip.exceptions import InstallationError, HashMismatch
from pip.util import (splitext, rmt... | mit |
alfredodeza/boto | tests/integration/cloudsearch2/test_cert_verification.py | 118 | 1579 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software withou... | mit |
pombredanne/django-rest-framework | rest_framework/test.py | 7 | 8635 | # -- coding: utf-8 --
# Note that we import as `DjangoRequestFactory` and `DjangoClient` in order
# to make it harder for the user to import the wrong thing without realizing.
from __future__ import unicode_literals
from django.conf import settings
from django.test import testcases
from django.test.client import Clie... | bsd-2-clause |
Satius/pia-linux-kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # 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 |
cartologic/cartoview | cartoview/apps_handler/config.py | 1 | 4552 | # -*- coding: utf-8 -*-
import json
import os
from collections import Mapping
import portalocker
class AppsDict(Mapping):
def __init__(self, *args, **kw):
self._app_data = dict(*args, **kw)
def __setitem__(self, key, item):
self._app_data[key] = item
self.__sort_apps()
def __geti... | bsd-2-clause |
Stanford-Online/edx-platform | common/lib/xmodule/xmodule/tests/test_progress.py | 13 | 4336 | """Module progress tests"""
import unittest
from mock import Mock
from xblock.field_data import DictFieldData
from xmodule.progress import Progress
from xmodule import x_module
from . import get_test_system
class ProgressTest(unittest.TestCase):
''' Test that basic Progress objects work. A Progress represent... | agpl-3.0 |
philoniare/horizon | openstack_dashboard/dashboards/admin/hypervisors/tests.py | 39 | 4785 | # Copyright 2013 B1 Systems GmbH
#
# 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 ag... | apache-2.0 |
mantidproject/mantid | Framework/PythonInterface/test/python/mantid/api/ProjectionTest.py | 3 | 3679 | # Mantid Repository : https://github.com/mantidproject/mantid
#
# Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
# NScD Oak Ridge National Laboratory, European Spallation Source,
# Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
# SPDX - License - Identifier: GPL - 3.0 +
impo... | gpl-3.0 |
pap/nupic | external/linux32/lib/python2.6/site-packages/matplotlib/fontconfig_pattern.py | 72 | 6429 | """
A module for parsing and generating fontconfig patterns.
See the `fontconfig pattern specification
<http://www.fontconfig.org/fontconfig-user.html>`_ for more
information.
"""
# Author : Michael Droettboom <mdroe@stsci.edu>
# License : matplotlib license (PSF compatible)
# This class is defined here because it m... | agpl-3.0 |
sevenian3/ChromaStarPy | solartest.py | 1 | 6462 | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 30 10:54:21 2017
@author: ishort
"""
#plotting:
import matplotlib
import matplotlib.pyplot as plt
#%matplotlib inline
import pylab
#General file for printing ad hoc quantities
#dbgHandle = open("debug.out", 'w')
#Get the data
dataPath = "SolFluxAtlas20... | mit |
rbberger/lammps | tools/i-pi/ipi/inputs/interface.py | 41 | 5745 | """Deals with creating the interface between the wrapper and the socket.
Copyright (C) 2013, Joshua More and Michele Ceriotti
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 ... | gpl-2.0 |
beni55/dipy | dipy/reconst/tests/test_peakdf.py | 9 | 2414 | import numpy as np
import numpy.testing as npt
from dipy.reconst.peaks import default_sphere, peaks_from_model
def test_PeaksAndMetricsDirectionGetter():
class SillyModel(object):
def fit(self, data, mask=None):
return SillyFit(self)
class SillyFit(object):
def __init__(self, m... | bsd-3-clause |
lunixbochs/uberserver | server.py | 1 | 4578 | #!/usr/bin/env python
# coding=utf-8
import thread, traceback, signal, socket, sys
from urllib import urlopen
from DataHandler import DataHandler
from Client import Client
from NATServer import NATServer
from Dispatcher import Dispatcher
import ip2country # just to make sure it's downloaded
import ChanSe... | mit |
marissazhou/django | tests/test_runner/test_discover_runner.py | 210 | 6196 | import os
from contextlib import contextmanager
from unittest import TestSuite, TextTestRunner, defaultTestLoader
from django.test import TestCase
from django.test.runner import DiscoverRunner
@contextmanager
def change_cwd(directory):
current_dir = os.path.abspath(os.path.dirname(__file__))
new_dir = os.pat... | bsd-3-clause |
CptLemming/libsaas | test/test_ducksboard.py | 4 | 4916 | import json
import unittest
from libsaas.executors import test_executor
from libsaas.services import ducksboard
class DucksboardTestCase(unittest.TestCase):
def setUp(self):
self.executor = test_executor.use()
self.executor.set_response(b'{}', 200, {})
self.service = ducksboard.Ducksboa... | mit |
dockerera/func | func/overlord/client.py | 2 | 44344 | ##
## func command line interface & client lib
##
## Copyright 2007, Red Hat, Inc
## Michael DeHaan <mdehaan@redhat.com>
## +AUTHORS
##
## This software may be freely redistributed under the terms of the GNU
## general public license.
##
## You should have received a copy of the GNU General Public License
## along with... | gpl-2.0 |
zooko/egtp_new | egtp/CommHints.py | 1 | 2565 | # Copyright (c) 2001 Autonomous Zone Industries
# This file is licensed under the
# GNU Lesser General Public License v2.1.
# See the file COPYING or visit http://www.gnu.org/ for details.
__revision__ = "$Id: CommHints.py,v 1.2 2002/12/02 19:58:44 myers_carpenter Exp $"
### standard modules
import types
# T... | lgpl-2.1 |
uwescience/myria-web | appengine/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py | 75 | 7708 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx
from nose.plugins.attrib import attr
from networkx import edge_current_flow_betweenness_centrality \
as edge_current_flow
from networkx import edge_current_flow_betweenness_centrality_subset \
as edge_current_flow_subset
... | bsd-3-clause |
dantebarba/docker-media-server | plex/Sub-Zero.bundle/Contents/Code/support/activities.py | 2 | 5022 | # coding=utf-8
from wraptor.decorators import throttle
from config import config
from items import get_item, get_item_kind_from_item, refresh_item
Activity = None
try:
from plex_activity import Activity
except ImportError:
pass
class PlexActivityManager(object):
def start(self):
activity_sources_... | gpl-3.0 |
mcsosa121/cafa | cafaenv/lib/python2.7/site-packages/PIL/GribStubImagePlugin.py | 21 | 1521 | #
# The Python Imaging Library
# $Id$
#
# GRIB stub adapter
#
# Copyright (c) 1996-2003 by Fredrik Lundh
#
# See the README file for information on usage and redistribution.
#
from PIL import Image, ImageFile
_handler = None
def register_handler(handler):
"""
Install application-specific GRIB image handler.... | mit |
mgogoulos/libcloud | libcloud/dns/drivers/zerigo.py | 19 | 18323 | # 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-2.0 |
lukacsaron/lesarrail | wp-content/themes/lesarrail/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py | 1812 | 9537 | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Utility functions shared amongst the Windows generators."""
import copy
import os
# A dictionary mapping supported target types to extensions.
TARGET_TYPE_EX... | gpl-2.0 |
nmrao/robotframework | atest/testresources/testlibs/classes.py | 25 | 6026 | __version__ = 'N/A' # This should be ignored when version is parsed
class NameLibrary:
handler_count = 10
def simple1(self):
"""Simple 1"""
def simple2___(self):
"""Simple 2"""
def underscore_name(self):
"""Underscore Name"""
def underscore_name2_(self):
"""Undersc... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.