repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
shelbycruver/real-python-test
env/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py
213
14674
# -*- coding: utf-8 -*- """ requests.adapters ~~~~~~~~~~~~~~~~~ This module contains the transport adapters that Requests uses to define and maintain connections. """ import socket from .models import Response from .packages.urllib3.poolmanager import PoolManager, proxy_from_url from .packages.urllib3.response impo...
gpl-2.0
labsquare/CuteVariant
cutevariant/gui/plugins/vql_editor/__init__.py
1
1026
from PySide2.QtWidgets import QApplication __title__ = "VQL Editor" __description__ = "A VQL editor" __long_description__ = QApplication.instance().translate( "vql_editor", """ <p>This plugin allows you to manage most of the work that can be done in a Cutevariant project by writing and executing VQL queries.<...
gpl-3.0
gregorynicholas/flask-admin
examples/sqla/simple.py
2
4047
from flask import Flask from flask.ext.sqlalchemy import SQLAlchemy from wtforms import validators from flask.ext import admin from flask.ext.admin.contrib import sqlamodel from flask.ext.admin.contrib.sqlamodel import filters # Create application app = Flask(__name__) # Create dummy secrey key so we can use sessio...
bsd-3-clause
eeshangarg/oh-mainline
mysite/search/migrations/0070_auto__del_field_bug_bize_size_tag_name.py
16
19382
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Deleting field 'Bug.bize_size_tag_name' db.delete_column('search_bug', 'bize_size_tag_name') def b...
agpl-3.0
PabloTunnon/pykka-deb
tests/logging_test.py
1
4370
import os import sys import logging import threading import unittest from pykka.actor import ThreadingActor from pykka.registry import ActorRegistry from tests import TestLogHandler class LoggingNullHandlerTest(unittest.TestCase): def test_null_handler_is_added_to_avoid_warnings(self): logger = logging....
apache-2.0
krosenvold/selenium-git-release-candidate
py/selenium/webdriver/phantomjs/service.py
17
3027
#!/usr/bin/python # # Copyright 2012 Software Freedom Conservancy # # 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 app...
apache-2.0
ishanic/scikit-learn
sklearn/metrics/metrics.py
233
1262
import warnings warnings.warn("sklearn.metrics.metrics is deprecated and will be removed in " "0.18. Please import from sklearn.metrics", DeprecationWarning) from .ranking import auc from .ranking import average_precision_score from .ranking import label_ranking_average_precision_score fro...
bsd-3-clause
jzt5132/scikit-learn
sklearn/feature_selection/univariate_selection.py
78
23706
"""Univariate features selection.""" # Authors: V. Michel, B. Thirion, G. Varoquaux, A. Gramfort, E. Duchesnay. # L. Buitinck, A. Joly # License: BSD 3 clause import numpy as np import warnings from scipy import special, stats from scipy.sparse import issparse from ..base import BaseEstimator from ..prepr...
bsd-3-clause
teoliphant/scipy
scipy/ndimage/filters.py
2
40010
# Copyright (C) 2003-2005 Peter J. Verveer # # 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 following d...
bsd-3-clause
pgoeser/gnuradio
gnuradio-examples/python/mp-sched/synthetic.py
16
4515
#!/usr/bin/env python # # Copyright 2008 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) ...
gpl-3.0
jimcunderwood/MissionPlanner
Lib/site-packages/numpy/testing/utils.py
53
47161
""" Utility function to facilitate testing. """ import os import sys import re import operator import types import warnings from nosetester import import_nose __all__ = ['assert_equal', 'assert_almost_equal','assert_approx_equal', 'assert_array_equal', 'assert_array_less', 'assert_string_equal', ...
gpl-3.0
vaniakosmos/memes-reposter
apps/imgur/migrations/0001_initial.py
1
1605
# Generated by Django 2.0.3 on 2018-06-30 17:27 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ] operations = [ migrations.CreateModel( name='ImgurConfig', fields=[ ...
mit
dsweet04/rekall
rekall-core/rekall/plugins/windows/heap_analysis.py
1
16866
# Rekall Memory Forensics # Copyright 2014 Google Inc. All Rights Reserved. # # 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 ver...
gpl-2.0
chrisseto/osf.io
api_tests/identifiers/views/test_identifier_list.py
2
10639
import pytest from urlparse import urlparse from api.base.settings.defaults import API_BASE from osf.models import Identifier from osf_tests.factories import ( RegistrationFactory, AuthUserFactory, IdentifierFactory, NodeFactory, PreprintFactory, ) from tests.utils import assert_items_equal @pytes...
apache-2.0
abuve/syspwd
app/models.py
2
1044
#!/usr/bin/env python # -*- coding: utf-8 -*- # 主机密码管理工具 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Title: models # Description: 定义mysql数据表结构 # Copyright: Copyright (c) 2015 # @ author : Abuve # @ version: 1.0 # @ email : buhe_186@163.com # @ web : http://www.abuve.com/ # -------...
gpl-2.0
simar7/singh-kernel-hammerhead
scripts/gcc-wrapper.py
1276
3382
#! /usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2011-2012, The Linux Foundation. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain th...
gpl-2.0
waheedahmed/edx-platform
lms/djangoapps/courseware/features/common.py
30
7862
# pylint: disable=missing-docstring # pylint: disable=redefined-outer-name from __future__ import absolute_import import time from lettuce import world, step from lettuce.django import django_url from django.contrib.auth.models import User from django.core.urlresolvers import reverse from student.models import Cours...
agpl-3.0
suyashphadtare/vestasi-erp-final
erpnext/setup/doctype/company/fixtures/india/__init__.py
36
4647
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe from frappe import _ def install(company): docs = [ {'doctype': 'Deduction Type', 'name': 'Professional Tax', 'description': 'Prof...
agpl-3.0
google/makani
gs/monitor2/apps/plugins/indicators/servo.py
1
17733
# Copyright 2020 Makani Technologies LLC # # 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...
apache-2.0
526avijitgupta/MozDef
alerts/ssl_blacklist_hit_pyes.py
9
1476
#!/usr/bin/env python # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Michal Purzynski michal@mozilla.com ...
mpl-2.0
ceph/autotest
client/common_lib/test_utils/mock_demo.py
4
3145
#!/usr/bin/python __author__ = "raphtee@google.com (Travis Miller)" import mock, mock_demo_MUT class MyError(Exception): pass class A(object): var = 8 def __init__(self): self.x = 0 def method1(self): self.x += 1 return self.x def method2(self, y): return y * ...
gpl-2.0
tempbottle/rethinkdb
external/v8_3.30.33.16/testing/gmock/gtest/test/gtest_uninitialized_test.py
2901
2480
#!/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...
agpl-3.0
jicahoo/numpy
numpy/polynomial/__init__.py
123
1119
""" A sub-package for efficiently dealing with polynomials. Within the documentation for this sub-package, a "finite power series," i.e., a polynomial (also referred to simply as a "series") is represented by a 1-D numpy array of the polynomial's coefficients, ordered from lowest order term to highest. For example, a...
bsd-3-clause
mydongistiny/external_chromium_org
tools/perf/measurements/startup.py
33
2626
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from metrics import startup_metric from telemetry.page import page_test class Startup(page_test.PageTest): """Performs a measurement of Chromium's startu...
bsd-3-clause
dataDogma/Computer-Science
Django-MVP-page/venv/Lib/site-packages/pip/_vendor/requests/packages/chardet/chardistribution.py
2755
9226
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is Mozilla Communicator client code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights R...
gpl-3.0
linktlh/Toontown-journey
toontown/safezone/DistributedMMPiano.py
4
4568
from pandac.PandaModules import * from direct.task.Task import Task from direct.distributed.ClockDelta import * from direct.interval.IntervalGlobal import * from direct.distributed import DistributedObject from pandac.PandaModules import NodePath from toontown.toonbase import ToontownGlobals ChangeDirectionDebounce = 1...
apache-2.0
takluyver/readthedocs.org
readthedocs/projects/migrations/0004_add_whitelisting.py
16
7681
# encoding: utf-8 import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Project.whitelisted' db.add_column('projects_project', 'whitelisted', self.gf('django.db.m...
mit
ikargis/horizon_fod
openstack_dashboard/openstack/common/uuidutils.py
159
1106
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 Intel Corporation. # 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.apa...
apache-2.0
barak/autograd
examples/fluidsim/wing.py
1
6136
from __future__ import absolute_import from __future__ import print_function import autograd.numpy as np from autograd import value_and_grad from scipy.optimize import minimize import matplotlib.pyplot as plt import os from builtins import range rows, cols = 40, 60 # Fluid simulation code based on # "Real-Time Flui...
mit
S34Qu4K3/P6-U06-JellyBean-Kernel-3.0.8---China-Version
tools/perf/scripts/python/futex-contention.py
11261
1486
# 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...
gpl-2.0
kinooo/Sick-Beard
lib/hachoir_parser/container/action_script.py
90
11980
""" SWF (Macromedia/Adobe Flash) file parser. Documentation: - Alexis' SWF Reference: http://www.m2osw.com/swf_alexref.html Author: Sebastien Ponce Creation date: 26 April 2008 """ from lib.hachoir_core.field import (FieldSet, ParserError, Bit, Bits, UInt8, UInt32, Int16, UInt16, Float32, CString, RawBy...
gpl-3.0
gkc1000/pyscf
pyscf/nao/test/test_0021_nao_after_gpaw.py
1
2374
# Copyright 2014-2018 The PySCF Developers. 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 appl...
apache-2.0
tillahoffmann/tensorflow
tensorflow/python/estimator/canned/optimizers.py
73
2924
# Copyright 2017 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...
apache-2.0
kaidokert/prospector
prospector/tools/pylint/indent_checker.py
4
2082
from __future__ import absolute_import import tokenize from pylint.checkers import BaseTokenChecker from pylint.interfaces import ITokenChecker class IndentChecker(BaseTokenChecker): __implements__ = (ITokenChecker,) name = 'indentation' msgs = { 'W0313': ('File contains mixed indentation - som...
gpl-2.0
MarvinTeichmann/KittiBox
tests/test_anno_load.py
1
14271
from __future__ import absolute_import from __future__ import division from __future__ import print_function import itertools import json import logging import os import sys import random from random import shuffle import numpy as np import scipy as scp import scipy.misc sys.path.insert(1, '../incl') from scipy.mis...
mit
xkmato/yowsup
yowsup/layers/protocol_groups/protocolentities/notification_groups_remove.py
59
2101
from .notification_groups import GroupsNotificationProtocolEntity from yowsup.structs import ProtocolTreeNode class RemoveGroupsNotificationProtocolEntity(GroupsNotificationProtocolEntity): ''' <notification notify="{{NOTIFY_NAME}}" id="{{id}}" t="{{TIMESTAMP}}" participant="{{participant_jiid}}" from="{{group_jid}...
gpl-3.0
endlessm/chromium-browser
third_party/llvm/llvm/utils/lit/tests/unit/TestRunner.py
1
11413
# RUN: %{python} %s # # END. import os.path import platform import unittest import lit.discovery import lit.LitConfig import lit.Test as Test from lit.TestRunner import ParserKind, IntegratedTestKeywordParser, \ parseIntegratedTestScript class TestIntegratedTestKeywordParser(unittest.Tes...
bsd-3-clause
nycoin/nycoin
share/qt/extract_strings_qt.py
2945
1844
#!/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 import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
TheTimmy/spack
var/spack/repos/builtin/packages/r-mlbench/package.py
3
1726
############################################################################## # Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
manastech/de-bee
gdata/finance/service.py
261
8974
#!/usr/bin/python # # Copyright (C) 2009 Tan Swee Heng # # 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 la...
mit
bop/rango
lib/python2.7/site-packages/PIL/McIdasImagePlugin.py
40
1721
# # The Python Imaging Library. # $Id$ # # Basic McIdas support for PIL # # History: # 1997-05-05 fl Created (8-bit images only) # 2009-03-08 fl Added 16/32-bit support. # # Thanks to Richard Jones and Craig Swank for specs and samples. # # Copyright (c) Secret Labs AB 1997. # Copyright (c) Fredrik Lundh 1997. # # Se...
gpl-2.0
citrix-openstack-build/swift
test/unit/proxy/test_server.py
2
307786
# Copyright (c) 2010-2012 OpenStack, LLC. # # 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 ...
apache-2.0
alekz112/statsmodels
statsmodels/stats/anova.py
25
13433
from statsmodels.compat.python import lrange, lmap import numpy as np from scipy import stats from pandas import DataFrame, Index from statsmodels.formula.formulatools import (_remove_intercept_patsy, _has_intercept, _intercept_idx) def _get_covariance(model, robust): if robust ...
bsd-3-clause
MrBloodyshadow/ShadowHunter
ini_file_validator.py
1
1651
# -*- coding: utf-8 -*- import configparser def config_file_exists(filename): config = configparser.ConfigParser() try: with open(filename) as f: config.read(f) f.close() except IOError: raise def validate_ini_file(filename, sections): try: config_fil...
mit
hpi-xnor/BMXNet
example/image-classification/common/data.py
17
7853
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
TimYi/django
tests/messages_tests/test_fallback.py
330
6950
from django.contrib.messages import constants from django.contrib.messages.storage.fallback import ( CookieStorage, FallbackStorage, ) from django.test import SimpleTestCase from .base import BaseTests from .test_cookie import set_cookie_data, stored_cookie_messages_count from .test_session import set_session_data...
bsd-3-clause
birocorneliu/youtube-dl
youtube_dl/extractor/esri.py
74
2626
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from ..compat import compat_urlparse from ..utils import ( int_or_none, parse_filesize, unified_strdate, ) class EsriVideoIE(InfoExtractor): _VALID_URL = r'https?://video\.esri\.com/watch/(?P<id>[0-9]...
unlicense
eayunstack/python-cinderclient
cinderclient/v1/volume_types.py
7
3493
# Copyright (c) 2011 Rackspace US, 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...
apache-2.0
sambitgaan/nupic
setup.py
6
4794
# ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2015, 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...
agpl-3.0
lthurlow/Network-Grapher
proj/external/matplotlib-1.2.1/build/lib.linux-i686-2.7/matplotlib/table.py
2
17111
""" Place a table below the x-axis at location loc. The table consists of a grid of cells. The grid need not be rectangular and can have holes. Cells are added by specifying their row and column. For the purposes of positioning the cell at (0, 0) is assumed to be at the top left and the cell at (max_row, max_col) i...
mit
VaibhavAgarwalVA/sympy
sympy/logic/tests/test_dimacs.py
102
3886
"""Various tests on satisfiability using dimacs cnf file syntax You can find lots of cnf files in ftp://dimacs.rutgers.edu/pub/challenge/satisfiability/benchmarks/cnf/ """ from sympy.logic.utilities.dimacs import load from sympy.logic.algorithms.dpll import dpll_satisfiable def test_f1(): assert bool(dpll_satisf...
bsd-3-clause
mattt416/neutron
neutron/tests/api/admin/test_agent_management.py
27
3851
# Copyright 2013 IBM Corp. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
apache-2.0
runjmc/maraschino
maraschino/noneditable.py
2
12120
# -*- coding: utf-8 -*- """Util funtions for Plex server settings.""" from maraschino.tools import get_setting_value, get_setting, requires_auth from maraschino.models import PlexServer, Setting from maraschino.database import db_session from plexLib import Server, User from maraschino import logger, app from flask im...
mit
with-git/tensorflow
tensorflow/contrib/boosted_trees/lib/learner/batch/ordinal_split_handler_test.py
29
44613
# Copyright 2017 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...
apache-2.0
baayso/learn-python3
basic/the_list.py
1
1216
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # list是一种有序的集合,可以随时添加和删除其中的元素 classmates = ['Michael', 'Bob', 'Tracy'] print(classmates) print(len(classmates)) print(classmates[0]) print(classmates[1]) print(classmates[2]) print(classmates[-1]) print(classmates[-2]) print(classmates[-3]) print() # 追加元素到末尾 classmates....
apache-2.0
sandeepdsouza93/TensorFlow-15712
tensorflow/python/ops/nn_batchnorm_test.py
22
28370
# 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...
apache-2.0
repotvsupertuga/repo
script.module.stream.tvsupertuga.addon/resources/lib/sources/de/pureanime.py
4
4562
# -*- 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...
gpl-2.0
lenstr/rethinkdb
test/rql_test/connections/http_support/flask/testsuite/appctx.py
558
3116
# -*- coding: utf-8 -*- """ flask.testsuite.appctx ~~~~~~~~~~~~~~~~~~~~~~ Tests the application context. :copyright: (c) 2012 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase class AppContextTestCase(Flask...
agpl-3.0
studenteternal/SoftLayer
get_list.py
1
1502
#!/usr/bin/python import yaml import SoftLayer from pprint import pprint credsFile = open("softcreds.yaml",'r') creds = yaml.load(credsFile) #print creds['username'] #print creds['api_key'] client = SoftLayer.Client(username=(creds['username']), api_key=(creds['api_key'])) n = 1 count = 1 kill_file = open("kill-...
mit
guewen/odoo
addons/mass_mailing/controllers/main.py
27
3834
import werkzeug from openerp import http, SUPERUSER_ID from openerp.http import request class MassMailController(http.Controller): @http.route('/mail/track/<int:mail_id>/blank.gif', type='http', auth='none') def track_mail_open(self, mail_id, **post): """ Email tracking. """ mail_mail_stats...
agpl-3.0
adkerr/tempest
tempest/services/compute/v3/json/interfaces_client.py
4
3359
# Copyright 2013 IBM Corp. # 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 app...
apache-2.0
donald-pinckney/EM-Simulator
EM Sim/EM SimContent/Lib/json/encoder.py
103
16014
"""Implementation of JSONEncoder """ import re try: from _json import encode_basestring_ascii as c_encode_basestring_ascii except ImportError: c_encode_basestring_ascii = None try: from _json import make_encoder as c_make_encoder except ImportError: c_make_encoder = None ESCAPE = re.compile(r'[\x00-\x...
apache-2.0
zqzhang/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_frame-src_cross-origin_multi_allowed_one-manual.py
30
2514
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "frame-src " + url1 + ...
bsd-3-clause
chrys87/orca-beep
src/orca/scripts/apps/Eclipse/script.py
4
5058
# Orca # # Copyright 2010 Informal Informatica LTDA. # Author: Jose Vilmar <vilmar@informal.com.br> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, ...
lgpl-2.1
r-icarus/openstack_microserver
openstack_dashboard/openstack/common/rpc/__init__.py
19
11823
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright 2011 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not...
apache-2.0
beia/beialand
projects/CitisimWebApp/app/src/users.py
1
2358
#!flask/bin/python from flask_bcrypt import Bcrypt from flask_login import UserMixin from main import login_manager from main import mydb import MySQLdb @login_manager.user_loader def load_user(user_id): user = User() return user.getUserByID(int(user_id)) class User(UserMixin): id = None username = No...
gpl-3.0
lucienfostier/gaffer
python/GafferUI/PathVectorDataWidget.py
8
5985
########################################################################## # # Copyright (c) 2011-2012, Image Engine Design 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: # # * Redi...
bsd-3-clause
vdt/hyde
hydeengine/templatetags/affliiates.py
62
4305
# affiliates.py from django import template from django.utils import html from django.template.defaultfilters import stringfilter from django.utils.safestring import mark_safe import urllib; if (not vars().has_key('ITUNES_AFFILIATE_ID')): ITUNES_AFFILIATE_ID = 'FU9TTuAveps' if (not vars().has_key('AMAZON_AFFILIAT...
mit
byhj/three.js
utils/exporters/blender/addons/io_three/exporter/api/__init__.py
174
1502
import os import bpy from . import object as object_, mesh, material, camera, light from .. import logger def active_object(): """ :return: The actively selected object """ return bpy.context.scene.objects.active def batch_mode(): """ :return: Whether or not the session is interactive ...
mit
joerocklin/gem5
src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py
1
2252
# Copyright (c) 2007 The Hewlett-Packard Development Company # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implemen...
bsd-3-clause
openstack/manila
manila/tests/share/drivers/dummy.py
1
36007
# Copyright 2016 Mirantis inc. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
apache-2.0
gtko/Sick-Beard
lib/guessit/transfo/guess_bonus_features.py
150
2155
#!/usr/bin/env python # -*- coding: utf-8 -*- # # GuessIt - A library for guessing information from filenames # Copyright (c) 2012 Nicolas Wack <wackou@gmail.com> # # GuessIt is free software; you can redistribute it and/or modify it under # the terms of the Lesser GNU General Public License as published by # the Free ...
gpl-3.0
dagwieers/ansible
test/units/mock/procenv.py
113
2694
# (c) 2016, Matt Davis <mdavis@ansible.com> # (c) 2016, Toshio Kuratomi <tkuratomi@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 ...
gpl-3.0
bzbarsky/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_msgutil.py
413
54959
#!/usr/bin/env python # # Copyright 2012, 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...
mpl-2.0
abhitopia/tensorflow
tensorflow/contrib/learn/python/learn/evaluable.py
64
4891
# 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...
apache-2.0
benob/icsisumm
icsisumm-primary-sys34_v1/nltk/nltk-0.9.2/nltk_contrib/classifier_tests/numrangetests.py
9
3887
# Natural Language Toolkit - RangeTest # # Author: Sumukh Ghodke <sumukh dot ghodke at gmail dot com> # # URL: <http://nltk.sf.net> from nltk_contrib.classifier import numrange as r from nltk_contrib.classifier_tests import * from nltk_contrib.classifier.exceptions import systemerror as se class RangeTestCase(unittest...
gpl-3.0
MSusik/invenio
modules/bibcheck/lib/bibcheck_task.py
2
27601
# -*- coding: utf-8 -*- ## ## This file is part of Invenio. ## Copyright (C) 2013 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) a...
gpl-2.0
chaumetteh/libsigrok
bindings/swig/doc.py
4
4686
## ## This file is part of the libsigrok project. ## ## Copyright (C) 2014 Martin Ling <martin-sigrok@earth.li> ## ## 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 Lice...
gpl-3.0
youprofit/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/layout_tests/views/metered_stream.py
157
5144
# Copyright (C) 2010, 2012 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 an...
bsd-3-clause
fabianp/scikit-learn
sklearn/utils/class_weight.py
140
7206
# Authors: Andreas Mueller # Manoj Kumar # License: BSD 3 clause import warnings import numpy as np from ..externals import six from ..utils.fixes import in1d from .fixes import bincount def compute_class_weight(class_weight, classes, y): """Estimate class weights for unbalanced datasets. Paramete...
bsd-3-clause
siliconsmiley/QGIS
python/ext-libs/pygments/lexers/_robotframeworklexer.py
76
18600
# -*- coding: utf-8 -*- """ pygments.lexers._robotframeworklexer ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for Robot Framework. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ # Copyright 2012 Nokia Siemens Networks Oyj # # License...
gpl-2.0
josegonzalez/chef-solo-cup
chef_solo_cup/log.py
2
1256
# -*- coding: utf-8 -*- import logging logging.basicConfig() def setup_custom_logger(name, args=None, output=None, formatter=None): logger = logging.getLogger(name) logger.propagate = False if logger.handlers: logger.handlers = [] has_args = args is not None and type(args) is dict is_d...
mit
porridge/apt-forktracer
lib/apt_forktracer/tests/test_config.py
1
1979
#!/usr/bin/python3 # apt-forktracer - a utility for managing package versions # Copyright (C) 2008,2010,2019 Marcin Owsiany <porridge@debian.org> # # 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...
gpl-2.0
sergiohgz/incubator-airflow
airflow/contrib/operators/bigquery_table_delete_operator.py
11
2706
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
shoopio/shoop
shuup/core/migrations/0001_initial.py
8
117821
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models import shuup.core.models import filer.fields.image import filer.fields.file import parler.models import shuup.core.models._attributes import django.db.models.deletion import shuup.core.modules.interface from decima...
agpl-3.0
gitterHQ/ansible
v2/ansible/playbook/attribute.py
1
1053
# (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...
gpl-3.0
calvingit21/h2o-2
py/testdir_0xdata_only/test_from_hdfs_hosts.py
9
2900
import unittest, time, sys, random sys.path.extend(['.','..','../..','py']) import h2o, h2o_cmd, h2o_browse as h2b, h2o_import as h2i class Basic(unittest.TestCase): def tearDown(self): h2o.check_sandbox_for_errors() @classmethod def setUpClass(cls): h2o.init(3, use_hdfs=True, hdfs_version...
apache-2.0
tum-camp/survival-support-vector-machine
doc/sphinxext/setup.py
3
1033
from __future__ import division, print_function import sys import setuptools from distutils.core import setup if sys.version_info[:2] < (2, 6) or (3, 0) <= sys.version_info[0:2] < (3, 3): raise RuntimeError("Python version 2.6, 2.7 or >= 3.3 required.") version = "0.6.dev" setup( name="numpydoc", packag...
gpl-3.0
zulip/zulip
confirmation/models.py
6
7752
# Copyright: (c) 2008, Jarek Zgoda <jarek.zgoda@gmail.com> __revision__ = "$Id: models.py 28 2009-10-22 15:03:02Z jarek.zgoda $" import datetime import secrets from base64 import b32encode from typing import Mapping, Optional, Union from urllib.parse import urljoin from django.conf import settings from django.contrib...
apache-2.0
ychen820/microblog
flask/lib/python2.7/site-packages/pip/cmdoptions.py
117
11475
""" shared options and groups The principle here is to define options once, but *not* instantiate them globally. One reason being that options with action='append' can carry state between parses. pip parse's general options twice internally, and shouldn't pass on state. To be consistent, all options will follow this d...
bsd-3-clause
whitepages/nova
nova/volume/encryptors/luks.py
30
5176
# Copyright (c) 2013 The Johns Hopkins University/Applied Physics Laboratory # 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/...
apache-2.0
abusesa/idiokit
idiokit/xmpp/jid.py
1
6351
# Module for XMPP JID processing as defined in on RFC 3920 # (http://www.ietf.org/rfc/rfc3920.txt) And RFC 3454 # (http://www.ietf.org/rfc/rfc3454.txt). # # This module was originally written using both the above RFCs and the # xmppstringprep module of the pyxmpp package # (http://pyxmpp.jajcus.net/) as well as the # t...
mit
moustakas/impy
teaching/siena_class_roster.py
1
3362
import requests #import BeautifulSoup from bs4 import BeautifulSoup import HTMLParser from HTMLParser import HTMLParser import sys import os # Open the file. r = open(sys.argv[1]) if not os.path.isdir('Detail_Class_List_files'): os.rename('Detail Class List_files', 'Detail_Class_List_files') # Try to parse the ...
gpl-2.0
jbassen/edx-platform
lms/djangoapps/commerce/__init__.py
55
1420
""" Commerce app. """ from django.conf import settings from ecommerce_api_client.client import EcommerceApiClient from eventtracking import tracker def create_tracking_context(user): """ Assembles attributes from user and request objects to be sent along in ecommerce api calls for tracking purposes. """ r...
agpl-3.0
cberry777/dd-agent
utils/ntp.py
13
1311
# (C) Datadog, Inc. 2010-2016 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import os import random # project from config import get_confd_path from util import check_yaml from utils.singleton import Singleton class NTPUtil(): __metaclass__ = Singleton DEFAULT_VERSION...
bsd-3-clause
eyeswideopen/beastArena
src/clientGui/QEnvironment.py
2
9071
# -*- coding: utf-8 -*- import sys,os from PyQt4 import QtGui,QtCore basePath = sys.argv[0].split('/') sys.path.append(os.path.abspath(sys.argv[0]).rpartition('/')[0].rpartition('/')[0]) class QEnvironment(QtGui.QWidget): """ extended by QtGui.QWidget widget for displaying the 5x5 environment of the own ...
gpl-3.0
vitan/hue
desktop/libs/hadoop/src/hadoop/cluster.py
1
7247
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
woel0007/caravel
caravel/config.py
1
5672
"""The main config file for Caravel All configuration in this file can be overridden by providing a caravel_config in your PYTHONPATH as there is a ``from caravel_config import *`` at the end of this file. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function ...
apache-2.0
raphaelmerx/django
django/views/defaults.py
339
3567
from django import http from django.template import Context, Engine, TemplateDoesNotExist, loader from django.utils import six from django.utils.encoding import force_text from django.views.decorators.csrf import requires_csrf_token # This can be called when CsrfViewMiddleware.process_view has not run, # therefore ne...
bsd-3-clause
LeartS/odoo
addons/sale_crm/wizard/__init__.py
443
1077
# -*- 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...
agpl-3.0