repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
CloverHealth/airflow
tests/utils/test_cli_util.py
15
3144
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
apache-2.0
airanmehr/Utils
Simulation.py
1
40529
''' Copyleft Oct 10, 2015 Arya Iranmehr, PhD Student, Bafna's Lab, UC San Diego, Email: airanmehr@gmail.com ''' from __future__ import division import numpy as np; import pandas as pd; np.set_printoptions(linewidth=140, precision=5, suppress=True) import subprocess, uuid, os,sys import pylab as plt import UTILS.Util...
mit
Leila20/django
django/contrib/gis/db/backends/spatialite/base.py
59
3621
import sys from ctypes.util import find_library from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.db.backends.sqlite3.base import ( Database, DatabaseWrapper as SQLiteDatabaseWrapper, SQLiteCursorWrapper, ) from django.utils import six from .client import SpatiaL...
bsd-3-clause
xcyan/models
object_detection/anchor_generators/multiple_grid_anchor_generator.py
21
12824
# 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
turbokongen/home-assistant
tests/components/airly/test_sensor.py
4
4303
"""Test sensor of Airly integration.""" from datetime import timedelta from homeassistant.components.airly.sensor import ATTRIBUTION from homeassistant.const import ( ATTR_ATTRIBUTION, ATTR_DEVICE_CLASS, ATTR_ENTITY_ID, ATTR_ICON, ATTR_UNIT_OF_MEASUREMENT, CONCENTRATION_MICROGRAMS_PER_CUBIC_MET...
apache-2.0
Coelhon/MasterRepo.repository
plugin.video.youtube/resources/lib/test_youtube/test_helper/test_resource_manager.py
27
1077
__author__ = 'bromix' from resources.lib import kodion from resources.lib.youtube import Provider from resources.lib.youtube.helper import ResourceManager import unittest class TestResourceManager(unittest.TestCase): def test_get_related_playlists(self): provider = Provider() context = kodion.Co...
gpl-2.0
jiachenning/odoo
addons/auth_signup/res_users.py
90
14710
# -*- 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
vasyarv/edx-platform
common/lib/xmodule/xmodule/tests/test_peer_grading.py
72
16833
import unittest import json import logging from mock import Mock, patch from webob.multidict import MultiDict from xblock.field_data import DictFieldData from xblock.fields import ScopeIds from opaque_keys.edx.locations import Location, SlashSeparatedCourseKey from xmodule.tests import get_test_system, get_test_descr...
agpl-3.0
maxamillion/systemd
tools/make-directive-index.py
8
11036
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */ # # This file is part of systemd. # # Copyright 2012-2013 Zbigniew Jędrzejewski-Szmek # # systemd is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Softwar...
gpl-2.0
turdusmerula/kipartman
test/TESTpluginImportCSV.py
1
1083
import sys, os #TODO: LOOK UP CURRENT DIRECTORY # sys.argv[0] <fulldirectory>\\<this filename> in ipython does not describe this filename # so use os.getcwd # For this TEST just add both possible paths to the necessary imports # # sys.path.append( os.path.join(os.path.split(os.path.dirname(sys.argv[0]))[0],'kipa...
gpl-3.0
40023255/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/site-packages/pygame/color.py
603
4330
## pygame - Python Game Library ## Copyright (C) 2000-2003 Pete Shinners ## ## This library 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; either ## version 2 of the License, or (...
gpl-3.0
trhongbinwang/data_science_journey
Spark/spark2.10/python/mllib/ranking_metrics_example.py
100
2197
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
apache-2.0
nvoron23/scipy
scipy/special/tests/test_data.py
9
21692
from __future__ import division, print_function, absolute_import import os import warnings import numpy as np from numpy import arccosh, arcsinh, arctanh from numpy.testing import run_module_suite from scipy.special import ( lpn, lpmn, lpmv, lqn, lqmn, sph_harm, eval_legendre, eval_hermite, eval_laguerre, eva...
bsd-3-clause
fusionpig/ansible
v1/ansible/color.py
134
2388
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
gpl-3.0
tiagofrepereira2012/tensorflow
tensorflow/python/kernel_tests/random_poisson_test.py
27
7393
# 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
jp-bpl/configuration
playbooks/roles/supervisor/files/pre_supervisor_checks.py
4
8641
import argparse import boto from boto.utils import get_instance_metadata from boto.exception import AWSConnectionError import hipchat import os import subprocess import traceback import socket import time # Services that should be checked for migrations. MIGRATION_COMMANDS = { 'lms': "{python} {code_dir}/manag...
agpl-3.0
yurac/python-docx
docx/styles/latent.py
13
7549
# encoding: utf-8 """ Latent style-related objects. """ from __future__ import ( absolute_import, division, print_function, unicode_literals ) from . import BabelFish from ..shared import ElementProxy class LatentStyles(ElementProxy): """ Provides access to the default behaviors for latent styles in th...
mit
setsulla/owanimo
script/battle_arena.py
1
1283
import os import sys import time from owanimo.app.error import ERROR as e from owanimo.script import allegory_special from owanimo.util import define from owanimo.util.log import LOG as L class Allegory(allegory_special.Allegory): def __init__(self, runner, profile, player): allegory_special.Allegory.__in...
mit
zturchan/CMPUT410-Lab6
v1/lib/python2.7/site-packages/django/conf/locale/mk/formats.py
43
1744
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'd F Y' TIME_FORMAT = 'H:i:s' DATE...
apache-2.0
haridsv/pip
pip/_vendor/requests/packages/chardet/codingstatemachine.py
2931
2318
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org 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 Reserved. # # Con...
mit
NullNoname/dolphin
Externals/scons-local/scons-local-2.0.1/SCons/Tool/javah.py
61
4666
"""SCons.Tool.javah Tool-specific initialization for javah. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation #...
gpl-2.0
rduivenvoorde/QGIS
tests/src/python/test_qgslayoutguides.py
30
17921
# -*- coding: utf-8 -*- """QGIS Unit tests for QgsLayoutGuide/QgsLayoutGuideCollection. .. note:: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) ...
gpl-2.0
aebrahim/CyLP
cylp/tests/test_CyCoinIndexedVector.py
4
2585
import unittest import numpy as np from cylp.cy import CyCoinIndexedVector class TestCyCoinIndexedVector(unittest.TestCase): def setUp(self): self.c = CyCoinIndexedVector() self.c.reserve(5) def test_basic(self): c = self.c c[1] = 3.1 c[4] = -2 self.assertTrue(...
epl-1.0
eeshangarg/oh-mainline
vendor/packages/zope.interface/src/zope/interface/common/tests/basemapping.py
52
3914
############################################################################## # # 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...
agpl-3.0
cloudant/bigcouch
couchjs/scons/scons-local-2.0.1/SCons/Tool/MSCommon/netframework.py
61
2807
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without li...
apache-2.0
maiorBoltach/bf2142stats_emu
python/bf2/stats/тест-medal_data.py
2
38019
import host import bf2 from bf2.stats.constants import * globalKeysNeeded = {} rank_data = {} LIMIT_SINGLE = 0 # can get only once in career LIMIT_MULTI = 1 # can get several in career and round # criteria functions def player_score (player_attr, value=None): if value == None: def _player_score (player): ...
gpl-2.0
mallconnectionorg/openerp
logistica/stock_posiciones_por_ubicacion/__openerp__.py
1
1871
# -*- 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
open-synergy/stock-logistics-warehouse
stock_reserve/model/product.py
2
3025
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
agpl-3.0
zstackio/zstack-woodpecker
integrationtest/vm/monitor/alert_host_network_tx.py
2
3082
''' Test about monitor trigger on host network tx in one minute @author: Songtao,Haochen ''' import os import test_stub import random import time import threading import zstacklib.utils.ssh as ssh import zstackwoodpecker.test_util as test_util import zstackwoodpecker.operations.resource_operations as res_ops import...
apache-2.0
ericholscher/django
django/views/i18n.py
1
10581
import importlib import json import os import gettext as gettext_module from django import http from django.conf import settings from django.template import Context, Template from django.utils.translation import check_for_language, to_locale, get_language from django.utils.encoding import smart_text from django.utils....
bsd-3-clause
teltek/edx-platform
common/djangoapps/entitlements/tests/test_utils.py
13
6248
""" Test entitlements utilities """ from datetime import timedelta from opaque_keys.edx.keys import CourseKey from django.conf import settings from django.utils.timezone import now from xmodule.modulestore.tests.django_utils import ModuleStoreTestCase from course_modes.models import CourseMode from course_modes.test...
agpl-3.0
Alir3z4/django-databrowse
django_databrowse/datastructures.py
1
11642
""" These classes are light wrappers around Django's database API that provide convenience functionality and permalink functions for the databrowse app. """ from django.db import models from django.utils import formats from django.utils.text import capfirst from django.utils.encoding import smart_text, smart_text, iri...
bsd-3-clause
halberom/ansible
lib/ansible/modules/web_infrastructure/letsencrypt.py
18
32399
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2016 Michael Gruener <michael.gruener@chaosmoon.net> # # 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...
gpl-3.0
Hackplayers/Empire-mod-Hackplayers
lib/stagers/osx/launcher.py
10
3008
from lib.common import helpers class Stager: def __init__(self, mainMenu, params=[]): self.info = { 'Name': 'Launcher', 'Author': ['@harmj0y'], 'Description': ('Generates a one-liner stage0 launcher for Empire.'), 'Comments': [ '' ...
bsd-3-clause
PyCQA/pylint
tests/functional/i/invalid/g/invalid_getnewargs_returned.py
2
1504
"""Check invalid value returned by __getnewargs__ """ # pylint: disable=too-few-public-methods,missing-docstring,no-self-use,import-error, useless-object-inheritance import six from missing import Missing class FirstGoodGetNewArgs(object): """__getnewargs__ returns <type 'tuple'>""" def __getnewargs__(self...
gpl-2.0
chb/indivo_server
indivo/urls/carenet.py
3
1997
from django.conf.urls.defaults import * from indivo.views import * from indivo.lib.utils import MethodDispatcher urlpatterns = patterns('', (r'^$', MethodDispatcher({ 'DELETE' : carenet_delete})), (r'^/rename$', MethodDispatcher({ 'POST' : carenet_rename})), (r'^/record$', ...
gpl-3.0
hoalamha/android_kernel_lge_apq8084
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
SelvorWhim/competitive
Codewars/LinkedListsAlternatingSplit.py
1
1195
# this solution preserves original list structure, but new nodes shallow copy old data, so if the data is a reference type, changing it in one list will affect one of the others class Node(object): def __init__(self, data=None): self.data = data self.next = None # shallow copy of the data,...
unlicense
hajuuk/asuswrt
release/src-rt-6.x.4708/toolchains/hndtools-armeabi-2013.11/arm-none-eabi/share/gdb/python/gdb/command/type_printers.py
137
4424
# Type printer commands. # Copyright (C) 2010-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 your option) any late...
gpl-2.0
Ziqi-Li/bknqgis
numpy/numpy/f2py/use_rules.py
188
3652
#!/usr/bin/env python """ Build 'use others module data' mechanism for f2py2e. Unfinished. Copyright 2000 Pearu Peterson all rights reserved, Pearu Peterson <pearu@ioc.ee> Permission to use, modify, and distribute this software is given under the terms of the NumPy License. NO WARRANTY IS EXPRESSED OR IMPLIED. USE...
gpl-2.0
yajnab/android_kernel_htc_golfu
arch/ia64/scripts/unwcheck.py
13143
1714
#!/usr/bin/python # # Usage: unwcheck.py FILE # # This script checks the unwind info of each function in file FILE # and verifies that the sum of the region-lengths matches the total # length of the function. # # Based on a shell/awk script originally written by Harish Patil, # which was converted to Perl by Matthew Ch...
gpl-2.0
Universal-Model-Converter/UMC3.0a
data/Python/x86/Lib/site-packages/pygame/tests/event_test.py
3
8601
#################################### IMPORTS ################################### if __name__ == '__main__': import sys import os pkg_dir = os.path.split(os.path.abspath(__file__))[0] parent_dir, pkg_name = os.path.split(pkg_dir) is_pygame_pkg = (pkg_name == 'tests' and os.path....
mit
edunham/servo
tests/wpt/update/__init__.py
194
1110
# 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/. #!/usr/bin/env python import os import subprocess import sys from mozlog.structured import structuredlog here = os.pat...
mpl-2.0
OpusVL/odoo
openerp/cli/scaffold.py
1
4096
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import os import re import sys import jinja2 from . import Command from openerp.modules.module import (get_module_root, MANIFEST, load_information_from_description_file as load_manifest) class Scaffold(Command): """ Generates an Odoo module skeleton...
agpl-3.0
Matt-Deacalion/django
django/utils/timesince.py
409
2671
from __future__ import unicode_literals import calendar import datetime from django.utils.html import avoid_wrapping from django.utils.timezone import is_aware, utc from django.utils.translation import ugettext, ungettext_lazy TIMESINCE_CHUNKS = ( (60 * 60 * 24 * 365, ungettext_lazy('%d year', '%d years')), ...
bsd-3-clause
jvrsantacruz/XlsxWriter
xlsxwriter/test/comparison/test_cond_format11.py
8
1684
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTest): """...
bsd-2-clause
jbenden/ansible
lib/ansible/modules/source_control/gitlab_user.py
8
12760
#!/usr/bin/python # (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) # 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.0', ...
gpl-3.0
tensorflow/lingvo
lingvo/tasks/asr/tools/simple_wer.py
1
9729
# Lint as: python3 # Copyright 2018 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 ...
apache-2.0
jimmyraywv/cloud-custodian
tests/test_kinesis.py
5
4223
# Copyright 2016-2017 Capital One Services, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
apache-2.0
LLNL/spack
var/spack/repos/builtin/packages/tulip/package.py
5
1425
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class Tulip(CMakePackage): """ Tulip is an information visualization framework dedicated to the analysis and visu...
lgpl-2.1
theflofly/tensorflow
tensorflow/python/autograph/pyct/ast_util.py
4
10786
# 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
neerajvashistha/pa-dude
lib/python2.7/site-packages/pygments/styles/pastie.py
50
2473
# -*- coding: utf-8 -*- """ pygments.styles.pastie ~~~~~~~~~~~~~~~~~~~~~~ Style similar to the `pastie`_ default style. .. _pastie: http://pastie.caboo.se/ :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.style impor...
mit
Pirata-Repository/Pirata
plugin.video.movie25/resources/libs/plugins/dramania.py
2
13253
# -*- coding: utf-8 -*- import urllib,re,os,sys,json import xbmc, xbmcgui, xbmcaddon, xbmcplugin,time from resources.libs import main #Mash Up - by Mash2k3 2012. addon_id = 'plugin.video.movie25' selfAddon = xbmcaddon.Addon(id=addon_id) art = main.art smalllogo=art+'/smallicon.png' def MAIN(): main.GA("Plugin",...
gpl-2.0
nullx002/pychess
lib/pychess/Players/Human.py
20
13896
from __future__ import print_function from gi.repository import Gtk, GObject from pychess.compat import Queue from pychess.Utils.const import * from pychess.Utils.logic import validate from pychess.Utils.Move import Move from pychess.Utils.Offer import Offer from pychess.System.Log import log from pychess.System impo...
gpl-3.0
ActiveState/code
recipes/Python/576696_OrderedSet_with_Weakrefs/recipe-576696.py
1
2863
import collections from weakref import proxy class Link(object): __slots__ = 'prev', 'next', 'key', '__weakref__' class OrderedSet(collections.MutableSet): 'Set the remembers the order elements were added' # Big-O running times for all methods are the same as for regular sets. # The internal self.__ma...
mit
ubiar/odoo
openerp/addons/test_new_api/tests/test_onchange.py
208
7641
# -*- coding: utf-8 -*- from openerp.tests import common class TestOnChange(common.TransactionCase): def setUp(self): super(TestOnChange, self).setUp() self.Discussion = self.env['test_new_api.discussion'] self.Message = self.env['test_new_api.message'] def test_default_get(self): ...
agpl-3.0
nvbn/django-discover-jenkins
tests/tests/test_runner.py
1
2207
from mock import MagicMock, patch from django.test import TestCase from discover_jenkins import runner, tasks class FakeTestRunner(object): """ A fake object to stub out the base methods that the mixin's super() calls require. """ def setup_test_environment(self): pass def teardown_...
bsd-3-clause
malaclypse2/seraphim
seraphim/users/tests/test_admin.py
117
1391
from test_plus.test import TestCase from ..admin import MyUserCreationForm class TestMyUserCreationForm(TestCase): def setUp(self): self.user = self.make_user('notalamode', 'notalamodespassword') def test_clean_username_success(self): # Instantiate the form with a new username form ...
mit
ndchorley/scipy
scipy/optimize/_trustregion.py
96
8598
"""Trust-region optimization.""" from __future__ import division, print_function, absolute_import import math import numpy as np import scipy.linalg from .optimize import (_check_unknown_options, wrap_function, _status_message, OptimizeResult) __all__ = [] class BaseQuadraticSubproblem(objec...
bsd-3-clause
KontorConsulting/odoo
addons/point_of_sale/wizard/pos_details.py
225
2386
# -*- 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
ulope/django
tests/model_forms/models.py
22
12360
""" XX. Generating HTML forms from models This is mostly just a reworking of the ``form_for_model``/``form_for_instance`` tests to use ``ModelForm``. As such, the text may not make sense in all cases, and the examples are probably a poor fit for the ``ModelForm`` syntax. In other words, most of these tests should be r...
bsd-3-clause
ansible/tower-cli
tower_cli/resources/host.py
2
4549
# Copyright 2015, Ansible, Inc. # Luke Sneeringer <lsneeringer@ansible.com> # # 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
discotato/breve
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/input.py
292
114315
# 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. from compiler.ast import Const from compiler.ast import Dict from compiler.ast import Discard from compiler.ast import List from compiler.ast import Module from co...
gpl-2.0
Tocknicsu/nctuoj_contest
test/api/submission/submission.py
1
3212
def set_contest(): import datetime start = datetime.datetime.now() + datetime.timedelta(hours=-1) end = datetime.datetime.now() + datetime.timedelta(hours=1) start = str(start)[:-7] end = str(end)[:-7] return [{ "name": "adjust to now is in contest", "url": "/api/contest/", ...
apache-2.0
rsvip/Django
django/db/backends/oracle/utils.py
539
1252
import datetime from django.utils.encoding import force_bytes, force_text from .base import Database # Check whether cx_Oracle was compiled with the WITH_UNICODE option if cx_Oracle is pre-5.1. This will # also be True for cx_Oracle 5.1 and in Python 3.0. See #19606 if int(Database.version.split('.', 1)[0]) >= 5 and...
bsd-3-clause
will-hart/blitz
blitz/data/__init__.py
1
8432
import sys __author__ = 'Will Hart' from collections import OrderedDict class DataContainer(object): """ A class for saving and managing data that can be used in the interface. It also provides an interface for adding DataTransform objects which can be used to apply filters (i.e. moving average, mu...
agpl-3.0
Plain-Andy-legacy/android_external_chromium_org
chrome/common/extensions/docs/server2/host_file_system_provider.py
25
4838
# 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. from caching_file_system import CachingFileSystem from gitiles_file_system import GitilesFileSystem from local_file_system import LocalFileSystem from offlin...
bsd-3-clause
sumspr/scikit-learn
sklearn/gaussian_process/correlation_models.py
230
7630
# -*- coding: utf-8 -*- # Author: Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # Licence: BSD 3 clause """ The built-in correlation models submodule for the gaussian_process module. """ import numpy as np def absolute_exponential(theta, d): """ Abs...
bsd-3-clause
paran0ids0ul/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/requests/packages/chardet/langhungarianmodel.py
2763
12536
######################## 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-3.0
SvichkarevAnatoly/Course-Python-Bioinformatics
semester1/bioseq8/example8.py
1
1082
import rpy2.robjects as R def binomialTailTest(count, nTrials, pEvent, oneSided=True): alt = 'greater' if oneSided else 'two.sided' func = R.r['binom.test'] result = func(x=count, n=nTrials, p=pEvent, alternative=alt) return result[2][0] count = 530 nTrials = 1000 pEvent = 0.5 result = binomialTa...
gpl-2.0
gangadhar-kadam/nassimapp
stock/doctype/bin/bin.py
30
2529
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import webnotes from webnotes.utils import add_days, cint,flt, nowdate, get_url_to_form, formatdate from webnotes import msgprint, _ import webnotes...
agpl-3.0
cldavid/aquacc
temp_client.py
1
1340
#!/usr/bin/python import socket import re import subprocess sensors_db = { "2857993450082": "in_temp", "2866BC3C5006E": "out_temp" } ALERT_TEMP_IN_MIN = 27.5 ALERT_TEMP_IN_MAX = 29.5 print "Sensor DB" for i in sensors_db: print i, sensors_db[i] print s = socket.socket() host = "localhost" por...
gpl-3.0
sunzhxjs/JobGIS
lib/python2.7/site-packages/numpy/lib/tests/test__iotools.py
148
14018
from __future__ import division, absolute_import, print_function import sys import time from datetime import date import numpy as np from numpy.compat import asbytes, asbytes_nested from numpy.testing import ( run_module_suite, TestCase, assert_, assert_equal, assert_allclose, assert_raises ) from numpy.l...
mit
rossgoodwin/musapaedia
musapaedia/muse/lib/python2.7/site-packages/pip/_vendor/requests/__init__.py
42
1861
# -*- coding: utf-8 -*- # __ # /__) _ _ _ _ _/ _ # / ( (- (/ (/ (- _) / _) # / """ requests HTTP library ~~~~~~~~~~~~~~~~~~~~~ Requests is an HTTP library, written in Python, for human beings. Basic GET usage: >>> import requests >>> r = requests.get('https://www.python.org') >>> ...
mit
jarmoni/ansible-modules-core
cloud/openstack/os_ironic.py
128
12857
#!/usr/bin/python # coding: utf-8 -*- # (c) 2014, Hewlett-Packard Development Company, L.P. # # This module 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 optio...
gpl-3.0
DG-i/openshift-ansible
roles/lib_openshift/library/oc_serviceaccount_secret.py
1
58441
#!/usr/bin/env python # pylint: disable=missing-docstring # flake8: noqa: T001 # ___ ___ _ _ ___ ___ _ _____ ___ ___ # / __| __| \| | __| _ \ /_\_ _| __| \ # | (_ | _|| .` | _|| / / _ \| | | _|| |) | # \___|___|_|\_|___|_|_\/_/_\_\_|_|___|___/_ _____ # | \ / _ \ | \| |/ _ \_ _| | __| \_ ...
apache-2.0
Bysmyyr/chromium-crosswalk
tools/grit/grit/pseudo_unittest.py
61
1822
#!/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. '''Unit tests for grit.pseudo''' import os import sys if __name__ == '__main__': sys.path.append(os.path.join(os.path.dirname(__...
bsd-3-clause
un33k/CouchPotatoServer
libs/guessit/hash_ed2k.py
150
2039
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
benhc123/cjdns
node_build/dependencies/libuv/build/gyp/test/copies/gyptest-slash.py
249
1433
#!/usr/bin/env python # 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. """ Verifies file copies with a trailing slash in the destination directory. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('cop...
gpl-3.0
sanjeevtripurari/hue
desktop/core/ext-py/Django-1.6.10/django/contrib/flatpages/models.py
119
1487
from __future__ import unicode_literals from django.db import models from django.contrib.sites.models import Site from django.core.urlresolvers import get_script_prefix from django.utils.translation import ugettext_lazy as _ from django.utils.encoding import iri_to_uri, python_2_unicode_compatible @python_2_unicode_c...
apache-2.0
atamazian/traffic-proc-tools
gg1_function.py
1
2914
#Simulate queuing system G/G/1 #@Author: Nguyen Duc Viet import random as rd import numpy as np import simpy #Function for epirical data -------------------------------------------------------------------------------------------- data_wt = [] def arrival(env, number,counter,interval,time_service): for i in range(...
mit
wainersm/buildbot
master/buildbot/process/buildrequestdistributor.py
10
20444
# This file is part of Buildbot. Buildbot is free software: you can # redistribute it and/or modify it under the terms of the GNU General Public # License as published by the Free Software Foundation, version 2. # # This program is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without eve...
gpl-2.0
weitengchu/rt-thread
components/external/freetype/src/tools/docmaker/utils.py
146
3530
# # utils.py # # Auxiliary functions for the `docmaker' tool (library file). # # Copyright 2002, 2004, 2007, 2008, 2014 by # David Turner. # # This file is part of the FreeType project, and may only be used, # modified, and distributed under the terms of the FreeType project # license, LICENSE.TXT. By continu...
gpl-2.0
DasIch/django
django/db/migrations/operations/special.py
52
7423
from __future__ import unicode_literals from django.db import router from .base import Operation class SeparateDatabaseAndState(Operation): """ Takes two lists of operations - ones that will be used for the database, and ones that will be used for the state change. This allows operations that don't ...
bsd-3-clause
bkfox/aircox
instance/urls.py
2
1343
"""aircox URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.8/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-base...
gpl-3.0
chidea/GoPythonDLLWrapper
bin/lib/test/test_file.py
8
11361
import sys import os import unittest from array import array from weakref import proxy import io import _pyio as pyio from test.support import TESTFN, run_unittest from collections import UserList class AutoFileTests: # file tests for which a test file is automatically set up def setUp(self): self.f...
mit
myarjunar/QGIS
python/plugins/processing/algs/grass7/Grass7Utils.py
1
18151
# -*- coding: utf-8 -*- """ *************************************************************************** GrassUtils.py --------------------- Date : February 2015 Copyright : (C) 2014-2015 by Victor Olaya Email : volayaf at gmail dot com *********************...
gpl-2.0
yuma-m/pychord
pychord/progression.py
1
3153
# -*- coding: utf-8 -*- from .chord import as_chord, Chord class ChordProgression(object): """ Class to handle chord progressions. :param list[pychord.Chord] _chords: component chords of chord progression. """ def __init__(self, initial_chords=None): """ Constructor of ChordProgression inst...
mit
sdh11/gnuradio
gnuradio-runtime/python/gnuradio/gr/packet_utils.py
6
4835
#!/usr/bin/env python # # Copyright 2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # ...
gpl-3.0
Kobzol/debug-visualizer
debugger/pycgdb/programinfo.py
1
2577
# -*- coding: utf-8 -*- # # Copyright (C) 2015-2016 Jakub Beranek # # This file is part of Devi. # # Devi is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, version 3 of the License, or # (at yo...
gpl-3.0
b-me/django
tests/reverse_lookup/tests.py
326
1675
from __future__ import unicode_literals from django.core.exceptions import FieldError from django.test import TestCase from .models import Choice, Poll, User class ReverseLookupTests(TestCase): def setUp(self): john = User.objects.create(name="John Doe") jim = User.objects.create(name="Jim Bo")...
bsd-3-clause
luiscarlosgph/nas
env/lib/python2.7/site-packages/django/contrib/admindocs/utils.py
80
3937
"Misc. utility functions/classes for admin documentation generator." import re from email.parser import HeaderParser from email.errors import HeaderParseError from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse from django.utils.encoding import force_bytes try: import docuti...
mit
valexandersaulys/airbnb_kaggle_contest
venv/lib/python3.4/site-packages/wheel/tool/__init__.py
238
13310
""" Wheel command-line utility. """ import os import hashlib import sys import json import wheel.paths from glob import iglob from .. import signatures from ..util import (urlsafe_b64decode, urlsafe_b64encode, native, binary, matches_requirement) from ..install import WheelFile def require_pkgre...
gpl-2.0
kostia/electron
script/upload.py
118
7288
#!/usr/bin/env python import argparse import errno import os import subprocess import sys import tempfile from lib.config import PLATFORM, get_target_arch, get_chromedriver_version from lib.util import atom_gyp, execute, get_atom_shell_version, parse_version, \ scoped_cwd from lib.github import G...
mit
MicrosoftGenomics/FaST-LMM
fastlmm/util/runner/examples.py
1
2867
import math from fastlmm.util.mapreduce import map_reduce from fastlmm.util.runner import Local, LocalMultiProc, HPC, LocalMultiThread import os def is_prime(n): assert n == int(n) and n>1, "Expect integers greater than 1" for j in xrange(2,int(math.sqrt(n))+1): if n % j == 0: return False ...
apache-2.0
electronic-library/electronic-library-core
tests/library_test.py
1
5083
""" Unit tests for class Library. """ from library.bookmark import Bookmark from library.book import Book from library.library import Library lib = Library() book1_refs = { 'Authors': ['OS guy', 'Some guy'], 'Publisher': 'Forgot publisher', 'Edition': 9, 'Chapters': 18, 'Pages': 900 } book...
gpl-3.0
jeamland/wsproto
test/test_upgrade.py
1
5508
# -*- coding: utf-8 -*- """ Test the HTTP upgrade phase of connection """ import base64 import email import random import sys from wsproto.connection import WSConnection, CLIENT, SERVER from wsproto.events import ( ConnectionEstablished, ConnectionFailed, ConnectionRequested ) IS_PYTHON3 = sys.version_info >= (...
mit
mbrukman/flocker
flocker/restapi/_error.py
8
3004
# Copyright Hybrid Logic Ltd. See LICENSE file for details. """ This module defines the presentation of error conditions that can be encountered by the implementation of the API. """ __all__ = [ "BadRequest", "InvalidRequestJSON", "makeBadRequest", "DECODING_ERROR_DESCRIPTION", "DECODING_ERROR", "UNAUTH...
apache-2.0
daenamkim/ansible
lib/ansible/modules/cloud/amazon/s3_lifecycle.py
29
15298
#!/usr/bin/python # Copyright: Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) from __future__ import absolute_import, division, print_function __metaclass__ = type ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterf...
gpl-3.0
rockingdingo/reinforcement-learning
lib/envs/windy_gridworld.py
6
2509
import gym import numpy as np import sys from gym.envs.toy_text import discrete UP = 0 RIGHT = 1 DOWN = 2 LEFT = 3 class WindyGridworldEnv(discrete.DiscreteEnv): metadata = {'render.modes': ['human', 'ansi']} def _limit_coordinates(self, coord): coord[0] = min(coord[0], self.shape[0] - 1) co...
mit