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
AltSysrq/mysql-server
storage/ndb/mcc/tst/unittest2/result.py
152
6133
"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from unittest2 import util from unittest2.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): ...
gpl-2.0
mekkablue/ShowCrosshair
ShowCrosshair.glyphsReporter/Contents/Resources/plugin.py
1
11905
# encoding: utf-8 from __future__ import division, print_function, unicode_literals ####################################################################################### # # Reporter Plugin # # Read the docs: # https://github.com/schriftgestalt/GlyphsSDK/tree/master/Python%20Templates/Reporter # ####################...
apache-2.0
alimony/django
django/contrib/gis/db/models/aggregates.py
17
2219
from django.contrib.gis.db.models.fields import ExtentField from django.db.models.aggregates import Aggregate __all__ = ['Collect', 'Extent', 'Extent3D', 'MakeLine', 'Union'] class GeoAggregate(Aggregate): function = None is_extent = False def as_sql(self, compiler, connection, function=None, **extra_co...
bsd-3-clause
piosz/test-infra
gubernator/github_auth.py
14
4800
# Copyright 2016 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
apache-2.0
coderum/crony
crony/crony.py
1
3147
import click from . import utils, views from . import parsers as p from .crontab import Crontab try: from StringIO import StringIO except ImportError: from io import StringIO @click.group() def crony(): pass @crony.command() @click.option('--limit', default=0, help="Number of crons to di...
gpl-3.0
tempbottle/kbengine
kbe/res/scripts/common/Lib/unittest/loader.py
83
16378
"""Loading unittests.""" import os import re import sys import traceback import types import functools from fnmatch import fnmatch from . import case, suite, util __unittest = True # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID...
lgpl-3.0
niceandcoolusername/cosmos
code/divide_conquer/quick_sort/QuickSort.py
2
1366
# divide conquer | quick sort | Python # Part of Cosmos by OpenGenus Foundation # This function takes last element as pivot, places # the pivot element at its correct position in sorted # array, and places all smaller (smaller than pivot) # to left of pivot and all greater elements to right # of pivot def partition(arr...
gpl-3.0
dagwieers/ansible-modules-core
cloud/digital_ocean/digital_ocean_domain.py
25
6906
#!/usr/bin/python # -*- coding: utf-8 -*- # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. #...
gpl-3.0
denismakogon/trove-guestagent
trove_guestagent/common/context.py
1
1865
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apach...
apache-2.0
sadaf2605/django
tests/foreign_object/models/person.py
64
3245
import datetime from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Country(models.Model): # Table Column Fields name = models.CharField(max_length=50) def __str__(self): return self.name @python_2_unicode_compatible cla...
bsd-3-clause
HuaweiSwitch/ansible
test/units/module_utils/test_postgresql.py
34
2863
import json import sys from ansible.compat.tests import unittest from ansible.compat.tests.mock import patch, MagicMock from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.six.moves import builtins from ansible.module_utils._text import to_native from units.mock.procenv import swap_stdin_an...
gpl-3.0
sinkuri256/python-for-android
python3-alpha/python3-src/Lib/test/test_compileall.py
51
14735
import sys import compileall import imp import os import py_compile import shutil import struct import subprocess import tempfile import time import unittest import io from test import support, script_helper class CompileallTests(unittest.TestCase): def setUp(self): self.directory = tempfile.mkdtemp() ...
apache-2.0
yishayv/lyacorr
extinction_correlation.py
1
10396
""" Computes the Lyman-alpha forest auto-correlation estimator. The work is split between MPI nodes based on the first QSO in each possible pair. Partial data is gathered and the correlation estimator file is saved after processing each sub-chunk. """ import cProfile import itertools import numpy as np fro...
mit
Mzero2010/MaxZone
plugin.video.Mzero/servers/videott.py
4
1830
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para videott # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import random import re from core import logger from c...
gpl-3.0
sebaleh/AliPhysics
PWGJE/EMCALJetTasks/Tracks/analysis/Draw/DrawRawSpectrumFit.py
41
2015
#************************************************************************** #* Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. * #* * #* Author: The ALICE Off-line Project. * #* Contributors ...
bsd-3-clause
cb1234/pynet-test
learnpy/class7/ex1a_cdp_parsing.py
1
1528
#!/usr/bin/env python ''' Create a program that opens the 'r1_cdp.txt' file and using regular expressions extracts the remote hostname, remote IP address, model, vendor, and device_type. ''' import re from pprint import pprint def generic_cdp_parser(pattern, cdp): ''' Search for pattern in the cdp data ...
apache-2.0
kaushik94/sympy
sympy/parsing/tests/test_maxima.py
2
1711
from sympy.parsing.maxima import parse_maxima from sympy import Rational, Abs, Symbol, sin, cos, E, oo, log, factorial from sympy.abc import x n = Symbol('n', integer=True) def test_parser(): assert Abs(parse_maxima('float(1/3)') - 0.333333333) < 10**(-5) assert parse_maxima('13^26') == 917333301932686166583...
bsd-3-clause
MarcJoan/django
tests/modeladmin/models.py
130
1603
# -*- coding: utf-8 -*- from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Band(models.Model): name = models.CharField(max_length=100) bio = models.TextField() sign_date = models.DateFiel...
bsd-3-clause
epeli/subssh
tests/test_assert_function_args.py
1
6487
''' Created on Mar 26, 2010 @author: epeli ''' import unittest from subssh.tools import assert_args from subssh import InvalidArguments class TestRequireArgumensWithFunctions(unittest.TestCase): def test_require_zero(self): def f(): pass assert_args(f, []) args = [...
agpl-3.0
idlead/scikit-learn
examples/neural_networks/plot_mlp_training_curves.py
56
3596
""" ======================================================== Compare Stochastic learning strategies for MLPClassifier ======================================================== This example visualizes some training loss curves for different stochastic learning strategies, including SGD and Adam. Because of time-constrai...
bsd-3-clause
roastduck/PyGram
t_PyGram.py
2
7843
""" This file provides unit testing for the different parts of the PQ-Gram algorithm. """ import PyGram, tree import unittest, random, itertools class ProfileCheck(unittest.TestCase): """ This class verifies that PyGram.Profile is executing properly. """ def checkProfileEquality(self,...
bsd-3-clause
PennartLoettring/Poettrix
rootfs/usr/lib/python3.4/email/charset.py
90
17219
# Copyright (C) 2001-2007 Python Software Foundation # Author: Ben Gertzfield, Barry Warsaw # Contact: email-sig@python.org __all__ = [ 'Charset', 'add_alias', 'add_charset', 'add_codec', ] from functools import partial import email.base64mime import email.quoprimime from email import errors fro...
gpl-2.0
tfmoraes/invesalius3
invesalius/gui/task_navigator.py
5
98510
#-------------------------------------------------------------------------- # Software: InVesalius - Software de Reconstrucao 3D de Imagens Medicas # Copyright: (C) 2001 Centro de Pesquisas Renato Archer # Homepage: http://www.softwarepublico.gov.br # Contact: invesalius@cti.gov.br # License: GNU ...
gpl-2.0
asnorkin/sentiment_analysis
site/lib/python2.7/site-packages/werkzeug/contrib/profiler.py
362
5151
# -*- coding: utf-8 -*- """ werkzeug.contrib.profiler ~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides a simple WSGI profiler middleware for finding bottlenecks in web application. It uses the :mod:`profile` or :mod:`cProfile` module to do the profiling and writes the stats to the stream provide...
mit
linked67/p2pool-lgc
SOAPpy/Types.py
289
52214
from __future__ import nested_scopes """ ################################################################################ # Copyright (c) 2003, Pfizer # Copyright (c) 2001, Cayce Ullman. # Copyright (c) 2001, Brian Matthews. # # All rights reserved. # # Redistribution and use in source and binary forms, with or withou...
gpl-3.0
eltonsantos/django
django/contrib/gis/geos/prototypes/errcheck.py
623
3522
""" Error checking functions for GEOS ctypes prototype functions. """ import os from ctypes import c_void_p, string_at, CDLL from django.contrib.gis.geos.error import GEOSException from django.contrib.gis.geos.libgeos import GEOS_VERSION from django.contrib.gis.geos.prototypes.threadsafe import GEOSFunc # Getting the...
bsd-3-clause
rhyolight/nupic
examples/opf/experiments/opfrunexperiment_test/simpleOPF/hotgym_no_agg/description.py
10
15037
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
agpl-3.0
SUSE/azure-sdk-for-python
azure-mgmt-network/azure/mgmt/network/v2017_06_01/models/network_management_client_enums.py
2
10623
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
colemanja91/PyEloqua-Examples
venv/lib/python3.4/site-packages/simple_salesforce/api.py
1
27063
"""Core classes and exceptions for Simple-Salesforce""" # has to be defined prior to login import DEFAULT_API_VERSION = '29.0' import requests import json try: from urlparse import urlparse except ImportError: # Python 3+ from urllib.parse import urlparse from simple_salesforce.login import SalesforceL...
gpl-2.0
kuiwei/edx-platform
lms/djangoapps/shoppingcart/processors/__init__.py
215
2574
""" Public API for payment processor implementations. The specific implementation is determined at runtime using Django settings: CC_PROCESSOR_NAME: The name of the Python module (in `shoppingcart.processors`) to use. CC_PROCESSOR: Dictionary of configuration options for specific processor implementations, ...
agpl-3.0
openstack/cinder
cinder/api/openstack/__init__.py
2
4873
# Copyright (c) 2013 OpenStack Foundation # # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unles...
apache-2.0
Sylrob434/CouchPotatoServer
libs/guessit/patterns.py
94
10301
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2011 Nicolas Wack <wackou@gmail.com> # Copyright (c) 2011 Ricard Marxer <ricardmp@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesse...
gpl-3.0
TAI-EPAM/JDI
Python/Test/jdi_uitests_webtests/test/composite/form_tests.py
3
1962
from JDI.jdi_assert.testing.assertion import Assert from Test.jdi_uitests_webtests.main.entities.contact import Contact from Test.jdi_uitests_webtests.main.enums.entities import Buttons from Test.jdi_uitests_webtests.main.enums.preconditions import Preconditions from Test.jdi_uitests_webtests.main.page_objects.epam_jdi...
gpl-3.0
GiggleLiu/nrg_mapping
doc/source/conf.py
1
9702
# -*- coding: utf-8 -*- # # NRGMapping documentation build configuration file, created by # sphinx-quickstart on Mon Sep 7 00:20:20 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # ...
mit
garverp/gnuradio
gr-qtgui/examples/pyqt_freq_c.py
38
6430
#!/usr/bin/env python # # Copyright 2012 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
vgrachev8/youtube-dl
youtube_dl/extractor/roxwel.py
9
2026
import re import json from .common import InfoExtractor from ..utils import unified_strdate, determine_ext class RoxwelIE(InfoExtractor): _VALID_URL = r'https?://www\.roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)' _TEST = { u'url': u'http://www.roxwel.com/player/passionpittakeawalklive.html', ...
unlicense
elfxwt/SpiderOfPython
main_simple.py
1
3003
# -*- coding: utf-8 -*- import requests import bs4 import time import codecs class Tool: def __init__(self,cityName): self.rootUrl = 'http://www.anjuke.com/' self.baseUrl = self.rootUrl + cityName + '/cm/' self.checkHref = self.rootUrl + cityName + '/' self.blUrlModle = 'http://'+cityName+'.anjuke.com/commu...
apache-2.0
caglar10ur/anvio
anvio/ccollections.py
1
8504
# -*- coding: utf-8 """Implements the collections class (the file name has an extra 'c' to avoid masking the standard collections library). If the user have analyzed their metagenome using a metagenome binning software and identified draft genomes in their data (or by any other means binned their contigs based on any...
gpl-3.0
clubcapra/Ibex
src/seagoatvision_ros/scripts/CapraVision/client/gtk/filters/implementation/WinMorphology.py
1
3720
#! /usr/bin/env python # Copyright (C) 2012 Club Capra - capra.etsmtl.ca # # This file is part of CapraVision. # # CapraVision 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 versio...
gpl-3.0
c0defreak/python-for-android
python3-alpha/python3-src/Lib/test/test_colorsys.py
98
2834
import unittest, test.support import colorsys def frange(start, stop, step): while start <= stop: yield start start += step class ColorsysTest(unittest.TestCase): def assertTripleEqual(self, tr1, tr2): self.assertEqual(len(tr1), 3) self.assertEqual(len(tr2), 3) self.as...
apache-2.0
rschatz/mx
mx_jackpot.py
2
3351
#!/usr/bin/env python2.7 # # ---------------------------------------------------------------------------------------------------- # # Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribut...
gpl-2.0
PongPi/isl-odoo
addons/website_sale/models/payment.py
137
1364
# -*- coding: utf-8 -*- from openerp import SUPERUSER_ID from openerp.osv import orm, fields class PaymentTransaction(orm.Model): _inherit = 'payment.transaction' _columns = { # link with the sale order 'sale_order_id': fields.many2one('sale.order', 'Sale Order'), } def form_feedbac...
agpl-3.0
mezz64/home-assistant
tests/components/bsblan/__init__.py
5
1279
"""Tests for the bsblan integration.""" from homeassistant.components.bsblan.const import ( CONF_DEVICE_IDENT, CONF_PASSKEY, DOMAIN, ) from homeassistant.const import CONF_HOST, CONF_PORT, CONTENT_TYPE_JSON from homeassistant.core import HomeAssistant from tests.common import MockConfigEntry, load_fixture...
apache-2.0
FrankBian/kuma
vendor/packages/translate-toolkit/translate/storage/test_zipfile.py
7
6252
#!/usr/bin/env python import zlib # implied prerequisite import zipfile, os, StringIO, tempfile from test.test_support import TestFailed from py import test from translate.misc import zipfileext BrokenStringIO = StringIO.StringIO class FixedStringIO(BrokenStringIO): def truncate(self, size=None): BrokenStr...
mpl-2.0
clm971910/googletest
xcode/Scripts/versiongenerate.py
3088
4536
#!/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...
bsd-3-clause
40223137/cdag7test37
static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_suite.py
791
12066
import unittest import sys from .support import LoggingResult, TestEquality ### Support code for Test_TestSuite ################################################################ class Test(object): class Foo(unittest.TestCase): def test_1(self): pass def test_2(self): pass def test_3(self...
gpl-3.0
musteryu/Data-Mining
assignment-黄煜-3120100937/question_4.py
1
1258
from mylib import * import os,sys import numpy as np import matplotlib.pyplot as plt import math import random from time import time if __name__ == '__main__': DIR_PATH = sys.path[0] + '\\' # normal distribution vector file nvctr_file1 = DIR_PATH + 'normal_500_1.txt' nvctr_file2 = DIR_PATH + 'normal_500_2.txt' #...
gpl-2.0
tipabu/swift
test/unit/common/middleware/s3api/test_s3api.py
1
61449
# Copyright (c) 2011-2014 OpenStack Foundation. # # 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 agre...
apache-2.0
samuknet/servo
ports/geckolib/binding_tools/regen_atoms.py
7
6142
#!/usr/bin/env python # 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/. import re import os def gnu_symbolify(source, ident): return "_ZN" + str(len(source.CLASS))...
mpl-2.0
kevinr/750book-web
750book-web-env/lib/python2.7/site-packages/pip-0.7.2-py2.7.egg/pip/commands/install.py
3
7798
import os from pip.req import InstallRequirement, RequirementSet from pip.req import parse_requirements from pip.log import logger from pip.locations import build_prefix, src_prefix from pip.basecommand import Command from pip.index import PackageFinder class InstallCommand(Command): name = 'install' usage = '...
mit
boundarydevices/android_external_chromium_org
third_party/protobuf/python/google/protobuf/internal/wire_format_test.py
571
10848
#! /usr/bin/python # # Protocol Buffers - Google's data interchange format # Copyright 2008 Google Inc. All rights reserved. # http://code.google.com/p/protobuf/ # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # ...
bsd-3-clause
duramato/CouchPotatoServer
libs/html5lib/trie/py.py
817
1763
from __future__ import absolute_import, division, unicode_literals from six import text_type from bisect import bisect_left from ._base import Trie as ABCTrie class Trie(ABCTrie): def __init__(self, data): if not all(isinstance(x, text_type) for x in data.keys()): raise TypeError("All keys m...
gpl-3.0
arvinsingla/CouchPotatoServer
libs/guessit/transfo/split_explicit_groups.py
150
1738
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 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
aps-sids/zulip
zerver/lib/narrow.py
123
1633
from zerver.decorator import JsonableError def check_supported_events_narrow_filter(narrow): for element in narrow: operator = element[0] if operator not in ["stream", "topic", "sender", "is"]: raise JsonableError("Operator %s not supported." % (operator,)) def build_narrow_filter(narr...
apache-2.0
OmgOhnoes/Flexget
flexget/api/app.py
2
13519
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import json import logging import os import re from collections import deque from functools import wraps from flask import Flask, request, jsonify, make_response from flas...
mit
peak6/st2
st2client/tests/unit/test_commands.py
6
11685
# Licensed to the StackStorm, Inc ('StackStorm') 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 use th...
apache-2.0
darrenbilby/grr
lib/rekall_profile_server_test.py
8
2994
#!/usr/bin/env python """Tests for the Rekall profile server.""" import urllib2 import zlib from rekall import constants from grr.lib import aff4 from grr.lib import config_lib from grr.lib import flags from grr.lib import rdfvalue from grr.lib import rekall_profile_server from grr.lib import test_lib from grr.lib ...
apache-2.0
larsbergstrom/servo
python/tidy/servo_tidy_tests/test_tidy.py
3
16426
# Copyright 2013 The Servo Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your #...
mpl-2.0
sibskull/synaptiks
scripts/try_keyboard_monitor.py
1
3711
#!/usr/bin/python2 # Copyright (c) 2010, 2011, Sebastian Wiesner <lunaryorn@googlemail.com> # All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the abov...
bsd-2-clause
listingmirror/boto
boto/ec2/__init__.py
145
3100
# Copyright (c) 2006-2008 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
tgoodlet/pluggy
testing/test_details.py
43
2753
import warnings import pytest from pluggy import PluginManager, HookimplMarker, HookspecMarker, _Result hookspec = HookspecMarker("example") hookimpl = HookimplMarker("example") def test_parse_hookimpl_override(): class MyPluginManager(PluginManager): def parse_hookimpl_opts(self, module_or_class, name...
mit
britcey/ansible
lib/ansible/modules/utilities/logic/async_status.py
56
3386
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others # # 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 ...
gpl-3.0
sriki18/scipy
benchmarks/benchmarks/io_matlab.py
48
3338
from __future__ import division, absolute_import, print_function from .common import set_mem_rlimit, run_monitored, get_mem_info import os import tempfile import collections from io import BytesIO import numpy as np try: from scipy.io import savemat, loadmat except ImportError: pass from .common import Benc...
bsd-3-clause
riddlezyc/geolab
src/structure/Z.py
1
1474
# -*- coding: utf-8 -*- # from framesplit import trajectory # too slow using this module import matplotlib.pyplot as plt dirName = r"F:\simulations\asphaltenes\na-mont\TMBO-oil\water\373-continue/" xyzName = 'all.xyz' hetero = 'O' # 'oh' 'N' 'sp' 'O' 'Np' 'sp' with open(dirName + xyzName, 'r') as f...
gpl-3.0
kylewm/oauth-dropins
twitter_auth.py
1
2312
"""Utility functions for generating Twitter OAuth headers and making API calls. """ import logging import urllib2 import appengine_config import handlers import requests import requests_oauthlib import tweepy def auth_header(url, token_key, token_secret, method='GET'): """Generates an Authorization header and ret...
unlicense
juergenhamel/cuon
cuon_client/cuon/Addresses/SingleScheduling.py
5
3563
# -*- coding: utf-8 -*- ##Copyright (C) [2003] [Jürgen Hamel, D-32584 Löhne] ##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 versi...
gpl-3.0
carthach/essentia
src/python/essentia/translate.py
1
24729
# Copyright (C) 2006-2016 Music Technology Group - Universitat Pompeu Fabra # # This file is part of Essentia # # Essentia 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 (FSF), either version 3 of the ...
agpl-3.0
sivikt/cassandra
pylib/cqlshlib/test/test_cqlsh_invocation.py
160
1941
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
fallen/milkymist-mmu
cores/softusb/navre_regress/test_opcodes/test_BCLR.py
4
2359
#! /usr/bin/env python ############################################################################### # # simulavr - A simulator for the Atmel AVR family of microcontrollers. # Copyright (C) 2001, 2002 Theodore A. Roth # # This program is free software; you can redistribute it and/or modify # it under the terms of th...
lgpl-3.0
aerickson/xbmc
addons/service.xbmc.versioncheck/service.py
58
3959
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Team-XBMC # # 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...
gpl-2.0
lakshayg/tensorflow
tensorflow/contrib/losses/__init__.py
41
1577
# 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
alephdata/aleph
aleph/views/xref_api.py
1
3909
import logging from flask import Blueprint, request from pantomime.types import XLSX from aleph.search import XrefQuery from aleph.logic.profiles import pairwise_judgements from aleph.logic.export import create_export from aleph.views.serializers import XrefSerializer from aleph.queues import queue_task, OP_XREF, OP_E...
mit
rbose85/bounce-cars
backend/bounce/settings/base.py
1
2389
import os from django.core.exceptions import ImproperlyConfigured def get_env_setting(setting): """Return the value of an environment variable, or raise an exception.""" try: return os.environ[setting] except KeyError: error_msg = "Set the {} env variable".format(setting) raise Im...
mit
ClovisIRex/Snake-django
env/lib/python3.6/site-packages/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...
mit
telwertowski/QGIS
python/plugins/processing/algs/grass7/ext/r_mask_rast.py
36
1842
# -*- coding: utf-8 -*- """ *************************************************************************** r_mask_rast.py -------------- Date : February 2016 Copyright : (C) 2016 by Médéric Ribreux Email : medspx at medspx dot fr ******************************...
gpl-2.0
rraadd88/dms2dfe
dms2dfe/lib/io_mut_class.py
2
9503
# Copyright 2017, Rohan Dandage <rraadd_8@hotmail.com,rohan@igib.in> # This program is distributed under General Public License v. 3. """ ================================ ``io_mut_files`` ================================ """ from __future__ import division import sys from os.path import splitext,exists,basename,absp...
gpl-3.0
andela-ooshodi/codango-debug
codango/account/migrations/0001_initial.py
1
1359
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings import cloudinary.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ ...
mit
kamyu104/LeetCode
Python/employee-importance.py
2
2490
# Time: O(n) # Space: O(h) # You are given a data structure of employee information, # which includes the employee's unique id, his importance value and his direct subordinates' id. # # For example, employee 1 is the leader of employee 2, and employee 2 is the leader of employee 3. # They have importance value 15, 10...
mit
bspink/django
django/db/migrations/topological_sort.py
538
1129
def topological_sort_as_sets(dependency_graph): """Variation of Kahn's algorithm (1962) that returns sets. Takes a dependency graph as a dictionary of node => dependencies. Yields sets of items in topological order, where the first set contains all nodes without dependencies, and each following set co...
bsd-3-clause
Denvi/FlatCAM
doc/source/conf.py
2
8265
# -*- coding: utf-8 -*- # # Cirkuix documentation build configuration file, created by # sphinx-quickstart on Fri Jan 24 22:13:35 2014. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # A...
mit
intgr/django
django/core/handlers/exception.py
15
4743
import logging import sys from functools import wraps from django.conf import settings from django.core import signals from django.core.exceptions import ( PermissionDenied, RequestDataTooBig, SuspiciousOperation, TooManyFieldsSent, ) from django.http import Http404 from django.http.multipartparser import Mult...
bsd-3-clause
bnbowman/HlaTools
src/pbhla/io/utils.py
1
4688
#! /usr/bin/env python from pbhla.filenames import get_file_type __author__ = 'bbowman@pacificbiosciences.com' import logging from tempfile import NamedTemporaryFile from pbcore.io.FastaIO import FastaRecord, FastaWriter from pbcore.io.FastqIO import FastqRecord, FastqWriter from pbhla.io.AmpAnalysisIO import Amplic...
bsd-3-clause
bright-sparks/nw.js
tools/aws_uploader.py
42
3658
#!/usr/bin/env python import argparse import boto import datetime import json import os import sys import time # Set timeout, for retry #if not boto.config.has_section('Boto'): # boto.config.add_section('Boto') #boto.config.set('Boto','http_socket_timeout','30') ################################ # Parse command li...
mit
stephen144/odoo
addons/mail/tests/test_mail_followers.py
27
7437
# -*- coding: utf-8 -*- from psycopg2 import IntegrityError from openerp.addons.mail.tests.common import TestMail class TestMailFollowers(TestMail): def setUp(self): super(TestMailFollowers, self).setUp() Subtype = self.env['mail.message.subtype'] self.mt_mg_def = Subtype.create({'name':...
agpl-3.0
alexandru/TheBuzzEngine
buzzengine/api/views.py
2
5507
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = "Alexandru Nedelcu" __email__ = "noreply@alexn.org" import hashlib import re from datetime import datetime, timedelta from django.utils import simplejson as json from google.appengine.api import mail from django.template.loader import get_template f...
mit
gmorph/MAVProxy
MAVProxy/modules/mavproxy_smartcamera/sc_video.py
4
6675
""" sc_video.py This file includes functions to: Initialise the camera Initialise the output video Image size is held in the smart_camera.cnf """ import sys from os.path import expanduser import time import math from multiprocessing import Process, Pipe import cv2 import sc_config class SmartCameraVideo: ...
gpl-3.0
jaume-pinyol/locust
locust/core.py
31
12806
import gevent from gevent import monkey, GreenletExit monkey.patch_all(thread=False) from time import time import sys import random import warnings import traceback import logging from clients import HttpSession import events from exception import LocustError, InterruptTaskSet, RescheduleTask, RescheduleTaskImmedia...
mit
zhengyongbo/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/steps/cleanworkingdirectory_unittest.py
124
3269
# Copyright (C) 2010 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
sputnick-dev/weboob
weboob/tools/value.py
4
8567
# -*- coding: utf-8 -*- # Copyright(C) 2010-2011 Romain Bignon # # This file is part of weboob. # # weboob is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your...
agpl-3.0
tkiethanom/splice
tests/api/test_authoring.py
3
5624
import calendar from datetime import datetime, timedelta from nose.tools import assert_equal from flask import url_for, json from mock import Mock, PropertyMock from tests.base import BaseTestCase from tests.test_scheduling import ScheduleTest import splice.ingest from splice.queries import ( get_scheduled_distribu...
mpl-2.0
alex/django-old
tests/regressiontests/admin_widgets/models.py
3
2172
from django.db import models from django.contrib.auth.models import User class MyFileField(models.FileField): pass class Member(models.Model): name = models.CharField(max_length=100) birthdate = models.DateTimeField(blank=True, null=True) gender = models.CharField(max_length=1, blank=True, choices=[...
bsd-3-clause
wellenreiter01/p2pool-neoscrypt
p2pool/bitcoin/networks/fastcoin.py
14
1186
import os import platform from twisted.internet import defer from .. import data, helper from p2pool.util import pack P2P_PREFIX = 'fbc0b6db'.decode('hex') P2P_PORT = 9526 ADDRESS_VERSION = 96 RPC_PORT = 9527 RPC_CHECK = defer.inlineCallbacks(lambda bitcoind: defer.returnValue( 'fastcoinaddress' in (yie...
gpl-3.0
nju520/youtube-dl
youtube_dl/extractor/malemotion.py
108
1423
# coding: utf-8 from __future__ import unicode_literals from .common import InfoExtractor from ..compat import compat_urllib_parse_unquote class MalemotionIE(InfoExtractor): _VALID_URL = r'https?://malemotion\.com/video/(.+?)\.(?P<id>.+?)(#|$)' _TEST = { 'url': 'http://malemotion.com/video/bete-de-co...
unlicense
SimenB/thefuck
tests/rules/test_pyenv_no_such_command.py
2
1859
import pytest from thefuck.rules.pyenv_no_such_command import get_new_command, match from thefuck.types import Command @pytest.fixture def output(pyenv_cmd): return "pyenv: no such command `{}'".format(pyenv_cmd) @pytest.fixture(autouse=True) def Popen(mocker): mock = mocker.patch('thefuck.rules.pyenv_no_s...
mit
pigeonflight/strider-plone
docker/appengine/lib/django-1.5/tests/regressiontests/http_utils/tests.py
52
1551
from __future__ import unicode_literals from django.http import HttpRequest, HttpResponse, StreamingHttpResponse from django.http.utils import conditional_content_removal from django.test import TestCase class HttpUtilTests(TestCase): def test_conditional_content_removal(self): """ Tests that co...
mit
jashort/clexp
tests/test_expenseList.py
1
2297
from unittest import TestCase import datetime from ExpenseList import ExpenseList class TestExpenseList(TestCase): def setUp(self): self.el = ExpenseList() # passing amount as a float is valid self.el.add_expense([2.11, "Food", "Candy Bar", "12/01/2013"]) # so is a string ...
mit
WDavidX/init
eplugins/epy/python-libs/rope/base/arguments.py
91
3296
import rope.base.evaluate from rope.base import ast class Arguments(object): """A class for evaluating parameters passed to a function You can use the `create_arguments` factory. It handles implicit first arguments. """ def __init__(self, args, scope): self.args = args self.sco...
lgpl-3.0
HiroIshikawa/21playground
thumblelog/myproject/lib/python3.5/site-packages/wheel/test/test_ranking.py
565
1496
import unittest from wheel.pep425tags import get_supported from wheel.install import WheelFile WHEELPAT = "%(name)s-%(ver)s-%(pyver)s-%(abi)s-%(arch)s.whl" def make_wheel(name, ver, pyver, abi, arch): name = WHEELPAT % dict(name=name, ver=ver, pyver=pyver, abi=abi, arch=arch) return WheelFile(name...
mit
felipebetancur/numpy
numpy/core/tests/test_defchararray.py
64
26901
from __future__ import division, absolute_import, print_function import sys import numpy as np from numpy.core.multiarray import _vec_string from numpy.compat import asbytes, asbytes_nested, sixu from numpy.testing import ( TestCase, run_module_suite, assert_, assert_equal, assert_array_equal ) kw_unicode_true =...
bsd-3-clause
couchbasedeps/git-repo
subcmds/checkout.py
3
1847
# -*- coding:utf-8 -*- # # Copyright (C) 2009 The Android Open Source Project # # 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 re...
apache-2.0