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 |
|---|---|---|---|---|---|
k0ste/ansible | test/support/integration/plugins/modules/nios_txt_record.py | 27 | 3936 | #!/usr/bin/python
# Copyright (c) 2018 Red Hat, Inc.
# 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',
'status': ['preview... | gpl-3.0 |
baylee/django | tests/template_tests/syntax_tests/test_spaceless.py | 521 | 1766 | from django.test import SimpleTestCase
from ..utils import setup
class SpacelessTagTests(SimpleTestCase):
@setup({'spaceless01': "{% spaceless %} <b> <i> text </i> </b> {% endspaceless %}"})
def test_spaceless01(self):
output = self.engine.render_to_string('spaceless01')
self.assertEqu... | bsd-3-clause |
mpasternak/michaldtz-fixes-518-522 | experimental/buffer/particles.py | 28 | 1906 | #!/usr/bin/python
# $Id:$
import random
import sys
from pyglet.gl import *
from pyglet import clock
from pyglet import font
from pyglet import graphics
from pyglet import window
MAX_PARTICLES = 1000
if len(sys.argv) > 1:
MAX_PARTICLES = int(sys.argv[1])
MAX_ADD_PARTICLES = 100
GRAVITY = -100
win = window.Windo... | bsd-3-clause |
guorendong/iridium-browser-ubuntu | third_party/trace-viewer/third_party/tvcm/third_party/rjsmin/bench/jsmin_2_0_9.py | 21 | 8203 | # This code is original from jsmin by Douglas Crockford, it was translated to
# Python by Baruch Even. It was rewritten by Dave St.Germain for speed.
#
# The MIT License (MIT)
#
# Copyright (c) 2013 Dave St.Germain
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and... | bsd-3-clause |
Spiderlover/Toontown | toontown/building/DistributedToonInteriorAI.py | 3 | 2001 | import cPickle
from direct.distributed import DistributedObjectAI
from direct.distributed.ClockDelta import *
from direct.fsm import ClassicFSM, State
from otp.ai.AIBaseGlobal import *
from toontown.toon import NPCToons
from toontown.toonbase.ToontownGlobals import *
class DistributedToonInteriorAI(DistributedObject... | mit |
rmm-fcul/workshops | 2015_graz/binary_choice/single_arena/xinhib_heaters.py | 1 | 14492 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
Four CASUs, with +ve feedback from self and from remote collaborator
(assumed to be in another arena); and -ve cross-inhibition from
local-ish competitor (assumed to be in local arena)
However, we have (optional/configurable) asymmetry in the interactions,
and diffe... | lgpl-3.0 |
philipan/paparazzi | sw/tools/parrot/ardrone2.py | 25 | 22475 | #!/usr/bin/env python
#
# Copyright (C) 2012-2014 The Paparazzi Team
#
# This file is part of Paparazzi.
#
# Paparazzi 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)
# an... | gpl-2.0 |
ammaradil/fibonacci | Lib/site-packages/pip/_vendor/html5lib/treebuilders/etree.py | 915 | 12621 | from __future__ import absolute_import, division, unicode_literals
from pip._vendor.six import text_type
import re
from . import _base
from .. import ihatexml
from .. import constants
from ..constants import namespaces
from ..utils import moduleFactoryFactory
tag_regexp = re.compile("{([^}]*)}(.*)")
def getETreeBu... | mit |
jacquesqiao/Paddle | go/pserver/client/c/test/test_mnist.py | 7 | 5239 | # Copyright (c) 2018 PaddlePaddle 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 app... | apache-2.0 |
tempbottle/Nuitka | nuitka/build/inline_copy/lib/scons-2.3.2/SCons/Tool/qt.py | 3 | 13161 |
"""SCons.Tool.qt
Tool-specific initialization for Qt.
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
#
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# Permission is hereby granted, free of charge, to ... | apache-2.0 |
cslarsen/crianza | setup.py | 1 | 1920 | from setuptools import setup
setup(
name="crianza",
packages=["crianza"],
version="0.1.9",
description="Simple Forth-like VM and genetic programming framework.",
author="Christian Stigen Larsen",
author_email="csl@csl.name",
url="https://github.com/cslarsen/crianza",
download_url="https... | bsd-3-clause |
TheVirtualLtd/bda.plone.productshop | src/bda/plone/productshop/interfaces.py | 1 | 2420 | # -*- coding: utf-8 -*-
from bda.plone.discount.interfaces import IDiscountSettingsEnabled
from bda.plone.shop.interfaces import IShopSettingsProvider
from collective.instancebehavior import IInstanceBehaviorAssignableContent
from plone.namedfile.interfaces import IImageScaleTraversable
from plone.supermodel import mod... | bsd-3-clause |
demon-ru/iml-crm | addons/point_of_sale/report/pos_payment_report.py | 380 | 3549 | # -*- 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 |
sjsucohort6/openstack | python/venv/lib/python2.7/site-packages/babel/messages/catalog.py | 32 | 31061 | # -*- coding: utf-8 -*-
"""
babel.messages.catalog
~~~~~~~~~~~~~~~~~~~~~~
Data structures for message catalogs.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import re
import time
from cgi import parse_header
from datetime import datetime, time as time_... | mit |
LukeC92/iris | lib/iris/tests/unit/quickplot/test_pcolor.py | 11 | 2324 | # (C) British Crown Copyright 2014 - 2016, Met Office
#
# This file is part of Iris.
#
# Iris 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 l... | lgpl-3.0 |
aimas/TuniErp-8.0 | openerp/addons/l10n_tu/report/misc.py | 458 | 1425 | # -*- 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... | agpl-3.0 |
d40223223/2015cd_midterm | static/Brython3.1.1-20150328-091302/Lib/_dummy_thread.py | 742 | 4769 | """Drop-in replacement for the thread module.
Meant to be used as a brain-dead substitute so that threaded code does
not need to be rewritten for when the thread module is not present.
Suggested usage is::
try:
import _thread
except ImportError:
import _dummy_thread as _thread
"""
# Exports ... | gpl-3.0 |
ukanga/SickRage | lib/github/AuthenticatedUser.py | 70 | 46818 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Steve English <steve.english@navetas.com> #
# Copyright 2012 Vincent Jacques <vincent@vincent-ja... | gpl-3.0 |
JioCloud/neutron | neutron/plugins/ml2/driver_context.py | 16 | 8856 | # Copyright (c) 2013 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
htzy/bigfour | common/djangoapps/course_action_state/migrations/0001_initial.py | 114 | 6793 | # -*- 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 model 'CourseRerunState'
db.create_table('course_action_state_coursererunstate', (
('id... | agpl-3.0 |
adykstra/mne-python | examples/datasets/plot_megsim_data.py | 1 | 1993 | """
.. _ex-megsim:
===========================================
MEGSIM experimental and simulation datasets
===========================================
The MEGSIM consists of experimental and simulated MEG data
which can be useful for reproducing research results.
The MEGSIM files will be dowloaded automatically.
Th... | bsd-3-clause |
redhat-openstack/nova | nova/tests/virt/hyperv/db_fakes.py | 6 | 5321 | # Copyright 2012 Cloudbase Solutions Srl
#
# 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 |
rail/treeherder | tests/autoclassify/test_classify_failures.py | 2 | 1646 | from django.core.management import call_command
from treeherder.model.models import Matcher, Repository
from treeherder.autoclassify.matchers import PreciseTestMatcher
from .utils import test_line, create_failure_lines
def test_classify_test_failure(activate_responses, jm, eleven_jobs_stored, initial_data,
... | mpl-2.0 |
saamrenton/GMBI | Modules/population_dynamics.py | 1 | 4532 | #A General Model of Biological Invasion (GMBI)
#Copyright (C) 2012 David Savage and Michael Renton
#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
#any later v... | gpl-3.0 |
takeshineshiro/horizon | openstack_dashboard/test/api_tests/config_rest_tests.py | 30 | 1086 | # Copyright 2015 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 by applicable law or agreed to in writing, sof... | apache-2.0 |
pcraston/django-preventconcurrentlogins | setup.py | 1 | 1156 | import os
from setuptools import setup, find_packages
ROOT = os.path.abspath(os.path.dirname(__file__))
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-preventconcurrentlogins',
version='0.8.2',
packages=find_pack... | mit |
pbmanis/acq4 | acq4/util/imaging/frame.py | 3 | 2154 | from __future__ import print_function
from acq4.pyqtgraph import Vector, SRTTransform3D
class Frame(object):
"""A single frame of imaging data including meta information.
Expects *info* to be a dictionary with some minimal information:
* 'frameTransform' maps from the image coordinates (0,0 at top-left)... | mit |
bavardage/statsmodels | statsmodels/sandbox/formula.py | 6 | 22869 | """
Provides the basic classes needed to specify statistical models.
namespace : dictionary
mapping from names to data, used to associate data to a formula or term
"""
import copy
import types
import numpy as np
try:
set
except NameError:
from sets import Set as set
__docformat__ = 'restructuredtext'
... | bsd-3-clause |
simsong/grr-insider | lib/flow_runner.py | 1 | 37982 | #!/usr/bin/env python
"""This file contains a helper class for the flows.
This flow context class provides all the methods for handling flows (i.e.,
calling clients, changing state, ...).
Each flow must have a flow runner before it can be executed. The flow runner is
responsible for queuing messages and maintaining s... | apache-2.0 |
arborh/tensorflow | tensorflow/lite/testing/op_tests/hardswish.py | 4 | 3045 | # Copyright 2019 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 |
bcl/blivet | blivet/formats/lvmpv.py | 4 | 5676 | # lvmpv.py
# Device format classes for anaconda's storage configuration module.
#
# Copyright (C) 2009 Red Hat, Inc.
#
# This copyrighted material is made available to anyone wishing to use,
# modify, copy, or redistribute it subject to the terms and conditions of
# the GNU General Public License v.2, or (at your opti... | gpl-2.0 |
mivade/tornado | tornado/test/iostream_test.py | 2 | 46831 | from tornado.concurrent import Future
from tornado import gen
from tornado import netutil
from tornado.ioloop import IOLoop
from tornado.iostream import (
IOStream,
SSLIOStream,
PipeIOStream,
StreamClosedError,
_StreamBuffer,
)
from tornado.httputil import HTTPHeaders
from tornado.locks import Condi... | apache-2.0 |
stosdev/registero | news/models.py | 1 | 1093 | # -*- coding: utf-8 -*-
from django.utils.translation import ugettext as _, pgettext_lazy
from django.utils.six import python_2_unicode_compatible
from django.contrib.sites.models import Site
from django.contrib.sites.managers import CurrentSiteManager
from django.core.urlresolvers import reverse
from django.db import ... | gpl-3.0 |
orgito/ansible | lib/ansible/modules/monitoring/zabbix/zabbix_template.py | 4 | 20154 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, sookido
# 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',
'status'... | gpl-3.0 |
Aaron1992/shadowsocks-final | shadowsocks/daemon.py | 694 | 5602 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014-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 requi... | apache-2.0 |
yukron/sphinx | api/test.py | 53 | 3218 | #
# $Id$
#
from sphinxapi import *
import sys, time
if not sys.argv[1:]:
print "Usage: python test.py [OPTIONS] query words\n"
print "Options are:"
print "-h, --host <HOST>\tconnect to searchd at host HOST"
print "-p, --port\t\tconnect to searchd at port PORT"
print "-i, --index <IDX>\tsearch through index(es) s... | gpl-2.0 |
lpryszcz/bin | bam2coverage.py | 1 | 1239 | #!/usr/bin/env python
"""
Usage:
samtools idxstats CBS1954.paired.bam | bam2coverage.py
"""
import sys
#from Bio import SeqIO
from datetime import datetime
from numpy import std,median
def bam2coverage():
"""
"""
fDiff=1.5
if len( sys.argv )>1: fDiff=float( sys.argv[1] )
handle=sys.stdin
c2l,c2r,c2... | gpl-3.0 |
k4ml/Marimorepy | mamopublic/utils/helpers.py | 1 | 10218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2009, MARIMORE Inc Tokyo, Japan.
# Contributed by
# Iqbal Abdullah <iqbal@marimore.co.jp>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following condit... | bsd-3-clause |
kartikdhar/djangotest | virt1/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/codingstatemachine.py | 2931 | 2318 | ######################## 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 |
doutib/lobpredict | setup.py | 1 | 1532 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('README.rst') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements = [
# TO... | isc |
creativecommons/open-ledger | imageledger/tests/test_auth.py | 1 | 3203 | import os
import logging
from django.urls import reverse
from django.conf import settings
from django.contrib.auth import get_user_model
from imageledger import models
from imageledger.tests.utils import *
class TestAuth(TestImageledgerApp):
def setUp(self):
self.username = 'testuser'
def test_dele... | mit |
vmendez/DIRAC | DataManagementSystem/DB/FileCatalogComponents/DirectoryTreeBase.py | 5 | 40821 | ########################################################################
# $Id$
########################################################################
""" DIRAC DirectoryTree base class """
__RCSID__ = "$Id$"
from DIRAC.DataManagementSystem.DB.FileCatalogComponents.Utilities import getIDSelectString
from DIRAC ... | gpl-3.0 |
Tjorriemorrie/trading | 21_gae_kelly/binary/stats.py | 2 | 1843 | import logging as log
from google.appengine.ext import ndb
from models import Run, Q
from pprint import pprint
from models import CURRENCIES, TIME_FRAMES, TRADE_BASES, TRADE_AIMS
class Stats():
def __init__(self):
log.info('Stat init started')
self.loadQ()
self.runs = Run.query().order(Ru... | mit |
williamluke4/Examenable | node_modules/npm/node_modules/node-gyp/gyp/buildbot/buildbot_run.py | 270 | 8338 | #!/usr/bin/env python
# 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.
"""Argument-less script to select what to run on the buildbots."""
import filecmp
import os
import shutil
import subprocess
import sys
i... | gpl-3.0 |
hseom/hseom_brunet | tests/loganalysis/memorybin.py | 3 | 1472 | #!/usr/bin/env python
#
# This takes a Brunet memory log and parses it
# The 10% memory, mean memory, and 90% memory footprint for each
# time bin is output.
# currently the header line for each node needs to be stripped off...or code
# needs to be added to skip lines that are the node headers.
import sys, time, cop... | gpl-2.0 |
tgsd96/gargnotes | venv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py | 31 | 7885 | """
PostgreSQL database backend for Django.
Requires psycopg 2: http://initd.org/projects/psycopg2
"""
from django.conf import settings
from django.db.backends import (BaseDatabaseFeatures, BaseDatabaseWrapper,
BaseDatabaseValidation)
from django.db.backends.postgresql_psycopg2.operations import DatabaseOperation... | mit |
DJArmstrong/autovet | Features/old/Centroiding/scripts/analyse_neighbours_NEW.py | 4 | 15081 | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 20 17:44:11 2016
@author:
Maximilian N. Guenther
Battcock Centre for Experimental Astrophysics,
Cavendish Laboratory,
JJ Thomson Avenue
Cambridge CB3 0HE
Email: mg719@cam.ac.uk
"""
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf im... | gpl-3.0 |
pilou-/ansible | lib/ansible/modules/storage/netapp/_sf_volume_access_group_manager.py | 59 | 8956 | #!/usr/bin/python
# (c) 2017, NetApp, Inc
# 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',
'status': ['deprecated'],
... | gpl-3.0 |
kbaseapps/GenomeFileUtil | lib/GenomeFileUtil/GenomeFileUtilImpl.py | 1 | 76042 | # -*- coding: utf-8 -*-
#BEGIN_HEADER
import json
import logging
import os
import shutil
from pprint import pprint
from GenomeFileUtil.core.FastaGFFToGenome import FastaGFFToGenome
from GenomeFileUtil.core.GenbankToGenome import GenbankToGenome
from GenomeFileUtil.core.GenomeFeaturesToFasta import GenomeFeaturesToFas... | mit |
asterix135/infonex_crm | registration/migrations/0025_auto_20181220_1600.py | 1 | 3486 | # Generated by Django 2.0.3 on 2018-12-20 21:00
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('registration', '0024_auto_20180123_1157'),
]
operations = [
migrations.AlterField(
model_name='company',
name='addre... | mit |
cristiana214/cristianachavez214-cristianachavez | python-build/python-libs/gdata/src/gdata/contacts/service.py | 137 | 13717 | #!/usr/bin/python
#
# Copyright (C) 2008 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 ... | apache-2.0 |
caphrim007/ansible | lib/ansible/plugins/cliconf/dellos6.py | 38 | 2807 | #
# (c) 2017 Red Hat Inc.
#
# (c) 2017 Dell EMC.
#
# 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 ve... | gpl-3.0 |
campbe13/openhatch | vendor/packages/mock/tests/testmock.py | 16 | 16933 | # Copyright (C) 2007-2011 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import unittest2, inPy3k
import copy
import sys
from mock import Mock, sentinel, DEFAULT
try:
unicode
except NameError:
unicode = str
class ... | agpl-3.0 |
choderalab/perses | examples/SamplerExample/run.py | 1 | 1260 | import yaml
import sys
import os
def run_relative_perturbation(ligA, ligB,tidy=True):
print('Starting relative calcluation of ligand {} to {}'.format(ligA,ligB))
trajectory_directory = 'lig{}to{}'.format(ligA,ligB)
new_yaml = 'cdk2_repex_{}to{}.yaml'.format(ligA,ligB)
# rewrite yaml file
wi... | mit |
kirca/OpenUpgrade | addons/mrp_repair/mrp_repair.py | 9 | 36779 | # -*- 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 |
chromium/chromium | third_party/wpt_tools/wpt/tools/third_party/html5lib/html5lib/html5parser.py | 32 | 117174 | from __future__ import absolute_import, division, unicode_literals
from six import with_metaclass, viewkeys
import types
from . import _inputstream
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters, asciiUpper2... | bsd-3-clause |
miscaandrei/django-testapp | django/contrib/admin/widgets.py | 88 | 12675 | """
Form Widget classes specific to the Django admin site.
"""
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.forms.widgets import RadioFieldRenderer
from django.forms.util import flatatt
from django.utils.... | bsd-3-clause |
maciekcc/tensorflow | tensorflow/contrib/training/python/training/sampling_ops.py | 39 | 17187 | # 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 |
jhsenjaliya/incubator-airflow | tests/ti_deps/deps/test_dagrun_exists_dep.py | 38 | 1461 | # -*- 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 |
svn2github/django | django/contrib/formtools/tests/__init__.py | 5 | 14825 | import os
import re
import warnings
from django import http
from django.conf import settings
from django.contrib.formtools import preview, utils
from django.contrib.formtools.wizard import FormWizard
from django.test import TestCase
from django.test.utils import override_settings
from django.utils import unittest
fro... | bsd-3-clause |
heidsoft/VirtualBox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/MigrationUtilities.py | 11 | 19858 | ## @file
# Contains several utilitities shared by migration tools.
#
# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text o... | gpl-2.0 |
joequant/zipline | tests/test_history.py | 17 | 38530 | #
# Copyright 2014 Quantopian, 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 wr... | apache-2.0 |
idl3r/ktsan | tools/perf/scripts/python/netdev-times.py | 1544 | 15191 | # Display a process of packets and processed time.
# It helps us to investigate networking or network device.
#
# options
# tx: show only tx chart
# rx: show only rx chart
# dev=: show only thing related to specified device
# debug: work with debug mode. It shows buffer status.
import os
import sys
sys.path.append(os... | gpl-2.0 |
adviti/melange | thirdparty/google_appengine/google/net/proto2/python/internal/wire_format.py | 15 | 6129 | #!/usr/bin/env python
#
# 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
#
# Unless required by applicable law o... | apache-2.0 |
UDST/activitysim | activitysim/core/chunk.py | 2 | 10744 | # ActivitySim
# See full license in LICENSE.txt.
from __future__ import (absolute_import, division, print_function, )
from future.standard_library import install_aliases
install_aliases() # noqa: E402
from builtins import input
import logging
from collections import OrderedDict
import numpy as np
import pandas as ... | bsd-3-clause |
DasIch/django | django/core/serializers/__init__.py | 347 | 8194 | """
Interfaces for serializing Django objects.
Usage::
from django.core import serializers
json = serializers.serialize("json", some_queryset)
objects = list(serializers.deserialize("json", json))
To add your own serializers, use the SERIALIZATION_MODULES setting::
SERIALIZATION_MODULES = {
... | bsd-3-clause |
NaturalGIS/QGIS | python/plugins/processing/algs/grass7/ext/r_li_richness_ascii.py | 45 | 1446 | # -*- coding: utf-8 -*-
"""
***************************************************************************
r_li_richness_ascii.py
----------------------
Date : February 2016
Copyright : (C) 2016 by Médéric Ribreux
Email : medspx at medspx dot fr
**************... | gpl-2.0 |
espadrine/opera | chromium/src/testing/gmock/scripts/fuse_gmock_files.py | 729 | 8606 | #!/usr/bin/env python
#
# Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
bernardokyotoku/skillplant | django/core/serializers/json.py | 3 | 1982 | """
Serialize data to/from JSON
"""
import datetime
import decimal
from StringIO import StringIO
from django.core.serializers.python import Serializer as PythonSerializer
from django.core.serializers.python import Deserializer as PythonDeserializer
from django.utils import datetime_safe
from django.utils i... | bsd-3-clause |
ProjectSWGCore/NGECore2 | scripts/mobiles/dantooine/slice_hound.py | 2 | 1667 | import sys
from services.spawn import MobileTemplate
from services.spawn import WeaponTemplate
from resources.datatables import WeaponType
from resources.datatables import Difficulty
from resources.datatables import Options
from java.util import Vector
def addTemplate(core):
mobileTemplate = MobileTemplate()
mobil... | lgpl-3.0 |
peterstangl/svg2data | svg2data.py | 1 | 53674 | import numpy as np
import ast
import xml.etree.ElementTree as ET
from operator import itemgetter
import matplotlib.pyplot as plt
from matplotlib import rcParams
from matplotlib.afm import AFM
import os.path
from math import sin, cos, tan, pi
afm_dir = os.path.join(rcParams['datapath'],'fonts', 'afm')
afm_dict = {}
for ... | gpl-2.0 |
zouyapeng/horizon-newtouch | openstack_dashboard/dashboards/project/volumes/snapshots/views.py | 7 | 3288 | # 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
# d... | apache-2.0 |
epam-mooc/edx-platform | common/lib/xmodule/xmodule/tests/test_stringify.py | 68 | 1189 | from nose.tools import assert_equals # pylint: disable=E0611
from lxml import etree
from xmodule.stringify import stringify_children
def test_stringify():
text = 'Hi <div x="foo">there <span>Bruce</span><b>!</b></div>'
html = '''<html a="b" foo="bar">{0}</html>'''.format(text)
xml = etree.fromstring(html... | agpl-3.0 |
tlakshman26/cinder-https-changes | cinder/db/sqlalchemy/migrate_repo/versions/009_add_snapshot_metadata_table.py | 20 | 1635 | # 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
# d... | apache-2.0 |
erkrishna9/odoo | openerp/addons/base/tests/test_ir_sequence.py | 136 | 8087 | # -*- coding: utf-8 -*-
# Run with one of these commands:
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy PYTHONPATH=. python tests/test_ir_sequence.py
# > OPENERP_ADDONS_PATH='../../addons/trunk' OPENERP_PORT=8069 \
# OPENERP_DATABASE=yy nosetests tests/test_ir_se... | agpl-3.0 |
cmoutard/mne-python | mne/event.py | 1 | 26090 | """IO with fif files containing events
"""
# Authors: Alexandre Gramfort <alexandre.gramfort@telecom-paristech.fr>
# Matti Hamalainen <msh@nmr.mgh.harvard.edu>
# Teon Brooks <teon.brooks@gmail.com>
# Clement Moutard <clement.moutard@polytechnique.org>
#
# License: BSD (3-clause)
import nump... | bsd-3-clause |
allisony/aplpy | aplpy/core.py | 2 | 74091 | from __future__ import absolute_import, print_function, division
from distutils import version
import os
import operator
from functools import reduce
import matplotlib
if version.LooseVersion(matplotlib.__version__) < version.LooseVersion('1.0.0'):
raise Exception("matplotlib 1.0.0 or later is required for APLpy... | mit |
angdraug/nova | nova/virt/hyperv/migrationops.py | 2 | 12844 | # Copyright 2013 Cloudbase Solutions Srl
# 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 r... | apache-2.0 |
nicolas-raoul/database-of-embassies | tools/generate_webpages_from_csv/generate_webpages.py | 1 | 10547 | import os
import sys
from urllib import unquote
import hashlib
import re
def safe_for_url(string):
return string.lower().replace(' ', '_').replace("'", '_')
# Does not work for https://commons.wikimedia.org/wiki/File:%E3%82%B8%E3%83%96%E3%83%81%E5%A4%A7%E4%BD%BF%E9%A4%A8%E3%81%AF%E4%B8%80%E8%BB%92%E5%AE%B6.jpg
de... | gpl-3.0 |
polimediaupv/edx-platform | lms/djangoapps/branding/views.py | 68 | 11242 | """Views for the branding app. """
import logging
import urllib
from django.conf import settings
from django.core.urlresolvers import reverse
from django.core.cache import cache
from django.views.decorators.cache import cache_control
from django.http import HttpResponse, Http404
from django.utils import translation
fr... | agpl-3.0 |
mkhuthir/learnPython | Book_pythonlearn_com/code3/gmane/gmodel.py | 1 | 7609 | import sqlite3
import time
import urllib.request, urllib.parse, urllib.error
import re
import zlib
from datetime import datetime, timedelta
# Not all systems have this
try:
import dateutil.parser as parser
except:
pass
dnsmapping = dict()
mapping = dict()
def fixsender(sender,allsenders=None) :
global dn... | mit |
stadelmanma/OpenPNM | OpenPNM/Physics/models/generic_source_term.py | 1 | 16005 | r"""
===============================================================================
Submodule -- generic_source_term
===============================================================================
"""
import scipy as _sp
def linear(physics, phase, A1='', A2='', x='', return_rate=True, **kwargs):
r"""
For t... | mit |
alvarolopez/nova | nova/tests/unit/virt/xenapi/client/test_session.py | 20 | 6579 | # Copyright (c) 2014 Rackspace Hosting
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
Kagee/youtube-dl | youtube_dl/extractor/escapist.py | 1 | 4503 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import (
compat_urllib_parse,
compat_urllib_request,
)
from ..utils import (
ExtractorError,
js_to_json,
)
class EscapistIE(InfoExtractor):
_VALID_URL = r'https?://?(www\.)?escapistmagazine\.com/videos/view/[^... | unlicense |
rvalyi/OpenUpgrade | addons/account/wizard/account_subscription_generate.py | 38 | 2269 | # -*- 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 |
kikokubo/Sick-Beard-TPB | tests/tv_tests.py | 36 | 3474 | # coding=UTF-8
# Author: Dennis Lutter <lad1337@gmail.com>
# URL: http://code.google.com/p/sickbeard/
#
# This file is part of Sick Beard.
#
# Sick Beard is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either ... | gpl-3.0 |
yuxiangtan/QueryFuse | QueryFuse_v1/breakpoint_adjustment_shift_range_scorening.py | 1 | 43604 | # -*- coding: cp936 -*-
# Copyright {2015} Yuxiang Tan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless req... | apache-2.0 |
RackHD-Mirror/RackHD | test/tests/api-cit/v2_0/config_tests.py | 10 | 1716 | """
Copyright (c) 2016-2017 Dell Inc. or its subsidiaries. All Rights Reserved.
"""
import fit_path # NOQA: unused import
import fit_common
import flogging
from config.api2_0_config import config
from on_http_api2_0 import ApiApi as Api
from json import loads
from nosedep import depends
from nose.plugins.attrib impor... | apache-2.0 |
MingdaZhou/gnuradio | gr-digital/python/digital/ofdm_sync_ml.py | 58 | 7663 | #!/usr/bin/env python
#
# Copyright 2007,2008 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your opt... | gpl-3.0 |
sicily/qt4.8.4 | src/3rdparty/webkit/Source/ThirdParty/gtest/test/gtest_xml_output_unittest.py | 306 | 9711 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | lgpl-2.1 |
Aixile/chainer-cyclegan | updater.py | 1 | 7124 | import numpy as np
import chainer
import chainer.functions as F
import chainer.links as L
import chainer.datasets.image_dataset as ImageDataset
import six
import os
from chainer import cuda, optimizers, serializers, Variable
from chainer import training
from PIL import Image
def cal_l2_sum(h, t):
return F.sum((h... | mit |
bdastur/pyvim | .vim/bundle/python-mode/pymode/libs3/rope/base/simplify.py | 115 | 1692 | """A module to ease code analysis
This module is here to help source code analysis.
"""
import re
from rope.base import codeanalyze, utils
@utils.cached(7)
def real_code(source):
"""Simplify `source` for analysis
It replaces:
* comments with spaces
* strs with a new str filled with spaces
* im... | apache-2.0 |
tobspr/P3D-ECS | p3d_ecs/unittest-helpers/gen_testsuite_entityref.py | 1 | 5676 | """
Generates the various entity-ref testcases
"""
def num_params(n):
return range(2**n)
def param(i, n):
return (i // (2**n)) % 2 == 0
out = ""
ttypes = ["empty", "nullptr", "empty_id", "id", "reg_id", "entity", "reg_entity"]
k = 0
for input_type in ttypes:
for reset_param in ttypes:
for ... | mit |
ccellis/WHACK2016 | flask/lib/python2.7/site-packages/sqlalchemy/dialects/postgresql/ranges.py | 41 | 4814 | # Copyright (C) 2013-2016 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
from .base import ischema_names
from ... import types as sqltypes
__all__ = ('INT4RANGE', 'INT8RANGE'... | bsd-3-clause |
stevenvolckaert/plugin.video.vrt.nu | addon.py | 1 | 1711 | import sys
import xbmcaddon
from urlparse import parse_qsl
from resources.lib.vrtplayer import vrtplayer
from resources.lib.kodiwrappers import kodiwrapper
from resources.lib.vrtplayer import actions
from resources.lib.kodiwrappers import sortmethod
_addon_ = xbmcaddon.Addon()
_url = sys.argv[0]
_handle = int(sys.argv... | gpl-3.0 |
stefan-andritoiu/upm | examples/python/temperature.py | 6 | 1918 | #!/usr/bin/env python
from __future__ import print_function
# Author: Brendan Le Foll <brendan.le.foll@intel.com>
# Contributions: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and assoc... | mit |
skosukhin/spack | var/spack/repos/builtin/packages/r-variantannotation/package.py | 1 | 2615 | ##############################################################################
# Copyright (c) 2013-2017, 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 |
eastbanctech/kubernetes-contrib | diurnal/Godeps/_workspace/src/github.com/ugorji/go/codec/test.py | 1138 | 3876 | #!/usr/bin/env python
# This will create golden files in a directory passed to it.
# A Test calls this internally to create the golden files
# So it can process them (so we don't have to checkin the files).
# Ensure msgpack-python and cbor are installed first, using:
# sudo apt-get install python-dev
# sudo apt-g... | apache-2.0 |
blueboxdevelopment/zerorpc-python | tests/test_buffered_channel.py | 32 | 13450 | # -*- coding: utf-8 -*-
# Open Source Initiative OSI - The MIT License (MIT):Licensing
#
# The MIT License (MIT)
# Copyright (c) 2012 DotCloud Inc (opensource@dotcloud.com)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Softwa... | mit |
zhmz90/CS231N | assign/assignment1/cs231n/gradient_check.py | 67 | 3568 | import numpy as np
from random import randrange
def eval_numerical_gradient(f, x, verbose=True, h=0.00001):
"""
a naive implementation of numerical gradient of f at x
- f should be a function that takes a single argument
- x is the point (numpy array) to evaluate the gradient at
"""
fx = f(x) # evaluat... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.