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 |
|---|---|---|---|---|---|
Kazade/NeHe-Website | google_appengine/lib/protorpc/protorpc/webapp/service_handlers.py | 2 | 28703 | #!/usr/bin/env python
#
# Copyright 2010 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 applicable law o... | bsd-3-clause |
dvliman/jaikuengine | .google_appengine/lib/django-1.4/tests/regressiontests/localflavor/se/tests.py | 33 | 6441 | # -*- coding: utf-8 -*-
from django.contrib.localflavor.se.forms import (SECountySelect,
SEOrganisationNumberField, SEPersonalIdentityNumberField,
SEPostalCodeField)
import datetime
from django.test import SimpleTestCase
class SELocalFlavorTests(SimpleTestCase):
def setUp(self):
# Mocking dateti... | apache-2.0 |
scripni/rethinkdb | test/rql_test/connections/http_support/flask/debughelpers.py | 777 | 3508 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string
class UnexpectedUnicodeError(AssertionEr... | agpl-3.0 |
odicraig/kodi2odi | addons/plugin.program.super.favourites/selector.py | 2 | 2421 | #
# Copyright (C) 2014-2015
# Sean Poyser (seanpoyser@gmail.com)
#
# 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, or (at your option)
# any later versio... | gpl-3.0 |
kumajaya/android_kernel_samsung_universal5422 | tools/perf/tests/attr.py | 3174 | 9441 | #! /usr/bin/python
import os
import sys
import glob
import optparse
import tempfile
import logging
import shutil
import ConfigParser
class Fail(Exception):
def __init__(self, test, msg):
self.msg = msg
self.test = test
def getMsg(self):
return '\'%s\' - %s' % (self.test.path, self.msg)... | gpl-2.0 |
jelugbo/hebs_master | common/djangoapps/student/tests/test_create_account.py | 15 | 5962 | "Tests for account creation"
import ddt
import unittest
from django.contrib.auth.models import User
from django.test.client import RequestFactory
from django.conf import settings
from django.core.urlresolvers import reverse
from django.contrib.auth.models import AnonymousUser
from django.utils.importlib import import_... | agpl-3.0 |
Iconoclasteinc/tgit | test/test_announcer.py | 1 | 1124 | import pytest
from flexmock import flexmock
from tgit.announcer import Announcer
pytestmark = pytest.mark.unit
class Listener(object):
def event_occurred(self, event):
pass
@pytest.fixture
def announcer():
return Announcer()
@pytest.fixture
def event():
return "event"
def test_announces_to... | gpl-3.0 |
kamyu104/django | tests/auth_tests/test_decorators.py | 279 | 4124 | from django.conf import settings
from django.contrib.auth import models
from django.contrib.auth.decorators import login_required, permission_required
from django.core.exceptions import PermissionDenied
from django.http import HttpResponse
from django.test import TestCase, override_settings
from django.test.client impo... | bsd-3-clause |
nirmeshk/oh-mainline | vendor/packages/requests/requests/compat.py | 1039 | 1469 | # -*- coding: utf-8 -*-
"""
pythoncompat
"""
from .packages import chardet
import sys
# -------
# Pythons
# -------
# Syntax sugar.
_ver = sys.version_info
#: Python 2.x?
is_py2 = (_ver[0] == 2)
#: Python 3.x?
is_py3 = (_ver[0] == 3)
try:
import simplejson as json
except (ImportError, SyntaxError):
# si... | agpl-3.0 |
renyi533/tensorflow | tensorflow/python/data/util/options.py | 22 | 4914 | # 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 |
ksmaheshkumar/grr | parsers/ie_history.py | 8 | 5599 | #!/usr/bin/env python
# Copyright 2011 Google Inc. All Rights Reserved.
"""Parser for IE index.dat files.
Note that this is a very naive and incomplete implementation and should be
replaced with a more intelligent one. Do not implement anything based on this
code, it is a placeholder for something real.
For anyone w... | apache-2.0 |
KNMI/VERCE | verce-hpc-pe/src/networkx/generators/tests/test_degree_seq.py | 61 | 5734 | #!/usr/bin/env python
from nose.tools import *
import networkx
from networkx import *
from networkx.generators.degree_seq import *
from networkx.utils import uniform_sequence,powerlaw_sequence
def test_configuration_model_empty():
# empty graph has empty degree sequence
deg_seq=[]
G=configuration_model(deg... | mit |
lewixliu/git-repo | subcmds/upload.py | 4 | 21890 | # -*- coding:utf-8 -*-
#
# Copyright (C) 2008 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 |
TeradataCenterForHadoop/ambari-presto-service | tests/test_worker.py | 2 | 5422 | # -*- coding: utf-8 -*-
#
# 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, software
... | apache-2.0 |
adsabs/ADSPipelineMsg | adsmsg/protobuf/status_pb2.py | 1 | 2108 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: status.proto
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
fr... | agpl-3.0 |
edx/edx-ora | peer_grading/migrations/0007_auto__add_unique_calibrationhistory_student_id_location.py | 1 | 5423 | # -*- 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 unique constraint on 'CalibrationHistory', fields ['student_id', 'location']
db.create_unique('peer... | agpl-3.0 |
rohitwaghchaure/erpnext_develop | erpnext/healthcare/doctype/physician/test_physician.py | 5 | 1077 | # -*- coding: utf-8 -*-
# Copyright (c) 2015, ESS LLP and Contributors
# See license.txt
from __future__ import unicode_literals
import unittest
import frappe
test_dependencies = ['Physician Schedule']
class TestPhysician(unittest.TestCase):
def tearDown(self):
frappe.delete_doc_if_exists('Physician', '_Testdocto... | gpl-3.0 |
mads-bertelsen/McCode | meta-pkgs/windows/Support/gnuplot-py-1.8/__init__.py | 4 | 6268 | #! /usr/bin/env python
# $Id: __init__.py 306 2008-05-02 01:09:02Z alford $
# Copyright (C) 1998-2003 Michael Haggerty <mhagger@alum.mit.edu>
#
# This file is licensed under the GNU Lesser General Public License
# (LGPL). See LICENSE.txt for details.
"""Gnuplot -- A pipe-based interface to the gnuplot plotting progr... | gpl-2.0 |
joshuahoman/vivisect | vivisect/parsers/blob.py | 4 | 1764 | import envi
import vivisect
import vivisect.parsers as v_parsers
from vivisect.const import *
def parseFd(vw, fd, filename=None):
fd.seek(0)
arch = vw.config.viv.parsers.blob.arch
bigend = vw.config.viv.parsers.blob.bigend
baseaddr = vw.config.viv.parsers.blob.baseaddr
try:
envi.getArchModu... | apache-2.0 |
tjma12/pycbc | pycbc/fft/backend_support.py | 1 | 3120 | # Copyright (C) 2012 Josh Willis, Andrew Miller
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 3 of the License, or (at your
# option) any later version.
#
# This program is d... | gpl-3.0 |
cernops/neutron | neutron/api/api_common.py | 17 | 10729 | # Copyright 2011 Citrix System.
# 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 b... | apache-2.0 |
davehorton/drachtio-server | deps/boost_1_69_0/tools/build/test/build_file.py | 7 | 5123 | #!/usr/bin/python
# Copyright (C) 2006. Vladimir Prus
# Copyright (C) 2008. Jurko Gospodnetic
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
# Tests that we explicitly request a file (not target) to be built by
#... | mit |
SmartCash/smartcash | qa/rpc-tests/test_framework/blockstore.py | 97 | 5416 | #!/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.
# BlockStore: a helper class that keeps a map of blocks and implements
# helper functions for ... | mit |
nmayorov/scipy | scipy/stats/tests/test_rank.py | 4 | 8291 | import numpy as np
from numpy.testing import assert_equal, assert_array_equal
from scipy.stats import rankdata, tiecorrect
import pytest
class TestTieCorrect(object):
def test_empty(self):
"""An empty array requires no correction, should return 1.0."""
ranks = np.array([], dtype=np.float64)
... | bsd-3-clause |
enStratus/unix-agent | src/dcm/agent/messaging/reply.py | 3 | 40292 | #
# Copyright (C) 2014 Dell, 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 or agreed to in wri... | apache-2.0 |
enikesha/ga-bitbot | libs/call_metrics.py | 18 | 2700 |
"""
call_metrics v0.01
a class function decorator which collects metrics (number of calls and total execution time)
Copyright 2012 Brian Monkaba
This file is part of ga-bitbot.
ga-bitbot is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as publishe... | gpl-3.0 |
nyddle/toster | core/views.py | 1 | 3655 | from django.shortcuts import render, redirect, HttpResponse, get_object_or_404
from django.http import Http404
from django.http import HttpResponseNotFound
from django.views.generic import View
from django.views.generic import ListView
from django.views.generic.edit import FormView, ProcessFormView, CreateView
from ... | mit |
BIDS-collaborative/cega-trace | webscrap/crossref JSON/doi/doi_to_JSON.py | 2 | 1389 | import re
import urllib
import urllib.request
import json
import sys
import codecs
def search_doi(s):
url = "http://api.crossref.org/works/" + s
with urllib.request.urlopen(url) as htmlfile:
htmltext = htmlfile.read().decode('utf-8')
curdata = json.loads(htmltext)
print(htmltext)
return cur... | bsd-2-clause |
bbuckingham/katello | scripts/reindent.py | 69 | 10490 | #! /usr/bin/env python
# Released to the public domain, by Tim Peters, 03 October 2000.
"""reindent [-d][-r][-v] [ path ... ]
-d (--dryrun) Dry run. Analyze, but don't make any changes to, files.
-r (--recurse) Recurse. Search for all .py files in subdirectories too.
-n (--nobackup) No backup. Does not make a... | gpl-2.0 |
nicholasserra/sentry | src/sentry/services/smtp.py | 36 | 3120 | """
sentry.services.smtp
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import asyncore
import email
import logging
from smtpd import SMTPServer, SMTPChannel
from ... | bsd-3-clause |
seem-sky/kbengine | kbe/res/scripts/common/Lib/lib2to3/pgen2/tokenize.py | 80 | 19321 | # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation.
# All rights reserved.
"""Tokenization help for Python programs.
generate_tokens(readline) is a generator that breaks a stream of
text into Python tokens. It accepts a readline-like method which is called
repeatedly to get the next line o... | lgpl-3.0 |
luoyetx/mxnet | example/ssd/data/demo/download_demo_images.py | 24 | 1663 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache Licen... | apache-2.0 |
CARocha/addac_fadcanic | encuesta/migrations/0005_auto__add_cultivosanuales__add_productoanimal__add_productoprocesado__.py | 2 | 26202 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as 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 'CultivosAnuales'
db.create_table(u'encuesta_cultivosanual... | gpl-3.0 |
bopo/django-userena | userena/utils.py | 4 | 6483 | from django.conf import settings
from django.utils.encoding import smart_bytes
from django.utils.functional import allow_lazy
from django.utils.http import urlencode
from django.utils.six import text_type
from django.utils.text import Truncator
from userena import settings as userena_settings
from userena.compat impor... | bsd-3-clause |
mbayon/TFG-MachineLearning | vbig/lib/python2.7/site-packages/django/contrib/sessions/middleware.py | 129 | 3423 | import time
from importlib import import_module
from django.conf import settings
from django.contrib.sessions.backends.base import UpdateError
from django.core.exceptions import SuspiciousOperation
from django.utils.cache import patch_vary_headers
from django.utils.deprecation import MiddlewareMixin
from django.utils.... | mit |
douglaskastle/mutagen | tests/test_trueaudio.py | 1 | 1544 | # -*- coding: utf-8 -*-
import os
import shutil
from mutagen.trueaudio import TrueAudio, delete
from mutagen.id3 import TIT1
from tests import TestCase, DATA_DIR
from tempfile import mkstemp
class TTrueAudio(TestCase):
def setUp(self):
self.audio = TrueAudio(os.path.join(DATA_DIR, "empty.tta"))
def... | gpl-2.0 |
astropy/astropy | astropy/units/misc.py | 8 | 3393 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This package defines miscellaneous units. They are also
available in the `astropy.units` namespace.
"""
from . import si
from astropy.constants import si as _si
from .core import (UnitBase, def_unit, si_prefixes, binary_prefi... | bsd-3-clause |
mdaniel/intellij-community | python/helpers/third_party/thriftpy/_shaded_ply/yacc.py | 99 | 135805 | # -----------------------------------------------------------------------------
# ply: yacc.py
#
# Copyright (C) 2001-2015,
# David M. Beazley (Dabeaz LLC)
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions a... | apache-2.0 |
40223137/w17w17 | static/Brython3.1.0-20150301-090019/Lib/fractions.py | 722 | 23203 | # Originally contributed by Sjoerd Mullender.
# Significantly modified by Jeffrey Yasskin <jyasskin at gmail.com>.
"""Fraction, infinite-precision, real numbers."""
from decimal import Decimal
import math
import numbers
import operator
import re
import sys
__all__ = ['Fraction', 'gcd']
def gcd(a, b):
"""Calcu... | gpl-3.0 |
eonum/medword | model_validation.py | 1 | 11972 | import numpy as np
import preprocess as pp
import os
from random import randint
from sklearn.decomposition import PCA
import matplotlib.pyplot as plt
import csv
def validate_model(embedding, emb_model_dir, emb_model_fn):
print("Start validation. Loading model. \n")
# load config
config = embedding.confi... | mit |
bimbam23/tools-iuc | datatypes/snpsift_dbnsfp_datatypes/snpsift_dbnsfp.py | 9 | 3924 | """
SnpSift dbNSFP datatypes
"""
import gzip
import logging
import os
import os.path
import sys
import traceback
from galaxy.datatypes.data import Text
from galaxy.datatypes.metadata import MetadataElement
log = logging.getLogger(__name__)
class SnpSiftDbNSFP( Text ):
"""Class describing a dbNSFP database prepa... | mit |
dannyboi104/SickRage | autoProcessTV/lib/requests/packages/chardet/universaldetector.py | 1776 | 6840 | ######################## 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 |
shail2810/nova | nova/tests/functional/api_sample_tests/test_quota_sets.py | 2 | 4070 | # Copyright 2012 Nebula, Inc.
# Copyright 2013 IBM Corp.
#
# 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... | apache-2.0 |
hoehnp/navit_test | lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.py | 353 | 14161 | """Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause proble... | gpl-2.0 |
mihaic/brainiak | brainiak/utils/utils.py | 1 | 36227 | # Copyright 2016 Intel Corporation, Princeton University
#
# 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 appli... | apache-2.0 |
beiko-lab/gengis | bin/Lib/site-packages/scipy/interpolate/__init__.py | 1 | 3385 | """
========================================
Interpolation (:mod:`scipy.interpolate`)
========================================
.. currentmodule:: scipy.interpolate
Sub-package for objects used in interpolation.
As listed below, this sub-package contains spline functions and classes,
one-dimensional and mul... | gpl-3.0 |
thumbimigwe/echorizr | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/six.py | 2375 | 11628 | """Utilities for writing code that runs on Python 2 and 3"""
#Copyright (c) 2010-2011 Benjamin Peterson
#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 l... | mit |
pyfisch/servo | tests/wpt/web-platform-tests/tools/third_party/py/py/_io/saferepr.py | 273 | 2483 | import py
import sys
builtin_repr = repr
reprlib = py.builtin._tryimport('repr', 'reprlib')
class SafeRepr(reprlib.Repr):
""" subclass of repr.Repr that limits the resulting size of repr()
and includes information on exceptions raised during the call.
"""
def repr(self, x):
return self._c... | mpl-2.0 |
azoft-dev-team/imagrium | env/Lib/test/test_format.py | 12 | 10507 | from test.test_support import verbose, have_unicode, TestFailed, is_jython
import sys
# test string formatting operator (I am not sure if this is being tested
# elsewhere but, surely, some of the given cases are *not* tested because
# they crash python)
# test on unicode strings as well
overflowok = 1
def testformat... | mit |
vlinhd11/vlinhd11-android-scripting | python/src/Tools/modulator/ScrolledListbox.py | 37 | 1477 | # A ScrolledList widget feels like a list widget but also has a
# vertical scroll bar on its right. (Later, options may be added to
# add a horizontal bar as well, to make the bars disappear
# automatically when not needed, to move them to the other side of the
# window, etc.)
#
# Configuration options are passed to t... | apache-2.0 |
mhum/ynab-enhanced | src/common/res/features/l10n/init.py | 1 | 3511 | #!/usr/bin/env python
"""Prepare and download l10ns."""
import urllib, urllib2
import shutil
import os
import zipfile
import json
import sys
import math
if len(sys.argv) != 2:
print ''
print 'ERROR:'
print ''
print 'Please supply a crowd in API key, obtained on this page:'
print 'http://translate.t... | mit |
sssstest/GameEditor | GameTrigger.py | 1 | 1438 | #!/usr/bin/env python
#@section License
#
#Copyright (C) 2013 ssss
#This file is a part of the GameEditor.
#
#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
#(a... | gpl-3.0 |
lmorchard/django-allauth | allauth/socialaccount/south_migrations/0011_auto__chg_field_socialtoken_token.py | 77 | 6468 | # -*- 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):
# Changing field 'SocialToken.token'
db.alter_column('socialaccount_socialtoken', 'token', self.gf('django.... | mit |
partofthething/home-assistant | tests/components/ruckus_unleashed/test_init.py | 3 | 3616 | """Test the Ruckus Unleashed config flow."""
from unittest.mock import patch
from pyruckus.exceptions import AuthenticationError
from homeassistant.components.ruckus_unleashed import (
API_AP,
API_DEVICE_NAME,
API_ID,
API_MAC,
API_MODEL,
API_SYSTEM_OVERVIEW,
API_VERSION,
DOMAIN,
MA... | mit |
wzbozon/statsmodels | statsmodels/tools/print_version.py | 23 | 7951 | #!/usr/bin/env python
from __future__ import print_function
from statsmodels.compat.python import reduce
import sys
from os.path import dirname
def safe_version(module, attr='__version__'):
if not isinstance(attr, list):
attr = [attr]
try:
return reduce(getattr, [module] + attr)
except Att... | bsd-3-clause |
cjhak/b2share | invenio/modules/uploader/uploader_tasks.py | 13 | 13474 | # -*- 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... | gpl-2.0 |
PongPi/isl-odoo | openerp/addons/base/__openerp__.py | 336 | 3703 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
mafiya69/sympy | sympy/vector/tests/test_dyadic.py | 94 | 4076 | from sympy import sin, cos, symbols, pi, ImmutableMatrix as Matrix, \
simplify
from sympy.vector import (CoordSysCartesian, Vector, Dyadic,
DyadicAdd, DyadicMul, DyadicZero,
BaseDyadic, express)
A = CoordSysCartesian('A')
def test_dyadic():
a, b = symbols... | bsd-3-clause |
mkheirkhah/mptcp | src/config-store/bindings/modulegen__gcc_ILP32.py | 36 | 68421 | from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers
import pybindgen.settings
import warnings
class ErrorHandler(pybindgen.settings.ErrorHandler):
def handle_error(self, wrapper, exception, traceback_):
warnings.warn("exception %r in wrapper %s" % (exception, wrapper))
... | gpl-2.0 |
cisc474/board_game_app | api/fetch_desc_bs4.py | 2 | 3669 | #importing the libraries I want, an sqlite interface, a url requester, and an XML parsing library
import sqlite3, urllib2, bs4 as BeautifulSoup
#sudo apt-get install python-bs4
#That's how I was able to install the latest beautiful soup
#this bit I have to google search everytime.
con = sqlite3.connect('bgg.sqlite')
... | mit |
dfm/arxiv2speech | arxiv2speech.py | 1 | 3104 | #!/usr/bin/env python
from __future__ import print_function, absolute_import, unicode_literals
__all__ = ["run"]
__version__ = "0.0.4"
__author__ = "Dan Foreman-Mackey (danfm@nyu.edu)"
__copyright__ = "Copyright 2013 Daniel Foreman-Mackey"
__contributors__ = []
import os
import re
import json
import shutil
import s... | bsd-2-clause |
valentin-krasontovitsch/ansible | test/units/parsing/test_metadata.py | 125 | 10000 | # coding: utf-8
# (c) 2017, Toshio Kuratomi <tkuratomi@ansible.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 o... | gpl-3.0 |
odrodrig/Devoxx4Kids | node_modules/utf8/tests/generate-test-data.py | 1788 | 1435 | #!/usr/bin/env python
import re
import json
# https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
# http://stackoverflow.com/a/13436167/96656
def unisymbol(codePoint):
if codePoint >= 0x0000 and codePoint <= 0xFFFF:
return unichr(codePoint)
elif codePoint >= 0x010000 and codePoint <= 0x10FFFF:
... | mit |
bitkeeper/python-opcua | opcua/server/binary_server_asyncio.py | 1 | 4546 | """
Socket server forwarding request to internal server
"""
import logging
try:
# we prefer to use bundles asyncio version, otherwise fallback to trollius
import asyncio
except ImportError:
import trollius as asyncio
from opcua import ua
from opcua.server.uaprocessor import UaProcessor
logger = logging.g... | lgpl-3.0 |
Duoxilian/home-assistant | homeassistant/const.py | 3 | 12028 | # coding: utf-8
"""Constants used by Home Assistant components."""
MAJOR_VERSION = 0
MINOR_VERSION = 39
PATCH_VERSION = '0.dev0'
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION)
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION)
REQUIRED_PYTHON_VER = (3, 4, 2)
REQUIRED_PYTHON_VER_WIN = (3, 5... | mit |
lgscofield/odoo | addons/survey/wizard/__init__.py | 385 | 1026 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-TODAY OpenERP S.A. <http://www.openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms... | agpl-3.0 |
marcel-dancak/QGIS | tests/src/python/test_qgsrasterbandcombobox.py | 23 | 3809 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsRasterBandComboBox.
.. note:: This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.... | gpl-2.0 |
MartyParty21/AwakenDreamsClient | mcp/runtime/startserver.py | 3 | 1524 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Fri Apr 8 16:54:36 2011
@author: ProfMobius
@version: v1.0
"""
import sys
import logging
import json
from optparse import OptionParser
from commands import Commands, SERVER
def main():
parser = OptionParser(version='MCP %s' % Commands.fullversion()... | gpl-3.0 |
jinnykoo/wuyisj | tests/unit/core/customisation_tests.py | 5 | 3068 | import os
import tempfile
from django.test import TestCase
from django.conf import settings
from oscar.core import customisation
VALID_FOLDER_PATH = 'tests/_site/apps'
class TestUtilities(TestCase):
def test_subfolder_extraction(self):
folders = list(customisation.subfolders('/var/www/eggs'))
... | bsd-3-clause |
nex3/pygments | pygments/styles/vim.py | 75 | 1976 | # -*- coding: utf-8 -*-
"""
pygments.styles.vim
~~~~~~~~~~~~~~~~~~~
A highlighting style for Pygments, inspired by vim.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keywor... | bsd-2-clause |
babelphish/fridge-cop | fridge_language.py | 1 | 1219 | import random
def get_fridge_language(language):
if (language == "EN"):
return EnglishFridgeLanguage()
class FridgeLanguage:
def _init_(self):
random.seed()
def get_random_letter(self):
value = random.random() * 100
total = 0
for letter_frequency i... | agpl-3.0 |
yaojingwu1992/XlsxWriter | xlsxwriter/test/comparison/test_cond_format07.py | 8 | 2470 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
duointeractive/media-nommer | media_nommer/ec2nommerd/node_state.py | 1 | 7367 | """
Contains the :py:class:`NodeStateManager` class, which is an abstraction layer
for storing and communicating the status of EC2_ nodes.
"""
import urllib2
import datetime
import boto
from twisted.internet import reactor
from media_nommer.conf import settings
from media_nommer.utils import logger
from media_nommer.ut... | bsd-3-clause |
javierTerry/odoo | addons/point_of_sale/__openerp__.py | 261 | 3612 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 |
ssh1/stbgui | lib/python/Components/Converter/PliExtraInfo.py | 4 | 12709 | # shamelessly copied from pliExpertInfo (Vali, Mirakels, Littlesat)
from enigma import iServiceInformation, iPlayableService
from Components.Converter.Converter import Converter
from Components.Element import cached
from Components.config import config
from Tools.Transponder import ConvertToHumanReadable, getChannelNu... | gpl-2.0 |
infected-lp/kernel_sony_msm8974 | scripts/build-all.py | 1474 | 10189 | #! /usr/bin/env python
# Copyright (c) 2009-2013, The Linux Foundation. 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
# ... | gpl-2.0 |
pschmitt/home-assistant | homeassistant/components/supla/cover.py | 6 | 2904 | """Support for Supla cover - curtains, rollershutters, entry gate etc."""
import logging
from pprint import pformat
from homeassistant.components.cover import (
ATTR_POSITION,
DEVICE_CLASS_GARAGE,
CoverEntity,
)
from homeassistant.components.supla import SuplaChannel
_LOGGER = logging.getLogger(__name__)
... | apache-2.0 |
h2oai/h2o | py/testdir_single_jvm/test_KMeans_twit_fvec.py | 9 | 2516 | import unittest, time, sys
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_kmeans, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(1, java_heap_GB=14)
@... | apache-2.0 |
bestwpw/mysql-5.6 | xtrabackup/test/python/subunit/tests/test_subunit_filter.py | 50 | 8259 | #
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
# project sour... | gpl-2.0 |
ayoubg/gem5-graphics | Mesa-7.11.2_GPGPU-Sim/src/gallium/drivers/i965/brw_structs_dump.py | 34 | 8917 | #!/usr/bin/env python
'''
Generates dumpers for the i965 state strucutures using pygccxml.
Run as
PYTHONPATH=/path/to/pygccxml-1.0.0 python brw_structs_dump.py
Jose Fonseca <jfonseca@vmware.com>
'''
copyright = '''
/**************************************************************************
*
* Copyright 2009 V... | bsd-3-clause |
Beauhurst/django | tests/auth_tests/test_basic.py | 31 | 5389 | from django.contrib.auth import get_user, get_user_model
from django.contrib.auth.models import AnonymousUser, User
from django.core.exceptions import ImproperlyConfigured
from django.db import IntegrityError
from django.http import HttpRequest
from django.test import TestCase, override_settings
from django.utils impor... | bsd-3-clause |
unho/pootle | pootle/apps/pootle_store/migrations/0025_unit_on_delete_user.py | 7 | 1163 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-02-02 14:03
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import pootle.core.user
class Migration(migrations.Migration):
dependencies = [
('pootle_store', '0024_set_store_bas... | gpl-3.0 |
ajaybhat/scikit-image | skimage/measure/tests/test_fit.py | 6 | 10401 | import numpy as np
from numpy.testing import assert_equal, assert_raises, assert_almost_equal
from skimage.measure import LineModelND, CircleModel, EllipseModel, ransac
from skimage.transform import AffineTransform
from skimage.measure.fit import _dynamic_max_trials
from skimage._shared._warnings import expected_warnin... | bsd-3-clause |
GotlingSystem/apnea | src/apps/dive_log/models.py | 1 | 2496 | # coding=utf-8
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext as _
from discipline.models import Discipline
class Session(models.Model):
#pool = models.ForeignKey(Pool)
user = models.ForeignKey(User)
date = models.DateField(verbose_na... | mit |
ThiagoGarciaAlves/intellij-community | python/lib/Lib/site-packages/django/conf/locale/ka/formats.py | 329 | 1888 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'l, j F, Y'
TIME_FORMAT = 'h:i:s a'
DATETIME_FORMAT = 'j F, Y h:i:s a'
YEA... | apache-2.0 |
johankaito/fufuka | microblog/venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## 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... | apache-2.0 |
openstack/heat | heat/tests/engine/test_engine_worker.py | 1 | 12872 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 |
cvra/can-bootloader | client/tests/test_config_read_tool.py | 1 | 2204 | import unittest
try:
from unittest.mock import *
except ImportError:
from mock import *
from msgpack import *
from cvra_bootloader.read_config import main
from cvra_bootloader.commands import *
import sys
import json
class ReadConfigToolTestCase(unittest.TestCase):
@patch('cvra_bootloader.utils.write_c... | bsd-2-clause |
pang-w/pyspider | pyspider/webui/app.py | 4 | 3259 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2014-02-22 23:17:13
import os
import sys
import logging
logger = logging.getLogger("webui")
from six import reraise
from six.moves import builtins
from si... | apache-2.0 |
diagramsoftware/odoomrp-utils | purchase_pricelist_partnerinfo/__openerp__.py | 12 | 1572 | # -*- encoding: utf-8 -*-
##############################################################################
#
# 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, either version 3 of the... | agpl-3.0 |
wido/cloudstack | tools/ngui/api.py | 7 | 1481 | #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 use thi... | apache-2.0 |
Belgabor/django | django/contrib/gis/gdal/prototypes/geom.py | 315 | 4821 | import re
from datetime import date
from ctypes import c_char, c_char_p, c_double, c_int, c_ubyte, c_void_p, POINTER
from django.contrib.gis.gdal.envelope import OGREnvelope
from django.contrib.gis.gdal.libgdal import lgdal, GEOJSON
from django.contrib.gis.gdal.prototypes.errcheck import check_bool, check_envelope
from... | bsd-3-clause |
apdjustino/DRCOG_Urbansim | src/opus_core/resource_factory.py | 1 | 2293 | # Opus/UrbanSim urban simulation software.
# Copyright (C) 2010-2011 University of California, Berkeley, 2005-2009 University of Washington
# See opus_core/LICENSE
from opus_core.resources import Resources
from opus_core.storage_factory import StorageFactory
class ResourceFactory(object):
""" Class for creating a... | agpl-3.0 |
andrewpollock/grpc | tools/gcp/stress_test/run_server.py | 37 | 5970 | #!/usr/bin/env python2.7
# Copyright 2015-2016, 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, thi... | bsd-3-clause |
lukas-krecan/tensorflow | tensorflow/python/ops/linalg_grad.py | 17 | 2430 | # Copyright 2015 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 a... | apache-2.0 |
pombredanne/MOG | tools/install_venv_common.py | 15 | 7428 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 OpenStack Foundation
# Copyright 2013 IBM Corp.
#
# 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.a... | apache-2.0 |
lbjay/cds-invenio | modules/bibformat/lib/elements/bfe_photos.py | 4 | 5570 | # -*- coding: utf-8 -*-
##
## This file is part of CDS Invenio.
## Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 CERN.
##
## CDS 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 versio... | gpl-2.0 |
purepitch/trove | tests/test_view.py | 1 | 2089 | # -*- coding: utf-8 -*-
import unittest
import StringIO
import sys
import re
from modules.view import View
class TestView(unittest.TestCase):
def setUp(self):
self.view = View()
def testPrintInfoExpectsArgument(self):
with self.assertRaises(TypeError):
self.view.print_line()
... | gpl-3.0 |
databrary/curation | tools/scripts/utils/openproject/update.py | 1 | 5971 | #!/usr/bin/env python2.7
import sys, os
'''smoother more informative version check'''
if sys.version_info >= (3, 0, 0):
sys.exit("You need to run this with python 2.7, exiting now so you can get your stuff together")
'''Run from ../scripts/ with `python -m utils.openproject.update`'''
import json
from .. impor... | gpl-3.0 |
kustodian/ansible | lib/ansible/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py | 37 | 6115 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Evgeniy Krysanov <evgeniy.krysanov@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 = {
'm... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.