repo_name stringlengths 6 100 | path stringlengths 4 294 | copies stringlengths 1 5 | size stringlengths 4 6 | content stringlengths 606 896k | license stringclasses 15
values |
|---|---|---|---|---|---|
symbolicdata/code | src/sdeval/classes/computationproblems/GB_Z_lp.py | 1 | 4721 | from ComputationProblem import ComputationProblem
import os
class GB_Z_lp(ComputationProblem):
"""
This computation problem represents the computation of a Groebner basis of a given polynomial system
(commutative) with integer coefficients and the lexicographical ordering.
.. moduleauthor:: Albert Hei... | gpl-3.0 |
pombredanne/kitchen-1 | kitchen2/tests/test_i18n.py | 1 | 40979 | # -*- coding: utf-8 -*-
#
import unittest
from nose import tools
import os
import types
from kitchen import i18n
import base_classes
class TestI18N_UTF8(unittest.TestCase, base_classes.UnicodeTestData):
def setUp(self):
self.old_LC_ALL = os.environ.get('LC_ALL', None)
os.environ['LC_ALL'] = 'pt_... | gpl-2.0 |
rangadi/beam | sdks/python/apache_beam/io/range_trackers.py | 5 | 14059 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
pozetroninc/micropython | tests/misc/rge_sm.py | 101 | 4241 | # evolve the RGEs of the standard model from electroweak scale up
# by dpgeorge
import math
class RungeKutta(object):
def __init__(self, functions, initConditions, t0, dh, save=True):
self.Trajectory, self.save = [[t0] + initConditions], save
self.functions = [lambda *args: 1.0] + list(functi... | mit |
samuelctabor/ardupilot | libraries/AP_Math/tools/geodesic_grid/icosahedron.py | 110 | 5898 | # Copyright (C) 2016 Intel Corporation. All rights reserved.
#
# This file 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 fi... | gpl-3.0 |
ArcherSys/ArcherSys | Lib/site-packages/sphinx/ext/autosummary/generate.py | 5 | 11707 | # -*- coding: utf-8 -*-
"""
sphinx.ext.autosummary.generate
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usable as a library or script to generate automatic RST source files for
items referred to in autosummary:: directives.
Each generated RST file contains a single auto*:: directive which
extracts the doc... | mit |
mholtrop/Phys605 | Python/RTC/ReadClock.py | 1 | 1380 | #!/usr/bin/env python
#
# The wiringPi requires you to run as sudo.
# This is needed for access to /dev/mem, which we don't use here.
# There is no way around this though, so we start this code as a root user.
#
#
import wiringpi as wp
#
# Define a function to decode BCD encoded numbers.
def decBCD(num):
return( (n... | gpl-3.0 |
antepsis/anteplahmacun | examples/advanced/pyglet_plotting.py | 92 | 7199 | #!/usr/bin/env python
"""
Plotting Examples
Suggested Usage: python -i plotting.py
"""
from sympy import symbols
from sympy.plotting.pygletplot import PygletPlot
from sympy import sin, cos, pi, sqrt, exp
from sympy.core.compatibility import range
from time import sleep, clock
def main():
x, y, z = symbols... | bsd-3-clause |
LeslieW/or-tools | examples/python/knapsack_cp.py | 34 | 2309 | # Copyright 2010 Hakan Kjellerstrand hakank@bonetmail.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | apache-2.0 |
mcollins12321/anita | venv/lib/python2.7/site-packages/requests/packages/chardet/sjisprober.py | 1777 | 3764 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | mit |
MediaSapiens/autonormix | django/contrib/sitemaps/views.py | 61 | 2026 | from django.http import HttpResponse, Http404
from django.template import loader
from django.contrib.sites.models import get_current_site
from django.core import urlresolvers
from django.utils.encoding import smart_str
from django.core.paginator import EmptyPage, PageNotAnInteger
def index(request, sitemaps):
curr... | bsd-3-clause |
johnardavies/scrapy | tests/test_proxy_connect.py | 130 | 4114 | import json
import os
import time
from threading import Thread
from libmproxy import controller, proxy
from netlib import http_auth
from testfixtures import LogCapture
from twisted.internet import defer
from twisted.trial.unittest import TestCase
from scrapy.utils.test import get_crawler
from scrapy.http import Reque... | bsd-3-clause |
peterayeni/libforensics | code/lf/dtypes/base.py | 13 | 1447 | # Copyright 2010 Michael Murr
#
# This file is part of LibForensics.
#
# LibForensics 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 3 of the License, or
# (at your option) any later ver... | lgpl-3.0 |
caveman-dick/ansible | test/units/modules/network/eos/test_eos_eapi.py | 56 | 6267 | # (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 |
openhumanoids/director | src/python/director/robotlinkselector.py | 4 | 2188 | from director import applogic
from director import objectmodel as om
from director import visualization as vis
class RobotLinkSelector(object):
def __init__(self):
self.selectedLink = None
self.setupMenuAction()
def setupMenuAction(self):
self.action = applogic.addMenuAction('Tools'... | bsd-3-clause |
jcurbelo/networkx | networkx/readwrite/json_graph/tests/test_tree.py | 63 | 1045 | import json
from nose.tools import assert_equal, assert_raises, assert_not_equal, assert_true, raises
import networkx as nx
from networkx.readwrite.json_graph import *
class TestTree:
def test_graph(self):
G=nx.DiGraph()
G.add_nodes_from([1,2,3],color='red')
G.add_edge(1,2,foo=7)
G... | bsd-3-clause |
hachreak/invenio-oauthclient | invenio_oauthclient/contrib/orcid.py | 1 | 7449 | # -*- coding: utf-8 -*-
#
# This file is part of Invenio.
# Copyright (C) 2014, 2015, 2016, 2017 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... | gpl-2.0 |
solome/jyp | misc/virtenv/lib/python2.6/site.py | 20 | 26322 | """Append module search paths for third-party packages to sys.path.
****************************************************************
* This module is automatically imported during initialization. *
****************************************************************
In earlier versions of Python (up to 1.5a3), scripts or... | mpl-2.0 |
PyCQA/isort | tests/unit/test_place.py | 1 | 2623 | """Tests for the isort import placement module"""
from functools import partial
from isort import place, sections
from isort.settings import Config
def test_module(src_path):
place_tester = partial(place.module, config=Config(src_paths=[src_path]))
assert place_tester("isort") == sections.FIRSTPARTY
asse... | mit |
sahildua2305/eden | static/scripts/tools/toposort.py | 305 | 1086 | """
toposort.py
Sorts dictionary keys based on lists of dependencies.
"""
class MissingDependency(Exception):
"""Exception raised when a listed dependency is not in the dictionary."""
class Sorter(object):
def __init__(self, dependencies):
self.dependencies = dependencies
self.visited = set()
... | mit |
batxes/4c2vhic | SHH_WT_models/SHH_WT_models_final_output_0.1_-0.1_11000/SHH_WT_models4320.py | 2 | 17580 | import _surface
import chimera
try:
import chimera.runCommand
except:
pass
from VolumePath import markerset as ms
try:
from VolumePath import Marker_Set, Link
new_marker_set=Marker_Set
except:
from VolumePath import volume_path_dialog
d= volume_path_dialog(True)
new_marker_set= d.new_marker_set
marker_set... | gpl-3.0 |
Aravinthu/odoo | addons/maintenance/models/maintenance.py | 1 | 20858 | # -*- coding: utf-8 -*-
from datetime import date, datetime, timedelta
from odoo import api, fields, models, SUPERUSER_ID, _
from odoo.exceptions import UserError
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
class MaintenanceStage(models.Model):
""" Model for case stages. Th... | agpl-3.0 |
tonyli71/designate | functionaltests/api/v2/models/transfer_requests_model.py | 6 | 1121 | # Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Author: Endre Karlson <endre.karlson@hp.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/lice... | apache-2.0 |
lebabouin/CouchPotatoServer-develop | couchpotato/core/providers/trailer/vftrailers/youtube_dl/extractor/howcast.py | 3 | 1716 | import re
from .common import InfoExtractor
class HowcastIE(InfoExtractor):
_VALID_URL = r'(?:https?://)?(?:www\.)?howcast\.com/videos/(?P<id>\d+)'
_TEST = {
u'url': u'http://www.howcast.com/videos/390161-How-to-Tie-a-Square-Knot-Properly',
u'file': u'390161.mp4',
u'md5': u'1d7ba54e2c... | gpl-3.0 |
nrb/ansible-modules-extras | system/puppet.py | 51 | 6731 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any late... | gpl-3.0 |
Stanford-Online/edx-analytics-pipeline | edx/analytics/tasks/common/tests/test_elasticsearch_load.py | 2 | 14619 | """Tests for elasticsearch loading."""
import datetime
import unittest
import ddt
import luigi.contrib.hdfs.target
from elasticsearch import TransportError
from freezegun import freeze_time
from mock import call, patch
from edx.analytics.tasks.common.elasticsearch_load import AwsHttpConnection, ElasticsearchIndexTas... | agpl-3.0 |
gnmiller/craig-bot | craig-bot/lib/python3.6/site-packages/pip/_vendor/chardet/jpcntx.py | 289 | 19643 | ######################## 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 |
zuku1985/scikit-learn | sklearn/preprocessing/tests/test_imputation.py | 51 | 12300 |
import numpy as np
from scipy import sparse
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_false
from sklearn.preprocessing.imputation import Imputer
from sklearn.pipeline imp... | bsd-3-clause |
mvk/hydrogen | data/i18n/stats.py | 6 | 1672 | #!/usr/bin/env python
from xml.dom import minidom, Node
def parse_ts(filename):
doc = minidom.parse(filename)
root_node = doc.documentElement
total = 0
unfinished = 0
obsolete = 0
for node in root_node.childNodes:
if node.nodeName == "context":
context_node = node
for context_child in context_n... | gpl-2.0 |
hudsonwoods/hudson_woods | node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py | 601 | 12116 | # 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.
"""New implementation of Visual Studio project generation."""
import os
import random
import gyp.common
# hashlib is supplied as of Python 2.5 as the replacemen... | apache-2.0 |
johndpope/tensorflow | tensorflow/python/ops/quantized_conv_ops_test.py | 98 | 7488 | # 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 |
lbarahona/UdacityProject4 | main.py | 1 | 2446 | #!/usr/bin/env python
"""
main.py -- Udacity conference server-side Python App Engine
HTTP controller handlers for memcache & task queue access
$Id$
created by wesc on 2014 may 24
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
import webapp2
from google.appengine.api import app_identity
from google.appe... | apache-2.0 |
jmcarbo/openerp7 | openerp/addons/base/module/wizard/base_update_translations.py | 447 | 2931 | # -*- 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 |
vseledkin/april-ann | packages/hmm_trainer/test/slf2hmm_trainer.py | 3 | 1753 | #!/usr/bin/python
import re
import sys
if sys.argv[2]=="p":
probs=True
else:
probs=False
f=file(sys.argv[1], 'r')
lines = f.readlines()
sizespec = re.compile('N=([0-9]+)\s+L=([0-9]+)')
node = re.compile('I=([0-9]+)\s+W=(\S*)')
if probs:
arc = re.compile('J=([0-9]+)\s+S=([0-9]+)\s+E=([0-9]+)\s+l=(\S+)')
... | gpl-3.0 |
kenshay/ImageScripter | ProgramData/SystemFiles/Python/Lib/site-packages/pip-9.0.1-py2.7.egg/pip/_vendor/requests/packages/chardet/cp949prober.py | 2801 | 1782 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Con... | gpl-3.0 |
KokareIITP/django | django/contrib/gis/db/models/lookups.py | 226 | 10608 | from __future__ import unicode_literals
import re
from django.core.exceptions import FieldDoesNotExist
from django.db.models.constants import LOOKUP_SEP
from django.db.models.expressions import Col, Expression
from django.db.models.lookups import Lookup
from django.utils import six
gis_lookups = {}
class GISLookup... | bsd-3-clause |
JohnSnowLabs/spark-nlp | python/tensorflow/lib/ner/ner_model.py | 1 | 21854 | import numpy as np
import tensorflow as tf
import random
import math
import sys
from sentence_grouper import SentenceGrouper
class NerModel:
# If session is not defined than default session will be used
def __init__(self, session=None, dummy_tags=None, use_contrib=True, use_gpu_device=0):
tf.disable_v... | apache-2.0 |
Lightmatter/django-inlineformfield | .tox/py27/lib/python2.7/site-packages/django/utils/archive.py | 562 | 7070 | """
Based on "python-archive" -- http://pypi.python.org/pypi/python-archive/
Copyright (c) 2010 Gary Wilson Jr. <gary.wilson@gmail.com> and contributors.
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 So... | mit |
srvg/ansible | test/units/utils/test_shlex.py | 35 | 1379 | # (c) 2015, Marius Gedminas <marius@gedmin.as>
#
# 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 vers... | gpl-3.0 |
yxd123/googleplayCrawler | googleplay_api/androguard/androproto.py | 4 | 6843 | #!/usr/bin/python
# This script analyzes an APK and tries to recover its .proto file, assuming
# the APK is using Micro-Protobuf. It has only been tested on Google Play
# Android client (sha1: 0f214c312f9800b01e2a5a7b9766dc880efda110).
#
# Use it at your own risk!
import sys
from pprint import pprint
from androguard... | gpl-2.0 |
jwlawson/tensorflow | tensorflow/contrib/learn/python/learn/ops/__init__.py | 124 | 1104 | # 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 |
EmreAtes/spack | var/spack/repos/builtin/packages/xf86bigfontproto/package.py | 5 | 1573 | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 |
vlegoff/tsunami | src/primaires/vehicule/force.py | 1 | 2990 | # -*-coding:Utf-8 -*
# Copyright (c) 2010-2017 DAVY Guillaume
# 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 |
scs/uclinux | lib/boost/boost_1_38_0/libs/python/test/callbacks.py | 46 | 2935 | # Copyright David Abrahams 2004. 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)
'''
>>> from callbacks_ext import *
>>> def double(x):
... return x + x
...
>>> apply_int_int(double, 42)
84
>>> apply_void_int(dou... | gpl-2.0 |
KDE/pykde4 | examples/kdeuiExamples/kaboutapplicationdialog.py | 1 | 2937 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from PyQt4.QtCore import SIGNAL, Qt
from PyQt4.QtGui import QLabel, QSizePolicy
from PyKDE4.kdecore import i18n, ki18n, KAboutData
from PyKDE4.kdeui import KVBox, KHBox, KPushButton, KAboutApplicationDialog
helpText = """The KAboutApplicationDialog is normally displayed ... | gpl-2.0 |
James-Firth/pip | pip/_vendor/requests/packages/chardet/hebrewprober.py | 2929 | 13359 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Shy Shalom
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved.
#... | mit |
otadmor/Open-Knesset | laws/migrations/0004_add_votes_count_to_vote.py | 9 | 6350 |
from south.db import db
from django.db import models
from laws.models import *
class Migration:
def forwards(self, orm):
# Adding field 'Vote.votes_count'
db.add_column('laws_vote', 'votes_count', orm['laws.vote:votes_count'])
def backwards(self, orm):
... | bsd-3-clause |
PaulKinlan/cli-caniuse | site/app/scripts/bower_components/jsrepl-build/extern/python/reloop-closured/lib/python2.7/lib2to3/fixes/fix_xrange.py | 326 | 2699 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes xrange(...) into range(...)."""
# Local imports
from .. import fixer_base
from ..fixer_util import Name, Call, consuming_calls
from .. import patcomp
class FixXrange(fixer_base.BaseFix):
BM_... | apache-2.0 |
caesar0301/omnilab-misc | OmniperfTools/perf_aem.py | 1 | 1492 | #!/usr/bin/env python
# Evaluating Activity-Entity model
#
# By chenxm
#
import os
import sys
import groundtruth
from PyOmniMisc.model.aem import AEM
def print_usage():
print("Usage: python exHttp.py <omniperf_trace>")
cut_gap = 8 # sec
def modelAEM(etrs):
print("Modeling AEM ...")
# Modeling traffic wi... | gpl-2.0 |
mino60/venom-xbmc-addons-beta | plugin.video.vstream/resources/sites/notre_ecole_net.py | 4 | 6399 | #-*- coding: utf-8 -*-
#Venom.
from resources.lib.gui.hoster import cHosterGui
from resources.lib.handler.hosterHandler import cHosterHandler
from resources.lib.gui.gui import cGui
from resources.lib.gui.guiElement import cGuiElement
from resources.lib.handler.inputParameterHandler import cInputParameterHandler
from re... | gpl-2.0 |
plotly/plotly.py | packages/python/plotly/plotly/validators/layout/xaxis/_categoryorder.py | 1 | 1151 | import _plotly_utils.basevalidators
class CategoryorderValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="categoryorder", parent_name="layout.xaxis", **kwargs
):
super(CategoryorderValidator, self).__init__(
plotly_name=plotly_name,
... | mit |
rsalmaso/django-allauth | allauth/socialaccount/providers/battlenet/tests.py | 9 | 2352 | import json
from allauth.socialaccount.models import SocialAccount
from allauth.socialaccount.providers.oauth2.client import OAuth2Error
from allauth.socialaccount.tests import OAuth2TestsMixin
from allauth.tests import MockedResponse, TestCase
from .provider import BattleNetProvider
from .views import _check_errors
... | mit |
mercycorps/tola-activity | htdocs/activitydb/migrations/0035_auto_20151028_0057.py | 1 | 3568 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('activitydb', '0034_auto_20151027_1851'),
]
operations = [
migrations.AddField(
model_name='projectagreement',
... | gpl-2.0 |
fuselock/odoo | addons/hr_timesheet_invoice/__openerp__.py | 260 | 2403 | # -*- 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 |
Hybrid-Cloud/cinder | cinder/volume/drivers/netapp/dataontap/iscsi_7mode.py | 4 | 5366 | # Copyright (c) 2014 Clinton Knight. All rights reserved.
# Copyright (c) 2016 Mike Rooney. 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://w... | apache-2.0 |
dymkowsk/mantid | Testing/SystemTests/tests/analysis/ISIS_PowderPearlTest.py | 2 | 5679 | from __future__ import (absolute_import, division, print_function)
import os
import stresstesting
import shutil
import mantid.simpleapi as mantid
from mantid import config
from isis_powder import Pearl
DIRS = config['datasearch.directories'].split(';')
# Setup various path details
inst_name = "PEARL"
# Relative t... | gpl-3.0 |
gechong/XlsxWriter | xlsxwriter/test/worksheet/test_cond_format12.py | 8 | 4434 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
class TestAss... | bsd-2-clause |
WendellDuncan/or-tools | examples/python/hidato_table.py | 5 | 5571 | # Copyright 2010-2014 Google
# 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, so... | apache-2.0 |
fahhem/mbed-os | tools/dev/dsp_fir.py | 120 | 2714 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
retomerz/intellij-community | python/lib/Lib/site-packages/django/contrib/gis/management/commands/ogrinspect.py | 324 | 6252 | import os, sys
from optparse import make_option
from django.contrib.gis import gdal
from django.contrib.gis.management.base import ArgsCommand, CommandError
def layer_option(option, opt, value, parser):
"""
Callback for `make_option` for the `ogrinspect` `layer_key`
keyword option which may be an integer o... | apache-2.0 |
SolarLune/SolHelp | BGE/bghelper/time.py | 1 | 1469 | __author__ = 'SolarLune'
from bge import logic
# Time-based mechanics.
class TimerBank():
def __init__(self):
self.time = 0.0
self.timers = {}
def add(self, timer_name):
self.timers[timer_name] = Timer()
def set(self, timer_name, time):
self.timers[timer_name].set(... | mit |
michael-afanasiev/specfemHelperScripts | setup_specfem_lasif.py | 1 | 11312 | #!/usr/bin/env python
import os, errno, shutil
import sys, subprocess
import argparse
import xml.etree.ElementTree as ET
class ParameterError(Exception):
pass
class PathError(Exception):
pass
class MesherNotRunError(Exception):
pass
class colours:
ylw = '\033[93m'
blu = '\033[94m'
... | gpl-2.0 |
pitch-sands/i-MPI | flask/Lib/site-packages/werkzeug/contrib/limiter.py | 295 | 1333 | # -*- coding: utf-8 -*-
"""
werkzeug.contrib.limiter
~~~~~~~~~~~~~~~~~~~~~~~~
A middleware that limits incoming data. This works around problems with
Trac_ or Django_ because those directly stream into the memory.
.. _Trac: http://trac.edgewall.org/
.. _Django: http://www.djangoproject.com/
... | bsd-3-clause |
kemalakyol48/python-for-android | python3-alpha/python3-src/Lib/encodings/shift_jisx0213.py | 816 | 1059 | #
# shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jisx0213')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEnc... | apache-2.0 |
m11s/MissionPlanner | Lib/site-packages/numpy/f2py/f90mod_rules.py | 51 | 9100 | #!"C:\Users\hog\Documents\Visual Studio 2010\Projects\ArdupilotMega\ArdupilotMega\bin\Debug\ipy.exe"
"""
Build F90 module support for f2py2e.
Copyright 2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy L... | gpl-3.0 |
Vettejeep/Boulder_County_Home_Prices | value_vs_price.py | 1 | 4101 | # Simply uses the assessors estimate to predict price, so we can see how much better the machine learning models are.
# requires data from Assemble_Data.py
# Copyright (C) 2017 Kevin Maher
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public Lice... | gpl-3.0 |
Glottotopia/aagd | moin/local/moin/build/lib.linux-x86_64-2.6/MoinMoin/support/pygments/lexers/special.py | 3 | 3180 | # -*- coding: utf-8 -*-
"""
pygments.lexers.special
~~~~~~~~~~~~~~~~~~~~~~~
Special lexers.
:copyright: Copyright 2006-2010 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import cStringIO
from pygments.lexer import Lexer
from pygments.toke... | mit |
ppmt/Crust | flask/lib/python2.7/site-packages/webob/dec.py | 24 | 10184 | """
Decorators to wrap functions to make them WSGI applications.
The main decorator :class:`wsgify` turns a function into a WSGI
application (while also allowing normal calling of the method with an
instantiated request).
"""
from webob.compat import (
bytes_,
text_type,
)
from webob.request import Reque... | gpl-2.0 |
stvstnfrd/edx-platform | cms/djangoapps/contentstore/management/commands/git_export.py | 1 | 2578 | """
This command exports a course from CMS to a git repository.
It takes as arguments the course id to export (i.e MITx/999/2020 ) and
the repository to commit too. It takes username as an option for identifying
the commit, as well as a directory path to place the git repository.
By default it will use settings.GIT_R... | agpl-3.0 |
songjiguo/C3-IDL-Compiler | c3_parser.py | 2 | 15156 | #!/usr/bin/python
# title :c3_parser.py
# description :This script preprocesses the IDL language mostly defined in macro
# and send to the 2nd stage to generagte the AST and the final interface code in C
# author :Jiguo Song
# date :20150817
# version :0.... | bsd-3-clause |
nachandr/cfme_tests | cfme/control/explorer/alerts.py | 2 | 17778 | """Page model for Control / Explorer"""
from copy import copy
import attr
from navmazing import NavigateToAttribute
from navmazing import NavigateToSibling
from widgetastic.exceptions import NoSuchElementException
from widgetastic.widget import Checkbox
from widgetastic.widget import Text
from widgetastic.widget impor... | gpl-2.0 |
XeCycle/indico | indico_zodbimport/modules/event_logs.py | 2 | 5771 | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 |
CasataliaLabs/biscuit_drishtiman | Pmw-2.0.0/Pmw/Pmw_2_0_0/lib/PmwButtonBox.py | 2 | 8437 | # Based on iwidgets2.2.0/buttonbox.itk code.
import types
import tkinter
import Pmw
class ButtonBox(Pmw.MegaWidget):
def __init__(self, parent = None, **kw):
# Define the megawidget options.
INITOPT = Pmw.INITOPT
optiondefs = (
('labelmargin', 0, ... | gpl-3.0 |
CiNC0/Cartier | cartier-python-resign-linux/tests/test_public_interface.py | 1 | 1352 | from isign_base_test import IsignBaseTest
import os
from os.path import exists
from isign import isign
import logging
log = logging.getLogger(__name__)
class TestPublicInterface(IsignBaseTest):
def _test_signable(self, filename, output_path):
self.resign(filename, output_path=output_path)
assert... | apache-2.0 |
yukoba/sympy | sympy/utilities/autowrap.py | 37 | 31887 | """Module for compiling codegen output, and wrap the binary for use in
python.
.. note:: To use the autowrap module it must first be imported
>>> from sympy.utilities.autowrap import autowrap
This module provides a common interface for different external backends, such
as f2py, fwrap, Cython, SWIG(?) etc. (Curren... | bsd-3-clause |
Meshu/three.js | utils/exporters/blender/addons/io_three/exporter/api/material.py | 124 | 7818 | from bpy import data, types
from .. import constants, logger
from .constants import MULTIPLY, WIRE, IMAGE
def _material(func):
"""
:param func:
"""
def inner(name, *args, **kwargs):
"""
:param name:
:param *args:
:param **kwargs:
"""
if isinstance(... | mit |
opentrials/collectors | migrations/env.py | 2 | 1428 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import os
import sys
import sqlalchemy as sa
from alembic import context
def run_migrations_offline():
"""Run migrations in 'offline' mode.
... | mit |
paulmathews/nova | nova/openstack/common/rpc/amqp.py | 1 | 15162 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright 2011 - 2012, Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
... | apache-2.0 |
sakuyaa/shadowsocks | shadowsocks/crypto/openssl.py | 1038 | 5414 | #!/usr/bin/env python
#
# Copyright 2015 clowwindy
#
# 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 |
Kevin-Dunlap/d7-platform | sites/all/themes/esdsite/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py | 1789 | 10585 | # Copyright (c) 2014 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.
"""Xcode-ninja wrapper project file generator.
This updates the data structures passed to the Xcode gyp generator to build
with ninja instead. The Xcode project i... | gpl-2.0 |
chaddienhart/UdacityP4-GAE-API | conference.py | 1 | 29852 | #!/usr/bin/env python
"""
conference.py -- Udacity conference server-side Python App Engine API;
uses Google Cloud Endpoints
$Id: conference.py,v 1.25 2014/05/24 23:42:19 wesc Exp wesc $
created by wesc on 2014 apr 21
"""
__author__ = 'wesc+api@google.com (Wesley Chun)'
from datetime import datetime
import ... | apache-2.0 |
edlabh/SickRage | lib/guessit/fileutils.py | 33 | 2885 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2013 Nicolas Wack <wackou@gmail.com>
#
# GuessIt is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free ... | gpl-3.0 |
csparpa/pyowm | tests/integration/agroapi10/test_integration_soil_data.py | 1 | 1137 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import os
from pyowm import owm
from pyowm.agroapi10.polygon import GeoPolygon
from pyowm.agroapi10.soil import Soil
class IntegrationTestsSoilData(unittest.TestCase):
__owm = owm.OWM(os.getenv('OWM_API_KEY', None))
def test_call_soil_data(self)... | mit |
pasquantonio/blackjack_terminal | src/blackjack.py | 1 | 20969 | #!/usr/bin/env python
import sqlite3
import argparse
import sys
import time
from player_class import Player, Fore, randint
from bot_player_class import BotPlayer
from dealer_class import Dealer
from deck_class import Deck
"""
Global Game Functions
"""
def create_players(p, bots, minimum, maximum):
""" Create and ap... | mit |
muff1nman/password-store | contrib/importers/kedpm2pass.py | 42 | 1568 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Antoine Beaupré <anarcat@orangeseeds.org>. All Rights Reserved.
# This file is licensed under the GPLv2+. Please see COPYING for more information.
#
# To double-check your import worked:
# grep Path passwords | sed 's#^Path: ##;s/$/.gpg/' | sort > lis... | gpl-2.0 |
drawks/go-carbon | receiver/parse/data/encode.py | 3 | 2084 | import pickle
import struct
import carbon_pb2
data = [
[('param1', (1423931224, 60.2))],
[('param1', (1423931224, 60.2), (1423931225, 50.2), (1423931226, 40.2))],
[('param1', (1423931224, 60.2)), ('param2', (1423931224, -15))],
[('param1', (1423931224, 60.2), (1423931284, 42)), ('param2', (1423931224, -15))],
]
d... | mit |
wanglongqi/sympy | sympy/plotting/pygletplot/plot_camera.py | 120 | 3888 | from __future__ import print_function, division
from pyglet.gl import *
from plot_rotation import get_spherical_rotatation
from util import get_model_matrix
from util import screen_to_model, model_to_screen
from util import vec_subs
class PlotCamera(object):
min_dist = 0.05
max_dist = 500.0
min_ortho_d... | bsd-3-clause |
xcyan/models | slim/datasets/dataset_factory.py | 33 | 1918 | # 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 |
bellowsj/aiopogo | aiopogo/pogoprotos/settings/fort_settings_pb2.py | 1 | 5612 | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pogoprotos/settings/fort_settings.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | mit |
nwjs/chromium.src | third_party/tlslite/tlslite/constants.py | 2 | 16402 | # Authors:
# Trevor Perrin
# Google - defining ClientCertificateType
# Google (adapted by Sam Rushing) - NPN support
# Dimitris Moraitis - Anon ciphersuites
# Dave Baggett (Arcode Corporation) - canonicalCipherName
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
#
# See the LICENSE file for legal i... | bsd-3-clause |
apmichaud/vitess-apm | py/zk/zkocc.py | 1 | 9075 | import itertools
import json
import logging
import os
import random
import threading
from net import bsonrpc
from net import gorpc
class ZkOccError(Exception):
pass
#
# the ZkNode dict returned by these structures has the following members:
#
# Path string
# Data string
# Stat ZkStat
# Children []strin... | bsd-3-clause |
foursquare/pants | src/python/pants/backend/jvm/tasks/jvm_tool_task_mixin.py | 2 | 2274 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
from pants.backend.jvm.subsystems.jvm_tool_mixin import JvmToolMixin
from pants.task.task... | apache-2.0 |
seguijoaquin/taller2-appserver | Appserver/utilities/GoogleTest/googlemock/scripts/generator/cpp/ast.py | 384 | 62773 | #!/usr/bin/env python
#
# Copyright 2007 Neal Norwitz
# Portions Copyright 2007 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... | mit |
whatever/Euler | 057/solution.py | 2 | 1482 | # Greatest Common Divisor
# Computes the Greatest Common Divisor between two integers using Euclid's
# Algorithm. If the innards are wrapped in more efficient methods, then it'd
# likely work quickly for very large integers!
def gcd (a, b):
# Let us compute the gcd of negative numbers
if a < 0: a = -a
if b < 0: b... | unlicense |
yourlabs/django-cities-light | src/cities_light/tests/base.py | 1 | 2657 | """."""
import os
from unittest import mock
from django import test
from django.core import management
from django.conf import settings
class FixtureDir:
"""Helper class to construct fixture paths."""
def __init__(self, rel_path='', base_dir=None):
"""Class constructor.
params:
rel_... | mit |
wfxiang08/django197 | django/conf/locale/fi/formats.py | 504 | 1390 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G.i'
DATET... | bsd-3-clause |
weimingtom/python-for-android | python3-alpha/python3-src/Lib/email/mime/audio.py | 159 | 2674 | # Copyright (C) 2001-2007 Python Software Foundation
# Author: Anthony Baxter
# Contact: email-sig@python.org
"""Class representing audio/* type MIME documents."""
__all__ = ['MIMEAudio']
import sndhdr
from io import BytesIO
from email import encoders
from email.mime.nonmultipart import MIMENonMultipart
_sndhdr... | apache-2.0 |
anish/buildbot | master/buildbot/util/eventual.py | 6 | 2775 | # This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | gpl-2.0 |
ntiufalara/openerp7 | openerp/addons/document_page/wizard/document_page_show_diff.py | 59 | 2212 | # -*- 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... | mit |
nwjs/chromium.src | third_party/blink/tools/blinkpy/third_party/wpt/wpt/tools/third_party/html5lib/html5lib/serializer.py | 45 | 15746 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from codecs import register_error, xmlcharrefreplace_errors
from .constants import voidElements, booleanAttributes, spaceCharacters
from .constants import rcdataElements, entities, xmlEntities
from . import treewal... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.