repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
hendradarwin/VTK | refs/heads/master | ThirdParty/Twisted/twisted/scripts/tap2rpm.py | 41 | # -*- test-case-name: twisted.scripts.test.test_tap2rpm -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
import sys, os, shutil, time, glob
import subprocess
import tempfile
import tarfile
from StringIO import StringIO
import warnings
from twisted.python import usage, log, versions, depreca... |
NewpTone/stacklab-nova | refs/heads/master | debian/python-nova/usr/share/pyshared/nova/tests/api/openstack/volume/extensions/foxinsocks.py | 33 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# 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/... |
ltilve/ChromiumGStreamerBackend | refs/heads/master | chrome/common/extensions/docs/server2/update_server.py | 152 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import getpass
import os
import subprocess
import sys
import build_server
if __name__ == '__main__':
additional_args = []
if ... |
UManPychron/pychron | refs/heads/develop | pychron/pyscripts/uv_extraction_line_pyscript.py | 2 | # ===============================================================================
# Copyright 2013 Jake Ross
#
# 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/licens... |
aimejeux/enigma2 | refs/heads/master | lib/python/Plugins/SystemPlugins/PositionerSetup/plugin.py | 2 | from enigma import eTimer, eDVBResourceManager, eDVBDiseqcCommand, eDVBFrontendParametersSatellite, iDVBFrontend
from Screens.Screen import Screen
from Screens.MessageBox import MessageBox
from Plugins.Plugin import PluginDescriptor
from Components.Label import Label
from Components.Button import Button
from Componen... |
lmazuel/azure-sdk-for-python | refs/heads/master | azure-mgmt-sql/azure/mgmt/sql/models/elastic_pool_database_activity.py | 4 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... |
wangshuai112/jstorm | refs/heads/master | jstorm-core/src/main/py/storm/__init__.py | 68 | __all__ = ['ttypes', 'constants', 'Nimbus', 'DistributedRPC', 'DistributedRPCInvocations']
|
pratikmallya/hue | refs/heads/master | desktop/core/ext-py/Mako-0.8.1/test/test_loop.py | 43 | import re
import unittest
from mako.template import Template
from mako.lookup import TemplateLookup
from mako.codegen import (
_FOR_LOOP, mangle_mako_loop, LoopVariable
)
from mako.runtime import LoopStack, LoopContext
from mako import exceptions
from test import assert_raises_message
from test import Temp... |
inirudebwoy/pulsar | refs/heads/master | tests/apps/rpc.py | 6 | '''Tests the rpc middleware and utilities. It uses the calculator example.'''
import unittest
from pulsar.apps import rpc
from pulsar.apps.test import HttpTestClient
class rpcTest(unittest.TestCase):
def proxy(self):
from examples.calculator.manage import Site
http = HttpTestClient(self, Site())... |
enjaz/enjaz | refs/heads/master | activities/migrations/0031_remove_invitation_registered_students.py | 2 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('activities', '0030_auto_20161124_1930'),
]
operations = [
migrations.RemoveField(
model_name='invitation',
... |
liushuaikobe/GitArchiveUtils | refs/heads/master | daily-task/downloader.py | 1 | # -*- coding: utf-8 -*-
from gevent import monkey
monkey.patch_all()
import os
import shutil
import datetime
from itertools import product
from tempfile import NamedTemporaryFile
import gevent
import requests
import config
import log
import util
yesterday = datetime.date.today() - datetime.timedelta(days=1)
year =... |
hiteshagrawal/python | refs/heads/master | udemy/udemy-memcache/load_balancer.py | 1 | import computer1
import computer2
import computer3
SERVERS = [computer1, computer2, computer3]
def getserver():
my_server = SERVERS.pop(0)
SERVERS.append(my_server)
return my_server
def test_loadbalancer():
from random import randint
for i in range(10):
z = randint(1,21)
a = [53,44,56,42,55,65,122][z%7]
... |
amitskwalia/codesters | refs/heads/master | Imaging-1.1.7/setup.py | 4 | #!/usr/bin/env python
#
# Setup script for PIL 1.1.5 and later
#
# Usage: python setup.py install
#
import glob, os, re, struct, string, sys
# make it possible to run the setup script from another directory
try:
os.chdir(os.path.dirname(sys.argv[0]))
except OSError:
pass
def libinclude(root):
# map root ... |
StealthMicro/OctoPi-Makerbot | refs/heads/master | env/Lib/site-packages/setuptools/tests/test_svn.py | 73 | # -*- coding: utf-8 -*-
"""svn tests"""
import os
import sys
import unittest
import codecs
import subprocess
from setuptools.tests import environment
from setuptools.compat import unicode, unichr
from setuptools import svn_utils
from setuptools.tests.py26compat import skipIf
def _do_svn_check():
try:
s... |
bkonkle/chef-cookbooks | refs/heads/master | example_project/myapp/conf/local/example/urls.py | 2 | from django.conf.urls.defaults import patterns, include
from django.conf.urls.static import static
from django.conf import settings
CONF_MODULE = '%s.conf' % settings.PROJECT_MODULE_NAME
urlpatterns = patterns('',
(r'', include('%s.urls' % CONF_MODULE)),
(r'', include('%s.common.urls.admin' % CONF_MODULE)),
)... |
Team-Zeus/okapi | refs/heads/master | okapi/templatetags/__init__.py | 1 | from okapi.templatetags import headers
from okapi.templatetags.exports import curl, jira
from okapi.templatetags import misc
filters = {
'nl2br': misc.nl2br,
'status_code_class': misc.status_code_class,
'escape_payload': curl.escape_payload,
'headers_as_string': headers.headers_as_string,
'expor... |
lihui7115/ChromiumGStreamerBackend | refs/heads/master | chrome/browser/resources/chromeos/chromevox/tools/generate_test_messages.py | 34 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
'''Generates test_messages.js from an extension message json file.'''
import optparse
import sys
def Die(message):
'''Prints an er... |
alessandro-aglietti/rosdep | refs/heads/master | test/test_rosdep_shell_utils.py | 7 | # Copyright (c) 2011, Willow Garage, 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 co... |
tadebayo/myedge | refs/heads/master | myvenv/Lib/site-packages/django/core/handlers/base.py | 96 | from __future__ import unicode_literals
import logging
import sys
import types
import warnings
from django.conf import settings
from django.core import signals
from django.core.exceptions import ImproperlyConfigured, MiddlewareNotUsed
from django.db import connections, transaction
from django.urls import get_resolver... |
guorendong/iridium-browser-ubuntu | refs/heads/ubuntu/precise | native_client/build/package_version/packages_info.py | 6 | #!/usr/bin/python
# Copyright (c) 2014 The Native Client Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Encompasses a description of packages associated with package targets."""
import error
import json
def LoadJSONStripComments(... |
RasaHQ/rasa_nlu | refs/heads/master | tests/nlu/conftest.py | 1 | import logging
import pytest
from rasa.nlu import data_router, config
from rasa.nlu.components import ComponentBuilder
from rasa.nlu.model import Trainer
from rasa.nlu import training_data
from rasa.nlu.config import RasaNLUModelConfig
logging.basicConfig(level="DEBUG")
CONFIG_DEFAULTS_PATH = "sample_configs/config_... |
basicScandal/raft | refs/heads/master | thirdparty/pyamf/pyamf/remoting/gateway/django.py | 39 | # Copyright (c) The PyAMF Project.
# See LICENSE.txt for details.
"""
Gateway for the Django framework.
This gateway allows you to expose functions in Django to AMF clients and
servers.
@see: U{Django homepage<http://djangoproject.com>}
@since: 0.1.0
"""
django = __import__('django.http')
http = django.http
conf = ... |
mtiny/pyroute2 | refs/heads/master | pyroute2/netlink/rtnl/req.py | 4 | from socket import AF_INET6
from pyroute2.common import basestring
from pyroute2.netlink.rtnl.ifinfmsg import ifinfmsg
from pyroute2.netlink.rtnl.rtmsg import rtmsg
class IPRequest(dict):
def __init__(self, obj=None):
dict.__init__(self)
if obj is not None:
self.update(obj)
def u... |
cstipkovic/spidermonkey-research | refs/heads/master | js/src/build_OPT.OBJ/_virtualenv/lib/python2.7/site-packages/pip/req/req_install.py | 50 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import sys
import tempfile
import traceback
import warnings
import zipfile
from distutils import sysconfig
from distutils.util import change_root
from email.parser import FeedParser
from pip._vendor import pkg_resources, six
from... |
pbrunet/pythran | refs/heads/master | pythran/tests/euler/euler49.py | 4 | #runas solve()
#unittest.skip recursive generator
#pythran export solve()
def solve():
'''
The arithmetic sequence, 1487, 4817, 8147, in which each of the terms increases by 3330, is unusual in two ways: (i) each of the three terms are prime, and, (ii) each of the 4-digit numbers are permutations of one another... |
cfobel/camip | refs/heads/master | camip/bin/place.py | 1 | # coding: utf-8
import hashlib
import sys
from path_helpers import path
from table_layouts import (get_PLACEMENT_TABLE_LAYOUT,
get_PLACEMENT_STATS_TABLE_LAYOUT,
get_PLACEMENT_STATS_DATAFRAME_LAYOUT)
from camip import CAMIP, VPRSchedule
from camip.timing import CAMI... |
nash-x/hws | refs/heads/master | neutron/plugins/cisco/extensions/_credential_view.py | 50 | # Copyright 2011 Cisco Systems, 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 requir... |
mou4e/zirconium | refs/heads/master | build/symlink.py | 132 | #!/usr/bin/env python
# Copyright (c) 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.
"""Make a symlink and optionally touch a file (to handle dependencies)."""
import errno
import optparse
import os.path
import sys... |
ERA-URBAN/wrfpy | refs/heads/master | wrfpy/split_namelist.py | 2 | #!/usr/bin/env python
'''
description: split WRF namelist into first domain / rest
license: APACHE 2.0
author: Ronald van Haren, NLeSC (r.vanharen@esciencecenter.nl)
'''
import f90nml
import copy
import mpl_toolkits.basemap.pyproj as pyproj
from wrfpy.config import config
import os
from wrfpy import... |
Bismarrck/tensorflow | refs/heads/master | tensorflow/contrib/learn/python/learn/datasets/__init__.py | 42 | # 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... |
mitsuhiko/sentry | refs/heads/master | src/sentry/rules/conditions/event_frequency.py | 1 | """
sentry.rules.conditions.event_frequency
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from datetime import datetime, timedelta
from django import forms
fro... |
Simplistix/testfixtures | refs/heads/master | testfixtures/tests/test_tempdir.py | 1 | import os
from testfixtures.shouldraise import ShouldAssert
from testfixtures.mock import Mock
from tempfile import mkdtemp
from testfixtures import Replacer, TempDirectory, compare, tempdir
from unittest import TestCase
from ..rmtree import rmtree
class TestTempDir(TestCase):
@tempdir()
def test_simple(se... |
zasdfgbnm/tensorflow | refs/heads/master | tensorflow/contrib/metrics/python/ops/metric_ops_test.py | 1 | # 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... |
kutuhal/oracle-r12-accounting | refs/heads/master | lib/django/db/models/fields/files.py | 29 | import datetime
import os
import warnings
from inspect import getargspec
from django import forms
from django.core import checks
from django.core.files.base import File
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.models import signals
from django.... |
TridevGuha/django | refs/heads/master | tests/migrations/test_migrations_squashed_complex/3_auto.py | 385 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [("migrations", "2_auto")]
operations = [
migrations.RunPython(migrations.RunPython.noop)
]
|
newerthcom/savagerebirth | refs/heads/master | libs/python-2.72/Tools/faqwiz/faqw.py | 11 | #!/usr/bin/env python
"""FAQ wizard bootstrap."""
# This is a longer version of the bootstrap script given at the end of
# faqwin.py; it prints timing statistics at the end of the regular CGI
# script's output (so you can monitor how it is doing).
# This script should be placed in your cgi-bin directory and made
# e... |
yukihirai0505/tutorial-program | refs/heads/master | programming/python/lstm/predict.py | 1 | import numpy as np
from keras.models import load_model
from utils import hist_price_dl, price_matrix_creator, normalize_windows
# We need ser, preds, row
ser = hist_price_dl(timeframe='30d')[1:31]
price_matrix = price_matrix_creator(ser)
X_test = normalize_windows(price_matrix)
X_test = np.array(X_test)
X_test = np.r... |
ampax/edx-platform | refs/heads/master | pavelib/acceptance_test.py | 15 | """
Acceptance test tasks
"""
from paver.easy import task, cmdopts, needs
from pavelib.utils.test.suites import AcceptanceTestSuite
from optparse import make_option
try:
from pygments.console import colorize
except ImportError:
colorize = lambda color, text: text
__test__ = False # do not collect
@task
@ne... |
jinie/sublime-wakatime | refs/heads/master | packages/wakatime/packages/pygments_py2/pygments/lexers/dalvik.py | 72 | # -*- coding: utf-8 -*-
"""
pygments.lexers.dalvik
~~~~~~~~~~~~~~~~~~~~~~
Pygments lexers for Dalvik VM-related languages.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, include, bygr... |
geosolutions-it/wps-remote | refs/heads/master | src/wpsremote/serviceTester.py | 1 | # (c) 2016 Open Source Geospatial Foundation - all rights reserved
# (c) 2014 - 2015 Centre for Maritime Research and Experimentation (CMRE)
# (c) 2013 - 2014 German Aerospace Center (DLR)
# This code is licensed under the GPL 2.0 license, available at the root
# application directory.
import logging.config
import log... |
mingyi-bian/ece496 | refs/heads/gh-pages | bottle-0.12.7/test/test_securecookies.py | 46 | #coding: utf-8
import unittest
import bottle
from bottle import tob, touni
class TestSecureCookies(unittest.TestCase):
def setUp(self):
self.data = dict(a=5, b=touni('υηι¢σ∂є'), c=[1,2,3,4,tob('bytestring')])
self.key = tob('secret')
def testDeEncode(self):
cookie = bottle.cookie_enco... |
GiovanniConserva/TestDeploy | refs/heads/master | venv/Lib/site-packages/pip/_vendor/packaging/_compat.py | 1177 | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
import sys
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3... |
ahmadassaf/zulip | refs/heads/master | zerver/lib/session_user.py | 14 | from __future__ import absolute_import
from django.contrib.auth import SESSION_KEY, get_user_model
from django.contrib.sessions.models import Session
from typing import Mapping, Optional
from six import text_type
def get_session_dict_user(session_dict):
# type: (Mapping[text_type, int]) -> Optional[int]
# C... |
tbenthompson/tectosaur | refs/heads/master | tectosaur/fmm/cfg.py | 1 | import numpy as np
import attr
import tectosaur.util.gpu as gpu
from tectosaur.util.quadrature import gauss4d_tri
from tectosaur.kernels import kernels
from tectosaur.mesh.mesh_gen import make_sphere
from tectosaur.fmm.surrounding_surf import surrounding_surf
from tectosaur.util.cpp import imp
traversal_ext = imp("t... |
pombredanne/erpnext | refs/heads/develop | erpnext/hr/doctype/employee_external_work_history/__init__.py | 37694 | from __future__ import unicode_literals
|
indashnet/InDashNet.Open.UN2000 | refs/heads/master | android/external/chromium_org/tools/telemetry/telemetry/page/page_measurement_unittest_base.py | 23 | # 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 os
import unittest
from telemetry.page import page_runner
from telemetry.page import page as page_module
from telemetry.page import page_set
from ... |
KanchanChauhan/erpnext | refs/heads/develop | erpnext/patches/v7_0/fix_nonwarehouse_ledger_gl_entries_for_transactions.py | 14 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
if not frappe.db.get_single_value("Accounts Settings", "auto_accounting_for_stock"):
return
frappe.reload_doctype("A... |
cloud9UG/odoo | refs/heads/8.0 | addons/bus/__init__.py | 349 | import bus
|
GodsOffSpring/AOSP-m8 | refs/heads/kitkat | tools/perf/scripts/python/futex-contention.py | 11261 | # futex contention
# (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Translation of:
#
# http://sourceware.org/systemtap/wiki/WSFutexContention
#
# to perf python scripting.
#
# Measures futex contention
import os, sys
sys.path.append(os.environ['PER... |
0x726d77/storm | refs/heads/master | storm-client/src/py/storm/constants.py | 22 | #!/usr/bin/env python
#
# 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
# "... |
yishenggudou/sqlautocode | refs/heads/master | sqlautocode/util.py | 7 | import fnmatch, os, re, sys
import config
_defaultencoding = sys.getdefaultencoding()
_python_identifier_re = re.compile(r'^[a-z_][a-z0-9_]*$', re.I)
def emit(*lines):
"""Emit one or more output strings."""
for line in lines:
if not line:
config.out.write(os.linesep)
else:
... |
andela-bojengwa/My-Flask-Blog | refs/heads/master | models/toSQL.py | 4 | import sqlite3
con = sqlite3.connect("blog.db")
c = con.cursor()
c.execute('''CREATE TABLE users
(id text, fname text, lname text, email text, password text, online integer)''')
con.commit()
c.execute('''CREATE TABLE posts
(uid text, pid text, title text, content text, date text)''')
con.comm... |
mrichart/ns-3-dev-git | refs/heads/rpc | examples/routing/examples-to-run.py | 199 | #! /usr/bin/env python
## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
# A list of C++ examples to run in order to ensure that they remain
# buildable and runnable over time. Each tuple in the list contains
#
# (example_name, do_run, do_valgrind_run).
#
# See test.py for more i... |
glensc/node-gyp | refs/heads/master | gyp/pylib/gyp/generator/make.py | 47 | # Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Notes:
#
# This is all roughly based on the Makefile system used by the Linux
# kernel, but is a non-recursive make -- we put the entire dependency
# graph in fr... |
aosp-samsung-msm7x30/android_kernel_samsung_msm7x30-common | refs/heads/lp5.1 | 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... |
Distrotech/Pyrex | refs/heads/master | Pyrex/Plex/Lexicons.py | 32 | #=======================================================================
#
# Python Lexical Analyser
#
# Lexical Analyser Specification
#
#=======================================================================
import types
import Actions
import DFA
import Errors
import Machines
import Regexps
# debug_flags for ... |
naresh21/synergetics-edx-platform | refs/heads/oxa/master.fic | lms/djangoapps/badges/tests/test_models.py | 17 | """
Tests for the Badges app models.
"""
from django.core.exceptions import ValidationError
from django.core.files.images import ImageFile
from django.core.files.storage import default_storage
from django.db.utils import IntegrityError
from django.test import TestCase
from django.test.utils import override_settings
fro... |
yi719/python-driver | refs/heads/master | tests/integration/cqlengine/base.py | 8 | # Copyright 2015 DataStax, 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 writing, s... |
bzennn/blog_flask | refs/heads/master | python/lib/python3.5/site-packages/flask_resize/metadata.py | 1 | __version_info__ = (2, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
|
snjv180/PythonStudy | refs/heads/master | variableParameter.py | 1 | def arithmetic_mean(x, *l):
""" The function calculates the arithmetic mean of a non-empty
arbitrary number of numbers """
sum = x
for i in l:
sum += i
return sum / (1.0 + len(l)) |
trichter/yam | refs/heads/master | yam/stretch.py | 1 | # Copyright 2017-2019, Tom Eulenfeld, MIT license
"""
Stretch correlations
The results are returned in a dictionary with the following entries:
:times: strings of starttimes of the traces (1D array, length ``N1``)
:velchange_values: velocity changes (%) corresponding to the used stretching
factors (assuming a hom... |
noroutine/ansible | refs/heads/devel | contrib/inventory/jail.py | 196 | #!/usr/bin/env python
# (c) 2013, Michael Scherer <misc@zarb.org>
#
# 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 o... |
kstaring/swift | refs/heads/upstream-master | benchmark/scripts/perf_test_driver/perf_test_driver.py | 11 | #!/usr/bin/env python
# ===--- perf_test_driver.py ---------------------------------------------===//
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See ... |
qifeigit/scikit-learn | refs/heads/master | sklearn/metrics/cluster/setup.py | 339 | import os
import numpy
from numpy.distutils.misc_util import Configuration
def configuration(parent_package="", top_path=None):
config = Configuration("metrics/cluster", parent_package, top_path)
libraries = []
if os.name == 'posix':
libraries.append('m')
config.add_extension("expected_mutual... |
WIZARD-CXY/kubernetes | refs/heads/master | hack/lookup_pull.py | 368 | #!/usr/bin/env python
# Copyright 2015 The Kubernetes 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
#
# Unle... |
mlaitinen/odoo | refs/heads/8.0 | addons/stock/tests/test_owner_available.py | 233 | # Author: Leonardo Pistone
# Copyright 2015 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any la... |
stoq/stoq-server | refs/heads/master | stoqserver/lib/duplicitybackup.py | 1 | # -*- coding: utf-8 -*-
# vi:si:et:sw=4:sts=4:ts=4
#
# Copyright (C) 2020 Stoq Tecnologia <http://www.stoq.com.br>
# All rights reserved
#
# 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;... |
EduPepperPD/pepper2013 | refs/heads/master | cms/djangoapps/contentstore/features/component_settings_editor_helpers.py | 5 | # disable missing docstring
#pylint: disable=C0111
from lettuce import world
from nose.tools import assert_equal # pylint: disable=E0611
from terrain.steps import reload_the_page
@world.absorb
def create_component_instance(step, component_button_css, category,
expected_css, boilerplate... |
undoware/neutron-drive | refs/heads/master | google_appengine/lib/django_1_3/django/template/response.py | 56 | from django.http import HttpResponse
from django.template import loader, Context, RequestContext
class ContentNotRenderedError(Exception):
pass
class SimpleTemplateResponse(HttpResponse):
def __init__(self, template, context=None, mimetype=None, status=None,
content_type=None):
# It would... |
ChawalitK/odoo | refs/heads/master | openerp/addons/base/tests/test_mail.py | 3 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import cgi
import unittest
from odoo.tools import html_sanitize, append_content_to_html, plaintext2html, email_split
from . import test_mail_examples
class TestSanitizer(unittest.TestCase):
""" Test the html sanit... |
IEEE-NITK/DeepNLP | refs/heads/master | Project-Code/ui/utils/word_vectors.py | 4 | import gensim.models.word2vec as w2v
from operator import itemgetter
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
from bhtsne import tsne
import os
import time
PATH = ""
# get pretrained word vectors trained on the entire GoT text using word2vec in gensim
#thrones2vec = w2v.Word2Vec.load("t... |
lvapeab/nmt-keras | refs/heads/master | utils/utils.py | 1 | from six import iteritems
def update_parameters(params, updates, restrict=False):
"""
Updates the parameters from params with the ones specified in updates
:param params: Parameters dictionary to update
:param updates: Updater dictionary
:param restrict: If True, parameters from the original dict ... |
OSSystems/lava-server | refs/heads/master | dashboard_app/tests/__init__.py | 1 | """
Package with all tests for dashboard_app
"""
import logging
import unittest
TEST_MODULES = [
'models.attachment',
'models.bundle',
'models.bundle_deserialization_error',
'models.bundle_stream',
'models.data_report',
'models.hw_device',
'models.named_attribute',
'models.sw_package',... |
drawks/ansible | refs/heads/devel | test/integration/targets/module_utils/module_utils/foo.py | 298 | #!/usr/bin/env python
foo = "FOO FROM foo.py"
|
nwalters512/the-blue-alliance | refs/heads/master | datafeeds/usfirst_match_schedule_parser.py | 8 | import json
import logging
from BeautifulSoup import BeautifulSoup
from datafeeds.parser_base import ParserBase
class UsfirstMatchScheduleParser(ParserBase):
@classmethod
def parse(self, html):
"""
Parse the table that contains the match schedule
"""
soup = BeautifulSoup(html... |
lucius-feng/tg2 | refs/heads/development | tg/util/__init__.py | 3 | """Utilities"""
from .decorators import no_warn
from .bunch import Bunch
from .files import DottedFileNameFinder, DottedFileLocatorError
from .lazystring import lazify, LazyString |
mancoast/CPythonPyc_test | refs/heads/master | fail/342_test_hmac.py | 84 | import functools
import hmac
import hashlib
import unittest
import warnings
from test import support
def ignore_warning(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
with warnings.catch_warnings():
warnings.filterwarnings("ignore",
category... |
giorgiop/scipy | refs/heads/master | scipy/special/tests/test_logit.py | 110 | from __future__ import division, print_function, absolute_import
import numpy as np
from numpy.testing import (TestCase, assert_equal, assert_almost_equal,
assert_allclose)
from scipy.special import logit, expit
class TestLogit(TestCase):
def check_logit_out(self, dtype, expected):
a = np.linspac... |
MechCoder/sympy | refs/heads/master | sympy/polys/tests/test_factortools.py | 80 | """Tools for polynomial factorization routines in characteristic zero. """
from sympy.polys.rings import ring, xring
from sympy.polys.domains import FF, ZZ, QQ, RR, EX
from sympy.polys import polyconfig as config
from sympy.polys.polyerrors import DomainError
from sympy.polys.polyclasses import ANP
from sympy.polys.s... |
acsone/knowledge | refs/heads/8.0 | setup/attachment_edit/setup.py | 7073 | import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
|
sparkslabs/kamaelia_ | refs/heads/master | Sketches/MPS/Random/feedtester.py | 3 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... |
gunchleoc/django | refs/heads/master | django/conf/locale/nn/formats.py | 504 | # -*- 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'
TIME_FORMAT = 'H:i'
DATET... |
alx-eu/django | refs/heads/stable/1.5.x | django/core/management/__init__.py | 99 | import collections
import os
import sys
from optparse import OptionParser, NO_DEFAULT
import imp
import warnings
from django.core.exceptions import ImproperlyConfigured
from django.core.management.base import BaseCommand, CommandError, handle_default_options
from django.core.management.color import color_style
from dj... |
ArthurPBressan/yt-auto-playlist | refs/heads/master | engine.py | 2 | # coding: utf-8
import httplib2
import os
import sys
import pprint
import arrow
from apiclient.discovery import build
from oauth2client.client import flow_from_clientsecrets
from oauth2client.file import Storage
from oauth2client.tools import argparser, run_flow
# The CLIENT_SECRETS_FILE variable specifies the name... |
imageworks/OpenShadingLanguage | refs/heads/master | testsuite/oslinfo-metadata/run.py | 2 | # Copyright Contributors to the Open Shading Language project.
# SPDX-License-Identifier: BSD-3-Clause
# https://github.com/AcademySoftwareFoundation/OpenShadingLanguage
#!/usr/bin/env python
command = oslinfo("-v metadata")
|
yaii/yai | refs/heads/alpha | share/extensions/Barcode/BaseEan.py | 6 | #
# Copyright (C) 2010 Martin Owens
#
# 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 program is distributed in... |
ric2b/Vivaldi-browser | refs/heads/master | chromium/chrome/common/extensions/docs/server2/render_servlet.py | 81 | # 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 hashlib
import logging
import posixpath
import traceback
from branch_utility import BranchUtility
from environment import IsPreviewServer
from file_s... |
tvibliani/odoo | refs/heads/8.0 | addons/website_twitter/models/twitter.py | 376 | from urllib2 import urlopen, Request, HTTPError
import base64
import json
import logging
import werkzeug
from openerp.osv import fields, osv
API_ENDPOINT = 'https://api.twitter.com'
API_VERSION = '1.1'
REQUEST_TOKEN_URL = '%s/oauth2/token' % API_ENDPOINT
REQUEST_FAVORITE_LIST_URL = '%s/%s/favorites/list.json' % (API... |
ryokochang/Slab-GCS | refs/heads/master | packages/IronPython.StdLib.2.7.5-beta1/content/Lib/encodings/koi8_u.py | 593 | """ Python Character Mapping Codec koi8_u generated from 'python-mappings/KOI8-U.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_table)
def decode(self,input,errors='stri... |
mbalasso/mynumpy | refs/heads/master | numpy/f2py/capi_maps.py | 9 | #!/usr/bin/env python
"""
Copyright 1999,2000 Pearu Peterson all rights reserved,
Pearu Peterson <pearu@ioc.ee>
Permission to use, modify, and distribute this software is given under the
terms of the NumPy License.
NO WARRANTY IS EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
$Date: 2005/05/06 10:57:33 $
Pearu Peterson... |
pedrobaeza/OpenUpgrade | refs/heads/8.0 | addons/crm_partner_assign/__init__.py | 364 | # -*- 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... |
2PacIsAlive/DeepOncology | refs/heads/master | deep_networks/data/__init__.py | 2 | import dicom
import preprocessing
import csv
import np
|
vinhlh/bite-project | refs/heads/master | deps/gdata-python-client/samples/webmastertools/SitesFeedSummary.py | 128 | #!/usr/bin/python
#
# Copyright (C) 2008 Yu-Jie Lin
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... |
TzuChieh/Photon-v2 | refs/heads/master | BlenderAddon/PhotonBlend/bmodule/__init__.py | 3800 | |
luckydonald/pytgbot | refs/heads/master | pytgbot/api_types/sendable/inline.py | 1 | # -*- coding: utf-8 -*-
from luckydonaldUtils.encoding import unicode_type, to_unicode as u
from luckydonaldUtils.exceptions import assert_type_or_raise
from luckydonaldUtils.logger import logging
from . import Sendable
__author__ = 'luckydonald'
logger = logging.getLogger(__name__)
class InlineQueryResult(Sendable)... |
pizzamig/gdb | refs/heads/master | gdb/testsuite/gdb.perf/lib/perftest/measure.py | 46 | # Copyright (C) 2013-2015 Free Software Foundation, 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 3 of the License, or
# (at your option) any later version.
#
# This progr... |
zstyblik/infernal-twin | refs/heads/master | build/pip/build/lib.linux-i686-2.7/pip/commands/search.py | 323 | from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.download import PipXmlrpcTransport
from pip.index import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from pip.exceptions import CommandError
... |
erfolgden/sanoma | refs/heads/master | functionaltests/pages/libelle/home_page/homePageLibelleWrapper.py | 1 | from functionaltests.core.config import LIBELLE_URL
from functionaltests.pages.BasePage import BasePage
class LibelleHomePageWrapper(BasePage):
"""
http://www.libelle.nl/ homepage
"""
SA_LOGIN_BUTTON = 'SA_login_button'
PAGE_TITLE = "Libelle Daily - Dagelijks het laatste nieuws dat informeert, i... |
trezorg/django | refs/heads/master | tests/regressiontests/forms/localflavor/ar.py | 87 | from django.contrib.localflavor.ar.forms import (ARProvinceSelect,
ARPostalCodeField, ARDNIField, ARCUITField)
from utils import LocalFlavorTestCase
class ARLocalFlavorTests(LocalFlavorTestCase):
def test_ARProvinceSelect(self):
f = ARProvinceSelect()
out = u'''<select name="provincias">
<opt... |
pombredanne/django-classy-settings | refs/heads/master | tests/test_env.py | 1 | import os
import unittest
import cbs
class TestEnv(unittest.TestCase):
def setUp(self):
os.environ.clear()
cbs.DEFAULT_ENV_PREFIX = ''
def test_retrieve_from_method(self):
class Settings:
@cbs.env
def SETTING(self):
return 'bar'
self.a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.