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 |
|---|---|---|---|---|---|
DDEFISHER/servo | tests/wpt/web-platform-tests/tools/wptserve/wptserve/request.py | 136 | 16506 | import base64
import cgi
import Cookie
import os
import StringIO
import tempfile
import urlparse
import stash
from utils import HTTPException
missing = object()
class Server(object):
"""Data about the server environment
.. attribute:: config
Environment configuration information with information about... | mpl-2.0 |
rcrowder/nupic | src/nupic/algorithms/backtracking_tm_shim.py | 6 | 9992 | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2014, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | agpl-3.0 |
felipebetancur/scipy | doc/postprocess.py | 101 | 1442 | #!/usr/bin/env python
"""
%prog MODE FILES...
Post-processes HTML and Latex files output by Sphinx.
MODE is either 'html' or 'tex'.
"""
import re, optparse
def main():
p = optparse.OptionParser(__doc__)
options, args = p.parse_args()
if len(args) < 1:
p.error('no mode given')
mode = args.po... | bsd-3-clause |
atsao72/sympy | sympy/solvers/diophantine.py | 11 | 79096 | from __future__ import print_function, division
from sympy import (Poly, igcd, divisors, sign, symbols, S, Integer, Wild, Symbol, factorint,
Add, Mul, solve, ceiling, floor, sqrt, sympify, Subs, ilcm, Matrix, factor_list, perfect_power,
isprime, nextprime, integer_nthroot)
from sympy.core.function import _mex... | bsd-3-clause |
yusiwen/offlineimap | offlineimap/syncmaster.py | 22 | 1711 | # OfflineIMAP synchronization master code
# Copyright (C) 2002-2007 John Goerzen
# <jgoerzen@complete.org>
#
# 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 Lice... | gpl-2.0 |
joshimoo/Algorithm-Implementations | Fibonacci_series/Python/jcla1/fib.py | 27 | 1515 | # This is a recursive implementation of the fibonacci series.
# This is the most natural representaion of the series
# The recurrence relation is quite simple:
# f(0) = 0
# f(1) = 1
# f(n) = f(n-1) + f(n-2)
# There is no point in trying to implement
# the fibonacci series in a tail-call recursive manner
# since t... | mit |
jmaurice/letsencrypt | acme/acme/jose/jwk_test.py | 31 | 5436 | """Tests for acme.jose.jwk."""
import unittest
from acme import test_util
from acme.jose import errors
from acme.jose import json_util
from acme.jose import util
DSA_PEM = test_util.load_vector('dsa512_key.pem')
RSA256_KEY = test_util.load_rsa_private_key('rsa256_key.pem')
RSA512_KEY = test_util.load_rsa_private_ke... | apache-2.0 |
naderm/cs188 | p3/reinforcement/graphicsDisplay.py | 6 | 28082 | # graphicsDisplay.py
# ------------------
# Licensing Information: You are free to use or extend these projects for
# educational purposes provided that (1) you do not distribute or publish
# solutions, (2) you retain this notice, and (3) you provide clear
# attribution to UC Berkeley, including a link to
# ht... | bsd-3-clause |
indashnet/InDashNet.Open.UN2000 | android/external/chromium_org/third_party/mesa/src/src/mapi/glapi/gen/gl_x86_asm.py | 11 | 8663 | #!/usr/bin/env python
# (C) Copyright IBM Corporation 2004, 2005
# All Rights Reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# ... | apache-2.0 |
rschnapka/odoo | addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report.py | 52 | 9652 | # -*- 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 |
kmacinnis/sympy | sympy/assumptions/assume.py | 3 | 5514 | from __future__ import print_function, division
import inspect
from sympy.core.cache import cacheit
from sympy.core.singleton import S
from sympy.logic.boolalg import Boolean
from sympy.utilities.source import get_class
from contextlib import contextmanager
class AssumptionsContext(set):
"""Set representing assu... | bsd-3-clause |
eirannejad/pyRevit | site-packages/sqlalchemy/pool.py | 32 | 49813 | # sqlalchemy/pool.py
# Copyright (C) 2005-2017 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Connection pooling for DB-API connections.
Provides a number of connection p... | gpl-3.0 |
chenyyx/scikit-learn-doc-zh | examples/en/decomposition/plot_ica_vs_pca.py | 59 | 3329 | """
==========================
FastICA on 2D point clouds
==========================
This example illustrates visually in the feature space a comparison by
results using two different component analysis techniques.
:ref:`ICA` vs :ref:`PCA`.
Representing ICA in the feature space gives the view of 'geometric ICA':
ICA... | gpl-3.0 |
evro/CouchPotatoServer | libs/suds/metrics.py | 211 | 2004 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser 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 distributed in the hope that it will ... | gpl-3.0 |
jswope00/griffinx | common/lib/capa/capa/checker.py | 123 | 5899 | #!/usr/bin/env python
"""
Commandline tool for doing operations on Problems
"""
from __future__ import unicode_literals
import argparse
import logging
import sys
from path import path
from cStringIO import StringIO
from calc import UndefinedVariable
from capa.capa_problem import LoncapaProblem
from mako.lookup impor... | agpl-3.0 |
hachard/Cra-Magnet | flask/lib/python3.5/site-packages/defusedxml/ElementTree.py | 53 | 4031 | # defusedxml
#
# Copyright (c) 2013 by Christian Heimes <christian@python.org>
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/psf/license for licensing details.
"""Defused xml.etree.ElementTree facade
"""
from __future__ import print_function, absolute_import
import sys
from .common impor... | gpl-3.0 |
Azulinho/ansible | lib/ansible/modules/web_infrastructure/supervisorctl.py | 49 | 8666 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Matt Wright <matt@nobien.net>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | gpl-3.0 |
biocore/qiime | tests/test_split_libraries_lea_seq.py | 15 | 24312 | #!/usr/bin/env python
from __future__ import division
__author__ = "Charudatta Navare"
__copyright__ = "Copyright 2014, The QIIME Project"
__credits__ = ["Charudatta Navare"]
__license__ = "GPL"
__version__ = "1.9.1-dev"
__maintainer__ = "Charudatta Navare"
__email__ = "charudatta.navare@gmail.com"
from tempfile impo... | gpl-2.0 |
mwv/scikit-learn | examples/classification/plot_lda_qda.py | 164 | 4806 | """
====================================================================
Linear and Quadratic Discriminant Analysis with confidence ellipsoid
====================================================================
Plot the confidence ellipsoids of each class and decision boundary
"""
print(__doc__)
from scipy import lin... | bsd-3-clause |
terrycojones/dark-matter | bin/sam-to-fasta-alignment.py | 2 | 3449 | #!/usr/bin/env python
"""
Extract aligned (i.e., padded) queries in FASTA format from a SAM/BAM file.
"""
from __future__ import division, print_function
import sys
import argparse
from dark.filter import (
addFASTAFilteringCommandLineOptions, parseFASTAFilteringCommandLineOptions)
from dark.reads import Reads
... | mit |
mmbtba/odoo | addons/hr_payroll/report/report_payslip.py | 377 | 1982 | #-*- coding:utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# d$
#
# This program is free software: you can redistribute it and/or modify
# it... | agpl-3.0 |
mmbtba/odoo | addons/l10n_jp/__openerp__.py | 220 | 1902 | # -*- coding: utf-8 -*-
# Copyright (C) Rooms For (Hong Kong) Limited T/A OSCG
#
# 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
# License, or (at y... | agpl-3.0 |
elainenaomi/sciwonc-dataflow-examples | dissertation2017/Experiment 1B/instances/11_1_workflow_full_10files_secondary_w1_3sh_3rs_with_annot_with_proj_3s_hash/taskevent_2/TaskEvent_2.py | 37 | 6282 | #!/usr/bin/env python
"""
Computes per event type:
- how many tasks are per event?
- which is the average and standard deviation of CPU request per event?
- which is the average and standard deviation of Memory request per event?
"""
# It will connect to DataStoreClient
from sciwonc.dataflow.DataStoreClient impo... | gpl-3.0 |
crosswalk-project/chromium-crosswalk-efl | tools/perf/page_sets/page_cycler/morejs.py | 34 | 1434 | # 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.
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class MorejsPage(page_module.Page):
def __init__(sel... | bsd-3-clause |
rooi/CouchPotatoServer | couchpotato/core/media/_base/searcher/base.py | 10 | 1312 | from couchpotato.core.event import addEvent, fireEvent
from couchpotato.core.logger import CPLog
from couchpotato.core.plugins.base import Plugin
log = CPLog(__name__)
class SearcherBase(Plugin):
in_progress = False
def __init__(self):
super(SearcherBase, self).__init__()
addEvent('search... | gpl-3.0 |
zorbathut/frames | deps/freetype-2.5.3/src/src/tools/docmaker/formatter.py | 515 | 4962 | # Formatter (c) 2002, 2004, 2007, 2008 David Turner <david@freetype.org>
#
from sources import *
from content import *
from utils import *
# This is the base Formatter class. Its purpose is to convert
# a content processor's data into specific documents (i.e., table of
# contents, global index, and individual API... | gpl-3.0 |
Nicop06/ansible | lib/ansible/vars/unsafe_proxy.py | 51 | 1219 | # (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 option) any later... | gpl-3.0 |
hemanthariyani/omap-kernel | arch/ia64/scripts/unwcheck.py | 13143 | 1714 | #!/usr/bin/python
#
# Usage: unwcheck.py FILE
#
# This script checks the unwind info of each function in file FILE
# and verifies that the sum of the region-lengths matches the total
# length of the function.
#
# Based on a shell/awk script originally written by Harish Patil,
# which was converted to Perl by Matthew Ch... | gpl-2.0 |
PlushBeaver/FanFicFare | included_dependencies/html5lib/treebuilders/dom.py | 920 | 8469 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
class A... | gpl-3.0 |
hackerbot/DjangoDev | tests/template_tests/test_logging.py | 210 | 2286 | from __future__ import unicode_literals
import logging
from django.template import Engine, Variable, VariableDoesNotExist
from django.test import SimpleTestCase
class TestHandler(logging.Handler):
def __init__(self):
super(TestHandler, self).__init__()
self.log_record = None
def emit(self, ... | bsd-3-clause |
sunu/oppia-test-4 | feconf.py | 1 | 4185 | # coding: utf-8
#
# Copyright 2012 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 ... | apache-2.0 |
slobberchops/rop | webrop.py | 1 | 3626 | from flask import Flask, Response, jsonify
import logging
logging.basicConfig(filename='web.log', level=logging.INFO)
import config
import os.path
from random import seed
from time import time
import traceback
from importer import ImportPlugins
from opc.matrix import OPCMatrix
# This code remains experimental. Co... | gpl-3.0 |
alexmandujano/django | tests/view_tests/tests/test_i18n.py | 40 | 10256 | # -*- coding:utf-8 -*-
from __future__ import absolute_import
import gettext
import os
from os import path
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test import LiveServerTestCase, TestCase
from django.test.utils import override_settings
from django.utils import six, un... | bsd-3-clause |
jeffsee55/ntb-sage | node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/MSVSSettings.py | 383 | 45223 | # 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.
r"""Code to validate and convert settings of the Microsoft build tools.
This file contains code to validate and convert settings of the Microsoft
build tools. Th... | mit |
insomniacslk/dpkt | tests/test-perf.py | 24 | 5648 | #!/usr/bin/env python
import time, sys
import dnet
sys.path.insert(0, '.')
import dpkt
from impacket import ImpactDecoder, ImpactPacket
from openbsd import packet
import scapy
import xstruct
xip = xstruct.structdef('>', [
('v_hl', ('B', 1), (4 << 4) | (dnet.IP_HDR_LEN >> 2)),
('tos', ('B', 1), dnet.IP_TOS_DE... | bsd-3-clause |
kailIII/geraldo | site/newsite/django_1_0/django/template/__init__.py | 11 | 35488 | """
This is the Django template system.
How it works:
The Lexer.tokenize() function converts a template string (i.e., a string containing
markup with custom template tags) to tokens, which can be either plain text
(TOKEN_TEXT), variables (TOKEN_VAR) or block statements (TOKEN_BLOCK).
The Parser() class takes a list ... | lgpl-3.0 |
chris-chris/tensorflow | tensorflow/contrib/framework/python/ops/ops.py | 30 | 2598 | # 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 |
liangazhou/django-rdp | packages/Django-1.8.6/build/lib/django/forms/formsets.py | 100 | 17573 | from __future__ import unicode_literals
from django.core.exceptions import ValidationError
from django.forms import Form
from django.forms.fields import BooleanField, IntegerField
from django.forms.utils import ErrorList
from django.forms.widgets import HiddenInput
from django.utils import six
from django.utils.encodi... | apache-2.0 |
olapaola/olapaola-android-scripting | python/gdata/src/gdata/tlslite/integration/ClientHelper.py | 285 | 7021 | """
A helper class for using TLS Lite with stdlib clients
(httplib, xmlrpclib, imaplib, poplib).
"""
from gdata.tlslite.Checker import Checker
class ClientHelper:
"""This is a helper class used to integrate TLS Lite with various
TLS clients (e.g. poplib, smtplib, httplib, etc.)"""
def __init__... | apache-2.0 |
randynobx/ansible | test/units/plugins/connection/test_ssh.py | 20 | 29307 | # -*- coding: utf-8 -*-
# (c) 2015, 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
# (a... | gpl-3.0 |
aperigault/ansible | lib/ansible/modules/cloud/openstack/os_server.py | 25 | 25051 | #!/usr/bin/python
# coding: utf-8 -*-
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2013, Benno Joy <benno@ansible.com>
# Copyright (c) 2013, John Dewey <john@dewey.ws>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import ... | gpl-3.0 |
zero-ui/miniblink49 | v8_5_7/testing/gmock/scripts/gmock_doctor.py | 346 | 24131 | #!/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-3.0 |
AndrewGrossman/django | django/views/decorators/debug.py | 712 | 2627 | import functools
from django.http import HttpRequest
def sensitive_variables(*variables):
"""
Indicates which variables used in the decorated function are sensitive, so
that those variables can later be treated in a special way, for example
by hiding them when logging unhandled exceptions.
Two f... | bsd-3-clause |
reubano/csvkit | csvkit/convert/__init__.py | 17 | 2264 | #!/usr/bin/env python
import six
from csvkit.convert.csvitself import csv2csv
from csvkit.convert.fixed import fixed2csv
from csvkit.convert.geojs import geojson2csv
from csvkit.convert.js import json2csv
from csvkit.convert.ndjs import ndjson2csv
from csvkit.convert.xls import xls2csv
from csvkit.convert.xlsx import... | mit |
ironbox360/django | tests/gis_tests/geo3d/models.py | 302 | 1294 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
darcy0511/Dato-Core | src/unity/python/graphlab/test/test_dataframe.py | 13 | 1711 | '''
Copyright (C) 2015 Dato, Inc.
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the DATO-PYTHON-LICENSE file for details.
'''
import unittest
import pandas
import array
from graphlab.cython.cy_dataframe import _dataframe
from pandas.util.testing import asser... | agpl-3.0 |
andykimpe/chromium-test-npapi | native_client_sdk/src/build_tools/buildbot_run.py | 10 | 4283 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Main entry point for the NaCl SDK buildbot.
The entry point used to be build_sdk.py itself, but we want
to be able to simplify ... | bsd-3-clause |
DrOctogon/unwash_ecom | oscar/apps/wishlists/migrations/0001_initial.py | 15 | 17221 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
from oscar.core.compat import AUTH_USER_MODEL, AUTH_USER_MODEL_NAME
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'WishList'
db.create_tabl... | bsd-3-clause |
batxes/4Cin | SHH_WT_models_highres/SHH_WT_models_highres_final_output_0.1_-0.1_5000/mtx1_models/SHH_WT_models_highres17943.py | 4 | 88227 | 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 |
xzturn/tensorflow | tensorflow/python/framework/kernels.py | 18 | 1709 | # 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 |
ryanahall/django | django/db/backends/mysql/schema.py | 18 | 2871 | from django.db.backends.base.schema import BaseDatabaseSchemaEditor
from django.db.models import NOT_PROVIDED
class DatabaseSchemaEditor(BaseDatabaseSchemaEditor):
sql_rename_table = "RENAME TABLE %(old_table)s TO %(new_table)s"
sql_alter_column_null = "MODIFY %(column)s %(type)s NULL"
sql_alter_column_... | bsd-3-clause |
alfredodeza/boto | boto/exception.py | 117 | 17106 | # Copyright (c) 2006-2010 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2010, Eucalyptus Systems, Inc.
# All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without res... | mit |
ttsubo/ryu | ryu/lib/ofctl_v1_0.py | 1 | 18053 | # Copyright (C) 2012 Nippon Telegraph and Telephone Corporation.
#
# 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 |
immesys/RiSyn | tests/pthread_tls/tests/01-run.py | 6 | 1349 | #!/usr/bin/env python3
import os
import sys
def _check_test_output(child):
child.expect('show tls values:')
for i in range(20):
if i != 5:
child.expect('key\[%d\]: \d+, val: %d'
% (i, i + 1 if i != 3 else 42))
def testfunc(child):
child.expect('START')
c... | lgpl-2.1 |
AntaresOne/AntaresCore-Kernel-h815 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
akmetainfo/opencorpora | scripts/ma_pools/unpublish_pools.py | 1 | 1437 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import time
import ConfigParser, MySQLdb
from MySQLdb.cursors import DictCursor
POOL_STATUS_PUBLISHED = 3
POOL_STATUS_UNPUBLISHED = 4
def check_pools(dbh):
dbh.execute("""
SELECT pool_id
FROM morph_annot_pools
WHERE status = {0}
... | gpl-2.0 |
jlegendary/servo | tests/wpt/web-platform-tests/tools/html5lib/html5lib/treebuilders/dom.py | 920 | 8469 | from __future__ import absolute_import, division, unicode_literals
from xml.dom import minidom, Node
import weakref
from . import _base
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
def getDomBuilder(DomImplementation):
Dom = DomImplementation
class A... | mpl-2.0 |
meganbkratz/acq4 | acq4/pyqtgraph/opengl/items/GLSurfacePlotItem.py | 52 | 5204 | from OpenGL.GL import *
from .GLMeshItem import GLMeshItem
from .. MeshData import MeshData
from ...Qt import QtGui
import numpy as np
__all__ = ['GLSurfacePlotItem']
class GLSurfacePlotItem(GLMeshItem):
"""
**Bases:** :class:`GLMeshItem <pyqtgraph.opengl.GLMeshItem>`
Displays a surface plot on a r... | mit |
junhuac/MQUIC | src/tools/cr/cr/actions/linux.py | 16 | 1318 | # 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.
"""A module to hold linux specific action implementations."""
import cr
class LinuxRunner(cr.Runner):
"""An implementation of cr.Runner for the linux pl... | mit |
Geew/shoppingDemo | app.py | 1 | 1437 | # coding: utf8
#!/usr/bin/env python
import os.path
import sys
sys.path.append(os.path.dirname(__file__))
import tornado.httpserver
import tornado.ioloop
import tornado.options
import tornado.web
from config import configs
class Application(tornado.web.Application):
def __init__(self):
handlers = []
... | gpl-2.0 |
dylanGeng/BuildingMachineLearningSystemsWithPython | ch02/figure2.py | 22 | 1732 | # This code is supporting material for the book
# Building Machine Learning Systems with Python
# by Willi Richert and Luis Pedro Coelho
# published by PACKT Publishing
#
# It is made available under the MIT License
COLOUR_FIGURE = False
from matplotlib import pyplot as plt
from sklearn.datasets import load_iris
data... | mit |
Jonas-Drotleff/YoWhenReady | requests/packages/chardet/langhebrewmodel.py | 2763 | 11318 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Simon Montagu
# Portions created by the Initial Developer are Copyright (C) 2005
# the Initial Developer. All Rights Reserved... | apache-2.0 |
amisrs/one-eighty | angular_flask/lib/python2.7/site-packages/sqlalchemy/orm/identity.py | 12 | 6992 | # orm/identity.py
# Copyright (C) 2005-2013 the SQLAlchemy authors and contributors <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
import weakref
from . import attributes
class IdentityMap(dict):
def __init__(se... | mit |
MenZil/kuma | vendor/packages/translate/lang/fa.py | 26 | 2366 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2007, 2010 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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 ... | mpl-2.0 |
ktdreyer/teuthology | teuthology/task/mpi.py | 10 | 4558 | """
Start mpi processes (and allow commands to be run inside process)
"""
from StringIO import StringIO
import logging
import re
from teuthology import misc as teuthology
log = logging.getLogger(__name__)
def _check_mpi_version(remotes):
"""
Retrieve the MPI version from each of `remotes` and raise an excep... | mit |
damdam-s/OCB | openerp/tools/graph.py | 441 | 26118 | #!/usr/bin/env python
# -*- 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 unde... | agpl-3.0 |
geneanet/moneta | moneta/http/server.py | 1 | 6949 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from gevent.server import StreamServer
from gevent import sleep
import logging
from fcntl import fcntl, F_GETFD, F_SETFD, FD_CLOEXEC
from collections import OrderedDict
import re
import json
import traceback
from moneta.http.http import *
logger = loggi... | bsd-3-clause |
Nexenta/cinder | cinder/volume/drivers/falconstor/iscsi.py | 5 | 3928 | # Copyright (c) 2016 FalconStor, 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 requ... | apache-2.0 |
mfherbst/spack | lib/spack/spack/util/spack_yaml.py | 2 | 12644 | ##############################################################################
# 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 |
jciskey/pygraph | pygraph/helpers/functions.py | 1 | 6839 | """Gathers together a collection of helper functions and classes that the library needs,
but end users won't care about."""
import copy
from ..classes import UndirectedGraph, DirectedGraph
# Graph Conversions
def make_subgraph(graph, vertices, edges):
"""Converts a subgraph given by a list of vertices and edge... | mit |
felixjimenez/django | django/template/loaders/app_directories.py | 105 | 2354 | """
Wrapper for loading templates from "templates" directories in INSTALLED_APPS
packages.
"""
import os
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.template.base import TemplateDoesNotExist
from django.template.loader import BaseLoader
from django.u... | bsd-3-clause |
santosh-surya/pcb-cnc-machine | desktop-application/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/input_test.py | 1841 | 3207 | #!/usr/bin/env python
# Copyright 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unit tests for the input.py file."""
import gyp.input
import unittest
import sys
class TestFindCycles(unittest.TestCase):
def setUp(self... | gpl-3.0 |
hWorblehat/smfs | googletest/googletest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | gpl-2.0 |
aldevigi/ursula | plugins/filters/ursula_filters.py | 17 | 1147 | import os
def ursula_controller_ips(hostvars, groups, controller_name='controller'):
controller_ips = set()
for host in groups[controller_name]:
controller_primary_interface = hostvars[host]['primary_interface']
ip = hostvars[host][controller_primary_interface]['ipv4']['address']
contr... | mit |
liuqr/edx-xiaodun | lms/djangoapps/wechat/courses.py | 7 | 11260 | from collections import defaultdict
from fs.errors import ResourceNotFoundError
import logging
import inspect
from path import path
from django.http import Http404
from django.conf import settings
from .module_render import get_module
from xmodule.course_module import CourseDescriptor
from xmodule.modulestore import L... | agpl-3.0 |
goddardl/cortex | test/IECore/JPEGImageReader.py | 12 | 7946 | ##########################################################################
#
# Copyright (c) 2007-2013, Image Engine Design 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:
#
# * Redis... | bsd-3-clause |
adhish20/TwitterWithCassandra | twiss/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/chardetect.py | 1786 | 2504 | #!/usr/bin/env python
"""
Script which takes one or more file paths and reports on their detected
encodings
Example::
% chardetect somefile someotherfile
somefile: windows-1252 with confidence 0.5
someotherfile: ascii with confidence 1.0
If no paths are provided, it takes its input from stdin.
"""
from... | mit |
wenhuizhang/dist-sys-exercises | lec-10/hadoop/reduce.py | 17 | 1027 | #!/usr/bin/env python
from operator import itemgetter
import sys
current_word = None
current_count = 0
word = None
# input comes from STDIN
for line in sys.stdin:
# remove leading and trailing whitespace
line = line.strip()
# parse the input we got from mapper.py
word, count = line.split('\t', 1)
... | mit |
a97001/comp2222prototype | node_modules/npm/node_modules/node-gyp/gyp/PRESUBMIT.py | 496 | 3373 | # 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.
"""Top-level presubmit script for GYP.
See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts
for more details about the presubmit API built... | gpl-3.0 |
dbcli/vcli | tests/features/db_utils.py | 1 | 1512 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import print_function
from vertica_python import connect
def create_schema(hostname='localhost', username=None, password=None,
dbname=None, port=None, schema_name=None):
"""Create test schema."""
cn = create_cn(... | bsd-3-clause |
droidlabour/git_intgrtn_aws_s3 | CreateSSHKey/Crypto/SelfTest/PublicKey/test_DSA.py | 118 | 9861 | # -*- coding: utf-8 -*-
#
# SelfTest/PublicKey/test_DSA.py: Self-test for the DSA primitive
#
# 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 dedic... | mit |
jmanday/Master | TFM/library/boost_1_63_0/tools/build/test/core_actions_quietly.py | 51 | 1038 | #!/usr/bin/python
# Copyright 2007 Rene Rivera.
# Copyright 2011 Steven Watanabe
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(pass_toolset=0)
t.write("file.jam", """\
actions qui... | apache-2.0 |
ForgottenKahz/CloudOPC | venv/Lib/site-packages/pip/_vendor/six.py | 878 | 29664 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2015 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 with... | mit |
wkschwartz/django | tests/generic_views/test_base.py | 10 | 22004 | import time
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
from django.test import RequestFactory, SimpleTestCase, override_settings
from django.test.utils import require_jinja2
from django.urls import resolve
from django.views.generic import RedirectView, TemplateView, Vi... | bsd-3-clause |
deginner/bitjws | tests/test_multisig.py | 1 | 1987 | import json
import pytest
import bitjws
def test_encode_decode():
key1 = bitjws.PrivateKey()
pubkey1 = bitjws.pubkey_to_addr(key1.pubkey.serialize())
key2 = bitjws.PrivateKey()
pubkey2 = bitjws.pubkey_to_addr(key2.pubkey.serialize())
ser = bitjws.multisig_sign_serialize([key1, key2])
headers, ... | mit |
pschmitt/home-assistant | homeassistant/components/rainmachine/sensor.py | 6 | 5800 | """This platform provides support for sensor data from RainMachine."""
import logging
from homeassistant.const import TEMP_CELSIUS
from homeassistant.core import callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from . import RainMachineEntity
from .const import (
DATA_CLIENT,
DAT... | apache-2.0 |
demorest/rtpipe | rtpipe/RT.py | 1 | 66374 | import rtpipe.parsems as pm
import rtpipe.parsecal as pc
import rtpipe.parsesdm as ps
import rtlib_cython as rtlib
import multiprocessing as mp
import multiprocessing.sharedctypes as mps
from contextlib import closing
import numpy as n
from scipy.special import erf
import scipy.stats.mstats as mstats
try:
import ca... | bsd-3-clause |
TNT-Samuel/Coding-Projects | DNS Server/Source - Copy/Lib/site-packages/setuptools/command/install_lib.py | 431 | 3840 | import os
import imp
from itertools import product, starmap
import distutils.command.install_lib as orig
class install_lib(orig.install_lib):
"""Don't add compiled flags to filenames of non-Python files"""
def run(self):
self.build()
outfiles = self.install()
if outfiles is not None:
... | gpl-3.0 |
mozilla/firefox-flicks | flicks/videos/tests/test_util.py | 1 | 2199 | from django.core import mail
from django.test.utils import override_settings
from mock import patch
from nose.tools import eq_, ok_
from pyquery import PyQuery as pq
from flicks.base.tests import TestCase
from flicks.users.tests import UserFactory, UserProfileFactory
from flicks.videos.tests import VideoFactory
from ... | bsd-3-clause |
waigani/GoAutoDeclare | goAutoDeclare.py | 1 | 3351 | # Copyright (c) 2014 Jesse Meek <https://github.com/waigani>
# This program is Free Software see LICENSE file for details.
""" GoAutoDeclare is a Sublime Text plugin which automatically corrects short
variable declaration ':=' and assignment operator '=' mistakes on save.
"""
import sublime, sublime_plugin, subproces... | mit |
acaranta/fig | fig/cli/errors.py | 1 | 1785 | from __future__ import absolute_import
from textwrap import dedent
class UserError(Exception):
def __init__(self, msg):
self.msg = dedent(msg).strip()
def __unicode__(self):
return self.msg
__str__ = __unicode__
class DockerNotFoundMac(UserError):
def __init__(self):
super(... | apache-2.0 |
Biktorgj/Tizen_b2_Kernel | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
glwu/python-for-android | python3-alpha/python3-src/Tools/msi/schema.py | 88 | 83800 | from msilib import Table
_Validation = Table('_Validation')
_Validation.add_field(1,'Table',11552)
_Validation.add_field(2,'Column',11552)
_Validation.add_field(3,'Nullable',3332)
_Validation.add_field(4,'MinValue',4356)
_Validation.add_field(5,'MaxValue',4356)
_Validation.add_field(6,'KeyTable',7679)
_Validation.add_... | apache-2.0 |
dzan/xenOnArm | tools/python/xen/xm/cpupool-new.py | 41 | 1702 | #============================================================================
# This library is free software; you can redistribute it and/or
# modify it under the terms of version 2.1 of the GNU Lesser General Public
# License as published by the Free Software Foundation.
#
# This library is distributed in the hope th... | gpl-2.0 |
chhe/streamlink | tests/test_utils_named_pipe.py | 3 | 5763 | import threading
import unittest
from unittest.mock import Mock, call, patch
from streamlink.compat import is_win32
from streamlink.utils.named_pipe import NamedPipe, NamedPipePosix, NamedPipeWindows
if is_win32:
from ctypes import windll, create_string_buffer, c_ulong, byref
GENERIC_READ = 0x80000000
OPEN_EXIS... | bsd-2-clause |
malcolmcrossley/sm | drivers/LVHDoISCSISR.py | 1 | 27645 | #!/usr/bin/python
#
# Copyright (C) Citrix Systems Inc.
#
# This program 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; version 2.1 only.
#
# This program is distributed in the hope that it will be u... | lgpl-2.1 |
timohtey/mediadrop_copy | mediacore_env/Lib/re.py | 153 | 12959 | #
# Secret Labs' Regular Expression Engine
#
# re-compatible interface for the sre matching engine
#
# Copyright (c) 1998-2001 by Secret Labs AB. All rights reserved.
#
# This version of the SRE library can be redistributed under CNRI's
# Python 1.6 license. For any other use, please contact Secret Labs
# AB (info@py... | gpl-3.0 |
Germanika/plover | plover/oslayer/log_dbus.py | 2 | 1337 |
import logging
import dbus
from plover import log, __name__ as __software_name__
APPNAME = __software_name__.capitalize()
SERVICE = 'org.freedesktop.Notifications'
INTERFACE = '/org/freedesktop/Notifications'
class DbusNotificationHandler(logging.Handler):
""" Handler using DBus notifications to show message... | gpl-2.0 |
vritant/subscription-manager | src/subscription_manager/base_plugin.py | 3 | 1448 | #
# Copyright (c) 2013 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of... | gpl-2.0 |
redhat-openstack/horizon | openstack_dashboard/dashboards/admin/defaults/tabs.py | 82 | 1417 | # Copyright 2013 Kylin, 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... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.