repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
klmitch/nova | refs/heads/master | nova/db/sqlalchemy/api_migrations/migrate_repo/versions/072_placeholder.py | 215 | # 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... |
patcon/open-cabinet | refs/heads/master | venv/lib/python2.7/site-packages/psycopg2/tests/test_types_extras.py | 39 | #!/usr/bin/env python
#
# types_extras.py - tests for extras types conversions
#
# Copyright (C) 2008-2010 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 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 Foundat... |
getnikola/plugins | refs/heads/master | v8/commonmark/commonmark.py | 1 | # -*- coding: utf-8 -*-
# Copyright © 2014 Roberto Alsina and others.
# 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
# the rights to use... |
hoosteeno/fjord | refs/heads/master | vendor/packages/carrot/carrot/serialization.py | 8 | """
Centralized support for encoding/decoding of data structures.
Requires a json library (`cjson`_, `simplejson`_, or `Python 2.6+`_).
Pickle support is built-in.
Optionally installs support for ``YAML`` if the `PyYAML`_ package
is installed.
Optionally installs support for `msgpack`_ if the `msgpack-python`_
packa... |
alphaBenj/zipline | refs/heads/master | zipline/data/history_loader.py | 5 | # Copyright 2016 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 writ... |
lopuhin/scrapy-splash | refs/heads/master | scrapy_splash/responsetypes.py | 4 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from scrapy.http import Response
from scrapy.responsetypes import ResponseTypes
import scrapy_splash
class SplashResponseTypes(ResponseTypes):
CLASSES = {
'text/html': 'scrapy_splash.response.SplashTextResponse',
'application/atom+xm... |
karthik339/Agni | refs/heads/master | MainDemo/flask/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/_vendor/html5lib/treebuilders/dom.py | 559 | 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... |
a0c/odoo | refs/heads/master | addons/membership/membership.py | 27 | # -*- 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... |
jruben/jruben.github.io | refs/heads/master | node_modules/pygmentize-bundled/vendor/pygments/pygments/lexers/shell.py | 287 | # -*- coding: utf-8 -*-
"""
pygments.lexers.shell
~~~~~~~~~~~~~~~~~~~~~
Lexers for various shells.
:copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import Lexer, RegexLexer, do_insertions, bygroups, inclu... |
rokj/django_basketball | refs/heads/master | settings.py | 1 | # -*- coding: utf-8 -*-
import os
DEBUG = True
TEMPLATE_DEBUG = True
ADMINS = (
('', ''),
)
SITE_NAME = 'Django basketball page'
SEND_BROKEN_LINK_EMAILS = True
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'sqlite3', # Add 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.... |
mszewczy/odoo | refs/heads/8.0 | addons/l10n_us/__openerp__.py | 341 | # -*- 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... |
wendal/yeelink_tester | refs/heads/master | yeelink_api_test.py | 1 | # -*- coding: utf-8 -*-
"""
Module implementing YeelinkTestDialog.
"""
from PyQt4.QtGui import QDialog
from PyQt4.QtCore import pyqtSignature
from Ui_yeelink_api_test import Ui_Dialog
import PyQt4.QtGui
import urllib2
import traceback
import os
handler=urllib2.HTTPHandler(debuglevel=1)
opener = urllib2.build_opener... |
tneumann/cmm | refs/heads/master | cmmlib/inout/__init__.py | 1 | from os import path
import numpy as np
import h5py
from scipy.io import loadmat
from scipy.sparse import csgraph
from scipy import sparse
from wavefront_obj import loadobj
import off
from ..util import filter_reindex
def load_nrw_mat(mat_file):
data = loadmat(mat_file)
verts = np.column_stack((
data[... |
romain-li/edx-platform | refs/heads/master | openedx/core/djangolib/fields.py | 15 | """
Custom Django fields.
"""
from django.db import models
class CharNullField(models.CharField):
"""CharField that stores NULL but returns ''"""
description = "CharField that stores NULL but returns ''"
def to_python(self, value):
"""Converts the value into the correct Python object."""
... |
webmakin/scrapy | refs/heads/master | scrapy/http/cookies.py | 37 | import time
from cookielib import CookieJar as _CookieJar, DefaultCookiePolicy, IPV4_RE
from scrapy.utils.httpobj import urlparse_cached
class CookieJar(object):
def __init__(self, policy=None, check_expired_frequency=10000):
self.policy = policy or DefaultCookiePolicy()
self.jar = _CookieJar(self... |
fitermay/intellij-community | refs/heads/master | python/lib/Lib/site-packages/django/contrib/gis/db/models/__init__.py | 321 | # Want to get everything from the 'normal' models package.
from django.db.models import *
# Geographic aggregate functions
from django.contrib.gis.db.models.aggregates import *
# The GeoManager
from django.contrib.gis.db.models.manager import GeoManager
# The geographic-enabled fields.
from django.contrib.gis.db.mod... |
robovm/robovm-studio | refs/heads/master | python/testData/skeletons/FakeNamedTuple.py | 83 | from collections import namedtuple
Point = namedtuple('Point', 'x y')
p = Point(1, 2)
# Fields and unpacking
x, y = p
x, y, z = p
print(p.x, p.y, p.<warning descr="Unresolved attribute reference 'z' for class 'Point'">z</warning>)
print(Point.x, Point.y, Point.<warning descr="Unresolved attribute reference 'z' for cl... |
JarbasAI/JarbasAI | refs/heads/patch-15 | mycroft/util/download.py | 1 | from threading import Thread
import os
import requests
from os.path import exists
_running_downloads = {}
def _get_download_tmp(dest):
tmp_base = dest + '.part'
if not exists(tmp_base):
return tmp_base
else:
i = 1
while(True):
tmp = tmp_base + '.' + str(i)
... |
fhcrc/deenurp | refs/heads/master | deenurp/util.py | 1 | """
Utility functions
"""
import bz2
import contextlib
import functools
import gzip
import itertools
import os
import os.path
import shutil
import sys
import time
import tempfile
from Bio import SeqIO
def apply_df_status(func, df, msg=''):
"""
"""
tmp_column = 'index_number'
row_count = float(len(d... |
KennethPierce/pylearnk | refs/heads/fixNogil/master | pylearn2/model_extensions/model_extension.py | 5 | """
Base class for model extensions
"""
class ModelExtension(object):
"""
An object that may be plugged into a model to add some functionality
to it.
"""
def post_modify_updates(self, updates):
""""
Modifies the parameters before a learning update is applied.
This method a... |
intel-linux-graphics/drm-intel | refs/heads/drm-intel-next-queued | tools/perf/scripts/python/syscall-counts.py | 11181 | # 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... |
qedi-r/home-assistant | refs/heads/dev | homeassistant/components/synology_srm/__init__.py | 15 | """The synology_srm component."""
|
apocquet/django | refs/heads/master | django/db/backends/base/operations.py | 192 | import datetime
import decimal
import warnings
from importlib import import_module
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.backends import utils
from django.utils import six, timezone
from django.utils.dateparse import parse_duration
from django.utils.dep... |
primiano/depot_tools | refs/heads/master | third_party/coverage/xmlreport.py | 49 | """XML reporting for coverage.py"""
import os, sys, time
import xml.dom.minidom
from coverage import __url__, __version__
from coverage.backward import sorted, rpartition # pylint: disable=W0622
from coverage.report import Reporter
def rate(hit, num):
"""Return the fraction of `hit`/`num`, as a string."""
... |
tempbottle/eventlet | refs/heads/master | eventlet/green/http/__init__.py | 5 | from eventlet.support import six
assert six.PY3, 'This is a Python 3 module'
|
turbokongen/home-assistant | refs/heads/dev | tests/components/vultr/test_switch.py | 3 | """Test the Vultr switch platform."""
import json
import unittest
from unittest.mock import patch
import pytest
import requests_mock
import voluptuous as vol
from homeassistant.components import vultr as base_vultr
from homeassistant.components.vultr import (
ATTR_ALLOWED_BANDWIDTH,
ATTR_AUTO_BACKUPS,
ATT... |
indictranstech/trufil-erpnext | refs/heads/master | erpnext/patches/v5_8/add_credit_note_print_heading.py | 90 | # 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 frappe
from frappe import _
def execute():
for print_heading in (_("Credit Note"), _("Debit Note")):
if not frappe.db.exists("Print Headin... |
edgarli/proj8 | refs/heads/master | env/lib/python3.4/site-packages/bson/dbref.py | 69 | # Copyright 2009-2015 MongoDB, 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 writin... |
dudonwai/dudonsblog | refs/heads/master | Lib/site-packages/django/utils/ipv6.py | 225 | # This code was mostly based on ipaddr-py
# Copyright 2007 Google Inc. http://code.google.com/p/ipaddr-py/
# Licensed under the Apache License, Version 2.0 (the "License").
from django.core.exceptions import ValidationError
from django.utils.six.moves import range
from django.utils.translation import ugettext_lazy as _... |
scalable-networks/gnuradio-3.7.2.1 | refs/heads/master | gr-filter/python/filter/filterbank.py | 58 | #
# Copyright 2005,2007 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 option)
# any later version... |
opoplawski/ansible | refs/heads/devel | contrib/inventory/vagrant.py | 150 | #!/usr/bin/env python
"""
Vagrant external inventory script. Automatically finds the IP of the booted vagrant vm(s), and
returns it under the host group 'vagrant'
Example Vagrant configuration using this script:
config.vm.provision :ansible do |ansible|
ansible.playbook = "./provision/your_playbook.yml"
... |
KISSMonX/micropython | refs/heads/master | tests/bench/var-5-class-attr.py | 102 | import bench
class Foo:
num = 20000000
def test(num):
i = 0
while i < Foo.num:
i += 1
bench.run(test)
|
hellfish2/treeio | refs/heads/master | changes/views.py | 3 | # encoding: utf-8
# Copyright 2011 Tree.io Limited
# This file is part of Treeio.
# License www.tree.io/license
"""
Change Control module views
"""
from django.shortcuts import get_object_or_404
from django.template import RequestContext
from django.http import HttpResponseRedirect
from django.core.urlresolvers import... |
cris-iisc/mpc-primitives | refs/heads/master | crislib/libscapi/lib/boost_1_64_0/libs/python/test/test_builtin_converters.py | 1 | # Copyright David Abrahams 2004. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
r"""
>>> from builtin_converters_ext import *
# Provide values for integer converter tests
>>> def _signed_values(s):
... base = 2 ... |
yadudoc/cloud_kotta | refs/heads/master | web2/utils.py | 1 | #!/usr/bin/env python
import math
import bottle
from bottle import template
from bottle import route, get, post, request, hook, redirect
import base64, hmac, sha
import logging
#################################################################################
# Some global vars
#########################################... |
Phasemix/phasepersist | refs/heads/master | setup.py | 1 | from setuptools import setup
setup(name='phasepersist',
version='0.1',
description='Load and save python stuff in pickle files.',
url='http://github.com/phasemix/phasepersist',
author='Roberto Allende',
author_email='rallende@gmail.com',
license='Apache 2.0',
packages=['phasep... |
gem/oq-engine | refs/heads/master | openquake/hmtk/tests/seismicity/smoothing/test_isotropic_gaussian_kernel.py | 1 | # -*- coding: utf-8 -*-
# LICENSE
#
# Copyright (C) 2010-2021 GEM Foundation, G. Weatherill, M. Pagani,
# D. Monelli.
#
# The Hazard Modeller's Toolkit 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, ei... |
wangyum/tensorflow | refs/heads/master | tensorflow/contrib/distributions/python/kernel_tests/uniform_test.py | 35 | # 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... |
rahushen/ansible | refs/heads/devel | lib/ansible/modules/cloud/cloudstack/cs_snapshot_policy.py | 80 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2016, René Moser <mail@renemoser.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',
... |
pnedunuri/scikit-learn | refs/heads/master | examples/bicluster/plot_spectral_coclustering.py | 276 | """
==============================================
A demo of the Spectral Co-Clustering algorithm
==============================================
This example demonstrates how to generate a dataset and bicluster it
using the the Spectral Co-Clustering algorithm.
The dataset is generated using the ``make_biclusters`` f... |
JCA-Developpement/Odoo | refs/heads/master | addons/l10n_sg/__init__.py | 669 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2014 Tech Receptives (<http://techreceptives.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the te... |
codrut3/tensorflow | refs/heads/master | tensorflow/python/ops/losses/util_test.py | 113 | # 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... |
natanielruiz/android-yolo | refs/heads/master | jni-build/jni/include/tensorflow/contrib/session_bundle/gc_test.py | 6 | # 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... |
pombredanne/python-bugzilla | refs/heads/master | bugzilla/rhbugzilla.py | 4 | # rhbugzilla.py - a Python interface to Red Hat Bugzilla using xmlrpclib.
#
# Copyright (C) 2008-2012 Red Hat Inc.
# Author: Will Woods <wwoods@redhat.com>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software ... |
incuna/django-forum-pinax | refs/heads/master | forum/forms.py | 1 | from django import forms
from django.utils.translation import ugettext as _
class CreateThreadForm(forms.Form):
title = forms.CharField(label=_("Title"), max_length=100)
body = forms.CharField(label=_("Body"), widget=forms.Textarea(attrs={'rows':8, 'cols':50}))
# subscribe = forms.BooleanField(label=_("Subs... |
Jet-Streaming/framework | refs/heads/master | deps/v8/tools/testrunner/local/commands.py | 6 | # Copyright 2012 the V8 project authors. 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 of conditi... |
rlworkgroup/metaworld | refs/heads/master | metaworld/envs/mujoco/sawyer_xyz/v1/sawyer_coffee_button.py | 1 | import numpy as np
from gym.spaces import Box
from metaworld.envs.asset_path_utils import full_v1_path_for
from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
class SawyerCoffeeButtonEnv(SawyerXYZEnv):
def __init__(self):
hand_low = (-0.5, 0.40, 0.05)
h... |
MaximNevrov/neutron | refs/heads/master | neutron/tests/unit/extensions/test_dns.py | 3 | # Copyright 2015 Rackspace
#
# 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 t... |
matiasb/django | refs/heads/master | tests/model_options/test_tablespaces.py | 337 | from __future__ import unicode_literals
from django.apps import apps
from django.conf import settings
from django.db import connection
from django.test import TestCase, skipIfDBFeature, skipUnlessDBFeature
from .models.tablespaces import (
Article, ArticleRef, Authors, Reviewers, Scientist, ScientistRef,
)
def ... |
h-mayorquin/Neural_Pattern_Doursat | refs/heads/master | network_3.py | 1 | ########################
# Network to study pattern learning
# Ramon Martinez 19 / 02 / 2014
########################
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import time
import csv
import h5py
def distance(i, j, index, dimension):
"""
Given a particular loc... |
ArcherSys/ArcherSys | refs/heads/master | Lib/archersys/ProducktivShell/__main__.py | 1 | import cmd, getpass, os,sys, string, sqlite3
from random import randint
from . import app_battleship
def guessing_game():
random_number = randint(1, 10)
guesses_left = 3
# Start your game!
while guesses_left > 0:
guess = int(input("Your Guess"))
guesses_left -= 1
if random_... |
sacharya/nova | refs/heads/master | nova/tests/test_utils.py | 1 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 Justin Santa Barbara
#
# 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/LICEN... |
timj/scons | refs/heads/master | test/runtest/print_time.py | 3 | #!/usr/bin/env python
#
# __COPYRIGHT__
#
# 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 the rights to use, copy, modify, merge, publish,
... |
grochmal/unixjsons | refs/heads/master | jgrep.py | 1 | #!/usr/bin/env python
__version__ = '0.7'
__author__ = 'Michal Grochmal'
__licence__ = 'GNU GPL v3 or later'
__prog__ = 'jgrep'
__doc__ = '''
Usage: jgrep [-n key] [-hVqviIHR] <key re> <value re> [<file> ...]
-h, --help
Print this help.
-V, --version
Prints the version of the script.
-... |
takis/odoo | refs/heads/8.0 | addons/website_event_sale/models/__init__.py | 428 | import product
import website
import sale_order
|
RuiNascimento/krepo | refs/heads/master | script.module.lambdascrapers/lib/lambdascrapers/sources_incursion/en_incursion-1.20(final)/ororo.py | 1 | # -*- coding: utf-8 -*-
'''
Covenant Add-on
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This prog... |
gaddman/ansible | refs/heads/devel | lib/ansible/template/template.py | 156 | # (c) 2012, Michael DeHaan <michael.dehaan@gmail.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 lat... |
ntt-sic/nova | refs/heads/master | nova/tests/virt/baremetal/test_iboot_pdu.py | 4 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2013 Red Hat 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/li... |
torwag/micropython | refs/heads/master | tests/basics/string_escape.py | 118 | a = "a\1b"
print(len(a))
print(ord(a[1]))
print(len("a\123b"))
a = "a\12345b"
print(len(a))
print(ord(a[1]))
a = "a\xffb"
print(len(a))
print(ord(a[1]))
|
gmist/gae-de-init | refs/heads/master | main/apps/auth/providers/linkedin/views.py | 1 | # coding: utf-8
import flask
from apps.auth import helpers
from apps.user import models
from core import util
from .import CONFIG
provider = helpers.make_provider(CONFIG)
bp = helpers.make_provider_bp(provider.name, __name__)
def change_linkedin_query(uri, headers, body):
auth = headers.pop('Authorization')
... |
40223135/40223135- | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/importlib/_bootstrap.py | 623 | """Core implementation of import.
This module is NOT meant to be directly imported! It has been designed such
that it can be bootstrapped into Python as the implementation of import. As
such it requires the injection of specific modules and attributes in order to
work. One should use importlib as the public-facing ver... |
bluven/eonboard | refs/heads/master | eoncloud_web/cloud/api/swift.py | 10 | # Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... |
h2oai/h2o-2 | refs/heads/master | py/testdir_hosts/test_parse_summary_zip_s3_fvec.py | 9 | import unittest, time, sys, random
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_glm, h2o_browse as h2b, h2o_import as h2i
class Basic(unittest.TestCase):
def tearDown(self):
h2o.check_sandbox_for_errors()
@classmethod
def setUpClass(cls):
h2o.init(1)
@classmethod
... |
phoebusliang/parallel-lettuce | refs/heads/master | tests/integration/lib/Django-1.3/tests/regressiontests/bash_completion/tests.py | 55 | """
A series of tests to establish that the command-line bash completion works.
"""
import os
import sys
import StringIO
from django.conf import settings
from django.core.management import ManagementUtility
from django.utils import unittest
class BashCompletionTests(unittest.TestCase):
"""
Testing the Python ... |
SteveDiamond/cvxpy | refs/heads/master | cvxpy/cvxcore/tests/python/364A_scripts/circuit_blend.py | 4 | import numpy as np
from cvxpy import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import math
import time
n = 10 # number of variables
k = 6 # number of designs
ANSWERS = []
TIME = 0
# component widths from known designs
# each column of W is a different design
W ='1.8381 1.5803 12.... |
mohamedhagag/community-addons | refs/heads/8.0 | project_sla/tests/test_compute_sla_date.py | 17 | from openerp.tests.common import TransactionCase
import datetime
dt_combine = datetime.datetime.combine
dt_delta = datetime.timedelta
thursday = datetime.date(2015, 4, 9)
friday = thursday + dt_delta(days=1)
monday = friday + dt_delta(days=3)
thursday_8 = dt_combine(thursday, datetime.time(8))
thursday_10 = dt_combi... |
savanu/servo | refs/heads/master | tests/wpt/web-platform-tests/WebCryptoAPI/tools/generate.py | 49 | # script to generate the generateKey tests
import os
here = os.path.dirname(__file__)
successes_html = """<!DOCTYPE html>
<meta charset=utf-8>
<meta name="timeout" content="long">
<title>WebCryptoAPI: generateKey() Successful Calls</title>
<link rel="author" title="Charles Engelke" href="mailto:w3c@engelke.com">
<li... |
mdietrichc2c/OCB | refs/heads/8.0 | addons/account_analytic_plans/wizard/__init__.py | 445 | # -*- 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... |
rohitranjan1991/home-assistant | refs/heads/dev | homeassistant/loader.py | 13 | """
homeassistant.loader
~~~~~~~~~~~~~~~~~~~~
Provides methods for loading Home Assistant components.
This module has quite some complex parts. I have tried to add as much
documentation as possible to keep it understandable.
Components are loaded by calling get_component('switch') from your code.
If you want to retr... |
ppc64le/ciaas | refs/heads/master | roles/client/files/backend/partner/migrations/0004_auto_20160720_1813.py | 1 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.6 on 2016-07-20 18:13
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('partner', '0003_auto_20160719_1359'),
]
operations = [
migrations.AlterField... |
eugena/django | refs/heads/master | tests/migrate_signals/tests.py | 324 | from django.apps import apps
from django.core import management
from django.db.models import signals
from django.test import TestCase, override_settings
from django.utils import six
APP_CONFIG = apps.get_app_config('migrate_signals')
PRE_MIGRATE_ARGS = ['app_config', 'verbosity', 'interactive', 'using']
MIGRATE_DATABA... |
technologiescollege/Blockly-rduino-communication | refs/heads/master | scripts_XP/Lib/tkinter/dialog.py | 153 | # dialog.py -- Tkinter interface to the tk_dialog script.
from tkinter import *
from tkinter import _cnfmerge
if TkVersion <= 3.6:
DIALOG_ICON = 'warning'
else:
DIALOG_ICON = 'questhead'
class Dialog(Widget):
def __init__(self, master=None, cnf={}, **kw):
cnf = _cnfmerge((cnf, kw))
self.... |
OneBitSoftware/jwtSample | refs/heads/master | src/Spa/env1/Lib/codecs.py | 33 | """ codecs -- Python Codec Registry, API and helpers.
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""#"
import __builtin__, sys
### Registry and builtin stateless codec functions
try:
from _codecs import *
except ImportError, why:
raise SystemErr... |
jhunufa/ArduWatchRaspSerial | refs/heads/master | virtualenv/lib/python3.4/site-packages/setuptools/lib2to3_ex.py | 907 | """
Customized Mixin2to3 support:
- adds support for converting doctests
This module raises an ImportError on Python 2.
"""
from distutils.util import Mixin2to3 as _Mixin2to3
from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
class DistutilsRefactorin... |
suncycheng/intellij-community | refs/heads/master | python/testData/refactoring/extractmethod/TryContext.after.py | 79 | def foo(f):
x = 1
x = bar(f, x)
return x
def bar(f_new, x_new):
try:
x_new = f_new()
except Exception:
pass
return x_new |
ahb0327/intellij-community | refs/heads/master | python/testData/resolve/multiFile/relativeSimple/RelativeSimple.py | 83 | from __future__ import absolute_import
from .sys import token
a = token
# <ref>
|
LaoZhongGu/kbengine | refs/heads/master | kbe/src/lib/python/Objects/typeslots.py | 47 | #!/usr/bin/python
# Usage: typeslots.py < Include/typeslots.h > typeslots.inc
import sys, re
print("/* Generated by typeslots.py $Revision$ */")
res = {}
for line in sys.stdin:
m = re.match("#define Py_([a-z_]+) ([0-9]+)", line)
if not m:
continue
member = m.group(1)
if member.startswith("tp_"... |
potens1/python-xbee | refs/heads/master | xbee/__init__.py | 55 | """
XBee package initalization file
By Paul Malmsten, 2010
pmalmsten@gmail.com
"""
from xbee.ieee import XBee
from xbee.zigbee import ZigBee
|
daq-tools/kotori | refs/heads/amo/packaging | kotori/vendor/hydro2motion/web/__init__.py | 966 | from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
|
jnayak1/osf.io | refs/heads/develop | tests/test_security.py | 54 | # -*- coding: utf-8 -*-
from nose.tools import *
from website import security
from test_features import requires_gnupg
def test_random_string():
s = security.random_string(length=30)
assert_true(isinstance(s, basestring))
assert_equal(len(s), 30)
s2 = security.random_string(30)
assert_not_equal(s... |
erikld/Bobo | refs/heads/master | python3/koans/jims.py | 145 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
class Dog:
def identify(self):
return "jims dog"
|
vbatts/linux | refs/heads/master | scripts/gdb/linux/utils.py | 630 | #
# gdb helper commands and functions for Linux kernel debugging
#
# common utilities
#
# Copyright (c) Siemens AG, 2011-2013
#
# Authors:
# Jan Kiszka <jan.kiszka@siemens.com>
#
# This work is licensed under the terms of the GNU GPL version 2.
#
import gdb
class CachedType:
def __init__(self, name):
s... |
theo-l/django | refs/heads/master | tests/redirects_tests/tests.py | 47 | from django.conf import settings
from django.contrib.redirects.middleware import RedirectFallbackMiddleware
from django.contrib.redirects.models import Redirect
from django.contrib.sites.models import Site
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponseForbidden, HttpRespons... |
uberamd/NGECore2 | refs/heads/master | scripts/object/draft_schematic/chemistry/medpack_enhance_strength_a.py | 85615 | import sys
def setup(core, object):
return |
ProjectSWGCore/NGECore2 | refs/heads/master | scripts/object/tangible/component/vehicle/armor_panel_acid.py | 85615 | import sys
def setup(core, object):
return |
sloanyang/aquantic | refs/heads/master | Tools/Scripts/webkitpy/common/net/failuremap.py | 134 | # Copyright (C) 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 of conditions and the ... |
evaschalde/odoo | refs/heads/master | addons/event_sale/__openerp__.py | 306 | # -*- 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... |
martinjorge/sm | refs/heads/master | drivers/mpath_null.py | 11 | #!/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... |
pombredanne/pulp_packaging | refs/heads/master | dockerfiles/registry-admin.py | 3 | #!/usr/bin/env python
"""Docker-focused client for pulp docker registry
"""
import argparse
import errno
import getpass
import os.path
import re
import subprocess
import tempfile
class Environment(object):
"""Host environment"""
def __init__(self):
"""Environment defaults"""
self.conf_dir =... |
kratman/psi4public | refs/heads/master | tests/python/energy/input.py | 6 | import psi4
psi4.set_output_file("output.dat", False)
geom = psi4.geometry("""
C # testing escaping comments
""")
psi4.set_options({"SCF_TYPE": "DF",
"BASIS": "cc-pVDZ"})
scf_e, scf_wfn = psi4.energy('SCF', return_wfn=True)
psi4.compare_values(-37.5959861862713893, scf_e, 6, 'SCF DF Energy')
ps... |
saurabh6790/medsyn-app | refs/heads/master | stock/utils.py | 10 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
import webnotes
from webnotes import msgprint, _
import json
from webnotes.utils import flt, cstr, nowdate, add_days, cint
from webnotes.defaults import get_global_default
from webnotes.uti... |
SmithsonianEnterprises/django-cms | refs/heads/develop | cms/models/query.py | 31 | # -*- coding: utf-8 -*-
from django.db.models import Q
from django.contrib.sites.models import Site
from treebeard.mp_tree import MP_NodeQuerySet
from cms.publisher.query import PublisherQuerySet
from cms.exceptions import NoHomeFound
from django.utils import timezone
class PageQuerySet(MP_NodeQuerySet, PublisherQuer... |
chrooter/planbox | refs/heads/staging | src/planbox_data/migrations/0008_project_layout.py | 4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('planbox_data', '0007_separate_shareabouts_section_maps_and_descriptions'),
]
operations = [
migrations.AddField(
... |
ingadhoc/xmi2odoo_example | refs/heads/xmi2odoo80 | addons/openacademy/session.py | 1 | # -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import Warning
class session(models.Model):
""""""
_name = 'openacademy.session'
_description = 'session'
_states_ = [
# State machine: untitle
('draft', 'Draft'),
('confirmed', 'Confir... |
piccolo-dev/android_kernel_bq_piccolo | refs/heads/cm-12.1-test | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... |
ewmoore/numpy | refs/heads/master | numpy/distutils/tests/setup.py | 49 | #!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
config = Configuration('testnumpydistutils',parent_package,top_path)
config.add_subpackage('pyrex_ext')
config.add_subpackage('f2py_ext')
#config.add_subpackage('f2py_f90_ext... |
broferek/ansible | refs/heads/devel | lib/ansible/modules/source_control/github/github_release.py | 47 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright: Ansible Team
# 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',
'... |
BiznetGIO/horizon | refs/heads/stable/pike-gio | openstack_dashboard/dashboards/identity/mappings/urls.py | 14 | # Copyright (C) 2015 Yahoo! 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... |
dlresende/extreme-carpaccio | refs/heads/master | clients/python/simple-server/__main__.py | 5 | import client
client.start_server() |
replicatorg/ReplicatorG | refs/heads/master | skein_engines/skeinforge-50/skeinforge_application/skeinforge_plugins/analyze_plugins/skeiniso.py | 7 | """
This page is in the table of contents.
Skeiniso is an analyze viewer to display a gcode file in an isometric view.
The skeiniso manual page is at:
http://fabmetheus.crsndoo.com/wiki/index.php/Skeinforge_Skeiniso
==Operation==
The default 'Activate Skeiniso' checkbox is off. When it is on, the functions described... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.