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
billy-inn/scikit-learn
sklearn/feature_selection/univariate_selection.py
95
23709
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
bsd-3-clause
minhphung171093/GreenERP_V7
openerp/addons/hr_recruitment/res_config.py
52
1975
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
akx/slacktrack
logify.py
1
1759
# -- encoding: UTF-8 -- import re import sys, json, time import argparse def read_messages(filenames): messages = set() user_map = {} for fn in sorted(filenames): with open(fn, "r") as infp: data = json.load(infp) for m in data["messages"]: messages.add((flo...
mit
zhuwenping/python-for-android
python-modules/zope/zope/interface/__init__.py
50
3001
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
apache-2.0
Joypricecorp/Sylius
docs/_exts/sensio/sphinx/phpcode.py
71
5207
# -*- coding: utf-8 -*- """ :copyright: (c) 2010-2012 Fabien Potencier :license: MIT, see LICENSE for more details. """ from docutils import nodes, utils from sphinx.util.nodes import split_explicit_title from string import lower def php_namespace_role(typ, rawtext, text, lineno, inliner, options={}, content...
mit
avanzosc/odoo-addons
resource_time/tests/test_resource_time.py
2
1167
# Copyright 2019 Oihane Crucelaegui - AvanzOSC # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). import odoo.tests.common as common class TestResourceTime(common.SavepointCase): @classmethod def setUpClass(cls): super(TestResourceTime, cls).setUpClass() start_hour = 10.0 ...
agpl-3.0
sandeepkoduri/GAE-html-to-pdf
libs/reportlab/graphics/renderPS.py
3
37243
#Copyright ReportLab Europe Ltd. 2000-2017 #see license.txt for license details #history http://www.reportlab.co.uk/cgi-bin/viewcvs.cgi/public/reportlab/trunk/reportlab/graphics/renderPS.py __version__='3.3.0' __doc__="""Render drawing objects in Postscript""" from reportlab.pdfbase.pdfmetrics import getFont, stringWi...
mit
harri88/harri88.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/styles/native.py
364
1938
# -*- coding: utf-8 -*- """ pygments.styles.native ~~~~~~~~~~~~~~~~~~~~~~ pygments version of my "native" vim theme. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style import Style from pygments.token import Keyword, ...
mit
armooo/zulip
zerver/management/commands/create_user.py
113
3255
from __future__ import absolute_import import sys import argparse from django.core.management.base import BaseCommand, CommandError from django.core.exceptions import ValidationError from django.db.utils import IntegrityError from django.core import validators from zerver.models import Realm, email_to_username from ...
apache-2.0
bepo13/destiny-stl-generator
src/DestinyModel.py
1
1617
import os import json import urllib import DataParse import DestinyGeometry bungieUrlPrefix = "http://www.bungie.net" bungieGeometryPrefix = "/common/destiny_content/geometry/platform/mobile/geometry/" class DestinyModel(object): def __init__(self, jsonFile): self.geometry = [] # Load th...
mit
BigBrother1984/android_external_chromium_org
third_party/tlslite/tlslite/utils/PyCrypto_RSAKey.py
361
1814
"""PyCrypto RSA implementation.""" from cryptomath import * from RSAKey import * from Python_RSAKey import Python_RSAKey if pycryptoLoaded: from Crypto.PublicKey import RSA class PyCrypto_RSAKey(RSAKey): def __init__(self, n=0, e=0, d=0, p=0, q=0, dP=0, dQ=0, qInv=0): if not d: ...
bsd-3-clause
koniiiik/django
django/core/management/commands/loaddata.py
67
13922
from __future__ import unicode_literals import glob import gzip import os import warnings import zipfile from itertools import product from django.apps import apps from django.conf import settings from django.core import serializers from django.core.exceptions import ImproperlyConfigured from django.core.management.b...
bsd-3-clause
nvoron23/python-weka-wrapper
tests/wekatests/coretests/capabilities.py
3
4622
# 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 program is distributed in the hope that it will be useful, # b...
gpl-3.0
rversteegen/commandergenius
project/jni/python/src/Lib/pydoc_topics.py
48
410336
# Autogenerated by Sphinx on Tue Apr 14 09:12:28 2009 topics = {'assert': u'\nThe ``assert`` statement\n************************\n\nAssert statements are a convenient way to insert debugging assertions\ninto a program:\n\n assert_stmt ::= "assert" expression ["," expression]\n\nThe simple form, ``assert expression``,...
lgpl-2.1
mizhgun/HTResearch
HTResearch/Test/Mocks/utility_scrapers.py
1
3518
class MockContactNameScraper(object): def parse(self, response): return ['test'] class MockEmailScraper(object): def parse(self, response): return ['test'] class MockIndianPhoneNumberScraper(object): def parse(self, response): return ['test'] class MockKeywordScraper(object)...
gpl-3.0
teltek/edx-platform
openedx/core/djangoapps/user_api/accounts/__init__.py
11
3569
""" Account constants """ from django.utils.text import format_lazy from django.utils.translation import ugettext_lazy as _ # The minimum and maximum length for the name ("full name") account field NAME_MIN_LENGTH = 2 NAME_MAX_LENGTH = 255 # The minimum and maximum length for the username account field USERNAME_MIN...
agpl-3.0
francoricci/sapspid
modules/easyspid/lib/easyspid.py
1
14942
import globalsObj import commonlib as commonlib from response import ResponseObj from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser import database import datetime from cryptography import x509 from cryptography.hazmat.backends import default_backend from lxml import etree from hashlib impo...
mit
tuxlifan/moneyguru
core/tests/export_test.py
2
3431
# Created By: Virgil Dupras # Created On: 2010-10-26 # Copyright 2015 Hardcoded Software (http://www.hardcoded.net) # # This software is licensed under the "GPLv3" License as described in the "LICENSE" file, # which should be included with this package. The terms are also available at # http://www.gnu.org/licenses/gpl-...
gpl-3.0
andynelson/ansible-modules-core
cloud/rackspace/rax_cbs.py
37
7072
#!/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 distributed...
gpl-3.0
calavera/docker
hack/infrastructure/docker-ci/functionaltests/test_index.py
12
2205
#!/usr/bin/python import os username, password = os.environ['DOCKER_CREDS'].split(':') from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from selenium.common.exceptions import NoSuchElementExcepti...
apache-2.0
houlixin/BBB-TISDK
linux-devkit/sysroots/i686-arago-linux/usr/lib/python2.7/encodings/cp500.py
593
13377
""" Python Character Mapping Codec cp500 generated from 'MAPPINGS/VENDORS/MICSFT/EBCDIC/CP500.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...
gpl-2.0
DrOctogon/unwash_ecom
tests/functional/dashboard/product_tests.py
1
5507
from django.core.urlresolvers import reverse from django_dynamic_fixture import G from oscar.test.testcases import WebTestCase from oscar.core.compat import get_user_model from oscar.apps.catalogue.models import ProductClass, Category, Product User = get_user_model() class ProductWebTest(WebTestCase): is_staff...
bsd-3-clause
aliyun/oss-ftp
python27/win32/Lib/binhex.py
216
14476
"""Macintosh binhex compression/decompression. easy interface: binhex(inputfilename, outputfilename) hexbin(inputfilename, outputfilename) """ # # Jack Jansen, CWI, August 1995. # # The module is supposed to be as compatible as possible. Especially the # easy interface should work "as expected" on any platform. # XXX...
mit
ficristo/brackets-shell
gyp/pylib/gyp/generator/dump_dependency_json.py
1534
3426
# 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. import collections import os import gyp import gyp.common import gyp.msvs_emulation import json import sys generator_supports_multiple_toolsets = True generator_...
mit
manashmndl/scikit-learn
sklearn/utils/tests/test_class_weight.py
140
11909
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
trondeau/gnuradio-old
grc/python/FlowGraph.py
7
9167
""" Copyright 2008-2011 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion 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 l...
gpl-3.0
7630155/tushare
test/ref_test.py
36
1507
# -*- coding:utf-8 -*- ''' Created on 2015/3/14 @author: Jimmy Liu ''' import unittest from tushare.stock import reference as fd class Test(unittest.TestCase): def set_data(self): self.code = '600848' self.start = '2015-01-03' self.end = '2015-04-07' self.year = 2014...
bsd-3-clause
TheTimmy/spack
var/spack/repos/builtin.mock/packages/extension1/package.py
1
1555
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
numpy/numpy-refactor
numpy/core/tests/test_errstate.py
58
1715
# The following exec statement (or something like it) is needed to # prevent SyntaxError on Python < 2.5. Even though this is a test, # SyntaxErrors are not acceptable; on Debian systems, they block # byte-compilation during install and thus cause the package to fail # to install. import sys if sys.version_info[:2] >=...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/PIL/ImageStat.py
26
3826
# # 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...
agpl-3.0
drzaeus77/pyroute2
pyroute2/ipdb/linkedset.py
5
6749
''' ''' import struct import threading from socket import inet_pton from socket import AF_INET from socket import AF_INET6 from pyroute2.common import basestring class LinkedSet(set): ''' Utility class, used by `Interface` to track ip addresses and ports. Called "linked" as it automatically updates all ...
apache-2.0
dmitriy-serdyuk/fuel
fuel/datasets/binarized_mnist.py
15
1672
# -*- coding: utf-8 -*- from fuel.datasets import H5PYDataset from fuel.utils import find_in_data_path class BinarizedMNIST(H5PYDataset): u"""Binarized, unlabeled MNIST dataset. MNIST (Mixed National Institute of Standards and Technology) [LBBH] is a database of handwritten digits. It is one of the most ...
mit
alburnum/alburnum-maas-client
maas/client/viscera/bcache_cache_sets.py
3
3076
"""Objects for cache sets.""" __all__ = ["BcacheCacheSet", "BcacheCacheSets"] from typing import Union from . import ObjectSet, ObjectType from .nodes import Node from .block_devices import BlockDevice from .partitions import Partition from .filesystem_groups import DeviceField, FilesystemGroup class BcacheCacheSe...
agpl-3.0
harrisonfeng/gunicorn
examples/frameworks/django/testing/testing/apps/someapp/views.py
22
1628
# Create your views here. import csv import io import os from django import forms from django.http import HttpResponse from django.shortcuts import render_to_response from django.template import RequestContext import tempfile class MsgForm(forms.Form): subject = forms.CharField(max_length=100) message = forms...
mit
smrq/sheepshead-mobile
bower_components/bootstrap/test-infra/s3_cache.py
70
3507
#!/usr/bin/env python2.7 from __future__ import absolute_import, unicode_literals, print_function, division from sys import argv from os import environ, stat, remove as _delete_file from os.path import isfile, dirname, basename, abspath from hashlib import sha256 from subprocess import check_call as run from boto.s3....
mit
Dfelker/ansible
contrib/inventory/linode.py
145
11235
#!/usr/bin/env python ''' Linode external inventory script ================================= Generates inventory that Ansible can understand by making API request to Linode using the Chube library. NOTE: This script assumes Ansible is being executed where Chube is already installed and has a valid config at ~/.chube...
gpl-3.0
sugartom/tensorflow-alien
tensorflow/python/platform/sysconfig.py
74
1745
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
wonderpl/s3yum-updater
repoupdate-daemon.py
2
9565
#!/usr/bin/env python """Daemon for serialising metadata updates on an s3-hosted yum repository. Listens on SQS for SNS messages that specify new packages published to s3. After waiting a while and grouping any additional messages, this script will update the yum repodata to include all the new packages. Assuming you...
bsd-2-clause
Pajinek/spacewalk
backend/satellite_tools/req_channels.py
7
6909
# # Copyright (c) 2008--2017 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should have received a c...
gpl-2.0
trippysalmon/bitcoin
test/functional/net.py
9
4207
#!/usr/bin/env python3 # Copyright (c) 2017 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 RPC calls related to net. Tests correspond to code in rpc/net.cpp. """ import time from test_framewo...
mit
CLVsol/oehealth_ichu
oehealth_lab_test/__openerp__.py
1
2176
# -*- encoding: utf-8 -*- ################################################################################ # # # Copyright (C) 2012 Carlos Eduardo Vercelino - CLVsol.net # # ...
agpl-3.0
ghickman/django
tests/serializers/tests.py
41
16912
# -*- coding: utf-8 -*- from __future__ import unicode_literals from datetime import datetime from django.core import serializers from django.core.serializers import SerializerDoesNotExist from django.core.serializers.base import ProgressBar from django.db import connection, transaction from django.http import HttpRe...
bsd-3-clause
jameslittle/python-social-auth
social/backends/base.py
59
9755
from requests import request, ConnectionError from social.utils import SSLHttpAdapter, module_member, parse_qs, user_agent from social.exceptions import AuthFailed class BaseAuth(object): """A django.contrib.auth backend that authenticates the user based on a authentication provider response""" name = ''...
bsd-3-clause
andrewleech/SickRage
lib/sqlalchemy/dialects/mysql/gaerdbms.py
79
2724
# mysql/gaerdbms.py # Copyright (C) 2005-2014 the SQLAlchemy authors and contributors <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """ .. dialect:: mysql+gaerdbms :name: Google Cloud SQL :dbapi: rdbms :co...
gpl-3.0
juliosueiras/atlas-vim
vim/plugged/UltiSnips/test/test_AnonymousExpansion.py
6
1710
from test.vim_test_case import VimTestCase as _VimTest from test.constant import * # Anonymous Expansion {{{# class _AnonBase(_VimTest): args = '' def _extra_options_pre_init(self, vim_config): vim_config.append('inoremap <silent> %s <C-R>=UltiSnips#Anon(%s)<cr>' % (EA, se...
mit
Hoekz/hackness-monster
venv/lib/python2.7/site-packages/pip/_vendor/requests/models.py
360
30532
# -*- coding: utf-8 -*- """ requests.models ~~~~~~~~~~~~~~~ This module contains the primary objects that power Requests. """ import collections import datetime from io import BytesIO, UnsupportedOperation from .hooks import default_hooks from .structures import CaseInsensitiveDict from .auth import HTTPBasicAuth ...
mit
Lh4cKg/sl4a
python/src/Lib/test/test_SimpleHTTPServer.py
61
1350
""" These tests only check url parsing for now. We don't want to require the 'network' resource. """ import os, unittest from SimpleHTTPServer import SimpleHTTPRequestHandler from test import test_support class SocketlessRequestHandler (SimpleHTTPRequestHandler): def __init__(self): pass class SimpleHTT...
apache-2.0
TathagataChakraborti/resource-conflicts
PLANROB-2015/py2.5/lib/python2.5/encodings/iso2022_jp_2004.py
816
1073
# # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 # # Written by Hye-Shik Chang <perky@FreeBSD.org> # import _codecs_iso2022, codecs import _multibytecodec as mbc codec = _codecs_iso2022.getcodec('iso2022_jp_2004') class Codec(codecs.Codec): encode = codec.encode decode = codec.decode class I...
mit
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/sqlalchemy/interfaces.py
33
10967
# sqlalchemy/interfaces.py # Copyright (C) 2007-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # Copyright (C) 2007 Jason Kirtland jek@discorporate.us # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Deprecated core ...
mit
kevin-coder/tensorflow-fork
tensorflow/contrib/tensor_forest/hybrid/python/models/stochastic_hard_decisions_to_data_then_nn.py
190
1909
# 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
icattlecoder/electron
script/build.py
155
1166
#!/usr/bin/env python import argparse import os import subprocess import sys from lib.util import atom_gyp CONFIGURATIONS = ['Release', 'Debug'] SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) def main(): os.chdir(SOURCE_ROOT) ninja = os.path.join('vendor', 'depot_tools', 'ninja') ...
mit
mKeRix/home-assistant
homeassistant/components/lovelace/dashboard.py
15
7968
"""Lovelace dashboard support.""" from abc import ABC, abstractmethod import logging import os import time from typing import Optional, cast import voluptuous as vol from homeassistant.components.frontend import DATA_PANELS from homeassistant.const import CONF_FILENAME from homeassistant.core import callback from hom...
mit
Peddle/hue
desktop/core/ext-py/South-1.0.2/south/management/commands/syncdb.py
119
4643
""" Overridden syncdb command """ from __future__ import print_function import sys from optparse import make_option from django.core.management.base import NoArgsCommand, BaseCommand from django.core.management.color import no_style from django.utils.datastructures import SortedDict from django.core.management.comm...
apache-2.0
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/docutils/parsers/rst/languages/lt.py
120
3584
# -*- coding: utf-8 -*- # $Id: lt.py 7668 2013-06-04 12:46:30Z milde $ # Author: Dalius Dobravolskas <dalius.do...@gmail.com> # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>....
mit
Communities-Communications/cc-odoo
addons/mail/mail_message_subtype.py
387
3094
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
moehle/investor_lifespan_model
investor_lifespan_model/mortality_data.py
1
3889
import numpy as np import scipy.interpolate as interp import scipy.integrate as integ import scipy as sp G_vec = np.array([ 100000, 99450 , 99409 , 99380 , 99360 , 99341 , 99326 , 99313 ...
mit
agry/NGECore2
scripts/mobiles/yavin4/feral_mutant_gackle_stalker.py
2
1740
import sys from services.spawn import MobileTemplate from services.spawn import WeaponTemplate from resources.datatables import WeaponType from resources.datatables import Difficulty from resources.datatables import Options from java.util import Vector def addTemplate(core): mobileTemplate = MobileTemplate...
lgpl-3.0
CHagenlo/home-gateway
node-v4.2.6/tools/gyp/pylib/gyp/generator/ninja_test.py
1843
1786
#!/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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
gpl-2.0
dribnet/plat
plat/bin/canvas.py
1
19630
#!/usr/bin/env python """Plots model samples.""" import argparse import numpy as np import random import sys import json from scipy.misc import imread, imsave, imresize import os from plat.utils import anchors_from_image, get_json_vectors, offset_from_string from plat.canvas_layout import create_mine_canvas import p...
mit
deepinsight/Deformable-ConvNets
rfcn/symbols/resnet_v1_101_rfcn_dcn.py
1
87041
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The Apache-2.0 License [see LICENSE for details] # Written by Yuwen Xiong, Xizhou Zhu # -------------------------------------------------------- import cPickle import mxnet as ...
apache-2.0
Yong-Lee/django
django/views/debug.py
65
46822
from __future__ import unicode_literals import re import sys import types from django.conf import settings from django.core.urlresolvers import Resolver404, resolve from django.http import HttpResponse, HttpResponseNotFound from django.template import Context, Engine, TemplateDoesNotExist from django.template.default...
bsd-3-clause
alexngmsft/lis-next
rpmbuild/createrpms.py
1
5034
# # Script to build RPM's using latest LIS code, it will build the RPM's and copy it to LISISO folder # currently we have two source tree one for RHEL 5 and one for RHEL6 # # import os import sys import shutil import subprocess homedir = os.getcwd() directory = "lis-next" if os.path.exists(directory): shutil.rmtree...
gpl-2.0
googlei18n/glyphsLib
tests/builder/fontinfo_test.py
1
26213
# coding=UTF-8 # # Copyright 2016 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 by ap...
apache-2.0
ZhiangChen/soft_arm
example_nets/DQN_path_planning.py
1
2536
from DQN import DeepQNetwork from map_env import Map import numpy as np EPS = 300000 STEP = 400 action_space = ['f','b','l','r'] DIST = 0.01 R = 0.5 MEMORYCAPACITY = 400000 def compute_reward(state, state_): """ if distance is decreasing, reward +1; if distance is increasing, reward -1; if reach the goal...
mit
tvalacarta/tvalacarta
python/main-classic/lib/youtube_dl/extractor/beeg.py
14
3586
from __future__ import unicode_literals from .common import InfoExtractor from ..compat import ( compat_str, compat_urlparse, ) from ..utils import ( int_or_none, unified_timestamp, ) class BeegIE(InfoExtractor): _VALID_URL = r'https?://(?:www\.)?beeg\.(?:com|porn(?:/video)?)/(?P<id>\d+)' _TE...
gpl-3.0
kdart/pycopia
core/pycopia/inet/telnet.py
1
17924
#!/usr/bin/python2.7 # vim:ts=4:sw=4:softtabstop=4:smarttab:expandtab from __future__ import absolute_import from __future__ import print_function from __future__ import division """TELNET client module. Forked from telnetlib and modified to better fit into Pycopia framework, such as having an API that works with an...
apache-2.0
abstract-open-solutions/OCB
addons/mrp_repair/wizard/cancel_repair.py
384
3683
# -*- 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
abhishek-ch/hue
desktop/core/ext-py/markdown/setup.py
40
2937
#!/usr/bin/env python import sys, os from distutils.core import setup from distutils.command.install_scripts import install_scripts version = '2.0.3' class md_install_scripts(install_scripts): """ Customized install_scripts. Create markdown.bat for win32. """ def run(self): install_scripts.run(self) ...
apache-2.0
florian-dacosta/OCB
addons/hr_attendance/res_config.py
434
1406
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
hidekb/espressopp
examples/hierarchical_strategy_for_one-component/fbloop.py
5
12797
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- from math import sqrt, pi, cos, sin, acos, asin, fabs import time import espressopp import logging from mpi4py import MPI # set parameters for simul...
gpl-3.0
attilahorvath/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/bot/expectedfailures_unittest.py
122
5271
# Copyright (c) 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 of conditions and the ...
bsd-3-clause
eoss-cloud/madxxx_catalog_api
catalog/client/services/catalog.py
1
22089
#-*- coding: utf-8 -*- """ EOSS catalog system functionality for the catalog endpoint """ from utilities.web_utils import remote_file_exists __author__ = "Thilo Wehrmann, Steffen Gebhardt" __copyright__ = "Copyright 2016, EOSS GmbH" __credits__ = ["Thilo Wehrmann", "Steffen Gebhardt"] __license__ = "GPL" __version__...
mit
blitzmann/Pyfa
gui/builtinViews/implantEditor.py
2
9701
# noinspection PyPackageRequirements import wx # noinspection PyPackageRequirements from wx.lib.buttons import GenBitmapButton import gui.builtinMarketBrowser.pfSearchBox as SBox import gui.display as d from gui.bitmap_loader import BitmapLoader from gui.marketBrowser import SearchBox from service.market import Market...
gpl-3.0
janusnic/python_koans
python2/koans/about_decorating_with_classes.py
97
3599
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * import functools class AboutDecoratingWithClasses(Koan): def maximum(self, a, b): if a > b: return a else: return b def test_partial_that_wrappers_no_args(self): """ Before we can...
mit
shakamunyi/tensorflow
tensorflow/tensorboard/backend/server.py
9
5706
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
xdlabs/crawling-tutorials
scrapy_example/scrapy_example/spiders/crawl_images.py
1
1130
import scrapy from bs4 import BeautifulSoup from scrapy_example.items import ImagesItem class ImagesSpider(scrapy.Spider): name = "crawl_images" allowed_domains = ["amazon.in"] start_urls = ["http://www.amazon.in/"] def parse(self, response): data = response.body soup = BeautifulSoup(...
mit
casebenton/certificate-revocation-analysis
get_CRL_revocations/build_CRL_revoked.py
1
2545
from urlparse import urlparse import os.path from multiprocessing import Process, Queue import json import sys WORKERS = 16 INFILE = '../certs_using_crl.json' CRL = 'megaCRL' OUTFILE = 'revokedCRLCerts/certs' def doWork(i, megaCRL_org, megaCRL_CN): print('starting worker ' + str(i)) with open(OUTFILE + str(i)...
mpl-2.0
agustinhenze/nikola.debian
tests/base.py
11
8602
# coding: utf8 # Author: Rodrigo Bistolfi # Date: 03/2013 """ Base class for Nikola test cases """ __all__ = ["BaseTestCase", "cd", "LocaleSupportInTesting"] import os import sys from contextlib import contextmanager import locale import unittest import logbook import nikola.utils nikola.utils.LOGGER.handlers...
mit
Triv90/Nova
nova/tests/servicegroup/test_zk_driver.py
7
2615
# Copyright (c) AT&T 2012-2013 Yun Mao <yunmao@gmail.com> # Copyright 2012 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/LICENS...
apache-2.0
Intel-Corporation/tensorflow
tensorflow/python/kernel_tests/gradient_correctness_test.py
14
4148
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
jaddison/ansible-modules-core
packaging/os/apt_repository.py
93
17068
#!/usr/bin/python # encoding: utf-8 # (c) 2012, Matt Wright <matt@nobien.net> # (c) 2013, Alexander Saltanov <asd@mokote.com> # (c) 2014, Rutger Spiertz <rutger@kumina.nl> # # 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...
gpl-3.0
pquentin/django
tests/forms_tests/tests/test_utils.py
25
6020
# -*- coding: utf-8 -*- from __future__ import unicode_literals import copy from django.core.exceptions import ValidationError from django.forms.utils import ErrorDict, ErrorList, flatatt from django.test import TestCase from django.utils import six from django.utils.encoding import force_text, python_2_unicode_compa...
bsd-3-clause
petjaui/petjaui-cards
node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/eclipse.py
437
11894
# 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. """GYP backend that generates Eclipse CDT settings files. This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML files that can be importe...
mit
jgcaaprom/android_external_chromium_org
tools/find_runtime_symbols/find_runtime_symbols.py
102
6593
#!/usr/bin/env python # 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. """Find symbols in a binary corresponding to given runtime virtual addresses. Note that source file names are treated as symbols in...
bsd-3-clause
gmorrow/ardupilot
Tools/LogAnalyzer/tests/TestDupeLogData.py
273
2651
from LogAnalyzer import Test,TestResult import DataflashLog class TestDupeLogData(Test): '''test for duplicated data in log, which has been happening on PX4/Pixhawk''' def __init__(self): Test.__init__(self) self.name = "Dupe Log Data" def __matchSample(self, sample, sampleStartIndex, logdata): '''return...
gpl-3.0
havt/odoo
addons/account_analytic_analysis/res_config.py
426
1408
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
gwaller/mongo-connector
tests/test_util.py
38
1776
# Copyright 2013-2014 MongoDB, 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 writin...
apache-2.0
thica/ORCA-Remote
src/ORCA/utils/Platform/generic/generic_GetIPAddressV4.py
1
4542
# -*- coding: utf-8 -*- """ ORCA Open Remote Control Application Copyright (C) 2013-2020 Carsten Thielepape Please contact me by : http://www.orca-remote.org/ This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publi...
gpl-3.0
cython-testbed/pandas
pandas/tests/tslibs/test_liboffsets.py
4
6794
# -*- coding: utf-8 -*- """ Tests for helper functions in the cython tslibs.offsets """ from datetime import datetime import pytest from pandas import Timestamp import pandas._libs.tslibs.offsets as liboffsets from pandas._libs.tslibs.offsets import roll_qtrday def test_get_lastbday(): dt = datetime(2017, 11, ...
bsd-3-clause
apavlo/h-store
graphs/eviction-overhead.py
4
2079
#!/usr/bin/env python import os import sys import re import logging import fnmatch import string import argparse import pylab import numpy as np import matplotlib.pyplot as plot from matplotlib.font_manager import FontProperties from matplotlib.ticker import MaxNLocator from pprint import pprint,pformat from options ...
gpl-3.0
maryklayne/Funcao
sympy/mpmath/tests/runtests.py
23
4985
#!/usr/bin/env python """ python runtests.py -py Use py.test to run tests (more useful for debugging) python runtests.py -psyco Enable psyco to make tests run about 50% faster python runtests.py -coverage Generate test coverage report. Statistics are written to /tmp python runtests.py -profile Generate prof...
bsd-3-clause
gauribhoite/personfinder
env/google_appengine/lib/django-0.96/django/contrib/admin/templatetags/log.py
32
2081
from django import template from django.contrib.admin.models import LogEntry register = template.Library() class AdminLogNode(template.Node): def __init__(self, limit, varname, user): self.limit, self.varname, self.user = limit, varname, user def __repr__(self): return "<GetAdminLog Node>" ...
apache-2.0
dmitriz/zipline
zipline/utils/argcheck.py
41
9808
# # Copyright 2014 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 wr...
apache-2.0
draperjames/bokeh
examples/plotting/file/histogram.py
7
4060
# -*- coding: utf-8 -*- import numpy as np import scipy.special from bokeh.layouts import gridplot from bokeh.plotting import figure, show, output_file p1 = figure(title="Normal Distribution (μ=0, σ=0.5)",tools="save", background_fill_color="#E8DDCB") mu, sigma = 0, 0.5 measured = np.random.normal(mu, ...
bsd-3-clause
sadanandb/pmt
src/pyasm/prod/web/asset_history_wdg.py
6
16477
########################################################### # # Copyright (c) 2005, Southpaw Technology # All Rights Reserved # # PROPRIETARY INFORMATION. This software is proprietary to # Southpaw Technology, and is not to be reproduced, transmitted, # or disclosed in any way without written permi...
epl-1.0
dahlstrom-g/intellij-community
python/testData/typeshed/stdlib/2/builtins_test.py
19
5056
def test_map(): assert map(str, [1, 2, 3]) + ['foo'] == ['1', '2', '3', 'foo'] assert map(lambda x: x.upper(), 'foo').pop() == 'O' def test_filter(): assert filter(lambda x: x % 2 == 0, [1, 2, 3]) + [4, 5, 6] == [2, 4, 5, 6] assert filter(lambda x: x != 'f', 'foo') + 'bar' == 'oobar' def test_open(t...
apache-2.0
LarryHillyer/PoolHost
PoolHost/env/Lib/encodings/iso8859_5.py
272
13015
""" Python Character Mapping Codec iso8859_5 generated from 'MAPPINGS/ISO8859/8859-5.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='...
gpl-3.0
chenjiancan/wechatpy
wechatpy/pay/utils.py
7
1364
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import hashlib import socket import six from wechatpy.utils import to_binary, to_text def format_url(params, api_key=None): data = [to_binary('{0}={1}'.format(k, params[k])) for k in sorted(params)] if api_key: data.app...
mit
MphasisWyde/eWamSublimeAdaptor
POC/v0_3_POC_with_project_aborted/third-party/simplejson/tests/test_unicode.py
108
6996
import sys import codecs from unittest import TestCase import simplejson as json from simplejson.compat import unichr, text_type, b, u, BytesIO class TestUnicode(TestCase): def test_encoding1(self): encoder = json.JSONEncoder(encoding='utf-8') u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LET...
mit
sameerparekh/pants
src/python/pants/build_graph/build_file_parser.py
6
7074
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
apache-2.0