repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
matehall/Python-koan
python 2/koans/about_scoring_project.py
1
2644
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * # Greed is a dice game where you roll up to five dice to accumulate # points. The following "score" function will be used calculate the # score of a single roll of the dice. # # A greed roll is scored as follows: # # * A set of three ...
mit
seann1/portfolio5
.meteor/dev_bundle/python/Lib/test/test_site.py
27
15596
"""Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. """ import unittest from test.test_support import run_unittest, TESTFN, EnvironmentVarGuard from test.test_support import captured_output import __builtin__ import os import sys import re im...
gpl-2.0
talpor/django-reversion
src/reversion/__init__.py
18
1730
""" Transactional version control for Django models. Developed by Dave Hall. <http://www.etianen.com/> """ from __future__ import unicode_literals from reversion.revisions import default_revision_manager, revision_context_manager, VersionAdapter from reversion.admin import VersionAdmin from reversion.models import ...
bsd-3-clause
arenadata/ambari
ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/job_history_server.py
1
3363
#!/usr/bin/python """ 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...
apache-2.0
weld-project/weld
python/grizzly/tests/grizzly_test.py
3
8320
#!/usr/bin/python import grizzly.grizzly as gr import pandas as pd import numpy as np import unittest class PandasWeldTestMethods(unittest.TestCase): # TODO: Add more tests here def test_groupby_sum(self): # test single column df = pd.DataFrame({"a":[3,2,3], "b":[4,5,6]}) input = gr....
bsd-3-clause
crazy-canux/pymonitoringplugins
scripts/check_ftp.py
1
4105
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Ftp plugins build with this library. Copyright (C) 2016 Canux CHENG. All rights reserved. Name: check_ftp.py Author: Canux CHENG canuxcheng@gmail.com Version: V1.0.0 Time: Thu 28 Jul 2016 03:23:45 PM CST Description: [1.0.0] 20160728 init for basic function. ...
gpl-3.0
sidooms/Twitter-ratings
backbone.py
2
3335
#Copyright (C) 2014, Simon Dooms #Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sub...
mit
mcflugen/hog
ez_setup.py
276
10240
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
mit
panmari/tensorflow
tensorflow/examples/skflow/iris_custom_model.py
1
1324
# Copyright 2015-present Scikit Flow 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...
apache-2.0
Teagan42/home-assistant
homeassistant/components/rfxtrx/cover.py
2
2910
"""Support for RFXtrx covers.""" import RFXtrx as rfxtrxmod import voluptuous as vol from homeassistant.components.cover import PLATFORM_SCHEMA, CoverDevice from homeassistant.const import CONF_NAME, STATE_OPEN from homeassistant.helpers import config_validation as cv from homeassistant.helpers.restore_state import Re...
apache-2.0
frePPLe/frePPLe
freppledb/reportmanager/migrations/0002_column.py
1
4371
# # Copyright (C) 2020 by frePPLe bv # # This library 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 option) any later version. # # This library is distri...
agpl-3.0
alirizakeles/zato
code/zato-web-admin/src/zato/admin/static/brython/_brython/Lib/xml/etree/__init__.py
81
1637
# $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ # elementtree package # -------------------------------------------------------------------- # The ElementTree toolkit is # # Copyright (c) 1999-2008 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentat...
gpl-3.0
tapanagupta/mi-instrument
mi/instrument/subc_control/onecam/ooicore/driver.py
6
58267
""" @package mi.instrument.subc_control.onecam.ooicore.driver @file marine-integrations/mi/instrument/subc_control/onecam/ooicore/driver.py @author Tapana Gupta @brief Driver for the CAMHD instrument """ import re import json import time import requests from mi.core.instrument.driver_dict import DriverDictKey from mi...
bsd-2-clause
kernc/networkx
tools/gh_api.py
32
6601
"""Functions for Github authorisation.""" from __future__ import print_function try: input = raw_input except NameError: pass import os import requests import getpass import json # Keyring stores passwords by a 'username', but we're not storing a username and # password fake_username = 'networkx-tests' cla...
bsd-3-clause
vladnicoara/SDLive-Blog
documentor/libraries/Sphinx-1.1.3-py3.2/sphinx/ext/intersphinx.py
2
9518
# -*- coding: utf-8 -*- """ sphinx.ext.intersphinx ~~~~~~~~~~~~~~~~~~~~~~ Insert links to objects documented in remote Sphinx documentation. This works as follows: * Each Sphinx HTML build creates a file named "objects.inv" that contains a mapping from object names to URIs relative to the H...
agpl-3.0
wisdomofcrowds/CekaPlus
inference/ds.py
1
12991
# -*- coding: utf-8 -*- # Dawid and Skene's model for multi-class multi-label annotation. # It also compatible for the single label scenario. # Reference: Dawid, A. P., & Skene, A. M. (1979). Maximum likelihood estimation # of observer error-rates using the EM algorithm. Applied statistics, 20-28. # @author:...
gpl-3.0
Rhaseven7h/hellanzb
build_util.py
3
15183
#!/usr/bin/env python """ build_util.py - Build related functions (c) Copyright 2005 Philip Jenvey [See end of file] """ import distutils.util, distutils.spawn, os, re, setup, shutil, sys, tarfile try: from hashlib import md5 except ImportError: from md5 import md5 if sys.version >= '2.5': from hashlib ...
bsd-3-clause
Averroes/data-science-from-scratch
code/recommender_systems.py
60
6291
from __future__ import division import math, random from collections import defaultdict, Counter from linear_algebra import dot users_interests = [ ["Hadoop", "Big Data", "HBase", "Java", "Spark", "Storm", "Cassandra"], ["NoSQL", "MongoDB", "Cassandra", "HBase", "Postgres"], ["Python", "scikit-learn", "sci...
unlicense
sklnet/beyonwiz-enigma2
lib/python/Screens/TaskList.py
7
3028
# -*- coding: utf-8 -*- # taken from mytube plugin from enigma import eTimer from Screens.Screen import Screen from Components.ActionMap import ActionMap from Components.Button import Button from Components.Label import Label from Components.Sources.List import List from Components.MultiContent import MultiContentEntr...
gpl-2.0
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/scipy/weave/standard_array_spec.py
31
7602
from __future__ import absolute_import, print_function from .c_spec import common_base_converter from .c_spec import num_to_c_types import numpy num_typecode = {'?': 'PyArray_BOOL', 'b': 'PyArray_BYTE', 'B': 'PyArray_UBYTE', 'h': 'PyArray_SHORT', 'H': 'P...
mit
sunghan-chang/TizenRT
external/gmock/gtest/test/gtest_xml_outfiles_test.py
2526
5340
#!/usr/bin/env python # # Copyright 2008, 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...
apache-2.0
JulienPeloton/lenscov
src/util.py
1
11683
# Copyright (C) 2016 Peloton ######################### # Contain classes and routines for # * binning # * file management # author: julien@sussex # See 1611.01446 ######################### import glob,sys,os import cPickle as pickle import errno import numpy as np ####################################################...
gpl-3.0
emc2foundation/einsteinium
qa/rpc-tests/maxuploadtarget.py
40
10803
#!/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 BitcoinTestFramework from...
mit
klusark/android_external_chromium_org
third_party/closure_linter/closure_linter/ecmametadatapass.py
155
18062
#!/usr/bin/env python # # Copyright 2010 The Closure Linter 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 #...
bsd-3-clause
GLolol/PyLink
launcher.py
1
8894
#!/usr/bin/env python3 """ PyLink IRC Services launcher. """ import os import signal import sys import time from pylinkirc import __version__, conf, real_version, world try: import psutil except ImportError: psutil = None args = {} def _main(): conf.load_conf(args.config) from pylinkirc.log import...
mpl-2.0
sesuncedu/sdhash
external/tools/build/v2/tools/rc.py
32
7115
# Status: being ported by Steven Watanabe # Base revision: 47077 # # Copyright (C) Andre Hentz 2003. Permission to copy, use, modify, sell and # distribute this software is granted provided this copyright notice appears in # all copies. This software is provided "as is" without express or implied # warranty, and wi...
apache-2.0
codendev/rapidwsgi
src/mako/ast.py
1
5789
# ast.py # Copyright (C) 2006, 2007, 2008, 2009, 2010 Michael Bayer mike_mp@zzzcomputing.com # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """utilities for analyzing expressions and blocks of Python code, as well as generating Python...
gpl-3.0
c0710204/edx-platform
common/djangoapps/student/management/commands/add_to_group.py
74
1972
from optparse import make_option from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User, Group class Command(BaseCommand): option_list = BaseCommand.option_list + ( make_option('--list', action='store_true', de...
agpl-3.0
gromez/Sick-Beard
lib/hachoir_parser/guess.py
90
3940
""" Parser list managment: - createParser() find the best parser for a file. """ import os from lib.hachoir_core.error import warning, info, HACHOIR_ERRORS from lib.hachoir_parser import ValidateError, HachoirParserList from lib.hachoir_core.stream import FileInputStream from lib.hachoir_core.i18n import _ class Que...
gpl-3.0
integricho/heroku-buildpack-python-ffmpeg2-lame
vendor/distribute-0.6.34/release.py
9
4493
#!/usr/bin/env python """ Script to fully automate the release process. Requires Python 2.6+ with sphinx installed and the 'hg' command on the path. """ from __future__ import print_function import subprocess import shutil import os import sys import urllib2 import getpass import collections try: import keyring ex...
mit
lafranceinsoumise/api-django
agir/people/person_forms/models.py
1
6813
from collections import OrderedDict from itertools import chain from django.db import models from django.contrib.postgres.fields import JSONField from django.utils import timezone from django.utils.translation import ugettext_lazy as _ from django.conf import settings from django_prometheus.models import ExportModelOp...
agpl-3.0
bluevoda/BloggyBlog
lib/python3.4/site-packages/django/db/backends/sqlite3/introspection.py
219
11307
import re from collections import namedtuple from django.db.backends.base.introspection import ( BaseDatabaseIntrospection, FieldInfo, TableInfo, ) field_size_re = re.compile(r'^\s*(?:var)?char\s*\(\s*(\d+)\s*\)\s*$') FieldInfo = namedtuple('FieldInfo', FieldInfo._fields + ('default',)) def get_field_size(name)...
gpl-3.0
NetEase/airtest
airtest/console.py
1
8221
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import re import sys import subprocess import time import urllib import json import platform import csv import airtest import click import humanize from airtest import log2html as airlog2html from airtest import androaxml __debug = False def _wget(url, filenam...
bsd-3-clause
odoo-arg/odoo_l10n_ar
l10n_ar_electronic_invoice_report/models/account_invoice.py
1
4181
# -*- encoding: utf-8 -*- ############################################################################## # # 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 Licens...
agpl-3.0
kernevil/samba
python/samba/netcmd/rodc.py
2
5871
# rodc related commands # # Copyright Andrew Tridgell 2010 # # 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 pr...
gpl-3.0
mezz64/home-assistant
tests/components/deconz/test_device_trigger.py
5
4560
"""deCONZ device automation tests.""" from copy import deepcopy from homeassistant.components.deconz import device_trigger from homeassistant.components.deconz.const import DOMAIN as DECONZ_DOMAIN from homeassistant.components.deconz.device_trigger import CONF_SUBTYPE from homeassistant.components.deconz.gateway impo...
apache-2.0
fametrano/BitcoinBlockchainTechnology
btclib/secpoint.py
1
2825
#!/usr/bin/env python3 # Copyright (C) 2017-2020 The btclib developers # # This file is part of btclib. It is subject to the license terms in the # LICENSE file found in the top-level directory of this distribution. # # No part of btclib including this file, may be copied, modified, propagated, # or distributed except...
mit
mitschabaude/nanopores
scripts/pughpore/randomwalk/plot_2bind.py
2
2468
import sys if len(sys.argv)!=4: print '[type,traj,both], samples (int), fieldsname' exit() if not (sys.argv[1]=='type' or sys.argv[1]=='traj' or sys.argv[1]=='both'): print '[type,traj,both], samples (int), fieldsname' exit() else: outcome=sys.argv[1] try: samples=int(sys.argv[2]) num = sys....
mit
shinglyu/servo
tests/wpt/css-tests/css-text-decor-3_dev/xhtml1print/reference/support/generate-text-emphasis-position-property-tests.py
841
3343
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-position-property-001 ~ 006 which cover all possible values of text-emphasis-position property with all combination of three main writing modes and two orientations. Only test files are generated by this script. It also out...
mpl-2.0
DiptoDas8/Biponi
lib/python2.7/site-packages/MySQLdb/converters.py
76
5312
"""MySQLdb type conversion module This module handles all the type conversions for MySQL. If the default type conversions aren't what you need, you can make your own. The dictionary conversions maps some kind of type to a conversion function which returns the corresponding value: Key: FIELD_TYPE.* (from MySQLd...
mit
django-backup/django-backup
test_project/core/settings.py
2
6106
# Django settings for test_project project. # Don't change this file for local needs. Create local_settings.py instead. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__),...
bsd-2-clause
mantidproject/mantid
scripts/test/Abins/AbinsLoadCASTEPTest.py
3
3238
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + impo...
gpl-3.0
Bogh/django-oscar
tests/functional/dashboard/range_tests.py
52
2098
from django.test import TestCase from oscar.apps.dashboard.ranges import forms from oscar.test.factories import create_product from oscar.apps.offer.models import Range class RangeProductFormTests(TestCase): def setUp(self): self.range = Range.objects.create(name='dummy') def tearDown(self): ...
bsd-3-clause
hoechenberger/psychopy
psychopy/tools/fileerrortools.py
1
2045
#!/usr/bin/env python # -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2018 Jonathan Peirce # Distributed under the terms of the GNU General Public License (GPL). """Functions and classes related to file and directory error handling """ from __future__ import absolute_import, print_function fro...
gpl-3.0
hehongyu1995/Dxf2GCode
core/intersect.py
1
6198
############################################################################ # # Copyright (C) 2015 # Jean-Paul Schouwstra # # This file is part of DXF2GCODE. # # DXF2GCODE is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the F...
gpl-3.0
Grassboy/plugin.video.plurkTrend
youtube_dl/extractor/redtube.py
7
1560
from __future__ import unicode_literals import re from .common import InfoExtractor class RedTubeIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?redtube\.com/(?P<id>[0-9]+)' _TEST = { 'url': 'http://www.redtube.com/66418', 'file': '66418.mp4', # md5 varies from time to time, as in...
mit
Qalthos/ansible
lib/ansible/modules/network/fortios/fortios_config.py
43
5108
#!/usr/bin/python # # Ansible module to manage configuration on fortios devices # (c) 2016, Benjamin Jolivot <bjolivot@gmail.com> # 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_...
gpl-3.0
bgxavier/nova
nova/tests/unit/virt/libvirt/test_config.py
23
87260
# Copyright (C) 2012 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 ...
apache-2.0
rahushen/ansible
contrib/inventory/packet_net.py
46
18168
#!/usr/bin/env python ''' Packet.net external inventory script ================================= Generates inventory that Ansible can understand by making API request to Packet.net using the Packet library. NOTE: This script assumes Ansible is being executed where the environment variable needed for Packet API Token...
gpl-3.0
edhuckle/statsmodels
statsmodels/genmod/cov_struct.py
19
46892
from statsmodels.compat.python import iterkeys, itervalues, zip, range from statsmodels.stats.correlation_tools import cov_nearest import numpy as np import pandas as pd from scipy import linalg as spl from collections import defaultdict from statsmodels.tools.sm_exceptions import (ConvergenceWarning, ...
bsd-3-clause
dagwieers/mrepo
setup.py
4
3033
#!/usr/bin/python ### This program is free software; you can redistribute it and/or modify ### it under the terms of the GNU Library General Public License as published by ### the Free Software Foundation; version 2 only ### ### This program is distributed in the hope that it will be useful, ### but WITHOUT ANY WARRAN...
gpl-2.0
jainanisha90/WeVoteServer
apis_v1/documentation_source/voter_email_address_sign_in_doc.py
2
2776
# apis_v1/documentation_source/voter_email_address_sign_in_doc.py # Brought to you by We Vote. Be good. # -*- coding: UTF-8 -*- def voter_email_address_sign_in_doc_template_values(url_root): """ Show documentation about voterEmailAddressSignIn """ required_query_parameter_list = [ { ...
mit
YangChihWei/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/fnmatch.py
894
3163
"""Filename matching with shell patterns. fnmatch(FILENAME, PATTERN) matches according to the local convention. fnmatchcase(FILENAME, PATTERN) always takes case in account. The functions operate by translating the pattern into a regular expression. They cache the compiled regular expressions for speed. The function...
gpl-3.0
monitor1379/hamaa
hamaa/trainers.py
1
11974
# encoding: utf-8 """ @author: monitor1379 @contact: yy4f5da2@hotmail.com @site: www.monitor1379.com @version: 1.0 @license: GNU General Public License(Version 3) @file: trainers.py @time: 2016/10/29 19:25 """ import sys import time import warnings import matplotlib.pyplot as plt import numpy as np from .utils i...
gpl-3.0
elena/django
tests/lookup/test_decimalfield.py
30
1467
from django.db.models import F, Sum from django.test import TestCase from .models import Product, Stock class DecimalFieldLookupTests(TestCase): @classmethod def setUpTestData(cls): cls.p1 = Product.objects.create(name='Product1', qty_target=10) Stock.objects.create(product=cls.p1, qty_availa...
bsd-3-clause
3L3N4/volatility
volatility/plugins/mac/WKdm.py
11
23101
# # Python port of WKdm compression / decompression by # Golden G. Richard III (@nolaforensix, golden@arcanealloy.com) # December 2013 # # For compression and decompression of 4K pages. # # Based loosely on WKdm.c, by: # # * Paul Wilson -- wilson@cs.utexas.edu # * Scott F. Kaplan -- sfkaplan@cs.utexas.edu # * Se...
gpl-2.0
GPUOpen-Drivers/llvm
utils/gn/build/sync_source_lists_from_cmake.py
1
5967
#!/usr/bin/env python """Helps to keep BUILD.gn files in sync with the corresponding CMakeLists.txt. For each BUILD.gn file in the tree, checks if the list of cpp files in it is identical to the list of cpp files in the corresponding CMakeLists.txt file, and prints the difference if not. Also checks that each CMakeL...
apache-2.0
hpcuantwerpen/easybuild-framework
easybuild/tools/repository/svnrepo.py
2
6882
# # # Copyright 2009-2021 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), # Flemish Research Foundation (...
gpl-2.0
hiraditya/fool
tensorflow/c_neuralnetwork.py
1
9707
import math import shutil import numpy as np import pandas as pd import tensorflow as tf ## Set Up # In this first cell, we'll load the necessary libraries. tf.logging.set_verbosity(tf.logging.INFO) pd.options.display.max_rows = 10 pd.options.display.float_format = '{:.1f}'.format # Next, we'll load our data set. df...
mit
Gitlab11/odoo
addons/mail/res_config.py
301
2233
# -*- 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
thebonzitree/django-guardian
guardian/tests/admin_test.py
41
19986
from __future__ import unicode_literals import copy from django import forms from django.conf import settings from django.contrib import admin from django.contrib.contenttypes.models import ContentType from django.core.urlresolvers import reverse from django.http import HttpRequest from django.test import TestCase fro...
bsd-2-clause
tomasreimers/tensorflow-emscripten
tensorflow/contrib/learn/python/learn/estimators/head.py
11
55996
# 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
wazaahhh/pgames
simulations/parseFiles.py
1
5897
import numpy as np import csv import os import re global resultDir resultDir = "/Users/maithoma/work/compute/pgames_d05_transition/results/" #resultDir = "/Users/maithoma/work/compute/phase_transition/results/" #resultDir = "/Users/maithoma/work/compute/pgames_resistance/results/" global summaryDir summaryDir = "summ...
mit
Adel-Magebinary/odoo
addons/base_report_designer/plugin/openerp_report_designer/bin/script/lib/error.py
382
1726
########################################################################## # # Copyright (c) 2003-2004 Danny Brewer d29583@groovegarden.com # Copyright (C) 2004-2010 OpenERP SA (<http://openerp.com>). # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser Gener...
agpl-3.0
shahankhatch/scikit-learn
examples/ensemble/plot_adaboost_regression.py
311
1529
""" ====================================== Decision Tree Regression with AdaBoost ====================================== A decision tree is boosted using the AdaBoost.R2 [1] algorithm on a 1D sinusoidal dataset with a small amount of Gaussian noise. 299 boosts (300 decision trees) is compared with a single decision tr...
bsd-3-clause
dmckinney5/SlackOff
slackoff/lib/python2.7/site-packages/setuptools/command/build_py.py
130
9555
from glob import glob from distutils.util import convert_path import distutils.command.build_py as orig import os import fnmatch import textwrap import io import distutils.errors import itertools import six from six.moves import map, filter, filterfalse try: from setuptools.lib2to3_ex import Mixin2to3 except Impo...
mit
arabenjamin/beets
beetsplug/ihate.py
25
3034
# This file is part of beets. # Copyright 2015, Blemjhoo Tezoulbr <baobab@heresiarch.info>. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitati...
mit
tareqalayan/ansible
lib/ansible/modules/cloud/ovirt/ovirt_hosts.py
22
23063
#!/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
anistark/mozillians
vendor-local/lib/python/rest_framework/authtoken/south_migrations/0001_initial.py
11
3259
# -*- coding: utf-8 -*- from south.db import db from south.v2 import SchemaMigration try: from django.contrib.auth import get_user_model except ImportError: # django < 1.5 from django.contrib.auth.models import User else: User = get_user_model() class Migration(SchemaMigration): def forwards(self, ...
bsd-3-clause
Tesi-Luca-Davide/ryu
ryu/cmd/of_config_cli.py
17
15609
#!/usr/bin/env python # # Copyright (C) 2013 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2013 YAMAMOTO Takashi <yamamoto at valinux co jp> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the...
apache-2.0
erwilan/ansible
lib/ansible/utils/module_docs_fragments/ec2.py
196
1119
# (c) 2015, Ansible, 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 # (at your option) any later version. # # Ansible is di...
gpl-3.0
benoitsteiner/tensorflow-xsmm
tensorflow/python/eager/ops_test.py
13
14825
# 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
ivoras/vacuumer
vacuumer.py
1
2854
#!/usr/bin/python import sys, os from getopt import getopt, GetoptError import getpass import psycopg2 from time import time PG_DB = 'template1' PG_HOST = 'localhost' PG_PORT = 5432 PG_USER = getpass.getuser() PG_PASSWORD = None DO_IT = True def help(): print "usage: %s [-d database] [-h host] [-p port] [-U user]...
bsd-2-clause
quedexnet/python-api
end_to_end_tests/test_api_end_to_end.py
1
5393
from threading import Event, Thread from unittest import TestCase import json from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory from autobahn.twisted.resource import WebSocketResource from twisted.internet import reactor from twisted.web.server import Site from twisted.web.static i...
apache-2.0
danielhers/ucca
scripts/match_text.py
1
2871
import argparse import re import sys from glob import glob from itertools import groupby from operator import attrgetter from tqdm import tqdm from ucca import layer0 from ucca.ioutil import get_passages_with_progress_bar def gen_lines(filenames): for filename in glob(filenames) or [filenames]: with ope...
gpl-3.0
wilberth/SledBalls
sledclient.py
2
11697
#!/usr/bin/python from __future__ import print_function import socket, sys, binascii, struct, time, threading, warnings, math, logging, numpy as np, copy, weakref from collections import deque ############ WvH: this file must be replaced by sledclient2.py once I debugged that one def exitHandler(): print("exit") cla...
gpl-3.0
aattaran/Machine-Learning-with-Python
CTCI/Chapter 4/Question4_8/ChapQ4.8.py
1
4568
import random import time #binary tree python class BinaryTree: def __init__(self, content): self.content = content self.left = None self.right = None self.hash = None self.children = -1 def __str__(self): return "( " + str(self.content) + " ( " + str(self.left)...
bsd-3-clause
rogst/datadogpy
datadog/threadstats/base.py
5
14015
""" ThreadStats is a tool for collecting application metrics without hindering performance. It collects metrics in the application thread with very little overhead and allows flushing metrics in process, in a thread or in a greenlet, depending on your application's needs. """ import logging from functools import wraps...
bsd-3-clause
kaushik94/tornado
tornado/test/util_test.py
37
5787
# coding: utf-8 from __future__ import absolute_import, division, print_function, with_statement import sys import datetime from tornado.escape import utf8 from tornado.util import raise_exc_info, Configurable, u, exec_in, ArgReplacer, timedelta_to_seconds from tornado.test.util import unittest try: from cStringI...
apache-2.0
andrius-preimantas/odoo
addons/purchase/report/purchase_report.py
49
6707
# -*- 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
ymollard/APEX
ros/apex_playground/src/apex_playground/learning/dmp/cs.py
6
4348
''' Copyright (C) 2013 Travis DeWolf 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 t...
gpl-3.0
GenericError/Project-Shell
rmdir.py
1
1287
""" Module which includes the rmdir command """ import os # Importing this for deletion and directory things from shellexceptions import * MAN_DOC = """rmdir - remove directories Usage: rmdir directory rmdir deletes an empty directory with the name of the directory specified. Attempting to remove a non-empty direct...
gpl-3.0
jamiefolsom/edx-platform
common/djangoapps/django_comment_common/models.py
55
5654
import logging from django.db import models from django.contrib.auth.models import User from django.dispatch import receiver from django.db.models.signals import post_save from django.utils.translation import ugettext_noop from student.models import CourseEnrollment from xmodule.modulestore.django import modulestor...
agpl-3.0
garbled1/ansible
lib/ansible/modules/network/avi/avi_pkiprofile.py
27
5312
#!/usr/bin/python # # Created on Aug 25, 2016 # @author: Gaurav Rastogi (grastogi@avinetworks.com) # Eric Anderson (eanderson@avinetworks.com) # module_check: supported # Avi Version: 17.1.1 # # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the te...
gpl-3.0
endlessm/chromium-browser
third_party/catapult/third_party/gsutil/third_party/argcomplete/argcomplete/completers.py
5
3681
# Copyright 2012-2013, Andrey Kislyuk and argcomplete contributors. # Licensed under the Apache License. See https://github.com/kislyuk/argcomplete for more info. from __future__ import absolute_import, division, print_function, unicode_literals import os import subprocess from .compat import str, sys_encoding def _...
bsd-3-clause
GdZ/scriptfile
software/googleAppEngine/lib/django_1_4/tests/regressiontests/forms/models.py
34
2525
# -*- coding: utf-8 -*- import os import datetime import tempfile from django.core.files.storage import FileSystemStorage from django.db import models temp_storage_location = tempfile.mkdtemp(dir=os.environ['DJANGO_TEST_TEMP_DIR']) temp_storage = FileSystemStorage(location=temp_storage_location) class BoundaryMode...
mit
juga0/ooni-probe
ooni/nettests/blocking/dns_consistency.py
4
7786
# -*- encoding: utf-8 -*- # # dnsconsistency # ************** # # The test reports censorship if the cardinality of the intersection of # the query result set from the control server and the query result set # from the experimental server is zero, which is to say, if the two sets # have no matching results whatso...
bsd-2-clause
patrickcurl/ztruck
dj/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer/htmlserializer.py
436
12855
from __future__ import absolute_import, division, unicode_literals from pip._vendor.six import text_type try: from functools import reduce except ImportError: pass from ..constants import voidElements, booleanAttributes, spaceCharacters from ..constants import rcdataElements, entities, xmlEntities from .. imp...
apache-2.0
sgerhart/ansible
lib/ansible/module_utils/pycompat24.py
76
4101
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
mit
andymckay/addons-server
src/olympia/landfill/tests/test_generators.py
2
3274
# -*- coding: utf-8 -*- import collections from olympia import amo from olympia.amo.tests import TestCase from olympia.addons.models import Addon, Persona from olympia.constants.applications import APPS from olympia.landfill.categories import addons_categories, themes_categories from olympia.landfill.generators import...
bsd-3-clause
svanschalkwyk/datafari
windows/python/Lib/lib2to3/fixes/fix_paren.py
327
1228
"""Fixer that addes parentheses where they are required This converts ``[x for x in 1, 2]`` to ``[x for x in (1, 2)]``.""" # By Taek Joo Kim and Benjamin Peterson # Local imports from .. import fixer_base from ..fixer_util import LParen, RParen # XXX This doesn't support nested for loops like [x for x in 1, 2 for x...
apache-2.0
IronLanguages/ironpython2
Src/StdLib/Lib/encodings/iso8859_10.py
593
13845
""" Python Character Mapping Codec iso8859_10 generated from 'MAPPINGS/ISO8859/8859-10.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...
apache-2.0
anirudhjayaraman/scikit-learn
examples/svm/plot_separating_hyperplane_unbalanced.py
329
1850
""" ================================================= SVM: Separating hyperplane for unbalanced classes ================================================= Find the optimal separating hyperplane using an SVC for classes that are unbalanced. We first find the separating plane with a plain SVC and then plot (dashed) the ...
bsd-3-clause
jamesblunt/sympy
sympy/mpmath/libmp/libmpc.py
40
26843
""" Low-level functions for complex arithmetic. """ import sys from .backend import MPZ, MPZ_ZERO, MPZ_ONE, MPZ_TWO, BACKEND from .libmpf import (\ round_floor, round_ceiling, round_down, round_up, round_nearest, round_fast, bitcount, bctable, normalize, normalize1, reciprocal_rnd, rshift, lshift, giant_...
bsd-3-clause
ProfessionalIT/professionalit-webiste
sdk/google_appengine/lib/python-gflags/gflags.py
448
104236
#!/usr/bin/env python # # Copyright (c) 2002, 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 ...
lgpl-3.0
postlund/pyatv
pyatv/mrp/protobuf/SetDefaultSupportedCommandsMessage_pb2.py
1
10775
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: pyatv/mrp/protobuf/SetDefaultSupportedCommandsMessage.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import...
mit
DMLoy/ECommerceBasic
lib/python2.7/site-packages/pkg_resources.py
64
101108
"""Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipula...
mit
socialwareinc/Diamond
src/diamond/handler/hostedgraphite.py
58
2501
# coding=utf-8 """ [Hosted Graphite](https://www.hostedgraphite.com/) is the powerful open-source application metrics system used by hundreds of companies. We take away the headaches of scaling, maintenance, and upgrades and let you do what you do best - write great software. #### Configuration Enable this handler ...
mit
BtpPrograms/MHacks8
Python/classify_myo.py
10
3304
from __future__ import print_function from collections import Counter import struct import sys import time import numpy as np try: from sklearn import neighbors, svm HAVE_SK = True except ImportError: HAVE_SK = False try: import pygame from pygame.locals import * HAVE_PYGAME = True except Im...
gpl-3.0
nysan/yocto-autobuilder
lib/python2.6/site-packages/Twisted-11.0.0-py2.6-linux-x86_64.egg/twisted/names/authority.py
20
11043
# -*- test-case-name: twisted.names.test.test_names -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Authoritative resolvers. """ import os import time from twisted.names import dns from twisted.internet import defer from twisted.python import failure import common def getSerial(file...
gpl-2.0