repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
neumerance/cloudloon2 | refs/heads/master | .venv/lib/python2.7/site-packages/django/core/management/commands/startapp.py | 205 | from django.core.management.base import CommandError
from django.core.management.templates import TemplateCommand
from django.utils.importlib import import_module
class Command(TemplateCommand):
help = ("Creates a Django app directory structure for the given app "
"name in the current directory or opt... |
selwin/Django-facebook | refs/heads/master | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/index.py | 25 | """Routines related to PyPI, indexes"""
import sys
import os
import re
import mimetypes
import threading
import posixpath
import pkg_resources
import random
import socket
import string
from pip.log import logger
from pip.util import Inf
from pip.util import normalize_name, splitext
from pip.exceptions import Distribut... |
ds-hwang/chromium-crosswalk | refs/heads/master | mojo/public/tools/bindings/pylib/mojom/generate/pack.py | 23 | # 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.
import module as mojom
# This module provides a mechanism for determining the packed order and offsets
# of a mojom.Struct.
#
# ps = pack.PackedStruct(struc... |
openstack/trove | refs/heads/master | trove/guestagent/utils/docker.py | 1 | # Copyright 2020 Catalyst Cloud
#
# 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 agre... |
akash1808/nova | refs/heads/master | nova/tests/unit/virt/xenapi/test_volumeops.py | 65 | # Copyright (c) 2012 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 ... |
joannne/aggregator | refs/heads/master | aggregator/users/admin.py | 60 | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django import forms
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin as AuthUserAdmin
from django.contrib.auth.forms import UserChangeForm, UserCreationForm
from .models import User
class MyUserChan... |
huiyiqun/kernel_flo | refs/heads/working | tools/perf/scripts/python/sctop.py | 11180 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... |
ojii/sandlib | refs/heads/master | lib/lib-python/2.7/email/header.py | 255 | # Copyright (C) 2002-2006 Python Software Foundation
# Author: Ben Gertzfield, Barry Warsaw
# Contact: email-sig@python.org
"""Header encoding and decoding functionality."""
__all__ = [
'Header',
'decode_header',
'make_header',
]
import re
import binascii
import email.quoprimime
import email.base64m... |
kisel/trex-core | refs/heads/master | scripts/external_libs/jsonrpclib-pelix-0.2.5/jsonrpclib/history.py | 5 | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
The history module.
:authors: Josh Marshall, Thomas Calmant
:copyright: Copyright 2015, isandlaTech
:license: Apache License 2.0
:version: 0.2.5
..
Copyright 2015 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not... |
WindCanDie/spark | refs/heads/master | python/test_coverage/coverage_daemon.py | 78 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
fbalakirev/red-pitaya-notes | refs/heads/master | projects/pulsed_nmr/client/pulsed_nmr.py | 1 | #!/usr/bin/env python
# Control program for the Red Pitaya Pulsed NMR system
# Copyright (C) 2015 Pavel Demin
#
# 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,... |
schleichdi2/OPENNFR-6.0-CORE | refs/heads/master | opennfr-openembedded-core/meta/lib/oeqa/selftest/bblayers.py | 1 | import unittest
import os
import logging
import re
import shutil
import oeqa.utils.ftools as ftools
from oeqa.selftest.base import oeSelfTest
from oeqa.utils.commands import runCmd, get_bb_var
from oeqa.utils.decorators import testcase
class BitbakeLayers(oeSelfTest):
@testcase(756)
def test_bitbakelayers_sh... |
jianlirong/incubator-hawq | refs/heads/master | tools/bin/pythonSrc/unittest2-0.5.1/unittest2/suite.py | 166 | """TestSuite"""
import sys
import unittest
from unittest2 import case, util
__unittest = True
class BaseTestSuite(unittest.TestSuite):
"""A simple test suite that doesn't provide class or module shared fixtures.
"""
def __init__(self, tests=()):
self._tests = []
self.addTests(tests)
... |
MalloyPower/parsing-python | refs/heads/master | front-end/testsuite-python-lib/Python-2.2/Lib/test/test_cfgparser.py | 2 | import ConfigParser
import StringIO
from test_support import TestFailed, verify
def basic(src):
print "Testing basic accessors..."
cf = ConfigParser.ConfigParser()
sio = StringIO.StringIO(src)
cf.readfp(sio)
L = cf.sections()
L.sort()
verify(L == [r'Commented Bar',
r'Foo ... |
giuliov/ansible | refs/heads/devel | lib/ansible/parsing/yaml/__init__.py | 7690 | # (c) 2012-2014, 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) an... |
nugget/home-assistant | refs/heads/dev | homeassistant/components/sensor/__init__.py | 4 | """
Component to interface with various sensors that can be monitored.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor/
"""
from datetime import timedelta
import logging
import voluptuous as vol
from homeassistant.helpers.entity_component impor... |
cgstudiomap/cgstudiomap | refs/heads/develop | main/eggs/geojson-1.3.1-py2.7.egg/geojson/utils.py | 1 | """Coordinate utility functions."""
def coords(obj):
"""
Yields the coordinates from a Feature or Geometry.
:param obj: A geometry or feature to extract the coordinates from."
:type obj: Feature, Geometry
:return: A generator with coordinate tuples from the geometry or feature.
:rtype: genera... |
GeyerA/android_external_chromium_org | refs/heads/master | chrome/test/functional/stress.py | 65 | #!/usr/bin/env python
# Copyright (c) 2011 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.
"""
Stess Tests for Google Chrome.
This script runs 4 different stress tests:
1. Plugin stress.
2. Back and forward stress.
3. Do... |
osrf/opensplice | refs/heads/osrf-6.9.0 | build/docs/DDSMATLABGuide/source/conf.py | 2 | # -*- coding: utf-8 -*-
#
# OpenSplice_Deployment_Guide build configuration file, created by
# ReST Editor on 06-Jul-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.
#
# All configuration... |
public-ink/public-ink | refs/heads/master | server/appengine-staging/lib/unidecode/x030.py | 248 | data = (
' ', # 0x00
', ', # 0x01
'. ', # 0x02
'"', # 0x03
'[JIS]', # 0x04
'"', # 0x05
'/', # 0x06
'0', # 0x07
'<', # 0x08
'> ', # 0x09
'<<', # 0x0a
'>> ', # 0x0b
'[', # 0x0c
'] ', # 0x0d
'{', # 0x0e
'} ', # 0x0f
'[(', # 0x10
')] ', # 0x11
'@', # 0x12
'X ', # ... |
nesdis/djongo | refs/heads/master | tests/django_tests/tests/v21/tests/auth_tests/test_management.py | 3 | import builtins
import getpass
import sys
from datetime import date
from io import StringIO
from unittest import mock
from django.apps import apps
from django.contrib.auth import management
from django.contrib.auth.management import (
create_permissions, get_default_username,
)
from django.contrib.auth.management.... |
jrrickerson/pyweek23 | refs/heads/master | src/main.py | 1 | import sge
from sge.gfx import Background, Color
from .game import Game
from .rooms import MainMenu
from .objects.testing import TestPlayer, SmallEnemy
def main():
sge.game = Game(width=640, height=480, fps=120, window_text='SGE Test')
background = sge.gfx.Background([], sge.gfx.Color("black"))
player = T... |
adityacs/ansible | refs/heads/devel | lib/ansible/modules/network/nxos/nxos_vrf_interface.py | 11 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... |
ugaliguy/HackerRank | refs/heads/master | Algorithms/Implementation/cut-the-sticks.py | 1 | # Python 2
#!/bin/python
import sys
n = int(raw_input())
arr = map(int,raw_input().split())
arr.sort()
count = len(arr)
while(count >= 1):
print count
min = arr[0]
for i in range(count):
if arr[0] == min:
arr.pop(0)
count = len(arr) |
clownhood/lol | refs/heads/master | contrib/wallettools/walletunlock.py | 2299 | from jsonrpc import ServiceProxy
access = ServiceProxy("http://127.0.0.1:8332")
pwd = raw_input("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60) |
pniebla/test-repo-console | refs/heads/master | svn/git-1.8.3.3.tar/git-1.8.3.3/git-1.8.3.3/git_remote_helpers/git/git.py | 44 | #!/usr/bin/env python
"""Functionality for interacting with Git repositories.
This module provides classes for interfacing with a Git repository.
"""
import os
import re
import time
from binascii import hexlify
from cStringIO import StringIO
import unittest
from git_remote_helpers.util import debug, error, die, sta... |
dav1x/ansible | refs/heads/devel | contrib/inventory/ec2.py | 26 | #!/usr/bin/env python
'''
EC2 external inventory script
=================================
Generates inventory that Ansible can understand by making API request to
AWS EC2 using the Boto library.
NOTE: This script assumes Ansible is being executed where the environment
variables needed for Boto have already been set:... |
JioCloud/swift | refs/heads/master | test/unit/common/ring/test_utils.py | 2 | # Copyright (c) 2010-2012 OpenStack Foundation
#
# 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 agree... |
99cloud/keystone_register | refs/heads/master | openstack_dashboard/dashboards/admin/instances/views.py | 7 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Copyright 2012 Openstack, LLC
# Copyright 2012 Nebula, Inc.
#
# Licensed under the Apache License, Version 2.0 ... |
dati91/servo | refs/heads/master | tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/resultlog.py | 32 | """ log machine-parseable test session result information in a plain
text file.
"""
from __future__ import absolute_import, division, print_function
import py
import os
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting", "resultlog plugin options")
group.addoption(
"--resultlo... |
sprinkler/rainmachine-developer-resources | refs/heads/master | sdk-parsers/RMParserFramework/parsers/met-no-parser.py | 1 | # Copyright (c) 2014-2015 RainMachine, Green Electronics LLC
# All rights reserved.
# Authors: Nicu Pavel <npavel@mini-box.com>
from RMParserFramework.rmParser import RMParser
from RMUtilsFramework.rmLogging import log
from RMDataFramework.rmWeatherData import RMWeatherConditions
from RMUtilsFramework.rmTimeUtils impo... |
ctu-osgeorel/gdal-vfr | refs/heads/master | vfr2pg.py | 1 | #!/usr/bin/env python
###############################################################################
#
# VFR importer based on GDAL library
#
# Author: Martin Landa <landa.martin gmail.com>
#
# Licence: MIT/X
#
###############################################################################
"""
Imports VFR data to Po... |
handroissuazo/tensorflow | refs/heads/master | tensorflow/contrib/specs/python/summaries.py | 164 | # 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 applicable ... |
makinacorpus/django-ckeditor | refs/heads/master | setup.py | 2 | import os.path
from setuptools import setup, find_packages
def get_source_files():
for dirname, _, files in os.walk('ckeditor/static/ckeditor/ckeditor/_source'):
for filename in files:
yield os.path.join('/'.join(dirname.split('/')[1:]), filename)
setup(
name='django-ckeditor-updated',
... |
anbasile/pmu_simulator | refs/heads/master | simulator/main.py | 2 | from __future__ import print_function
import matplotlib.pyplot as plt
import random
import math
import folium
import pandas as pd
import numpy as np
#select a point to generate points around
pt = [46.086262,11.128824]
#load TT stops
stops = pd.read_csv("stops.txt")
#generate N points around pt.
temp = []
def genera... |
aterrel/dynd-python | refs/heads/master | dynd/tests/test_ckernel.py | 1 | from __future__ import print_function, absolute_import
import sys
import ctypes
import unittest
from dynd import nd, ndt, _lowlevel
import numpy as np
# ctypes.c_ssize_t/c_size_t was introduced in python 2.7
if sys.version_info >= (2, 7):
c_ssize_t = ctypes.c_ssize_t
c_size_t = ctypes.c_size_t
else:
if cty... |
MontrealCorpusTools/PolyglotDB | refs/heads/main | tests/test_subannotations.py | 4 | import pytest
from polyglotdb import CorpusContext
from polyglotdb.query import Sum
from polyglotdb.exceptions import AnnotationAttributeError
def test_basic(subannotation_config):
with CorpusContext(subannotation_config) as c:
q = c.query_graph(c.phone).filter(c.phone.label == 'g')
q = q.columns... |
maarteninja/ml2014 | refs/heads/master | three/minimize.py | 1 | #This program is distributed WITHOUT ANY WARRANTY; without even the implied
#warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
#
#This file contains a Python version of Carl Rasmussen's Matlab-function
#minimize.m
#
#minimize.m is copyright (C) 1999 - 2006, Carl Edward Rasmussen.
#Python adaptation ... |
edwardzhou1980/bite-project | refs/heads/master | server/root.py | 17 | # Copyright 2012 Google Inc. All Rights Reserved.
"""Server root."""
__author__ = 'jason.stredwick@gmail.com (Jason Stredwick)'
import os
ROOT = os.path.dirname(__file__)
|
s3nk4s/flaskTutorials | refs/heads/master | FlaskApp/FlaskApp/venv/local/lib/python2.7/site-packages/setuptools/svn_utils.py | 98 | import os
import re
import sys
from distutils import log
import xml.dom.pulldom
import shlex
import locale
import codecs
import unicodedata
import warnings
from setuptools.compat import unicode
from setuptools.py31compat import TemporaryDirectory
from xml.sax.saxutils import unescape
try:
import url... |
mozilla/inventory | refs/heads/master | vendor-local/src/django-multidb-router/docs/conf.py | 3 | import sys
import os
sys.path.append(os.path.abspath('..'))
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
extensions = ['sphinx.ext.autodoc']
# General information about the project.
project = u'multidb-router'
copyright = u'2010, The Zamboni Collectiv... |
gabrielfalcao/lettuce | refs/heads/master | tests/integration/lib/Django-1.2.5/django/conf/locale/pt/formats.py | 80 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
DATE_FORMAT = r'j \de F \de Y'
TIME_FORMAT = 'H:i:s'
DATETIME_FORMAT = r'j \de F \de Y à\s H:i'
YEAR_MONTH_FORMAT = r'F \de Y'
MONTH_DAY_FORMAT = r'j \de F'
SHORT_DATE_FORMAT = 'd/m/Y'
SHORT_DATETIME_FORMAT = 'd/m/Y H:... |
leilihh/cinder | refs/heads/master | tools/colorizer.py | 36 | #!/usr/bin/env python
# Copyright (c) 2013, Nebula, Inc.
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file exce... |
mateor/betarepo | refs/heads/master | src/python/betarepo/datastructures/linear/concrete/stacks/dynamic_array_stack.py | 1 | # coding=utf-8
# The MIT License (MIT)
# Copyright (c) 2016 mateor
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
from betarepo.datastructures.linear.concrete.stacks.fixed_array_stack import FixedArrayStack
from ... |
hachard/Cra-Magnet | refs/heads/master | flask/lib/python3.5/site-packages/bs4/tests/test_docs.py | 607 | "Test harness for doctests."
# pylint: disable-msg=E0611,W0142
__metaclass__ = type
__all__ = [
'additional_tests',
]
import atexit
import doctest
import os
#from pkg_resources import (
# resource_filename, resource_exists, resource_listdir, cleanup_resources)
import unittest
DOCTEST_FLAGS = (
doctes... |
VictoriousCoin/Victorious-Coin | refs/heads/master | share/qt/extract_strings_qt.py | 1294 | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt4 stringdefs so that
they can be picked up by Qt linguist.
'''
from subprocess import Popen, PIPE
import glob
OUT_CPP="src/qt/bitcoinstrings.cpp"
EMPTY=['""']
def parse_po(text):
"""
Parse 'po' format produced by xgettext.
Ret... |
dongjiaqiang/cassandra | refs/heads/trunk | pylib/cqlshlib/helptopics.py | 10 | # 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... |
burzillibus/RobHome | refs/heads/master | venv/lib/python2.7/site-packages/click/parser.py | 199 | # -*- coding: utf-8 -*-
"""
click.parser
~~~~~~~~~~~~
This module started out as largely a copy paste from the stdlib's
optparse module with the features removed that we do not need from
optparse because we implement them in Click on a higher level (for
instance type handling, help formatting a... |
BaconPancakes/valor | refs/heads/master | lib/aiohttp/connector.py | 17 | import asyncio
import functools
import http.cookies
import ssl
import sys
import traceback
import warnings
from collections import defaultdict
from hashlib import md5, sha1, sha256
from itertools import chain
from math import ceil
from types import MappingProxyType
import aiohttp
from . import hdrs, helpers
from .cli... |
Ebag333/Pyfa | refs/heads/master | eos/effects/shipbonushybridtrackingatc2.py | 2 | # shipBonusHybridTrackingATC2
#
# Used by:
# Ship: Adrestia
type = "passive"
def handler(fit, ship, context):
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Medium Hybrid Turret"),
"trackingSpeed", ship.getModifiedItemAttr("shipBonusATC2"))
|
3dfxmadscientist/CBSS | refs/heads/master | addons/hr_recruitment/__openerp__.py | 52 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... |
ralphtheninja/cjdns | refs/heads/master | node_build/dependencies/libuv/build/gyp/test/library/gyptest-static.py | 72 | #!/usr/bin/env python
# Copyright (c) 2009 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.
"""
Verifies simple build of a "Hello, world!" program with static libraries,
including verifying that libraries are rebuilt correctly when ... |
Alberto-Beralix/Beralix | refs/heads/master | i386-squashfs-root/usr/share/system-config-printer/troubleshoot/CheckLocalServerPublishing.py | 2 | #!/usr/bin/python
## Printing troubleshooter
## Copyright (C) 2008 Red Hat, Inc.
## Copyright (C) 2008 Tim Waugh <twaugh@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 Foundation; either ... |
tschaume/gnuplot-py | refs/heads/master | gnuplot_Suites.py | 2 | # $Id$
# This file is provided as part of the Gnuplot.py package for the
# convenience of Mac users. It was generated primarily using gensuitemodule
# with Mac gnuplot 3.7.1a. Thanks to Anthony M. Ingraldi and Noboru Yamamoto
# for helping with this.
# file contains
#
# class gnuplot_Suite
# class odds_and_ends
#... |
agendaTCC/AgendaTCC | refs/heads/master | tccweb/apps/emails/sendmail.py | 1 | from django.db.models import Q
from ast import literal_eval
import re
from django.contrib.auth import get_user_model as User
from disciplinas.models import Disciplina
from semestre.models import Semestre
from projetos.models import ProjetoDeGraduacao
from departamentos.models import Departamento
def alunosMatriculado... |
CJ8664/servo | refs/heads/master | tests/wpt/web-platform-tests/html/semantics/forms/form-submission-0/form-echo.py | 80 | def main(request, response):
bytes = bytearray(request.raw_input.read())
bytes_string = " ".join("%02x" % b for b in bytes)
return (
[("Content-Type", "text/plain")],
bytes_string
)
|
zhuwenping/python-for-android | refs/heads/master | python3-alpha/python3-src/Lib/test/crashers/gc_inspection.py | 195 | """
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 ... |
halberom/ansible | refs/heads/devel | lib/ansible/executor/__init__.py | 7690 | # (c) 2012-2014, 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) an... |
youprofit/ansible | refs/heads/devel | test/units/module_utils/__init__.py | 7690 | # (c) 2012-2014, 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) an... |
hlin117/scikit-learn | refs/heads/master | examples/linear_model/plot_theilsen.py | 100 | """
====================
Theil-Sen Regression
====================
Computes a Theil-Sen Regression on a synthetic dataset.
See :ref:`theil_sen_regression` for more information on the regressor.
Compared to the OLS (ordinary least squares) estimator, the Theil-Sen
estimator is robust against outliers. It has a breakd... |
AndrewGrossman/fuzzy-octo-batman | refs/heads/master | src/accounts/forms.py | 69 | from __future__ import unicode_literals
from django.contrib.auth.forms import AuthenticationForm
from django import forms
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, Div, Submit, HTML, Button, Row, Field
from crispy_forms.bootstrap import AppendedText, PrependedText, FormActions
f... |
Sotera/Datawake-Legacy | refs/heads/master | memex-datawake-stream/src/datawakeio/local_entity_data_connector.py | 4 | """
Copyright 2014 Sotera Defense Solutions, 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... |
hongliang5623/sentry | refs/heads/master | src/sentry/management/commands/celerybeat.py | 29 | """
Start the celery clock service from the Django management command.
"""
from __future__ import absolute_import, unicode_literals
from celery.bin import beat
from sentry.celery import app
from sentry.queue.command import CeleryCommand
beat = beat.beat(app=app)
# this is a reimplementation of the djcelery 'cele... |
modelrockettier/wget | refs/heads/master | testenv/conf/expected_files.py | 6 | from difflib import unified_diff
import os
import sys
from conf import hook
from exc.test_failed import TestFailed
""" Post-Test Hook: ExpectedFiles
This is a Post-Test hook that checks the test directory for the files it
contains. A dictionary object is passed to it, which contains a mapping of
filenames and contents... |
mixturemodel-flow/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/datasets/load_csv_test.py | 137 | # 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... |
fengbaicanhe/intellij-community | refs/heads/master | python/helpers/pydev/tests_python/_debugger_case19.py | 100 | class A:
def __init__(self):
self.__var = 10
if __name__ == '__main__':
a = A()
print(a._A__var)
# Evaluate 'a.__var' should give a._A__var_
print('TEST SUCEEDED')
|
Genomon-Project/Genomon | refs/heads/devel | scripts/genomon_pipeline/dna_resource/pre_pmsignature.py | 2 | #! /usr/bin/env python
from genomon_pipeline.stage_task import *
class Res_PrePmsignature(Stage_task):
task_name = "pre_pmsignature"
script_template = """
#!/bin/bash
#
# Set SGE
#
#$ -S /bin/bash # set shell in UGE
#$ -cwd # execute at the submitted dir
pwd # pri... |
lgscofield/odoo | refs/heads/8.0 | addons/account_budget/tests/test_theoreticalamount.py | 229 | # -*- coding: utf-8 -*-
from datetime import datetime
from mock import patch
from openerp.tests.common import TransactionCase
from openerp.tools import DEFAULT_SERVER_DATETIME_FORMAT
# ---------------------------------------------------------
# Tests
# ---------------------------------------------------------
class ... |
vmiklos/vmexam | refs/heads/master | python/irssi/chanstat.py | 1 | import irssi, time, os
ignore = []
statfile = os.path.join(os.environ['HOME'], ".irssi", "chanstat")
def cmd_chanstat(data, server, witem):
def chancmp(a, b):
return cmp(a[1], b[1])
prevdate = None
datelimit = None
datestr = ""
if data == "yesterday":
datestr = " previous"
prevdate = 86400
datelimit = ... |
albertjiang/gambit_agg_old | refs/heads/master_gamerep_agg | contrib/scripts/build/minint.py | 2 | #
# A Python script to test the Gambit Python wrapper by building
# the minimum-unique-integer game
#
import gambit, sys
K = int(sys.argv[2])
N = int(sys.argv[1])
nfg = gambit.NewTable([K for i in range(N)])
# Pre-create outcomes. Outcome 'i' is the outcome where player 'i' wins.
for pl in xrange(1, nfg.NumPlayer... |
CMPUT404W16/social-dist | refs/heads/master | fbook/api/postAPI.py | 1 | from .api import api
from ..db import db
from .. models import Post, User, Comment, RemoteUser, Image_Posts
from flask_restful import Resource, reqparse
from flask.ext.login import current_user
from flask import request, abort
from bauth import auth
from apiHelper import ApiHelper
import json
import dateutil.parser
imp... |
zhwa/thunder | refs/heads/master | thunder/rdds/fileio/writers.py | 8 | """Classes that abstract writing to various types of filesystems.
Currently two types of 'filesystem' are supported:
* the local file system, via python's native file() objects
* Amazon's S3 or Google Storage, using the boto library (only if boto is installed; boto is not a requirement)
For each filesystem, three t... |
40223246/w16b_test | refs/heads/master | static/Brython3.1.3-20150514-095342/Lib/decimal.py | 623 | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz <aahz at pobox.com>
# and Tim Peters
# This module should be kept in sync with ... |
qiankunshe/sky_engine | refs/heads/master | sky/tools/webkitpy/layout_tests/process_json_data_unittest.py | 59 | # Copyright (C) 2014 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 ... |
greyfenrir/taurus | refs/heads/master | tests/resources/selenium/external_logging.py | 1 | # coding=utf-8
import logging
import random
import string
import sys
import unittest
from time import time, sleep
import apiritif
import os
import re
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException, TimeoutException
from selenium.webdriver.common.by import By
from seleniu... |
riggsd/solartime | refs/heads/dev | solartime.py | 1 | """
The :mod:`solartime` module provides the means to calculate dawn, sunrise, solar noon, sunset,
and dusk, at a specific latitude/longitude.
The module provides one main class, :class:`SolarTime`.
:class:`SolarTime`
* Calculates events in the UTC timezone.
Example usage ::
>>> from datetime imp... |
Pixelblaster/kotti_contentgenerator | refs/heads/master | kotti_contentgenerator/tests/test_views.py | 2 | from kotti.testing import DummyRequest
from mock import MagicMock
class TestGeneratorView:
def make_one(self):
from kotti_contentgenerator.views import GeneratorView
return GeneratorView({}, DummyRequest())
def test_it(self, db_session, monkeypatch):
from kotti.resources import Docum... |
mas2df/racefinder | refs/heads/master | processing/test/race_distance_regex_test.py | 1 | import unittest
from processing.utils import getDistanceAndType, getDistanceUnitAndType
data = [
["5K run", "5", "K", "run"],
["10K run", "10", "K", "run"],
["8K run", "8", "K", "run"],
["5K novelty run", "5", "K", "novelty run"],
["5K walk", "5", "K", "walk"],
["1M fun run", "1", "M", "fun run"],
["1M walk", "1", "M"... |
santidediego/LearningDjango | refs/heads/master | lib/python3.5/site-packages/pip/_vendor/pkg_resources/__init__.py | 252 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... |
chatelak/RMG-Py | refs/heads/master | rmgpy/data/thermoTest.py | 2 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import unittest
from external.wip import work_in_progress
from rmgpy import settings
from rmgpy.species import Species
from rmgpy.data.thermo import ThermoDatabase
from rmgpy.molecule.molecule import Molecule
########################################################... |
lancezlin/pylearn2 | refs/heads/master | pylearn2/scripts/papers/jia_huang_wkshp_11/assemble.py | 44 | from __future__ import print_function
import numpy as np
import os
from theano.compat.six.moves import xrange
#check that the right files are present
names = os.listdir('.')
if 'features.npy' in names:
print("Not doing anything, features.npy already exists.")
quit(0)
chunk_names = [ 'features_A.npy',
... |
m-ober/byceps | refs/heads/master | byceps/blueprints/admin/email/authorization.py | 1 | """
byceps.blueprints.admin.email.authorization
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from byceps.util.authorization import create_permission_enum
EmailConfigPermission = create_permission_enum('email_config', [
... |
open-homeautomation/home-assistant | refs/heads/dev | tests/components/test_google.py | 13 | """The tests for the Google Calendar component."""
import logging
import unittest
from unittest.mock import patch
import homeassistant.components.google as google
from homeassistant.bootstrap import setup_component
from tests.common import get_test_home_assistant
_LOGGER = logging.getLogger(__name__)
class TestGoog... |
tonybaloney/st2contrib | refs/heads/master | packs/github/actions/add_status.py | 15 | from github import GithubObject
from lib.base import BaseGithubAction
__all__ = [
'AddCommitStatusAction'
]
class AddCommitStatusAction(BaseGithubAction):
def run(self, user, repo, sha, state, target_url=None, description=None):
target_url = target_url or GithubObject.NotSet
description = de... |
niknow/scipy | refs/heads/master | scipy/stats/vonmises.py | 139 | from __future__ import division, print_function, absolute_import
import numpy as np
import scipy.stats
from scipy.special import i0
def von_mises_cdf_series(k,x,p):
x = float(x)
s = np.sin(x)
c = np.cos(x)
sn = np.sin(p*x)
cn = np.cos(p*x)
R = 0
V = 0
for n in range(p-1,0,-1):
... |
Ben-Healey/PGE-Extension | refs/heads/master | pge-0.3/src/pge2d.py | 2 | #!/usr/bin/env python
#
#
#
def rgb (r, g, b):
|
trungdong/prov | refs/heads/master | src/prov/identifier.py | 1 | __author__ = "Trung Dong Huynh"
__email__ = "trungdong@donggiang.com"
class Identifier(object):
"""Base class for all identifiers and also represents xsd:anyURI."""
# TODO: make Identifier an "abstract" base class and move xsd:anyURI
# into a subclass
def __init__(self, uri):
"""
Con... |
manasi24/jiocloud-tempest-qatempest | refs/heads/master | tempest/api/identity/admin/v2/test_roles.py | 11 | # Copyright 2012 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 requ... |
eckucukoglu/arm-linux-gnueabihf | refs/heads/master | arm-linux-gnueabihf/libc/usr/lib/python2.7/test/test_xml_etree.py | 37 | # xml.etree test. This file contains enough tests to make sure that
# all included components work as they should.
# Large parts are extracted from the upstream test suite.
# IMPORTANT: the same doctests are run from "test_xml_etree_c" in
# order to ensure consistency between the C implementation and the
# Python imp... |
DrMeers/django | refs/heads/master | tests/file_uploads/views.py | 21 | from __future__ import unicode_literals
import hashlib
import json
import os
from django.core.files.uploadedfile import UploadedFile
from django.http import HttpResponse, HttpResponseServerError
from django.utils import six
from django.utils.encoding import force_bytes, smart_str
from .models import FileModel
from .... |
rlr/fjord | refs/heads/master | vendor/packages/Babel/babel/core.py | 79 | # -*- coding: utf-8 -*-
"""
babel.core
~~~~~~~~~~
Core locale representation and locale data access.
:copyright: (c) 2013 by the Babel Team.
:license: BSD, see LICENSE for more details.
"""
import os
from babel import localedata
from babel._compat import pickle, string_types
__all__ = ['Unknown... |
amitu/rtime | refs/heads/master | src/pyrtime/tests/test_frame.py | 1 | from __future__ import absolute_import, unicode_literals
import pytest
from rtime.datastructures import Frame
from .utils import assert_similar_structure
def test_init():
assert_similar_structure(Frame(), {})
assert_similar_structure(Frame(name='name'), {'name': 'name'})
assert_similar_structure(Frame(... |
egbertbouman/tribler-g | refs/heads/master | Tribler/Core/NATFirewall/NatCheck.py | 1 | # Written by Lucia D'Acunto
# see LICENSE.txt for license information
import socket
import sys
DEBUG = False
def Test1(udpsock, serveraddr):
"""
The client sends a request to a server asking it to send the
response back to the address and port the request came from
"""
retVal = {"r... |
sebadiaz/rethinkdb | refs/heads/next | test/rql_test/connections/http_support/jinja2/testsuite/__init__.py | 404 | # -*- coding: utf-8 -*-
"""
jinja2.testsuite
~~~~~~~~~~~~~~~~
All the unittests of Jinja2. These tests can be executed by
either running run-tests.py using multiple Python versions at
the same time.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
i... |
ettm2012/MissionPlanner | refs/heads/master | Lib/uu.py | 62 | #! /usr/bin/env python
# Copyright 1994 by Lance Ellinghouse
# Cathedral City, California Republic, United States of America.
# All Rights Reserved
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# ... |
smrjan/seldon-server | refs/heads/master | python/seldon/pipeline/tests/test_util.py | 2 | import unittest
from .. import util as sutils
from .. import basic_transforms as bt
import pandas as pd
import json
import os.path
from sklearn.pipeline import Pipeline
from sklearn.externals import joblib
import logging
class Test_PipelineWrapper(unittest.TestCase):
def _create_test_json(self,fname,as_list=False... |
TaskEvolution/Task-Coach-Evolution | refs/heads/master | taskcoach/taskcoachlib/persistence/csv/__init__.py | 1 | '''
Task Coach - Your friendly task manager
Copyright (C) 2004-2013 Task Coach developers <developers@taskcoach.org>
Task Coach 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
... |
dgoedkoop/QGIS | refs/heads/master | python/plugins/db_manager/db_manager_plugin.py | 8 | # -*- coding: utf-8 -*-
"""
/***************************************************************************
Name : DB Manager
Description : Database manager plugin for QGIS
Date : May 23, 2011
copyright : (C) 2011 by Giuseppe Sucameli
email : brush.tyler@... |
ribag/ganeti-experiments | refs/heads/topic-cli-quote | test/py/ganeti.hypervisor.hv_xen_unittest.py | 2 | #!/usr/bin/python
#
# Copyright (C) 2011, 2013 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This p... |
drnextgis/QGIS | refs/heads/master | python/ext-libs/pygments/lexers/modula2.py | 23 | # -*- coding: utf-8 -*-
"""
pygments.lexers.modula2
~~~~~~~~~~~~~~~~~~~~~~~
Multi-Dialect Lexer for Modula-2.
:copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include
from pygments.util... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.