repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
krisht/Krishna-Thesis
Research/src/BrainNet.py
1
43359
from __future__ import print_function import datetime import itertools import matplotlib import os import re os.environ["CUDA_DEVICE_ORDER"]="PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"]="0,1" matplotlib.use('Agg') import matplotlib.pyplot as plt plt.rcParams["font.family"] = "FreeSerif" import numpy as np impor...
mit
yfried/ansible
test/units/modules/network/f5/test_bigip_tunnel.py
4
3345
# -*- coding: utf-8 -*- # # Copyright: (c) 2017, F5 Networks Inc. # 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 import os import json import sys from nose.plugins.skip import SkipTest...
gpl-3.0
Communities-Communications/cc-odoo
addons/report_webkit/wizard/__init__.py
431
1482
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2010 Camptocamp SA (http://www.camptocamp.com) # All Right Reserved # # Author : Vincent Renaville # # WARNING: This program as such is intended to be used by professional # programmers who take the...
agpl-3.0
dataxu/ansible
lib/ansible/modules/cloud/cloudstack/cs_portforward.py
73
12316
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2015, René Moser <mail@renemoser.net> # 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
ff94315/hiwifi-openwrt-HC5661-HC5761
staging_dir/host/lib/python2.7/ctypes/test/test_cast.py
81
3212
from ctypes import * import unittest import sys class Test(unittest.TestCase): def test_array2pointer(self): array = (c_int * 3)(42, 17, 2) # casting an array to a pointer works. ptr = cast(array, POINTER(c_int)) self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2]) i...
gpl-2.0
fajoy/nova
nova/tests/api/openstack/compute/contrib/test_flavor_swap.py
11
3113
# 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
rutum/gensim
gensim/test/test_sharded_corpus.py
54
9571
""" Testing the test sharded corpus. """ import os # For backwards compatibility with setUpClass and tearDownClass: # import sys # if sys.version_info[0] == 2 and sys.version_info[1] <= 6: # import unittest2 as unittest # else: # import unittest import unittest import random import numpy import shutil from s...
lgpl-3.0
gatoravi/regtools
src/utils/gtest-1.7.0/test/gtest_throw_on_failure_test.py
2917
5766
#!/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...
mit
shepdelacreme/ansible
lib/ansible/modules/network/cloudengine/ce_bfd_session.py
43
20235
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
kjs73/pele
pele/transition_states/_find_lowest_eig.py
5
16110
"""tools for finding the smallest eigenvalue and associated eigenvector using Rayleigh-Ritz minimization """ import numpy as np import logging from pele.transition_states import orthogopt from pele.potentials.potential import BasePotential from pele.optimize import MYLBFGS import pele.utils.rotations as rotations __...
gpl-3.0
rajeev/lifeflow
context.py
1
2195
from lifeflow.models import Entry, Flow, RecommendedSite, Author, Flow, Language from django.contrib.sites.models import Site from django.conf import settings def blog(request): def make_slug(str): return str.lower().replace(" ","-") recent = Entry.current.all()[:3] random = Entry.current.all().or...
mit
goodwinnk/intellij-community
python/lib/Lib/site-packages/django/contrib/sessions/backends/base.py
245
10286
import base64 import os import random import sys import time from datetime import datetime, timedelta try: import cPickle as pickle except ImportError: import pickle from django.conf import settings from django.core.exceptions import SuspiciousOperation from django.utils.hashcompat import md5_constructor from ...
apache-2.0
dankcoin/dankcoin
qa/rpc-tests/p2p-acceptblock.py
1
12416
#!/usr/bin/env python3 # Copyright (c) 2015-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. from test_framework.mininode import * from test_framework.test_framework import DankcoinTestFramework fro...
mit
DrMeers/django
django/contrib/gis/geos/prototypes/__init__.py
237
1328
""" This module contains all of the GEOS ctypes function prototypes. Each prototype handles the interaction between the GEOS library and Python via ctypes. """ # Coordinate sequence routines. from django.contrib.gis.geos.prototypes.coordseq import (create_cs, get_cs, # NOQA cs_clone, cs_getordinate, cs_setordi...
bsd-3-clause
SerCeMan/intellij-community
python/lib/Lib/site-packages/django/contrib/localflavor/jp/jp_prefectures.py
543
2089
from django.utils.translation import ugettext_lazy JP_PREFECTURES = ( ('hokkaido', ugettext_lazy('Hokkaido'),), ('aomori', ugettext_lazy('Aomori'),), ('iwate', ugettext_lazy('Iwate'),), ('miyagi', ugettext_lazy('Miyagi'),), ('akita', ugettext_lazy('Akita'),), ('yamagata', ugettext_lazy('Yamagat...
apache-2.0
bfagundez/super_powered_recycle_bin
sprb/views.py
2
1123
from flask import render_template, request from sprb import sprb from classes.signed_request import SignedRequest import json #import ipdb import os from sforce_custom.partner import SforcePartnerClient # load WSDL declaration file sf = SforcePartnerClient('sprb/partner.wsdl') @sprb.route('/canvas', methods=['POST'...
mit
himanshu-setia/keystone
keystone/common/validation/__init__.py
3
3875
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the Li...
apache-2.0
mihailignatenko/erp
openerp/addons/base/tests/test_basecase.py
379
3895
# -*- coding: utf-8 -*- import unittest2 from openerp.tests import common class test_single_transaction_case(common.SingleTransactionCase): """ Check the whole-class transaction behavior of SingleTransactionCase. """ def test_00(self): """Create a partner.""" cr, uid = self.cr, self.u...
agpl-3.0
DepthDeluxe/ansible
lib/ansible/modules/cloud/ovirt/ovirt_snapshots_facts.py
45
4381
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
gpl-3.0
AltSchool/django
tests/template_tests/filter_tests/test_add.py
503
1688
from datetime import date, timedelta from django.template.defaultfilters import add from django.test import SimpleTestCase from ..utils import setup class AddTests(SimpleTestCase): """ Tests for #11687 and #16676 """ @setup({'add01': '{{ i|add:"5" }}'}) def test_add01(self): output = se...
bsd-3-clause
eptmp3/Sick-Beard
lib/jsonrpclib/config.py
188
1418
import sys class LocalClasses(dict): def add(self, cls): self[cls.__name__] = cls class Config(object): """ This is pretty much used exclusively for the 'jsonclass' functionality... set use_jsonclass to False to turn it off. You can change serialize_method and ignore_attribute, or use ...
gpl-3.0
Muuo/PanyaFace
server/panya.py
1
1043
import panya import time import serial directions = {'forward': 'w', 'reverse': 's', 'left': 'a', 'right': 'd'} ser = None def init(): global ser try: ser = serial.Serial('/dev/ttyUSB0', 9600) return True except: return False def endit(): global ser ser.close() ser = N...
apache-2.0
z1gm4/desarrollo_web_udp
env/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree.py
915
12621
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type import re from . import _base from .. import ihatexml from .. import constants from ..constants import namespaces from ..utils import moduleFactoryFactory tag_regexp = re.compile("{([^}]*)}(.*)") def getETreeBu...
gpl-3.0
popazerty/test-gui
lib/python/Screens/SleepTimerEdit.py
13
5611
from Screens.InfoBar import InfoBar from Screens.Screen import Screen from Screens.MessageBox import MessageBox from Components.ActionMap import ActionMap from Components.ConfigList import ConfigListScreen from Components.Label import Label from Components.Sources.StaticText import StaticText from Components.config imp...
gpl-2.0
amchoukir/YouCompleteMe
third_party/pythonfutures/crawl.py
85
2422
"""Compare the speed of downloading URLs sequentially vs. using futures.""" import functools import time import timeit import sys try: from urllib2 import urlopen except ImportError: from urllib.request import urlopen from concurrent.futures import (as_completed, ThreadPoolExecutor, ...
gpl-3.0
nippled/dronecoin
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
DazWorrall/ansible-modules-extras
notification/twilio.py
76
5667
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Matt Makai <matthew.makai@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 ...
gpl-3.0
GeoscienceAustralia/PyRate
tests/test_prepifg.py
1
37631
# This Python module is part of the PyRate software package. # # Copyright 2020 Geoscience Australia # # 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/...
apache-2.0
mrb/letsencrypt
letsencrypt-compatibility-test/letsencrypt_compatibility_test/interfaces.py
39
1576
"""Let's Encrypt compatibility test interfaces""" import zope.interface import letsencrypt.interfaces # pylint: disable=no-self-argument,no-method-argument class IPluginProxy(zope.interface.Interface): """Wraps a Let's Encrypt plugin""" http_port = zope.interface.Attribute( "The port to connect to o...
apache-2.0
laurent-george/weboob
modules/freegeoip/module.py
5
1892
# -*- coding: utf-8 -*- # Copyright(C) 2015 Julien Veyssier # # This file is part of weboob. # # weboob 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 the License, or # (at your op...
agpl-3.0
rolandmansilla/microblog
flask/lib/python2.7/site-packages/flask/blueprints.py
773
16320
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
bsd-3-clause
Intel-Corporation/tensorflow
tensorflow/contrib/nn/python/ops/scaled_softplus.py
42
4568
# 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
marktwtn/gdb
gdb/python/lib/gdb/function/strfns.py
137
2684
# Useful gdb string convenience functions. # Copyright (C) 2012-2013 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at you...
gpl-2.0
himanshu-dixit/oppia
extensions/interactions/CodeRepl/CodeRepl.py
3
2687
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
apache-2.0
apigee/edx-platform
lms/djangoapps/analytics/tests/test_csvs.py
44
4688
""" Tests for analytics.csvs """ from django.test import TestCase from nose.tools import raises from analytics.csvs import create_csv_response, format_dictlist, format_instances class TestAnalyticsCSVS(TestCase): """ Test analytics rendering of csv files.""" def test_create_csv_response_nodata(self): ...
agpl-3.0
homeslike/OpticalTweezer
scripts/p0.1_at0.05/vCOMhistogram.py
28
2448
import math import sys import numpy as np import matplotlib.pyplot as plt import matplotlib.mlab as mlab from subprocess import call from scipy.stats import norm # proc = call("ls *.dat",shell=True) # datetime = "170123_2033_" datetime = sys.argv[1]+"_" gasTempDataIn = np.genfromtxt(datetime+"gasTempData.dat",usecols...
mit
axbaretto/beam
sdks/python/.tox/lint/lib/python2.7/site-packages/pylint/reporters/ureports/text_writer.py
2
3047
# Copyright (c) 2015-2016 Claudiu Popa <pcmanticore@gmail.com> # Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html # For details: https://github.com/PyCQA/pylint/blob/master/COPYING """Text formatting drivers for ureports""" from __future__ import print_function from pylint.reporters.ur...
apache-2.0
afk11/bitcoin
test/functional/p2p_sendheaders.py
11
26649
#!/usr/bin/env python3 # Copyright (c) 2014-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 behavior of headers messages to announce blocks. Setup: - Two nodes: - node0 is the node-und...
mit
LaoZhongGu/kbengine
kbe/src/lib/python/Lib/test/test_codecencodings_cn.py
55
3144
#!/usr/bin/env python3 # # test_codecencodings_cn.py # Codec encoding tests for PRC encodings. # from test import support from test import test_multibytecodec_support import unittest class Test_GB2312(test_multibytecodec_support.TestBase, unittest.TestCase): encoding = 'gb2312' tstring = test_multibytecodec...
lgpl-3.0
VanirAOSP/external_chromium_org
chrome/test/chromedriver/embed_version_in_cpp.py
69
1114
#!/usr/bin/env python # 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. """Embeds Chrome user data files in C++ code.""" import optparse import os import sys import chrome_paths import cpp_source sys.path...
bsd-3-clause
sametmax/Django--an-app-at-a-time
ignore_this_directory/django/core/management/commands/sendtestemail.py
75
1456
import socket from django.core.mail import mail_admins, mail_managers, send_mail from django.core.management.base import BaseCommand from django.utils import timezone class Command(BaseCommand): help = "Sends a test email to the email addresses specified as arguments." missing_args_message = "You must specif...
mit
fentas/phantomjs
src/breakpad/src/tools/gyp/test/subdirectory/gyptest-SYMROOT-all.py
399
1269
#!/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 building a target and a subsidiary dependent target from a .gyp file in a subdirectory, without specifying an explicit output b...
bsd-3-clause
VahidGh/ChannelWorm
channelworm/account/form.py
4
1305
from django import forms from django.contrib.auth.hashers import make_password from django.contrib.auth.models import User from django.forms import ModelForm from models import UserProfile class UserForm(ModelForm): password = forms.CharField(widget=forms.PasswordInput) confirm_password = forms.CharField(wid...
mit
RyanHope/PyeTracker
parse.py
1
14485
from __future__ import division from PySide.QtCore import * from PySide.QtGui import * from datamodel import DataModel import sys,re,csv,copy,operator class ParseDlg(QDialog): def __init__(self, filename, parent=None): super(ParseDlg, self).__init__(parent) self.filename = filename...
gpl-3.0
sadleader/odoo
addons/email_template/wizard/__init__.py
446
1130
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009 Sharoon Thomas # Copyright (C) 2010-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it ...
agpl-3.0
lcharleux/numerical_analysis
doc/Optimisation/Example_code/brachi1d.py
1
2925
#------------------------------------------------------------------------ # RECHERCHE DU CHEMIN LE PLUS RAPIDE ENTRE 2 POINTS A ET B #------------------------------------------------------------------------ #------------------------------------------------------------------------ # PACKAGES from scipy import optimize ...
gpl-2.0
MozillaSecurity/laniakea
laniakea/core/multipart.py
2
2571
# coding: utf-8 # 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/. """Utility class for multipart UserData scripts.""" import os import gzip from email import encoders fro...
mpl-2.0
nicocardiel/numina
numina/core/tests/test_validator.py
3
2875
import pytest import numina.exceptions import numina.core.recipes from ..validator import validate from ..validator import only_positive from ..validator import as_list from ..validator import range_validator class RecipeIO(object): def __init__(self, valid=True): self.valid = valid self.was_call...
gpl-3.0
tkaitchuck/nupic
external/linux64/lib/python2.6/site-packages/matplotlib/backends/backend_wx.py
69
77038
from __future__ import division """ backend_wx.py A wxPython backend for matplotlib, based (very heavily) on backend_template.py and backend_gtk.py Author: Jeremy O'Donoghue (jeremy@o-donoghue.com) Derived from original copyright work by John Hunter (jdhunter@ace.bsd.uchicago.edu) Copyright (C) Jeremy O'Don...
gpl-3.0
rickhurst/Django-non-rel-blog
django/contrib/gis/db/backends/spatialite/creation.py
178
4393
import os from django.conf import settings from django.core.cache import get_cache from django.core.cache.backends.db import BaseDatabaseCache from django.core.exceptions import ImproperlyConfigured from django.core.management import call_command from django.db.backends.sqlite3.creation import DatabaseCreation class S...
bsd-3-clause
xmission/d-note
venv/lib/python2.7/site-packages/wheel/pep425tags.py
220
2861
"""Generate and work with PEP 425 Compatibility Tags.""" import sys try: import sysconfig except ImportError: # pragma nocover # Python < 2.7 import distutils.sysconfig as sysconfig import distutils.util def get_abbr_impl(): """Return abbreviated implementation name.""" if hasattr(sys, 'pypy_ve...
agpl-3.0
sarahn/ganeti
lib/tools/node_daemon_setup.py
3
6412
# # # Copyright (C) 2012 Google Inc. # # 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 distributed ...
gpl-2.0
pmelchior/skymapper
examples/example1.py
1
3622
# load projection and helper functions import numpy as np import skymapper as skm def getCatalog(size=10000, survey=None): # dummy catalog: uniform on sphere # Marsaglia (1972) xyz = np.random.normal(size=(size, 3)) r = np.sqrt((xyz**2).sum(axis=1)) dec = np.arccos(xyz[:,2]/r) / skm.DEG2RAD - 90 ...
mit
jjmleiro/hue
desktop/core/ext-py/boto-2.38.0/boto/glacier/writer.py
153
9668
# -*- coding: utf-8 -*- # Copyright (c) 2012 Thomas Parslow http://almostobsolete.net/ # Copyright (c) 2012 Robie Basak <robie@justgohome.co.uk> # Tree hash implementation from Aaron Brady bradya@gmail.com # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated...
apache-2.0
fairbird/OpenPLI-TSimage
lib/python/Components/ConfigList.py
2
8963
from GUIComponent import GUIComponent from config import KEY_LEFT, KEY_RIGHT, KEY_HOME, KEY_END, KEY_0, KEY_DELETE, KEY_BACKSPACE, KEY_OK, KEY_TOGGLEOW, KEY_ASCII, KEY_TIMEOUT, KEY_NUMBERS, ConfigElement, ConfigText, ConfigPassword from Components.ActionMap import NumberActionMap, ActionMap from enigma import eListbox,...
gpl-2.0
iddqd1/django-cms
cms/models/static_placeholder.py
49
3452
import uuid from django.contrib.auth import get_permission_codename from django.contrib.sites.models import Site from django.core.exceptions import ValidationError from django.db import models from django.utils.encoding import python_2_unicode_compatible from django.utils.translation import ugettext_lazy as _ from cm...
bsd-3-clause
taigaio/taiga-back
taiga/webhooks/migrations/0001_initial.py
1
1572
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations import taiga.base.db.models.fields class Migration(migrations.Migration): dependencies = [ ('projects', '0015_auto_20141230_1212'), ] operations = [ migrations.CreateModel( ...
agpl-3.0
gpodder/gpodder
src/gpodder/core.py
1
1953
# -*- coding: utf-8 -*- # # gPodder - A media aggregator and podcast client # Copyright (c) 2005-2018 The gPodder Team # # gPodder is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the Licens...
gpl-3.0
kaushiks/GDB
gdb/testsuite/gdb.python/py-events.py
17
3247
# Copyright (C) 2010-2012 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This progr...
gpl-2.0
TNT-Samuel/Coding-Projects
DNS Server/Source/Lib/urllib/robotparser.py
11
8832
""" robotparser.py Copyright (C) 2000 Bastian Kleineidam You can choose between two licenses when using this package: 1) GNU GPLv2 2) PSF license for Python 2.2 The robots.txt Exclusion Protocol is implemented as specified in http://www.robotstxt.org/norobots-rfc.txt """ import collections ...
gpl-3.0
proxysh/Safejumper-for-Mac
buildmac/Resources/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langcyrillicmodel.py
2762
17725
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-2.0
nelmiux/CarnotKE
jyhton/Lib/test/test_multibytecodec_support.py
12
14633
#!/usr/bin/env python # # test_multibytecodec_support.py # Common Unittest Routines for CJK codecs # import codecs import os import re import sys import unittest from httplib import HTTPException from test import test_support from StringIO import StringIO class TestBase: encoding = '' # codec name ...
apache-2.0
jalaziz/ansible
lib/ansible/runner/action_plugins/async.py
5
1849
# (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
shadyueh/pyranking
env/lib/python2.7/site-packages/pip/commands/search.py
323
4604
from __future__ import absolute_import import logging import sys import textwrap from pip.basecommand import Command, SUCCESS from pip.download import PipXmlrpcTransport from pip.index import PyPI from pip.utils import get_terminal_size from pip.utils.logging import indent_log from pip.exceptions import CommandError ...
mit
prasanna08/oppia
core/domain/stats_jobs_continuous.py
2
13768
# Copyright 2014 The Oppia 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
pblottiere/QGIS
python/plugins/processing/algs/qgis/SetRasterStyle.py
26
2812
# -*- coding: utf-8 -*- """ *************************************************************************** SetRasterStyle.py --------------------- Date : August 2012 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ************************...
gpl-2.0
Warvito/DeepLearningTutorials
code/hmc/test_hmc.py
35
2218
import numpy from scipy import linalg import theano from hmc import HMC_sampler def sampler_on_nd_gaussian(sampler_cls, burnin, n_samples, dim=10): batchsize = 3 rng = numpy.random.RandomState(123) # Define a covariance and mu for a gaussian mu = numpy.array(rng.rand(dim) * 10, dtype=theano.config....
bsd-3-clause
nurbsurf/fed-comdipity
node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py
2767
2174
# Copyright (c) 2011 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. """Applies a fix to CR LF TAB handling in xml.dom. Fixes this: http://code.google.com/p/chromium/issues/detail?id=76293 Working around this: http://bugs.python.or...
mit
rossant/phy
phy/utils/tests/test_config.py
2
3120
# -*- coding: utf-8 -*- """Test config.""" #------------------------------------------------------------------------------ # Imports #------------------------------------------------------------------------------ import os.path as op from textwrap import dedent from pytest import fixture from traitlets import Float...
bsd-3-clause
kevinkindom/chrome_depto_tools
third_party/boto/ses/connection.py
56
21582
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2011 Harry Marr http://hmarr.com/ # # 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 # wit...
bsd-3-clause
v4hn/moveit
moveit_commander/src/moveit_commander/interpreter.py
4
30614
# Software License Agreement (BSD License) # # Copyright (c) 2012, Willow Garage, 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...
bsd-3-clause
jelugbo/ddi
common/lib/chem/chem/tests.py
68
21271
import codecs from fractions import Fraction import unittest from .chemcalc import (compare_chemical_expression, divide_chemical_expression, render_to_html, chemical_equations_equal) import miller local_debug = None def log(s, output_type=None): if local_debug: print s if ...
agpl-3.0
jaj42/GraPhysio
graphysio/ui/loopwidget.py
2
5830
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'loopwidget.ui' # # Created by: PyQt5 UI code generator 5.12.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets class Ui_LoopWidget(object): def setupUi(self, LoopWidget): Loo...
isc
h3biomed/ansible-modules-core
network/nxos/nxos_vrf_interface.py
25
15853
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
broferek/ansible
lib/ansible/modules/remote_management/ucs/ucs_org.py
18
6663
#!/usr/bin/python # -*- coding: utf-8 -*- # 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
aYukiSekiguchi/ACCESS-Chromium
third_party/protobuf/python/google/protobuf/internal/message_test.py
253
15707
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
zhy0216/random-read
article/models.py
1
4390
# -*- coding: utf-8 -*- from django.db import models from django.contrib.auth.models import User import requests import chardet from utils import redis_conn, q, get_whoosh_ix ''' primary means whether the article is the first similar article added ''' class Article(models.Model): original_url = models.CharF...
mit
dea82/StateMachineCreator
build-tools/build_conan_dependencies.py
1
2859
#!/usr/bin/env python import argparse import json import conan.conanrepo.conanrepo as conanrepo from subprocess import call def decorated_print(string): print("*" * 60) print('* ' + string) print("*" * 60) def get_login_credentials(config_file, section): try: conan_repo_config = conanrep...
mit
mangaki/movielens
code/reco.py
1
2969
notes = [ [1, -1, 0, 1, 0, -1], [-1, 0, 1, -1, 1, 1], [1, 1, 1, 1, -1, -1], [1, 1, 0, 0, 1, -1], [1, -1, 1, 1, -1, 0]] nb_gens = 5 nb_films = 6 prenoms = ['Alice', 'Bob', 'Charles', 'Daisy', 'Everett'] films = ['007', 'Batman 1', 'Shrek 2', 'Toy Story 3', 'Star Wars 4', 'Twilight 5'] NB_VOISINS = 3 ...
mit
Orav/kbengine
kbe/src/lib/python/Lib/tokenize.py
2
25567
"""Tokenization help for Python programs. tokenize(readline) is a generator that breaks a stream of bytes into Python tokens. It decodes the bytes according to PEP-0263 for determining source file encoding. It accepts a readline-like method which is called repeatedly to get the next line of input (or b"" for ...
lgpl-3.0
echelon/laser-asteroids
entities/healthbar.py
2
3143
""" Player's health bar TODO: DOC """ # STDLIB import math import random import itertools import sys import thread import time import pygame # GLOBALS from globalvals import * # Base class from entity import Entity class HealthBar(Entity): HEALTH_MAX = SHIP_HEALTH_MAX def __init__(self, x = 0, y = 0, r = 0, g...
mit
CamelBackNotation/CarnotKE
jyhton/lib-python/2.7/encodings/tis_620.py
593
12556
""" Python Character Mapping Codec tis_620 generated from 'python-mappings/TIS-620.TXT' with gencodec.py. """#" import codecs ### Codec APIs class Codec(codecs.Codec): def encode(self,input,errors='strict'): return codecs.charmap_encode(input,errors,encoding_table) def decode(self,input,errors='st...
apache-2.0
lberruti/ansible
lib/ansible/cache/memcached.py
132
5890
# (c) 2014, Brian Coca, Josh Drake, et al # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. ...
gpl-3.0
itai12312/workspaces
hellodjango/venv/lib/python2.7/site-packages/django/contrib/localflavor/ch/forms.py
101
3963
""" Swiss-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.ch.ch_states import STATE_CHOICES from django.core.validators import EMPTY_VALUES from django.forms import ValidationError from django.forms.fields import Field, RegexField, Select f...
gpl-2.0
openstack-packages/DLRN
dlrn/shell.py
1
35994
# 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 t...
apache-2.0
loco-odoo/localizacion_co
openerp/addons-extra/odoo-pruebas/odoo-server/addons/account_bank_statement_extensions/wizard/confirm_statement_line.py
381
1490
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
mikel-egana-aranguren/SADI-Galaxy-Docker
galaxy-dist/eggs/kombu-3.0.13-py2.7.egg/kombu/tests/test_simple.py
30
3772
from __future__ import absolute_import from kombu import Connection, Exchange, Queue from .case import Case, Mock class SimpleBase(Case): abstract = True def Queue(self, name, *args, **kwargs): q = name if not isinstance(q, Queue): q = self.__class__.__name__ if name...
gpl-3.0
minhphung171093/GreenERP_V8
openerp/addons/l10n_be_invoice_bba/partner.py
379
2268
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Created by Luc De Meyer # Copyright (c) 2010 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribu...
agpl-3.0
WhySoGeeky/DroidPot
venv/lib/python2.7/site-packages/pygments/scanner.py
135
3114
# -*- coding: utf-8 -*- """ pygments.scanner ~~~~~~~~~~~~~~~~ This library implements a regex based scanner. Some languages like Pascal are easy to parse but have some keywords that depend on the context. Because of this it's impossible to lex that just by using a regular expression lexer like ...
mit
Microvellum/Fluid-Designer
win64-vc/2.78/python/lib/collections/__init__.py
7
44832
__all__ = ['deque', 'defaultdict', 'namedtuple', 'UserDict', 'UserList', 'UserString', 'Counter', 'OrderedDict', 'ChainMap'] # For backwards compatibility, continue to make the collections ABCs # available through the collections module. from _collections_abc import * import _collections_abc __all__ += _co...
gpl-3.0
rocky/python2-trepan
trepan/lib/deparse.py
1
3101
# -*- coding: utf-8 -*- """Deparsing Routines""" import sys, tempfile from StringIO import StringIO from hashlib import sha1 from uncompyle6.semantics.linemap import code_deparse_with_map from uncompyle6.semantics.fragments import ( deparsed_find, code_deparse) import pyficache # FIXME remap filename to a short na...
gpl-3.0
kohout/djangocms-getaweb-products
djangocms_product/south_migrations/0009_auto__chg_field_order_city__chg_field_order_telephone__chg_field_order.py
1
12653
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Order.city' db.alter_column(u'djangocms_product_order'...
unlicense
adkerr/tempest
tempest/openstack/common/timeutils.py
20
5955
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 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.apac...
apache-2.0
rgant/saas-api-boilerplate
tests/ourmarshmallow/test_schema.py
1
10435
""" Tests for our customized marshmallow Schema """ from __future__ import (absolute_import, division, print_function, unicode_literals) try: from builtins import * # pylint: disable=unused-wildcard-import,redefined-builtin,wildcard-import except ImportError: import sys print("WARNING: Cannot Load builtins...
gpl-3.0
tmrowco/electricitymap
parsers/ENTE.py
1
6758
#!/usr/bin/env python3 # This parser gets all real time interconnection flows from the # Central American Electrical Interconnection System (SIEPAC). import arrow import pandas as pd url = 'http://www.enteoperador.org/newsite/flash/data.csv' def read_data(): """ Reads csv data from the url. Returns a p...
gpl-3.0
xq262144/hue
desktop/core/ext-py/Django-1.6.10/tests/queryset_pickle/tests.py
49
3858
from __future__ import absolute_import import pickle import datetime from django.db import models from django.test import TestCase from .models import Group, Event, Happening, Container, M2MModel class PickleabilityTestCase(TestCase): def setUp(self): Happening.objects.create() # make sure the defaults...
apache-2.0
sdlBasic/sdlbrt
win32/mingw/opt/lib/python2.7/distutils/command/install.py
1
26371
"""distutils.command.install Implements the Distutils 'install' command.""" from distutils import log # This module should be kept compatible with Python 2.1. __revision__ = "$Id$" import sys, os, string from types import * from distutils.core import Command from distutils.debug import DEBUG from distutils.sysconf...
lgpl-2.1
cwolferh/heat-scratch
heat_integrationtests/functional/test_waitcondition.py
4
2623
# 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
simmetria/sentry
src/sentry/utils/cache.py
2
1499
import logging import time from django.core.cache import get_cache, cache from sentry.conf import settings if settings.CACHE_BACKEND != 'default': cache = get_cache(settings.CACHE_BACKEND) # NOQA _cache = cache logger = logging.getLogger(__name__) class UnableToGetLock(Exception): pass class Lock(obj...
bsd-3-clause
neharejanjeva/techstitution
app/logs/venv/lib/python2.7/site-packages/werkzeug/http.py
75
35287
# -*- coding: utf-8 -*- """ werkzeug.http ~~~~~~~~~~~~~ Werkzeug comes with a bunch of utilities that help Werkzeug to deal with HTTP data. Most of the classes and functions provided by this module are used by the wrappers, but they are useful on their own, too, especially if the response and ...
cc0-1.0