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
egafford/sahara
sahara/service/api/v2/clusters.py
3
5858
# Copyright (c) 2016 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
apache-2.0
UnderSn0w/picasso-graphic
tools/gyp/build/lib/gyp/xcode_emulation.py
149
42289
# 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. """ This module contains classes that help to emulate xcodebuild behavior on top of other build systems, such as make and ninja. """ import gyp.common import os.p...
bsd-3-clause
etkirsch/scikit-learn
sklearn/externals/joblib/hashing.py
194
7504
""" Fast cryptographic hash of Python objects, with a special case for fast hashing of numpy arrays. """ # Author: Gael Varoquaux <gael dot varoquaux at normalesup dot org> # Copyright (c) 2009 Gael Varoquaux # License: BSD Style, 3 clauses. import warnings import pickle import hashlib import sys import types import ...
bsd-3-clause
hujiajie/chromium-crosswalk
tools/json_to_struct/element_generator.py
38
6436
# Copyright (c) 2012 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 json import struct_generator def _JSONToCString16(json_string_literal): """Converts a JSON string literal to a C++ UTF-16 string literal. This ...
bsd-3-clause
vkscool/nupic
tests/regression/run_opf_benchmarks_test.py
2
52736
#!/usr/bin/env python # ---------------------------------------------------------------------- # 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 ...
gpl-3.0
ttfseiko/openerp-trunk
openerp/addons/l10n_mx/__init__.py
975
1058
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2008 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify #...
agpl-3.0
TuSimple/mxnet
example/speech_recognition/stt_layer_lstm.py
52
15440
# 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
dav1x/ansible
contrib/inventory/mdt_dynamic_inventory.py
52
4540
#!/usr/bin/env python # (c) 2016, Julian Barnett <jbarnett@tableau.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 ...
gpl-3.0
robhudson/kuma
vendor/packages/translate/storage/test_wordfast.py
26
2843
#!/usr/bin/env python # -*- coding: utf-8 -*- from translate.storage import test_base, wordfast as wf class TestWFTime(object): def test_timestring(self): """Setting and getting times set using a timestring""" wftime = wf.WordfastTime() assert wftime.timestring is None wftime.tim...
mpl-2.0
waheedahmed/edx-platform
lms/djangoapps/lti_provider/tests/test_outcomes.py
48
18771
""" Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py """ import unittest from django.test import TestCase from lxml import etree from mock import patch, MagicMock, ANY import requests_oauthlib import requests from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator from stud...
agpl-3.0
ztemt/Z5S_NX503A_KitKat_kernel
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
brianlsharp/MissionPlanner
Lib/site-packages/scipy/linalg/decomp.py
53
28952
# # Author: Pearu Peterson, March 2002 # # additions by Travis Oliphant, March 2002 # additions by Eric Jones, June 2002 # additions by Johannes Loehnert, June 2006 # additions by Bart Vandereycken, June 2006 # additions by Andrew D Straw, May 2007 # additions by Tiziano Zito, November 2008 # # April 2010: Functio...
gpl-3.0
Samsung/skia
bench/gen_bench_expectations.py
2
5049
#!/usr/bin/env python # Copyright (c) 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. """ Generate bench_expectations file from a given set of bench data files. """ import argparse import bench_util import os import ...
bsd-3-clause
caidongyun/BuildingMachineLearningSystemsWithPython
ch07/lr10k.py
24
1228
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import numpy as np from sklearn.metrics import mean_squared_error, r2_score from sklearn.datasets impor...
mit
pniedzielski/fb-hackathon-2013-11-21
src/repl.it/jsrepl/extern/python/closured/lib/python2.7/encodings/palmos.py
647
2936
""" Python Character Mapping Codec for PalmOS 3.5. Written by Sjoerd Mullender (sjoerd@acm.org); based on iso8859_15.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_map) def decode(self,inp...
agpl-3.0
alexgorban/models
official/recommendation/ncf_input_pipeline.py
1
7065
# Copyright 2019 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
mariianna/kodi
pelisalacarta/channels/moviepremium.py
2
12362
# -*- coding: utf-8 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Canal para moviepremium creado por Itsuki Minami # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import urlparse,urllib2,urllib,re...
gpl-3.0
protwis/protwis
construct/tool.py
1
81937
from django.shortcuts import render, redirect from django.http import HttpResponse from django.db.models import Min, Count, Max from django.conf import settings from django.views.decorators.cache import cache_page from django import forms from construct.models import * from structure.models import Structure from prote...
apache-2.0
mhei/linux
Documentation/sphinx/kernel_include.py
949
8570
#!/usr/bin/env python3 # -*- coding: utf-8; mode: python -*- # pylint: disable=R0903, C0330, R0914, R0912, E0401 u""" kernel-include ~~~~~~~~~~~~~~ Implementation of the ``kernel-include`` reST-directive. :copyright: Copyright (C) 2016 Markus Heiser :license: GPL Version 2, June 1991 see lin...
gpl-2.0
sangeethah/validation-tests
tests/v3_validation/cattlevalidationtest/core/test_rancher_compose_commands.py
1
20881
from common_fixtures import * # NOQA RCCOMMANDS_SUBDIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'resources/rccmds') logger = logging.getLogger(__name__) start_project_str = "Starting" if_compose_data_files = pytest.mark.skipif( not os.path.isdir(RCCOMMANDS_SUBD...
apache-2.0
kevinastone/sentry
src/sentry/migrations/0007_auto__add_field_message_site.py
36
4258
# 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 field 'Message.site' db.add_column('sentry_message', 'site', self.gf('django.db.models.fields.CharField')...
bsd-3-clause
qiyuangong/leetcode
python/259_3Sum_Smaller.py
2
1788
class Solution(object): # def threeSumSmaller(self, nums, target): # """ # :type nums: List[int] # :type target: int # :rtype: int # """ # # https://leetcode.com/articles/3sum-smaller/#approach-2-binary-search-accepted # nums.sort() # ls = len(nums) ...
mit
adelton/django
django/db/backends/sqlite3/creation.py
193
2859
import os import sys from django.core.exceptions import ImproperlyConfigured from django.db.backends.base.creation import BaseDatabaseCreation from django.utils.six.moves import input class DatabaseCreation(BaseDatabaseCreation): def _get_test_db_name(self): test_database_name = self.connection.settings...
bsd-3-clause
spreadcoin/spreadcoin
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
jerel/readthedocs.org
readthedocs/bookmarks/views.py
2
6466
from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseRedirect from django.http import HttpResponseBadRequest from django.shortcuts import get_object_or_404, render_to_response from django.views.generic import ListView, View from django.core.urlresolvers import reve...
mit
devilry/devilry-django
devilry/devilry_group/tests/test_feedbackfeed/examiner/test_feedbackfeed_examiner_discuss.py
1
50866
# -*- coding: utf-8 -*- from datetime import timedelta from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.test import TestCase from django.utils import timezone from django.conf import settings from model_bakery import baker from devilry.devilry_comment import mod...
bsd-3-clause
milliman/spark
python/pyspark/sql/tests.py
1
107755
# -*- encoding: utf-8 -*- # # 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
tgerla/ansible
lib/ansible/cli/__init__.py
62
23010
# (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
rushiagr/keystone
keystone/tests/unit/ksfixtures/cache.py
23
1337
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
apache-2.0
anksp21/Community-Zenpacks
ZenPacks.community.AvailabilityReportPerCollection/setup.py
2
2666
################################ # These variables are overwritten by Zenoss when the ZenPack is exported # or saved. Do not modify them directly here. # NB: PACKAGES is deprecated NAME = "ZenPacks.community.AvailabilityReportPerCollection" VERSION = "1.2.6" AUTHOR = "Jane Curry" LICENSE = "" NAMESPACE_PACKAGES = ['Ze...
gpl-2.0
jinverar/Empire
lib/stagers/hta.py
12
3328
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'HTA', 'Author': ['@subTee'], 'Description': ('Generates an HTA (HyperText Application) For Internet Explorer'), 'Comments': [ 'Yo...
bsd-3-clause
wolf29/games
py-proj-building-blocks/python2-chardet-2.0.1/setup.py
3
2058
from distutils.core import setup # patch distutils if it can't cope with the "classifiers" or "download_url" # keywords (prior to python 2.3.0). from distutils.dist import DistributionMetadata if not hasattr(DistributionMetadata, 'classifiers'): DistributionMetadata.classifiers = None if not hasattr(Distrib...
gpl-3.0
MichaelDoyle/Diamond
src/collectors/udp/udp.py
31
2669
# coding=utf-8 """ The UDPCollector class collects metrics on UDP stats (surprise!) #### Dependencies * /proc/net/snmp """ import diamond.collector import os class UDPCollector(diamond.collector.Collector): PROC = [ '/proc/net/snmp' ] def process_config(self): super(UDPCollector, s...
mit
scs/uclinux
user/python/python-2.4.4/Lib/test/string_tests.py
5
35487
""" Common tests shared by test_str, test_unicode, test_userstring and test_string. """ import unittest, string, sys from test import test_support from UserList import UserList class Sequence: def __init__(self, seq='wxyz'): self.seq = seq def __len__(self): return len(self.seq) def __getitem__(self, i): ...
gpl-2.0
ahmedaljazzar/edx-platform
openedx/core/djangoapps/oauth_dispatch/migrations/0002_scopedapplication_scopedapplicationorganization.py
13
2897
# -*- coding: utf-8 -*- # Generated by Django 1.11.13 on 2018-06-20 18:22 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import django_mysql.models import oauth2_provider.generators import oauth2_provider.validators c...
agpl-3.0
ryenus/vbox
src/libs/libxml2-2.6.31/python/tests/reader3.py
87
4086
#!/usr/bin/python -u # # this tests the entities substitutions with the XmlTextReader interface # import sys import StringIO import libxml2 docstr="""<?xml version='1.0'?> <!DOCTYPE doc [ <!ENTITY tst "<p>test</p>"> ]> <doc>&tst;</doc>""" # Memory debug specific libxml2.debugMemory(1) # # First test, normal don't su...
gpl-2.0
sideeffects/pycparser
pycparser/c_parser.py
1
60688
#------------------------------------------------------------------------------ # pycparser: c_parser.py # # CParser class: Parser and AST builder for the C language # # Copyright (C) 2008-2013, Eli Bendersky # License: BSD #------------------------------------------------------------------------------ import re from ...
bsd-3-clause
rkhleics/wagtailmenus
wagtailmenus/migrations/0003_auto_20160129_2339.py
3
2519
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('wagtailmenus', '0002_auto_20160129_0901'), ] operations = [ migrations.AlterField( model_name='flatmenu', ...
mit
brengarajalu/GrpcAPI
protobuf/protobuf-3.0.0-alpha-2/gtest/scripts/fuse_gtest_files.py
2577
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
cdoremus/udacity-python_web_development-cs253
src/unit2/rot13/rot13_main.py
1
2113
''' In order to be graded correctly for this homework, there are a few things to keep in mind. We'll be grading your web app by POSTing to your form and retrieving the text that has been encoded with ROT13. There are a few main issues you need to keep in mind in order for this to work: 1. The textarea form element...
apache-2.0
deanhiller/databus
webapp/play1.3.x/python/Lib/encodings/iso8859_6.py
93
11396
""" Python Character Mapping Codec iso8859_6 generated from 'MAPPINGS/ISO8859/8859-6.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,i...
mpl-2.0
chiefspace/udemy-rest-api
udemy_rest_api_section5/env/lib/python3.4/site-packages/setuptools/tests/test_sandbox.py
342
2170
"""develop tests """ import sys import os import shutil import unittest import tempfile import types import pkg_resources import setuptools.sandbox from setuptools.sandbox import DirectorySandbox, SandboxViolation def has_win32com(): """ Run this to determine if the local machine has win32com, and if it d...
gpl-2.0
Drooids/odoo
addons/hr_holidays/__init__.py
442
1094
# -*- 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
jsirois/pex
pex/vendor/_vendored/setuptools/setuptools/command/build_ext.py
2
13284
import os import sys import itertools from distutils.command.build_ext import build_ext as _du_build_ext from distutils.file_util import copy_file from distutils.ccompiler import new_compiler from distutils.sysconfig import customize_compiler, get_config_var from distutils.errors import DistutilsError from distutils im...
apache-2.0
xuleiboy1234/autoTitle
tensorflow/tensorflow/contrib/signal/__init__.py
10
1899
# 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...
mit
amd77/parker
inventario/migrations/0007_auto_20171014_1756.py
1
1706
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('inventario', '0006_auto_20170930_1629'), ] operations = [ migrations.CreateModel( name='ComandoRemoto', ...
gpl-2.0
angad/libjingle-mac
scons-2.2.0/build/lib/SCons/Node/__init__.py
14
47696
"""SCons.Node The Node package for the SCons software construction utility. This is, in many ways, the heart of SCons. A Node is where we encapsulate all of the dependency information about any thing that SCons can build, or about any thing which SCons can use to build some other thing. The canonical "thing," of co...
bsd-3-clause
ianatpn/nupictest
examples/opf/experiments/spatial_classification/base/description.py
3
14983
# ---------------------------------------------------------------------- # 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...
gpl-3.0
magus424/powerline
powerline/lint/markedjson/reader.py
1
3808
# vim:fileencoding=utf-8:noet from __future__ import (unicode_literals, division, absolute_import, print_function) import codecs from powerline.lint.markedjson.error import MarkedError, Mark, NON_PRINTABLE from powerline.lib.unicode import unicode # This module contains abstractions for the input stream. You don't ...
mit
40223117cda/cda
static/Brython3.1.1-20150328-091302/Lib/unittest/mock.py
739
71473
# mock.py # Test tools for mocking and patching. # Maintained by Michael Foord # Backport for other versions of Python available from # http://pypi.python.org/pypi/mock __all__ = ( 'Mock', 'MagicMock', 'patch', 'sentinel', 'DEFAULT', 'ANY', 'call', 'create_autospec', 'FILTER_DIR', ...
gpl-3.0
bpaquet/graphite-web
webapp/graphite/urls.py
29
2222
"""Copyright 2008 Orbitz WorldWide Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
apache-2.0
willingc/oh-mainline
vendor/packages/python-social-auth/social/tests/backends/test_tripit.py
91
4218
import json from social.p3 import urlencode from social.tests.backends.oauth import OAuth1Test class TripitOAuth1Test(OAuth1Test): backend_path = 'social.backends.tripit.TripItOAuth' user_data_url = 'https://api.tripit.com/v1/get/profile' expected_username = 'foobar' access_token_body = json.dumps({ ...
agpl-3.0
jeremiahyan/odoo
addons/purchase_requisition_stock/models/stock.py
5
3295
# -*- encoding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from collections import defaultdict from odoo import api, fields, models class StockRule(models.Model): _inherit = 'stock.rule' @api.model def _run_buy(self, procurements): requisitions_values_b...
gpl-3.0
archf/ansible
test/units/plugins/filter/test_ipaddr.py
25
22130
# 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
openfun/xblock-utils2
tests/integration/test_studio_editable.py
2
12688
from xblock.core import XBlock from xblock.fields import Boolean, Dict, Float, Integer, List, String from xblock.validation import ValidationMessage from xblockutils.studio_editable import StudioEditableXBlockMixin from xblockutils.studio_editable_test import StudioEditableBaseTest class EditableXBlock(StudioEditable...
agpl-3.0
kustodian/ansible
lib/ansible/modules/cloud/amazon/ec2_ami_info.py
18
9090
#!/usr/bin/python # 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', 'status': ['preview'], ...
gpl-3.0
t0mk/ansible
lib/ansible/plugins/callback/default.py
16
12833
# (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
JamesMura/sentry
src/sentry/web/frontend/project_plugin_configure.py
4
1191
from __future__ import absolute_import from django.core.urlresolvers import reverse from django.http import HttpResponse from sentry.plugins import plugins from sentry.web.frontend.base import ProjectView class ProjectPluginConfigureView(ProjectView): required_scope = 'project:write' def handle(self, reque...
bsd-3-clause
lidavidm/sympy
sympy/liealgebras/type_f.py
1
4555
from sympy.core import Set, Dict, Tuple, Rational from .cartan_type import Standard_Cartan from sympy.matrices import Matrix class TypeF(Standard_Cartan): def __init__(self, n): assert n == 4 Standard_Cartan.__init__(self, "F", 4) def dimension(self): """ Returns the dimensio...
bsd-3-clause
inspyration/odoo
openerp/addons/base/ir/osv_memory_autovacuum.py
447
1450
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2010 OpenERP s.a. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
poojavade/Genomics_Docker
Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/numpy/distutils/command/install_clib.py
258
1315
from __future__ import division, absolute_import, print_function import os from distutils.core import Command from distutils.ccompiler import new_compiler from numpy.distutils.misc_util import get_cmd class install_clib(Command): description = "Command to install installable C libraries" user_options = [] ...
apache-2.0
hydralabs/pyamf
doc/tutorials/examples/gateways/appengine/demo/settings.py
9
3042
# Django settings for google_appengine project. import os, sys DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = '' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = '' # Or p...
mit
52ai/django-ccsds
django/conf/locale/zh_CN/formats.py
634
1810
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y年n月j日' # 2016年9月5...
bsd-3-clause
alfredodeza/boto
tests/unit/cloudsearch2/test_exceptions.py
114
1469
from boto.compat import json from tests.compat import mock, unittest from tests.unit.cloudsearch2.test_search import HOSTNAME, \ CloudSearchSearchBaseTest from boto.cloudsearch2.search import SearchConnection, SearchServiceException def fake_loads_value_error(content, ...
mit
dgellis90/nipype
nipype/algorithms/tests/test_rapidart.py
10
3446
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: from __future__ import division import numpy as np from ...testing import (assert_equal, assert_false, assert_true, assert_almost_equal) from .. import rapidart as ra from ...inter...
bsd-3-clause
Harunx9/Transaltors
Lexer/Lexer/env/Lib/site-packages/setuptools/command/test.py
285
5932
from setuptools import Command from distutils.errors import DistutilsOptionError import sys from pkg_resources import * from pkg_resources import _namespace_packages from unittest import TestLoader, main class ScanningLoader(TestLoader): def loadTestsFromModule(self, module): """Return a suite of all test...
mit
lthurlow/Network-Grapher
proj/external/numpy-1.7.0/build/lib.linux-i686-2.7/numpy/matlib.py
90
9494
import numpy as np from numpy.matrixlib.defmatrix import matrix, asmatrix # need * as we're copying the numpy namespace from numpy import * __version__ = np.__version__ __all__ = np.__all__[:] # copy numpy namespace __all__ += ['rand', 'randn', 'repmat'] def empty(shape, dtype=None, order='C'): """ Return a ...
mit
kenshay/ImageScripter
Script_Runner/PYTHON/Lib/site-packages/pip/_vendor/urllib3/util/url.py
203
6487
from __future__ import absolute_import from collections import namedtuple from ..exceptions import LocationParseError url_attrs = ['scheme', 'auth', 'host', 'port', 'path', 'query', 'fragment'] # We only want to normalize urls with an HTTP(S) scheme. # urllib3 infers URLs without a scheme (None) to be http. NORMALI...
gpl-3.0
beauraines/fail2ban
fail2ban/server/strptime.py
18
6047
# emacs: -*- mode: python; coding: utf-8; py-indent-offset: 4; indent-tabs-mode: t -*- # vi: set ft=python sts=4 ts=4 sw=4 noet : # This file is part of Fail2Ban. # # Fail2Ban 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 Softw...
gpl-2.0
NetApp/cinder
cinder/tests/unit/objects/test_objects.py
2
5812
# Copyright 2015 IBM Corp. # # 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 t...
apache-2.0
fbradyirl/home-assistant
homeassistant/components/monoprice/media_player.py
3
7133
"""Support for interfacing with Monoprice 6 zone home audio controller.""" import logging import voluptuous as vol from homeassistant.components.media_player import MediaPlayerDevice, PLATFORM_SCHEMA from homeassistant.components.media_player.const import ( DOMAIN, SUPPORT_SELECT_SOURCE, SUPPORT_TURN_OFF,...
apache-2.0
Curso-OpenShift/Formulario
OverFlow/ProjectFormulario/env/lib/python2.7/site-packages/django/conf/urls/__init__.py
133
3546
import warnings from importlib import import_module from django.core.exceptions import ImproperlyConfigured from django.urls import ( LocaleRegexURLResolver, RegexURLPattern, RegexURLResolver, ) from django.utils import six from django.utils.deprecation import RemovedInDjango20Warning __all__ = ['handler400', 'ha...
gpl-3.0
xodus7/tensorflow
tensorflow/contrib/timeseries/python/timeseries/state_space_models/test_utils.py
76
5071
# 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 applica...
apache-2.0
nicolas998/Op_Interpolated
06_Codigos/Genera_Graficas_TiempoConcentracion.py
2
6390
#!/usr/bin/env python import argparse import textwrap from wmf import wmf import pickle from plotly.offline import download_plotlyjs, plot, iplot from plotly.graph_objs import Scatter, Figure, Layout import plotly.plotly as py import plotly.graph_objs as go from wmf import wmf import numpy as np #Parametros de entra...
gpl-3.0
cfriedt/bluetooth-next
tools/perf/scripts/python/failed-syscalls-by-pid.py
1996
2233
# failed system call counts, by pid # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide failed system call totals, broken down by pid. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.pa...
gpl-2.0
edcast-inc/edx-platform-edcast
common/lib/xmodule/xmodule/modulestore/tests/test_libraries.py
157
7393
# -*- coding: utf-8 -*- """ Basic unit tests related to content libraries. Higher-level tests are in `cms/djangoapps/contentstore`. """ import ddt from bson.objectid import ObjectId from opaque_keys.edx.locator import LibraryLocator from xmodule.modulestore.exceptions import DuplicateCourseError from xmodule.module...
agpl-3.0
jomo/youtube-dl
youtube_dl/extractor/streamcloud.py
127
1927
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, ) class StreamcloudIE(InfoExtractor): IE_NAME = 'streamcloud.eu' _VALID_URL = r'https?://streamcloud\.eu/(?P<id>[a-zA-Z0-9_-]+)(?:/(?...
unlicense
ahaym/eden
tests/execution/libs/edentest_robot.py
30
2688
# -*- coding: utf-8 -*- from robot.api import logger from robot.libraries.BuiltIn import BuiltIn import requests from base64 import b64encode class edentest_robot(object): def __init__(self, server, appname, admin_email, admin_password): """ Initialize the class variables """ ...
mit
kxliugang/edx-platform
common/djangoapps/student/management/commands/6002exportusers.py
138
1837
## ## One-off script to export 6.002x users into the edX framework ## ## Could be modified to be general by: ## * Changing user_keys and up_keys to handle dates more cleanly ## * Providing a generic set of tables, rather than just users and user profiles ## * Handling certificates and grades ## * Handling merge/forks o...
agpl-3.0
flailingsquirrel/asciimapper
OSMTileLoader.py
1
3184
#!/usr/bin/python ###################################################################### # Ascii TMS Viewer # #-------------------------------------------------------------------- # Brian Hone | Initial Release #-------------------------------------------------------------------- # ...
bsd-3-clause
duducosmos/pgs4a
python-install/lib/python2.7/test/test_socketserver.py
17
9679
""" Test suite for SocketServer.py. """ import contextlib import imp import os import select import signal import socket import tempfile import unittest import SocketServer import test.test_support from test.test_support import reap_children, reap_threads, verbose try: import threading except ImportError: thr...
lgpl-2.1
oracul/bullyon2
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
simonwydooghe/ansible
lib/ansible/modules/cloud/google/gcp_compute_https_health_check.py
13
15129
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2017 Google # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # ---------------------------------------------------------------------------- # # *** AUTO GENERATED CODE *** AUTO GENERATED CODE *** # ...
gpl-3.0
margamanterola/Cinnamon
files/usr/share/cinnamon/cinnamon-settings/modules/cs_privacy.py
16
3984
#!/usr/bin/env python2 from SettingsWidgets import * PRIVACY_SCHEMA = "org.cinnamon.desktop.privacy" GTK_RECENT_ENABLE_KEY = "remember-recent-files" GTK_RECENT_MAX_AGE = "recent-files-max-age" class Module: name = "privacy" comment = _("Cinnamon privacy settings") category = "prefs" def __init__(sel...
gpl-2.0
msebire/intellij-community
python/helpers/coveragepy/coverage/data.py
40
27599
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt """Coverage data for coverage.py.""" import glob import itertools import json import optparse import os import os.path import random import re import socket from ...
apache-2.0
jolyonb/edx-platform
openedx/core/lib/celery/task_utils.py
2
2503
""" Middleware utilities """ from __future__ import absolute_import from contextlib import contextmanager from crum import CurrentRequestUserMiddleware from django.http import HttpResponse from openedx.core.djangoapps.theming.middleware import CurrentSiteThemeMiddleware from openedx.core.lib.request_utils import g...
agpl-3.0
sobercoder/gem5
src/dev/x86/SouthBridge.py
23
4919
# Copyright (c) 2008 The Regents of The University of Michigan # 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
texttochange/vusion-backend
vusion/persist/content_variable/content_variable_table.py
1
4240
from vusion.persist import Model class ContentVariableTable(Model): MODEL_TYPE = 'content_variable_table' MODEL_VERSION = '2' fields= { 'name': { 'required': True }, 'columns': { 'required': True }, 'column-key-selection': {...
bsd-3-clause
alistairlow/tensorflow
tensorflow/contrib/lookup/lookup_ops.py
47
26456
# 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
liorvh/infernal-twin
build/pillow/build/lib.linux-i686-2.7/PIL/ImageStat.py
88
3847
# # The Python Imaging Library. # $Id$ # # global image statistics # # History: # 1996-04-05 fl Created # 1997-05-21 fl Added mask; added rms, var, stddev attributes # 1997-08-05 fl Added median # 1998-07-05 hk Fixed integer overflow error # # Notes: # This class shows how to implement delayed evaluation of att...
gpl-3.0
cfe-lab/MiCall
micall/tests/test_trim_fastqs.py
1
17740
import csv import os from io import BytesIO from io import StringIO import unittest from pathlib import Path import pytest from micall.core.trim_fastqs import censor, trim, cut_all from micall.utils.translation import reverse_and_complement class CensorTest(unittest.TestCase): def setUp(self): self.addT...
agpl-3.0
phantomii/restalchemy
examples/migrations/8d3025-2st-migration.py
1
1163
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2016 Eugene Frolov <eugene@frolov.net.ru> # # 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 # # ...
apache-2.0
40223208/CDB-Final-
static/Brython3.1.1-20150328-091302/Lib/collections/abc.py
739
16026
# Copyright 2007 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Abstract Base Classes (ABCs) for collections, according to PEP 3119. Unit tests are in test_collections. """ from abc import ABCMeta, abstractmethod import sys __all__ = ["Hashable", "Iterable", "Iterator", ...
gpl-3.0
Triv90/SwiftUml
swift/common/middleware/recon.py
3
14052
# Copyright (c) 2010-2012 OpenStack, LLC. # # 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 ...
apache-2.0
yatish27/mase
src/walkcsv.py
10
2368
from __future__ import print_function, division from ok import * import zipfile,re,sys sys.dont_write_bytecode = True """ # Iterators for Walking CSV Data Can handing raw strings, files, zip files. Assumes if lines end in ',' then that line continues to the next. Also assumes first line is column names. ## Hand...
unlicense
diagramsoftware/odoo
addons/product_margin/__init__.py
444
1092
# -*- 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
brendangregg/bcc
tools/exitsnoop.py
1
10349
#!/usr/bin/python # @lint-avoid-python-3-compatibility-imports from __future__ import print_function import argparse import ctypes as ct import os import platform import re import signal import sys from bcc import BPF from datetime import datetime from time import strftime # # exitsnoop Trace all process termination...
apache-2.0
xxsergzzxx/python-for-android
python-build/python-libs/gdata/build/lib/gdata/client.py
133
35227
#!/usr/bin/env python # # Copyright (C) 2008, 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 appli...
apache-2.0
wahahahps/xvid-codec
src/dct/ia64_asm/genidct.py
43
8532
#! /usr/bin/python # generate the linzer-feig multiply-add idct for ia64 # (c) 2002 Christian Schwarz <schwarz@ira.uka.de>, # Haiko Gaisser <haiko@gaisser.de>, # Sebastian Hack <mail@s-hack.de> import math pre_shuffle = [ 0, 4, 2, 6, 1, 7, 3, 5 ] post_shuffle = [ 0, 1, 6, 3, 7, 2, 5, 4 ] constant...
gpl-2.0
tamihiro/grpc
src/python/grpcio/tests/unit/beta/test_utilities.py
9
2526
# 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