repo_name
stringlengths
5
100
ref
stringlengths
12
67
path
stringlengths
4
244
copies
stringlengths
1
8
content
stringlengths
0
1.05M
shockwavefraz/CEM
refs/heads/master
trunk/External_Libraries/googletest/googletest/test/gtest_env_var_test.py
343
#!/usr/bin/env python # # Copyright 2008, 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...
nhejazi/scikit-learn
refs/heads/master
sklearn/metrics/tests/test_ranking.py
11
from __future__ import division, print_function import numpy as np from itertools import product import warnings from scipy.sparse import csr_matrix from sklearn import datasets from sklearn import svm from sklearn.datasets import make_multilabel_classification from sklearn.random_projection import sparse_random_mat...
BT-astauder/odoo
refs/heads/8.0
addons/website_blog/tests/common.py
279
# -*- coding: utf-8 -*- from openerp.tests import common class TestWebsiteBlogCommon(common.TransactionCase): def setUp(self): super(TestWebsiteBlogCommon, self).setUp() Users = self.env['res.users'] group_blog_manager_id = self.ref('base.group_document_user') group_employee_id =...
atumanov/ray
refs/heads/master
python/ray/experimental/array/remote/random.py
5
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import ray @ray.remote def normal(shape): return np.random.normal(size=shape)
adarob/magenta
refs/heads/master
magenta/models/music_vae/music_vae_generate.py
2
# Copyright 2019 The Magenta Authors. # # 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 ...
rgarcia-herrera/MCAC
refs/heads/master
vep/vep2csv_frameshift.py
2
import csv import argparse from pprint import pprint parser = argparse.ArgumentParser(description="Unfold VEP's extra field to create regular CSV files") parser.add_argument('vep', type=argparse.FileType('r')) # parser.add_argument('--csv', type=argparse.FileType('w'), required=True ) args = parser.parse_args() e...
vivekananda/fbeats
refs/heads/master
django/contrib/flatpages/templatetags/flatpages.py
98
from django import template from django.conf import settings from django.contrib.flatpages.models import FlatPage register = template.Library() class FlatpageNode(template.Node): def __init__(self, context_name, starts_with=None, user=None): self.context_name = context_name if starts_with: ...
Drooids/erpnext
refs/heads/develop
erpnext/patches/v5_0/update_sms_sender.py
120
# Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe def execute(): frappe.db.set_value("SMS Settings", "SMS Settings", "sms_sender_name", frappe.db.get_single_value("Global Defaults", "s...
krother/maze_run
refs/heads/master
09_test_data/test_crate.py
1
from draw_maze import parse_grid from moves import move from moves import LEFT, RIGHT, UP, DOWN import pytest LEVEL = """####### #.....# #..o..# #.o*o.# #..o..# #.....# #######""" @pytest.mark.parametrize('direction, pos, tile', [ (LEFT, (3, 2), '*'), (LEFT, (3, 1), 'o'), (RIGHT, (3, 4), '*'), (RIG...
openstack/keystone
refs/heads/master
keystone/common/policies/registered_limit.py
2
# 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 # distributed under t...
Carmezim/tensorflow
refs/heads/master
tensorflow/python/kernel_tests/session_ops_test.py
104
# 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...
brolewis/oracle_of_kirk
refs/heads/master
app.py
1
# Third Party import flask import flask_bootstrap import wtforms import wtforms.csrf.session import wtforms.ext.sqlalchemy.fields # Local import oracle app = flask.Flask(__name__) flask_bootstrap.Bootstrap(app) app.debug = True app.secret_key = 'asdfp98ydlkasdfy8p9dfayh90sdgy879' six = oracle.SixDegrees() class Bas...
unbrice/carbonate
refs/heads/master
tests/test_fill.py
1
import unittest import os import whisper import time import random import mock from carbonate.fill import fill_archives def _average(ints_or_nones): total = 0 count = 0 for i in ints_or_nones: if i is not None: total += i count += 1 return total // count class FillTe...
dansan/spring-replay-site
refs/heads/master
srs/management/commands/upload_replay.py
1
#!/usr/bin/env python # This file is part of the "spring relay site / srs" program. It is published # under the GPLv3. # # Copyright (C) 2018 Daniel Troeder (daniel #at# admin-box #dot# com) # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.or...
subho007/androguard
refs/heads/master
androguard/core/analysis/sign.py
22
# This file is part of Androguard. # # Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr> # 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...
Bobypalcka/coinwatcher
refs/heads/master
coinwatcher.py
1
import errno import os import signal import sys import time from lib.api_pull_data import api_data_fill as update from lib.login import login from lib.newUser import create_new_user class main(object): def __init__(self, *arg, **kvarg): self.database_exists = False signal.signal(signal.SIGINT, ...
repotvsupertuga/repo
refs/heads/master
instal/script.module.stream.tvsupertuga.addon/resources/lib/sources/en/tvbmoviez.py
8
# -*- coding: utf-8 -*- ''' Exodus Add-on Copyright (C) 2016 Exodus 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 l...
alexbruy/QGIS
refs/heads/master
python/plugins/processing/algs/grass7/ext/v_net_arcs.py
11
# -*- coding: utf-8 -*- """ *************************************************************************** v_net_arcs.py --------------------- Date : December 2015 Copyright : (C) 2015 by Médéric Ribreux Email : medspx at medspx dot fr ************************...
CapOM/ChromiumGStreamerBackend
refs/heads/master
tools/telemetry/telemetry/internal/backends/chrome/cros_browser_backend.py
3
# 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 logging import os from telemetry.core import exceptions from telemetry.core import util from telemetry import decorators from telemetry.internal.back...
Linkid/numpy
refs/heads/master
numpy/f2py/capi_maps.py
17
#!/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...
robinro/ansible
refs/heads/devel
test/units/parsing/test_mod_args.py
66
# (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...
fixator/aprinter
refs/heads/master
config_system/gui/configema.py
2
# Copyright (c) 2015 Ambroz Bizjak # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the...
HackersUOP/pythonTutes
refs/heads/master
lessons/lesson6_Task1.py
1
''' * Copyright 2016 Hackers' Club, University Of Peradeniya * Author : Irunika Weeraratne E/11/431 * * 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-...
bhmehnert/math-code-bits
refs/heads/master
ReducedForms.py
1
# The function ReducedForms(D) below computes all 'reduced' positive definite binary quadratic forms of the negative discriminant D from math import sqrt def IsEven(m): return not m%2 # Lets compute quickly a list of divisors of a number m def ListDivisors(m): outl,outr = [],[] for i in r...
rismalrv/edx-platform
refs/heads/master
lms/djangoapps/shoppingcart/processors/CyberSource.py
142
""" Implementation the CyberSource credit card processor. IMPORTANT: CyberSource will deprecate this version of the API ("Hosted Order Page") in September 2014. We are keeping this implementation in the code-base for now, but we should eventually replace this module with the newer implementation (in `CyberSource2.py`)...
RO-ny9/python-for-android
refs/heads/master
python3-alpha/python3-src/Lib/tkinter/test/test_ttk/test_widgets.py
48
import unittest import tkinter import os from tkinter import ttk from test.support import requires, run_unittest import sys import tkinter.test.support as support from tkinter.test.test_ttk.test_functions import MockTclObj, MockStateSpec requires('gui') class WidgetTest(unittest.TestCase): """Tests methods avail...
mindw/numpy
refs/heads/master
numpy/distutils/command/build_scripts.py
264
""" Modified version of build_scripts that handles building scripts from functions. """ from __future__ import division, absolute_import, print_function from distutils.command.build_scripts import build_scripts as old_build_scripts from numpy.distutils import log from numpy.distutils.misc_util import is_string class...
hang-qi/models
refs/heads/hemingway
slim/nets/resnet_v1.py
12
# 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 ...
Griesbacher/ContentAnalytics
refs/heads/master
knn.py
1
from elasticsearch import Elasticsearch import indexer import indices from csv_handling import write_tweets_to_csv, load_tweet_csv from filter import get_filter_from_index from tweet import Tweet class KNN: def __init__(self, index, es_obj): self._es = es_obj self._index = index def get_best...
pleonex/Ninokuni
refs/heads/master
Programs/scripts/ImagenReferences.py
1
#!/bin/python # -*- coding: utf-8 -*- ############################################################################### # Exports the relation between ImagenParam and ImagenName files - V1.0 # # Copyright 2014 Benito Palacios (aka pleonex) # # ...
simonwydooghe/ansible
refs/heads/devel
test/units/modules/network/fortios/test_fortios_switch_controller_global.py
21
# Copyright 2019 Fortinet, 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 program is distributed in the...
kris-singh/pgmpy
refs/heads/dev
pgmpy/tests/test_inference/test_ExactInference.py
6
import unittest import numpy as np import numpy.testing as np_test from pgmpy.inference import VariableElimination from pgmpy.inference import BeliefPropagation from pgmpy.models import BayesianModel, MarkovModel from pgmpy.models import JunctionTree from pgmpy.factors.discrete import TabularCPD from pgmpy.factors.dis...
mrfuxi/lastfm-user-tracks
refs/heads/master
runtests.py
1
#!/usr/bin/env python import unittest from user_tracks import tests loader = unittest.TestLoader() suite = loader.loadTestsFromModule(tests) unittest.TextTestRunner(verbosity=2).run(suite)
codebox/neural-net
refs/heads/master
network.py
1
from __future__ import division from axon import Axon from layer import InputLayer, HiddenLayer, OutputLayer from node import HasInputAxonsMixin, InputNode, HasOutputAxonsMixin, BiasNode import random class NeuralNet: def __init__(self, layer_spec, activation_fn, lambda_term): if len(layer_spec) < 3: ...
scode/pants
refs/heads/master
src/python/pants/backend/project_info/tasks/ensime_gen.py
15
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import os import pkg...
figment/falloutsnip
refs/heads/master
Vendor/IronPython/Lib/encodings/mac_iceland.py
593
""" Python Character Mapping Codec mac_iceland generated from 'MAPPINGS/VENDORS/APPLE/ICELAND.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...
wobh/xpython
refs/heads/master
crypto-square/crypto_square_test.py
14
import unittest from crypto_square import encode class CryptoSquareTest(unittest.TestCase): def test_empty_string(self): self.assertEqual('', encode('')) def test_perfect_square(self): self.assertEqual('ac bd', encode('ABCD')) def test_small_imperfect_square(self): self.assertE...
JeanFred/graphite-web
refs/heads/master
setup.py
29
#!/usr/bin/env python from __future__ import with_statement import os import ConfigParser from glob import glob from collections import defaultdict try: from io import BytesIO except ImportError: from StringIO import StringIO as BytesIO # Graphite historically has an install prefix set in setup.cfg. Being ...
Workday/OpenFrame
refs/heads/master
build/android/devil/android/sdk/adb_wrapper.py
2
# 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. """This module wraps Android's adb tool. This is a thin wrapper around the adb interface. Any additional complexity should be delegated to a higher level (e...
wanghaihan/FormatByFecs
refs/heads/master
FormatByFecs.py
1
import sublime, sublime_plugin, os,shlex, subprocess, tempfile import merge_utils def formatWholeFile(view, edit): region = sublime.Region(0, view.size()) code = view.substr(region) newCode = format(code) view.replace(edit, sublime.Region(0, view.size()), newCode) def format(code): #temp = tempfil...
XXMrHyde/android_external_chromium_org
refs/heads/darkkat-4.4
chrome/tools/build/win/syzygy_instrument.py
31
#!/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. """A utility script to help building Syzygy-instrumented Chrome binaries.""" import glob import logging import optparse import os ...
osvaldshpengler/BuildingMachineLearningSystemsWithPython
refs/heads/master
ch10/simple_classification.py
21
# This code is supporting material for the book # Building Machine Learning Systems with Python # by Willi Richert and Luis Pedro Coelho # published by PACKT Publishing # # It is made available under the MIT License import mahotas as mh import numpy as np from glob import glob from features import texture, color_hist...
kernel-sanders/arsenic-mobile
refs/heads/master
Dependencies/Twisted-13.0.0/twisted/conch/manhole_tap.py
42
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ TAP plugin for creating telnet- and ssh-accessible manhole servers. @author: Jp Calderone """ from zope.interface import implements from twisted.internet import protocol from twisted.application import service, strports from twisted.conch.s...
ddico/odoo
refs/heads/master
addons/stock_dropshipping/tests/test_lifo_price.py
2
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import fields, tools from odoo.addons.stock_account.tests.common import StockAccountTestCommon from odoo.modules.module import get_module_resource from odoo.tests import common, Form class TestLifoPrice(Stock...
arnaud-morvan/QGIS
refs/heads/master
tests/code_layout/test_qgssipcoverage.py
13
# -*- coding: utf-8 -*- """QGIS Unit tests for SIP binding coverage. .. note:: 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. ...
rdempsey/python-for-sharing
refs/heads/master
practical-predictive-modeling-in-python/scoring code/bin/normalizers.py
1
#!/usr/bin/env python # encoding: utf-8 """ normalizers.py Created by Robert Dempsey on 05/18/2015 Updated on 05/18/2015 Copyright (c) 2015 Robert Dempsey. All rights reserved. """ from time import strftime from datetime import datetime import bin.cleaners as clean def right(s, amount): return s[-amount:] def ...
dufdif/KPU2DGamePrograming
refs/heads/master
Homework/2012182026이관구/start_state.py
1
from pico2d import * import game_framework import title_state name = "StartState" image = None logo_time = 0.0 def enter(): global image open_canvas() image = load_image('kpu_credit.png') def exit(): global image del(image) close_canvas() def update(): global logo_time if (logo_time ...
bestephe/ns-3-tcpbolt
refs/heads/master
src/dsr/bindings/modulegen__gcc_LP64.py
22
from pybindgen import Module, FileCodeSink, param, retval, cppclass, typehandlers import pybindgen.settings import warnings class ErrorHandler(pybindgen.settings.ErrorHandler): def handle_error(self, wrapper, exception, traceback_): warnings.warn("exception %r in wrapper %s" % (exception, wrapper)) ...
cchamberlain/npm
refs/heads/master
node_modules/node-gyp/gyp/tools/graphviz.py
2679
#!/usr/bin/env python # Copyright (c) 2011 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. """Using the JSON dumped by the dump-dependency-json generator, generate input suitable for graphviz to render a dependency graph of targets...
hhbyyh/spark
refs/heads/master
python/pyspark/sql/tests/test_utils.py
11
# # 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...
cmelange/ansible
refs/heads/devel
lib/ansible/playbook/role/metadata.py
31
# (c) 2014 Michael DeHaan, <michael@ansible.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 later ve...
pragnani/google-diff-match-patch
refs/heads/master
python2/diff_match_patch_test.py
319
#!/usr/bin/python2.4 """Test harness for diff_match_patch.py Copyright 2006 Google Inc. http://code.google.com/p/google-diff-match-patch/ 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://...
calabash/WordPress-iOS
refs/heads/develop
Scripts/coverage.py
22
import glob import os import shutil import subprocess import StringIO import sys # Directories dataDirectory = "./CoverageData" cacheDirectory = dataDirectory + "/Cache" derivedDataDirectory = dataDirectory + "/DerivedData" buildObjectsDirectory = derivedDataDirectory + "/Build/Intermediates/WordPress.build/Debug-ipho...
napkindrawing/ansible
refs/heads/devel
test/units/playbook/test_play_context.py
25
# (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...
winhamwr/selenium
refs/heads/trunk
py/test/selenium/webdriver/common/select_element_handling_tests.py
28
#!/usr/bin/python # Copyright 2008-2009 WebDriver committers # Copyright 2008-2009 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-...
shaftoe/home-assistant
refs/heads/dev
homeassistant/components/device_tracker/demo.py
28
""" Demo platform for the Device tracker component. For more details about this platform, please refer to the documentation https://home-assistant.io/components/demo/ """ import random from homeassistant.components.device_tracker import DOMAIN def setup_scanner(hass, config, see, discovery_info=None): """Set up...
VaybhavSharma/commons
refs/heads/master
src/python/twitter/common/java/constant.py
15
# ================================================================================================== # Copyright 2011 Twitter, Inc. # -------------------------------------------------------------------------------------------------- # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use thi...
habibiefaried/ryu
refs/heads/master
ryu/contrib/ncclient/operations/flowmon.py
82
# Copyright 2h009 Shikhar Bhushan # # 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 writi...
fredhusser/scikit-learn
refs/heads/master
sklearn/cluster/tests/test_affinity_propagation.py
341
""" Testing for Clustering methods """ import numpy as np from sklearn.utils.testing import assert_equal from sklearn.utils.testing import assert_array_equal from sklearn.utils.testing import assert_raises from sklearn.cluster.affinity_propagation_ import AffinityPropagation from sklearn.cluster.affinity_propagatio...
ljhljh235/AutoRest
refs/heads/master
src/generator/AutoRest.Python.Tests/AcceptanceTests/byte_tests.py
8
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""),...
obi-two/Rebelion
refs/heads/master
data/scripts/templates/object/tangible/component/droid/shared_personality_module_geek.py
2
#### NOTICE: THIS FILE IS AUTOGENERATED #### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY #### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/droid/shared_personality_module_geek.iff" result.attribut...
tupolev/plugin.video.mitele
refs/heads/master
lib/youtube_dl/extractor/audiomack.py
60
# coding: utf-8 from __future__ import unicode_literals import itertools import time from .common import InfoExtractor from .soundcloud import SoundcloudIE from ..compat import compat_str from ..utils import ( ExtractorError, url_basename, ) class AudiomackIE(InfoExtractor): _VALID_URL = r'https?://(?:w...
JiYouMCC/python
refs/heads/master
burun/0007/0007.py
39
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Date: 17-03-15 # Author: Liang ''' 第 0007 题: 有个目录,里面是你自己写过的程序,统计一下你写过多少行代码。包括空行和注释,但是要分别列出来. ''' ''' Not to specific code files yet, like "py", "cpp" .etc. Not consider different comment methods like ''' ''' yet. Not consider sub-directory yet. ''' import os # set c...
yencarnacion/jaikuengine
refs/heads/master
.google_appengine/lib/django-1.2/tests/regressiontests/context_processors/views.py
99
from django.core import context_processors from django.shortcuts import render_to_response from django.template.context import RequestContext def request_processor(request): return render_to_response('context_processors/request_attrs.html', RequestContext(request, {}, processors=[context_processors.reques...
bufferapp/buffer-django-nonrel
refs/heads/master
tests/regressiontests/file_uploads/tests.py
7
#! -*- coding: utf-8 -*- import errno import os import shutil from StringIO import StringIO from django.core.files import temp as tempfile from django.core.files.uploadedfile import SimpleUploadedFile from django.http.multipartparser import MultiPartParser from django.test import TestCase, client from django.utils imp...
hep7agon/city-feedback-hub
refs/heads/master
frontend/tests.py
1
from django.core.urlresolvers import reverse from django.test import TestCase from django.core.files.uploadedfile import SimpleUploadedFile from django.utils.encoding import force_text import json from .forms import * # Test some developer functions class BasicTest(TestCase): fixtures = ["test_data.json"] #...
aerickson/ansible
refs/heads/devel
lib/ansible/modules/cloud/ovirt/ovirt_quotas.py
26
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # # 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 #...
jmartinm/InvenioAuthorLists
refs/heads/master
modules/bibcheck/web/admin/bibcheckadmin.py
7
## This file is part of Invenio. ## Copyright (C) 2009, 2010, 2011 CERN. ## ## Invenio 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 versio...
HPPTECH/hpp_IOSTressTest
refs/heads/master
Refer/IOST_OLD_SRC/IOST_0.12/IOST_Terminal.py
1
#!/usr/bin/python #====================================================================== # # Project : hpp_IOStressTest # File : IOST_Terminal.py # Version : 1.01 # Date : Sep 21, 2016 # Author : HuuHoang Nguyen # Contact : hhnguyen@apm.com # : hoangnh.hpp@gmail.com # License : MIT License # C...
massmutual/scikit-learn
refs/heads/master
sklearn/base.py
40
"""Base classes for all estimators.""" # Author: Gael Varoquaux <gael.varoquaux@normalesup.org> # License: BSD 3 clause import copy import warnings import numpy as np from scipy import sparse from .externals import six from .utils.fixes import signature class ChangedBehaviorWarning(UserWarning): pass ########...
vitaly-krugl/nupic
refs/heads/master
tests/swarming/nupic/swarming/experiments/simpleV2/description.py
10
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions apply: # # This progra...
gregplaysguitar/django-dps
refs/heads/master
dps/__init__.py
3
from ._version import __version__ __all__ = ['__version__']
lijoantony/django-oscar
refs/heads/master
src/oscar/apps/customer/abstract_models.py
22
from django.utils import six import hashlib import random from django.conf import settings from django.contrib.auth import models as auth_models from django.core.urlresolvers import reverse from django.core.validators import RegexValidator from django.db import models from django.template import Template, Context, Tem...
luiseduardohdbackup/odoo
refs/heads/8.0
addons/l10n_ch/__init__.py
424
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi. Copyright Camptocamp SA # Financial contributors: Hasa SA, Open Net SA, # Prisme Solutions Informatique SA, Quod SA # # Translation contributors: brain-te...
joesleung/node-gyp
refs/heads/master
gyp/pylib/gyp/MSVSNew.py
601
# 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. """New implementation of Visual Studio project generation.""" import os import random import gyp.common # hashlib is supplied as of Python 2.5 as the replacemen...
ethanrublee/ecto-release
refs/heads/master
samples/experimental/necto_imshow.py
5
#!/usr/bin/env python # # 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 # n...
daiyiwhale/hatch
refs/heads/master
incubator/egg_utils.py
1
from django.contrib.auth.models import User from incubator.models import Egg, Incubator def evolve(egg): if egg.next_identity != '' and egg.next_identity != 'kanto': egg.identity = egg.next_identity egg.next_identity = '' egg.steps_needed += 2000 egg.save() def message(egg, user):...
nhicher/ansible
refs/heads/devel
test/units/module_utils/network/nso/test_nso.py
28
# Copyright (c) 2017 Cisco and/or its affiliates. # # 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 v...
valtech-mooc/edx-platform
refs/heads/master
common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py
24
import json import logging import re import bleach from html5lib.tokenizer import HTMLTokenizer from xmodule.progress import Progress import capa.xqueue_interface as xqueue_interface from capa.util import * from .peer_grading_service import PeerGradingService, MockPeerGradingService import controller_query_service fro...
safwanrahman/linuxdesh
refs/heads/master
kitsune/kbadge/utils.py
22
from badger.models import Badge def get_or_create_badge(badge_template, year=None): """Get or create a badge. The badge_template is a dict and must have a slug key. All the values in the dict will be formatted with year, if one is specified. For example: badge_template['slug'].format(year=yea...
timchen86/gdcmdtools
refs/heads/master
gdcmdtools/auth.py
2
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from oauth2client.file import Storage from oauth2client.client import flow_from_clientsecrets from oauth2client.tools import run_flow from apiclient.discovery import build from gdcmdtools.base import BASE_INFO import httplib2 import pprint import shutil impor...
muhkuh-sys/org.muhkuh.tools-muhkuh_gui
refs/heads/master
cmake/tests/mingw_dll_dependencies.py
1
import argparse import re import string import subprocess import sys __astrStandardDlls = [ 'advapi32', 'kernel32', 'msvcrt', 'setupapi', 'user32', 'ws2_32' ] def main(argv): tParser = argparse.ArgumentParser(description='Check the DLL dependencies of an executable.') tParser.add_argument('infile', nargs='+'...
vbraun/oxford-strings
refs/heads/master
lib/markdown/extensions/sane_lists.py
11
""" Sane List Extension for Python-Markdown ======================================= Modify the behavior of Lists in Python-Markdown t act in a sane manor. In standard Markdown syntax, the following would constitute a single ordered list. However, with this extension, the output would include two lists, the ...
jeffreyjinfeng/scrapy
refs/heads/master
scrapy/utils/markup.py
211
""" Transitional module for moving to the w3lib library. For new code, always import from w3lib.html instead of this module """ from w3lib.html import *
lociii/googleads-python-lib
refs/heads/master
examples/adspygoogle/dfp/v201208/__init__.py
66
#!/usr/bin/python # # Copyright 2012 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 b...
Beyond-Imagination/BlubBlub
refs/heads/master
ChatbotServer/ChatbotEnv/Lib/site-packages/urllib3/contrib/ntlmpool.py
312
""" NTLM authenticating pool, contributed by erikcederstran Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10 """ from __future__ import absolute_import from logging import getLogger from ntlm import ntlm from .. import HTTPSConnectionPool from ..packages.six.moves.http_client import HTTPSConnecti...
kokdemo/electron
refs/heads/master
script/cpplint.py
13
#!/usr/bin/env python import fnmatch import os import sys from lib.util import execute IGNORE_FILES = [ os.path.join('atom', 'browser', 'mac', 'atom_application.h'), os.path.join('atom', 'browser', 'mac', 'atom_application_delegate.h'), os.path.join('atom', 'browser', 'resources', 'win', 'resource.h'), os.pa...
titiushko/readthedocs.org
refs/heads/master
readthedocs/core/single_version_urls.py
32
from django.conf.urls import patterns, url urlpatterns = patterns( '', # base view, flake8 complains if it is on the previous line. # Handle /docs on RTD domain url(r'^docs/(?P<project_slug>[-\w]+)/(?P<filename>.*)$', 'readthedocs.core.views.serve_single_version_docs', name='docs_detail'),...
bjaus/hellowebapp
refs/heads/master
pycon-tutorial/pycon-project/collection/tests.py
24123
from django.test import TestCase # Create your tests here.
chemelnucfin/tensorflow
refs/heads/master
tensorflow/python/debug/lib/debug_graphs_test.py
82
# 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...
4022321818/2015cd_midterm
refs/heads/master
static/Brython3.1.1-20150328-091302/Lib/zipfile.py
620
""" Read and write ZIP files. XXX references to utf-8 need further investigation. """ import io import os import re import imp import sys import time import stat import shutil import struct import binascii try: import zlib # We may need its compression method crc32 = zlib.crc32 except ImportError: zlib =...
COSMOGRAIL/COSMOULINE
refs/heads/master
pipe/extrascripts/set_testlist.py
1
# # sets the testlist-flag according to the contents of the "testlist" file. # It's a bit long as we make this one foolproof... execfile("../config.py") from kirbybase import KirbyBase, KBError from variousfct import * # Read the testlist testlisttxt = readimagelist(testlist) # a list of [imgname, comment] # Check ...
illicitonion/givabit
refs/heads/master
lib/sdks/google_appengine_1.7.1/google_appengine/lib/django_1_3/tests/modeltests/validation/__init__.py
21
from django.test import TestCase from django.core.exceptions import ValidationError class ValidationTestCase(TestCase): def assertFailsValidation(self, clean, failed_fields): self.assertRaises(ValidationError, clean) try: clean() except ValidationError, e: self.asse...
Khan/agar
refs/heads/master
lib/webapp2_extras/appengine/sessions_memcache.py
66
# -*- coding: utf-8 -*- """ webapp2_extras.appengine.sessions_memcache ========================================== Extended sessions stored in memcache. :copyright: 2011 by tipfy.org. :license: Apache Sotware License, see LICENSE for details. """ from google.appengine.api import memcache from weba...
unindented/streamcode
refs/heads/master
client/static/jsrepl/extern/python/unclosured/lib/python2.7/distutils/bcppcompiler.py
250
"""distutils.bcppcompiler Contains BorlandCCompiler, an implementation of the abstract CCompiler class for the Borland C++ compiler. """ # This implementation by Lyle Johnson, based on the original msvccompiler.py # module and using the directions originally published by Gordon Williams. # XXX looks like there's a L...
blitzagency/django-chatterbox
refs/heads/master
chatterbox/signals/jobs.py
1
import json from django.db.models.signals import post_save, post_delete from django.dispatch import receiver from chatterbox.models import Job @receiver(post_save, sender=Job) def job_post_save(sender, **kwargs): obj = kwargs["instance"] kls = obj.collector.load_driver() action = kls() hook = getattr...
haad/ansible-modules-extras
refs/heads/devel
cloud/profitbricks/profitbricks.py
16
#!/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 distributed...
MQQiang/kbengine
refs/heads/master
kbe/src/lib/python/Lib/test/test_nis.py
88
from test import support import unittest import sys # Skip test if nis module does not exist. nis = support.import_module('nis') class NisTests(unittest.TestCase): def test_maps(self): try: maps = nis.maps() except nis.error as msg: # NIS is probably not active, so this te...
pyq881120/peinjector
refs/heads/master
pe-injector-interceptor/peinjector_interceptor.py
17
#!/usr/bin/env python # -*- encoding: utf-8 -*- """ Interceptor - reference implementation of a Interceptor based on libmproxy with a connection to a peinjector-server """ __author__ = 'W.L.' from threading import Thread from libmproxy import controller, proxy from libmproxy.proxy.server import ProxyServer from ...
aricchen/openHR
refs/heads/master
openerp/addons/sale/sale.py
5
# -*- 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...