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 |
|---|---|---|---|---|---|
cryptapus/electrum | electrum/gui/qt/invoice_list.py | 3 | 3740 | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... | mit |
marcoarruda/MissionPlanner | Lib/encodings/cp037.py | 93 | 13684 | """ Python Character Mapping Codec cp037 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP037.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 deco... | gpl-3.0 |
orgito/ansible | lib/ansible/modules/cloud/openstack/os_keystone_domain_facts.py | 31 | 3511 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# 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 |
drjova/cds-demosite | cds/modules/records/bundles.py | 3 | 1303 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2016 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later... | gpl-2.0 |
yoki/phantomjs | src/breakpad/src/tools/gyp/test/defines/gyptest-defines-env.py | 501 | 1874 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies build of an executable with C++ define specified by a gyp define.
"""
import os
import TestGyp
test = TestGyp.TestGyp()
# Wi... | bsd-3-clause |
dankolbrs/zeroclickinfo-fathead | lib/fathead/redis_commands/parse.py | 8 | 1392 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import lxml.etree, lxml.html
import re
url = "http://redis.io"
output = "output.txt"
f = open(output, "w");
tree = lxml.html.parse("download/raw.dat").getroot()
commands = tree.find_class("command")
data = {}
for command in commands:
for row in command.findall('a'):
... | apache-2.0 |
Antiun/purchase-workflow | framework_agreement/tests/common.py | 20 | 1677 | # -*- coding: utf-8 -*-
# Author: Nicolas Bessi, Leonardo Pistone
# Copyright 2013-2015 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
# published by the Free Software Foundation, either version 3 of ... | agpl-3.0 |
bjori/grpc | src/python/grpcio_test/grpc_test/framework/interfaces/links/__init__.py | 1496 | 1530 | # 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 |
normanjaeckel/LearningProgress | learningprogress/accounts/urls.py | 2 | 2103 | from django.conf.urls import patterns, url
from django.contrib.auth.decorators import login_required
from . import views
urlpatterns = patterns(
'',
# Login and logout
url(r'^login/$',
'django.contrib.auth.views.login',
{'template_name': 'accounts/login.html'},
name='login'),
u... | mit |
dcroc16/skunk_works | google_appengine/google/appengine/tools/devappserver2/wsgi_test_utils.py | 10 | 6329 | #!/usr/bin/env python
#
# Copyright 2007 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 law o... | mit |
benwaa/iPhotoCloudSync | lib/python2.7/tilutil/exiftool.py | 2 | 20409 | '''Helpers to use exiftool to read and update image meta data.
Created on May 29, 2009
@author: tsporkert@gmail.com
'''
# Copyright 2010 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 t... | apache-2.0 |
pyblish/pyblish-win | lib/Python27/Lib/sunau.py | 56 | 17222 | """Stuff to parse Sun and NeXT audio files.
An audio file consists of a header followed by the data. The structure
of the header is as follows.
+---------------+
| magic word |
+---------------+
| header size |
+---------------+
| data size |
+--------... | lgpl-3.0 |
perdona/titanium_mobile | support/common/simplejson/tests/test_unicode.py | 123 | 2327 | from unittest import TestCase
import simplejson as json
class TestUnicode(TestCase):
def test_encoding1(self):
encoder = json.JSONEncoder(encoding='utf-8')
u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}'
s = u.encode('utf-8')
ju = encoder.encode(u)
js = en... | apache-2.0 |
Parkjihooni6186/TizenRT | os/drivers/sercomm/loadwriter.py | 13 | 1050 | #!/usr/bin/python
###########################################################################
#
# Copyright 2016 Samsung Electronics 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 ... | apache-2.0 |
rockyzhang/zhangyanhit-python-for-android-mips | python3-alpha/python3-src/Lib/ctypes/test/test_strings.py | 52 | 7126 | import unittest
from ctypes import *
class StringArrayTestCase(unittest.TestCase):
def test(self):
BUF = c_char * 4
buf = BUF(b"a", b"b", b"c")
self.assertEqual(buf.value, b"abc")
self.assertEqual(buf.raw, b"abc\000")
buf.value = b"ABCD"
self.assertEqual(buf.value,... | apache-2.0 |
seagullua/MuPDF | scripts/tohtml.py | 62 | 1760 | import sys, os, re
HEADER="""<head>
<style>
body { background-color:#fffff0; color:black; margin:16pt; }
a { text-decoration:none; color:darkblue; }
a.line { position:relative; padding-top:300px; }
.comment { color:green; font-style:italic; }
.comment a { color:darkgreen; }
</style>
</head>
<body><pre><pre>"""
FOOTER... | agpl-3.0 |
aimas/TuniErp-8.0 | addons/project_issue/report/__init__.py | 442 | 1084 | # -*- 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... | agpl-3.0 |
40223148/2015cda_g5 | static/Brython3.1.0-20150301-090019/Lib/token.py | 743 | 3034 | """Token constants (from "token.h")."""
__all__ = ['tok_name', 'ISTERMINAL', 'ISNONTERMINAL', 'ISEOF']
# This file is automatically generated; please don't muck it up!
#
# To update the symbols in this file, 'cd' to the top directory of
# the python source tree after building the interpreter and run:
#
# ./pyth... | gpl-3.0 |
DavidLP/home-assistant | homeassistant/components/push/camera.py | 5 | 5809 | """Camera platform that receives images through HTTP POST."""
import logging
import asyncio
from collections import deque
from datetime import timedelta
import voluptuous as vol
import aiohttp
import async_timeout
from homeassistant.components.camera import Camera, PLATFORM_SCHEMA,\
STATE_IDLE, STATE_RECORDING
fr... | apache-2.0 |
harikvpy/django-popupcrud | test/tests.py | 1 | 14507 | # -*- coding: utf-8 -*-
# pylint: skip-file
import re
import json
from django.test import TestCase
from django.http import JsonResponse
try:
from django.urls import reverse
except expression as identifier:
from django.core.urlresolvers import reverse
import six
from .models import Author, Book
from .views im... | bsd-3-clause |
js0701/chromium-crosswalk | tools/perf/measurements/page_cycler_unittest.py | 8 | 8815 | # Copyright 2013 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 sys
import unittest
from telemetry.internal.browser import browser_options
from telemetry.internal.results import page_test_results
from telemetry.in... | bsd-3-clause |
Widiot/simpleblog | venv/lib/python3.5/site-packages/sqlalchemy/sql/__init__.py | 32 | 1821 | # sql/__init__.py
# Copyright (C) 2005-2017 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
from .expression import (
Alias,
ClauseElement,
ColumnCollection,
Co... | mit |
m8ttyB/socorro | minidump-stackwalk/jsoncpp-src-0.5.0/makerelease.py | 75 | 14783 | """Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
Example of invocation (use to test the script):
python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,mingw -ublep 0.5.0 0.6.0-dev
Example of invocation when doing a release:
python makerelease.py 0.5.0 0.6.0-dev
"""
imp... | mpl-2.0 |
mozilla/stoneridge | python/src/Lib/test/test_float.py | 67 | 62273 |
import unittest, struct
import os
from test import test_support
import math
from math import isinf, isnan, copysign, ldexp
import operator
import random
import fractions
import sys
INF = float("inf")
NAN = float("nan")
have_getformat = hasattr(float, "__getformat__")
requires_getformat = unittest.skipUnless(have_get... | mpl-2.0 |
digimarc/django | tests/custom_columns/tests.py | 207 | 4090 | from __future__ import unicode_literals
from django.core.exceptions import FieldError
from django.test import TestCase
from django.utils import six
from .models import Article, Author
class CustomColumnsTests(TestCase):
def setUp(self):
self.a1 = Author.objects.create(first_name="John", last_name="Smit... | bsd-3-clause |
GuillaumeGomez/servo | tests/wpt/css-tests/tools/py/testing/code/test_excinfo.py | 160 | 30688 | # -*- coding: utf-8 -*-
import py
from py._code.code import FormattedExcinfo, ReprExceptionInfo
queue = py.builtin._tryimport('queue', 'Queue')
failsonjython = py.test.mark.xfail("sys.platform.startswith('java')")
from test_source import astonly
try:
import importlib
except ImportError:
invalidate_import_cac... | mpl-2.0 |
Changaco/oh-mainline | vendor/packages/twisted/twisted/web/test/test_flatten.py | 18 | 10028 |
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys
import traceback
from zope.interface import implements
from twisted.trial.unittest import TestCase
from twisted.internet.defer import succeed, gatherResults
from twisted.web._stan import Tag
from twisted.web.error import UnfilledSlot... | agpl-3.0 |
rsignell-usgs/PySeidon | pyseidon/tidegaugeClass/plotsTidegauge.py | 2 | 1096 | #!/usr/bin/python2.7
# encoding: utf-8
from __future__ import division
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.tri as Tri
import matplotlib.ticker as ticker
import seaborn
class PlotsTidegauge:
"""'Plots' subset of Tidegauge class gathers plotting functions"""
def __init__(self, v... | agpl-3.0 |
brianwc/juriscraper | opinions/united_states/state/cal.py | 1 | 1498 | from juriscraper.OpinionSite import OpinionSite
import re
import time
from datetime import date
class Site(OpinionSite):
def __init__(self):
super(Site, self).__init__()
self.url = 'http://www.courtinfo.ca.gov/cgi-bin/opinions-blank.cgi?Courts=S'
self.court_id = self.__module__
def _g... | bsd-2-clause |
neno1978/pelisalacarta | python/main-classic/servers/wholecloud.py | 2 | 2380 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para wholecloud
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
# ------------------------------------------------------------
import re
from core import httptools
from core import ... | gpl-3.0 |
pelya/commandergenius | project/jni/python/src/Lib/plat-irix6/panel.py | 132 | 7862 | # Module 'panel'
#
# Support for the Panel library.
# Uses built-in module 'pnl'.
# Applications should use 'panel.function' instead of 'pnl.function';
# most 'pnl' functions are transparently exported by 'panel',
# but dopanel() is overridden and you have to use this version
# if you want to use callbacks.
from warnin... | lgpl-2.1 |
igemsoftware/SYSU-Software2013 | project/Python27_32/Lib/test/test_hotshot.py | 122 | 4990 | import os
import pprint
import unittest
import tempfile
import _hotshot
import gc
from test import test_support
# Silence Py3k warning
hotshot = test_support.import_module('hotshot', deprecated=True)
from hotshot.log import ENTER, EXIT, LINE
from hotshot import stats
def shortfilename(fn):
# We use a really sho... | mit |
fujita-shintaro/mkdocs | mkdocs/tests/search_tests.py | 21 | 4220 | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
import unittest
from mkdocs import nav
from mkdocs import search
from mkdocs.tests.base import dedent, markdown_to_toc
def strip_whitespace(string):
return string.replace("\n", "").replace(" ", "")
class SearchTests(unittest.TestCas... | bsd-2-clause |
Jav10/Python | C-digosPython/VarTipo1.py | 1 | 1449 | #Variables y tipos de datos
#Autor: Javier Arturo Hernández Sosa
#Fecha: 28/Ago/2017
#Descripcion: Curso Python FES Acatlán
#Tipos de datos
numero = 5 #Operador de asignación
numero2 = 19
numeroFlotante = 25.0
cadena = "Hola Mundo"
boleano1 = True
boleano2 = False
complejo1 = 5 - 3j
complejo2 = 2 + 5j
#... | mit |
rrampage/rethinkdb | test/rql_test/connections/http_support/werkzeug/contrib/wrappers.py | 295 | 10331 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.wrappers
~~~~~~~~~~~~~~~~~~~~~~~~~
Extra wrappers or mixins contributed by the community. These wrappers can
be mixed in into request objects to add extra functionality.
Example::
from werkzeug.wrappers import Request as RequestBase
fr... | agpl-3.0 |
pawaranand/phr_frappe | frappe/core/page/data_import_tool/data_import_tool.py | 17 | 2781 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, json, os
from frappe import _
import frappe.modules.import_file
@frappe.whitelist()
def get_data_keys():
return frappe._dict({
"data_separator": _(... | mit |
openstack/horizon | openstack_dashboard/dashboards/project/volumes/tests.py | 1 | 96001 | # Copyright 2012 Nebula, 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 agree... | apache-2.0 |
DazWorrall/ansible | lib/ansible/modules/monitoring/pagerduty.py | 29 | 9095 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Project
# 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 |
XueqingLin/tensorflow | tensorflow/python/training/momentum.py | 27 | 3021 | # 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 |
Godiyos/python-for-android | python3-alpha/python3-src/Lib/test/test_startfile.py | 53 | 1102 | # Ridiculously simple test of the os.startfile function for Windows.
#
# empty.vbs is an empty file (except for a comment), which does
# nothing when run with cscript or wscript.
#
# A possible improvement would be to have empty.vbs do something that
# we can detect here, to make sure that not only the os.startfile()
#... | apache-2.0 |
efimlosev/corpcolo | noc-ps/add_server.py | 1 | 2912 | from json_p_n import sendRecieve
import pexpect,argparse
from sys import path
import subprocess
path.append('/home/efim/Dropbox')
from ipcalc_flask import calculateSubnet as calc
def Main():
parser = argparse.ArgumentParser()
parser.add_argument('subnet', help='Give me a subnet', type=str) #optinal argument
... | gpl-2.0 |
mozilla/zamboni | mkt/recommendations/views.py | 9 | 3183 | from django.conf import settings
import commonware.log
import requests
from django_statsd.clients import statsd
from requests.exceptions import RequestException, Timeout
from rest_framework.generics import ListAPIView
from rest_framework.permissions import AllowAny
from rest_framework.response import Response
from mk... | bsd-3-clause |
chrismattmann/tika-similarity | sk_kmeans.py | 2 | 4409 | #!/usr/bin/env python2.7
#
# 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 "... | apache-2.0 |
cfehring/slack-onnow | requests/packages/chardet/compat.py | 2943 | 1157 | ######################## BEGIN LICENSE BLOCK ########################
# Contributor(s):
# Ian Cordasco - port to Python
#
# This library 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
# versio... | gpl-3.0 |
Dylan-halls/Network-Exploitation-Toolkit | PacketBlocker/ARP_UDP.py | 1 | 2931 | import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import threading
from termcolor import colored
os.system("clear")
print("""
____ ___________ __________
| | \______ ______ )
| | /| | \| ___)
... | mit |
GitHublong/hue | desktop/core/ext-py/PyYAML-3.09/tests/lib3/test_constructor.py | 57 | 8744 |
import yaml
import pprint
import datetime
import yaml.tokens
def execute(code):
global value
exec(code)
return value
def _make_objects():
global MyLoader, MyDumper, MyTestClass1, MyTestClass2, MyTestClass3, YAMLObject1, YAMLObject2, \
AnObject, AnInstance, AState, ACustomState, InitArgs... | apache-2.0 |
rgayon/plaso | plaso/parsers/czip.py | 1 | 2615 | # -*- coding: utf-8 -*-
"""This file contains a parser for compound ZIP files."""
from __future__ import unicode_literals
import struct
import zipfile
from plaso.lib import errors
from plaso.parsers import interface
from plaso.parsers import logger
from plaso.parsers import manager
class CompoundZIPParser(interfac... | apache-2.0 |
craigcook/bedrock | bedrock/security/models.py | 9 | 8360 | # 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 django.db import models
from django.template.defaultfilters import slugify
from django.utils.functional import tota... | mpl-2.0 |
odlgroup/odl | odl/test/util/vectorization_test.py | 3 | 9270 | # Copyright 2014-2017 The ODL contributors
#
# This file is part of ODL.
#
# 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 https://mozilla.org/MPL/2.0/.
from __future__ import division
import numpy... | mpl-2.0 |
fbossy/SickRage | lib/hachoir_parser/archive/ace.py | 95 | 9944 | """
ACE parser
From wotsit.org and the SDK header (bitflags)
Partial study of a new block type (5) I've called "new_recovery", as its
syntax is very close to the former one (of type 2).
Status: can only read totally file and header blocks.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
Creation date: 19 jan... | gpl-3.0 |
kant/videonotes | lib/oauth2client/multistore_file.py | 52 | 12045 | # Copyright 2011 Google Inc. All Rights Reserved.
"""Multi-credential file store with lock support.
This module implements a JSON credential store where multiple
credentials can be stored in one file. That file supports locking
both in a single process and across processes.
The credential themselves are keyed off of... | mit |
viggates/nova | tools/xenserver/stress_test.py | 149 | 5170 | """
This script concurrently builds and migrates instances. This can be useful when
troubleshooting race-conditions in virt-layer code.
Expects:
novarc to be sourced in the environment
Helper Script for Xen Dom0:
# cat /tmp/destroy_cache_vdis
#!/bin/bash
xe vdi-list | grep "Glance Image" -C1 | grep ... | apache-2.0 |
vlinhd11/vlinhd11-android-scripting | python-build/python-libs/gdata/tests/all_tests_cached.py | 87 | 1025 | #!/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... | apache-2.0 |
accomac/namebench | nb_third_party/httplib2/iri2uri.py | 885 | 3850 | """
iri2uri
Converts an IRI to a URI.
"""
__author__ = "Joe Gregorio (joe@bitworking.org)"
__copyright__ = "Copyright 2006, Joe Gregorio"
__contributors__ = []
__version__ = "1.0.0"
__license__ = "MIT"
__history__ = """
"""
import urlparse
# Convert an IRI to a URI following the rules in RFC 3987
#
# The characte... | apache-2.0 |
rameshvs/nipype | nipype/interfaces/camino/tests/test_auto_ImageStats.py | 3 | 1231 | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from nipype.testing import assert_equal
from nipype.interfaces.camino.utils import ImageStats
def test_ImageStats_inputs():
input_map = dict(args=dict(argstr='%s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(nohash... | bsd-3-clause |
r3tard/BartusBot | lib/requests/compat.py | 87 | 2567 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import charade as chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
#: Python 3.0.x
is_py30 = (is_py3 and _ver[1] == 0)
#: Python 3.1.... | apache-2.0 |
mdhaber/scipy | scipy/linalg/matfuncs.py | 21 | 19751 | #
# Author: Travis Oliphant, March 2002
#
__all__ = ['expm','cosm','sinm','tanm','coshm','sinhm',
'tanhm','logm','funm','signm','sqrtm',
'expm_frechet', 'expm_cond', 'fractional_matrix_power',
'khatri_rao']
from numpy import (Inf, dot, diag, prod, logical_not, ravel,
transpose... | bsd-3-clause |
astropy/astropy | astropy/timeseries/periodograms/lombscargle/tests/test_statistics.py | 5 | 7537 | import numpy as np
import pytest
from numpy.testing import assert_allclose
import astropy.units as u
from astropy.timeseries.periodograms.lombscargle import LombScargle
from astropy.timeseries.periodograms.lombscargle._statistics import (fap_single, inv_fap_single,
... | bsd-3-clause |
petrutlucian94/nova | nova/api/openstack/compute/plugins/v3/shelve.py | 36 | 3900 | # Copyright 2013 Rackspace Hosting
#
# 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 agre... | apache-2.0 |
citrix-openstack-build/python-ironicclient | ironicclient/openstack/common/rootwrap/filters.py | 5 | 8428 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2011 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-2.0 |
0jpq0/kbengine | kbe/src/lib/python/Lib/test/test_pstats.py | 175 | 1295 | import unittest
from test import support
from io import StringIO
import pstats
class AddCallersTestCase(unittest.TestCase):
"""Tests for pstats.add_callers helper."""
def test_combine_results(self):
# pstats.add_callers should combine the call results of both target
# and source by adding th... | lgpl-3.0 |
klausman/scion | python/lib/sibra/ext/resv.py | 3 | 4193 | # Copyright 2016 ETH Zurich
#
# 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, sof... | apache-2.0 |
enthought/depsolver | depsolver/solver/tests/scenarios/common.py | 1 | 6526 | import collections
import glob
import json
import subprocess
import tempfile
import os.path as op
import yaml
from depsolver.bundled.traitlets \
import \
HasTraits, Dict, Instance, List, Long, Unicode
from depsolver.constraints \
import \
Any, GEQ, LT
from depsolver.package \
import \
... | bsd-3-clause |
darshanthaker/nupic | examples/prediction/experiments/confidenceTest/secondOrder0/description.py | 50 | 3175 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2013, 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... | agpl-3.0 |
dtusar/coco | code-postprocessing/bbob_pproc/compall/pprldmany.py | 3 | 29654 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Generates figure of the bootstrap distribution of ERT.
The main method in this module generates figures of Empirical
Cumulative Distribution Functions of the bootstrap distribution of
the Expected Running Time (ERT) divided by the dimension for many
algorithms.
T... | bsd-3-clause |
hammondt/googletest | test/gtest_list_tests_unittest.py | 1898 | 6515 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
faircoin/faircoin2 | test/functional/p2p-timeouts.py | 34 | 2963 | #!/usr/bin/env python3
# Copyright (c) 2016 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 various net timeouts.
- Create three bitcoind nodes:
no_verack_node - we never send a verack in r... | mit |
switowski/invenio | invenio/modules/workflows/tasks/sample_tasks.py | 15 | 3791 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2013, 2014 CERN.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any... | gpl-2.0 |
randynobx/ansible | lib/ansible/modules/cloud/amazon/ec2_group.py | 2 | 23019 | #!/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 |
jensengrouppsu/rapid | rapid/pyqtgraph/units.py | 55 | 1402 | # -*- coding: utf-8 -*-
## Very simple unit support:
## - creates variable names like 'mV' and 'kHz'
## - the value assigned to the variable corresponds to the scale prefix
## (mV = 0.001)
## - the actual units are purely cosmetic for making code clearer:
##
## x = 20*pA is identical to x = 20*1e-12
#... | mit |
kangfend/django | django/conf/locale/__init__.py | 294 | 11881 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
"""
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.
The 'fallback' key can be used to specify a special fallback... | bsd-3-clause |
brokenjacobs/ansible | lib/ansible/template/__init__.py | 29 | 29436 | # (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 |
xodus7/tensorflow | tensorflow/python/training/evaluation.py | 39 | 8616 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
DolphinDream/sverchok | nodes/generators_extended/spiral_mk2.py | 1 | 22191 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | gpl-3.0 |
flyballlabs/threatdetectionservice | api/venv/lib/python2.7/site-packages/pip/_vendor/cachecontrol/heuristics.py | 490 | 4141 | import calendar
import time
from email.utils import formatdate, parsedate, parsedate_tz
from datetime import datetime, timedelta
TIME_FMT = "%a, %d %b %Y %H:%M:%S GMT"
def expire_after(delta, date=None):
date = date or datetime.now()
return date + delta
def datetime_to_header(dt):
return formatdate(c... | apache-2.0 |
AD5GB/android_kernel_google_msm | tools/perf/scripts/python/sctop.py | 11180 | 1924 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
aldian/tensorflow | tensorflow/python/saved_model/saved_model_test.py | 3 | 44466 | # 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 |
cutelyst/FrameworkBenchmarks | frameworks/Python/emmett/app.py | 10 | 2325 |
from functools import partial
from random import randint
from emmett import App, request
from emmett.orm import Database, Model, Field, rowmethod
from emmett.tools import service
app = App(__name__)
class World(Model):
tablename = "world"
randomnumber = Field.int()
@rowmethod('serialize')
def _ser... | bsd-3-clause |
pbomta/or-tools | examples/python/young_tableaux.py | 32 | 4055 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# 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 ... | apache-2.0 |
simmetria/sentry | tests/sentry/web/frontend/projects/tests.py | 1 | 1710 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
from django.contrib.auth.models import User
from django.core.urlresolvers import reverse
from sentry.constants import MEMBER_OWNER
from sentry.models import Project, Team
from sentry.testutils import fixture
from sentry.testutils import T... | bsd-3-clause |
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | volume/drivers/ec2/ec2volume.py | 10 | 3823 | """
Volume Drivers for aws storage arrays.
"""
from py4j.java_gateway import JavaGateway, GatewayClient
import time
from cinder.i18n import _
from cinder import exception
from cinder.openstack.common import log as logging
from cinder.volume import driver
from py4j.java_gateway import JavaGateway
LOG = logging.getLogg... | apache-2.0 |
rkokkelk/CouchPotatoServer | couchpotato/core/media/_base/providers/torrent/awesomehd.py | 54 | 6550 | import re
import traceback
from bs4 import BeautifulSoup
from couchpotato.core.helpers.variable import tryInt, getIdentifier
from couchpotato.core.logger import CPLog
from couchpotato.core.media._base.providers.torrent.base import TorrentProvider
log = CPLog(__name__)
class Base(TorrentProvider):
urls = {
... | gpl-3.0 |
GreenLunar/searx | searx/engines/faroo.py | 6 | 3527 | """
Faroo (Web, News)
@website http://www.faroo.com
@provide-api yes (http://www.faroo.com/hp/api/api.html), require API-key
@using-api yes
@results JSON
@stable yes
@parse url, title, content, publishedDate, img_src
"""
from urllib import urlencode
from json import loads
import datetime
... | agpl-3.0 |
emilio/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/python/integration.py | 30 | 13137 | import pytest
from _pytest import python
from _pytest import runner
class TestOEJSKITSpecials(object):
def test_funcarg_non_pycollectobj(self, testdir): # rough jstests usage
testdir.makeconftest(
"""
import pytest
def pytest_pycollect_makeitem(collector, name, obj):
... | mpl-2.0 |
sachinkum/Bal-Aveksha | WebServer/BalAvekshaEnv/lib/python3.5/site-packages/django/core/serializers/__init__.py | 115 | 8253 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | gpl-3.0 |
zeroincombenze/tools | clodoo/tests/__clodoo_test_04.py | 2 | 21130 | # -*- coding: utf-8 -*-
#
# Copyright SHS-AV s.r.l. <http://www.zeroincombenze.org>)
#
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
#
# All Rights Reserved
#
"""
Clodoo Regression Test Suite
"""
# import pdb
import os
import re
# import os.path
import sys
from subprocess import PIPE, Popen
f... | agpl-3.0 |
manolama/dd-agent | tests/checks/integration/test_rabbitmq.py | 7 | 3567 | # 3p
from nose.plugins.attrib import attr
# project
from tests.checks.common import AgentCheckTest
CONFIG = {
'init_config': {},
'instances': [
{
'rabbitmq_api_url': 'http://localhost:15672/api/',
'rabbitmq_user': 'guest',
'rabbitmq_pass': 'guest',
'queu... | bsd-3-clause |
MobinRanjbar/hue | desktop/core/ext-py/tablib-0.10.0/tablib/packages/odf3/number.py | 56 | 3137 | # -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library 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 2.1 of the License, or (at you... | apache-2.0 |
redhat-performance/tuned | tuned/daemon/controller.py | 1 | 8767 | from tuned import exports
import tuned.logs
import tuned.exceptions
from tuned.exceptions import TunedException
import threading
import tuned.consts as consts
from tuned.utils.commands import commands
__all__ = ["Controller"]
log = tuned.logs.get()
class TimerStore(object):
def __init__(self):
self._timers = dict... | gpl-2.0 |
hainm/scikit-learn | benchmarks/bench_sample_without_replacement.py | 397 | 8008 | """
Benchmarks for sampling without replacement of integer.
"""
from __future__ import division
from __future__ import print_function
import gc
import sys
import optparse
from datetime import datetime
import operator
import matplotlib.pyplot as plt
import numpy as np
import random
from sklearn.externals.six.moves i... | bsd-3-clause |
sauloal/pycluster | pypy-1.9_64/lib-python/2.7/plat-irix5/panelparser.py | 132 | 3398 | # Module 'parser'
#
# Parse S-expressions output by the Panel Editor
# (which is written in Scheme so it can't help writing S-expressions).
#
# See notes at end of file.
from warnings import warnpy3k
warnpy3k("the panelparser module has been removed in Python 3.0", stacklevel=2)
del warnpy3k
whitespace = ' \t\n'
oper... | mit |
xodus7/tensorflow | tensorflow/python/training/monitored_session.py | 2 | 52771 | # pylint: disable=g-bad-file-header
# 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/LICENS... | apache-2.0 |
NathanW2/QGIS | tests/src/python/test_qgsappstartup.py | 17 | 4844 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsApplication.
From build dir: ctest -R PyQgsAppStartup -V
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, ... | gpl-2.0 |
Sonicbids/django | django/core/handlers/base.py | 13 | 12068 | 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... | bsd-3-clause |
ff94315/hiwifi-openwrt-HC5661-HC5761 | staging_dir/host/lib/python2.7/distutils/tests/test_build_ext.py | 18 | 19362 | import sys
import os
from StringIO import StringIO
import textwrap
from distutils.core import Extension, Distribution
from distutils.command.build_ext import build_ext
from distutils import sysconfig
from distutils.tests import support
from distutils.errors import (DistutilsSetupError, CompileError,
... | gpl-2.0 |
r8921039/bitcoin | test/functional/feature_segwit.py | 1 | 36451 | #!/usr/bin/env python3
# Copyright (c) 2016-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 the SegWit changeover logic."""
from decimal import Decimal
from io import BytesIO
from test_fra... | mit |
a10networks/acos-client | acos_client/tests/unit/v30/test_dns.py | 1 | 3344 | # Copyright (C) 2016, A10 Networks 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 requi... | apache-2.0 |
zhengyongbo/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/scripts/fuse_gtest_files.py | 314 | 8813 | #!/usr/bin/env python
#
# Copyright 2009, 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... | bsd-3-clause |
MicroDreamIT/ShapeCss | node_modules/node-gyp/gyp/pylib/gyp/generator/android.py | 960 | 45344 | # Copyright (c) 2012 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.
# Notes:
#
# This generates makefiles suitable for inclusion into the Android build system
# via an Android.mk file. It is based on make.py, the standard makefile
... | mit |
syci/l10n-spain | l10n_es_vat_book/models/l10n_es_vat_book_issued_lines.py | 5 | 2053 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2017 Praxya (http://praxya.com/)
# Daniel Rodriguez Lijo <drl.9319@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the te... | agpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.