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 |
|---|---|---|---|---|---|
rex-xxx/mt6572_x201 | external/chromium/testing/gtest/test/gtest_xml_outfiles_test.py | 718 | 5312 | #!/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... | gpl-2.0 |
ygenc/onlineLDA | onlineldavb_new/build/scipy/scipy/special/tests/test_orthogonal.py | 4 | 9595 | from numpy.testing import assert_array_almost_equal, assert_almost_equal, \
rand, TestCase
import numpy as np
from numpy import array, sqrt
import scipy.special.orthogonal as orth
from scipy.special import gamma
class TestCheby(TestCase):
def test_chebyc(self):
C0 = orth.chebyc(0)
C1 = ort... | gpl-3.0 |
neverware/bios_pnp | make_vendor_list.py | 1 | 3833 | #! /usr/bin/env python
# Copyright 2016 Neverware Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | apache-2.0 |
orion1024/Sick-Beard | sickbeard/providers/cpasbien.py | 13 | 5625 | # -*- coding: latin-1 -*-
# Author: Guillaume Serre <guillaume.serre@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard 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 Softwar... | gpl-3.0 |
Pluto-tv/chromium-crosswalk | third_party/markdown/__init__.py | 109 | 17943 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
beck/django | django/db/migrations/autodetector.py | 67 | 56177 | from __future__ import unicode_literals
import datetime
import re
from itertools import chain
from django.conf import settings
from django.db import models
from django.db.migrations import operations
from django.db.migrations.migration import Migration
from django.db.migrations.operations.models import AlterModelOpti... | bsd-3-clause |
ApuliaSoftware/odoo | openerp/addons/base/report/preview_report.py | 447 | 1457 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of... | agpl-3.0 |
kybriainfotech/iSocioCRM | setup.py | 150 | 5628 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
from glob import glob
from setuptools import find_packages, setup
from os.path import join, dirname
execfile(join(dirname(__file__), 'openerp', 'release.py')) # Load release variables
lib_name = 'openerp'
def py2exe_datafiles():
data_files = {}... | agpl-3.0 |
maboss-YCMan/Doctopus | Doctopus/lib/transport.py | 1 | 3926 | # -*- coding: utf-8 -*-
import logging
import msgpack
import time
import sys
if sys.version_info[0] == 3 and sys.version_info[1] >= 5:
from Doctopus.lib.communication import Communication
else:
from Doctopus.lib.communication_2 import Communication
from Doctopus.lib.database_wrapper import InfluxdbWrapper, Re... | mit |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/third_party/python_26/Lib/test/test_slice.py | 56 | 4358 | # tests for slice objects; in particular the indices method.
import unittest
from test import test_support
from cPickle import loads, dumps
import sys
class SliceTest(unittest.TestCase):
def test_constructor(self):
self.assertRaises(TypeError, slice)
self.assertRaises(TypeError, slice, 1, 2, 3, ... | apache-2.0 |
seshin/namebench | nb_third_party/dns/renderer.py | 248 | 11865 | # Copyright (C) 2001-2007, 2009, 2010 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED ... | apache-2.0 |
vikas1885/test1 | lms/djangoapps/instructor/access.py | 16 | 3036 | """
Access control operations for use by instructor APIs.
Does not include any access control, be sure to check access before calling.
TO DO sync instructor and staff flags
e.g. should these be possible?
{instructor: true, staff: false}
{instructor: true, staff: true}
"""
import logging
from djan... | agpl-3.0 |
w1r0x/ansible | lib/ansible/plugins/lookup/env.py | 251 | 1071 | # (c) 2012, Jan-Piet Mens <jpmens(at)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) any later ver... | gpl-3.0 |
peterm-itr/edx-platform | lms/djangoapps/courseware/migrations/0001_initial.py | 194 | 8306 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'StudentModule'
db.create_table('courseware_studentmodule', (
('id', self.gf('django.d... | agpl-3.0 |
Gschlotter/planet.opensuse.org | libs/jinja/jinja2/utils.py | 5 | 25404 | # -*- coding: utf-8 -*-
"""
jinja2.utils
~~~~~~~~~~~~
Utility functions.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
import sys
import errno
try:
from thread import allocate_lock
except ImportError:
from dummy_thread import allocate_lo... | gpl-2.0 |
pwns4cash/vivisect | cobra/dcode.py | 7 | 3314 | """
Cobra's distributed code module capable of allowing
serialization of code from one system to another.
Particularly useful for clustering and workunit stuff.
"""
import os
import sys
import imp
import cobra
verbose = False
class DcodeServer:
def getPythonModule(self, fullname, path=None):
# Some s... | apache-2.0 |
stamhe/bitcoin | test/functional/mining_basic.py | 20 | 5582 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mining RPCs
- getmininginfo
- getblocktemplate proposal mode
- submitblock"""
import copy
from b... | mit |
ngcrawford/CloudForest | cloudforest/tests/test_phylip2oneliner.py | 2 | 2418 | import textwrap
import unittest
from cloudforest import phylip2oneliner
class TestPhylip2OnelinerFunctions(unittest.TestCase):
def setUp(self):
self.phylip = """\
10 430
mus_mus ----TCCTAG CTGAACAGAG AAGGGTGATT AACGATAGCA ATTTATTGTA
oto_gar GTAATCATAG TTGAACCGAG AAAGGTGATT AACGATAGCA ATTTATTGTA
cal_j... | bsd-3-clause |
Gitlab11/odoo | addons/auth_ldap/__init__.py | 442 | 1049 | ##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Publ... | agpl-3.0 |
jbedorf/tensorflow | tensorflow/python/keras/utils/multi_gpu_utils.py | 8 | 9468 | # 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 |
Teamxrtc/webrtc-streaming-node | third_party/depot_tools/third_party/pylint/checkers/python3.py | 57 | 20491 | # Copyright 2014 Google 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 2 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope... | mit |
geektoni/shogun | examples/undocumented/python/distance_manhattanword.py | 2 | 1105 | #!/usr/bin/env python
import shogun as sg
traindna = '../data/fm_train_dna.dat'
testdna = '../data/fm_test_dna.dat'
parameter_list = [[traindna,testdna,3,0,False],[traindna,testdna,4,0,False]]
def distance_manhattenword (train_fname=traindna,test_fname=testdna,order=3,gap=0,reverse=False):
charfeat=sg.create_string... | bsd-3-clause |
yamila-moreno/django | tests/db_functions/tests.py | 2 | 18258 | from __future__ import unicode_literals
from datetime import datetime, timedelta
from unittest import skipIf, skipUnless
from django.db import connection
from django.db.models import CharField, TextField, Value as V
from django.db.models.expressions import RawSQL
from django.db.models.functions import (
Coalesce,... | bsd-3-clause |
aabbox/kbengine | kbe/res/scripts/common/Lib/test/test_unpack_ex.py | 183 | 4137 | # Tests for extended unpacking, starred expressions.
doctests = """
Unpack tuple
>>> t = (1, 2, 3)
>>> a, *b, c = t
>>> a == 1 and b == [2] and c == 3
True
Unpack list
>>> l = [4, 5, 6]
>>> a, *b = l
>>> a == 4 and b == [5, 6]
True
Unpack implied tuple
>>> *a, = 7, 8, 9
>>... | lgpl-3.0 |
brownplt/k3 | dj-resume/resume/generate.py | 1 | 3738 | import resume.models as rmod
import random
import logging
from django.http import HttpResponse
from datetime import date
logger = logging.getLogger('default')
def generate(request):
cs_objs = rmod.Department.objects.filter(shortname='cs')
if len(cs_objs) == 0:
logger.info('created cs dept')
cs = rmod.Depa... | apache-2.0 |
canglade/NLP | storage/api/compose_objects.py | 7 | 2893 | #!/usr/bin/env python
# Copyright (C) 2013 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | apache-2.0 |
tashaxe/Red-DiscordBot | lib/chardet/sbcsgroupprober.py | 273 | 3546 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | gpl-3.0 |
sve-odoo/odoo | addons/l10n_be_hr_payroll/__init__.py | 438 | 1072 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2011 OpenERP SA (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the G... | agpl-3.0 |
ajylee/gpaw-rtxs | gpaw/test/bse_vs_lrtddft.py | 1 | 1334 | import numpy as np
from ase import Atom, Atoms
from ase.units import Hartree
from gpaw.mpi import size
from gpaw import GPAW
from gpaw.response.bse import BSE
GS = 1
bse = 1
casida = 1
compare = 1
if GS:
d = 2.89
cluster = Atoms([Atom('Na', (0, 0, 0)),
Atom('Na', (0, 0, d)),
... | gpl-3.0 |
Mendeley/breakpad | src/third_party/protobuf/protobuf/gtest/test/gtest_xml_outfiles_test.py | 718 | 5312 | #!/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 |
marratj/ansible | lib/ansible/plugins/strategy/free.py | 14 | 11816 | # (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 |
tysonclugg/django | django/contrib/sessions/backends/file.py | 5 | 7892 | import datetime
import logging
import os
import shutil
import tempfile
from contextlib import suppress
from django.conf import settings
from django.contrib.sessions.backends.base import (
VALID_KEY_CHARS, CreateError, SessionBase, UpdateError,
)
from django.contrib.sessions.exceptions import InvalidSessionKey
from... | bsd-3-clause |
kiith-sa/QGIS | python/plugins/GdalTools/tools/doProximity.py | 7 | 4877 | # -*- coding: utf-8 -*-
"""
***************************************************************************
doProximity.py
---------------------
Date : June 2010
Copyright : (C) 2010 by Giuseppe Sucameli
Email : brush dot tyler at gmail dot com
****************... | gpl-2.0 |
svalenti/pessto | trunk/src/ntt/efoscfastspecdef.py | 1 | 11439 |
def efoscfastredu(imglist, _listsens, _listarc, _ext_trace, _dispersionline, _cosmic, _interactive):
# print "LOGX:: Entering `efoscfastredu` method/function in %(__file__)s"
# % globals()
import string
import os
import re
import sys
os.environ["PYRAF_BETA_STATUS"] = "1"
try: from ... | mit |
dd00/commandergenius | project/jni/python/src/Lib/idlelib/OutputWindow.py | 67 | 4396 | from Tkinter import *
from EditorWindow import EditorWindow
import re
import tkMessageBox
import IOBinding
class OutputWindow(EditorWindow):
"""An editor window that can serve as an output file.
Also the future base class for the Python shell window.
This class has no input facilities.
"""
def _... | lgpl-2.1 |
aitoralmeida/dl_activity_recognition | lstm/data-framer.py | 1 | 15250 | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 11 14:38:48 2017
@author: gazkune
"""
from collections import Counter
import sys
from copy import deepcopy
import pandas as pd
from keras.utils import np_utils
from keras.preprocessing.sequence import pad_sequences
from keras.preprocessing.text import Tokenizer
from g... | gpl-3.0 |
t2y/learnnlp | NaturalLanguageProcessingWithPython/07/chunk_noun_phrase.py | 1 | 3354 | # -*- coding: utf-8 -*-
from __future__ import print_function
import sys
from janome.tokenizer import Tokenizer
tokenizer = Tokenizer()
def filter_word_class(text, word_classes=['名詞']):
d = {}
for i, token in enumerate(tokenizer.tokenize(text)):
word_class = token.part_of_speech.split(',')[0]
... | artistic-2.0 |
an7oine/WinVHS | Cygwin/lib/python2.7/site-packages/Crypto/Util/Counter.py | 132 | 5157 | # -*- coding: ascii -*-
#
# Util/Counter.py : Fast counter for use with CTR-mode ciphers
#
# Written in 2008 by Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# ===================================================================
# The contents of this file are dedicated to the public domain. To
# the extent that dedicati... | gpl-3.0 |
gedare/gem5 | tests/long/se/50.vortex/test.py | 23 | 1738 | # Copyright (c) 2006-2007 The Regents of The University of Michigan
# 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 ... | bsd-3-clause |
kushview/libjuce | waflib/Tools/ccroot.py | 40 | 26260 | #!/usr/bin/env python
# encoding: utf-8
# Thomas Nagy, 2005-2018 (ita)
"""
Classes and methods shared by tools providing support for C-like language such
as C/C++/D/Assembly/Go (this support module is almost never used alone).
"""
import os, re
from waflib import Task, Utils, Node, Errors, Logs
from waflib.TaskGen im... | gpl-2.0 |
ncbray/pystream | bin/analysis/ipa/model/objectname.py | 1 | 1105 | # Copyright 2011 Nicholas Bray
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... | apache-2.0 |
DCSaunders/tensorflow | tensorflow/python/lib/io/python_io.py | 29 | 1902 | # 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 |
NeuralEnsemble/neuroConstruct | lib/jython/Lib/test/test_ascii_formatd.py | 124 | 1919 | # PyOS_ascii_formatd is deprecated and not called from anywhere in
# Python itself. So this module is the only place it gets tested.
# Test that it works, and test that it's deprecated.
import unittest
from test.test_support import check_warnings, run_unittest, import_module
# Skip tests if _ctypes module does not e... | gpl-2.0 |
henriquemiranda/yambopy | yambopy/dbs/electronsdb.py | 3 | 9258 | # Copyright (c) 2016, Henrique Miranda
# All rights reserved.
#
# This file is part of the yambopy project
#
from netCDF4 import Dataset
import numpy as np
from itertools import product
import collections
ha2ev = 27.211396132
max_exp = 50
min_exp =-100.
def abs2(x):
return x.real**2 + x.imag**2
def fermi(e):
... | bsd-3-clause |
smsisko/Voodoo-Mock | pytest/pyvoodoo/expectations.py | 3 | 9193 | from pytestsuite import *
from pyvoodoo.ultimateobject import UltimateObject
from voodooexception import VoodooException
import pprint
class Call:
def __init__( self,
path,
paramExpectations,
returnValue,
kwargsExpectations = {},
hook = None,
bookmark = None ):
self._voodo... | gpl-2.0 |
globau/servo | tests/wpt/web-platform-tests/conformance-checkers/tools/dl.py | 107 | 4915 | # -*- coding: utf-8 -*-
import os
ccdir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
template = """<!DOCTYPE html>
<meta charset=utf-8>
"""
errors = {
"dl-in-p": "<p><dl><dt>text<dd>text</dl></p>",
"header-in-dt": "<dl><dt><header>text</header><dd>text</dl>",
"footer-in-dt": "<dl><dt><foot... | mpl-2.0 |
XiaosongWei/chromium-crosswalk | third_party/WebKit/Source/bindings/scripts/generate_init_partial_interfaces.py | 15 | 2948 | #!/usr/bin/python
# 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.
"""Generate initPartialInterfacesInModules(), which registers partial interfaces in modules to core interfaces."""
import cPickle as pickl... | bsd-3-clause |
shastikk/youtube-dl | youtube_dl/extractor/ynet.py | 105 | 1741 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
class YnetIE(InfoExtractor):
_VALID_URL = r'http://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html'
_TESTS = [
{... | unlicense |
rahushen/ansible | lib/ansible/utils/module_docs_fragments/inventory_cache.py | 82 | 1175 | # (c) 2017 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# inventory cache
DOCUMENTATION = """
options:
cache:
description:
- Toggle to enable/disable the caching of the inventory's source data, requir... | gpl-3.0 |
cpennington/edx-platform | lms/djangoapps/bulk_email/tests/test_tasks.py | 4 | 23098 | # -*- coding: utf-8 -*-
"""
Unit tests for LMS instructor-initiated background tasks.
Runs tasks on answers to course problems to validate that code
paths actually work.
"""
import json
from itertools import chain, cycle, repeat
from smtplib import SMTPAuthenticationError, SMTPConnectError, SMTPDataError, SMTPServe... | agpl-3.0 |
varunarya10/boto | boto/provider.py | 102 | 20925 | # Copyright (c) 2010 Mitch Garnaat http://garnaat.org/
# Copyright 2010 Google Inc.
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# Copyright (c) 2011, Nexenta Systems Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated document... | mit |
mollstam/UnrealPy | UnrealPyEmbed/Source/Python/Lib/python27/test/inspect_fodder2.py | 213 | 1279 | # line 1
def wrap(foo=None):
def wrapper(func):
return func
return wrapper
# line 7
def replace(func):
def insteadfunc():
print 'hello'
return insteadfunc
# line 13
@wrap()
@wrap(wrap)
def wrapped():
pass
# line 19
@replace
def gone():
pass
# line 24
oll = lambda m: m
# line... | mit |
Zeppen/xbmc-pvr-spotify | tools/Linux/FEH-ARM.py | 47 | 4395 | import os
import sys
import re
AvailableOutputs = []
Output = None
try:
from qt import *
AvailableOutputs.append("--error-output=Qt")
except:
pass
try:
import pygtk
pygtk.require('2.0')
import gtk
AvailableOutputs.append("--error-output=GTK")
except:
pass
try:
import pygame
imp... | gpl-2.0 |
dieb/algorithms.py | algorithms/sorting/counting.py | 1 | 1754 | # -*- coding: utf-8 -*-
from six.moves import range
__all__ = ('counting_sort',)
def counting_sort(array, k=None):
""" Integer sorting algorithm.
For each element in array, counts the number of elements that are less
than itself. E.g. if there are 18 elements less than element, then it
belongs on ... | mit |
PeterWangIntel/chromium-crosswalk | tools/perf/profile_creators/small_profile_extender.py | 5 | 1448 | # 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.
import page_sets
from profile_creators import fast_navigation_profile_extender
class SmallProfileExtender(
fast_navigation_profile_extender.FastNaviga... | bsd-3-clause |
cryptovein/p2pool-mintcoin | p2pool/p2p.py | 147 | 27992 | from __future__ import division
import math
import random
import sys
import time
from twisted.internet import defer, protocol, reactor
from twisted.python import failure, log
import p2pool
from p2pool import data as p2pool_data
from p2pool.bitcoin import data as bitcoin_data
from p2pool.util import deferral, p2proto... | gpl-3.0 |
sander76/home-assistant | tests/components/nest/test_init_sdm.py | 6 | 4645 | """
Test for setup methods for the SDM API.
The tests fake out the subscriber/devicemanager and simulate setup behavior
and failure modes.
"""
import logging
from unittest.mock import patch
from google_nest_sdm.exceptions import AuthException, GoogleNestException
from homeassistant.components.nest import DOMAIN
fro... | apache-2.0 |
sinremite/sinremite.github.io | node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/common.py | 1292 | 20063 | # 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 __future__ import with_statement
import collections
import errno
import filecmp
import os.path
import re
import tempfile
import sys
# A minimal memoizing d... | mit |
brennanblue/unit_tests | run_tests.py | 1 | 1222 | #!/usr/bin/env python
import unittest
from src.convert import kilometers_to_miles, miles_to_kilometers, \
years_to_minutes, minutes_to_years, inches_to_cm, cm_to_inches
class TestConvert(unittest.TestCase):
def test_km_to_miles(self):
actual = kilometers_to_miles(1)
expected = 0.621 # general kno... | cc0-1.0 |
google/google-ctf | third_party/edk2/AppPkg/Applications/Python/Python-2.7.2/Lib/test/test_ascii_formatd.py | 13 | 1977 | # PyOS_ascii_formatd is deprecated and not called from anywhere in
# Python itself. So this module is the only place it gets tested.
# Test that it works, and test that it's deprecated.
import unittest
from test.test_support import check_warnings, run_unittest, import_module
# Skip tests if _ctypes module doe... | apache-2.0 |
idovear/odoo | openerp/addons/base/module/wizard/__init__.py | 365 | 1250 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 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 |
ArmlessJohn404/calcuMLator | server.py | 1 | 1075 | from flask import Flask, render_template, request, redirect, url_for, jsonify
from calcuMLator import estimate
app = Flask(__name__, static_folder="docs")
op_strings = estimate.conf['types']
method_strings = estimate.conf['estimators']
@app.route('/')
def index():
return app.send_static_file('index.html')
@app... | gpl-3.0 |
dr0pz0ne/sibble | lib/ansible/utils/vars.py | 6 | 4477 | # (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 |
shaufi/odoo | openerp/addons/base/res/res_users.py | 70 | 46571 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2014 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
google/trimmed_match | trimmed_match/design/tests/matched_pairs_rmse_test.py | 1 | 12029 | # Copyright 2020 Google 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,... | apache-2.0 |
p4datasystems/CarnotKE | jyhton/lib-python/2.7/ctypes/test/test_cast.py | 81 | 3212 | from ctypes import *
import unittest
import sys
class Test(unittest.TestCase):
def test_array2pointer(self):
array = (c_int * 3)(42, 17, 2)
# casting an array to a pointer works.
ptr = cast(array, POINTER(c_int))
self.assertEqual([ptr[i] for i in range(3)], [42, 17, 2])
i... | apache-2.0 |
Qusic/ycmd | ycmd/completers/cpp/flags.py | 2 | 23081 | # Copyright (C) 2011, 2012 Google Inc.
#
# This file is part of ycmd.
#
# ycmd 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.
#
# ycmd... | gpl-3.0 |
kionetworks/openstack-dashboard-havana | openstack_dashboard/openstack/common/notifier/rpc_notifier2.py | 19 | 1969 | # 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.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
sudheesh001/oh-mainline | vendor/packages/PyYaml/tests/lib/test_input_output.py | 55 | 6210 |
import yaml
import codecs, StringIO, tempfile, os, os.path
def _unicode_open(file, encoding, errors='strict'):
info = codecs.lookup(encoding)
if isinstance(info, tuple):
reader = info[2]
writer = info[3]
else:
reader = info.streamreader
writer = info.streamwriter
srw = ... | agpl-3.0 |
cmdunkers/DeeperMind | PythonEnv/lib/python2.7/site-packages/pip/commands/search.py | 323 | 4604 | from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.download import PipXmlrpcTransport
from pip.index import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from pip.exceptions import CommandError
... | bsd-3-clause |
Eynaliyev/meteor | examples/unfinished/python-ddp-client/ddp-client.py | 169 | 10313 | #!/usr/bin/env python2.7
import sys
import json
import time
import argparse
import thread
import threading
import traceback
from ws4py.client.threadedclient import WebSocketClient
from cmd import Cmd
DDP_VERSIONS = ["pre1"]
def log(msg):
"""A shortcut to write to the standard error file descriptor"""
sys.s... | mit |
crakensio/django_training | lib/python2.7/site-packages/debug_toolbar/panels/sql/forms.py | 36 | 2784 | from __future__ import absolute_import, unicode_literals
import json
import hashlib
from django import forms
from django.conf import settings
from django.db import connections
from django.utils.encoding import force_text
from django.utils.functional import cached_property
from django.core.exceptions import Validation... | cc0-1.0 |
nikhilprathapani/python-for-android | python-modules/pybluez/bluetooth/btcommon.py | 68 | 13317 | import sys
import struct
import binascii
L2CAP=0
RFCOMM=3
PORT_ANY=0
# Service Class IDs
SDP_SERVER_CLASS = "1000"
BROWSE_GRP_DESC_CLASS = "1001"
PUBLIC_BROWSE_GROUP = "1002"
SERIAL_PORT_CLASS = "1101"
LAN_ACCESS_CLASS = "1102"
DIALUP_NET_CLASS = "1103"
IRMC_SYNC_CLASS = "1104"
OBEX_OBJPUSH_CLASS = "1105"
OBEX_FILET... | apache-2.0 |
kleetus/bitcoin | contrib/devtools/clang-format-diff.py | 90 | 6192 | #!/usr/bin/env python
#
#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License.
#
# ===========================================================... | mit |
SysMa/audit | auparse/test/auparse_test.py | 11 | 9542 | #!/usr/bin/env python
import os
srcdir = os.getenv('srcdir')
buf = ["type=LOGIN msg=audit(1143146623.787:142): login pid=2027 uid=0 old auid=4294967295 new auid=848\ntype=SYSCALL msg=audit(1143146623.875:143): arch=c000003e syscall=188 success=yes exit=0 a0=7fffffa9a9f0 a1=3958d11333 a2=5131f0 a3=20 items=1 pid=2027 ... | gpl-2.0 |
JamesMura/elections | apollo/frontend/filters.py | 1 | 15783 | from ..core import CharFilter, ChoiceFilter, FilterSet
from ..helpers import _make_choices
from ..submissions.models import FLAG_CHOICES, STATUS_CHOICES
from ..wtforms_ext import ExtendedSelectField, ExtendedMultipleSelectField
from .helpers import get_event
from collections import defaultdict, OrderedDict
from dateuti... | gpl-3.0 |
binoculars/osf.io | tests/test_events.py | 18 | 34350 | from collections import OrderedDict
import mock
from nose.tools import *
from website.notifications.events.base import Event, register, event_registry
from website.notifications.events.files import (
FileAdded, FileRemoved, FolderCreated, FileUpdated,
AddonFileCopied, AddonFileMoved, AddonFileRenamed,
)
from ... | apache-2.0 |
svn2github/audacity | lib-src/lv2/lv2/waflib/extras/doxygen.py | 105 | 4815 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
from fnmatch import fnmatchcase
import os,os.path,re,stat
from waflib import Task,Utils,Node,Logs
from waflib.TaskGen import feature
DOXY_STR='${DOXYGEN} - '
DOXY_FMTS='html l... | gpl-2.0 |
jobiols/server-tools | profiler/controllers/main.py | 7 | 8824 | # coding: utf-8
# License AGPL-3 or later (http://www.gnu.org/licenses/lgpl).
# Copyright 2014 Anybox <http://anybox.fr>
# Copyright 2016 Vauxoo (https://www.vauxoo.com) <info@vauxoo.com>
import errno
import logging
import os
import sys
import tempfile
from cStringIO import StringIO
from datetime import datetime
from ... | agpl-3.0 |
dhacker29/android_kernel_nokia_normandy | tools/perf/scripts/python/net_dropmonitor.py | 1258 | 1562 | # Monitor the system for dropped packets and proudce a report of drop locations and counts
import os
import sys
sys.path.append(os.environ['PERF_EXEC_PATH'] + \
'/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
from perf_trace_context import *
from Core import *
from Util import *
drop_log = {}
kallsyms = []
def... | gpl-2.0 |
achang97/YouTunes | lib/python2.7/site-packages/chardet/big5freq.py | 342 | 31254 | ######################## 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... | mit |
nicky-ji/edx-nicky | common/lib/xmodule/xmodule/tests/test_resource_templates.py | 242 | 1418 | """
Tests for xmodule.x_module.ResourceTemplates
"""
import unittest
from xmodule.x_module import ResourceTemplates
class ResourceTemplatesTests(unittest.TestCase):
"""
Tests for xmodule.x_module.ResourceTemplates
"""
def test_templates(self):
expected = set([
'latex_html.yaml',
... | agpl-3.0 |
df-a/par-nl | node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py | 327 | 132617 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ntpath
import os
import posixpath
import re
import subprocess
import sys
import gyp.common
import gyp.easy_xml as easy_xml
import gyp.generator... | mpl-2.0 |
rtindru/django | tests/m2m_regress/models.py | 358 | 2826 | from django.contrib.auth import models as auth
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# No related name is needed here, since symmetrical relations are not
# explicitly reversible.
@python_2_unicode_compatible
class SelfRefer(models.Model):
name = models.CharFie... | bsd-3-clause |
GiggleLiu/tba | hgen/tests/test_kron.py | 1 | 1935 | from numpy import *
from numpy.testing import dec,assert_,assert_raises,assert_almost_equal,assert_allclose
from matplotlib.pyplot import *
from numpy.linalg import eigh,eigvalsh
from scipy import sparse as sps
from scipy.sparse.linalg import eigsh
import time,pdb,sys
sys.path.insert(0,'../')
from tba.hgen import Spac... | gpl-2.0 |
tchernomax/ansible | test/units/modules/network/aruba/aruba_module.py | 73 | 2508 | # (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is dis... | gpl-3.0 |
PerkinsRay/pox | pox/proto/arp_helper.py | 38 | 7649 | # Copyright 2011,2012,2013 James McCauley
#
# 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 t... | apache-2.0 |
yuehaowang/pylash_engine | setup.py | 1 | 1508 | import os
from setuptools import setup, find_packages
setup(
name="pylash_engine",
version="2.0.0a1",
author="Yuehao Wang",
author_email="wangyuehao1999@gmail.com",
license="MIT",
description="A lightweight and relaxed game engine for Python.",
long_description=open(os.path.join(os.path.di... | mit |
chauhanhardik/populo | lms/djangoapps/shoppingcart/migrations/0022_auto__add_field_registrationcoderedemption_course_enrollment__add_fiel.py | 110 | 18922 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'RegistrationCodeRedemption.course_enrollment'
db.add_column('shoppingcart_registrationcodere... | agpl-3.0 |
jkent/jkent-pybot | pybot/plugins/plugin.py | 2 | 1527 | # -*- coding: utf-8 -*-
# vim: set ts=4 et
from plugin import *
class Plugin(BasePlugin):
default_level = 900
@hook
def plugin_list_trigger(self, msg):
names = ', '.join(self.bot.plugins.list())
msg.reply(names)
@hook
def plugin_load_trigger(self, msg, args):
try:
... | mit |
Zord13appdesa/python-for-android | python-modules/twisted/twisted/conch/checkers.py | 59 | 9838 | # -*- test-case-name: twisted.conch.test.test_checkers -*-
# Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Provide L{ICredentialsChecker} implementations to be used in Conch protocols.
"""
import os, base64, binascii, errno
try:
import pwd
except ImportError:
pwd = None
e... | apache-2.0 |
theflofly/tensorflow | tensorflow/python/ops/parallel_for/__init__.py | 52 | 1204 | # 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 required by applica... | apache-2.0 |
openstate/yournextrepresentative | elections/uk_general_election_2015/mapit.py | 2 | 1729 | # coding=utf-8
import re
import requests
from django.conf import settings
from django.core.cache import cache
from django.utils.http import urlquote
from django.utils.translation import ugettext as _
from candidates.mapit import (
BaseMapItException, BadPostcodeException, UnknownMapitException
)
class NoConst... | agpl-3.0 |
AaronLeeee/stardict-3 | tools/src/extractKangXi.py | 45 | 1860 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import sys, os, string, re, glob
import libxml2dom
fencoding = 'utf-8'
whattoextract = u'康熙字典'
#def TextInNode(node):
# result = u''
# for child in node.childNodes:
# if child.nodeType == child.TEXT_NODE:
# result += child.nodeValue
# else:
# result += TextInNode(child)
... | gpl-3.0 |
ndchorley/scipy | scipy/weave/examples/vq.py | 100 | 9312 | """
"""
from __future__ import absolute_import, print_function
# C:\home\ej\wrk\scipy\weave\examples>python vq.py
# vq with 1000 observation, 10 features and 30 codes fo 100 iterations
# speed in python: 0.150119999647
# [25 29] [ 2.49147266 3.83021032]
# speed in standard c: 0.00710999965668
# [25 29] [ 2.49147266... | bsd-3-clause |
studybuffalo/rdrhc_calendar | modules/assemble_schedule.py | 1 | 17569 | """Extracts and organizes a users schedule details."""
from datetime import datetime, timedelta
import json
import logging
from decimal import Decimal
import requests
from modules.custom_exceptions import ScheduleError
from modules.extract_schedule import generate_raw_schedule
from modules.utils import convert_durat... | gpl-3.0 |
PeterDSteinberg/webapp-public | webapp/apps/taxbrain/migrations/0022_auto_20141021_1954.py | 3 | 1104 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('taxbrain', '0021_auto_20141021_1954'),
]
operations = [
migrations.AddField(
model_name='grossincomeinputs',
... | mit |
plncoin/PLNcoin_Core | qa/rpc-tests/bip68-112-113-p2p.py | 41 | 27358 | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from test_framework.test_framework import ComparisonTestFramework
from test_framework.util import *
from ... | mit |
jgravois/developer-support | python/general-python/create-oauth-application/create-application.py | 15 | 2770 | import sys, os, urllib, urllib2, json, httplib, ssl
#####Parameters or Variables Start#####
#NOTE FOR THIS TO WORK THE USER (AKA userName) MUST HAVE ADMIN PERMISSIONS
portalUrl = "https://arcgis.com"
userName = "XXXXX"
password = "XXXXX"
####Parameters or Variables End######
def generateToken(username, passwor... | apache-2.0 |
auduny/home-assistant | homeassistant/components/hunterdouglas_powerview/scene.py | 7 | 2993 | """Support for Powerview scenes from a Powerview hub."""
import logging
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.components.scene import Scene, DOMAIN
from homeassistant.const import CONF_PLATFORM
from homeassistant.helpers.aiohttp_client import async_get_client... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.