repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
BackupGGCode/python-for-android | python-build/python-libs/gdata/src/gdata/docs/service.py | 133 | 22521 | #!/usr/bin/python
#
# Copyright 2009 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 b... | apache-2.0 |
neutronpy/neutronpy | neutronpy/lsfit/fitter.py | 3 | 14260 | # -*- coding: utf-8 -*-
r"""non-linear least squares fitting
"""
import numbers
import warnings
from collections import namedtuple
import numpy as np
from lmfit import Minimizer, Parameters, minimize
from .plot import PlotFit
from .tools import residual_wrapper
class Fitter(PlotFit):
u"""Wrapper for LMFIT, whi... | mit |
pumazi/wsgi_intercept2 | wsgi_intercept/httplib2_intercept.py | 2 | 1655 |
"""intercept HTTP connections that use httplib2
(see wsgi_intercept/__init__.py for examples)
"""
import httplib2
import wsgi_intercept
from httplib2 import SCHEME_TO_CONNECTION, HTTPConnectionWithTimeout, HTTPSConnectionWithTimeout
import sys
InterceptorMixin = wsgi_intercept.WSGI_HTTPConnection
# might make mor... | mit |
vmarkovtsev/django | tests/utils_tests/test_regex_helper.py | 448 | 1784 | from __future__ import unicode_literals
import unittest
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def te... | bsd-3-clause |
assefay/inasafe | safe_qgis/utilities/test/test_styling.py | 3 | 13779 | """
InaSAFE Disaster risk assessment tool developed by AusAid -
**Styling Tests.**
Contact : ole.moller.nielsen@gmail.com
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either ... | gpl-3.0 |
CN-UPB/OpenBarista | utils/decaf-utils-vnfm/decaf_utils_vnfm/element_manager/element_manager.py | 1 | 1235 | ##
# Copyright 2016 DECaF Project Group, University of Paderborn
# This file is part of the decaf orchestration framework
# All Rights Reserved.
#
# 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 htt... | mpl-2.0 |
crmccreary/openerp_server | openerp/addons/point_of_sale/report/pos_sales_user.py | 9 | 2136 | # -*- 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 |
kambysese/mne-python | examples/forward/plot_forward_sensitivity_maps.py | 14 | 4139 | """
.. _ex-sensitivity-maps:
================================================
Display sensitivity maps for EEG and MEG sensors
================================================
Sensitivity maps can be produced from forward operators that
indicate how well different sensor types will be able to detect
neural currents f... | bsd-3-clause |
Sinar/popit_ng | popit/tests/base_testcase.py | 1 | 8586 | from django.test import TestCase
from rest_framework.test import APITestCase
from popit.signals.handlers import *
from popit.models import *
class BasePopitTestCase(TestCase):
fixtures = ["api_request_test_data.yaml"]
def setUp(self):
post_save.disconnect(entity_save_handler, sender=Person)
p... | agpl-3.0 |
ianmiell/OLD-shutitdist | cups/cups.py | 1 | 2066 | """ShutIt module. See http://shutit.tk
"""
from shutit_module import ShutItModule
class cups(ShutItModule):
def is_installed(self, shutit):
return shutit.file_exists('/root/shutit_build/module_record/' + self.module_id + '/built')
def build(self, shutit):
shutit.send('mkdir -p /tmp/build/cups')
shutit.sen... | gpl-2.0 |
guorendong/iridium-browser-ubuntu | third_party/markupsafe/__init__.py | 371 | 8205 | # -*- coding: utf-8 -*-
"""
markupsafe
~~~~~~~~~~
Implements a Markup string.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import re
from markupsafe._compat import text_type, string_types, int_types, \
unichr, PY2
__all__ = ['Markup', 'soft_unicod... | bsd-3-clause |
bfalacerda/strands_executive | task_executor/scripts/db_queries/routine_times.py | 2 | 2092 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import rospy
import mongodb_store_msgs.srv as dc_srv
import mongodb_store.util as dc_util
from mongodb_store.message_store import MessageStoreProxy
from strands_executive_msgs.msg import Task, TaskEvent
from datetime import datetime
from task_executor import task_routine, ... | mit |
skuarch/namebench | nb_third_party/dns/rdtypes/ANY/CNAME.py | 248 | 1092 | # 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 |
zdanek/FrameworkBenchmarks | toolset/benchmark/test_types/framework_test_type.py | 5 | 4747 | import copy
import sys
import subprocess
from subprocess import PIPE
from pprint import pprint
class FrameworkTestType:
'''Interface between a test type (json, query, plaintext, etc) and
the rest of TFB. A test type defines a number of keys it expects
to find in the benchmark_config.json, and this base class h... | bsd-3-clause |
dya2/python-for-android | python3-alpha/python3-src/Lib/test/test_int.py | 765 | 12587 | import sys
import unittest
from test.support import run_unittest
L = [
('0', 0),
('1', 1),
('9', 9),
('10', 10),
('99', 99),
('100', 100),
('314', 314),
(' 314', 314),
('314 ', 314),
(' \t\t 314 \t\t ', 314),
(repr(sys.maxsize... | apache-2.0 |
mmezzavilla/ns3-mmwave | .waf-1.8.19-b1fc8f7baef51bd2db4c2971909a568d/waflib/Tools/c_tests.py | 10 | 4245 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! https://waf.io/book/index.html#_obtaining_the_waf_file
from waflib import Task
from waflib.Configure import conf
from waflib.TaskGen import feature,before_method,after_method
LIB_CODE='''
#ifdef _MSC_VER
#define testEXPORT __declspec(dllexport)
#else
#de... | gpl-2.0 |
bryx-inc/boto | boto/__init__.py | 87 | 41904 | # Copyright (c) 2006-2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010-2011, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# Copyright (c) 2010, Google, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, ... | mit |
tomislacker/python-iproute2 | pyroute2/ipdb/route.py | 4 | 16062 | import logging
import threading
from socket import AF_UNSPEC
from pyroute2.common import basestring
from pyroute2.netlink import nlmsg
from pyroute2.netlink.rtnl.rtmsg import rtmsg
from pyroute2.netlink.rtnl.req import IPRouteRequest
from pyroute2.ipdb.transactional import Transactional
from pyroute2.ipdb.linkedset imp... | apache-2.0 |
rzambre/servo | tests/wpt/web-platform-tests/tools/pytest/_pytest/cacheprovider.py | 188 | 8939 | """
merged implementation of the cache provider
the name cache was not choosen to ensure pluggy automatically
ignores the external pytest-cache
"""
import py
import pytest
import json
from os.path import sep as _sep, altsep as _altsep
class Cache(object):
def __init__(self, config):
self.config = config... | mpl-2.0 |
nitin-cherian/LifeLongLearning | Python/PythonProgrammingLanguage/Encapsulation/encap_env/lib/python3.5/site-packages/pip-9.0.1-py3.5.egg/pip/_vendor/html5lib/filters/optionaltags.py | 354 | 10534 | from __future__ import absolute_import, division, unicode_literals
from . import base
class Filter(base.Filter):
def slider(self):
previous1 = previous2 = None
for token in self.source:
if previous1 is not None:
yield previous2, previous1, token
previous2 =... | mit |
Varentsov/servo | tests/wpt/web-platform-tests/mimesniff/mime-types/resources/generated-mime-types.py | 47 | 1790 | import json
def isHTTPTokenCodePoint(cp):
if cp in (0x21, 0x23, 0x24, 0x25, 0x26, 0x27, 0x2A, 0x2B, 0x2D, 0x2E, 0x5E, 0x5F, 0x60, 0x7C, 0x7E) or (cp >= 0x30 and cp <= 0x39) or (cp >= 0x41 and cp <= 0x5A) or (cp >= 0x61 and cp <= 0x7A):
return True
else:
return False
def isHTTPQuotedStringToken... | mpl-2.0 |
sschuberth/ubuntu-make | tests/small/test_download_center.py | 5 | 26374 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... | gpl-3.0 |
dominjune/LeetCode | 200 Number of Islands.py | 2 | 1498 | """
Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and
is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all
surrounded by water.
Example 1:
11110
11010
11000
00000
Answer: 1
Example 2:
... | mit |
OldManMarsh/Jumper-Cogs | lottery/lottery.py | 1 | 26301 | # Lottery was created by Redjumpman for Redbot
# This will create 2 data folders with 1 JSON file
import os
import asyncio
import random
import discord
from discord.ext import commands
from .utils.dataIO import dataIO
from .utils import checks
from __main__ import send_cmd_help
class Lottery:
"""Ho... | mit |
vipul-sharma20/oh-mainline | vendor/packages/Django/django/conf/urls/__init__.py | 116 | 2538 | from django.core.urlresolvers import (RegexURLPattern,
RegexURLResolver, LocaleRegexURLResolver)
from django.core.exceptions import ImproperlyConfigured
from django.utils.importlib import import_module
from django.utils import six
__all__ = ['handler403', 'handler404', 'handler500', 'include', 'patterns', 'url']
... | agpl-3.0 |
sbtlaarzc/vispy | examples/collections/tiger.py | 18 | 2455 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vispy: testskip
# -----------------------------------------------------------------------------
# Copyright (c) 2014, Nicolas P. Rougier. All Rights Reserved.
# Distributed under the (new) BSD License.
# -------------------------------------------------------------------... | bsd-3-clause |
jbtule/keyczar-dev | cpp/src/tools/scons/scons-local-1.2.0.d20090223/SCons/Tool/packaging/src_zip.py | 19 | 1714 | """SCons.Tool.Packaging.zip
The zip SRC packager.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 The SCons Foundation
#
# 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 S... | apache-2.0 |
aeph6Ee0/youtube-dl | devscripts/zsh-completion.py | 36 | 1384 | #!/usr/bin/env python
from __future__ import unicode_literals
import os
from os.path import dirname as dirn
import sys
sys.path.insert(0, dirn(dirn((os.path.abspath(__file__)))))
import youtube_dl
ZSH_COMPLETION_FILE = "youtube-dl.zsh"
ZSH_COMPLETION_TEMPLATE = "devscripts/zsh-completion.in"
def build_completion(o... | unlicense |
GuessWhoSamFoo/pandas | pandas/tests/extension/base/ops.py | 2 | 5816 | import operator
import pytest
import pandas as pd
from pandas.core import ops
from .base import BaseExtensionTests
class BaseOpsUtil(BaseExtensionTests):
def get_op_from_name(self, op_name):
short_opname = op_name.strip('_')
try:
op = getattr(operator, short_opname)
except ... | bsd-3-clause |
annacarol/GeoGig | doc/technical/source/conf.py | 8 | 7925 | # -*- coding: utf-8 -*-
#
# GeoGig documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Feb 25 13:44:22 2013.
#
# 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
# autogenerated ... | bsd-3-clause |
bokeh/bokeh | examples/plotting/file/vector.py | 1 | 6589 | from typing import Any, List, Tuple
import numpy as np
from bokeh.layouts import gridplot
from bokeh.plotting import figure, output_file, show
def streamlines(x: np.ndarray, y, u, v, density: float = 1) -> Tuple[List[Any], List[Any]]:
''' Return streamlines of a vector flow.
* x and y are 1d arrays definin... | bsd-3-clause |
oneminot/audacity | lib-src/lv2/lv2/waflib/Utils.py | 146 | 9078 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,sys,errno,traceback,inspect,re,shutil,datetime,gc
import subprocess
try:
from collections import deque
except ImportError:
class deque(list):
def popleft(self):
... | gpl-2.0 |
timj/scons | test/AS/ASPP.py | 3 | 3967 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 limitation the rights to use, copy, modify, merge, publish,
... | mit |
freundTech/blender2minecraft | blender2minecraft/importer.py | 1 | 9365 | class ImportBlockModel(Operator, ImportHelper):
"""This appears in the tooltip of the operator and in the generated docs"""
bl_idname = "import_mc.blockmodel" # important since its how bpy.ops.import_test.some_data is constructed
bl_label = "Import a Minecraft Blockmodel in Scene"
def execute(self, co... | gpl-2.0 |
edunham/servo | tests/wpt/css-tests/tools/wptserve/tests/functional/test_request.py | 299 | 2987 | import os
import unittest
import urllib2
import json
import time
import wptserve
from base import TestUsingServer, doc_root
class TestInputFile(TestUsingServer):
def test_seek(self):
@wptserve.handlers.handler
def handler(request, response):
rv = []
f = request.raw_input
... | mpl-2.0 |
Endika/bank-statement-reconcile | account_advanced_reconcile/advanced_reconciliation.py | 15 | 4709 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2012 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pu... | agpl-3.0 |
smcantab/pele | playground/rigidification/rigidify.py | 7 | 1703 | import numpy as np
from pele.potentials import LJ
from pele.utils import xyz
from pele.angleaxis import rigidbody
from pele.optimize import lbfgs_py
# read in coordinates from xyz file
ref = xyz.read_xyz(open("water.xyz"))
xyz.write_xyz(open("test.xyz", "w"), coords = ref.coords)
# lookup table for atom masses
mass_lo... | gpl-3.0 |
chanul13/hubbard_dimer | dmrg101/core/transform_matrix.py | 2 | 2082 | #
# File: transform_matrix.py
# Author: Ivan Gonzalez
#
""" A function to transform a matrix to a new (truncated) basis.
"""
import numpy as np
from dmrg_exceptions import DMRGException
def transform_matrix(matrix_to_transform, transformation_matrix):
"""Transforms a matrix to a new (truncated) basis.
You us... | mit |
tareqalayan/ansible | lib/ansible/modules/network/netconf/netconf_config.py | 35 | 10840 | #!/usr/bin/python
# (c) 2016, Leandro Lisboa Penz <lpenz at lpenz.org>
# 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 |
borosnborea/SwordGO_app | example/kivymap/.buildozer/android/app/_applibs/requests/packages/chardet/sbcharsetprober.py | 2927 | 4793 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
tchernomax/ansible | lib/ansible/template/template.py | 156 | 1632 | # (c) 2012, 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) any lat... | gpl-3.0 |
atsao72/sympy | sympy/utilities/tests/test_code_quality.py | 64 | 15421 | from os import walk, sep, pardir
from os.path import split, join, abspath, exists, isfile
from glob import glob
import re
import random
import ast
from sympy.core.compatibility import PY3
# System path separator (usually slash or backslash) to be
# used with excluded files, e.g.
# exclude = set([
# ... | bsd-3-clause |
vipul-sharma20/oh-mainline | vendor/packages/python-social-auth/social/backends/tumblr.py | 85 | 1108 | """
Tumblr OAuth1 backend, docs at:
http://psa.matiasaguirre.net/docs/backends/tumblr.html
"""
from social.utils import first
from social.backends.oauth import BaseOAuth1
class TumblrOAuth(BaseOAuth1):
name = 'tumblr'
ID_KEY = 'name'
AUTHORIZATION_URL = 'http://www.tumblr.com/oauth/authorize'
REQU... | agpl-3.0 |
gangadhar-kadam/latestchurcherp | erpnext/setup/utils.py | 6 | 2215 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, throw
from frappe.utils import flt
def get_company_currency(company):
currency = frappe.db.get_value("Company", co... | agpl-3.0 |
aachik/flask-blog-abdulmx | env/lib/python2.7/site-packages/pip/__init__.py | 145 | 9450 | #!/usr/bin/env python
import os
import optparse
import sys
import re
from pip.exceptions import InstallationError, CommandError, PipError
from pip.log import logger
from pip.util import get_installed_distributions, get_prog
from pip.vcs import git, mercurial, subversion, bazaar # noqa
from pip.baseparser import Conf... | mit |
HonzaKral/django | django/contrib/gis/utils/ogrinspect.py | 17 | 8994 | """
This module is for inspecting OGR data sources and generating either
models for GeoDjango and/or mapping dictionaries for use with the
`LayerMapping` utility.
"""
from django.contrib.gis.gdal import DataSource
from django.contrib.gis.gdal.field import (
OFTDate, OFTDateTime, OFTInteger, OFTReal, OFTString, OFTT... | bsd-3-clause |
elssar/calibre | src/calibre/ebooks/compression/palmdoc.py | 14 | 2948 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
__license__ = 'GPL v3'
__copyright__ = '2008, Kovid Goyal <kovid at kovidgoyal.net>'
from cStringIO import StringIO
from struct import pack
from calibre.constants import plugins
cPalmdoc = plugins['cPalmdoc'][0]
if not cPalmdoc:
raise R... | gpl-3.0 |
Softmotions/edx-platform | common/lib/calc/calc/tests/test_preview.py | 257 | 8723 | # -*- coding: utf-8 -*-
"""
Unit tests for preview.py
"""
import unittest
from calc import preview
import pyparsing
class LatexRenderedTest(unittest.TestCase):
"""
Test the initializing code for LatexRendered.
Specifically that it stores the correct data and handles parens well.
"""
def test_sim... | agpl-3.0 |
jlongever/redfish-client-python | on_http_redfish_1_0/models/rack_hd_boot_image_users.py | 1 | 5244 | # coding: utf-8
"""
Copyright 2015 SmartBear Software
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 |
red-green/broscanner | file_scanning.py | 1 | 1354 | ## simple file type detection.
## if i had unlimited api access, i would send every single md5 to something like VirusTotal
forbidden_types = ['text/x-bash', 'text/scriptlet', 'application/x-opc+zip', 'application/com', 'application/x-msmetafile', 'application/x-shellscript', 'text/x-sh', 'text/x-csh', 'application/x-... | gpl-2.0 |
AOKPSaber/kernel_samsung_p4 | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
adityak74/android_kernel_mediatek_sprout | tools/perf/scripts/python/net_dropmonitor.py | 1258 | 1562 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
ybw2016v/pydog | sys.py | 1 | 1265 | #python3
import re
#import indog
from indog import shi
from cal1 import welldog,calone
zhiliang={}
listdata=[]
aimdog={}
def start():
'''启动界面'''
print("KNN PROGECT")
start()
conf=''
def readconf():
global conf
conf=['','']
'''读取配置文件'''
f = open ('data.conf','r')
#conf=0
#while True:
... | lgpl-3.0 |
cyplp/chaton | chaton/__init__.py | 1 | 1830 | from pyramid.config import Configurator
from pyramid.session import SignedCookieSessionFactory
from pyramid.threadlocal import get_current_registry
from chaton.predicate import LoggedPredicate, IsAdminPredicate
my_session_factory = SignedCookieSessionFactory('itsaseekreet')
def main(global_config, **settings):
... | mit |
buntyke/Flask | microblog/flask/lib/python2.7/site-packages/whoosh/qparser/taggers.py | 96 | 3624 | # Copyright 2011 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | mit |
vulcansteel/autorest | AutoRest/Generators/Python/Python.Tests/Expected/AcceptanceTests/BodyDateTime/auto_rest_date_time_test_service/models/error.py | 24 | 1158 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | mit |
skuda/client-python | kubernetes/client/models/v1_key_to_path.py | 1 | 4890 | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.6.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | apache-2.0 |
sktjdgns1189/android_kernel_samsung_aries_KOR | tools/perf/scripts/python/syscall-counts-by-pid.py | 944 | 1744 | # 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
import sys
sys.path.append(... | gpl-2.0 |
conwin/node-gyp | gyp/test/mac/gyptest-installname.py | 244 | 2512 | #!/usr/bin/env python
# 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.
"""
Verifies that LD_DYLIB_INSTALL_NAME and DYLIB_INSTALL_NAME_BASE are handled
correctly.
"""
import TestGyp
import re
import subprocess
... | mit |
xiang12835/python_web | py2_web2py/web2py/applications/welcome/languages/nl.py | 4 | 19462 | # -*- coding: utf-8 -*-
{
'!langcode!': 'nl',
'!langname!': 'Nederlands',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'%(nrows)s rec... | apache-2.0 |
salamer/picard | picard/mbxml.py | 1 | 15327 | # -*- coding: utf-8 -*-
#
# Picard, the next-generation MusicBrainz tagger
# Copyright (C) 2007 Lukáš Lalinský
#
# 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 |
wong2/sentry | src/sentry/buffer/base.py | 15 | 2435 | """
sentry.buffer.base
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import logging
from django.db.models import F
from sentry.signals import buffer_incr_complete
from sentry.task... | bsd-3-clause |
lekshmideepu/nest-simulator | pynest/examples/glif_cond_neuron.py | 14 | 9655 | # -*- coding: utf-8 -*-
#
# glif_cond_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST 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 Licens... | gpl-2.0 |
spiricn/libIDL | idl/IDLError.py | 1 | 1097 | class IDLError(Exception):
def __init__(self, name, baseMessage, module=None, line=None):
message = '%s error' % name
if module:
message += ' in module %r' % module.name
if module.filePath:
message += ' (File %r )' % mod... | mit |
chromium/chromium | build/util/version.py | 1 | 7963 | #!/usr/bin/env python
# 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.
"""
version.py -- Chromium version string substitution utility.
"""
from __future__ import print_function
import argparse
import os
i... | bsd-3-clause |
svenstaro/flask-jwt | tests/conftest.py | 1 | 1149 | # -*- coding: utf-8 -*-
"""
tests.conftest
~~~~~~~~~~~~~~
Test fixtures and what not
"""
from datetime import timedelta
import pytest
from flask import Flask
import flask_jwt
class User(object):
def __init__(self, **kwargs):
for k, v in kwargs.items():
setattr(self, k, v)
@p... | mit |
aviciimaxwell/odoo | doc/_extensions/odoo/__init__.py | 89 | 4588 | # -*- coding: utf-8 -*-
from . import pygments_override
from . import switcher
from . import translator
import sphinx.environment
import sphinx.builders.html
from docutils import nodes
def setup(app):
app.set_translator('html', translator.BootstrapTranslator)
switcher.setup(app)
app.add_config_value('odo... | agpl-3.0 |
mattmccarthy11/vidly-development | mediadrop/model/comments.py | 10 | 3784 | # This file is a part of MediaDrop (http://www.mediadrop.net),
# Copyright 2009-2015 MediaDrop contributors
# For the exact contribution history, see the git revision log.
# The source code contained in this file is licensed under the GPLv3 or
# (at your option) any later version.
# See LICENSE.txt in the main project ... | gpl-3.0 |
IronLanguages/ironpython2 | Tests/test_super.py | 2 | 1745 | #####################################################################################
#
# Copyright (c) Michael van der Kolff. All rights reserved.
#
# This source code is subject to terms and conditions of the Apache License, Version 2.0. A
# copy of the license can be found in the License.html file at the root of th... | apache-2.0 |
h2oai/h2o-dev | h2o-py/tests/testdir_munging/unop/pyunit_minmax_basic.py | 8 | 1973 | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
import numpy as np
def minmax_basic():
print("Uploading iris data...")
iris_h2o = h2o.import_file(pyunit_utils.locate("smalldata/iris/iris_wheader.csv"))
iris_np = np.genfromtxt(pyunit... | apache-2.0 |
ozburo/youtube-dl | youtube_dl/extractor/niconico.py | 4 | 20357 | # coding: utf-8
from __future__ import unicode_literals
import datetime
import functools
import json
import math
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
determine_ext,
dict_get,
ExtractorError,
float_or_non... | unlicense |
BTCDDev/bitcoin | qa/rpc-tests/pruning.py | 41 | 16675 | #!/usr/bin/env python3
# Copyright (c) 2014-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 pruning code
# ********
# WARNING:
# This test uses 4GB of disk space.
# This test takes 30 mins... | mit |
enigmampc/catalyst | catalyst/data/resample.py | 1 | 26992 | # Copyright 2016 Quantopian, 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 writ... | apache-2.0 |
tdhopper/westminster-daily | tests/test_data.py | 2 | 6950 | import datetime as dt
import pytz
import pytest
import flask_application.data as data
def strip_html_tags(text):
finished = 0
while not finished:
finished = 1
start = text.find("<")
if start >= 0:
stop = text[start:].find(">")
if stop >= 0:
text... | bsd-3-clause |
mopidy/mopidy | mopidy/core/tracklist.py | 3 | 21114 | import logging
import random
from mopidy import exceptions
from mopidy.core import listener
from mopidy.internal import deprecation, validation
from mopidy.internal.models import TracklistState
from mopidy.models import TlTrack, Track
logger = logging.getLogger(__name__)
class TracklistController:
def __init__(... | apache-2.0 |
balloob/home-assistant | homeassistant/components/flo/__init__.py | 7 | 2356 | """The flo integration."""
import asyncio
import logging
from aioflo import async_get_api
from aioflo.errors import RequestError
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
from homeassistant.core import HomeAssistant
from ... | apache-2.0 |
jmacmahon/invenio | modules/miscutil/lib/upgrades/invenio_release_1_1_0.py | 3 | 29872 | #-*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2008, 2009, 2010, 2011, 2012 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... | gpl-2.0 |
akrehl/dotfiles | vim/bundle/YouCompleteMe/third_party/requests/setup.py | 40 | 2124 | #!/usr/bin/env python
import os
import re
import sys
from codecs import open
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
packages = [
'requests',
'requests.packages'... | mit |
liorvh/golismero | tools/sqlmap/lib/core/threads.py | 7 | 5980 | #!/usr/bin/env python
"""
Copyright (c) 2006-2013 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import difflib
import threading
import time
import traceback
from thread import error as threadError
from lib.core.data import conf
from lib.core.data import kb
from lib.cor... | gpl-2.0 |
cxxgtxy/tensorflow | tensorflow/python/client/session_benchmark.py | 76 | 8973 | # 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 |
ppericard/matam | scripts/matam_assembly.py | 2 | 72939 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import statistics
import subprocess
import time
import logging
import cProfile
from collections import defaultdict
import shutil
import runner
from compute_abundance import get_abundance_by_scaffold, complete_fasta_with_abundance, get... | agpl-3.0 |
NeCTAR-RC/horizon | openstack_dashboard/dashboards/project/cg_snapshots/tests.py | 2 | 7819 | # 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 |
isandlaTech/cohorte-demos | led/dump/led-demo-yun/cohorte/dist/cohorte-1.0.0-20141216.234517-57-python-distribution/repo/pelix/internals/events.py | 4 | 4959 | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
Event beans for Pelix.
:author: Thomas Calmant
:copyright: Copyright 2014, isandlaTech
:license: Apache License 2.0
:version: 0.5.8
:status: Beta
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you ma... | apache-2.0 |
jusdng/odoo | addons/payment_sips/__openerp__.py | 196 | 1374 | # -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright Eezee-It
#
# 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, eith... | agpl-3.0 |
lemire/simdjson | singleheader/amalgamate.py | 1 | 6725 | #!/usr/bin/env python3
#
# Creates the amalgamated source files.
#
import sys
import os.path
import subprocess
import os
import re
import shutil
if sys.version_info < (3, 0):
sys.stdout.write("Sorry, requires Python 3.x or better\n")
sys.exit(1)
SCRIPTPATH = os.path.dirname(os.path.abspath(sys.argv[0]))
PROJ... | apache-2.0 |
leezu/mxnet | python/mxnet/io/utils.py | 16 | 3098 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
dednal/chromium.src | third_party/cython/src/Cython/Compiler/Tests/TestBuffer.py | 133 | 4122 | from Cython.TestUtils import CythonTest
import Cython.Compiler.Errors as Errors
from Cython.Compiler.Nodes import *
from Cython.Compiler.ParseTreeTransforms import *
from Cython.Compiler.Buffer import *
class TestBufferParsing(CythonTest):
# First, we only test the raw parser, i.e.
# the number and contents o... | bsd-3-clause |
Yajo/website | website_blog_mgmt/controllers/main.py | 29 | 3311 | # -*- coding: utf-8 -*-
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website_blog.controllers.main import WebsiteBlog
from openerp.addons.website_blog.controllers.main import QueryURL
class WebsiteBlog(WebsiteBlog):
_blog_post_per_page = 20
_post_comment... | agpl-3.0 |
dpoirier/django-all-access | allaccess/models.py | 3 | 2750 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from .clients import get_client
from .compat import AUTH_USER_MODEL
from .fields import EncryptedField
class ProviderManager(models.Manager):
"Additional manager methods for Provide... | bsd-2-clause |
lobnek/pyutil | pyutil/timeseries/merge.py | 1 | 1293 | import pandas as pd
def merge(new, old=None):
# very smart merging here, new and old merge
if new is not None:
if old is not None:
x = pd.concat((new, old), sort=True)
return x.groupby(x.index).first().sort_index()
else:
return new
else:
return ... | mit |
UniShared/videonotes | lib/thrift/transport/TTransport.py | 74 | 8384 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | mit |
fossoult/odoo | openerp/modules/module.py | 199 | 16207 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
kamalx/edx-platform | common/djangoapps/student/migrations/0039_auto__del_courseregistrationcode.py | 114 | 13511 | # -*- 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 model 'CourseRegistrationCode'
db.delete_table('student_courseregistrationcode')
def backwa... | agpl-3.0 |
tlksio/tlksio | env/lib/python3.4/site-packages/pylint/checkers/newstyle.py | 1 | 4488 | # Copyright (c) 2005-2006 LOGILAB S.A. (Paris, FRANCE).
# http://www.logilab.fr/ -- mailto:contact@logilab.fr
#
# 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, o... | mit |
NeuroDataDesign/seelviz | Flask/env/lib/python2.7/site-packages/pip/wheel.py | 78 | 32216 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import absolute_import
import compileall
import csv
import errno
import functools
import hashlib
import logging
import os
import os.path
import re
import shutil
import stat
import sys
import tempfile
import warnings
from ba... | apache-2.0 |
gompa/linux | tools/perf/scripts/python/export-to-postgresql.py | 293 | 26298 | # export-to-postgresql.py: export perf data to a postgresql database
# Copyright (c) 2014, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# Thi... | gpl-2.0 |
public-ink/public-ink | server/appengine/lib/mpl_toolkits/axes_grid1/parasite_axes.py | 10 | 15472 | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import warnings
import matplotlib
rcParams = matplotlib.rcParams
import matplotlib.artist as martist
import matplotlib.transforms as mtransforms
import matplotlib.collections as mcoll
import matplo... | gpl-3.0 |
alrifqi/django | tests/utils_tests/test_regex_helper.py | 448 | 1784 | from __future__ import unicode_literals
import unittest
from django.utils import regex_helper
class NormalizeTests(unittest.TestCase):
def test_empty(self):
pattern = r""
expected = [('', [])]
result = regex_helper.normalize(pattern)
self.assertEqual(result, expected)
def te... | bsd-3-clause |
NelisVerhoef/scikit-learn | benchmarks/bench_multilabel_metrics.py | 276 | 7138 | #!/usr/bin/env python
"""
A comparison of multilabel target formats and metrics over them
"""
from __future__ import division
from __future__ import print_function
from timeit import timeit
from functools import partial
import itertools
import argparse
import sys
import matplotlib.pyplot as plt
import scipy.sparse as... | bsd-3-clause |
karmix/anaconda | tests/pyanaconda_tests/grub_raid_test.py | 13 | 7619 | # Copyright (C) 2014 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your option) any later version.
# This program is distributed in the hope that it will be u... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.