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 |
|---|---|---|---|---|---|
MattAgile/workshop-ecosystem | jenkins/setup.py | 24 | 1134 | #!/usr/bin/env python3
from datetime import datetime, timezone
from os import makedirs
from os.path import dirname, abspath, join, basename
from shlex import split
from shutil import rmtree
from subprocess import run
FORMAT = 'html'
SECOND = 1
MINUTE = 60 * SECOND
START_TIME = datetime.now()
sourcedir = dirname(a... | apache-2.0 |
hadim/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers | Chapter5_LossFunctions/DarkWorldsMetric.py | 92 | 20375 | """ DarkWorldsMetricMountianOsteric.py
Custom evaluation metric for the 'Observing Dark Worlds' competition.
[Description of metric, or reference to documentation.]
Update: Made for the training set only so users can check there results from the training c
@Author: David Harvey
Created: 22 August 2012
"""
import nu... | mit |
amith01994/intellij-community | python/testData/buildout/site.py | 83 | 20097 | """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... | apache-2.0 |
likaiwalkman/cassandra | pylib/cqlshlib/sslhandling.py | 28 | 3725 | # 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 u... | apache-2.0 |
hpcleuven/easybuild-framework | test/framework/sandbox/easybuild/tools/module_naming_scheme/test_module_naming_scheme_more.py | 3 | 2985 | ##
# Copyright 2013-2016 Ghent University
#
# This file is part of EasyBuild,
# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en),
# with support of Ghent University (http://ugent.be/hpc),
# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be),
# Flemish Research Foundation (F... | gpl-2.0 |
elationfoundation/PyOrgMode | build/lib/PyOrgMode/test_simple-agenda.py | 2 | 2101 |
import PyOrgMode
import copy
try:
import unittest2 as unittest
except ImportError:
import unittest
def Get_Scheduled_Elements(element, data=[]):
"""
Grab the data from all scheduled elements for all the tree defined by 'element' recursively.
Returns all the elements as an array.
"""
if ha... | gpl-3.0 |
nirmeshk/oh-mainline | vendor/packages/Django/tests/modeltests/generic_relations/models.py | 48 | 2987 | """
34. Generic relations
Generic relations let an object have a foreign key to any object through a
content-type/object-id field. A ``GenericForeignKey`` field can point to any
object, be it animal, vegetable, or mineral.
The canonical example is tags (although this example implementation is *far*
from complete).
""... | agpl-3.0 |
ColdSauce/IsSittingOnButt | server/env/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/langgreekmodel.py | 2763 | 12628 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
alexholcombe/twoWords | honoursClass2015/twoWordsExperimentInvertedbackMayAlexContinue2.py | 2 | 52750 | #Alex Holcombe alex.holcombe@sydney.edu.au
#See the github repository for more information: https://github.com/alexholcombe/twoWords
from __future__ import print_function
from psychopy import monitors, visual, event, data, logging, core, sound, gui
import psychopy.info
import numpy as np
from math import atan, log, cei... | mit |
sjlehtin/django | tests/select_related_regress/models.py | 106 | 3371 | from django.db import models
class Building(models.Model):
name = models.CharField(max_length=10)
def __str__(self):
return "Building: %s" % self.name
class Device(models.Model):
building = models.ForeignKey('Building', models.CASCADE)
name = models.CharField(max_length=10)
def __str__... | bsd-3-clause |
mitodl/micromasters | courses/views.py | 1 | 4278 | """Views for courses"""
from django.db import transaction
from rest_framework import (
viewsets,
mixins,
status,
)
from rest_framework.views import APIView
from rest_framework.authentication import SessionAuthentication, TokenAuthentication
from rest_framework.exceptions import (
APIException,
NotFo... | bsd-3-clause |
polimediaupv/edx-platform | lms/djangoapps/instructor/views/instructor_task_helpers.py | 133 | 5257 | """
A collection of helper utility functions for working with instructor
tasks.
"""
import json
import logging
from util.date_utils import get_default_time_display
from bulk_email.models import CourseEmail
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from instructor_... | agpl-3.0 |
ament/ament_lint | ament_clang_format/setup.py | 1 | 1420 | from setuptools import find_packages
from setuptools import setup
package_name = 'ament_clang_format'
setup(
name=package_name,
version='0.11.2',
packages=find_packages(exclude=['test']),
data_files=[
('share/' + package_name, ['package.xml']),
('share/ament_index/resource_index/packag... | apache-2.0 |
tigeli/futurice-ldap-user-manager | fum/groups/tests.py | 2 | 1459 | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from fum.models import Groups, Users
from mockldap import MockLdap
from fum.common.ldap_test_suite imp... | bsd-3-clause |
schqiushui/HTL21-KitKat-3.4.X | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/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 |
RedHenLab/NLP | MWEtoolkit-interface/web_mwetoolkit/settings.py | 1 | 3009 | """
Django settings for gsoc15 project.
Generated by 'django-admin startproject' using Django 1.8.2.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build paths... | gpl-2.0 |
matpow2/cuwo | terraingen/tgen2/external/pe-parse/python/setup.py | 3 | 2310 | # Copyright (c) 2013, Wesley Shields <wxs@atarininja.org>. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this l... | gpl-3.0 |
lumig242/Hue-Integration-with-CDAP | desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/chart/surface_chart.py | 10 | 2960 | from __future__ import absolute_import
# Copyright (c) 2010-2015 openpyxl
from openpyxl.descriptors.serialisable import Serialisable
from openpyxl.descriptors import (
Typed,
Integer,
Bool,
Alias,
Sequence,
)
from openpyxl.descriptors.excel import ExtensionList
from openpyxl.descriptors.nested impo... | apache-2.0 |
jruben/jruben.github.io | node_modules/pygmentize-bundled/vendor/pygments/build-3.3/pygments/lexers/_luabuiltins.py | 95 | 6914 | # -*- coding: utf-8 -*-
"""
pygments.lexers._luabuiltins
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This file contains the names and modules of lua functions
It is able to re-generate itself, but for adding new functions you
probably have to add some callbacks (see function module_callbacks).
Do not edit th... | mit |
density215/d215-miniblog | django/contrib/gis/tests/test_measure.py | 231 | 8820 | """
Distance and Area objects to allow for sensible and convienient calculation
and conversions. Here are some tests.
"""
from django.contrib.gis.measure import Distance, Area, D, A
from django.utils import unittest
class DistanceTest(unittest.TestCase):
"Testing the Distance object"
def testInit(self):
... | bsd-3-clause |
sudeepdutt/mic | scripts/gdb/linux/lists.py | 630 | 2897 | #
# gdb helper commands and functions for Linux kernel debugging
#
# list tools
#
# Copyright (c) Thiebaud Weksteen, 2015
#
# Authors:
# Thiebaud Weksteen <thiebaud@weksteen.fr>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
from linux import utils
list_head = utils.CachedType("st... | gpl-2.0 |
johannesu/cnn-cells | network.py | 1 | 1240 | import lasagne
def setup(input_var, box_size = 29,):
# Setup network
net = lasagne.layers.InputLayer(
shape=(None, 1, box_size, box_size),
input_var=input_var)
# stage 1 : filter bank -> squashing -> max-pooling
net = lasagne.layers.Conv2DLayer(
net,
n... | mit |
ToonTownInfiniteRepo/ToontownInfinite | toontown/coghq/DistributedLawOfficeFloorAI.py | 4 | 5468 | import cPickle
import CogDisguiseGlobals
import FactoryEntityCreatorAI
import FactorySpecs
import LawOfficeBase
import LevelSuitPlannerAI
from direct.directnotify import DirectNotifyGlobal
from direct.distributed import DistributedObjectAI
from direct.task import Task
from otp.level import DistributedLevelAI
from otp.... | mit |
nisse3000/pymatgen | pymatgen/io/feff/tests/test_outputs.py | 4 | 3050 | # coding: utf-8
# Copyright (c) Pymatgen Development Team.
# Distributed under the terms of the MIT License.
from __future__ import unicode_literals
import unittest
import os
from pymatgen.io.feff.outputs import LDos, Xmu
test_dir = os.path.join(os.path.dirname(__file__), "..", "..", "..", "..",
... | mit |
umitproject/packet-manipulator | umit/pm/backend/umpa/context/sniff.py | 2 | 2062 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2008 Adriano Monteiro Marques
#
# Author: Francesco Piccinno <stack.box@gmail.com>
# ... | gpl-2.0 |
Aeronavics/MissionPlanner | ExtLibs/Mavlink/pymavlink/generator/mavparse.py | 1 | 19826 | #!/usr/bin/env python
'''
mavlink python parse functions
Copyright Andrew Tridgell 2011
Released under GNU GPL version 3 or later
'''
from __future__ import print_function
from builtins import range
from builtins import object
import errno
import operator
import os
import sys
import time
import xml.parsers.expat
PRO... | gpl-3.0 |
Kwpolska/upass | docs/conf.py | 1 | 7406 | # -*- coding: utf-8 -*-
#
# upass documentation build configuration file, created by
# sphinx-quickstart on Fri Dec 14 21:02:58 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All c... | bsd-3-clause |
seem-sky/FrameworkBenchmarks | aspnet/setup_xsp.py | 7 | 1097 | import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
if os.name == 'nt':
return 1
setup_util.replace_text("aspnet/src/Web.config", "localhost", args.database_host)
try:
subprocess.check_call("rm -rf bin obj", shell=True, cwd="aspnet/src", stderr=errfile, stdout=... | bsd-3-clause |
EiSandi/greetingslack | greetingslack/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/charsetprober.py | 3127 | 1902 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All R... | mit |
chaowyc/youtube-dl | youtube_dl/extractor/spiegeltv.py | 87 | 4011 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlparse
from ..utils import (
determine_ext,
float_or_none,
)
class SpiegeltvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?spiegel\.tv/(?:#/)?filme/(?P<id>[\-a-z0-9]+... | unlicense |
brennanblue/svgplotlib | svgplotlib/Gantt.py | 2 | 11612 | #!python -u
# -*- coding: utf-8 -*-
# Gantt code from Plone : http://svn.plone.org/svn/collective/xm.charting/
# License : GPL
import itertools
import calendar
import datetime
from datetime import date
from datetime import timedelta
from svgplotlib import Base
ONEWEEK = timedelta(days=7)
ONEDAY = timedelta(days=1)
#... | bsd-3-clause |
mistercrunch/airflow | airflow/cli/commands/kerberos_command.py | 14 | 1731 | # 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 u... | apache-2.0 |
tmilicic/networkx | networkx/algorithms/tests/test_graphical.py | 22 | 4665 | #!/usr/bin/env python
from nose.tools import *
from nose import SkipTest
import networkx as nx
def test_valid_degree_sequence1():
n = 100
p = .3
for i in range(10):
G = nx.erdos_renyi_graph(n,p)
deg = (d for n, d in G.degree())
assert_true( nx.is_valid_degree_sequence(deg, method='e... | bsd-3-clause |
mgeorgehansen/FIFE_Technomage | demos/shooter/scripts/gui/guis.py | 1 | 10455 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2010 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General ... | lgpl-2.1 |
JazzeYoung/VeryDeepAutoEncoder | theano/sandbox/cuda/tests/test_driver.py | 2 | 3607 | from __future__ import absolute_import, print_function, division
import numpy
import theano
# Skip test if cuda_ndarray is not available.
try:
from nose.plugins.skip import SkipTest
import theano.sandbox.cuda as cuda_ndarray
if cuda_ndarray.cuda_available is False:
raise SkipTest('Optional package ... | bsd-3-clause |
fabiohsmachado/dandelion | dandelion/main.py | 1 | 9787 | """Defines the Dandelion class"""
import networkx as nx;
class Dandelion:
"""The Dandelion code"""
def __init__(self, N, k, code = None, kTree = None):
"""Initializes the code."""
self.N = N;
self.k = k;
self._code = None;
self._kTree = None;
if code is not Non... | gpl-3.0 |
user-none/calibre | src/calibre/ebooks/pdb/ztxt/writer.py | 24 | 3629 | # -*- coding: utf-8 -*-
'''
Writer content to ztxt pdb file.
'''
__license__ = 'GPL v3'
__copyright__ = '2009, John Schember <john@nachtimwald.com>'
__docformat__ = 'restructuredtext en'
import struct, zlib
from calibre.ebooks.pdb.formatwriter import FormatWriter
from calibre.ebooks.pdb.header import PdbHeaderBui... | gpl-3.0 |
augusten/webshop-app | 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... | mit |
Srisai85/scipy | scipy/stats/kde.py | 27 | 17303 | #-------------------------------------------------------------------------------
#
# Define classes for (uni/multi)-variate kernel density estimation.
#
# Currently, only Gaussian kernels are implemented.
#
# Written by: Robert Kern
#
# Date: 2004-08-09
#
# Modified: 2005-02-10 by Robert Kern.
# Contr... | bsd-3-clause |
coursemdetw/2014c2 | exts/w2/static/Brython2.0.0-20140209-164925/Lib/unittest/case.py | 743 | 48873 | """Test case implementation"""
import sys
import functools
import difflib
import pprint
import re
import warnings
import collections
from . import result
from .util import (strclass, safe_repr, _count_diff_all_purpose,
_count_diff_hashable)
__unittest = True
DIFF_OMITTED = ('\nDiff is %s charact... | gpl-2.0 |
carnell69/kuma | vendor/packages/setuptools/dist.py | 259 | 35320 | __all__ = ['Distribution']
import re
import os
import sys
import warnings
import numbers
import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
from distutils.core import Distribution as _Distribution
from distutils.errors import (DistutilsOptionError, DistutilsPlatformError,
Distuti... | mpl-2.0 |
pre-commit/pre-commit | pre_commit/languages/golang.py | 1 | 3152 | import contextlib
import os.path
import sys
from typing import Generator
from typing import Sequence
from typing import Tuple
import pre_commit.constants as C
from pre_commit import git
from pre_commit.envcontext import envcontext
from pre_commit.envcontext import PatchesT
from pre_commit.envcontext import Var
from pr... | mit |
crimsonthunder/Samsung_mm | tools/perf/python/twatch.py | 7370 | 1334 | #! /usr/bin/python
# -*- python -*-
# -*- coding: utf-8 -*-
# twatch - Experimental use of the perf python interface
# Copyright (C) 2011 Arnaldo Carvalho de Melo <acme@redhat.com>
#
# This application is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License... | gpl-2.0 |
swayf/ajenti | plugins/filesystems/backend.py | 17 | 1910 | import re
import os
from ajenti.api import *
from ajenti.com import *
from ajenti.utils import *
class Entry:
def __init__(self):
self.src = ''
self.dst = ''
self.options = ''
self.fs_type = ''
self.dump_p = 0
self.fsck_p = 0
def read():
ss = ConfManager.get(... | lgpl-3.0 |
lenovo-a3-dev/kernel_lenovo_a3 | tools/perf/scripts/python/syscall-counts.py | 11181 | 1522 | # system call counts
# (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
import sys
sys.path.append(os.envir... | gpl-2.0 |
CouchPotato/CouchPotatoServer | libs/guessit/language.py | 94 | 14207 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# GuessIt - A library for guessing information from filenames
# Copyright (c) 2011 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 |
icereval/osf.io | scripts/create_fakes.py | 2 | 19939 | # -*- coding: utf-8 -*-
"""Fake data generator.
To use:
1. Install fake-factory.
pip install fake-factory
2. Create your OSF user account
3. Run the script, passing in your username (email).
::
python -m scripts.create_fakes --user fred@cos.io
This will create 3 fake public projects, each with 3 fake con... | apache-2.0 |
polimediaupv/edx-platform | lms/djangoapps/instructor/features/data_download.py | 56 | 3761 | """
Define steps for instructor dashboard - data download tab
acceptance tests.
"""
# pylint: disable=missing-docstring
# pylint: disable=redefined-outer-name
from lettuce import world, step
from nose.tools import assert_in, assert_regexp_matches # pylint: disable=no-name-in-module
from terrain.steps import reload_t... | agpl-3.0 |
armab/st2 | st2tests/st2tests/config.py | 2 | 8930 | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | apache-2.0 |
CDSherrill/psi4 | tests/json/schema-1-orient/input.py | 17 | 2246 | #! test QC_JSON Schema mol orientation
import numpy as np
import psi4
import json
import copy
# Generate JSON data
json_data = {
"schema_name": "qc_schema_input",
"schema_version": 1,
"molecule": {
"geometry": [
0.0,
0.0,
0.0,
0.0,
1.732,... | lgpl-3.0 |
kyvinh/home-assistant | homeassistant/components/camera/amcrest.py | 10 | 4397 | """
This component provides basic support for Amcrest IP cameras.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/camera.amcrest/
"""
import asyncio
import logging
import aiohttp
import voluptuous as vol
import homeassistant.loader as loader
from homeas... | apache-2.0 |
kronoscode/Booktype | lib/booktype/utils/tests/test_log_chapter_history.py | 7 | 1743 | # -*- coding: utf-8 -*-
# NOTE: for now this is intended to test all methods in
# log.py in old booki app. In near future we should move log.py
# into the new booktype app
from django.test import TestCase
from booktype.tests.factory_models import BookFactory, BookVersionFactory, ChapterFactory, UserFactory
from booki.... | agpl-3.0 |
Perferom/android_external_chromium_org | chrome/common/extensions/docs/server2/test_object_store_test.py | 153 | 1495 | #!/usr/bin/env python
# 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.
from test_object_store import TestObjectStore
import unittest
class TestObjectStoreTest(unittest.TestCase):
def testEmpty(self):
... | bsd-3-clause |
LumaPictures/rez | src/rez/bind/python.py | 3 | 3490 | """
Binds a python executable as a rez package.
"""
from __future__ import absolute_import
from rez.bind._utils import check_version, find_exe, extract_version, \
make_dirs, log, run_python_command
from rez.package_maker__ import make_package
from rez.system import system
from rez.utils.lint_helper import env
from ... | lgpl-3.0 |
Abi1ity/uniclust2.0 | flask/lib/python2.7/site-packages/django/conf/locale/cy/formats.py | 160 | 1822 | # -*- 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 F Y' # '25 Hy... | bsd-3-clause |
elenanst/HPOlib | HPOlib/wrapping.py | 2 | 24657 | ##
# wrapping: A program making it easy to use hyperparameter
# optimization software.
# Copyright (C) 2013 Katharina Eggensperger and Matthias Feurer
#
# 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 Found... | gpl-3.0 |
benschhold/android_kernel_oneplus_msm8994_custom | scripts/build-all.py | 704 | 14699 | #! /usr/bin/env python
# Copyright (c) 2009-2014, The Linux Foundation. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of source code must retain the above copyright
# ... | gpl-2.0 |
jbassen/edx-platform | cms/envs/bok_choy.py | 11 | 4495 | """
Settings for Bok Choy tests that are used when running Studio.
Bok Choy uses two different settings files:
1. test_static_optimized is used when invoking collectstatic
2. bok_choy is used when running the tests
Note: it isn't possible to have a single settings file, because Django doesn't
support both generating ... | agpl-3.0 |
LLNL/spack | var/spack/repos/builtin/packages/r-rmarkdown/package.py | 5 | 1715 | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RRmarkdown(RPackage):
"""Convert R Markdown documents into a variety of formats."""
... | lgpl-2.1 |
theonion/django-bulbs | tests/instant_articles/test_facebook_api.py | 1 | 6087 | import requests_mock
from django.utils import timezone
from django.test.utils import override_settings
from bulbs.content.models import FeatureType, Content
from bulbs.utils.test import BaseIndexableTestCase
from bulbs.utils.test.mock_vault import mock_vault
from example.testcontent.models import TestContentObjThree... | mit |
waytai/django | tests/m2m_through_regress/models.py | 273 | 2771 | from __future__ import unicode_literals
from django.contrib.auth.models import User
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
# Forward declared intermediate model
@python_2_unicode_compatible
class Membership(models.Model):
person = models.ForeignKey('Person', mo... | bsd-3-clause |
VitalLabs/gcloud-python | gcloud/bigtable/happybase/pool.py | 5 | 5918 | # Copyright 2016 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
saurabh6790/medsynaptic-app | stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.py | 30 | 3487 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import webnotes
from webnotes.utils import flt
def execute(filters=None):
columns = get_columns(filters)
consumed_details = get_consumed_details(f... | agpl-3.0 |
neilLasrado/erpnext | erpnext/config/accounts.py | 1 | 13984 | from __future__ import unicode_literals
from frappe import _
import frappe
def get_data():
config = [
{
"label": _("Accounts Receivable"),
"items": [
{
"type": "doctype",
"name": "Sales Invoice",
"description": _("Bills raised to Customers."),
"onboard": 1,
},
{
"type": "... | gpl-3.0 |
nameoffnv/pywinauto | sandbox/playing_RepeatedHotkeyFixing.py | 16 | 7751 | # GUI Application automation and testing library
# Copyright (C) 2006 Mark Mc Mahon
#
# This library 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 2.1
# of the License, or (at ... | lgpl-2.1 |
wholeGenomeSequencingAnalysisPipeline/BacPipe | cutadapt-1.12/tests/testmodifiers.py | 1 | 1619 | # coding: utf-8
from __future__ import print_function, division, absolute_import
from cutadapt.seqio import Sequence
from cutadapt.modifiers import (UnconditionalCutter, NEndTrimmer, QualityTrimmer,
Shortener)
def test_unconditional_cutter():
uc = UnconditionalCutter(length=5)
s = 'abcdefg'
assert UnconditionalCu... | gpl-3.0 |
vFense/vFenseAgent-nix | agent/deps/rpm6-32/Python-2.7.5/lib/python2.7/idlelib/configHandler.py | 51 | 29367 | """Provides access to stored IDLE configuration information.
Refer to the comments at the beginning of config-main.def for a description of
the available configuration files and the design implemented to update user
configuration information. In particular, user configuration choices which
duplicate the defaults will... | lgpl-3.0 |
takeshineshiro/cinder | cinder/tests/unit/fake_utils.py | 23 | 2907 | # Copyright (c) 2011 Citrix Systems, 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 ... | apache-2.0 |
mfraezz/osf.io | addons/dataverse/migrations/0001_initial.py | 28 | 1807 | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-23 20:34
from __future__ import unicode_literals
from django.db import migrations, models
import osf.models.base
import osf.utils.datetime_aware_jsonfield
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operation... | apache-2.0 |
hunter007/django | django/conf/global_settings.py | 46 | 22617 | # Default Django settings. Override these with settings in the module
# pointed-to by the DJANGO_SETTINGS_MODULE environment variable.
# This is defined here as a do-nothing function because we can't import
# django.utils.translation -- that module depends on the settings.
gettext_noop = lambda s: s
#################... | bsd-3-clause |
mclaughlin6464/pylearn2 | pylearn2/scripts/datasets/step_through_norb_foveated.py | 44 | 1160 | from __future__ import print_function
__author__ = "Ian Goodfellow"
"""
A script for sequentially stepping through FoveatedNORB, viewing each image
and its label.
"""
import numpy as np
from theano.compat.six.moves import input
from pylearn2.datasets.norb_small import FoveatedNORB
from pylearn2.gui.patch_viewer impo... | bsd-3-clause |
mafrosis/python-lifx-sdk | doc/source/conf.py | 2 | 9408 | # -*- coding: utf-8 -*-
#
# lifx-sdk documentation build configuration file, created by
# sphinx-quickstart on Tue Aug 4 22:06:59 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# ... | mit |
caglar/Arcade-Universe | arcade_universe/data_generator.py | 1 | 2656 | from gen import *
from pdataset import *
import numpy as np
import argparse
from arcade_universe.fg import Foreground, FGTextureType
import time
import copy
class PentominoGenerator(object):
def __init__(self,
batch_size,
use_patch_centers=False,
seed=1321, patc... | bsd-3-clause |
iModels/mbuild | mbuild/bond_graph.py | 2 | 6551 | """Bond graph for mBuild Compounds.
NOTE: The functions 'connected_components' and '_bfs' have been obtained (with
modifications) from the Networkx Python package, which is distributed under the
following BSD license:
Copyright (C) 2004-2016, NetworkX Developers
Aric Hagberg <hagberg@lanl.gov>
Dan Schult <dschult@col... | mit |
bcornwellmott/erpnext | erpnext/crm/report/campaign_efficiency/campaign_efficiency.py | 32 | 2829 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
def execute(filters=None):
columns, data = [], []
columns=get_columns()
data=get_lead_data(filters, "Campaign Name")
ret... | gpl-3.0 |
simvisage/oricreate | docs/howtos/ex08_rigid_facets/sim031miura_ori_psi_cntl.py | 1 | 2750 | r'''
Fold the Miura ori crease pattern using psi control
---------------------------------------------------
'''
import numpy as np
from oricreate.api import \
SimulationTask, SimulationConfig, \
FTV, FTA
from oricreate.gu import \
GuConstantLength, GuDofConstraints, GuPsiConstraints, fix
def create_cp... | gpl-3.0 |
CAChemE/stochastic-optimization | ConventionalDistillationColumn/hyInterface.py | 1 | 4985 | # -*- coding: utf-8 -*-
import os
import win32com.client as win32
"""
# -------------------------------------------------------------------------
# SIMULATION-BASED OPTIMIZATION OF A SINGLE CONVENTIONAL DISTILLATION
# COLUMN USING THE PARTICLE SWARM OPTIMIZATION ALGORITHM
#--------------------------------... | bsd-3-clause |
jrutila/cmsplugin-filer | cmsplugin_filer_link/models.py | 17 | 1199 | from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from cms.models import CMSPlugin, Page
from cms.models.fields import PageField
from filer.fields.file import FilerFileField
DEFULT_LINK_STYLES = (
(" ", "Default"),
)
LINK_STYLES = getattr(setting... | bsd-3-clause |
poojavade/Genomics_Docker | Dockerfiles/gedlab-khmer-filter-abund/pymodules/python2.7/lib/python/Pillow-2.3.0-py2.7-linux-x86_64.egg/PIL/GbrImagePlugin.py | 18 | 1579 | #
# The Python Imaging Library
# $Id$
#
# load a GIMP brush file
#
# History:
# 96-03-14 fl Created
#
# Copyright (c) Secret Labs AB 1997.
# Copyright (c) Fredrik Lundh 1996.
#
# See the README file for information on usage and redistribution.
#
from PIL import Image, ImageFile, _binary
i32 = _binary.i32be
... | apache-2.0 |
dash-dash/pyzmq | zmq/eventloop/minitornado/platform/auto.py | 50 | 1424 | #!/usr/bin/env python
#
# Copyright 2011 Facebook
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | bsd-3-clause |
harveybia/face-hack | venv/face/lib/python2.7/site-packages/PIL/ImageOps.py | 51 | 13895 | #
# The Python Imaging Library.
# $Id$
#
# standard image operations
#
# History:
# 2001-10-20 fl Created
# 2001-10-23 fl Added autocontrast operator
# 2001-12-18 fl Added Kevin's fit operator
# 2004-03-14 fl Fixed potential division by zero in equalize
# 2005-05-05 fl Fixed equalize for low number of values
... | mit |
yaojingwu1992/XlsxWriter | xlsxwriter/test/comparison/test_chart_display_units06.py | 8 | 1414 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
juanantoniofm12/toonai | Zappa/zappa/middleware.py | 4 | 2374 | from werkzeug.wsgi import ClosingIterator
def all_casings(input_string):
"""
Permute all casings of a given string.
A pretty algoritm, via @Amber
http://stackoverflow.com/questions/6792803/finding-all-possible-case-permutations-in-python
"""
if not input_string:
yield ""
else:
... | mit |
wanggang3333/scikit-learn | examples/model_selection/plot_validation_curve.py | 229 | 1823 | """
==========================
Plotting Validation Curves
==========================
In this plot you can see the training scores and validation scores of an SVM
for different values of the kernel parameter gamma. For very low values of
gamma, you can see that both the training score and the validation score are
low. ... | bsd-3-clause |
timvideos/flumotion | flumotion/component/common/fgdp/fgdp.py | 3 | 10973 | # -*- Mode: Python -*-
# vi:si:et:sw=4:sts=4:ts=4
# Flumotion - a streaming media server
# Copyright (C) 2004,2005,2006,2007,2008,2009 Fluendo, S.L.
# Copyright (C) 2010,2011 Flumotion Services, S.A.
# All rights reserved.
#
# This file may be distributed and/or modified under the terms of
# the GNU Lesser General Pub... | lgpl-2.1 |
iambibhas/django | django/db/migrations/operations/models.py | 2 | 18399 | from __future__ import unicode_literals
from django.db import models
from django.db.models.options import normalize_together
from django.db.migrations.state import ModelState
from django.db.migrations.operations.base import Operation
from django.utils import six
class CreateModel(Operation):
"""
Create a mod... | bsd-3-clause |
PulsePod/evepod | lib/python2.7/site-packages/werkzeug/testsuite/http.py | 89 | 18911 | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.http
~~~~~~~~~~~~~~~~~~~~~~~
HTTP parsing utilities.
:copyright: (c) 2013 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import unittest
from datetime import datetime
from werkzeug.testsuite import WerkzeugTestCase
from werkzeug.... | apache-2.0 |
wuhengzhi/chromium-crosswalk | native_client_sdk/src/build_tools/sdk_tools/command/update.py | 15 | 13917 | # 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.
import hashlib
import copy
import logging
import os
import subprocess
import sys
import urlparse
import urllib2
import command_common
import download
fr... | bsd-3-clause |
googyanas/Googy-Max4-CM-Kernel | Documentation/target/tcm_mod_builder.py | 4981 | 41422 | #!/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 |
samuell/luigi | test/contrib/esindex_test.py | 14 | 12176 | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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 |
zozo123/buildbot | master/buildbot/test/unit/test_data_steps.py | 1 | 13740 | # 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-3.0 |
chaosblog/pyload | module/lib/thrift/transport/TSocket.py | 62 | 5094 | #
# 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 u... | gpl-3.0 |
0x46616c6b/ansible | lib/ansible/cli/vault.py | 5 | 14344 | # (c) 2014, James Tanner <tanner.jc@gmail.com>
#
# 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 distributed i... | gpl-3.0 |
dyjakan/interpreter-bugs | python/cpython-2.7.13-asan/ba74a2ffd077ff29ca7c84d5132be64ce3e9782f5f7dff0ec21b6e47a2100294.py | 1 | 1090 | """
gc.get_referrers() can be used to see objects before they are fully built.
Note that this is only an example. There are many ways to crash Python
by using gc.get_referrers(), as well as many extension modules (even
when they are using perfectly documented patterns to build objects).
Identifying and removing all ... | unlicense |
beni55/SimpleCV | SimpleCV/examples/util/ColorCube.py | 13 | 1901 | from SimpleCV import Image, Camera, Display, Color
import pygame as pg
import numpy as np
from pylab import *
from mpl_toolkits.mplot3d import axes3d
from matplotlib.backends.backend_agg import FigureCanvasAgg
import cv2
bins = 8
#precompute
idxs = []
colors = []
offset = bins/2
skip = 255/bins
for x in range(0,bins):... | bsd-3-clause |
PaulieC/sprint3-Council | ServerPackage/Scorekeeper.py | 2 | 3735 | __author__ = "Paul Council, Joseph Gonzoph, Anand Patel"
__version__ = "sprint1"
__credits__ = ["jeffrey creighton"]
# imports
from ServerPackage import ScorekeeperHistoryItem, ScoreKeeperListItem
class Scorekeeper:
"""
Purpose: to collect and store scores from all players and matches
Attributes:
... | apache-2.0 |
eleonrk/SickRage | lib/hachoir_parser/program/nds.py | 58 | 13832 | """
Nintendo DS .nds game file parser
File format references:
- http://www.bottledlight.com/ds/index.php/FileFormats/NDSFormat
- http://imrannazar.com/The-Smallest-NDS-File
- http://darkfader.net/ds/files/ndstool.cpp
- http://crackerscrap.com/docs/dsromstructure.html
- http://nocash.emubase.de/gbatek.htm
"""
from hac... | gpl-3.0 |
saradbowman/osf.io | osf/migrations/0135_migrate_registrations_to_osf_registries_provider.py | 13 | 2304 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-07-18 13:51
from __future__ import unicode_literals
import logging
from django.db import migrations
logger = logging.getLogger(__file__)
def migrate_existing_registrations_into_osf_registries(state, schema):
AbstractProvider = state.get_model('osf', '... | apache-2.0 |
TiVo/kafka | tests/kafkatest/tests/verifiable_consumer_test.py | 4 | 4599 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | apache-2.0 |
DataONEorg/d1_python | test_utilities/src/d1_test/stress_tester/projects/combination_1/test_scripts/tier_3_mn_storage_create.py | 2 | 3141 | #!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.