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
nowls/gnuradio
gr-blocks/python/blocks/qa_head.py
57
1502
#!/usr/bin/env python # # Copyright 2004,2007,2010,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 ...
gpl-3.0
geary/claslite
web/app/lib/simplejson/tests/test_unicode.py
65
4234
from unittest import TestCase import simplejson as json class TestUnicode(TestCase): def test_encoding1(self): encoder = json.JSONEncoder(encoding='utf-8') u = u'\N{GREEK SMALL LETTER ALPHA}\N{GREEK CAPITAL LETTER OMEGA}' s = u.encode('utf-8') ju = encoder.encode(u) js = en...
unlicense
crcresearch/osf.io
addons/box/models.py
4
8752
import httplib as http import logging import os import requests from addons.base.models import (BaseOAuthNodeSettings, BaseOAuthUserSettings, BaseStorageAddon) from box import BoxClient, CredentialsV2 from box.client import BoxClientException from django.db import models from framework....
apache-2.0
prasanna08/oppia
core/controllers/cron_test.py
1
14776
# Copyright 2019 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
apache-2.0
daniaki/pyPPI
pyppi/tests/test_predict.py
1
18250
import os import numpy as np from itertools import product from Bio import SwissProt from unittest import TestCase from ..database import create_session, delete_database, cleanup_database from ..database.models import Interaction, Protein from ..database.utilities import create_interaction from ..database.exceptions i...
mit
soarpenguin/ansible
lib/ansible/modules/windows/win_ping.py
22
1959
#!/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
moksha11/xen-hv
tools/python/xen/xend/XendNetwork.py
48
7501
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
DCSaunders/tensorflow
tensorflow/python/training/session_run_hook.py
9
8732
# 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
amitay/samba
source4/heimdal/lib/wind/gen-errorlist.py
35
3615
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
gpl-3.0
alicegraziosi/semaphore
app/node_modules/angular2-color-picker/node_modules/node-gyp/gyp/pylib/gyp/input_test.py
1841
3207
#!/usr/bin/env python # Copyright 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unit tests for the input.py file.""" import gyp.input import unittest import sys class TestFindCycles(unittest.TestCase): def setUp(self...
mit
jordy33/yowsup
yowsup/layers/auth/test_authenticator.py
53
1503
from yowsup.layers.auth import YowAuthenticationProtocolLayer from yowsup.layers import YowLayerEvent, YowLayerTest from yowsup.layers.auth.protocolentities import StreamFeaturesProtocolEntity,AuthProtocolEntity, ChallengeProtocolEntity from yowsup.structs import ProtocolTreeNode from yowsup.stacks import YowStack impo...
gpl-3.0
aroche/django
tests/template_tests/filter_tests/test_length.py
521
1900
from django.template.defaultfilters import length from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class LengthTests(SimpleTestCase): @setup({'length01': '{{ list|length }}'}) def test_length01(self): output = self.engine.render_to_string...
bsd-3-clause
40223246/0622cdb-Final-TEST2-1
static/Brython3.1.3-20150514-095342/Lib/test/test_re.py
718
56009
# FIXME: brython: implement test.support #from test.support import verbose, run_unittest, gc_collect, bigmemtest, _2G, \ # cpython_only verbose = True # FIXME: brython: Not used in this module ? #import io import re # FIXME: brython: implement re.Scanner #from re import Scanner import sre_constants import sys...
gpl-3.0
danbeam/catapult
third_party/beautifulsoup4/bs4/dammit.py
408
29302
# -*- coding: utf-8 -*- """Beautiful Soup bonus library: Unicode, Dammit This library converts a bytestream to Unicode through any means necessary. It is heavily based on code from Mark Pilgrim's Universal Feed Parser. It works best on XML and XML, but it does not rewrite the XML or HTML to reflect a new encoding; tha...
bsd-3-clause
vramiro/easy-wget-mirror
plugins/ChangeOwner.py
1
1241
import os from pwd import getpwnam from grp import getgrnam from MirrorPlugin import MirrorPlugin class ChangeOwnerException(Exception): pass class ChangeOwner(MirrorPlugin): def __init__(self, *args, **kwargs): try: m = kwargs['mirror'] config = kwargs['config'] supe...
mit
theflofly/tensorflow
tensorflow/python/autograph/converters/control_flow.py
1
18448
# 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
zsjohny/jumpserver
apps/ops/celery/decorator.py
3
2824
# -*- coding: utf-8 -*- # from functools import wraps _need_registered_period_tasks = [] _after_app_ready_start_tasks = [] _after_app_shutdown_clean_periodic_tasks = [] def add_register_period_task(task): _need_registered_period_tasks.append(task) def get_register_period_tasks(): return _need_registered_pe...
gpl-2.0
huoxudong125/poedit
deps/boost/tools/build/src/engine/bump_version.py
71
2821
#!/usr/bin/python # This script is used to bump the bjam version. It takes a single argument, e.g # # ./bump_version.py 3.1.9 # # and updates all the necessary files. # # Copyright 2006 Rene Rivera. # Copyright 2005-2006 Vladimir Prus. # Distributed under the Boost Software License, Version 1.0. # (See accompanying...
mit
zhuwenping/python-for-android
python3-alpha/python3-src/Lib/lib2to3/fixes/fix_set_literal.py
203
1697
""" Optional fixer to transform set() calls to set literals. """ # Author: Benjamin Peterson from lib2to3 import fixer_base, pytree from lib2to3.fixer_util import token, syms class FixSetLiteral(fixer_base.BaseFix): BM_compatible = True explicit = True PATTERN = """power< 'set' trailer< '(' ...
apache-2.0
GunoH/intellij-community
python/helpers/py3only/docutils/parsers/rst/directives/misc.py
44
22893
# $Id: misc.py 7487 2012-07-22 21:20:28Z milde $ # Authors: David Goodger <goodger@python.org>; Dethe Elza # Copyright: This module has been placed in the public domain. """Miscellaneous directives.""" __docformat__ = 'reStructuredText' import os.path import re import sys import time from docutils import io, nodes,...
apache-2.0
danielemichilli/SpS
sps/src/waterfaller/filterbank.py
1
10773
""" A module for reading filterbank files. Patrick Lazarus, June 26, 2012 (Minor modification from file originally from June 6th, 2009) """ import sys import warnings import os import os.path import numpy as np import sigproc import spectra DEBUG = False def create_filterbank_file(outfn, header, spectra=None, nbit...
mit
TeamOrion-Devices/Orion_kernel_motorola_msm8226
tools/perf/scripts/python/sctop.py
11180
1924
# system call top # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Periodically displays system-wide system call totals, broken down by # syscall. If a [comm] arg is specified, only syscalls called by # [comm] are displayed. If an [interval] arg is specified,...
gpl-2.0
Eigenlabs/EigenD
tools/packages/SCons/Sig.py
2
2341
# # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 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 limitati...
gpl-3.0
kidmaple/CoolWall
user/python/Lib/test/test_cfgparser.py
10
4272
import ConfigParser import StringIO def basic(src): print print "Testing basic accessors..." cf = ConfigParser.ConfigParser() sio = StringIO.StringIO(src) cf.readfp(sio) L = cf.sections() L.sort() print L for s in L: print "%s: %s" % (s, cf.options(s)) # The use of spac...
gpl-2.0
Jonekee/chromium.src
third_party/protobuf/python/google/protobuf/service_reflection.py
601
11010
# 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: # # * Redistributions o...
bsd-3-clause
christianurich/VIBe2UrbanSim
3rdparty/opus/src/urbansim/household_x_zone/is_DDD_persons_x_percent_size_DDD_persons.py
2
2026
# Opus/UrbanSim urban simulation software. # Copyright (C) 2005-2009 University of Washington # See opus_core/LICENSE from opus_core.variables.variable import Variable from urbansim.functions import attribute_label class is_DDD_persons_x_percent_size_DDD_persons(Variable): """Percent of households with D...
gpl-2.0
hansehe/Wind-Blade-Inspection
TestUnits/Test_src/Test_bin/Test_UserInput/Test_UserInput.py
1
1322
''' Author: Hans Erik Heggem Email: hans.erik.heggem@gmail.com Project: Master's Thesis - Autonomous Inspection Of Wind Blades Repository: Master's Thesis - CV (Computer Vision) ''' ################### UNIT TEST ######################## import unittest from Settings.TestData import TestData from TestUnits.Test_ma...
mit
devs1991/test_edx_docmode
common/lib/xmodule/xmodule/modulestore/tests/test_xml_importer.py
100
11947
""" Tests for XML importer. """ import mock from opaque_keys.edx.locator import BlockUsageLocator, CourseLocator from xblock.fields import String, Scope, ScopeIds, List from xblock.runtime import Runtime, KvsFieldData, DictKeyValueStore from xmodule.x_module import XModuleMixin from opaque_keys.edx.locations import Loc...
agpl-3.0
SBRG/ssbio
ssbio/test/test_pipeline_gempro.py
2
10016
import os.path as op import pytest from ssbio.pipeline.gempro import GEMPRO from ssbio.core.genepro import GenePro from ssbio.databases.kegg import KEGGProp from ssbio.databases.uniprot import UniProtProp from ssbio.databases.pdb import PDBProp from cobra.core import Model, DictList import cobra.manipulation @pytest....
mit
fvrmatteo/capstone
bindings/python/test_x86.py
2
6090
#!/usr/bin/env python # Capstone Python bindings, by Nguyen Anh Quynnh <aquynh@gmail.com> from __future__ import print_function from capstone import * from capstone.x86 import * from xprint import to_hex, to_x, to_x_32 X86_CODE64 = b"\x55\x48\x8b\x05\xb8\x13\x00\x00\x8f\xe8\x60\xcd\xe2\x07" X86_CODE16 = b"\x8d\x4c\x...
bsd-3-clause
koder-ua/nailgun-fcert
nailgun/nailgun/consts.py
2
2853
# -*- coding: utf-8 -*- # Copyright 2013 Mirantis, 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 requi...
apache-2.0
MaizerGomes/youtube-dl
test/test_swfinterp.py
158
2224
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import errno import io import json import re import subprocess from youtube_dl.swfinterp import SWFInterpreter ...
unlicense
nginxxx/blueprint
blueprint/frontend/bcfg2.py
4
10710
""" bcfg2 configuration generator. """ import codecs import logging import os import os.path import platform import re import sys import tarfile try: import lxml.etree except ImportError: print("The bcfg2 configuration generator requires the lxml python module") # bcfg2 writes xml, shell comments not underst...
bsd-2-clause
google/oauth2client
scripts/run_gce_system_tests.py
11
2001
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ...
apache-2.0
SKIRT/PTS
evolve/core/statistics.py
1
4547
#!/usr/bin/env python # -*- coding: utf8 -*- # ***************************************************************** # ** PTS -- Python Toolkit for working with SKIRT ** # ** © Astronomical Observatory, Ghent University ** # ***************************************************************** ##...
agpl-3.0
marc-sensenich/ansible
lib/ansible/plugins/inventory/ini.py
9
17490
# Copyright (c) 2017 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 DOCUMENTATION = ''' inventory: ini version_added: "2.4" short_description: Uses an Ansibl...
gpl-3.0
google-research/google-research
xirl/xirl/trainers/tcc.py
1
2653
# coding=utf-8 # Copyright 2021 The Google Research 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 applicab...
apache-2.0
h2oloopan/easymerge
EasyMerge/tests/scrapy/scrapy/tests/test_settings.py
7
3582
import unittest from scrapy.settings import Settings from scrapy.utils.test import get_crawler from scrapy.spider import Spider class SettingsTest(unittest.TestCase): def test_get(self): settings = Settings({ 'TEST_ENABLED1': '1', 'TEST_ENABLED2': True, 'TEST_ENABLED3'...
mit
asifmadnan/DIGITS
digits/utils/image.py
7
16502
# Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. import os.path import requests import cStringIO import PIL.Image import numpy as np import scipy.misc from . import is_url, HTTP_TIMEOUT, errors # Library defaults: # PIL.Image: # size -- (width, height) # np.array: # shape -- (hei...
bsd-3-clause
agrimaldi/metaseq
metaseq/plotutils.py
3
34743
""" Module with handy utilities for plotting genomic signal """ import itertools import matplotlib from matplotlib import pyplot as plt from matplotlib import mlab import numpy as np from matplotlib.ticker import MaxNLocator from mpl_toolkits.axes_grid1 import make_axes_locatable from matplotlib import gridspec import ...
mit
glovebx/odoo
addons/payment_transfer/models/payment_acquirer.py
27
3773
# -*- coding: utf-'8' "-*-" from openerp.addons.payment.models.payment_acquirer import ValidationError from openerp.osv import osv from openerp.tools.float_utils import float_compare from openerp.tools.translate import _ import logging import pprint _logger = logging.getLogger(__name__) class TransferPaymentAcquir...
agpl-3.0
nugget/home-assistant
homeassistant/components/mysensors/cover.py
10
3195
"""Support for MySensors covers.""" from homeassistant.components import mysensors from homeassistant.components.cover import ATTR_POSITION, DOMAIN, CoverDevice from homeassistant.const import STATE_OFF, STATE_ON async def async_setup_platform( hass, config, async_add_entities, discovery_info=None): """Se...
apache-2.0
toffaletti/libten
googletest/test/gtest_xml_test_utils.py
1815
8876
#!/usr/bin/env python # # Copyright 2006, 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
hfutsuchao/Python2.6
uvMonitor/seoUV.py
1
17262
#coding:utf-8 import html import time import json import sys from datetime import datetime,date from urllib import unquote #Login sso global crm params = {"UserName":"suchao","Domain":"@ganji.com","Password":"hFuT8141553561502"} url = "http://sso.ganji.com/Account/LogOn" crm = html.Html() crm.post(u...
gpl-2.0
zhjunlang/kbengine
kbe/res/scripts/common/Lib/ctypes/test/test_win32.py
59
4199
# Windows specific tests from ctypes import * import unittest, sys from test import support import _ctypes_test # Only windows 32-bit has different calling conventions. @unittest.skipUnless(sys.platform == "win32", 'Windows-specific test') @unittest.skipUnless(sizeof(c_void_p) == sizeof(c_int), ...
lgpl-3.0
Arable/evepod
lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/hooks/template_mako.py
4
1637
import newrelic.api.function_trace import newrelic.api.object_wrapper class TemplateRenderWrapper(object): def __init__(self, wrapped): self.__wrapped = wrapped def __getattr__(self, name): return getattr(self.__wrapped, name) def __get__(self, instance, klass): if instance is No...
apache-2.0
scality/cinder
cinder/backup/chunkeddriver.py
3
31663
# Copyright (C) 2012 Hewlett-Packard Development Company, L.P. # Copyright (c) 2014 TrilioData, Inc # Copyright (c) 2015 EMC Corporation # Copyright (C) 2015 Kevin Fox <kevin@efox.cc> # Copyright (C) 2015 Tom Barron <tpb@dyncloud.net> # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "Li...
apache-2.0
matthdsm/bioconda-recipes
recipes/emboss/fix_acd_path.py
7
4782
#!/usr/bin/env python import os import sys import shutil """ This script produces for every binary a new shell script similar to: -------------------------------------------- #!/bin/bash export EMBOSS_ACDROOT=../share/EMBOSS/acd/ export EMBOSS_DATA=../share/EMBOSS/data export PLPLOT_LIB=../share/EMBOSS _water "$@"...
mit
delinhabit/django
tests/mail/test_sendtestemail.py
327
3088
from __future__ import unicode_literals from django.core import mail from django.core.management import call_command from django.test import SimpleTestCase, override_settings @override_settings( ADMINS=(('Admin', 'admin@example.com'), ('Admin and Manager', 'admin_and_manager@example.com')), MANAGERS=(('Manag...
bsd-3-clause
Endika/edx-platform
lms/djangoapps/course_api/blocks/transformers/__init__.py
38
1989
""" Course API Block Transformers """ from .student_view import StudentViewTransformer from .block_counts import BlockCountsTransformer from .navigation import BlockNavigationTransformer class SupportedFieldType(object): """ Metadata about fields supported by different transformers """ def __init__( ...
agpl-3.0
JohnGeorgiadis/invenio
invenio/__init__.py
19
1124
# -*- coding: utf-8 -*- # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later v...
gpl-2.0
isle2983/bitcoin
qa/rpc-tests/test_framework/test_framework.py
5
10080
#!/usr/bin/env python3 # Copyright (c) 2014-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. """Base class for RPC testing.""" import logging import optparse import os import sys import shutil impor...
mit
bretlowery/snakr
lib/django/contrib/gis/forms/widgets.py
422
3659
from __future__ import unicode_literals import logging from django.conf import settings from django.contrib.gis import gdal from django.contrib.gis.geos import GEOSException, GEOSGeometry from django.forms.widgets import Widget from django.template import loader from django.utils import six, translation logger = log...
bsd-3-clause
catapult-project/catapult
third_party/mapreduce/mapreduce/third_party/crc32c.py
92
5182
#!/usr/bin/env python # # Copyright 2009 Google Inc. All Rights Reserved. """Implementation of CRC-32C checksumming as in rfc3720 section B.4. See http://en.wikipedia.org/wiki/Cyclic_redundancy_check for details on CRC-32C. This code is a manual python translation of c code generated by pycrc 0.7.1 (http://www.tty1....
bsd-3-clause
beni55/django-tastypie
tastypie/utils/mime.py
46
2105
from __future__ import unicode_literals import mimeparse from tastypie.exceptions import BadRequest def determine_format(request, serializer, default_format='application/json'): """ Tries to "smartly" determine which output format is desired. First attempts to find a ``format`` override from the reques...
bsd-3-clause
vaygr/ansible
lib/ansible/plugins/connection/docker.py
47
13329
# Based on the chroot connection plugin by Maykel Moya # # (c) 2014, Lorin Hochstein # (c) 2015, Leendert Brouwer (https://github.com/objectified) # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-...
gpl-3.0
Hasimir/pyjs
examples/gcharttestapp/TestGChart01.py
12
2917
import GChartTestAppUtil from pyjamas.chart.GChart import GChart from pyjamas.chart import GChartConsts from pyjamas.chart import AnnotationLocation from pyjamas.chart import SymbolType from pyjamas.ui.Button import Button msg = [["Check: all chart elements except labels red", "Check: missing image icon appears on p...
apache-2.0
drankye/arrow
python/pyarrow/tests/test_table.py
1
2477
# 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
rruebner/odoo
addons/mass_mailing/tests/__init__.py
121
1072
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms...
agpl-3.0
doraemonext/wechat-platform
wechat_platform/system/simulation/migrations/0001_initial.py
1
1119
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('official_account', '0001_initial'), ] operations = [ migrations.CreateModel( name='SimulationMatch', ...
bsd-2-clause
zarr12steven/paramiko
tests/test_auth.py
23
8503
# Copyright (C) 2008 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 # Software Foundation; either version 2.1 of the License, or (at you...
lgpl-2.1
Back2Basics/routeedu
bp_includes/external/babel/messages/pofile.py
54
16041
# -*- coding: utf-8 -*- # # Copyright (C) 2007 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://babel.edgewall.org/wiki/License. # # This software consists of v...
lgpl-3.0
mogoweb/chromium-crosswalk
third_party/python_gflags/setup.py
376
1991
#!/usr/bin/env python # Copyright (c) 2007, 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 l...
bsd-3-clause
encbladexp/ansible
lib/ansible/module_utils/facts/system/service_mgr.py
11
6453
# Collect facts related to system service manager and init. # # 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) a...
gpl-3.0
runt18/mojo
mojo/python/tests/validation_unittest.py
10
2684
# Copyright 2014 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. import logging import os import os.path import mojo_unittest import validation_test_interfaces_mojom # pylint: disable=E0611 import mojo_system as system f...
bsd-3-clause
koyuawsmbrtn/eclock
windows/Python27/Lib/site-packages/docutils/languages/he.py
148
2683
# Author: Meir Kriheli # Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language:...
gpl-2.0
jayvdb/coala
tests/processes/communication/LogMessageTest.py
34
3288
import unittest from datetime import datetime from coalib.misc import Constants from coalib.output.printers.LOG_LEVEL import LOG_LEVEL from coalib.processes.communication.LogMessage import LogMessage class LogMessageTest(unittest.TestCase): timestamp = datetime.today() def setUp(self): self.uut = Lo...
agpl-3.0
grantdelozier/TopoCluster
scripts/MoransV1.py
1
45111
import sys #sys.path.append('/home/02608/grantdel/pythonlib/lib/python2.7/site-packages') import psycopg2 import datetime import io import math import numpy from collections import Counter import KernelFunctionsV1 as KF import SuperDocument as sp import operator import random class Document: userID = "" ...
apache-2.0
cryptickp/python-neutronclient
neutronclient/tests/unit/vpn/test_cli20_ipsecpolicy.py
7
8365
# (c) Copyright 2013 Hewlett-Packard Development Company, L.P. # 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...
apache-2.0
jasrusable/fun
venv/lib/python2.7/site-packages/jinja2/parser.py
637
35186
# -*- coding: utf-8 -*- """ jinja2.parser ~~~~~~~~~~~~~ Implements the template parser. :copyright: (c) 2010 by the Jinja Team. :license: BSD, see LICENSE for more details. """ from jinja2 import nodes from jinja2.exceptions import TemplateSyntaxError, TemplateAssertionError from jinja2.lexer impo...
gpl-2.0
JohnnyKing94/pootle
pootle/apps/pootle_config/getters.py
9
1264
# -*- coding: utf-8 -*- # # Copyright (C) Pootle contributors. # # This file is a part of the Pootle project. It is distributed under the GPL3 # or later license. See the LICENSE file for a copy of the license and the # AUTHORS file for copyright and authorship information. from pootle.core.delegate import config from...
gpl-3.0
jfpla/odoo
openerp/addons/test_new_api/tests/test_domain.py
87
1672
# -*- coding: utf-8 -*- from openerp.tests import common class test_domain(common.TransactionCase): def setUp(self): super(test_domain, self).setUp() self.bool = self.env['domain.bool'] def test_00_test_bool_undefined(self): """ Check that undefined/empty values in database i...
agpl-3.0
loretoparisi/nupic
nupic/support/configuration_custom.py
21
10029
# ---------------------------------------------------------------------- # 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
Smiljanic/Esspresso-Code
doc/doxygen/gen_doxyconfig.py
15
1862
# Copyright (C) 2013,2014 The ESPResSo project # Copyright (C) 2012 Olaf Lenz # # This file is part of ESPResSo. # # ESPResSo 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
parthea/pydatalab
datalab/stackdriver/monitoring/_utils.py
2
1080
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
dkubiak789/OpenUpgrade
addons/gamification/models/res_users.py
386
4010
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms of the ...
agpl-3.0
acsone/project
project_stage_state/__openerp__.py
13
1425
# -*- coding: utf-8 -*- ############################################################################## # # Daniel Reis, 2014 # # This program 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, eith...
agpl-3.0
jalexvig/tensorflow
tensorflow/contrib/tensor_forest/python/ops/stats_ops.py
68
4686
# 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
zooniverse/SpaceWarps
analysis/swap/mongodb.py
1
12654
# ====================================================================== import numpy as np import os,sys,datetime try: from pymongo import MongoClient except: print "MongoDB: pymongo is not installed. You can still --practise though" # sys.exit() # Hard-coded for all Space Warps datasets: testGroup = '5154a...
gpl-2.0
polimediaupv/edx-platform
common/djangoapps/course_action_state/models.py
64
4602
""" Models for course action state If you make changes to this model, be sure to create an appropriate migration file and check it in at the same time as your model changes. To do that, 1. Go to the edx-platform dir 2. ./manage.py cms schemamigration course_action_state --auto description_of_your_change 3. It adds th...
agpl-3.0
mobb-io/django-erp
djangoerp/pluggets/tests/test_apps.py
1
1878
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import unicode_literals """This file is part of the django ERP project. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND...
mit
broferek/ansible
lib/ansible/modules/network/cloudengine/ce_bfd_global.py
13
21501
#!/usr/bin/python # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distribut...
gpl-3.0
codeb2cc/weather
monitor/utils.py
1
5697
# -*- coding:utf-8 -*- from __future__ import absolute_import, division, print_function, with_statement import math import logging import traceback from scipy import stats from PIL import Image, ImageDraw, ImageFilter logger = logging.getLogger('weather.monitor') logger.addHandler(logging.StreamHandler()) LEVEL_...
mit
BadSingleton/pyside2
tests/QtWidgets/qpen_test.py
3
1255
import unittest from helper import UsesQApplication from PySide2.QtCore import Qt, QTimer from PySide2.QtGui import QPen, QPainter from PySide2.QtWidgets import QWidget class Painting(QWidget): def __init__(self): QWidget.__init__(self) self.penFromEnum = None self.penFromInteger = None ...
lgpl-2.1
P2PHash/p2pool-deletecoin
p2pool/work.py
8
26135
from __future__ import division import base64 import random import re import sys import time from twisted.internet import defer from twisted.python import log import bitcoin.getwork as bitcoin_getwork, bitcoin.data as bitcoin_data from bitcoin import helper, script, worker_interface from util import forest, jsonrpc,...
gpl-3.0
duganchen/qmpdsocket
demo.py
1
2941
#!/usr/bin/env python from __future__ import (absolute_import, generators, nested_scopes, print_function, unicode_literals, with_statement) from sip import setapi setapi("QDate", 2) setapi("QDateTime", 2) setapi("QTextStream", 2) setapi("QTime", 2) setapi("QVariant", 2) setapi("QString", 2) se...
mit
alexlo03/ansible
lib/ansible/modules/system/service.py
26
61239
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2012, Michael DeHaan <michael.dehaan@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_METADATA = {'metadata_v...
gpl-3.0
klusark/android_external_chromium_org
build/protoc_java.py
90
1317
#!/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. """Generate java source files from protobufs Usage: protoc_java.py {protoc} {proto_path} {java_out} {stamp_file} {proto_files}...
bsd-3-clause
Sorsly/subtle
google-cloud-sdk/platform/gsutil/third_party/boto/boto/ec2/blockdevicemapping.py
149
6372
# Copyright (c) 2009-2012 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2012 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 wit...
mit
OmgOhnoes/Flexget
flexget/plugins/parsers/parser_internal.py
6
1607
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import time from flexget import plugin from flexget.event import event from flexget.utils.log import log_once from flexget.utils.titles.movie import MoviePa...
mit
Bionetbook/bionetbook
bnbapp/core/utils.py
2
3811
from django.core.exceptions import ObjectDoesNotExist # COMMON UNIT LISTS CONCENTRATION_UNITS = (("","None"),("ng/ul","nanogram / microliter"),("ug/ul","microgram / microliter"),("mg/ul","miligram / microliter"),("ug/ml",'microgram/mililiter'),("mg/ml","miligram / mililiter"), ("mg/l","miligram / liter"), ("g/ml",...
mit
garlandkr/ansible
lib/ansible/errors.py
46
1194
# (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
linkmyth/advance_medical
node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py
2736
6387
# 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. """Visual Studio project reader/writer.""" import gyp.common import gyp.easy_xml as easy_xml #-------------------------------------------------------------------...
mit
raymondnijssen/QGIS
python/plugins/processing/preconfigured/PreconfiguredAlgorithmDialog.py
17
4528
# -*- coding: utf-8 -*- """ *************************************************************************** PreconfiguredAlgorithmDialog.py --------------------- Date : April 2016 Copyright : (C) 2012 by Victor Olaya Email : volayaf at gmail dot com ***********...
gpl-2.0
procoder317/scikit-learn
examples/feature_selection/plot_rfe_with_cross_validation.py
226
1384
""" =================================================== Recursive feature elimination with cross-validation =================================================== A recursive feature elimination example with automatic tuning of the number of features selected with cross-validation. """ print(__doc__) import matplotlib.p...
bsd-3-clause
certik/pyjamas
examples/jsonrpc/public/services/simplejson/decoder.py
62
8840
""" Implementation of JSONDecoder """ import re from simplejson.scanner import Scanner, pattern FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): import struct import sys _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys.byteorder != 'big': _BYTES = _BYTES[:8...
apache-2.0
Sarah-Alsinan/muypicky
lib/python3.6/site-packages/django/contrib/gis/gdal/prototypes/raster.py
60
4370
""" This module houses the ctypes function prototypes for GDAL DataSource (raster) related data structures. """ from ctypes import POINTER, c_char_p, c_double, c_int, c_void_p from functools import partial from django.contrib.gis.gdal.libgdal import GDAL_VERSION, std_call from django.contrib.gis.gdal.prototypes.genera...
mit
ericholscher/invoke
tests/_utils.py
1
1235
import os, sys from contextlib import contextmanager from spec import trap, Spec, eq_ from mock import patch support = os.path.join(os.path.dirname(__file__), '_support') @contextmanager def support_path(): sys.path.insert(0, support) yield sys.path.pop(0) def load(name): with support_path(): ...
bsd-2-clause
alex/braid
braid/config.py
1
1780
""" Support for multiple environments based on python configuration files. """ from __future__ import print_function, absolute_import import os from twisted.python.filepath import FilePath from fabric.api import env, task from braid.settings import ENVIRONMENTS CONFIG_DIRS = [ '~/.config/braid', ] # FIXME: ...
mit
ChanChiChoi/scikit-learn
sklearn/utils/tests/test_shortest_path.py
88
2828
from collections import defaultdict import numpy as np from numpy.testing import assert_array_almost_equal from sklearn.utils.graph import (graph_shortest_path, single_source_shortest_path_length) def floyd_warshall_slow(graph, directed=False): N = graph.shape[0] #set nonzer...
bsd-3-clause